@syncfusion/ej2-treegrid 31.2.15 → 32.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-treegrid.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +1052 -318
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1058 -321
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +1 -10
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/package.json +5 -5
- package/src/treegrid/actions/batch-edit.js +21 -3
- package/src/treegrid/actions/context-menu.d.ts +1 -0
- package/src/treegrid/actions/context-menu.js +16 -0
- package/src/treegrid/actions/edit.d.ts +4 -1
- package/src/treegrid/actions/edit.js +56 -3
- package/src/treegrid/actions/freeze-column.js +1 -1
- package/src/treegrid/actions/rowdragdrop.js +3 -0
- package/src/treegrid/actions/selection.d.ts +226 -8
- package/src/treegrid/actions/selection.js +759 -288
- package/src/treegrid/actions/summary.js +1 -1
- package/src/treegrid/actions/virtual-scroll.js +6 -3
- package/src/treegrid/base/data.js +2 -1
- package/src/treegrid/base/treegrid-model.d.ts +16 -0
- package/src/treegrid/base/treegrid.d.ts +50 -4
- package/src/treegrid/base/treegrid.js +157 -19
- package/src/treegrid/models/column.d.ts +24 -0
- package/src/treegrid/models/column.js +12 -0
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +24 -2
- package/styles/bds-lite.scss +17 -18
- package/styles/bds.scss +18 -19
- package/styles/bootstrap-dark-lite.scss +17 -18
- package/styles/bootstrap-dark.scss +18 -19
- package/styles/bootstrap-lite.scss +17 -18
- package/styles/bootstrap.scss +18 -19
- package/styles/bootstrap4-lite.scss +17 -18
- package/styles/bootstrap4.scss +18 -19
- package/styles/bootstrap5-dark-lite.scss +17 -18
- package/styles/bootstrap5-dark.scss +18 -19
- package/styles/bootstrap5-lite.scss +18 -18
- package/styles/bootstrap5.3-lite.css +81 -1
- package/styles/bootstrap5.3-lite.scss +18 -18
- package/styles/bootstrap5.3.css +81 -1
- package/styles/bootstrap5.3.scss +19 -19
- package/styles/bootstrap5.scss +19 -19
- package/styles/fabric-dark-lite.scss +18 -18
- package/styles/fabric-dark.scss +19 -19
- package/styles/fabric-lite.scss +18 -18
- package/styles/fabric.scss +19 -19
- package/styles/fluent-dark-lite.scss +18 -18
- package/styles/fluent-dark.scss +19 -19
- package/styles/fluent-lite.scss +18 -18
- package/styles/fluent.scss +19 -19
- package/styles/fluent2-lite.css +152 -4
- package/styles/fluent2-lite.scss +18 -18
- package/styles/fluent2.css +152 -4
- package/styles/fluent2.scss +19 -19
- package/styles/highcontrast-light-lite.scss +18 -18
- package/styles/highcontrast-light.scss +19 -19
- package/styles/highcontrast-lite.scss +18 -18
- package/styles/highcontrast.scss +19 -19
- package/styles/material-dark-lite.scss +18 -18
- package/styles/material-dark.scss +19 -19
- package/styles/material-lite.scss +17 -18
- package/styles/material.scss +18 -19
- package/styles/material3-dark-lite.css +140 -1
- package/styles/material3-dark-lite.scss +18 -18
- package/styles/material3-dark.css +140 -1
- package/styles/material3-dark.scss +19 -21
- package/styles/material3-lite.css +140 -1
- package/styles/material3-lite.scss +18 -18
- package/styles/material3.css +140 -1
- package/styles/material3.scss +19 -21
- package/styles/tailwind-dark-lite.scss +18 -18
- package/styles/tailwind-dark.scss +19 -19
- package/styles/tailwind-lite.scss +18 -18
- package/styles/tailwind.scss +19 -19
- package/styles/tailwind3-lite.css +119 -1
- package/styles/tailwind3-lite.scss +18 -18
- package/styles/tailwind3.css +119 -1
- package/styles/tailwind3.scss +19 -19
- package/styles/treegrid/_all.scss +2 -2
- package/styles/treegrid/_bds-definition.scss +2 -0
- package/styles/treegrid/_bigger.scss +2 -0
- package/styles/treegrid/_bootstrap-dark-definition.scss +2 -0
- package/styles/treegrid/_bootstrap-definition.scss +2 -0
- package/styles/treegrid/_bootstrap4-definition.scss +2 -0
- package/styles/treegrid/_bootstrap5-dark-definition.scss +26 -1
- package/styles/treegrid/_bootstrap5-definition.scss +2 -0
- package/styles/treegrid/_bootstrap5.3-definition.scss +2 -0
- package/styles/treegrid/_fabric-dark-definition.scss +2 -0
- package/styles/treegrid/_fabric-definition.scss +2 -0
- package/styles/treegrid/_fluent-dark-definition.scss +27 -1
- package/styles/treegrid/_fluent-definition.scss +2 -0
- package/styles/treegrid/_fluent2-definition.scss +2 -0
- package/styles/treegrid/_highcontrast-definition.scss +2 -0
- package/styles/treegrid/_highcontrast-light-definition.scss +2 -0
- package/styles/treegrid/_layout.scss +5 -2
- package/styles/treegrid/_material-dark-definition.scss +2 -0
- package/styles/treegrid/_material-definition.scss +2 -0
- package/styles/treegrid/_material3-dark-definition.scss +26 -1
- package/styles/treegrid/_material3-definition.scss +2 -0
- package/styles/treegrid/_tailwind-dark-definition.scss +26 -1
- package/styles/treegrid/_tailwind-definition.scss +2 -0
- package/styles/treegrid/_tailwind3-definition.scss +2 -0
- package/styles/treegrid/_theme-variables.scss +1 -0
- package/styles/treegrid/bds.scss +19 -19
- package/styles/treegrid/bootstrap-dark.scss +19 -19
- package/styles/treegrid/bootstrap.scss +19 -19
- package/styles/treegrid/bootstrap4.scss +19 -19
- package/styles/treegrid/bootstrap5-dark.scss +19 -19
- package/styles/treegrid/bootstrap5.3.css +81 -1
- package/styles/treegrid/bootstrap5.3.scss +19 -19
- package/styles/treegrid/bootstrap5.scss +19 -19
- package/styles/treegrid/fabric-dark.scss +19 -19
- package/styles/treegrid/fabric.scss +19 -19
- package/styles/treegrid/fluent-dark.scss +19 -19
- package/styles/treegrid/fluent.scss +19 -19
- package/styles/treegrid/fluent2.css +152 -4
- package/styles/treegrid/fluent2.scss +19 -19
- package/styles/treegrid/highcontrast-light.scss +19 -19
- package/styles/treegrid/highcontrast.scss +19 -19
- package/styles/treegrid/icons/_bds.scss +1 -0
- package/styles/treegrid/icons/_bootstrap-dark.scss +1 -0
- package/styles/treegrid/icons/_bootstrap.scss +1 -0
- package/styles/treegrid/icons/_bootstrap4.scss +1 -0
- package/styles/treegrid/icons/_bootstrap5-dark.scss +1 -1
- package/styles/treegrid/icons/_bootstrap5.3.scss +1 -0
- package/styles/treegrid/icons/_bootstrap5.scss +1 -0
- package/styles/treegrid/icons/_fabric-dark.scss +1 -0
- package/styles/treegrid/icons/_fabric.scss +1 -0
- package/styles/treegrid/icons/_fluent-dark.scss +1 -1
- package/styles/treegrid/icons/_fluent.scss +1 -0
- package/styles/treegrid/icons/_fluent2.scss +1 -0
- package/styles/treegrid/icons/_fusionnew.scss +1 -0
- package/styles/treegrid/icons/_highcontrast-light.scss +1 -0
- package/styles/treegrid/icons/_highcontrast.scss +1 -0
- package/styles/treegrid/icons/_material-dark.scss +1 -0
- package/styles/treegrid/icons/_material.scss +1 -0
- package/styles/treegrid/icons/_material3-dark.scss +1 -1
- package/styles/treegrid/icons/_material3.scss +1 -0
- package/styles/treegrid/icons/_tailwind-dark.scss +1 -0
- package/styles/treegrid/icons/_tailwind.scss +1 -0
- package/styles/treegrid/icons/_tailwind3.scss +1 -0
- package/styles/treegrid/material-dark.scss +19 -19
- package/styles/treegrid/material.scss +19 -19
- package/styles/treegrid/material3-dark.css +140 -1
- package/styles/treegrid/material3-dark.scss +19 -20
- package/styles/treegrid/material3.css +140 -1
- package/styles/treegrid/material3.scss +19 -20
- package/styles/treegrid/tailwind-dark.scss +19 -19
- package/styles/treegrid/tailwind.scss +19 -19
- package/styles/treegrid/tailwind3.css +119 -1
- package/styles/treegrid/tailwind3.scss +19 -19
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-treegrid.min.js
|
|
3
|
-
* version : 31.2.15
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
|
-
this.ej=this.ej||{},this.ej.treegrid=function(e,t,i,r,n,o){"use strict";function a(e){if(e.treeGrid&&e.treeGrid.isGantt)return!!e.taskFields.hasChildMapping&&(e.dataSource instanceof n.DataManager&&((t=e.dataSource.adaptor)instanceof n.ODataAdaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.UrlAdaptor));if(e.dataSource instanceof n.DataManager){var t=e.dataSource.adaptor;return t instanceof n.ODataAdaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.UrlAdaptor}return!1}function s(e){return!!(e.dataSource&&"result"in e.dataSource)}function d(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function l(e){return!((t.isNullOrUndefined(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function p(e){for(var t=[],r=0,n=Object.keys(e).length;r<n;r++)i.getObject("hasChildRecords",e[parseInt(r.toString(),10)])&&t.push(e[parseInt(r.toString(),10)]);return t}function h(e,i,r){var n,o=t.isNullOrUndefined(i.parentItem)?null:m(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||t.isNullOrUndefined(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||(n=m(e,o.parentItem.uniqueID),n&&e.initialRender&&!t.isNullOrUndefined(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||h(e,n)))):(o.expanded=!1,!1))}function c(e){var i=[];if(t.isNullOrUndefined(e)||!e.hasChildRecords&&!t.isNullOrUndefined(e.childRecords)&&!e.childRecords.length)return[];if(!t.isNullOrUndefined(e.childRecords))for(var r=e.childRecords.filter(function(e){return!e.isSummaryRow}),n=0,o=Object.keys(r).length;n<o;n++)i.push(r[parseInt(n.toString(),10)]),(r[parseInt(n.toString(),10)].hasChildRecords||!t.isNullOrUndefined(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(c(r[parseInt(n.toString(),10)])));return i}function u(e){if(a(e)){var i=e.dataSource;return!t.isNullOrUndefined(i.ready)}return!0}function g(e){for(var t,i,r=[],n=0;e&&n<e.length;n++){i=Object.keys(e[parseInt(n.toString(),10)]),t={};for(var o=0;o<i.length;o++)t[i[parseInt(o.toString(),10)]]=e[parseInt(n.toString(),10)][i[parseInt(o.toString(),10)]];r.push(t)}return r}function f(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function m(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function y(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}function S(e,i,r,o,a,s,d){var l,p,h,c=e.value,u=e.action,f=i.grid.getPrimaryKeyFieldNames()[0],y=i.dataSource instanceof n.DataManager?i.dataSource.dataSource.json:i.dataSource,S=i.grid.dataSource,R=[],x=c,C=!1;if("Batch"===i.editSettings.mode&&(h=i.grid.editModule.getBatchChanges()),"add"===u||"batchsave"===u&&"Batch"===i.editSettings.mode&&h.addedRecords.length){var b=v(e,y,i,r,o,a,d);c=b.value,C=b.isSkip}if(c instanceof Array?R=g(c):R.push(t.extend({},c)),!C&&("add"!==u||"Top"!==i.editSettings.newRowPosition&&"Bottom"!==i.editSettings.newRowPosition))for(var D=0;D<R.length;D++){"object"==typeof R[parseInt(D.toString(),10)][""+f]&&(R[parseInt(D.toString(),10)]=R[parseInt(D.toString(),10)][""+f]);var M=R[parseInt(D.toString(),10)].taskData?Object.keys(R[parseInt(D.toString(),10)].taskData):Object.keys(R[parseInt(D.toString(),10)]);l=0===y.length&&1===S.length?S.length:y.length;for(;l--&&l>=0&&"break"!==function(){if(0===y.length&&1===S.length&&S[parseInt(l.toString(),10)][""+f]===R[parseInt(D.toString(),10)][""+f]||y[parseInt(l.toString(),10)][""+f]===R[parseInt(D.toString(),10)][""+f]){if("delete"!==u){if("edit"===u){for(p=0;p<M.length;p++)if(Object.prototype.hasOwnProperty.call(y[parseInt(l.toString(),10)],M[parseInt(p.toString(),10)])&&("Cell"!==i.editSettings.mode||!t.isNullOrUndefined(h)&&0===h.changedRecords.length||M[parseInt(p.toString(),10)]===s)){var e=m(i,R[parseInt(D.toString(),10)].uniqueID);y[parseInt(l.toString(),10)][M[parseInt(p.toString(),10)]]=R[parseInt(D.toString(),10)][M[parseInt(p.toString(),10)]],e&&e.taskData&&(e.taskData[M[parseInt(p.toString(),10)]]=e[M[parseInt(p.toString(),10)]]=y[parseInt(l.toString(),10)][M[parseInt(p.toString(),10)]])}}else if("add"===u||"batchsave"===u){var n=void 0;"Child"===i.editSettings.newRowPosition?0===y.length&&1===S.length?y.push(x.taskData):r?(x.taskData[""+i.parentIdMapping]=y[parseInt(l.toString(),10)][""+i.idMapping],y.splice(l+1,0,x.taskData)):(Object.prototype.hasOwnProperty.call(y[parseInt(l.toString(),10)],i.childMapping)||(y[parseInt(l.toString(),10)][""+i.childMapping]=[]),y[parseInt(l.toString(),10)][""+i.childMapping].push(x.taskData),I(f,y[parseInt(l.toString(),10)],u,i,r,x)):"Below"===i.editSettings.newRowPosition?(y.splice(l+1,0,x.taskData),t.isNullOrUndefined(x.parentItem)||I(f,y[l+1],u,i,r,x)):o?"Above"===i.editSettings.newRowPosition&&(y.splice(l,0,x.taskData),t.isNullOrUndefined(x.parentItem)||I(f,y[parseInt(l.toString(),10)],u,i,r,x)):(n=0,y.splice(n,0,x.taskData))}return"break"}var a=y[parseInt(l.toString(),10)];if(y.splice(l,1),r){if(!t.isNullOrUndefined(a[""+i.parentIdMapping]))for(var d=i.flatData.filter(function(e){return e[""+i.idMapping]===a[""+i.parentIdMapping]})[0],c=d?d[""+i.childMapping]:[],g=c.length-1;g>=0;g--)if(c[parseInt(g.toString(),10)][""+i.idMapping]===a[""+i.idMapping]){i.enableImmutableMode||d.childRecords.length!==d.Children.length||d.childRecords.splice(g,1),c.splice(g,1),c.length||(d.hasChildRecords=!1,I(f,d,u,i,r));break}return"break"}}else t.isNullOrUndefined(y[parseInt(l.toString(),10)][""+i.childMapping])||w(y[parseInt(l.toString(),10)][""+i.childMapping],R[parseInt(D.toString(),10)],u,f,i,r,x,s)&&I(f,y[parseInt(l.toString(),10)],u,i,r)}(););}}function v(e,i,r,n,o,a,s){var d,l=!1,p=r.grid.getCurrentViewRecords();switch(d=t.extend({},e.value),d=f(d),r.editSettings.newRowPosition){case"Top":i.unshift(d),l=!0;break;case"Bottom":i.push(d),l=!0;break;case"Above":d=f(t.isNullOrUndefined(s)?0===p.length?d:d=t.extend({},p[o+1]):d=t.extend({},s));break;case"Below":case"Child":if(t.isNullOrUndefined(s)){var h=r.grid.getPrimaryKeyFieldNames()[0],c=p.length>0?p[parseInt(o.toString(),10)]:[];d=f(d=!t.isNullOrUndefined(c)&&c[""+h]===e.value[""+h]||-1!==a&&0!==i.length?t.extend({},c):t.extend({},e.value));r.editModule.internalProperties.taskData=d}else d=f(d=t.extend({},s));-1===a&&(i.unshift(d),l=!0)}return{value:d,isSkip:l}}function w(e,i,r,n,o,a,s,d){for(var l=!1,p=e.length;p--&&p>=0;)if(e[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&e[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h=Object.keys(i),c=m(o,i.uniqueID),u=0;u<h.length;u++)if(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],h[parseInt(u.toString(),10)])&&("Cell"!==o.editSettings.mode||h[parseInt(u.toString(),10)]===d)&&(c[h[parseInt(u.toString(),10)]]=c.taskData[h[parseInt(u.toString(),10)]]=e[parseInt(p.toString(),10)][h[parseInt(u.toString(),10)]]=i[h[parseInt(u.toString(),10)]],"Normal"===o.grid.editSettings.mode&&"Cell"===o.editSettings.mode&&!t.isNullOrUndefined(o.grid.editModule))){o.grid.editModule.editModule.editRowIndex=i.index,o.grid.editModule.editModule.updateCurrentViewData(i)}break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?a?(s[""+o.parentIdMapping]=e[parseInt(p.toString(),10)][o.idMapping],e.splice(p+1,0,s),I(n,e[parseInt(p.toString(),10)],r,o,a,s)):(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],o.childMapping)||(e[parseInt(p.toString(),10)][o.childMapping]=[]),e[parseInt(p.toString(),10)][o.childMapping].push(s.taskData),I(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(e.splice(p,0,s.taskData),t.isNullOrUndefined(s.parentItem)||I(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(e.splice(p+1,0,s.taskData),t.isNullOrUndefined(s.parentItem)||I(n,e[parseInt(p.toString(),10)],r,o,a,s)):(e.splice(p,1),e.length||(l=!0))}else t.isNullOrUndefined(e[parseInt(p.toString(),10)][o.childMapping])||w(e[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&I(n,e[parseInt(p.toString(),10)],r,o,a);return l}function I(e,i,r,o,a,s){if("Above"!==o.editSettings.newRowPosition&&"Below"!==o.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||t.isNullOrUndefined(s.parentItem)){var d,l=o.grid.getCurrentViewRecords();if(l.map(function(t,r){if(t[""+e]===i[""+e])return void(d=r)}),o.enableVirtualization&&t.isNullOrUndefined(d)){var p=t.getValue("uniqueIDCollection."+s.parentUniqueID,o);i=p}if(t.isNullOrUndefined(d)||(i=l[parseInt(d.toString(),10)]),o.enableVirtualization&&t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&(i=t.getValue("uniqueIDCollection."+s.parentUniqueID,o)),a||t.isNullOrUndefined(i.childRecords)||!i.childRecords.length?i.hasChildRecords=!1:i.hasChildRecords=!0,"add"===r||"batchsave"===r){i.expanded=!0,i.hasChildRecords=!0,o.sortSettings.columns.length&&t.isNullOrUndefined(s)&&(s=l.filter(function(e){return e.parentUniqueID===i.uniqueID?e:null}));var h=s?s instanceof Array?s[0]:s:l[d+1];"Below"!==o.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(i,"childRecords")?t.isNullOrUndefined(s)||i[""+e]===s[""+e]||i.childRecords.some(function(e){return e.uniqueID===s.uniqueID})||i.childRecords.push(s):i.childRecords=[],-1===i.childRecords.indexOf(h)&&i[""+e]!==s[""+e]&&i.childRecords.unshift(h),a&&(Object.prototype.hasOwnProperty.call(i,o.childMapping)||(i[o.childMapping]=[]),-1===i[""+o.childMapping].indexOf(h)&&i[""+e]!==s[""+e]&&i[o.childMapping].unshift(h)))}for(var c=o.grid.getPrimaryKeyFieldNames()[0],u=o.grid.dataSource instanceof n.DataManager?o.grid.dataSource.dataSource.json:o.grid.dataSource,g=0;g<u.length;g++)if(u[parseInt(g.toString(),10)][""+c]===i[""+c]){u[parseInt(g.toString(),10)]=i;break}o.grid.setRowData(e,i);var f=o.getRowByIndex(d);"Batch"===o.editSettings.mode&&(f="add"===r?o.getRows()[o.grid.getCurrentViewRecords().indexOf(i)]:o.getRows()[o.grid.getRowIndexByPrimaryKey(i[""+e])]);var y=void 0;if((o.frozenRows||o.getFrozenColumns())&&(y=o.getRowByIndex(d)),!o.enableVirtualization&&!t.isNullOrUndefined(f)||!t.isNullOrUndefined(y)){var S=o.treeColumnIndex;o.allowRowDragAndDrop&&o.enableImmutableMode&&(S+=1),o.renderModule.cellRender({data:i,cell:f.cells[parseInt(S.toString(),10)]?f.cells[parseInt(S.toString(),10)]:y.cells[S-o.getFrozenColumns()],column:o.grid.getColumns()[o.treeColumnIndex],requestType:r}),(o.enableImmutableMode&&"indenting"===o.action||"outdenting"===o.action)&&o.renderModule.RowModifier({data:i,row:f})}}else m(o,s.parentItem.uniqueID).childRecords.push(s)}var R=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),x=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},C=function(){function e(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},t.merge(this,e)}return e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)if(this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]){this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)}},e}(),b=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),x([t.Property(null)],i.prototype,"columns",void 0),i}(C),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return R(t,e),t}(b),M=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),O=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return M(i,e),O([t.Property("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),A=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),E=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),E([t.Property()],i.prototype,"field",void 0),E([t.Property()],i.prototype,"operator",void 0),E([t.Property()],i.prototype,"value",void 0),E([t.Property()],i.prototype,"matchCase",void 0),E([t.Property()],i.prototype,"ignoreAccent",void 0),E([t.Property()],i.prototype,"predicate",void 0),E([t.Property({})],i.prototype,"actualFilterValue",void 0),E([t.Property({})],i.prototype,"actualOperator",void 0),E([t.Property()],i.prototype,"type",void 0),E([t.Property()],i.prototype,"ejpredicate",void 0),E([t.Property()],i.prototype,"uid",void 0),E([t.Property()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),E([t.Collection([],N)],i.prototype,"columns",void 0),E([t.Property("FilterBar")],i.prototype,"type",void 0),E([t.Property()],i.prototype,"mode",void 0),E([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),E([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),E([t.Property()],i.prototype,"operators",void 0),E([t.Property(!1)],i.prototype,"ignoreAccent",void 0),E([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),k=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),q=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),q([t.Property("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),B=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),V="https://ej2.syncfusion.com/documentation/treegrid",z="https://ej2.syncfusion.com/documentation",L=!1,F=function(e){function r(t){return i.Grid.Inject(i.Logger),e.call(this,t)||this}return B(r,e),r.prototype.getModuleName=function(){return"logger"},r.prototype.log=function(e,r){e instanceof Array||(e=[e]);for(var n=e,o=0;o<n.length;o++){var a=i.detailLists[n[parseInt(o.toString(),10)]],s=a.check(r,this.parent);if(s.success){var d=a.generateMessage(r,this.parent,s.options);d=d.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),L&&"primary_column_missing"===n[parseInt(o.toString(),10)]&&(d=d.replace("Editing","Row DragAndDrop"),L=!1);var l=d.indexOf("https"),p=d.substring(l);"module_missing"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/modules"):"primary_column_missing"===n[parseInt(o.toString(),10)]||"selection_key_missing"===n[parseInt(o.toString(),10)]?d=d.replace(p,z+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/edit"):"virtual_height"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/virtual"):"check_datasource_columns"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/columns"):"locale_missing"===n[parseInt(o.toString(),10)]&&(d=d.replace(p,V+"/global-local/#localization")),"datasource_syntax_mismatch"===n[parseInt(o.toString(),10)]?t.isNullOrUndefined(this.treeGridObj)||t.isNullOrUndefined(this.treeGridObj.dataStateChange)||console[a.logType](d):console[a.logType](d)}}},r.prototype.treeLog=function(e,t,i){this.treeGridObj=i,e instanceof Array||(e=[e]);var r=e;i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(L=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=j[r[parseInt(n.toString(),10)]],a=o.check(t,i);if(a.success){var s=o.generateMessage(t,i,a.options);console[o.logType](s)}}},r}(i.Logger),j={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return(t.isNullOrUndefined(i.idMapping)&&t.isNullOrUndefined(i.childMapping)&&t.isNullOrUndefined(i.parentIdMapping)||!t.isNullOrUndefined(i.idMapping)&&t.isNullOrUndefined(i.parentIdMapping)||t.isNullOrUndefined(i.idMapping)&&!t.isNullOrUndefined(i.parentIdMapping))&&(r={success:!0}),r},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+z+"/api/treegrid#childmapping\n"+z+"/api/treegrid#idmapping\n"+z+"/api/treegrid#$parentidmapping"}}},_=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),H=function(e){function i(t,i){var r=e.call(this,t.grid,i)||this;return r.treeCopyContent="",r.copiedUniqueIdCollection=[],r.treeGridParent=t,r.serviceLocator=i,r}return _(i,e),i.prototype.setCopyData=function(i){var r=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";var n=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var o=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),a=0;a<o.length;a++){a>0&&(this.treeCopyContent+="\n");var s=o[parseInt(a.toString(),10)];if(!n[s].classList.contains("e-summaryrow")){var d=[].slice.call(n[s].querySelectorAll(".e-rowcell")),l=this.treeGridParent.getSelectedRecords()[parseInt(a.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(l)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(r,s,n,i,a),this.getCopyData(d,!1,"\t",i),this.treeCopyContent+=this.copyContent,this.copiedUniqueIdCollection.push(l),this.copyContent="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(r,o[parseInt(a.toString(),10)],n,i))}}if(i){var p=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText});this.getCopyData(p,!1,"\t",i),this.treeCopyContent=this.copyContent+"\n"+this.treeCopyContent}var h={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger("beforeCopy",h),h.cancel)return;this.clipBoardTextArea.value=this.copyContent=h.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent=""}else e.prototype.setCopyData.call(this,i)}},i.prototype.parentContentData=function(e,i,r,n,o){if(!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem))for(var a=e[parseInt(i.toString(),10)].parentItem.level,s=0;s<a+1;s++)for(var d=0;d<e.length;d++)if(!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)&&e[parseInt(d.toString(),10)].uniqueID===e[parseInt(i.toString(),10)].parentItem.uniqueID){i=d;var l=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),p=e[parseInt(d.toString(),10)].uniqueID;if(-1===this.copiedUniqueIdCollection.indexOf(p)){this.getCopyData(l,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this.copyContent+"\n":this.copyContent+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(p),this.copyContent="";break}}},i.prototype.copy=function(t){e.prototype.copy.call(this,t)},i.prototype.paste=function(t,i,r){e.prototype.paste.call(this,t,i,r)},i.prototype.getModuleName=function(){return"clipboard"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.childContentData=function(e,i,r,n){if(e[parseInt(i.toString(),10)].hasChildRecords)for(var o=e[parseInt(i.toString(),10)].childRecords,a=0;a<o.length;a++)for(var s=0;s<e.length;s++)if(!t.isNullOrUndefined(o[parseInt(a.toString(),10)].uniqueID)&&e[parseInt(s.toString(),10)].uniqueID===o[parseInt(a.toString(),10)].uniqueID){if(!t.isNullOrUndefined(r[parseInt(s.toString(),10)])&&!r[parseInt(s.toString(),10)].classList.contains("e-summaryrow")){var d=[].slice.call(r[parseInt(s.toString(),10)].querySelectorAll(".e-rowcell")),l=e[parseInt(s.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(l)&&(this.getCopyData(d,!1,"\t",n),this.treeCopyContent+="\n"+this.copyContent,this.copyContent="",this.copiedUniqueIdCollection.push(l),this.childContentData(e,s,r,n))}break}},i}(i.Clipboard),G=function(){function e(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.checkboxSelection=function(e){var r,n,o=i.getObject("target",e),s=i.parentsUntil(o,"e-checkbox-wrapper");if(s&&s.querySelectorAll(".e-treecheckselect").length>0){n=s.querySelector('input[type="checkbox"]');var d=[];d.push(o.closest("tr").rowIndex),this.selectCheckboxes(d),this.triggerChkChangeEvent(n,n.nextElementSibling.classList.contains("e-check"),o.closest("tr"))}else if(s&&s.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var l=!s.querySelector(".e-frame").classList.contains("e-check")&&!s.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(l),n=s.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(n,l,o.closest("tr"))}!t.isNullOrUndefined(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(this.parent)&&this.parent.parentQuery.length>0&&((r=this.parent.query.queries).push.apply(r,this.parent.parentQuery),this.parent.parentQuery=[])},e.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],n={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger("checkboxChange",n)},e.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].showCheckbox&&(e=i[parseInt(r.toString(),10)].uid);for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,o=0;o<n;o++)this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(o.toString(),10)].getAttribute("data-mappinguid")===e&&(t=o);return t},e.prototype.headerCheckbox=function(){if(this.columnIndex=this.getCheckboxcolumnIndex(),this.columnIndex>-1&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length){var e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}});(n=r.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),n.insertBefore(i.cloneNode(),n.firstChild),t.isNullOrUndefined(e)||e.insertBefore(n,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var n=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0],o=n.querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&o&&this.headerSelection(o)}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),n=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var o=!t.isNullOrUndefined(n.checkboxState)&&"uncheck"!==n.checkboxState,a=r.createCheckBox(this.parent.createElement,!1,{checked:o,label:" "});if(a.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(a.querySelector(".e-frame").style.width="18px"),"indeterminate"===n.checkboxState){var s=a.querySelectorAll(".e-frame")[0];t.removeClass([s],["e-check","e-stop","e-uncheck"]),a.querySelector(".e-frame").classList.add("e-stop")}return a.insertBefore(i.cloneNode(),a.firstChild),a},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if(t.isNullOrUndefined(r)){var n=this.parent.createElement("span",{className:"e-treecheckbox"}),o=e.cell.innerHTML;e.cell.innerHTML="",n.innerHTML=o;var a=this.parent.createElement("div",{className:"e-treecheckbox-container"});a.appendChild(i),a.appendChild(n),e.cell.appendChild(a)}else e.cell.querySelector(".e-hierarchycheckbox")||r.insertBefore(i,r.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){if(t.isNullOrUndefined(e)){this.parent.trigger("actionFailure",{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."})}for(var i=0;i<e.length;i++){var r=this.parent.getCurrentViewRecords()[e[parseInt(i.toString(),10)]],n=m(this.parent,r.uniqueID),o="uncheck"===(r=n).checkboxState?"check":"uncheck";r.checkboxState=o;for(var a=Object.keys(r),s=0;s<a.length;s++)Object.prototype.hasOwnProperty.call(n,a[parseInt(s.toString(),10)])&&(n[a[parseInt(s.toString(),10)]]=r[a[parseInt(s.toString(),10)]]);this.traverSelection(r,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},e.prototype.traverSelection=function(e,i,r){var n=0;if(this.updateSelectedItems(e,i),!r&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy){var o=e.childRecords;!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(o=this.getFilteredChildRecords(o)),n=o.length;for(var a=0;a<n;a++)o[parseInt(a.toString(),10)].isSummaryRow||(o[parseInt(a.toString(),10)].hasChildRecords?this.traverSelection(o[parseInt(a.toString(),10)],i,!0):this.updateSelectedItems(o[parseInt(a.toString(),10)],i))}},e.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return t.parent.filterModule.filteredResult.indexOf(e)>-1})},e.prototype.updateParentSelection=function(e){var i=0,r=[],n=m(this.parent,e.uniqueID);n&&n.childRecords&&(r=n.childRecords),!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(r=this.getFilteredChildRecords(r)),i=r&&r.length;var o=0,a=0;if(!t.isNullOrUndefined(n)){for(var s=0;s<r.length;s++){var d=m(this.parent,r[parseInt(s.toString(),10)].uniqueID);t.isNullOrUndefined(d)||("indeterminate"===d.checkboxState?o++:"check"===d.checkboxState&&a++)}o>0||a>0&&a!==i?n.checkboxState="indeterminate":(0!==a||n.hasFilteredChildRecords&&!t.isNullOrUndefined(n.hasFilteredChildRecords)||t.isNullOrUndefined(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==n.checkboxState)&&(0===a&&0===o||0===a&&n.hasFilteredChildRecords&&!t.isNullOrUndefined(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===n.checkboxState)?n.checkboxState="uncheck":n.checkboxState="check",this.updateSelectedItems(n,n.checkboxState),n.parentItem&&this.updateParentSelection(n.parentItem)}},e.prototype.headerSelection=function(e){var i=this,r=0,n=!1;if(!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var o=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=o),this.parent.grid.searchSettings.key.length?this.searchingRecords=o:this.filteredList!==o?(this.filteredList=o,n=!0):n=!1}this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!t.isNullOrUndefined(e)&&(this.filteredList=this.searchingRecords));var s;if(s=!t.isNullOrUndefined(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0?this.filteredList:!t.isNullOrUndefined(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,s=a(this.parent)?this.parent.getCurrentViewRecords():s,!t.isNullOrUndefined(e))for(var d=0;d<s.length;d++)if(e){if("check"===s[parseInt(d.toString(),10)].checkboxState)continue;if(n)continue;s[parseInt(d.toString(),10)].checkboxState="check",this.updateSelectedItems(s[parseInt(d.toString(),10)],s[parseInt(d.toString(),10)].checkboxState)}else this.selectedItems.indexOf(s[parseInt(d.toString(),10)])>-1&&(s[parseInt(d.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(s[parseInt(d.toString(),10)],s[parseInt(d.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(s[parseInt(d.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],s.filter(function(e){e.checkboxState="uncheck",i.updateSelectedItems(e,e.checkboxState)})),r=this.selectedItems.length;var l=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];r>0&&s.length>0?r===s.length||e?(t.removeClass([l],["e-stop"]),l.classList.add("e-check")):(t.removeClass([l],["e-check"]),l.classList.add("e-stop")):t.removeClass([l],["e-check","e-stop"])},e.prototype.updateSelectedItems=function(e,i){var r,n,o=this.parent.grid.currentViewData.filter(function(t){return t.uniqueID===e.uniqueID}),a=this.parent.grid.currentViewData.indexOf(o[0]),s=m(this.parent,e.uniqueID),d=this.parent.getRows()[parseInt(a.toString(),10)];if(a>-1){var l=void 0;(this.parent.frozenRows||this.parent.getFrozenColumns())&&(l=this.parent.getDataRows()[parseInt(a.toString(),10)]),n=d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]:l.querySelectorAll(".e-hierarchycheckbox .e-frame")[0],t.isNullOrUndefined(n)||t.removeClass([n],["e-check","e-stop","e-uncheck"])}if(r=s,t.isNullOrUndefined(r)&&(r=e),r.checkboxState=i,"check"===i&&t.isNullOrUndefined(e.isSummaryRow))-1!==a&&-1===this.selectedIndexes.indexOf(a)&&this.selectedIndexes.push(a),-1===this.selectedItems.indexOf(r)&&-1!==a&&!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1!==this.selectedItems.indexOf(r)||t.isNullOrUndefined(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&t.isNullOrUndefined(this.parent.filterModule)&&this.selectedItems.push(r);else if(("uncheck"===i||"indeterminate"===i)&&t.isNullOrUndefined(e.isSummaryRow)){var p=this.selectedItems.indexOf(r);if(-1!==p&&this.selectedItems.splice(p,1),-1!==this.selectedIndexes.indexOf(a)){var h=this.selectedIndexes.indexOf(a);this.selectedIndexes.splice(h,1)}}var c="indeterminate"===i?"e-stop":"e-"+i;a>-1&&(t.isNullOrUndefined(n)||(n.classList.add(c),d.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===i?"true":"uncheck"===i?"false":"mixed")))},e.prototype.updateGridActions=function(e){var i,r,n=this,o=e.requestType;if(d(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===o||"paging"===o){var s=this.parent.grid.getRows();r=(i=this.parent.getCurrentViewRecords()).length,this.selectedIndexes=[];for(p=0;p<r;p++)s[parseInt(p.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(p.toString(),10)],i[parseInt(p.toString(),10)].checkboxState)}else if("delete"===o||"add"===e.action){var l=[];"delete"===o?l=e.data:l.push(e.data);for(var p=0;p<l.length;p++){if("delete"===o){var h=this.parent.flatData.indexOf(l[parseInt(p.toString(),10)]),u=this.selectedIndexes.indexOf(h);this.selectedIndexes.splice(u,1),this.updateSelectedItems(l[parseInt(p.toString(),10)],"uncheck")}t.isNullOrUndefined(l[parseInt(p.toString(),10)].parentItem)||this.updateParentSelection(l[parseInt(p.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===o||"searching"===o||"refresh"===o&&!a(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],(i=!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(n.parent.enableVirtualization){e.hasChildRecords&&e.childRecords.length>0?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState);var i=c(e);i=n.getFilteredChildRecords(i);for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)].hasChildRecords?n.updateParentSelection(i[parseInt(r.toString(),10)]):i[parseInt(r.toString(),10)].hasChildRecords||t.isNullOrUndefined(i[parseInt(r.toString(),10)])||n.updateSelectedItems(i[parseInt(r.toString(),10)],i[parseInt(r.toString(),10)].checkboxState)}else e.hasChildRecords?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState)}),this.headerSelection());else"filtering"!==o&&"searching"!==o&&"refresh"!==o||a(this.parent)||(this.selectedItems=[],this.selectedIndexes=[])},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}(),Q=function(){function e(e){this.parent=e,i.Grid.Inject(i.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on("printGrid-Init",this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off("printGrid-Init",this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var r=i.getObject("printgrid",e),n=i.getObject("element",e);r.addEventListener("queryCellInfo",this.parent.grid.queryCellInfo),r.addEventListener("rowDataBound",this.parent.grid.rowDataBound),r.addEventListener("beforeDataBound",this.parent.grid.beforeDataBound),t.addClass([n],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),K=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),W=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return K(i,e),W([t.Property()],i.prototype,"fields",void 0),W([t.Property(!1)],i.prototype,"ignoreCase",void 0),W([t.Property("contains")],i.prototype,"operator",void 0),W([t.Property()],i.prototype,"key",void 0),W([t.Property()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),J=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),X=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},$=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return J(i,e),X([t.Property("Row")],i.prototype,"mode",void 0),X([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),X([t.Property("Single")],i.prototype,"type",void 0),X([t.Property(!1)],i.prototype,"persistSelection",void 0),X([t.Property("Default")],i.prototype,"checkboxMode",void 0),X([t.Property(!1)],i.prototype,"checkboxOnly",void 0),X([t.Property(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Z=function(){function e(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}return e.prototype.RowModifier=function(e){if(e.data){var r=e.data,n=r.parentItem;if(!t.isNullOrUndefined(r.parentItem)&&!l(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||a(this.parent)&&!u(this.parent))&&(this.parent.initialRender&&(!(t.isNullOrUndefined(n[this.parent.expandStateMapping])||n[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!h(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!t.isNullOrUndefined(e.row)){this.parent.toggleRowVisibility(e.row,"e-childrow-hidden");var o=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||t.isNullOrUndefined(e.row.getAttribute("data-uid"))||(o.filter(function(t){return t.uid===e.row.getAttribute("data-uid")})[0].visible=!1)}if(a(this.parent)&&!u(this.parent)){var s=this.parent,d=this.parent.getCurrentViewRecords().filter(function(e){return t.getValue(s.idMapping,e)===t.getValue(s.parentIdMapping,r)});if(d.length>0&&!d[0].isSummaryRow&&!t.isNullOrUndefined(e.row)){var p=d[0].expanded?"e-childrow-visible":"e-childrow-hidden";this.parent.toggleRowVisibility(e.row,p)}}i.getObject("isSummaryRow",e.data)&&t.addClass([e.row],"e-summaryrow"),t.isNullOrUndefined(e.row)||(e.row.querySelector(".e-treegridexpand")?e.row.setAttribute("aria-expanded","true"):e.row.querySelector(".e-treegridcollapse")&&e.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&(t.isNullOrUndefined(r.parentItem)||this.parent.toggleRowVisibility(e.row,"e-childrow-hidden")));if(this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight){this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==e.data.uniqueID||t.isNullOrUndefined(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var c=this;c.parent.renderReactTemplates(function(){c.parent.trigger("rowDataBound",e)})}else this.parent.trigger("rowDataBound",e)}},e.prototype.cellRender=function(e){if(e.data){var r,n,o=this.parent.grid,s=e.data,d=t.isNullOrUndefined(s.filterLevel)?s.level:s.filterLevel,l=0,p=this.parent.getColumnByUid(e.column.uid),c=s.isSummaryRow,u=this.parent.getFrozenColumns();r=t.isNullOrUndefined(s.parentItem)?s.index:s.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):o.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!t.isNullOrUndefined(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var g=t.createElement("div",{className:"e-treecolumn-container"}),f=t.createElement("span",{className:"e-icons e-none"});f.style.width="10px",f.style.display="inline-block";for(var m=0;m<d;m++)l+=10,g.appendChild(f.cloneNode());var y=t.isNullOrUndefined(s.hasFilteredChildRecords)?s.hasChildRecords:s.hasFilteredChildRecords;if(y&&!t.isNullOrUndefined(s.childRecords)&&(y=this.parent.isFromGantt&&this.parent.loadChildOnDemand?s.hasChildRecords:!(0===s.childRecords.length)),y){t.addClass([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",s.expanded?"true":"false");var S=t.createElement("span",{className:"e-icons"}),v=void 0;if(this.parent.initialRender)v=s.expanded&&(t.isNullOrUndefined(s[this.parent.expandStateMapping])||s[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll;else if(v=!(!s.expanded||!h(this.parent,s,this.parent.grid.getCurrentViewRecords())),"Cell"===this.parent.editSettings.mode&&!a(this.parent)){var w=this.parent.flatData.find(function(e){return e.uniqueID===s.uniqueID});t.isNullOrUndefined(w)||(v=s.expanded!==w.expanded?w.expanded:s.expanded)}t.addClass([S],v?"e-treegridexpand":"e-treegridcollapse"),l+=18,g.appendChild(S),f.style.width="4px",l+=7,g.appendChild(f.cloneNode())}else(d||!d&&!s.level)&&(l+=20,g.appendChild(f.cloneNode()),g.appendChild(f.cloneNode()));n=t.createElement("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(n.style.width="Calc(100% - "+l+"px)"),t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level),this.updateTreeCell(e,n),g.appendChild(n),e.cell.appendChild(g)}if(o.getFrozenLeftColumnsCount()>0||o.getFrozenRightColumnsCount()>0){var I=o.getFrozenRightColumns(),R=o.getFrozenLeftColumns(),x=o.getMovableColumns();I.length>0&&I[0].field===e.column.field?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):R.length>0&&R[0].field===e.column.field?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):x.length>0&&x[0].field===e.column.field&&t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level)}else u>this.parent.treeColumnIndex&&u>0&&o.getColumnIndexByUid(e.column.uid)===u?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):u<this.parent.treeColumnIndex&&u>0&&(o.getColumnIndexByUid(e.column.uid)===u||o.getColumnIndexByUid(e.column.uid)===u-1)?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):u===this.parent.treeColumnIndex&&u>0&&o.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1&&t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level);if(!t.isNullOrUndefined(p)&&p.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var C=e.cell.querySelectorAll(".e-frame")[0];l+=parseInt(C.style.width,16),l+=10,(n=o.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+l+"px)"}if(c){t.addClass([e.cell],"e-summarycell");var b=i.getObject(e.column.field,e.data);b=t.isNullOrUndefined(b)?null:b,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=b:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=b}this.parent.args=e;var D=t.getValue("columnModel",this.parent)[this.parent.treeColumnIndex];if(t.isNullOrUndefined(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger("queryCellInfo",e);else if(this.parent.isReact&&D.field!==e.column.field){var M=this;M.parent.renderReactTemplates(function(){M.parent.trigger("queryCellInfo",e)})}}},e.prototype.updateTreeCell=function(e,r){var n=t.getValue("columnModel",this.parent)[this.parent.treeColumnIndex],o=e.column.index;t.isNullOrUndefined(n.field)&&e.cell.setAttribute("aria-colindex",o+1+""),n.field!==e.column.field||t.isNullOrUndefined(n.template)||(e.column.template=n.template,e.column.templateFn=i.templateCompiler(e.column.template),e.cell.classList.add("e-templatecell"));var a=null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML:e.cell.innerHTML;if("object"==typeof e.column.template&&this.templateResult)i.appendChildren(r,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var s=e.cell.children.length,d=this.parent.element.id+e.column.uid;if(n.field!==e.column.field||t.isNullOrUndefined(n.template))for(;0<s;s=e.cell.children.length)r.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{if(this.parent.isReact&&"string"!=typeof e.column.template){e.column.templateFn(e.data,this.parent,"columnTemplate",d,null,null,r),t.isNullOrUndefined(this.parent.grid.portals)&&(this.parent.grid.portals=this.parent.portals),this.parent.notify("renderReactTemplate",this.parent.portals);var l=this;l.parent.renderReactTemplates(function(){l.parent.trigger("queryCellInfo",e)})}else{var p=e.column.templateFn(i.extend({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);i.appendChildren(r,p)}delete e.column.template,delete e.column.templateFn,e.cell.innerHTML=""}}else r.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var r=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var n=r.parent.grid.getRowsObject(),o=r.parent.getDataRows(),a=r.parent.grid.getIndentCount(),s=r.parent.grid.getNormalizedColumnIndex(e);if(0!==o.length)for(var d=0;d<n.length;d++)if(n[parseInt(d.toString(),10)].isDataRow&&!t.isNullOrUndefined(n[parseInt(d.toString(),10)].index)){var l=n[parseInt(d.toString(),10)].cells[parseInt(s.toString(),10)],p=new i.CellRenderer(r.parent.grid,r.parent.grid.serviceLocator),h=o.length>=n.length?r.parent.getCellFromIndex(n[parseInt(d.toString(),10)].index,s-a):o[n[parseInt(d.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,l,n[parseInt(d.toString(),10)].data,{index:n[parseInt(d.toString(),10)].index});var c=r.parent.getRows()[parseInt(d.toString(),10)].cells[parseInt(s.toString(),10)];r.cellRender({data:n[parseInt(d.toString(),10)].data,cell:c,column:l.column})}})},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){this.parent.portals=e,this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),ee=function(){function e(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!t.isNullOrUndefined(this.parent.parentIdMapping)}return e.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on("remoteExpand",this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("remoteExpand",this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.isRemote=function(){return this.parent.dataSource instanceof n.DataManager},e.prototype.convertToFlatData=function(e){var i=this;if(this.parent.flatData=t.isNullOrUndefined(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof n.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],a(this.parent)&&!u(this.parent)&&e instanceof n.DataManager&&!(e instanceof Array)){var r=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=t.isNullOrUndefined(this.parent.query)?new n.Query:this.parent.query,this.parent.parentIdMapping){var o=this.parent.query.params.filter(function(e){return"IdMapping"===e.key});this.parent.initialRender&&!o.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var s=this.parent.query.clone();s.queries=[],(s=s.select([this.parent.parentIdMapping])).isCountRequired=!0,r.executeQuery(s).then(function(e){i.parentItems=n.DataUtil.distinct(e.result,i.parent.parentIdMapping,!1);0===(e.result?0:1)&&(t.setValue("grid.contentModule.isLoaded",!0,i.parent),t.isNullOrUndefined(i.zerothLevelData)||(t.setValue("cancel",!1,i.zerothLevelData),t.getValue("grid.renderModule",i.parent).dataManagerSuccess(i.zerothLevelData),i.zerothLevelData=null),i.parent.grid.hideSpinner())})}}}else e instanceof Array&&this.convertJSONData(e)},e.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var i=Object.keys(e),r=0;r<i.length;r++){var o=e[parseInt(r.toString(),10)];this.hierarchyData.push(t.extend({},o)),t.isNullOrUndefined(o[this.parent.idMapping])||this.taskIds.push(o[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var a=[],s=new n.DataManager(this.hierarchyData).executeLocal((new n.Query).group(this.parent.parentIdMapping)),r=0;r<s.length;r++){var d=s[parseInt(r.toString(),10)],l=this.taskIds.indexOf(d.key);if(!t.isNullOrUndefined(d.key)&&l>-1){var p=d.items;this.hierarchyData[parseInt(l.toString(),10)][this.parent.childMapping]=p}else a.push.apply(a,d.items)}this.hierarchyData=this.selfReferenceUpdate(a)}if(Object.keys(this.hierarchyData).length)this.createRecords(this.hierarchyData);else{var h=!(this.parent.dataSource instanceof n.DataManager)&&this.parent.isGantt;this.parent.flatData=h?this.parent.dataSource:[]}this.storedIndex=-1},e.prototype.selfReferenceUpdate=function(e){for(var t=[];this.hierarchyData.length>0&&e.length>0;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},e.prototype.updateParentRemoteData=function(e){var r=this;a(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e.actionArgs.requestType&&this.parent.hideSpinner();var n=e.result;if(a(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===e.actionArgs.requestType||"clearFilter"===e.actionArgs.action||""===e.actionArgs.searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var o=this,d=0;d<n.length;d++)!function(d){if(s(o.parent)&&n[parseInt(d.toString(),10)].hasChildRecords&&o.parent.initialRender&&(n[parseInt(d.toString(),10)].expanded=!1),a(o.parent)&&o.parent.enableVirtualization){var l=[],p=o.parent;n.filter(function(e){e[""+p.parentIdMapping]===n[parseInt(d.toString(),10)][""+p.idMapping]&&l.push(e)}),l.length?n[parseInt(d.toString(),10)].expanded=!0:n[parseInt(d.toString(),10)].hasChildRecords&&(n[parseInt(d.toString(),10)].expanded=!1)}if(t.isNullOrUndefined(n[parseInt(d.toString(),10)].index)){if(n[parseInt(d.toString(),10)].taskData=t.extend({},n[parseInt(d.toString(),10)]),n[parseInt(d.toString(),10)].uniqueID=i.getUid(o.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+n[parseInt(d.toString(),10)].uniqueID,n[parseInt(d.toString(),10)],o.parent),a(o.parent)&&o.parent.enableVirtualization&&n[parseInt(d.toString(),10)][""+o.parent.parentIdMapping]&&(t.isNullOrUndefined(n[parseInt(d.toString(),10)].level)||0===n[parseInt(d.toString(),10)].level)){var h=n[parseInt(d.toString(),10)][""+o.parent.parentIdMapping],c=n.find(function(e){return e[""+r.parent.idMapping]===h});if(c)n[parseInt(d.toString(),10)].level=c.level+1;else{var u=e.actual.flatData.find(function(e){return e[""+r.parent.idMapping]===h});t.isNullOrUndefined(u[""+o.parent.parentIdMapping])?n[parseInt(d.toString(),10)].level=1:n[parseInt(d.toString(),10)].level=u.level+1}}else n[parseInt(d.toString(),10)].level=0;n[parseInt(d.toString(),10)].index=Math.ceil(1e3*Math.random()),(n[parseInt(d.toString(),10)][o.parent.hasChildMapping]||-1!==o.parentItems.indexOf(n[parseInt(d.toString(),10)][o.parent.idMapping]))&&(n[parseInt(d.toString(),10)].hasChildRecords=!0),n[parseInt(d.toString(),10)].checkboxState="uncheck"}}(d);else{t.isNullOrUndefined(n)||!this.parent.loadChildOnDemand&&s(this.parent)&&!t.isNullOrUndefined(this.parent.dataResults.expandRecord)||a(this.parent)&&!this.parent.loadChildOnDemand&&e.actionArgs.isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(n)}else this.zerothLevelData=e,t.setValue("cancel",!0,e);if(a(this.parent)&&!this.parent.loadChildOnDemand&&e.actionArgs.isExpandCollapse&&this.parent.enableVirtualization?e.result=n:a(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?e.result=n:e.result=this.parent.loadChildOnDemand?n:this.parent.flatData,a(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var l=e.query.queries.filter(function(e){return"onAggregates"===e.fn});e.result=this.parent.summaryModule.calculateSummaryValue(l,this.parent.flatData,!0)}this.parent.notify("updateResults",e)},e.prototype.collectExpandingRecs=function(e,i){var r=this.parent.getRows();if(this.parent.rowTemplate){var n=this.parent.getContentTable().rows;r=[].slice.call(n)}var o;if(e.rows.length>0){i||(e.record.expanded=!0);for(var a=0;a<e.rows.length;a++){if(this.parent.toggleRowVisibility(e.rows[parseInt(a.toString(),10)],"e-childrow-visible"),!this.parent.loadChildOnDemand){var s=e.rows[parseInt(a.toString(),10)].getElementsByClassName("e-treegridcollapse")[0];o=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(a.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(a.toString(),10)].getAttribute("data-uid")).data,!t.isNullOrUndefined(s)&&o.expanded&&(t.addClass([s],"e-treegridexpand"),t.removeClass([s],"e-treegridcollapse"));var d=[];(d=r.filter(function(e){return e.querySelector(".e-gridrowindex"+o.index+"level"+(o.level+1))})).length&&o.expanded&&this.collectExpandingRecs({record:o,rows:d,parentRow:e.parentRow},!0)}var l=e.rows[parseInt(a.toString(),10)].querySelector(".e-detailrowcollapse");t.isNullOrUndefined(l)||this.parent.grid.detailRowModule.expand(l)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},e.prototype.fetchRemoteChildData=function(e){var r=this,a={row:e.parentRow,data:e.record},s=this.parent.dataSource,d=this.parent.grid.getDataModule().generateQuery(),l=d.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn});d.queries=l,d.isCountRequired=!0;var p=parseInt(e.record[this.parent.idMapping],10);if(isNaN(p)&&(p=e.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===e.action)d.take(this.parent.grid.pageSettings.pageSize),(h=[]).push("ExpandingAction",p.toString()),d.expand(h);else if(this.parent.enableVirtualization&&"collapse"===e.action){d.take(this.parent.grid.pageSettings.pageSize);var h=[];h.push("CollapsingAction",p.toString()),d.expand(h)}if(d.where(this.parent.parentIdMapping,"equal",e.record[this.parent.idMapping]),"remoteExpand"===e.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length){var c=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates});d.queries.push(c[0])}o.showSpinner(this.parent.element),s.executeQuery(d).then(function(s){var d,l=r.parent.grid.currentViewData.slice(),p=r.parent.idMapping;if(r.parent.isGantt&&r.parent.loadChildOnDemand&&r.parent.hasChildMapping){for(g=0;g<r.parent.grid.currentViewData.length;g++)if(e.record[p]===r.parent.grid.currentViewData[g][p]){d=g;break}}else d=l.indexOf(e.record);if(r.parent.enableVirtualization&&("collapse"===e.action||"remoteExpand"===e.action)){l=[];for(g=0;g<d;g++)l.push(r.parent.grid.currentViewData[parseInt(g.toString(),10)])}-1===d&&r.parent.grid.getRowsObject().forEach(function(t){t.data.uniqueID===e.record.uniqueID&&(d=t.index)});var h=i.getObject("actual.nextLevel",s),c=s.result,u=[];if("remoteExpand"===e.action&&r.parent.grid.filterModule&&r.parent.grid.filterModule.value){for(g=0;g<l.length;g++)Object.prototype.hasOwnProperty.call(l[parseInt(g.toString(),10)],r.parent.parentIdMapping)&&null!==l[parseInt(g.toString(),10)][""+r.parent.parentIdMapping]&&0===l[parseInt(g.toString(),10)].level&&(l.splice(g,1),g--);for(g=0;g<c.length;g++)e.record[""+r.parent.idMapping]!==c[parseInt(g.toString(),10)][""+r.parent.idMapping]&&e.record[""+r.parent.idMapping]===c[parseInt(g.toString(),10)][""+r.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(c,g)&&u.push(c[parseInt(g.toString(),10)]);c=u}if(r.parent.enableVirtualization&&"remoteExpand"===e.action){e.record.childRecords=[];for(var g=0;g<c.length;g++)e.record[""+r.parent.idMapping]!==c[parseInt(g.toString(),10)][""+r.parent.idMapping]&&e.record[""+r.parent.idMapping]===c[parseInt(g.toString(),10)][""+r.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(c,g)&&e.record.childRecords.push(c[parseInt(g.toString(),10)])}else e.record.childRecords=c;for(var f=0;f<c.length;f++)!function(n){var o=c[parseInt(n.toString(),10)];if(r.parent.enableVirtualization&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping]&&"remoteExpand"===e.action)r.parent.remoteExpandedData.push(e.record);else if(r.parent.enableVirtualization&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping]&&"collapse"===e.action)for(p=0;p<r.parent.remoteExpandedData.length;p++)e.record[""+r.parent.idMapping]===r.parent.remoteExpandedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&r.parent.remoteExpandedData.splice(p,1);if(o.taskData=t.extend({},o),o[""+r.parent.parentIdMapping]&&r.parent.enableVirtualization&&r.parent.remoteExpandedData.length)for(p=0;p<r.parent.remoteExpandedData.length;p++)o[""+r.parent.parentIdMapping]===r.parent.remoteExpandedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&(o.level=r.parent.remoteExpandedData[parseInt(p.toString(),10)].level+1,delete(a=r.parent.remoteExpandedData[parseInt(p.toString(),10)]).childRecords,o.parentItem=a,o.parentUniqueID=a.uniqueID);else if(r.parent.enableVirtualization)!o[""+r.parent.hasChildMapping]&&-1===r.parentItems.indexOf(o[""+r.parent.idMapping])||h&&!h[parseInt(n.toString(),10)]?(delete(a=t.extend({},e.record)).childRecords,o.parentItem=a,o.parentUniqueID=e.record.uniqueID):t.isNullOrUndefined(o[""+r.parent.parentIdMapping])?(o.level=0,"remoteExpand"===e.action&&(o.childRecords=[],o.childRecords=e.record.childRecords)):o.level=e.record.level;else{o.level=e.record.level+1;var a=t.extend({},e.record);delete a.childRecords,o.parentItem=a,o.parentUniqueID=e.record.uniqueID}if(o.index=Math.ceil(1e3*Math.random()),o.uniqueID=i.getUid(r.parent.element.id+"_data_"),e.record[""+r.parent.idMapping]===o[""+r.parent.idMapping]&&(e.record.uniqueID=o.uniqueID),o.checkboxState="uncheck",r.parent.enableVirtualization&&t.isNullOrUndefined(o.level))for(var s=0;s<r.parent.grid.currentViewData.length;s++)r.parent.grid.currentViewData[parseInt(s.toString(),10)][""+r.parent.idMapping]===o[""+r.parent.parentIdMapping]&&(o.level=r.parent.grid.currentViewData[parseInt(s.toString(),10)].level+1);if(t.setValue("uniqueIDCollection."+o.uniqueID,o,r.parent),(o[""+r.parent.hasChildMapping]||-1!==r.parentItems.indexOf(o[""+r.parent.idMapping]))&&(!h||h[parseInt(n.toString(),10)]))if(o.hasChildRecords=!0,r.parent.enableVirtualization&&!r.parent.loadChildOnDemand){for(p=0;p<r.parent.remoteCollapsedData.length;p++)o[""+r.parent.idMapping]===r.parent.remoteCollapsedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&(o.expanded=r.parent.remoteCollapsedData[parseInt(p.toString(),10)].expanded);if("collapse"===e.action&&o[""+r.parent.idMapping]!==e.record[""+r.parent.idMapping]&&!1!==o.expanded)o.expanded=!0;else if("collapse"===e.action&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping])o.expanded=!1,r.parent.remoteCollapsedData.push(e.record);else if("remoteExpand"===e.action){for(p=0;p<r.parent.grid.currentViewData.length;p++)r.parent.grid.currentViewData[parseInt(p.toString(),10)][""+r.parent.idMapping]===o[""+r.parent.idMapping]&&c.splice(n,1,r.parent.grid.currentViewData[parseInt(p.toString(),10)]);if(o[r.parent.idMapping]===e.record[""+r.parent.idMapping])for(var p=0;p<r.parent.remoteCollapsedData.length;p++)e.record[""+r.parent.idMapping]===r.parent.remoteCollapsedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&r.parent.remoteCollapsedData.splice(p,1);!1!==o.expanded&&(o.expanded=!0)}}else r.parent.enableVirtualization&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping]&&"collapse"!==e.action?o.expanded=!0:r.parent.enableVirtualization&&!r.parent.loadChildOnDemand||(o.expanded=!1);l.some(function(e){return e[""+r.parent.idMapping]===o[r.parent.idMapping]})||l.splice(d+n+1,0,o)}(f);var m=r.parent.idMapping;if(r.parent.enableVirtualization&&r.parent.loadChildOnDemand&&l.sort(function(e,t){return e[""+m]-t[""+m]}),t.setValue("result",l,s),t.setValue("action","beforecontentrender",s),r.parent.trigger("actionComplete",s),o.hideSpinner(r.parent.element),r.parent.grid.aggregates.length>0&&!r.parent.enableVirtualization){var y=i.getObject("query",s);if(t.isNullOrUndefined(y)&&(y=t.getValue("grid.renderModule.data",r.parent).aggregateQuery(new n.Query)),!t.isNullOrUndefined(y)){var S=y.queries.filter(function(e){return"onAggregates"===e.fn});s.result=r.parent.summaryModule.calculateSummaryValue(S,s.result,!0)}}"remoteExpand"===e.action&&r.parent.allowPaging&&"All"===r.parent.pageSettings.pageSizeMode&&(r.parent.grid.pageSettings.totalRecordsCount=r.parent.grid.pageSettings.totalRecordsCount+c.length),r.parent.enableVirtualization&&(r.parent.grid.pageSettings.totalRecordsCount=s.count),s.count=r.parent.grid.pageSettings.totalRecordsCount;var v={};r.parent.enableVirtualization&&r.remoteVirtualAction(v);var w={index:d,childData:c};r.parent.enableInfiniteScrolling?r.parent.notify("infinite-remote-expand",w):t.getValue("grid.renderModule",r.parent).dataManagerSuccess(s,v),r.parent.trigger("expanded",a)})},e.prototype.remoteVirtualAction=function(e){e.requestType="refresh",t.setValue("isExpandCollapse",!0,e);var i=t.getValue("grid.contentModule",this.parent),r=t.getValue("currentInfo",i),n=t.getValue("prevInfo",i);r.loadNext&&this.parent.grid.pageSettings.currentPage===r.nextInfo.page&&!this.parent.loadChildOnDemand&&(this.parent.grid.pageSettings.currentPage=n.page)},e.prototype.beginSorting=function(){if(this.isSortAction=!0,a(this.parent)&&this.parent.enableVirtualization){var e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]);-1!==e&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length&&this.parent.query.sortBy(null,null)}},e.prototype.createRecords=function(e,r){for(var n=[],o=0,d=Object.keys(e).length;o<d;o++){var l=t.extend({},e[parseInt(o.toString(),10)]);l.taskData=e[parseInt(o.toString(),10)];var p=0;this.storedIndex++,Object.prototype.hasOwnProperty.call(l,"index")||(l.index=this.storedIndex);var h=l[this.parent.childMapping],c=!t.isNullOrUndefined(h)&&h.length>0,u=s(this.parent),g=l[this.parent.hasChildMapping];if(l.hasChildRecords=!!(c&&!u||g&&u),(!t.isNullOrUndefined(h)&&!u||g&&u)&&(this.parent.enableCollapseAll||!t.isNullOrUndefined(this.parent.dataStateChange)&&t.isNullOrUndefined(h)?l.expanded=!1:l.expanded=!!t.isNullOrUndefined(l[this.parent.expandStateMapping])||l[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(l,"index")||(l.index=(l.hasChildRecords,this.storedIndex)),this.isSelfReference&&t.isNullOrUndefined(l[this.parent.parentIdMapping])&&this.parent.parentData.push(l),l.uniqueID=i.getUid(this.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+l.uniqueID,l,this.parent),!t.isNullOrUndefined(r)){var f=t.extend({},r);delete f.childRecords,delete f[this.parent.childMapping],this.isSelfReference&&delete f.taskData[this.parent.childMapping],l.parentItem=f,l.parentUniqueID=f.uniqueID,p=r.level+1}Object.prototype.hasOwnProperty.call(l,"level")||(l.level=p),l.checkboxState="uncheck";if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&a(this.parent)&&!this.parent.initialRender){if(!l.hasChildRecords&&t.isNullOrUndefined(l[""+this.parent.parentIdMapping])){l.hasChildRecords=!0;for(var m=0;m<this.parent.remoteCollapsedData.length;m++)this.parent.remoteCollapsedData[parseInt(m.toString(),10)][""+this.parent.idMapping]===l[""+this.parent.idMapping]&&(l.expanded=!1)}else 0===l.level&&t.isNullOrUndefined(r)&&!l.hasChildRecords&&(l.level=l.level+1);l[""+this.parent.hasChildMapping]&&!t.isNullOrUndefined(l[""+this.parent.expandStateMapping])&&(l.expanded=l[""+this.parent.expandStateMapping],l.hasChildRecords=!0),this.parent.flatData.push(l)}else(t.isNullOrUndefined(l[""+this.parent.parentIdMapping])||l.parentItem)&&(t.isNullOrUndefined(this.parent.rowDropSettings.targetID)?this.parent.flatData.push(l):this.parent.rowDragAndDropModule.isDuplicateData(l)||this.parent.flatData.push(l),this.parent.infiniteScrollData.push(l));if(this.isSelfReference||0!==l.level||this.parent.parentData.push(l),!t.isNullOrUndefined(l[this.parent.childMapping]&&l[this.parent.childMapping].length)){var y=this.createRecords(l[this.parent.childMapping],l);l.childRecords=y}n.push(l)}return n},e.prototype.dataProcessor=function(e){var r,o=i.getObject("isExport",e),a=i.getObject("expresults",e),d=i.getObject("exportType",e),l=i.getObject("isPrinting",e),p=i.getObject("actionArgs",e),h=i.getObject("requestType",e),c=i.getObject("data",e),g=i.getObject("action",e),f=p,m=this.parent.getPrimaryKeyFieldNames()[0],y=i.getObject("data",f);t.isNullOrUndefined(f)||t.isNullOrUndefined(f.action)||"add"!==f.action||t.isNullOrUndefined(f.data)||!t.isNullOrUndefined(f.data[""+m])||(f.data[""+m]=e.result[f.index][""+m],y.taskData[""+m]=e.result[f.index][""+m]),(!t.isNullOrUndefined(p)&&Object.keys(p).length||"save"===h)&&(h=h||p.requestType,c=c||i.getObject("data",p),g=g||i.getObject("action",p),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData&&this.updateAction(c,g,h));var S,v,w=(r=o&&!t.isNullOrUndefined(a)?a:s(this.parent)?t.getValue("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof n.DataManager?r.dataSource.json:r,I=s(this.parent)?t.getValue("count",this.parent.dataSource):w.length,R=new n.Query,x=i.getObject("query",e);if(t.isNullOrUndefined(x)||(S=x.queries.filter(function(e){return"onWhere"===e.fn}),v=x.queries.filter(function(e){return"onSearch"===e.fn})),this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||this.parent.grid.searchSettings.key.length>0||!t.isNullOrUndefined(x)&&(S.length||v.length)&&this.parent.isLocalData){t.isNullOrUndefined(x)&&(x=new n.Query,x=t.getValue("grid.renderModule.data",this.parent).filterQuery(x),x=t.getValue("grid.renderModule.data",this.parent).searchQuery(x));var C=x.queries.filter(function(e){return"onWhere"===e.fn}),b=x.queries.filter(function(e){return"onSearch"===e.fn});R.queries=C.concat(b);var D=new n.DataManager(w).executeLocal(R);if(this.parent.notify("updateFilterRecs",{data:D}),w=this.dataResults.result,this.dataResults.result=null,this.parent.grid.aggregates.length>0){P=i.getObject("query",e);if(t.isNullOrUndefined(x)&&(x=t.getValue("grid.renderModule.data",this.parent).aggregateQuery(new n.Query)),!t.isNullOrUndefined(P)){V=P.queries.filter(function(e){return"onAggregates"===e.fn});w=this.parent.summaryModule.calculateSummaryValue(V,w,!0)}}}if(this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var M=i.getObject("query",e);t.isNullOrUndefined(M)&&(M=t.getValue("grid.renderModule.data",this.parent).aggregateQuery(new n.Query));V=M.queries.filter(function(e){return"onAggregates"===e.fn});w=this.parent.summaryModule.calculateSummaryValue(V,this.parent.flatData,!0)}if(this.parent.grid.sortSettings.columns.length>0||this.isSortAction){this.isSortAction=!1;for(var O=this.parent.parentData,P=i.getObject("query",e),A=new n.Query,E=this.parent.grid.sortSettings.columns.length-1;E>=0;E--){var N=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(E.toString(),10)].field),U=N.sortComparer&&u(this.parent)?N.sortComparer.bind(N):this.parent.grid.sortSettings.columns[parseInt(E.toString(),10)].direction;A.sortBy(this.parent.grid.sortSettings.columns[parseInt(E.toString(),10)].field,U)}var k=new n.DataManager(O).executeLocal(A);if(this.parent.allowRowDragAndDrop&&!t.isNullOrUndefined(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var q=k.indexOf(this.parent.rowDragAndDropModule.draggedRecord);k.splice(q,1);var T=k.indexOf(this.parent.rowDragAndDropModule.droppedRecord);this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?k.splice(T,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&k.splice(T+1,0,this.parent.rowDragAndDropModule.draggedRecord)}var B={modifiedData:k,filteredData:w,srtQry:A};if(this.parent.notify("createSort",B),w=B.modifiedData,this.dataResults.result=null,this.sortedData=w,this.parent.notify("updateModel",{}),this.parent.grid.aggregates.length>0&&!t.isNullOrUndefined(P)){var V=i.getObject("query",e).queries.filter(function(e){return"onAggregates"===e.fn});w=this.parent.summaryModule.calculateSummaryValue(V,this.sortedData,!1)}}I=s(this.parent)?t.getValue("count",this.parent.dataSource):w.length;var z=this.paging(w,I,o,l,d,e);w=z.result,I=z.count,e.result=w,e.count=I,this.parent.notify("updateResults",e)},e.prototype.paging=function(e,i,r,n,o,a){if(!this.parent.allowPaging||r&&"CurrentPage"!==o||n&&"CurrentPage"!==this.parent.printMode){if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(!r||"CurrentPage"===o)&&"save"!==t.getValue("requestType",a)){var d=this.parent.enableInfiniteScrolling?a:t.getValue("actionArgs",a);this.parent.notify("pagingActions",{result:e,count:i,actionArgs:d}),e=this.dataResults.result,i=this.dataResults.count}}else this.parent.notify("pagingActions",{result:e,count:i,actionArgs:a}),e=this.dataResults.result,i=s(this.parent)?t.getValue("count",this.parent.dataSource):this.dataResults.count;if((!0===n||a.isPdfExport&&(t.isNullOrUndefined(a.isCollapsedStatePersist)||a.isCollapsedStatePersist))&&"AllPages"===this.parent.printMode){for(var l=[],p=0;p<e.length;p++)h(this.parent,e[parseInt(p.toString(),10)],this.parent.parentData)&&l.push(e[parseInt(p.toString(),10)]);i=(e=l).length}return{result:e,count:i}},e.prototype.updateData=function(e){this.dataResults=e},e.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify("crudAction",{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchSave",{})},e}();!function(e){e[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Search=5]="Search",e[e.ExpandAll=6]="ExpandAll",e[e.CollapseAll=7]="CollapseAll",e[e.ExcelExport=8]="ExcelExport",e[e.PdfExport=9]="PdfExport",e[e.CsvExport=10]="CsvExport",e[e.Print=11]="Print",e[e.RowIndent=12]="RowIndent",e[e.RowOutdent=13]="RowOutdent"}(e.ToolbarItem||(e.ToolbarItem={})),function(e){e[e.AutoFit=0]="AutoFit",e[e.AutoFitAll=1]="AutoFitAll",e[e.SortAscending=2]="SortAscending",e[e.SortDescending=3]="SortDescending",e[e.Edit=4]="Edit",e[e.Delete=5]="Delete",e[e.Save=6]="Save",e[e.Cancel=7]="Cancel",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.FirstPage=11]="FirstPage",e[e.PrevPage=12]="PrevPage",e[e.LastPage=13]="LastPage",e[e.NextPage=14]="NextPage",e[e.AddRow=15]="AddRow",e[e.RowIndent=16]="RowIndent",e[e.RowOutdent=17]="RowOutdent"}(e.ContextMenuItems||(e.ContextMenuItems={}));var te=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ie=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return te(i,e),ie([t.Property(12)],i.prototype,"pageSize",void 0),ie([t.Property(8)],i.prototype,"pageCount",void 0),ie([t.Property(1)],i.prototype,"currentPage",void 0),ie([t.Property()],i.prototype,"totalRecordsCount",void 0),ie([t.Property(!1)],i.prototype,"enableQueryString",void 0),ie([t.Property(!1)],i.prototype,"pageSizes",void 0),ie([t.Property(null)],i.prototype,"template",void 0),ie([t.Property("All")],i.prototype,"pageSizeMode",void 0),i}(t.ChildProperty),ne=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oe=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ae=function(e){function r(){var i=null!==e&&e.apply(this,arguments)||this;return i.intl=new t.Internationalization,i.templateFn={},i}return ne(r,e),r.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},r.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},r.prototype.getFormatter=function(){return this.formatFn},r.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[t.getEnumValue(i.CellType,i.CellType.Summary)]={fn:t.compile(this.footerTemplate,e),property:"footerTemplate"})},r.prototype.getTemplate=function(e){return this.templateFn[t.getEnumValue(i.CellType,e)]},r.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},oe([t.Property()],r.prototype,"type",void 0),oe([t.Property()],r.prototype,"footerTemplate",void 0),oe([t.Property()],r.prototype,"field",void 0),oe([t.Property()],r.prototype,"format",void 0),oe([t.Property()],r.prototype,"columnName",void 0),oe([t.Property()],r.prototype,"customAggregate",void 0),r}(t.ChildProperty),se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ne(i,e),oe([t.Collection([],ae)],i.prototype,"columns",void 0),oe([t.Property(!0)],i.prototype,"showChildSummary",void 0),i}(t.ChildProperty),de=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),le=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return de(i,e),le([t.Property(!1)],i.prototype,"allowAdding",void 0),le([t.Property(!1)],i.prototype,"allowEditing",void 0),le([t.Property(!1)],i.prototype,"allowDeleting",void 0),le([t.Property("Cell")],i.prototype,"mode",void 0),le([t.Property("Top")],i.prototype,"newRowPosition",void 0),le([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),le([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),le([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),le([t.Property("")],i.prototype,"template",void 0),le([t.Property({})],i.prototype,"dialog",void 0),le([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),he=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ce=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),ce([t.Property()],i.prototype,"field",void 0),ce([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),ce([t.Collection([],ue)],i.prototype,"columns",void 0),ce([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),fe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),me=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fe(i,e),me([t.Property(!1)],i.prototype,"enableCache",void 0),me([t.Property(3)],i.prototype,"maxBlocks",void 0),me([t.Property(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Se=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ve=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},we=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Se(i,e),ve([t.Property("startsWith")],i.prototype,"operator",void 0),ve([t.Property(!1)],i.prototype,"ignoreAccent",void 0),ve([t.Property(null)],i.prototype,"headerTemplate",void 0),ve([t.Property(null)],i.prototype,"template",void 0),ve([t.Property(null)],i.prototype,"footerTemplate",void 0),ve([t.Property(!0)],i.prototype,"enableSearching",void 0),ve([t.Property(null)],i.prototype,"renderCustomColumnChooser",void 0),i}(t.ChildProperty),Ie=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Re=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},xe=function(r){function d(e,n){var o=r.call(this,e,n)||this;o.dataResults={},o.uniqueIDCollection={},o.uniqueIDFilterCollection={},o.changedRecords="changedRecords",o.deletedRecords="deletedRecords",o.addedRecords="addedRecords",o.indentOutdentAction="indentOutdentAction",o.isFromChartSide=!1,o.modifiedRecords=[],o.stackedHeader=!1,o.freezeColumnRefresh=!0,o.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),r=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],o=0;o<i.length;o++)if(!(e[i[parseInt(o.toString(),10)]]===t[i[parseInt(o.toString(),10)]]||-1!==n.indexOf(i[parseInt(o.toString(),10)])||e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date&&e[i[parseInt(o.toString(),10)]].getTime()===t[i[parseInt(o.toString(),10)]].getTime())){r=!1;break}return r}return!1},l.Inject(G,F),t.setValue("mergePersistData",o.mergePersistTreeGridData,o);t.isNullOrUndefined(o.injectedModules.Logger)||i.Grid.Inject(i.Logger);o.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&i.Grid.Inject(i.Freeze)});return o.grid=new i.Grid,o}Ie(d,r),l=d,d.prototype.excelExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!1)},d.prototype.csvExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!0)},d.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule.Map(e,t,i,r)},d.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},d.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},d.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},d.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),i=(new n.UrlAdaptor).processQuery(new n.DataManager({url:""}),t),r=JSON.parse(i.data),o=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"])),a=["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"];o.filterSettings.columns=r.where,o.searchSettings.fields=r.search&&r.search[0].fields||[],o.sortSettings.columns=r.sorted,o.columns=this.setHeaderText(o.columns,a);var s=this.createElement("form",{id:"ExportForm"});s.style.display="none";var d=this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}});d.value=JSON.stringify(o),s.method="POST",s.action=e,s.appendChild(d),document.body.appendChild(s),s.submit(),s.remove()},d.prototype.setHeaderText=function(e,r){for(var n=0;n<e.length;n++){var o=this.getColumnByUid(e[parseInt(n.toString(),10)].uid);this.stackedHeader&&t.isNullOrUndefined(o)&&(o=t.isNullOrUndefined(e[parseInt(n.toString(),10)].field)?e[parseInt(n.toString(),10)]:this.getColumnByField(e[parseInt(n.toString(),10)].field)),e[parseInt(n.toString(),10)].headerText=o.headerText,t.isNullOrUndefined(o.template)||(e[parseInt(n.toString(),10)].template="true"),e[parseInt(n.toString(),10)].format&&(e[parseInt(n.toString(),10)].format=i.getNumberFormat(this.getFormat(o.format),o.type,!1,this.currencyCode),this.isExcel||"datetime"!==o.type&&"date"!==o.type||(e[parseInt(n.toString(),10)].format=e[parseInt(n.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(n.toString(),10)].type=o.type),e[parseInt(n.toString(),10)].columns&&this.setHeaderText(e[parseInt(n.toString(),10)].columns,r);for(var a=Object.keys(e[parseInt(n.toString(),10)]),s=0;s<a.length;s++)r.indexOf(a[parseInt(s.toString(),10)])<0&&delete e[parseInt(n.toString(),10)][a[parseInt(s.toString(),10)]]}return e},d.prototype.getFormat=function(e){return"object"==typeof e?t.isNullOrUndefined(e.format)?e.skeleton:e.format:e},d.prototype.getModuleName=function(){return"treegrid"},d.prototype.preRender=function(){this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&t.isNullOrUndefined(this.childMapping)&&(this.childMapping="Children")},d.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},d.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},d.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},d.prototype.search=function(e){this.grid.search(e)},d.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},d.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},d.prototype.TreeGridLocale=function(){if(!t.isNullOrUndefined(this.locale)){var e=t.L10n.locale,r={};t.setValue(this.locale,{},r);var n=void 0;n={},n=i.getObject(this.locale,e);var o=void 0;o={},o=i.getObject(this.getModuleName(),n),t.setValue("grid",o,i.getObject(this.locale,r)),t.L10n.load(r)}},d.prototype.print=function(){this.printModule.print()},d.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var r=void 0,n=void 0,o=void 0,a=void 0,s=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":o=(r=e.target).closest(".e-rowcell"),t.isNullOrUndefined(o)||(a=o.closest("tr"),t.isNullOrUndefined(a)||t.isNullOrUndefined(a.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridexpand")));break;case"ctrlShiftDownArrow":o=(r=e.target).closest(".e-rowcell"),t.isNullOrUndefined(o)||(a=o.closest("tr"),t.isNullOrUndefined(a)||t.isNullOrUndefined(a.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridcollapse")));break;case"downArrow":if(!this.enableVirtualization&&t.isNullOrUndefined(this.rowTemplate)&&(r=e.target,t.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=i.parentsUntil(r,"e-rowcell")),!t.isNullOrUndefined(r)&&(n=r.parentElement,!t.isNullOrUndefined(n))))if((p=n.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(p).editType&&t.isNullOrUndefined(this.grid.getColumnByIndex(p).edit.obj)&&(n=r),null!==(s=this.findnextRowElement(n))){var d=r.cellIndex,l=s.children[parseInt(d.toString(),10)];t.isNullOrUndefined(l)||this.grid.isEdit||((u=this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus")).forEach(function(e){t.removeClass([e],["e-focused","e-focus"])}),t.addClass([l],["e-focused","e-focus"]))}else this.clearSelection();break;case"upArrow":if(!this.enableVirtualization&&t.isNullOrUndefined(this.rowTemplate)&&(r=e.target,t.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=i.parentsUntil(r,"e-rowcell")),!t.isNullOrUndefined(r)&&(n=r.parentElement,!t.isNullOrUndefined(n)))){var p=n.cellIndex;if(p&&"dropdownedit"===this.grid.getColumnByIndex(p).editType&&t.isNullOrUndefined(this.grid.getColumnByIndex(p).edit.obj)&&(n=r),null!==(s=this.findPreviousRowElement(n))){var h=r.cellIndex;if(!t.isNullOrUndefined(h)){var c=s.children[parseInt(h.toString(),10)];if(!t.isNullOrUndefined(c)&&!this.grid.isEdit){var u=this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus");u.forEach(function(e){t.removeClass([e],["e-focused","e-focus"])}),t.addClass([c],["e-focused","e-focus"])}}}else this.clearSelection()}}}},d.prototype.findnextRowElement=function(e){var t=e.nextElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findnextRowElement(t)),t},d.prototype.findPreviousRowElement=function(e){var t=e.previousElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findPreviousRowElement(t)),t},d.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.freezeColumnRefresh=!0,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof n.DataManager)||this.dataSource.dataSource.offline||!t.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof n.RemoteSaveAdaptor,this.isSelfReference=!t.isNullOrUndefined(this.parentIdMapping)},d.prototype.wireEvents=function(){t.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},d.prototype.requiredModules=function(){var e=[];if(this.mergedColumns&&(this.grid.mergedColumns=this.mergedColumns),t.isNullOrUndefined(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed)return e;e.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),t.isNullOrUndefined(this.toolbar)||e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&e.push({member:"sort",args:[this],name:"Sort"}),this.aggregates.length>0&&e.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this],name:"ExcelExport"});var i=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),r=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||r)&&i.length>0&&e.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&e.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(e),e},d.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},d.prototype.extendRequiredModules=function(e){var i=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||i.length)&&(t.isNullOrUndefined(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!t.isNullOrUndefined(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},d.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},d.prototype.unwireEvents=function(){this.grid&&this.grid.element&&t.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard&&this.element.removeAttribute("tabIndex"))},d.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},d.prototype.render=function(){var e=this;this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),o.createSpinner({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new Z(this),this.dataModule=new ee(this),this.printModule=new Q(this),this.trigger("load"),this.autoGenerateColumns(),this.initialRender=!0,t.isNullOrUndefined(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener();var i=t.createElement("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"});t.addClass([this.element],"e-treegrid"),t.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),t.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(i);var r=this.grid.requiredModules;this.grid.requiredModules=function(){var e=[];e=r.apply(this);for(var t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e};this.grid.root=this.root?this.root:this,this.grid.appendTo(i),this.actionFailureHandler(),this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var n=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table");t.isNullOrUndefined(n)||n.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.updateColumnModel(),this.wireEvents(),this.renderComplete();var a=this.grid.destroyTemplate;this.grid.destroyTemplate=function(i,r,n){a.apply(e.grid);e.isReact&&t.isNullOrUndefined(e.portals)?t.isNullOrUndefined(n)||n():e.clearTemplate(i,r,n)}},d.prototype.actionFailureHandler=function(){var e=this,i=[],r=this.getPrimaryKeyFieldNames(),n=this.flatData.length;(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===r.length&&0!==n&&i.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===r.length&&0!==n&&i.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&i.push("Paging is not allowed in virtualization case."),0===n&&0===this.columns.length&&i.push("Either of the Data source or columns should be given."),this.frozenColumns>0&&this.columnModel.filter(function(e){return e.isFrozen})&&i.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!t.isNullOrUndefined(this.detailTemplate)&&i.push("Virtual scrolling is not compatible with the detail template"),!(this.frozenColumns>0||this.frozenRows>0||this.columnModel.filter(function(e){return e.isFrozen}))||t.isNullOrUndefined(this.detailTemplate)&&t.isNullOrUndefined(this.rowTemplate)||i.push("Frozen rows and columns are not supported with the Detail template and row template."),(this.frozenColumns>0||this.columnModel.filter(function(e){return e.isFrozen}).length>0||this.frozenRows>0)&&"Cell"===this.editSettings.mode&&i.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!t.isNullOrUndefined(this.rowTemplate)&&i.push("Selection is not supported in RowTemplate"),this.treeColumnIndex>=this.columns.length&&i.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&i.push("column width and height should be in pixels"),"Children"===this.childMapping||t.isNullOrUndefined(this.idMapping)||i.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!t.isNullOrUndefined(this.idMapping)&&t.isNullOrUndefined(this.parentIdMapping)||t.isNullOrUndefined(this.idMapping)&&!t.isNullOrUndefined(this.parentIdMapping))&&i.push("IdMapping and ParentIdMapping properties should be defined and vice versa.");var o=this.columnModel.filter(function(e){return e.showCheckbox}),a=this.columns[this.treeColumnIndex];0!==o.length&&(o!==a&&i.push("ShowCheckbox column should not be defined other than the tree column."),o.length>1&&i.push("Only one column can have the ShowCheckbox option enabled."));if(null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&this.treeColumnIndex<this.columns.length&&0!==this.columnModel.filter(function(t){return"Right"===t.textAlign&&t.field===e.columnModel[e.treeColumnIndex].field}).length&&i.push("TextAlign right for the tree column is not applicable."),i.length>0){var s={error:{}};i.forEach(function(e,t){s.error[parseInt(t.toString(),10)]=e}),this.trigger("actionFailure",s)}},d.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",r=e.querySelector("#"+t).parentElement,n=e.querySelector("#"+i).parentElement;r.classList.add("e-hidden"),n.classList.add("e-hidden")},d.prototype.afterGridRender=function(){t.isNullOrUndefined(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new H(this,this.grid.serviceLocator)},d.prototype.convertTreeData=function(e){if(s(this)&&(e=t.getValue("result",e)),e instanceof Array&&e.length>0&&Object.prototype.hasOwnProperty.call(e[0],"level")){this.flatData=e;for(var i=this,r=0,n=this.flatData.length;r<n;r++)!function(e,r){var n=i.flatData[parseInt(e.toString(),10)];t.setValue("uniqueIDCollection."+n.uniqueID,n,i),0!==n.level||i.parentData.some(function(e){return e.uniqueID===n.uniqueID})||i.parentData.push(n)}(r)}else if(s(this)){var o=t.getValue("result",this.dataSource);this.dataModule.convertToFlatData(o)}else this.dataModule.convertToFlatData(e)},d.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=i.getActualProperties(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowMultiSorting=this.allowMultiSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=i.getActualProperties(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=i.getActualProperties(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.columnChooserSettings=this.columnChooserSettings,this.grid.filterSettings=i.getActualProperties(this.filterSettings),this.grid.selectionSettings=i.getActualProperties(this.selectionSettings),this.grid.sortSettings=i.getActualProperties(this.sortSettings),this.grid.searchSettings=i.getActualProperties(this.searchSettings),this.grid.aggregates=i.getActualProperties(this.aggregates),this.grid.textWrapSettings=i.getActualProperties(this.textWrapSettings),this.grid.printMode=i.getActualProperties(this.printMode),this.grid.locale=i.getActualProperties(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=i.getActualProperties(this.getContextMenu()),this.grid.columnMenuItems=i.getActualProperties(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=i.getActualProperties(this.rowTemplate),this.grid.detailTemplate=i.getActualProperties(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=i.getActualProperties(this.clipMode);this.grid.templateDotnetInstance=this.templateDotnetInstance;this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer,this.grid.enableStickyHeader=this.enableStickyHeader,this.grid.emptyRecordTemplate=this.emptyRecordTemplate,this.grid.isRowSelectable=this.isRowSelectable;this.grid.isTreeGrid=!0},d.prototype.triggerEvents=function(e){this.trigger(i.getObject("name",e),e)},d.prototype.IsExpandCollapseClicked=function(e){if(!this.isFromChartSide&&!t.isNullOrUndefined(e.target)&&(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))&&!this.selectionSettings.checkboxOnly&&(!t.isNullOrUndefined(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&t.isNullOrUndefined(e.data)))return void(e.cancel=!0)},d.prototype.bindGridEvents=function(){var e=this;this.grid.rowSelecting=function(i){e.IsExpandCollapseClicked(i),!t.isNullOrUndefined(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(e)&&(t.isNullOrUndefined(i.data.parentItem)&&!i.isHeaderCheckboxClicked||(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0))),"Root"===e.pageSettings.pageSizeMode&&(e.grid.selectionModule.totalRecordsCount=e.grid.currentViewData.length),i.cancel||e.trigger("rowSelecting",i)},this.grid.rowDeselecting=function(i){e.IsExpandCollapseClicked(i),!t.isNullOrUndefined(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(e)&&(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0)),e.trigger("rowDeselecting",i)},this.grid.rowSelected=function(t){e.enableVirtualization&&e.virtualScrollModule.updateSelection(t),e.selectedRowIndex=e.grid.selectedRowIndex,e.notify("rowSelected",t),e.trigger("rowSelected",t)},this.grid.rowDeselected=function(i){e.selectedRowIndex=e.grid.selectedRowIndex,t.isNullOrUndefined(i.data)||e.notify("rowDeselected",i),e.trigger("rowDeselected",i)},this.grid.resizeStop=function(t){e.updateColumnModel(),e.trigger("resizeStop",t)},this.grid.excelQueryCellInfo=function(t){e.notify("excelCellInfo",t),t=e.dataResults},this.grid.excelAggregateQueryCellInfo=function(t){e.notify("excelAggregateCellInfo",t),t=e.dataResults},this.grid.pdfAggregateQueryCellInfo=function(t){e.notify("pdfAggregateCellInfo",t),t=e.dataResults},this.grid.pdfQueryCellInfo=function(t){e.notify("pdfCellInfo",t),t=e.dataResults},this.grid.checkBoxChange=function(t){e.trigger("checkboxChange",t)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(t){for(var i=e.getRows();i[t.rowIndex].classList.contains("e-summaryrow");)t.rowIndex++;e.trigger("beforePaste",t)},this.grid.load=function(){if(e.grid.on("initial-end",e.afterGridRender,e),!t.isNullOrUndefined(e.loggerModule)){e.loggerModule=e.grid.loggerModule=new F(e.grid)}},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(t){e.trigger("actionFailure",t)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},d.prototype.lastRowBorder=function(e,i){for(var r=0;r<e.cells.length;r++)i?t.addClass([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell"):t.removeClass([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell")},d.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},d.prototype.extendedGridDataBoundEvent=function(){var e=this;this.grid.dataBound=function(i){if(e.lastRowBorderEventListener(),e.updateRowTemplate(),e.updateColumnModel(),e.updateAltRow(e.getRows()),e.notify("dataBoundArg",i),a(e)&&!u(e)&&!e.hasChildMapping){var r=void 0;r=e.dataResults.result?0:1,t.setValue("grid.contentModule.isLoaded",!(r>0),e)}if(e.isPixelHeight()&&e.initialRender)for(var n=e.getContentTable().rows,o=[].slice.call(n),s=o.length-1;s>0;s--)if(!y(o[parseInt(s.toString(),10)])){o[parseInt(s.toString(),10)].nextElementSibling&&e.lastRowBorder(o[parseInt(s.toString(),10)],!0);break}if(e.enableVirtualization&&e.selectionSettings.persistSelection&&("expand"===e.dataResults.action||"collapse"===e.dataResults.action)){if(e.grid.selectionModule.refreshPersistSelection(),"Single"===e.grid.selectionSettings.type){var d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.grid.selectionModule.data);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}}if(e.enableVirtualization&&e.selectionSettings.persistSelection&&!t.isNullOrUndefined(e.virtualScrollModule.prevSelectedRecord))for(s=0;s<e.virtualScrollModule.prevSelectedRecord.length;s++){var d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.virtualScrollModule.prevSelectedRecord[parseInt(s.toString(),10)]);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}e.trigger("dataBound",i),e.initialRender=!1};var r=this;this.grid.beforeDataBound=function(e){var o=i.getObject("action",e);if((a(r)&&!u(r)||s(this))&&"edit"!==o)r.notify("updateRemoteLevel",e),e=r.dataResults;else if(0===r.flatData.length&&u(r)&&r.dataSource instanceof n.DataManager){var d=r.dataSource;r.dataModule.convertToFlatData(d.dataSource.json),e.result=r.grid.dataSource.dataSource.json=r.flatData}if(a(r)||s(this)||t.isNullOrUndefined(r.dataSource)||(this.isPrinting&&t.setValue("isPrinting",!0,e),r.notify("dataProcessor",e)),t.extend(e,r.dataResults),r.enableImmutableMode&&(e.result=e.result.slice()),r.initialRender&&(this.contentModule.objectEqualityChecker=r.objectEqualityChecker),!this.isPrinting){var l=new n.Deferred;return r.trigger("beforeDataBound",e,function(e){l.resolve(e)}),l}},this.grid.log=function(t,i){e.loggerModule&&e.loggerModule.log(t,i)}},d.prototype.lastRowBorderEventListener=function(){this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},d.prototype.bindCallBackEvents=function(){var e=this;this.grid.toolbarClick=function(t){if(!(t.item.id===e.grid.element.id+"_excelexport"&&!1===e.allowExcelExport||t.item.id===e.grid.element.id+"_pdfexport"&&!1===e.allowPdfExport||t.item.id===e.grid.element.id+"_csvexport"&&!1===e.allowExcelExport)){var i=new n.Deferred;return e.trigger("toolbarClick",t,function(r){r.cancel||e.notify("toolbarClick",t),i.resolve(r)}),i}},this.grid.cellSelecting=function(r){var o=e.grid.selectionModule.actualTarget;t.isNullOrUndefined(o)||!o.classList.contains("e-treegridexpand")&&!o.classList.contains("e-treegridcollapse")||(r.cancel=!0);var a=new n.Deferred;return e.trigger(i.getObject("name",r),r,function(e){a.resolve(e)}),a},this.grid.beginEdit=function(i){if(!t.isNullOrUndefined(i.row)&&i.row.classList.contains("e-summaryrow"))return void(i.cancel=!0);var r=new n.Deferred;return e.trigger("beginEdit",i,function(e){r.resolve(e)}),r}},d.prototype.extendedGridEditEvents=function(){var e=this;this.grid.dataStateChange=function(i){e.isExpandRefresh?(e.isExpandRefresh=!1,e.grid.dataSource={result:e.flatData,count:t.getValue("count",e.grid.dataSource)}):("infiniteScroll"!==i.action.requestType&&(e.infiniteScrollData=[]),e.trigger("dataStateChange",i))},this.grid.cellSave=function(i){if(e.grid.isContextMenuOpen()){var r=e.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0];(t.isNullOrUndefined(r)||r.id!==e.element.id+"_gridcontrol_cmenu_Save")&&(i.cancel=!0)}var o=new n.Deferred;return e.trigger("cellSave",i,function(t){t.cancel||e.notify("cellSave",t),o.resolve(t)}),o},this.grid.cellSaved=function(t){e.trigger("cellSaved",t),e.notify("cellSaved",t)},this.grid.cellEdit=function(t){var i=new n.Deferred;return t.promise=i,e.notify("cellEdit",t),i},this.grid.batchAdd=function(t){e.trigger("batchAdd",t),e.notify("batchAdd",t)},this.grid.beforeBatchSave=function(t){e.trigger("beforeBatchSave",t),e.notify("beforeBatchSave",t)},this.grid.beforeBatchAdd=function(t){e.trigger("beforeBatchAdd",t),e.notify("beforeBatchAdd",t)},this.grid.batchDelete=function(t){e.trigger("batchDelete",t),e.notify("batchDelete",t)},this.grid.beforeBatchDelete=function(t){e.trigger("beforeBatchDelete",t),e.notify("beforeBatchDelete",t)},this.grid.batchCancel=function(t){"Cell"!==e.editSettings.mode&&e.trigger("batchCancel",t),e.notify("batchCancel",t)}},d.prototype.updateRowTemplate=function(){var e=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(e.treeColumnRowTemplate(),e.enableCollapseAll)for(var t=e.getCurrentViewRecords(),i=e.getContentTable().rows,r=0;r<i.length;r++){var n={data:t[parseInt(r.toString(),10)],row:i[parseInt(r.toString(),10)]};e.renderModule.RowModifier(n)}},0):this.treeColumnRowTemplate())},d.prototype.bindedDataSource=function(){if(this.dataSource&&s(this)){var e=this.flatData,i=t.getValue("count",this.dataSource);this.grid.dataSource={result:e,count:i}}else this.grid.dataSource=this.dataSource instanceof n.DataManager?new n.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0):this.flatData;if(this.dataSource instanceof n.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)){this.grid.dataSource.dataSource.json=g(this.dataSource.dataSource.json),this.grid.dataSource.ready=this.dataSource.ready;var r=this;t.isNullOrUndefined(this.grid.dataSource.ready)||this.grid.dataSource.ready.then(function(e){var t=r.grid.dataSource;t.dataSource.offline=!0,t.isDataAvailable=!0,t.dataSource.json=e.result,t.adaptor=new n.JsonAdaptor})}},d.prototype.extendedGridActionEvents=function(){var e=this;this.grid.actionBegin=function(r){if("sorting"===r.requestType&&r.target&&r.target.parentElement&&r.target.parentElement.classList.contains("e-hierarchycheckbox"))return void(r.cancel=!0);if("reorder"===i.getObject("requestType",r)&&e.notify("getColumnIndex",{}),a(e)&&e.enableVirtualization&&("virtualscroll"===r.requestType?(e.query.expand("VirtualScrollingAction"),e.showSpinner()):"searching"===r.requestType&&""===r.searchString?e.query.expand("ClearSearchingAction"):"clearFilter"===r.action&&e.query.expand("ClearFilteringAction")),e.notify("actionBegin",{editAction:r}),a(e)||t.isNullOrUndefined(e.filterModule)||s(e)||0!==e.grid.filterSettings.columns.length||0!==e.grid.searchSettings.key.length||(e.notify("clearFilters",{flatData:e.grid.dataSource}),e.grid.setProperties({dataSource:e.dataResults.result},!0),t.isNullOrUndefined(e.grid.changedProperties.dataSource)&&(e.grid.renderModule.data.dataManager=e.grid.dataSource instanceof n.DataManager?e.grid.dataSource:t.isNullOrUndefined(e.grid.dataSource)?new n.DataManager:new n.DataManager(e.grid.dataSource),e.grid.renderModule.data.isQueryInvokedFromData=!0,e.grid.query=e.grid.query instanceof n.Query?e.grid.query:new n.Query)),"indenting"!==e.action&&"outdenting"!==e.action){var o=new n.Deferred;return e.trigger("actionBegin",r,function(t){t.cancel||e.notify("beginEdit",t),o.resolve(t)}),o}},this.grid.actionComplete=function(t){if(e.notify("actioncomplete",t),e.updateColumnModel(),e.updateTreeGridModel(),"reorder"===t.requestType&&e.notify("setColumnIndex",{}),e.notify("actionComplete",{editAction:t}),"add"===t.requestType&&"Top"!==e.editSettings.newRowPosition&&"Bottom"!==e.editSettings.newRowPosition&&e.notify("beginAdd",t),"batchsave"===t.requestType&&e.notify("batchSave",t),e.notify("updateGridActions",t),"save"===t.requestType&&e.aggregates.map(function(e){return!0===e.showChildSummary}).length&&e.grid.refresh(),"filter"===t.action&&(t.isCollapseMaintain||""===e.filterModule.currentFilterObject||!e.enableVirtualization||e.initialRender||a(e)&&e.enableVirtualization||e.expandAll()),"searching"===t.requestType&&(t.isCollapseMaintain||""===e.searchSettings.key||!e.enableVirtualization||e.initialRender||a(e)&&e.enableVirtualization||e.expandAll()),"clearFilter"===t.action&&e.enableCollapseAll&&e.collapseAll(),"indenting"===e.action||"outdenting"===e.action){e.action="indenting"===e.action?"indented":"outdented";var i=[e.selectedRecords],r={data:i,dropIndex:e.dropIndex,dropPosition:e.dropPosition,modifiedRecords:e.modifiedRecords,requestType:e.action,row:e.selectedRows};e.trigger("actionComplete",r),e.getCurrentViewRecords().filter(function(e){return e.uniqueID===i[0].uniqueID}).length||e.refreshToolbarItems(),e.action="",e.selectedRecords=e.selectedRows=e.modifiedRecords=[]}else{if(e.grid.isFrozenGrid()&&e.enableVirtualization&&"movable"===t.tableName){var n=e.grid.element.querySelector(".e-movablecontent"),o=e.grid.element.querySelector(".e-frozencontent");n.style.height=o.style.height="auto"}e.trigger("actionComplete",t)}}},d.prototype.extendedGridEvents=function(){var e=this,i=this;this.grid.recordDoubleClick=function(t){e.trigger("recordDoubleClick",t),e.notify("recordDoubleClick",t)},this.grid.detailDataBound=function(t){e.notify("detaildataBound",t),e.trigger("detailDataBound",t)},this.grid.rowDataBound=function(e){t.isNullOrUndefined(this.isPrinting)?t.setValue("isPrinting",!1,e):t.setValue("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){t.isNullOrUndefined(this.isPrinting)?t.setValue("isPrinting",!1,e):t.setValue("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(t){e.notify("contextMenuClick",t),e.trigger("contextMenuClick",t)},this.grid.contextMenuOpen=function(t){e.notify("contextMenuOpen",t),e.trigger("contextMenuOpen",t)},this.grid.queryCellInfo=function(t){e.renderModule.cellRender(t)}},d.prototype.bindGridDragEvents=function(){var e=this;this.grid.rowDragStartHelper=function(t){e.trigger("rowDragStartHelper",t)},this.grid.rowDragStart=function(t){e.trigger("rowDragStart",t)},this.grid.rowDrag=function(t){if(e.grid.isEdit)return void(t.cancel=!0);e.notify("row-draging",t),e.trigger("rowDrag",t)},this.grid.rowDrop=function(t){if(e.grid.isEdit)return void(t.cancel=!0);e.notify("row-dropped",t),t.cancel=!0}},d.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),t.setValue("registeredTemplate",this.registeredTemplate,this.grid);t.setValue("viewContainerRef",this.viewContainerRef,this.grid)},d.prototype.autoGenerateColumns=function(){var e=this;if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];var t=this.dataSource[0],i=Object.keys(t);this.columns=i.filter(function(t){return-1===[e.childMapping,e.parentIdMapping].indexOf(t)})}},d.prototype.getGridEditSettings=function(){var e={};switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e.guid=this.editSettings.guid,e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},d.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var t=[],i=0;i<this.contextMenuItems.length;i++)switch(this.contextMenuItems[parseInt(i.toString(),10)]){case"AddRow":case e.ContextMenuItems.AddRow:t.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case e.ContextMenuItems.RowIndent:t.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case e.ContextMenuItems.RowOutdent:t.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:t.push(this.contextMenuItems[parseInt(i.toString(),10)])}return t}return null},d.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale);for(var i=[],r=void 0,n=0;n<this.toolbar.length;n++)switch(this.toolbar[parseInt(n.toString(),10)]){case"Search":case e.ToolbarItem.Search:i.push("Search");break;case"Print":case e.ToolbarItem.Print:i.push("Print");break;case"ExpandAll":case e.ToolbarItem.ExpandAll:r=this.l10n.getConstant("ExpandAll"),i.push({text:r,tooltipText:r,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case e.ToolbarItem.CollapseAll:r=this.l10n.getConstant("CollapseAll"),i.push({text:r,tooltipText:r,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case e.ToolbarItem.RowIndent:r=this.l10n.getConstant("RowIndent"),i.push({text:r,tooltipText:r,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case e.ToolbarItem.RowOutdent:r=this.l10n.getConstant("RowOutdent"),i.push({text:r,tooltipText:r,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:i.push(this.toolbar[parseInt(n.toString(),10)])}return i}return null},d.prototype.getGridColumns=function(e,i,r){void 0===i&&(i=!0),void 0===r&&(r=0);var n=e;i&&(this.columnModel=[]);var o,a;0===this.columnModel.length&&(r=0===r?-1:r);for(var s=[],d=0;d<n.length;d++){r+=1;var l=this.grid.getColumnByUid(n[parseInt(d.toString(),10)].uid);if(a=l||{},o={},"string"==typeof this.columns[parseInt(d.toString(),10)])a.field=o.field=this.columns[parseInt(d.toString(),10)];else for(var p=Object.keys(n[parseInt(d.toString(),10)]),h=0;h<p.length;h++){var c=p[parseInt(h.toString(),10)];r===this.treeColumnIndex&&"template"===c?o[""+c]=n[parseInt(d.toString(),10)][""+c]:"columns"!==c||t.isNullOrUndefined(n[parseInt(d.toString(),10)][""+c])?this.initialRender&&!t.isNullOrUndefined(l)&&this.enablePersistence&&"edit"===c?a[""+c]=o[""+c]=l[""+c]:l&&"sortComparer"===c||(a[""+c]=o[""+c]=n[parseInt(d.toString(),10)][""+c]):(a[""+c]=this.getGridColumns(n[parseInt(d.toString(),10)][""+c],!1,this.columnModel.length-1),o[""+c]=n[parseInt(d.toString(),10)][""+c])}o.columns||this.columnModel.push(new C(o)),s.push(a),!t.isNullOrUndefined(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&a.field===this.columnModel[this.treeColumnIndex].field&&(t.isNullOrUndefined(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),a.textAlign="Right")}return s},d.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),t=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});if(t.length>0){var i=t[t.length-1];this.lastRowBorder(i,!0)}},d.prototype.onPropertyChanged=function(e){var r=Object.keys(e),o=!1;r.indexOf("columns")>-1&&!t.isNullOrUndefined(e.columns)&&this.refreshColumns();for(var a=0,d=r;a<d.length;a++){var l=d[a];switch(l){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=i.getActualProperties(this.pageSettings),o=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=i.getActualProperties(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=i.getActualProperties(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=i.getActualProperties(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=i.getActualProperties(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=i.getActualProperties(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":if(this.isLocalData=!(this.dataSource instanceof n.DataManager)||!t.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof n.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData){if(s(this)){var p=t.getValue("count",this.dataSource);this.grid.dataSource={result:this.flatData,count:p}}else{var h=this.dataSource;this.grid.dataSource=h instanceof n.DataManager?new n.DataManager(h.dataSource,h.defaultQuery,h.adaptor):this.flatData}this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)}else this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable());break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+l]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=i.getActualProperties(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight,this.refresh();break;case"height":t.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":t.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"columnChooserSettings":this.grid.columnChooserSettings=i.getActualProperties(this.columnChooserSettings);break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":t.isNullOrUndefined(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=i.getActualProperties(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=i.getActualProperties(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=i.getActualProperties(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=i.getActualProperties(this.columnMenuItems);break;case"enableStickyHeader":this.grid.enableStickyHeader=this.enableStickyHeader;break;case"emptyRecordTemplate":this.grid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"isRowSelectable":this.grid.isRowSelectable=this.isRowSelectable;break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+l].mode&&("Cell"===e[""+l].mode||"Row"===e[""+l].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings()}o&&this.grid.refresh()}},d.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},d.prototype.destroy=function(){var e=this.element;if(e){var t=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent"));t&&this.unwireEvents(),this.removeListener(),t&&r.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy();for(var i=["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"],n=0;n<i.length;n++)this[i[parseInt(n.toString(),10)]]&&(this[i[parseInt(n.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},d.prototype.dataBind=function(){t.isNullOrUndefined(this.grid)||(!t.isNullOrUndefined(this.rowDropSettings.targetID)&&t.isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),r.prototype.dataBind.call(this),this.grid.dataBind())},d.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],i={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],n=0;n<e.length;n++)for(var o=this[e[parseInt(n.toString(),10)]],a=0,s=i[e[parseInt(n.toString(),10)]];!t.isNullOrUndefined(s)&&a<s.length;a++)delete o[""+s[parseInt(a.toString(),10)]];return this.ignoreInArrays(r,this.columns),this.addOnPersist(e)},d.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},d.prototype.ignoreInColumn=function(e,i){if(t.isNullOrUndefined(i.template))for(var r=0;r<e.length;r++)delete i[e[parseInt(r.toString(),10)]],i.filter={}},d.prototype.mouseClickHandler=function(e){var i=this;if(t.isNullOrUndefined(e.touches)){var r=e.target;!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(r);if((r.classList.contains("e-treegridexpand")||r.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:r}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length){var n=this.grid.getHeaderContent().querySelector(".e-checkselectall"),o=this.grid.getSelectedRowIndexes().length,a=this.getCurrentViewRecords().length;if(a>0&&o===a){var s=n.nextElementSibling;t.removeClass([s],["e-stop","e-uncheck"]),t.addClass([s],["e-check"])}}if((r.classList.contains("e-flmenu-cancelbtn")||r.classList.contains("e-flmenu-okbtn")||r.classList.contains("e-content")||r.classList.contains("e-rowcell"))&&!t.isNullOrUndefined(this.grid.filterModule)&&this.isReact&&!t.isNullOrUndefined(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate){var d=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id);this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&d&&this.clearTemplate(["filterTemplate"],void 0,function(){i.grid.filterModule.filterModule.dlgObj.destroy()})}}},d.prototype.getRows=function(){return this.grid.getRows()},d.prototype.getPager=function(){return this.grid.getPager()},d.prototype.addRecord=function(e,t,i){if(this.editModule){this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i)}},d.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},d.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},d.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},d.prototype.updateRow=function(e,i){if(this.grid.editModule)if(t.isNullOrUndefined(e))this.grid.editModule.updateRow(e,i);else{var r=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)];t.extend(r,i),this.grid.editModule.updateRow(e,r)}},d.prototype.deleteRecord=function(e,i){if(t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)||this.getSelectedRecords().length<=0){this.trigger("actionFailure",{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."})}this.grid.editModule&&this.grid.editModule.deleteRecord(e,i)},d.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},d.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},d.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},d.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},d.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},d.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},d.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},d.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);var r=this.grid.getRowIndexByPrimaryKey(e),n=this.getCurrentViewRecords()[parseInt(r.toString(),10)];S({value:n,action:"edit"},this,this.isSelfReference,n.index,this.grid.selectedRowIndex,t)},d.prototype.setRowData=function(e,t){var i=this.getCurrentViewRecords(),r=this.grid.getPrimaryKeyFieldNames()[0],n=0,o={};i.some(function(t){return t[""+r]===e&&(o=t,!0)}),n=o.level,t.level=n,t.index=o.index,t.childRecords=o.childRecords,t.taskData=o.taskData,t.uniqueID=o.uniqueID,t.parentItem=o.parentItem,t.checkboxState=o.checkboxState,t.hasChildRecords=o.hasChildRecords,t.parentUniqueID=o.parentUniqueID,t.expanded=o.expanded,this.grid.setRowData(e,t);var a=this.getVisibleRecords();if(a.length>0&&e===a[a.length-1][""+r]){var s=this.getContentTable().scrollHeight,d=this.getContent().clientHeight;this.lastRowBorder(this.getRows()[i.indexOf(o)],s<=d)}},d.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},d.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},d.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},d.prototype.getColumnByField=function(e){return i.iterateArrayOrObject(this.columnModel,function(t){if(t.field===e)return t})[0]},d.prototype.getColumnByUid=function(e){var t=this.initialRender?this.grid.columns:this.columns;return this.grid.columns.length!==this.columnModel.length&&(t=this.grid.columnModel),i.iterateArrayOrObject(t,function(t){if(t.uid===e)return t})[0]},d.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},d.prototype.getFooterContent=function(){return this.grid.getFooterContent()},d.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},d.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},d.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},d.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},d.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},d.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},d.prototype.getVirtualColIndexByUid=function(e){var r=i.iterateArrayOrObject(this.grid.columnModel,function(t,i){if(t.uid===e)return i})[0];return t.isNullOrUndefined(r)?-1:r},d.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},d.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},d.prototype.updateColumnModel=function(e){var i,r,n=t.isNullOrUndefined(e)?this.grid.getColumns():e;-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!t.isNullOrUndefined(this.columnModel[this.treeColumnIndex].template)&&(i=this.columnModel[this.treeColumnIndex].template,r=this.columnModel[this.treeColumnIndex].field);var o;if(!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===n.length){this.columnModel=[];for(var a=0;a<n.length;a++){o={};for(var s=0,d=Object.keys(n[parseInt(a.toString(),10)]);s<d.length;s++){var l=d[s];o[""+l]=n[parseInt(a.toString(),10)][""+l]}this.columnModel.push(new C(o)),r!==this.columnModel[parseInt(a.toString(),10)].field||"checkbox"===this.columnModel[parseInt(a.toString(),10)].type||t.isNullOrUndefined(i)||""===i||(this.columnModel[parseInt(a.toString(),10)].template=i)}}if(this.deepMerge=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!t.isNullOrUndefined(this.detailTemplate)){this.trigger("actionFailure",{error:"Stacked header is not compatible with the detail template"})}return this.stackedHeader&&this.allowResizing&&!t.isNullOrUndefined(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||t.isNullOrUndefined(this.columns)||t.merge(this.columns,this.columnModel),this.deepMerge=void 0,this.columnModel},d.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){if(!t.isNullOrUndefined(e)&&e.columns)i.updateColumnsWidth(e.columns);else if(!t.isNullOrUndefined(e)&&e.field){var r=i.grid.getColumnByField(e.field);t.isNullOrUndefined(r)||(e.width=r.width)}})},d.prototype.getContent=function(){return this.grid.getContent()},d.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},d.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},d.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this)},d.prototype.splitFrozenCount=function(e){var t=this.frozenColumns>0?this.grid:this;this.grid.splitFrozenCount.apply(t,[e])},d.prototype.removeBorder=function(e){this.grid.removeBorder.apply(this.grid,[e])},d.prototype.frozenLeftBorderColumns=function(e){this.grid.frozenLeftBorderColumns.apply(this.grid,[e])},d.prototype.frozenRightBorderColumns=function(e){this.grid.frozenRightBorderColumns.apply(this.grid,[e])},d.prototype.isFrozenGrid=function(){var e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return this.frozenColumns>0||this.frozenRows>0||this.getFrozenColumns()>0||e},d.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:i.getObject("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:i.getObject("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:i.getObject("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:i.getObject("properties",this.grid.sortSettings)},!0)},d.prototype.hasPreAndPostMiddleware=function(e){return e&&"function"==typeof e.applyPreRequestMiddlewares&&"function"==typeof e.applyPostRequestMiddlewares},d.prototype.getContentTable=function(){return this.grid.getContentTable()},d.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,r=t.length;i<r;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},d.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return t.isNullOrUndefined(e.isSummaryRow)})},d.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},d.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},d.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},d.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},d.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},d.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},d.prototype.getVisibleColumns=function(){return this.columnModel.filter(function(e){return e.visible})},d.prototype.showSpinner=function(){o.showSpinner(this.element)},d.prototype.hideSpinner=function(){o.hideSpinner(this.element)},d.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),s(this)||(this.dataSource instanceof n.DataManager?this.grid.setProperties({dataSource:new n.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},d.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},d.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=c(t[parseInt(i.toString(),10)]).length);return e},d.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},d.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},d.prototype.refreshColumns=function(e){t.isNullOrUndefined(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},d.prototype.getTreeColumn=function(){var e=this.columnModel[this.treeColumnIndex],r=this.getColumns(),n=i.getObject("field",e),o=r.findIndex(function(e){return i.getObject("field",e)===n});t.isNullOrUndefined(o)||this.setProperties({treeColumnIndex:o},!0)},d.prototype.refreshHeader=function(){this.grid.refreshHeader()},d.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode){if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog){var t=this.grid.editModule.dialogObj;return this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e)}}if(this.rowTemplate){var i=e.closest(".e-treerowcell").parentElement,r=this.getCurrentViewRecords()[i.rowIndex];e.classList.contains("e-treegridexpand")?this.collapseRow(i,r):this.expandRow(i,r)}else{var n=this.grid.getRowInfo(e),r=n.rowData;if(this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(r).length){r=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===n.row.getAttribute("data-uid")})[0].data}this.enableImmutableMode&&(r=this.getCurrentViewRecords()[n.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(n.row,r):this.expandRow(n.row,r)}},d.prototype.expandRow=function(e,i,r,n){var o=this;this.isCollapseAll=!1;var s=this.parentData;if(this.enableVirtualization||(s=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!t.isNullOrUndefined(e)||!t.isNullOrUndefined(i))if(!t.isNullOrUndefined(e)&&e.cells&&e.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(e,!1),this.isExpandAll&&!a(this)){var d={data:s,row:e,cancel:!1},l=!1;this.grid.pagerModule&&!t.isNullOrUndefined(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(l=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||l&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(e,i,s):this.trigger("expanding",d,function(a){o.expandAllPrevent=a.cancel,a.cancel||t.isNullOrUndefined(i)||(a.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,s))}),this.isExpandingEventTriggered=!0}else if(!this.isExpandAll||this.isExpandAll&&a(this)){d={data:i,row:e,cancel:!1};this.trigger("expanding",d,function(t){t.cancel||(t.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,s))})}},d.prototype.expandRows=function(e,i,r){this.expandCollapse("expand",e,i);if((!a(this)||u(this))&&(!s(this)||!t.isNullOrUndefined(i.Children))){var n={data:i,row:e};t.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,n={data:r,row:e},this.trigger("expanded",n)):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!t.isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger("expanded",n)}},d.prototype.expandCollapseAllChildren=function(e,i,r,n){if((t.isNullOrUndefined(r)||e[this.getPrimaryKeyFieldNames()[0]]===r)&&(t.isNullOrUndefined(n)||n===e.level)){var o=c(e).filter(function(e){return e.hasChildRecords});o.unshift(e);for(var a=0;a<o.length;a++)this.expandCollapse(i,null,o[parseInt(a.toString(),10)])}},d.prototype.getCollapseExpandRecords=function(e,i){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&t.isNullOrUndefined(i)&&!a(this)?i=this.flatData.filter(function(e){return e.hasChildRecords}):t.isNullOrUndefined(i)&&!t.isNullOrUndefined(e)&&(i=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),i},d.prototype.collapseRow=function(e,i,r){var n=this;this.isExpandAll=!1;var o=this.parentData;if(this.enableVirtualization||(o=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!t.isNullOrUndefined(e)||!t.isNullOrUndefined(i))if(this.isCollapseAll&&!a(this)){s={data:o,row:e,cancel:!1};this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(e,i,o):this.trigger("collapsing",s,function(t){n.collapseAllPrevent=t.cancel,t.cancel||(t.collapseAll&&n.expandCollapseAllChildren(i,"collapse",r),n.collapseRows(e,i,o))}),this.isCollapsingEventTriggered=!0}else if(!this.isCollapseAll||this.isCollapseAll&&a(this)){var s={data:i,row:e,cancel:!1};this.trigger("collapsing",s,function(t){t.cancel||n.collapseRows(e,i,o)})}},d.prototype.collapseRows=function(e,i,r){this.expandCollapse("collapse",e,i);var n={data:i,row:e};a(this)||(t.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,n={data:r,row:e},this.trigger("collapsed",n)):this.isCollapseAll||this.trigger("collapsed",n),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},d.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)][this.expandStateMapping]=t,S({value:i[parseInt(r.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(r.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,S({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},d.prototype.expandAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!a(this)){t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!0),t.hasChildRecords&&t.level===e});this.expandAction(t,null,e,!0)}else{var t=this.getRecordDetails(e),r=i.getObject("records",t);this.expandAction(r,null,e)}},d.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},d.prototype.expandAction=function(e,i,r,n){void 0===n&&(n=!1);for(var o=this,s=0;s<e.length;s++)!function(s){if(!t.isNullOrUndefined(e[parseInt(s.toString(),10)].parentItem)){var d=e[parseInt(s.toString(),10)].parentItem.uniqueID,l=o.flatData.filter(function(e){return e.uniqueID===d});a(o)&&(l=o.getCurrentViewRecords().filter(function(e){return e.uniqueID===d})),!1===l[0].expanded?(e.push(l[0]),l[0].expanded=!0):h(o,l[0],o.parentData)||l[0].expanded&&void 0!==l[0].parentItem&&e.push(l[0])}n||o.expandRow(null,e[parseInt(s.toString(),10)],i,r)}(s);n&&this.expandRow(null,e,i,r)},d.prototype.getRecordDetails=function(e){var t=this.getRows().filter(function(t){return-1!==t.className.indexOf("level"+e)&&(t.querySelector(".e-treegridcollapse")||t.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(t){return t.level===e&&t.hasChildRecords}),rows:t}},d.prototype.collapseAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!a(this)){var t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!1),t.hasChildRecords&&t.level===e});this.collapseAction(t,null,!0)}else{var r=this.getRecordDetails(e),n=i.getObject("records",r);this.collapseAction(n)}},d.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},d.prototype.expandCollapseActionByKey=function(e,i){var r=this.getPrimaryKeyFieldNames()[0],n=a(this)?this.getCurrentViewRecords():this.grid.dataSource;if(!t.isNullOrUndefined(r)){var o=n.filter(function(t){return t[""+r].toString()===e.toString()});"Expand"===i?this.expandAction(o,e,null):this.collapseAction(o,e)}},d.prototype.collapseAction=function(e,t,i){if(void 0===i&&(i=!1),i)this.collapseRow(null,e);else for(var r=0;r<e.length;r++)this.collapseRow(null,e[parseInt(r.toString(),10)],t);if(!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length){this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1}},d.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger("actionFailure",{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("expand")},d.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger("actionFailure",{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("collapse")},d.prototype.expandCollapseAll=function(e){var i;if(!(i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))}):this.getRows().filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))})).length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!a(this)){if(this.flatData.filter(function(t){t.hasChildRecords&&(t.expanded="collapse"!==e)}),i.length)for(n=0;n<i.length;n++)"collapse"===e?t.isNullOrUndefined(this.getCurrentViewRecords()[i[parseInt(n.toString(),10)].rowIndex])||this.collapseRow(i[parseInt(n.toString(),10)]):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(n.toString(),10)]);else if(this.allowPaging){var r=this.enableCollapseAll;this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:r},!0)}}else for(var n=0;n<i.length;n++)"collapse"===e?this.collapseRow(i[parseInt(n.toString(),10)]):this.expandRow(i[parseInt(n.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},d.prototype.expandCollapse=function(e,i,r,n){var o,d=this,l={row:i,data:r,childData:[],requestType:e},p=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});(!a(this)&&"expand"===e&&this.isSelfReference&&s(this)&&!p.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!a(this)&&this.isSelfReference&&s(this))&&this.updateChildOnDemand(l);var c=this.getRows();if(this.rowTemplate){R=this.getContentTable().rows;c=[].slice.call(R)}var g;if(t.isNullOrUndefined(i)?(g=this.grid.currentViewData.indexOf(r),i=c[parseInt(g.toString(),10)]):g=+i.getAttribute("aria-rowindex")-1,t.isNullOrUndefined(i)||i.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||a(this)||s(this)){var f=void 0;if("expand"===e){if(f="e-childrow-visible",n||(r.expanded=!0,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),t.isNullOrUndefined(i)||(o=i.getElementsByClassName("e-treegridcollapse")[0]),n&&!t.isNullOrUndefined(r[this.expandStateMapping])&&r[this.expandStateMapping]&&t.isNullOrUndefined(o)&&(o=i.getElementsByClassName("e-treegridexpand")[0]),t.isNullOrUndefined(o))return;o.classList.contains("e-treegridexpand")||t.addClass([o],"e-treegridexpand"),t.removeClass([o],"e-treegridcollapse")}else{if(f="e-childrow-hidden",n&&!s(this)||(r.expanded=!1,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),t.isNullOrUndefined(i)||(o=i.getElementsByClassName("e-treegridexpand")[0]),n&&!t.isNullOrUndefined(r[this.expandStateMapping])&&!r[this.expandStateMapping]&&t.isNullOrUndefined(o)&&(o=i.getElementsByClassName("e-treegridcollapse")[0]),t.isNullOrUndefined(o))return;o.classList.contains("e-treegridcollapse")||t.addClass([o],"e-treegridcollapse"),t.removeClass([o],"e-treegridexpand")}i.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");var m=c.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))});if(a(this)&&!u(this))this.remoteExpand(e,i,r);else{s(this)&&!p.length&&"collapse"!==e||this.localExpand(e,i,r);var S=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,v=this.getRowByIndex(S);this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!t.isNullOrUndefined(v)&&!v.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(v,!0)}if(s(this)&&"expand"===e){var w=this.getCurrentViewRecords().filter(function(e){return h(d,e,d.parentData)});this.dataResults.result=w}if(!t.isNullOrUndefined(o)&&o.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(o.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),o.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!i.cells[0].classList.contains("e-lastrowcell"))for(var I=this.getRows(),R=this.getContentTable().rows,x=(I=[].slice.call(R)).length-1;x>=0;x--)if(!y(I[parseInt(x.toString(),10)])){var C=this.getContentTable().scrollHeight,b=this.getContent().clientHeight;this.lastRowBorder(I[parseInt(x.toString(),10)],C<=b);break}this.notify("rowExpandCollapse",{detailrows:m,action:f,record:r,row:i}),this.updateAltRow(c)}else this.notify("localPagedExpandCollapse",{action:e,row:i,record:r})},d.prototype.updateChildOnDemand=function(e){var r=this;if("collapse"===e.requestType&&s(this)){for(var o=this.flatData.slice(),a=0;a<o.length;a++)o[parseInt(a.toString(),10)].parentUniqueID===e.data.uniqueID&&(o.splice(a,1),a-=1);return void(this.dataResults.result=o)}var d,l=new n.Deferred;this.query?(d=this.grid.getDataModule().getStateEventArgument(this.query)).action=e:d=e,e.childDataBind=l.resolve;var p=e.data;this.trigger("dataStateChange",d),l.promise.then(function(){if(e.childData.length){s(r)&&(r.flatData=r.dataResults.result),r.enableInfiniteScrolling&&s(r)&&(r.flatData=r.infiniteScrollData);for(var n=r.flatData,o=0,a=0;a<n.length;a++)if(n[parseInt(a.toString(),10)].taskData===p.taskData){o=a;break}for(var d=t.getValue("result",r.dataSource),l=g(e.childData),h=p[r.childMapping]&&p[r.childMapping].length>l.length?p[r.childMapping].length:l.length,a=0;a<h;a++)p[r.childMapping]&&d.filter(function(e,t){e[r.parentIdMapping]===p[r.idMapping]&&d.splice(t,1)}),l[parseInt(a.toString(),10)]?(l[parseInt(a.toString(),10)].level=p.level+1,l[parseInt(a.toString(),10)].index=Math.ceil(1e3*Math.random()),l[parseInt(a.toString(),10)].parentItem=t.extend({},p),l[parseInt(a.toString(),10)].taskData=t.extend({},l[parseInt(a.toString(),10)]),delete l[parseInt(a.toString(),10)].parentItem.childRecords,delete l[parseInt(a.toString(),10)].taskData.parentItem,l[parseInt(a.toString(),10)].parentUniqueID=p.uniqueID,l[parseInt(a.toString(),10)].uniqueID=i.getUid(r.element.id+"_data_"),t.setValue("uniqueIDCollection."+l[parseInt(a.toString(),10)].uniqueID,l[parseInt(a.toString(),10)],r),(!t.isNullOrUndefined(l[parseInt(a.toString(),10)][r.childMapping])||l[parseInt(a.toString(),10)][r.hasChildMapping]&&s(r))&&(l[parseInt(a.toString(),10)].hasChildRecords=!0),s(r)&&p[r.childMapping]&&p[r.childMapping][parseInt(a.toString(),10)]?n.splice(o+1+a,0,l[parseInt(a.toString(),10)]):n.splice(o+1+a,p[r.childMapping]&&p[r.childMapping][parseInt(a.toString(),10)]?1:0,l[parseInt(a.toString(),10)])):n.splice(o+1+a,1);n[parseInt(o.toString(),10)][""+r.childMapping]=l,n[parseInt(o.toString(),10)].childRecords=l,n[parseInt(o.toString(),10)].expanded=!0,t.setValue("uniqueIDCollection."+n[parseInt(o.toString(),10)].uniqueID,n[parseInt(o.toString(),10)],r);for(var c=0;c<e.childData.length;c++)d.push(e.childData[parseInt(c.toString(),10)])}s(r)&&!r.loadChildOnDemand&&"expand"===e.requestType&&(r.dataResults.expandRecord={},r.dataResults.expandRecord=e.data),r.isExpandRefresh=!0;var u=r.getContentTable().parentElement.scrollTop;r.grid.refresh(),r.enableInfiniteScrolling&&(r.getContentTable().parentElement.scrollTop=u),r.trigger("expanded",e)})},d.prototype.remoteExpand=function(e,i,r){var n=this.getRows(),o=t.getValue("isCollapseAll",this)?"collapseAll":"refresh";if(this.grid.contentModule.requestType=o,this.rowTemplate){var a=this.getContentTable().rows;n=[].slice.call(a)}var s={data:r,row:i},d=[];if(d=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))||e.querySelector(".e-gridrowindex"+r.index+"level0.e-summarycell")}),"expand"===e){this.notify("remoteExpand",{record:r,rows:d,parentRow:i});var l={row:i,data:r};d.length>0&&this.trigger("expanded",l)}else"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:s.data,rows:null,parentRow:s.row}):(this.collapseRemoteChild({record:r,rows:d}),this.trigger("collapsed",s))},d.prototype.localExpand=function(e,i,r){var n,o=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});this.isPixelHeight()&&i.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(i,!1);var d,l,p=this.getRows();if(this.rowTemplate){var h=this.getContentTable().rows;p=[].slice.call(h)}var c="expand"===e?"e-childrow-visible":"e-childrow-hidden",u=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging){n=[];for(I=0;I<o.length;I++){var g=this.grid.getRowIndexByPrimaryKey(o[parseInt(I.toString(),10)][""+u]);n.push(this.getRows()[parseInt(g.toString(),10)])}}else n=p.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))});var f=this.grid.getFrozenLeftColumnsCount()>0||this.grid.getFrozenRightColumnsCount()>0;(this.frozenRows||this.frozenColumns||this.getFrozenColumns()||f)&&(d=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})),f&&(l=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}));var m=this.grid.getRowsObject(),y=this.grid.currentViewData,S=y.filter(function(e){return e.uniqueID===r.uniqueID}),v=y.indexOf(S[0]);t.isNullOrUndefined(m[parseInt(v.toString(),10)].visible)||!1===m[parseInt(v.toString(),10)].visible||(m[parseInt(v.toString(),10)].visible=!0),this.detailTemplate&&p.forEach(function(e){e.classList.contains("e-detailrow")&&"none"===e.style.display&&(e.style.display="")});for(var w=p.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))}),I=0;I<n.length;I++){if(t.isNullOrUndefined(n[parseInt(I.toString(),10)])||this.toggleRowVisibility(n[parseInt(I.toString(),10)],c),!t.isNullOrUndefined(n[parseInt(I.toString(),10)])&&!this.allowPaging&&!(this.enableVirtualization||this.enableInfiniteScrolling||a(this)||s(this))){t.isNullOrUndefined(m[n[parseInt(I.toString(),10)].rowIndex])||(m[n[parseInt(I.toString(),10)].rowIndex].visible="e-childrow-hidden"!==c);var R=y.filter(function(e){return e.uniqueID===S[0].parentUniqueID});!t.isNullOrUndefined(R[0])&&p[y.indexOf(R[0])].getElementsByClassName("e-treegridcollapse").length&&(m[parseInt(v.toString(),10)].visible=!1)}t.isNullOrUndefined(d)||this.toggleRowVisibility(d[parseInt(I.toString(),10)],c),t.isNullOrUndefined(l)||this.toggleRowVisibility(l[parseInt(I.toString(),10)],c),this.notify("childRowExpand",{row:n[parseInt(I.toString(),10)]}),!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(o[parseInt(I.toString(),10)].childRecords)&&o[parseInt(I.toString(),10)].childRecords.length>0&&("expand"!==e||t.isNullOrUndefined(o[parseInt(I.toString(),10)].expanded)||o[parseInt(I.toString(),10)].expanded)&&(this.expandCollapse(e,n[parseInt(I.toString(),10)],o[parseInt(I.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex&&!t.isNullOrUndefined(d)&&this.expandCollapse(e,d[parseInt(I.toString(),10)],o[parseInt(I.toString(),10)],!0))}for(I=0;I<w.length;I++)t.isNullOrUndefined(w[parseInt(I.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||a(this)||s(this)||(m[w[parseInt(I.toString(),10)].rowIndex].visible="e-childrow-hidden"!==c,this.toggleRowVisibility(w[parseInt(I.toString(),10)],c));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||a(this)||s(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},d.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},d.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var i=0,r=0;e&&r<e.length;r++){var n=e[parseInt(r.toString(),10)];n.classList.contains("e-childrow-hidden")||(n.classList.contains("e-altrow")&&t.removeClass([n],"e-altrow"),i%2==0||n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||t.addClass([n],"e-altrow"),n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||i++)}},d.prototype.treeColumnRowTemplate=function(){var e=this.getContentTable().rows;e=[].slice.call(e);for(var t=this.grid.getRowsObject(),i=0;i<e.length;i++){var r=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],n=e[parseInt(i.toString(),10)],o={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(o)}},d.prototype.collapseRemoteChild=function(e,i){t.isNullOrUndefined(i)||i||!this.loadChildOnDemand||(e.record.expanded=!1);var r,n,o=e.rows,a=[],s=[],d=this.getFrozenLeftColumnsCount()>0||this.getFrozenRightColumnsCount()>0;d&&(a=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}),s=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}));for(var l=0;l<o.length;l++){this.toggleRowVisibility(o[parseInt(l.toString(),10)],"e-childrow-hidden"),r=o[parseInt(l.toString(),10)];var p=o[parseInt(l.toString(),10)].querySelector(".e-detailrowexpand");if(t.isNullOrUndefined(p)||this.grid.detailRowModule.collapse(p),d&&(this.toggleRowVisibility(a[parseInt(l.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(s[parseInt(l.toString(),10)],"e-childrow-hidden"),o[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(a[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?r=a[parseInt(l.toString(),10)]:s[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(r=s[parseInt(l.toString(),10)]))),r.querySelector(".e-treecolumn-container .e-treegridexpand")){var h=r.querySelector(".e-treecolumn-container .e-treegridexpand");n=this.rowTemplate?this.grid.getCurrentViewRecords()[o[parseInt(l.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(o[parseInt(l.toString(),10)].getAttribute("data-Uid")).data,!t.isNullOrUndefined(h)&&n.expanded&&(t.removeClass([h],"e-treegridexpand"),t.addClass([h],"e-treegridcollapse"));for(var c=[],u=this.getRows(),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))&&c.push(u[parseInt(g.toString(),10)]);c.length&&n.expanded&&this.collapseRemoteChild({record:n,rows:c},!1)}}this.grid.pageSettings.totalRecordsCount-=o.length},d.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?t.SanitizeHtmlHelper.sanitize(e):e},d.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("partial-filter-update",this.partialFilterUpdate,this)},d.prototype.updateResultModel=function(e){this.dataResults=e},d.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated),this.grid.off("partial-filter-update",this.partialFilterUpdate))},d.prototype.partialFilterUpdate=function(e){var t=e.gridFiltered;this.notify("updateFilterRecs",{data:t})},d.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},d.prototype.clearFiltering=function(){this.grid.clearFiltering()},d.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},d.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},d.prototype.selectRows=function(e){this.grid.selectRows(e)},d.prototype.clearSelection=function(){t.isNullOrUndefined(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},d.prototype.copy=function(e){this.clipboardModule.copy(e)},d.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},d.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},d.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},d.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},d.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},d.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},d.prototype.getMovableRows=function(){return this.grid.getRows()},d.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},d.prototype.getFrozenRightRows=function(){return this.grid.getRows()},d.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},d.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},d.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},d.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},d.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},d.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},d.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},d.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},d.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},d.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},d.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},d.prototype.getFrozenColumns=function(){return this.getFrozenCount(!t.isNullOrUndefined(this.columns)&&this.columns,0)+this.frozenColumns},d.prototype.getFrozenCount=function(e,t){for(var i=0,r=e.length;i<r;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},d.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},d.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},d.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},d.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},d.prototype.reorderRows=function(e,i,r){t.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,i,r)},d.prototype.indent=function(e){t.isNullOrUndefined(this.rowDragAndDropModule)||(e=e,this.rowDragAndDropModule[this.indentOutdentAction](e,"indent"))},d.prototype.outdent=function(e){t.isNullOrUndefined(this.rowDragAndDropModule)||(e=e,this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent"))};var l;return Re([t.Property(0)],d.prototype,"frozenRows",void 0),Re([t.Property(0)],d.prototype,"frozenColumns",void 0),Re([t.Property("Ellipsis")],d.prototype,"clipMode",void 0),Re([t.Property([])],d.prototype,"columns",void 0),Re([t.Property(null)],d.prototype,"childMapping",void 0),Re([t.Property(null)],d.prototype,"hasChildMapping",void 0),Re([t.Property(0)],d.prototype,"treeColumnIndex",void 0),Re([t.Property(null)],d.prototype,"idMapping",void 0),Re([t.Property(null)],d.prototype,"parentIdMapping",void 0),Re([t.Property(!1)],d.prototype,"enableCollapseAll",void 0),Re([t.Property(null)],d.prototype,"expandStateMapping",void 0),Re([t.Property(!1)],d.prototype,"allowRowDragAndDrop",void 0),Re([t.Property([])],d.prototype,"dataSource",void 0),Re([t.Property()],d.prototype,"query",void 0),Re([t.Property()],d.prototype,"cloneQuery",void 0),Re([t.Property("AllPages")],d.prototype,"printMode",void 0),Re([t.Property(!1)],d.prototype,"allowPaging",void 0),Re([t.Property(!0)],d.prototype,"loadChildOnDemand",void 0),Re([t.Property(!1)],d.prototype,"allowTextWrap",void 0),Re([t.Complex({},T)],d.prototype,"textWrapSettings",void 0),Re([t.Property(!1)],d.prototype,"allowReordering",void 0),Re([t.Property(!1)],d.prototype,"allowResizing",void 0),Re([t.Property(!1)],d.prototype,"autoCheckHierarchy",void 0),Re([t.Complex({},re)],d.prototype,"pageSettings",void 0),Re([t.Complex({},i.RowDropSettings)],d.prototype,"rowDropSettings",void 0),Re([t.Property("USD")],d.prototype,"currencyCode",void 0),Re([t.Property()],d.prototype,"pagerTemplate",void 0),Re([t.Property(!1)],d.prototype,"showColumnMenu",void 0),Re([t.Property(!1)],d.prototype,"showColumnChooser",void 0),Re([t.Complex({},we)],d.prototype,"columnChooserSettings",void 0),Re([t.Property(!1)],d.prototype,"allowSorting",void 0),Re([t.Property(!0)],d.prototype,"allowMultiSorting",void 0),Re([t.Complex({},ge)],d.prototype,"sortSettings",void 0),Re([t.Collection([],se)],d.prototype,"aggregates",void 0),Re([t.Complex({},pe)],d.prototype,"editSettings",void 0),Re([t.Property(!1)],d.prototype,"allowFiltering",void 0),Re([t.Property()],d.prototype,"detailTemplate",void 0),Re([t.Complex({},U)],d.prototype,"filterSettings",void 0),Re([t.Complex({},Y)],d.prototype,"searchSettings",void 0),Re([t.Property()],d.prototype,"toolbar",void 0),Re([t.Property()],d.prototype,"toolbarTemplate",void 0),Re([t.Property("Default")],d.prototype,"gridLines",void 0),Re([t.Property()],d.prototype,"contextMenuItems",void 0),Re([t.Property()],d.prototype,"columnMenuItems",void 0),Re([t.Property()],d.prototype,"rowTemplate",void 0),Re([t.Property("Parent")],d.prototype,"copyHierarchyMode",void 0),Re([t.Property(null)],d.prototype,"rowHeight",void 0),Re([t.Property(!0)],d.prototype,"enableAltRow",void 0),Re([t.Property(!0)],d.prototype,"allowKeyboard",void 0),Re([t.Property(!1)],d.prototype,"enableHover",void 0),Re([t.Property(!1)],d.prototype,"enableAutoFill",void 0),Re([t.Property(!1)],d.prototype,"enableAdaptiveUI",void 0),Re([t.Property(!1)],d.prototype,"enableImmutableMode",void 0),Re([t.Property(!1)],d.prototype,"enableStickyHeader",void 0),Re([t.Property()],d.prototype,"emptyRecordTemplate",void 0),Re([t.Property("auto")],d.prototype,"height",void 0),Re([t.Property("auto")],d.prototype,"width",void 0),Re([t.Complex({},P)],d.prototype,"loadingIndicator",void 0),Re([t.Property(!0)],d.prototype,"enableVirtualMaskRow",void 0),Re([t.Property(!1)],d.prototype,"enableVirtualization",void 0),Re([t.Property(!1)],d.prototype,"enableColumnVirtualization",void 0),Re([t.Property(!1)],d.prototype,"enableHtmlSanitizer",void 0),Re([t.Property(!1)],d.prototype,"enableInfiniteScrolling",void 0),Re([t.Complex({},ye)],d.prototype,"infiniteScrollSettings",void 0),Re([t.Property("All")],d.prototype,"columnQueryMode",void 0),Re([t.Property(!0)],d.prototype,"allowSelection",void 0),Re([t.Property(-1)],d.prototype,"selectedRowIndex",void 0),Re([t.Property(null)],d.prototype,"isRowSelectable",void 0),Re([t.Complex({},$)],d.prototype,"selectionSettings",void 0),Re([t.Property(!1)],d.prototype,"allowExcelExport",void 0),Re([t.Property(!1)],d.prototype,"allowPdfExport",void 0),Re([t.Event()],d.prototype,"created",void 0),Re([t.Event()],d.prototype,"load",void 0),Re([t.Event()],d.prototype,"expanding",void 0),Re([t.Event()],d.prototype,"expanded",void 0),Re([t.Event()],d.prototype,"collapsing",void 0),Re([t.Event()],d.prototype,"collapsed",void 0),Re([t.Event()],d.prototype,"cellSave",void 0),Re([t.Event()],d.prototype,"cellSaved",void 0),Re([t.Event()],d.prototype,"actionBegin",void 0),Re([t.Event()],d.prototype,"actionComplete",void 0),Re([t.Event()],d.prototype,"beginEdit",void 0),Re([t.Event()],d.prototype,"batchAdd",void 0),Re([t.Event()],d.prototype,"batchDelete",void 0),Re([t.Event()],d.prototype,"batchCancel",void 0),Re([t.Event()],d.prototype,"beforeBatchAdd",void 0),Re([t.Event()],d.prototype,"beforeBatchDelete",void 0),Re([t.Event()],d.prototype,"beforeBatchSave",void 0),Re([t.Event()],d.prototype,"cellEdit",void 0),Re([t.Event()],d.prototype,"actionFailure",void 0),Re([t.Event()],d.prototype,"dataBound",void 0),Re([t.Event()],d.prototype,"dataSourceChanged",void 0),Re([t.Event()],d.prototype,"dataStateChange",void 0),Re([t.Event()],d.prototype,"recordDoubleClick",void 0),Re([t.Event()],d.prototype,"rowDataBound",void 0),Re([t.Event()],d.prototype,"detailDataBound",void 0),Re([t.Event()],d.prototype,"queryCellInfo",void 0),Re([t.Event()],d.prototype,"rowSelecting",void 0),Re([t.Event()],d.prototype,"rowSelected",void 0),Re([t.Event()],d.prototype,"rowDeselecting",void 0),Re([t.Event()],d.prototype,"rowDeselected",void 0),Re([t.Event()],d.prototype,"headerCellInfo",void 0),Re([t.Event()],d.prototype,"cellSelecting",void 0),Re([t.Event()],d.prototype,"columnMenuOpen",void 0),Re([t.Event()],d.prototype,"columnMenuClick",void 0),Re([t.Event()],d.prototype,"cellSelected",void 0),Re([t.Event()],d.prototype,"cellDeselecting",void 0),Re([t.Event()],d.prototype,"cellDeselected",void 0),Re([t.Event()],d.prototype,"resizeStart",void 0),Re([t.Event()],d.prototype,"resizing",void 0),Re([t.Event()],d.prototype,"resizeStop",void 0),Re([t.Event()],d.prototype,"columnDragStart",void 0),Re([t.Event()],d.prototype,"columnDrag",void 0),Re([t.Event()],d.prototype,"columnDrop",void 0),Re([t.Event()],d.prototype,"checkboxChange",void 0),Re([t.Event()],d.prototype,"printComplete",void 0),Re([t.Event()],d.prototype,"beforePrint",void 0),Re([t.Event()],d.prototype,"toolbarClick",void 0),Re([t.Event()],d.prototype,"beforeDataBound",void 0),Re([t.Event()],d.prototype,"contextMenuOpen",void 0),Re([t.Event()],d.prototype,"contextMenuClick",void 0),Re([t.Event()],d.prototype,"beforeCopy",void 0),Re([t.Event()],d.prototype,"beforePaste",void 0),Re([t.Event()],d.prototype,"rowDrag",void 0),Re([t.Event()],d.prototype,"rowDragStart",void 0),Re([t.Event()],d.prototype,"rowDragStartHelper",void 0),Re([t.Event()],d.prototype,"rowDrop",void 0),Re([t.Event()],d.prototype,"pdfQueryCellInfo",void 0),Re([t.Event()],d.prototype,"pdfHeaderQueryCellInfo",void 0),Re([t.Event()],d.prototype,"excelQueryCellInfo",void 0),Re([t.Event()],d.prototype,"pdfAggregateQueryCellInfo",void 0),Re([t.Event()],d.prototype,"excelAggregateQueryCellInfo",void 0),Re([t.Event()],d.prototype,"excelHeaderQueryCellInfo",void 0),Re([t.Event()],d.prototype,"beforeExcelExport",void 0),Re([t.Event()],d.prototype,"excelExportComplete",void 0),Re([t.Event()],d.prototype,"beforePdfExport",void 0),Re([t.Event()],d.prototype,"pdfExportComplete",void 0),d=l=Re([t.NotifyPropertyChanges],d)}(t.Component),Ce=function(){function e(e){i.Grid.Inject(i.Reorder),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()},e}(),be=function(){function e(e){i.Grid.Inject(i.Resize),this.parent=e}return e.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},e.prototype.getModuleName=function(){return"resize"},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()},e}(),De=function(){function e(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,i.Grid.Inject(i.RowDD),this.parent=e,this.addEventListener()}return e.prototype.getChildrecordsByParentID=function(e){return(this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource).filter(function(t){return t.uniqueID===e})},e.prototype.addEventListener=function(){this.parent.on("row-draging",this.Rowdraging,this),this.parent.on("row-dropped",this.rowDropped,this),this.parent.on("rows-add",this.rowsAdded,this),this.parent.on("rows-remove",this.rowsRemoved,this)},e.prototype.reorderRows=function(e,i,r){var n=this.parent;if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){"above"===r&&(this.dropPosition="topSegment"),"below"===r&&(this.dropPosition="bottomSegment"),"child"===r&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var o=[],a=0;a<e.length;a++){l=this.parent.getRowByIndex(e[parseInt(a.toString(),10)]).rowIndex;o[parseInt(a.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(l.toString(),10)]}var d={data:o,dropIndex:i};if(s(this.parent)||this.dropRows(d,!0),n.isLocalData&&(n.flatData=this.orderToIndex(n.flatData)),"outdenting"===this.parent.action&&(t.isNullOrUndefined(o[0].parentItem)||(o[0].level=o[0].parentItem.level+1)),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition){var l=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent.action?this.parent.treeColumnIndex:void 0,p=this.parent.getRows()[e[0]],h=d.data[0],c=[];(y=[]).push(h),c.push(p);var u=m(this.parent,d.data[0].parentUniqueID),g=this.parent.getRows()[parseInt(i.toString(),10)];y.push(u),c.push(g),this.updateRowAndCellElements(y,c,l)}if(this.parent.enableImmutableMode&&"outdenting"===this.parent.action){var l=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent.action?this.parent.treeColumnIndex:void 0,f=d.data[0],p=this.parent.getRows()[e[0]],y=[],c=[];y.push(f),c.push(p),this.updateRowAndCellElements(y,c,l)}}}},e.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.parent.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},e.prototype.indentOutdentAction=function(e,i){var r=this.parent,n=-1;if(!t.isNullOrUndefined(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),this.selectedItem=t.isNullOrUndefined(e)?r.getCurrentViewRecords()[parseInt(n.toString(),10)]:e;var o=this.parent.getPrimaryKeyFieldNames()[0],a=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+o]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==n?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(a),this.selectedRecord=this.parent[this.selectedRecords]=-1!==n?r.getCurrentViewRecords()[parseInt(n.toString(),10)]:this.selectedItem,"indent"===i){var s=r.getCurrentViewRecords()[this.selectedRow.rowIndex-1],d=void 0;if(0===this.selectedRow.rowIndex||-1===this.selectedRow.rowIndex||r.getCurrentViewRecords()[this.selectedRow.rowIndex].level-s.level==1)return;if(s.level>this.selectedRecord.level)for(var l=0;l<r.getCurrentViewRecords().length;l++)r.getCurrentViewRecords()[parseInt(l.toString(),10)].taskData===s.parentItem.taskData&&(d=l,r.enableVirtualization&&(d=parseInt(r.getRows()[parseInt(l.toString(),10)].getAttribute("aria-rowindex"),10)-1));else d=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||s.level>this.selectedRecord.level||(d=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),r.action="indenting",r.dropIndex=d,this.eventTrigger("indenting",d)}else if("outdent"===i){var p=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,h=0===r.getCurrentViewRecords()[this.selectedRow.rowIndex].level;if(p||h)return;var c=this.selectedRecord.parentItem;if(-1===(d=r.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===c.uniqueID})))return;if(this.parent.enableVirtualization&&this.selectedRecord){var u=this.parent.getRows()[parseInt(d.toString(),10)].getAttribute("aria-rowindex");d=parseInt(u,10)-1}r.action="outdenting",r.dropIndex=d,this.eventTrigger("outdenting",d)}}},e.prototype.eventTrigger=function(e,t){var i=this,r={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger("actionBegin",r,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},e.prototype.orderToIndex=function(e){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].index=i,!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)){var r=t.getValue("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent);e[parseInt(i.toString(),10)].parentItem.index=r.index}return e},e.prototype.rowsAdded=function(e){for(var i,r=e.records,o=e.records.length-1;o>-1;o--)if((i=r[parseInt(o.toString(),10)]).parentUniqueID){var a=r.filter(function(e){return e.uniqueID===i.parentUniqueID});if(a.length){var s=a[0].childRecords.indexOf(i),d=a[0];-1!==s&&(t.isNullOrUndefined(this.parent.idMapping)&&(d.childRecords.splice(s,1),d.childRecords.length||(d.hasChildRecords=!1,d.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0)}}if(t.isNullOrUndefined(this.parent.dataSource)||!this.parent.dataSource.length){for(var l,p=this.parent,h=e.records,o=e.records.length-1;o>-1;o--){l=h[parseInt(o.toString(),10)],!o&&l.hasChildRecords&&(l.taskData[this.parent.parentIdMapping]=null);if(t.isNullOrUndefined(p.parentIdMapping)||(p.childMapping=null),t.isNullOrUndefined(l.taskData)||t.isNullOrUndefined(p.childMapping)||Object.prototype.hasOwnProperty.call(l.taskData,p.childMapping)||(l.taskData[p.childMapping]=[]),!t.isNullOrUndefined(l[p.childMapping])&&Object.prototype.hasOwnProperty.call(l,p.childMapping)&&l[p.childMapping].length&&!this.isDraggedWithChild&&!t.isNullOrUndefined(p.parentIdMapping))for(var c=l[p.childMapping],u=0;u<c.length;u++)-1===h.indexOf(c[parseInt(u.toString(),10)])&&(h.splice(u,0,c[parseInt(u.toString(),10)]),c[parseInt(u.toString(),10)].taskData=t.extend({},c[parseInt(u.toString(),10)]),o+=1);Object.prototype.hasOwnProperty.call(l,p.parentIdMapping)&&null!==l[p.parentIdMapping]&&!this.isDraggedWithChild&&(l.taskData[p.parentIdMapping]=null,delete l.parentItem,delete l.parentUniqueID),t.isNullOrUndefined(p.dataSource)&&(p.dataSource=[]),p.dataSource.splice(0,0,l.taskData)}p.setProperties({dataSource:p.dataSource},!1)}else{for(o=0;o<r.length;o++)t.setValue("uniqueIDCollection."+r[parseInt(o.toString(),10)].uniqueID,r[parseInt(o.toString(),10)],this.parent);var g={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof n.DataManager?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),t.isNullOrUndefined(this.dropPosition)&&(this.dropPosition="bottomSegment",g.dropIndex=this.parent.getCurrentViewRecords().length>1?this.parent.getCurrentViewRecords().length-1:g.dropIndex,g.data=g.data.map(function(e){return e.hasChildRecords&&t.isNullOrUndefined(e.parentItem)?(e.level=0,e):(delete e.parentItem,delete e.parentUniqueID,e.level=0,e)})),this.dropRows(g)}},e.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},e.prototype.refreshGridDataSource=function(){var e,i,r=this.draggedRecord,o=this.droppedRecord,a=this.parent;if(!(e=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?a.dataSource.dataSource.json:a.dataSource)||t.isNullOrUndefined(o)||o.parentItem||t.isNullOrUndefined(o.taskData)){if(!this.parent.parentIdMapping&&!t.isNullOrUndefined(o)&&o.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition))for(var s=this.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,d=0;d<s.length;d++)o.parentItem.taskData[this.parent.childMapping][parseInt(d.toString(),10)]=s[parseInt(d.toString(),10)].taskData}else{for(var l=Object.keys(e),d=0;d<l.length;d++)if(e[parseInt(d.toString(),10)][this.parent.childMapping])e[parseInt(d.toString(),10)][this.parent.childMapping]===o.taskData[this.parent.childMapping]&&(i=d);else{var p=this.parent.getPrimaryKeyFieldNames()[0];e[parseInt(d.toString(),10)][""+p]===o.taskData[""+p]&&(i=d)}if(!this.parent.idMapping){var h="topSegment"===this.dropPosition?0:1;"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||e.splice(i+h,0,r.taskData)}}this.parent.parentIdMapping&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.parentIdMapping]=o[this.parent.parentIdMapping],r.taskData[this.parent.parentIdMapping]=o[this.parent.parentIdMapping]):(r[this.parent.parentIdMapping]=o[this.parent.idMapping],r.taskData[this.parent.parentIdMapping]=o[this.parent.idMapping]):(r.taskData[this.parent.parentIdMapping]=null,r[this.parent.parentIdMapping]=null))},e.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;this.parent.element.getElementsByClassName("e-firstrow-border").length>0&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},e.prototype.removeLastrowBorder=function(e){if(e&&!(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"))){var t=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,i=this.parent.element.getElementsByClassName("e-lastrow-border")[0];i&&t&&i.remove()}},e.prototype.updateIcon=function(e,r,n){var o=n.target?t.closest(n.target,"tr"):null;this.dropPosition=void 0;var a=0;this.removeFirstrowBorder(o),this.removeLastrowBorder(o);for(var s=0;s<n.rows.length;s++)(t.isNullOrUndefined(o)||o.getAttribute("data-uid")!==n.rows[parseInt(s.toString(),10)].getAttribute("data-uid"))&&i.parentsUntil(n.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),t.isNullOrUndefined(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var d=this.parent,l=0,p=d.toolbar&&d.toolbar.length?document.getElementById(d.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(d.element),c=d.getHeaderContent().offsetHeight+h.top+p,u=d.getContent().firstElementChild.scrollTop;t.isNullOrUndefined(o)||(a=o.offsetTop-u),l=this.parent.enableVirtualization?o.getBoundingClientRect().top:a+c+0;var g=((0!==e[0].offsetHeight&&t.isNullOrUndefined(o)?l+e[0].offsetHeight:l+o.offsetHeight)-l)/3,f=l+g,m=f+g,y=m+g,S=i.getObject("originalEvent.event",n),v=i.getObject("originalEvent.event",n),w="mousemove"===S.type?S.pageY:t.isNullOrUndefined(v)||t.isNullOrUndefined(v.changedTouches)?null:v.changedTouches[0].pageY;this.parent.enableVirtualization&&(w="mousemove"===S.type?S.clientY:t.isNullOrUndefined(v)||t.isNullOrUndefined(v.changedTouches)?null:v.changedTouches[0].clientY);var I=w<=f,R=w>f&&w<=m,x=w>m&&w<=y,C=!0;if(I||R||x)if(I&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(o),this.removeErrorElem(),this.removeLastrowBorder(o)),R&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(o),this.addFirstrowBorder(o)),x&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(o),this.removeFirstrowBorder(o)),(I||x)&&"Invalid"!==this.dropPosition)C=this.updateBorderStatus(e,r),this.topOrBottomBorder(n.target,C);else if(R&&"Invalid"!==this.dropPosition){var b=[],D=t.closest(n.target,"tr");b=[].slice.call(D.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),C=this.updateBorderStatus(e,r),b.length>0&&C&&this.addRemoveClasses(b,!0,"e-childborder")}return this.dropPosition},e.prototype.updateBorderStatus=function(e,i){var r=this,n=!0,o=this.parent.grid.getRows(),a=[],s=!1;t.isNullOrUndefined(this.parent.detailTemplate)||(o=this.parent.getDataRows(),s=!0);var d=this.parent.treeColumnIndex,l=this.parent.allowRowDragAndDrop?s?d+2:d+1:s?d+1:d;t.isNullOrUndefined(this.parent.rowDropSettings.targetID)||(l=d);var p=e,h=[o[""+i]];return"topSegment"===this.dropPosition&&(e.filter(function(r){if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.cells)||t.isNullOrUndefined(h[0])||t.isNullOrUndefined(h[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null===r||void 0===r?void 0:r.cells[""+l].className.match(s),c=h[0].cells[""+l].className.match(s);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c)||t.isNullOrUndefined(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var m=0;m<o.length;m++)if(o[parseInt(m.toString(),10)]===p[0]&&(f=!0),f&&o[parseInt(m.toString(),10)]!==p[0]){var y=+o[parseInt(m.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(y!==u&&y>u))break;a.push(o[parseInt(m.toString(),10)])}return u===g&&(a.length>0&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-(a.length+1)||0===a.length&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1)&&(n=!1),!0}),n=!(!t.isNullOrUndefined(e)&&0===a.length&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1&&t.isNullOrUndefined(e[0]))&&n),"bottomSegment"===this.dropPosition&&(h.filter(function(r){if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.cells)||t.isNullOrUndefined(p[0])||t.isNullOrUndefined(p[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null===r||void 0===r?void 0:r.cells[""+l].className.match(s),c=p[0].cells[""+l].className.match(s);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var m=0;m<o.length;m++)if(o[parseInt(m.toString(),10)]===h[0]&&(f=!0),f&&o[parseInt(m.toString(),10)]!==h[0]){var y=+o[parseInt(m.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(y!==u&&y>u))break;a.push(o[parseInt(m.toString(),10)])}return!t.isNullOrUndefined(e)&&u===g&&(a.length>0&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+(a.length+1)||0===a.length&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1)&&(n=!1),!0}),n=!(!t.isNullOrUndefined(e)&&0===a.length&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1&&t.isNullOrUndefined(e[0]))&&n),"middleSegment"===this.dropPosition&&h.filter(function(e){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e.cells)||t.isNullOrUndefined(p[0])||t.isNullOrUndefined(p[0].cells))return!0;for(var i=0;i<p.length;i++){var o=h[0].rowIndex,a=p[parseInt(i.toString(),10)].cells[""+l].className.match(/index(\d+)|level(\d+)/g);if(!a)return!0;var d=parseInt(a.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(s&&(o/=2),d!==o||r.parent.rowDropSettings.targetID){n=!0;break}n=!1}return n||(r.dropPosition="Invalid",r.addErrorElem()),n}),this.canDrop=n,n},e.prototype.removeChildBorder=function(){var e=[];(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length>0&&this.addRemoveClasses(e,!1,"e-childborder")},e.prototype.addFirstrowBorder=function(e){var i=this.parent.element,r=this.parent;if(e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")){var n=this.parent.createElement("div",{className:"e-firstrow-border"}),o=this.parent.getHeaderContent(),a=0;r.toolbar&&(a=r.toolbarModule.getToolbar().offsetHeight);var s=!t.isNullOrUndefined(this.parent.rowDropSettings.targetID);s&&(n.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+a+"px"),n.style.width=s?i.offsetWidth+"px":i.offsetWidth-this.getScrollWidth()+"px",o.querySelectorAll(".e-firstrow-border").length||o.appendChild(n)}},e.prototype.addLastRowborder=function(e){if(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));if(!t&&e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")){var i=this.parent.createElement("div",{className:"e-lastrow-border"}),r=this.parent.getContent();i.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",r.querySelectorAll(".e-lastrow-border").length||(r.classList.add("e-treegrid-relative"),r.appendChild(i),i.style.bottom=this.getScrollWidth()+"px")}}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?i.Scroll.getScrollBarWidth():0},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-cloneproperties")[0];if(!e.querySelectorAll(".e-errorelem").length&&!this.parent.rowDropSettings.targetID){var t=document.createElement("div");t.classList.add("e-errorcontainer","e-icons","e-errorelem");var i=e.querySelector(".e-rowcell"),r=e.querySelector(".errorValue"),n=i.innerHTML;r&&(n=this.parent.sanitize(r.innerHTML),r.parentNode.removeChild(r)),i.innerHTML="";var o=document.createElement("span");o.className="errorValue",o.style.paddingLeft="16px",o.innerHTML=this.parent.sanitize(n),i.appendChild(t),i.appendChild(o);var a=document.querySelector(".e-dropitemscount");if(this.hasDropItem&&a){var s=parseInt(a.style.left,10)+t.offsetWidth+16,d=this.parent.enableRtl?0:s;a.style.left=d+"px",this.hasDropItem=!1}}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");if(e){if(r){var n=parseInt(r.style.left,10)-e.offsetWidth-16;t.setStyleAttribute(i,{paddingLeft:"0px"}),this.parent.enableRtl||t.setStyleAttribute(r,{left:n+"px"})}e.remove()}this.hasDropItem=!0},e.prototype.topOrBottomBorder=function(e,i){void 0===i&&(i=!0);var r=t.closest(e,"tr"),n=r?Array.from(r.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];if(n.length){var o=i?this.addRemoveClasses.bind(this,n,!0):this.addRemoveClasses.bind(this,n,!1,"e-dragborder");if("topSegment"===this.dropPosition){o("e-droptop");var a=this.parent.element.querySelector(".e-lastrow-dragborder");a&&a.remove()}"bottomSegment"===this.dropPosition&&o("e-dropbottom")}},e.prototype.removetopOrBottomBorder=function(){var e=[];e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop")),this.parent.rowDropSettings.targetID&&(e=[].slice.call(document.querySelectorAll(".e-dropbottom, .e-droptop"))),e.length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},e.prototype.addRemoveClasses=function(e,t,i){for(var r=0,n=e.length;r<n;r++)t?e[parseInt(r.toString(),10)].classList.add(i):e[parseInt(r.toString(),10)].classList.remove(i)},e.prototype.getOffset=function(e){var t=e.getBoundingClientRect(),i=document.body,r=document.documentElement,n=window.pageYOffset||r.scrollTop||i.scrollTop,o=window.pageXOffset||r.scrollLeft||i.scrollLeft,a=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,d=t.top+n-a,l=t.left+o-s;return{top:Math.round(d),left:Math.round(l)}},e.prototype.Rowdraging=function(e){var r=this.parent,n=this.parent.element.querySelector(".e-cloneproperties");if(n){n.style.cursor="";var o=e.target?t.closest(e.target,"tr"):null,a=-1;if(-1===(a=t.isNullOrUndefined(this.parent.detailTemplate)?o?o.rowIndex:-1:o?this.parent.getDataRows().indexOf(o):-1))return this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),void this.removeChildBorder();var s=Array.isArray(e.data)?e.data:[e.data],d=r.getCurrentViewRecords()[parseInt(a.toString(),10)];if(r.rowDropSettings.targetID&&(p=i.parentsUntil(e.target,"e-treegrid"))&&p.id===this.parent.rowDropSettings.targetID&&(d=(l=p.ej2_instances[0]).getCurrentViewRecords()[parseInt(a.toString(),10)]),this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(s,d),r.rowDropSettings.targetID||!this.canDrop||t.isNullOrUndefined(e.rows[0])||r.rowDragAndDropModule.updateIcon(e.rows,a,e),r.rowDropSettings.targetID&&(p=i.parentsUntil(e.target,"e-treegrid"))&&p.id===this.parent.rowDropSettings.targetID){var l=p.ej2_instances[0];l.rowDragAndDropModule.updateIcon(e.rows,a,e),this.dropPosition=l.rowDragAndDropModule.dropPosition}if(e.target&&t.closest(e.target,"#"+r.rowDropSettings.targetID)){var p=i.parentsUntil(e.target,"e-treegrid");p||(n.style.cursor="default")}}},e.prototype.rowDropped=function(e){var r=this.parent;if(r.rowDropSettings.targetID){if((e.target&&t.closest(e.target,"#"+r.rowDropSettings.targetID)||i.parentsUntil(e.target,"e-treegrid")&&i.parentsUntil(e.target,"e-treegrid").id===r.rowDropSettings.targetID||e.target&&document.getElementById(r.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),t.setValue("dropPosition",this.dropPosition,e),r.trigger("rowDrop",e),!e.cancel&&r.rowDropSettings.targetID)){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),r.isLocalData&&(r.flatData=this.orderToIndex(r.flatData))}}else if((i.parentsUntil(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),t.setValue("dropPosition",this.dropPosition,e),r.trigger("rowDrop",e),!e.cancel)){if(!s(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;s(this.parent)||this.dropRows(e),r.isLocalData&&(r.flatData=this.orderToIndex(r.flatData)),r.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!t.isNullOrUndefined(e.data[0].parentItem)){var n=this.parent.treeColumnIndex;n+=1;var o=this.parent.getPrimaryKeyFieldNames()[0],a=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+o]),d=this.parent.getRows()[parseInt(a.toString(),10)],l=e.data[0];if("middleSegment"===this.dropPosition){var p=[],h=[];p.push(l),h.push(d);l=m(this.parent,e.data[0].parentUniqueID),a=this.parent.grid.getRowIndexByPrimaryKey(l[""+o]);var c=this.parent.getRows()[parseInt(a.toString(),10)];p.push(l),h.push(c);for(var u=0;u<p.length;u++)this.parent.renderModule.cellRender({data:p[parseInt(u.toString(),10)],cell:h[parseInt(u.toString(),10)].cells[parseInt(n.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});var g=c.getElementsByClassName("e-treegridcollapse")[0];t.isNullOrUndefined(g)||(t.removeClass([g],"e-treegridcollapse"),t.addClass([g],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:l,cell:d.cells[parseInt(n.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},e.prototype.removeRowBorders=function(){var e=this;["e-firstrow-border","e-lastrow-border"].forEach(function(t){var i=e.parent.element.getElementsByClassName(t)[0];i&&i.remove()})},e.prototype.dragDropGrid=function(e){var r,n=this.parent,o=t.closest(e.target,"tr"),d=isNaN(this.getTargetIdx(o))?0:this.getTargetIdx(o),l=i.parentsUntil(e.target,"e-treegrid");if(l&&l.id===this.parent.rowDropSettings.targetID&&!a(this.parent)&&!s(this.parent)){r=l.ej2_instances[0];for(var p=n.getSelectedRecords(),h=[],u=0;u<p.length;u++)h[parseInt(u.toString(),10)]=p[parseInt(u.toString(),10)].index;var g=r.dataSource;if(null!==this.parent.idMapping&&(t.isNullOrUndefined(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!g.length){for(var f=[],u=0;u<p.length;u++)if(p[parseInt(u.toString(),10)].hasChildRecords){f.push(p[parseInt(u.toString(),10)]);for(var m=c(p[parseInt(u.toString(),10)]),y=0;y<m.length;y++)f.push(m[parseInt(y.toString(),10)])}f.length&&(p=f)}n.notify("rows-remove",{indexes:h,records:p}),r.notify("rows-add",{toIndex:d,records:p});var S=r.rowDragAndDropModule.treeGridData;if(!t.isNullOrUndefined(S))for(u=0;u<S.length;u++)if(S[parseInt(u.toString(),10)].index=u,!t.isNullOrUndefined(S[parseInt(u.toString(),10)].parentItem)){var v=t.getValue("uniqueIDCollection."+S[parseInt(u.toString(),10)].parentUniqueID+".index",r);S[parseInt(u.toString(),10)].parentItem.index=v}n.grid.refresh(),r.grid.refresh(),r.grid.dataSource.length>1&&(r.grid.refresh(),t.isNullOrUndefined(r.getHeaderContent().querySelector(".e-firstrow-border"))||r.getHeaderContent().querySelector(".e-firstrow-border").remove(),t.isNullOrUndefined(r.getContent().querySelector(".e-lastrow-border"))||r.getContent().querySelector(".e-lastrow-border").remove())}s(this.parent)&&(r=l.ej2_instances[0],n.grid.refresh(),r.grid.refresh())},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},e.prototype.getParentData=function(e,t){var i=e.parentItem,r=-1;if(this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?r=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(r=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition){var n=this.parent.getPrimaryKeyFieldNames()[0],o=-1===r?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+n]):this.parent.getSelectedRowIndexes()[0],a=this.parent.getCurrentViewRecords()[parseInt(o.toString(),10)];this.droppedRecord=m(this.parent,a.parentItem.uniqueID)}"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===i.level?this.droppedRecord=m(this.parent,i.uniqueID):this.getParentData(i))},e.prototype.dropRows=function(e,i){if("Invalid"!==this.dropPosition&&!a(this.parent)){var r,n=this.parent,o=void 0;if(t.isNullOrUndefined(e.dropIndex)){var s=this.parent.getPrimaryKeyFieldNames()[0],d=-1===n.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+s])-1:n.getSelectedRowIndexes()[0]-1,l=n.getCurrentViewRecords()[parseInt(d.toString(),10)];this.getParentData(l,e.data)}else if(e.dropIndex=e.dropIndex===e.fromIndex?this.getTargetIdx(e.target.parentElement):e.dropIndex,this.parent.enableVirtualization){var p=this.parent.getRowByIndex(e.dropIndex).rowIndex;this.droppedRecord=n.getCurrentViewRecords()[parseInt(p.toString(),10)]}else if(t.isNullOrUndefined(this.parent.rowDropSettings.targetID))this.droppedRecord=n.getCurrentViewRecords()[e.dropIndex];else{var h=this.parent.grid.getRowsObject();this.droppedRecord=h.length>0?h[e.dropIndex].data:void 0}var c=[];o=this.droppedRecord,e.data[0]?c=e.data:c.push(e.data),this.parent[this.modifiedRecords].push(e.data[0],o);var u=0,g=this.parent.rowDropSettings.targetID;this.isMultipleGrid=g,g?this.isaddtoBottom=g&&this.isDraggedWithChild:this.ensuredropPosition(c,o);var f=c.length;(!t.isNullOrUndefined(this.parent.idMapping)||"bottomSegment"===this.dropPosition&&c.length>1&&t.isNullOrUndefined(this.parent.idMapping))&&c.reverse();for(var m=this,y=0;y<f;y++)!function(a){if(r=c[parseInt(a.toString(),10)],m.draggedRecord=r,!m.draggedRecord.hasChildRecords)for(var s=0,d=c;s<d.length;s++){var l=d[s];t.isNullOrUndefined(l.childRecords)||-1===l.childRecords.indexOf(m.draggedRecord)||(m.draggedRecord=void 0)}if(!t.isNullOrUndefined(m.draggedRecord)){if("Invalid"!==m.dropPosition&&!t.isNullOrUndefined(m.droppedRecord)){if(n.rowDropSettings.targetID&&!i||m.deleteDragRow(),m.draggedRecord===m.droppedRecord){var p=m.getTargetIdx(e.target.offsetParent.parentElement);isNaN(p)&&(p=m.getTargetIdx(e.target.parentElement)),e.dropIndex=p,o=m.droppedRecord=m.parent.getCurrentViewRecords()[e.dropIndex]}(o.parentItem||"middleSegment"===m.dropPosition)&&-1!==(S=(y=n.parentData).indexOf(m.draggedRecord))&&y.splice(S,1);var h=m.treeGridData.indexOf(o);if(m.dropAtTop(h),"bottomSegment"===m.dropPosition){if(o.hasChildRecords?(u=m.getChildCount(o,0),m.parent.parentIdMapping&&m.treeData.splice(h+u+1,0,m.draggedRecord.taskData),m.treeGridData.splice(h+u+1,0,m.draggedRecord)):(m.parent.parentIdMapping&&m.treeData.splice(h+1,0,m.draggedRecord.taskData),m.treeGridData.splice(h+1,0,m.draggedRecord)),t.isNullOrUndefined(o.parentItem)&&(delete r.parentItem,delete r.parentUniqueID,r.level=0,m.parent.parentIdMapping&&(r[m.parent.parentIdMapping]=null)),o.parentItem){var g=m.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,f=g.indexOf(o)+1;g.splice(f,0,r),r.parentItem=o.parentItem,r.parentUniqueID=o.parentUniqueID,r.level=o.level,m.parent.parentIdMapping&&(r[m.parent.parentIdMapping]=o[m.parent.parentIdMapping],r.parentItem=o.parentItem,r.level=o.level)}if(r.hasChildRecords){m.updateChildRecordLevel(r,1),m.updateChildRecord(r,h+u+1)}}m.dropMiddle(h)}if(t.isNullOrUndefined(r.parentItem)){var y=n.parentData,S=y.indexOf(m.droppedRecord),v=0;y.filter(function(e){r.uniqueID===e.uniqueID&&v++}),"bottomSegment"===m.dropPosition&&0===v?y.splice(S+1,0,r):"topSegment"===m.dropPosition&&0===v&&y.splice(S,0,r)}n.rowDragAndDropModule.refreshGridDataSource()}}(y)}},e.prototype.dropMiddle=function(e){var i=this.parent,r=c(this.droppedRecord),n=t.isNullOrUndefined(r)||0===r.length?e+1:r.length+e+1;"middleSegment"===this.dropPosition&&(i.parentIdMapping?(this.treeData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord)):this.treeGridData.splice(n,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n))},e.prototype.dropAtTop=function(e){var t=this.parent;if("topSegment"===this.dropPosition){t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData);var i=this.treeGridData[parseInt(e.toString(),10)];if(this.draggedRecord.parentItem=i.parentItem,this.draggedRecord.parentUniqueID=i.parentUniqueID,this.draggedRecord.level=i.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords){this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)}if(this.droppedRecord.parentItem){var r=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords,n=r.indexOf(this.droppedRecord);r.splice(n,0,this.draggedRecord)}}},e.prototype.recordLevel=function(){var e=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=e.childMapping;if(r.hasChildRecords||(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,(t.isNullOrUndefined(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!e.parentIdMapping&&t.isNullOrUndefined(r.taskData[""+n])&&(r.taskData[""+n]=[]))),"middleSegment"===this.dropPosition){var o=t.extend({},r);delete o.childRecords,i.parentItem=o,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i),t.setValue("uniqueIDCollection."+i.uniqueID,i,e);if(e.isSelfReference&&(r[e.childMapping]=[],r[e.childMapping].splice(r[e.childMapping].length,0,i)),t.isNullOrUndefined(i)||e.parentIdMapping||t.isNullOrUndefined(r.taskData[""+n])||r.taskData[e.childMapping].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords){i.level=r.level+1,this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager&&u(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=m(this.parent,this.draggedRecord.uniqueID);!t.isNullOrUndefined(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},e.prototype.updateChildRecord=function(e,i){var r,n=this.parent,o=0;if(!e.hasChildRecords)return 0;o=e.childRecords.length;for(var a=0;a<o;a++)r=this.isMultipleGrid?e.childRecords[parseInt(a.toString(),10)]:t.getValue("uniqueIDCollection."+e.childRecords[parseInt(a.toString(),10)].uniqueID,n),i++,n.flatData.splice(i,0,r),t.setValue("uniqueIDCollection."+r.uniqueID,r,this.parent),n.parentIdMapping&&this.treeData.splice(i,0,r.taskData),r.hasChildRecords&&(i=this.updateChildRecord(r,i));return i},e.prototype.updateChildRecordLevel=function(e,i){var r,n=0;if(i++,!e.hasChildRecords)return 0;n=e.childRecords.length;for(var o=0;o<n;o++){r=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:t.getValue("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,this.parent);var a=void 0;e.parentItem&&(a=m(this.parent,e.parentItem.uniqueID)),t.isNullOrUndefined(a)&&!t.isNullOrUndefined(e.parentItem)&&(a=e.parentItem),r.level=e.parentItem?a.level+i:e.level+1,r.hasChildRecords&&(i--,i=this.updateChildRecordLevel(r,i))}return i},e.prototype.removeRecords=function(e){var i,r=this,o=this.parent;i=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;var a=e,s=!t.isNullOrUndefined(o.parentIdMapping),d=this.getChildrecordsByParentID(a.parentUniqueID)[0];if(a){if(a.parentItem){var l=d?d.childRecords:[],p=0;l&&l.length>0&&(p=l.indexOf(a),d.childRecords.splice(p,1),this.parent.parentIdMapping&&!o.enableImmutableMode||S({value:a,action:"delete"},this.parent,s,a.index,a.index))}if(o.parentIdMapping){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);var h=i.findIndex(function(e){return e[r.parent.idMapping]===a.taskData[r.parent.idMapping]}),c=this.treeGridData.findIndex(function(e){return e[r.parent.idMapping]===a.taskData[r.parent.idMapping]});-1===h||t.isNullOrUndefined(h)||i.splice(h,1),-1===c||t.isNullOrUndefined(c)||this.treeGridData.splice(c,1)}var g=this.treeGridData.indexOf(a);if(!o.parentIdMapping){var f=this.parent.parentData.indexOf(a);-1!==f&&(o.parentData.splice(f,1),i.splice(f,1))}if(-1===g&&!o.parentIdMapping)for(var m=o.getPrimaryKeyFieldNames()[0],y=0;y<this.treeGridData.length;y++)this.treeGridData[parseInt(y.toString(),10)][""+m]===a[""+m]&&(g=y);if(!o.parentIdMapping){var v=this.getChildCount(a,0);this.treeGridData.splice(g,v+1)}a.parentItem&&d&&d.childRecords&&!d.childRecords.length&&(d.expanded=!1,d.hasChildRecords=!1,d.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(d)||t.isNullOrUndefined(d)||this.parent[this.modifiedRecords].push(d),t.isNullOrUndefined(d)||this.updateModifiedRecords(d)}},e.prototype.updateModifiedRecords=function(e){var i=m(this.parent,e.parentUniqueID);t.isNullOrUndefined(i)||(this.parent[this.modifiedRecords].push(i),this.updateModifiedRecords(i))},e.prototype.removeChildItem=function(e){var i,r,o,a;a=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var s=0;s<e.childRecords.length;s++){i=e.childRecords[parseInt(s.toString(),10)],!t.isNullOrUndefined(i.childRecords)&&i.childRecords.length&&(i.hasChildRecords=!0);var d=void 0;d=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var l=0;l<d.length;l++)d[parseInt(l.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]&&(r=l);for(var p=0;p<this.treeGridData.length;p++)if(this.treeGridData[parseInt(p.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]){o=p;break}-1===r||t.isNullOrUndefined(r)||a.splice(r,1),-1===o||t.isNullOrUndefined(o)||this.treeGridData.splice(o,1),i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[parseInt(r.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.ensuredropPosition=function(e,i){var r=this;e.filter(function(e){if(e.hasChildRecords&&!t.isNullOrUndefined(e.childRecords)){if(-1!==e.childRecords.indexOf(i))return r.dropPosition="Invalid",r.addErrorElem(),r.canDrop=!1,void(t.isNullOrUndefined(r.parent.rowDropSettings.targetID)&&(r.removetopOrBottomBorder(),r.removeChildBorder()));r.ensuredropPosition(e.childRecords,i)}})},e.prototype.isDuplicateData=function(e){var t=this.parent.getPrimaryKeyFieldNames();return 0!==t.length&&this.parent.flatData.some(function(i){return t.every(function(t){return i[t]===e[t]})})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("row-draging",this.Rowdraging),this.parent.off("row-dropped",this.rowDropped),this.parent.off("rows-add",this.rowsAdded),this.parent.off("rows-remove",this.rowsRemoved))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e}(),Me=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oe=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Me(i,e),Oe([t.Property()],i.prototype,"targetID",void 0),i}(t.ChildProperty),Ae=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ee=function(e){function i(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return Ae(i,e),i.prototype.addEventListener=function(){this.parent.on("data-listener",this.getDatas,this)},i.prototype.getDatas=function(e){this.visualData=e.data},i.prototype.getDataInfo=function(){return e.prototype.getData.call(this)},i.prototype.generateRows=function(i,r){var o=this.getDataInfo();if("refresh"===r.requestType&&r.isExpandCollapse&&(r.virtualInfo=this.prevInfo),t.isNullOrUndefined(r.virtualInfo)||this.parent.root.loadChildOnDemand&&a(this.parent.root)||("right"!==r.virtualInfo.direction&&"left"!==r.virtualInfo.direction?a(this.parent.root)&&!s(this.parent)&&1!==r.virtualInfo.blockIndexes.length||(r.virtualInfo.blockIndexes=o.blockIndexes):r.virtualInfo.blockIndexes=this.getBlockIndexes(r.virtualInfo.page)),this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent))return e.prototype.generateRows.call(this,i,r);t.isNullOrUndefined(r.requestType)||"collapseAll"!==r.requestType.toString()||(r.requestType="refresh");var d=e.prototype.generateRows.call(this,i,r);if(!t.isNullOrUndefined(this.visualData))for(var l=0;l<d.length;l++)d[parseInt(l.toString(),10)].index=this.visualData.indexOf(d[parseInt(l.toString(),10)].data);return d},i.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(t){return e===t});if(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent)){var i=this.model.currentPage;t?(this.cache={},this.data={},this.groups={}):"virtualscroll"===e&&this.cache[parseInt(i.toString(),10)]&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&(this.cache[parseInt(i.toString(),10)]=this.cache[parseInt(i.toString(),10)].slice(0,this.parent.contentModule.getBlockSize()))}else(t||"virtualscroll"===e)&&(this.cache={},this.data={},this.groups={});return t},i}(i.VirtualRowModelGenerator),Ne=function(){function e(e){i.Grid.Inject(i.Filter),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},e.prototype.updatedFilteredRecord=function(e){t.setValue("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var r=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode,n=0;n<this.flatFilteredData.length;n++){var o=this.flatFilteredData[parseInt(n.toString(),10)];this.addParentRecord(o),"Child"!==r&&"None"!==r||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0);var a=i.getObject("childRecords",o);!t.isNullOrUndefined(a)&&a.length&&t.setValue("hasFilteredChildRecords",this.checkChildExsist(o),o);var s=i.getObject("parentItem",o);if(!t.isNullOrUndefined(s)){var d=m(this.parent,o.parentItem.uniqueID,!0);t.setValue("hasFilteredChildRecords",!0,d),d&&d.parentItem&&this.updateParentFilteredRecord(d)}}this.flatFilteredData.length>0&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},e.prototype.updateParentFilteredRecord=function(e){var i=m(this.parent,e.parentItem.uniqueID,!0),r=t.getValue("uniqueIDFilterCollection",this.parent);i&&Object.prototype.hasOwnProperty.call(r,i.uniqueID)&&t.setValue("hasFilteredChildRecords",!0,i),i&&i.parentItem&&this.updateParentFilteredRecord(i)},e.prototype.addParentRecord=function(e){var i=m(this.parent,e.parentUniqueID);if("None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)t.isNullOrUndefined(i)||("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key?this.addParentRecord(i):-1!==this.flatFilteredData.indexOf(i)&&this.addParentRecord(i)),-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent));else if(t.isNullOrUndefined(i)){if(-1!==this.flatFilteredData.indexOf(e))return void(-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0))}else this.addParentRecord(i),-1!==this.flatFilteredData.indexOf(i)||-1!==this.filteredResult.indexOf(i)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))},e.prototype.checkChildExsist=function(e){for(var r=i.getObject("childRecords",e),n=!1,o=0;o<r.length;o++){var a=r[parseInt(o.toString(),10)].childRecords,s=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;if(!("Child"!==s&&"Both"!==s||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)){var d=t.getValue("uniqueIDFilterCollection",this.parent);Object.prototype.hasOwnProperty.call(d,r[parseInt(o.toString(),10)].uniqueID)||(this.filteredResult.push(r[parseInt(o.toString(),10)]),t.setValue("uniqueIDFilterCollection."+r[parseInt(o.toString(),10)].uniqueID,r[parseInt(o.toString(),10)],this.parent),n=!0)}if("None"===s&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(r[parseInt(o.toString(),10)])){n=!0;break}!t.isNullOrUndefined(a)&&a.length&&(n=this.checkChildExsist(r[parseInt(o.toString(),10)])),"Child"!==s&&"Both"!==s||!r.length||(n=!0)}return n},e.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=m(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);if(-1!==e.indexOf(r)){var n=m(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0);e[parseInt(i.toString(),10)].filterLevel=n.filterLevel+1}else e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)])}},e.prototype.clearFilterLevel=function(e){var i,r=0,n=e.flatData,o=n.length;for(r;r<o;r++){var a=(i=n[parseInt(r.toString(),10)]).filterLevel;!a&&0!==a&&t.isNullOrUndefined(i.hasFilteredChildRecords)||(i.hasFilteredChildRecords=null,i.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:n,count:n.length})},e}(),Ue=function(){function e(e){this.isCollapsedStatePersist=!1,i.Grid.Inject(i.ExcelExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"ExcelExport"},e.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.on("excelAggregateCellInfo",this.excelAggregateCellInfo,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.off("excelAggregateCellInfo",this.excelAggregateCellInfo),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},e.prototype.updateExcelResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,r,o,a,s){var d=this,l=this.parent.dataSource,p=new i.Data(this.parent.grid),h=Object();if(t.setValue("isCsv",s,h),t.setValue("cancel",!1,h),t.isNullOrUndefined(e)||(this.isCollapsedStatePersist=e.isCollapsedStatePersist),!t.isNullOrUndefined(e)){if(!this.isLocal()&&!t.isNullOrUndefined(e.dataSource)&&!e.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,e,r,o,s,a);if("CurrentPage"===e.exportType)return e.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,e,r,o,s,a)}return new Promise(function(c){var u=!d.isLocal()||l instanceof n.DataManager?d.parent.dataSource:new n.DataManager(l),g=new n.Query;if(d.isLocal()||((g=d.generateQuery(g)).queries=d.parent.grid.getDataModule().generateQuery().queries,g=i.ExportHelper.getQuery(d.parent.grid,p),t.isNullOrUndefined(d.parent.filterModule)&&(g.queries=g.queries.slice(1,2),g.params=g.params.slice(0,0)),t.setValue("query",g,h)),d.parent.trigger("beforeExcelExport",t.extend(h,e)),i.getObject("cancel",h))return null;u.executeQuery(g).then(function(i){var n=null;return t.isNullOrUndefined(e)||t.isNullOrUndefined(e.dataSource)||(n=e.dataSource),e=d.manipulateExportProperties(e,l,i),d.parent.grid.excelExportModule.Map(d.parent.grid,e,r,o,s,a).then(function(t){null!=n?e.dataSource=n:delete e.dataSource,c(t)})})})},e.prototype.generateQuery=function(e,r){return!t.isNullOrUndefined(r)&&"CurrentPage"===r.exportType&&this.parent.allowPaging&&(r.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=i.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulateExportProperties=function(e,r,o){var a=Object();if(t.isNullOrUndefined(this.parent.grid.getDataModule())||t.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),a),t.setValue("isExport",!0,a),t.isNullOrUndefined(e)||t.isNullOrUndefined(e.exportType)||t.setValue("exportType",e.exportType,a),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(i.getObject("result",o)),t.setValue("expresults",this.parent.flatData,a)),this.parent.notify("dataProcessor",a),a=this.dataResults,r=t.isNullOrUndefined(a.result)?this.parent.flatData.slice(0):a.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource){var s=this.parent.flatData,d=e.dataSource instanceof n.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(d),r=this.parent.flatData,this.parent.flatData=s}return e=t.isNullOrUndefined(e)?Object():e,e.dataSource=new n.DataManager({json:r}),this.parent.aggregates.length>0&&(e.query=a.query),e},e.prototype.excelQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=e.data,n=t.isNullOrUndefined(r.filterLevel)?r.level:r.filterLevel;i.indent=n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},e.prototype.excelAggregateCellInfo=function(e){this.parent.trigger("excelAggregateQueryCellInfo",e)},e.prototype.exportRowDataBound=function(e){if("excel"===e.type){var i=e.rowObj.data,r=this.parent.grid.filterSettings.columns.length,n=e.excelRows.length,o=i.level;if(i.parentItem&&m(this.parent,i.parentItem.uniqueID,Boolean(r))){var a=!1,s=!1,d=h(this.parent,i,this.parent.parentData);!this.isCollapsedStatePersist||d&&this.parent.isLocalData||(a=!0,s=!i.expanded),e.excelRows[n-1].grouping={outlineLevel:o,isCollapsed:s,isHidden:a}}else i.hasChildRecords&&t.isNullOrUndefined(i.parentItem)&&(e.excelRows[n-1].grouping={outlineLevel:o})}},e.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},e.prototype.isLocal=function(){return!a(this.parent)&&u(this.parent)},e}(),ke=function(){function e(e){i.Grid.Inject(i.PdfExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this),this.parent.on("pdfAggregateCellInfo",this.pdfAggregateCellInfo,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel),this.parent.off("pdfAggregateCellInfo",this.pdfAggregateCellInfo))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updatePdfResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,r,o,s){var d=this,l=this.parent.dataSource,p=Object(),h=!a(this.parent)&&u(this.parent);return t.setValue("cancel",!1,p),new Promise(function(a){var c=!h||l instanceof n.DataManager?d.parent.dataSource:new n.DataManager(l),u=new n.Query;if(h||(u=d.generateQuery(u),t.setValue("query",u,p)),d.parent.trigger("beforePdfExport",t.extend(p,e)),i.getObject("cancel",p))return null;c.executeQuery(u).then(function(i){var n=null;return t.isNullOrUndefined(e)||t.isNullOrUndefined(e.dataSource)||(n=e.dataSource),e=d.manipulatePdfProperties(e,l,i),d.parent.grid.pdfExportModule.Map(d.parent.grid,e,r,o,s).then(function(t){null!=n?e.dataSource=n:delete e.dataSource,a(t)})})})},e.prototype.generateQuery=function(e,r){return!t.isNullOrUndefined(r)&&"CurrentPage"===r.exportType&&this.parent.allowPaging&&(r.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=i.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulatePdfProperties=function(e,i,r){var o={},s=!a(this.parent)&&u(this.parent);if(t.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),o),t.setValue("isExport",!0,o),t.setValue("isPdfExport",!0,o),t.isNullOrUndefined(e)||t.isNullOrUndefined(e.isCollapsedStatePersist)||t.setValue("isCollapsedStatePersist",e.isCollapsedStatePersist,o),t.isNullOrUndefined(e)||t.isNullOrUndefined(e.exportType)||t.setValue("exportType",e.exportType,o),s||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(t.getValue("result",r)),t.setValue("expresults",this.parent.flatData,o)),this.parent.notify("dataProcessor",o),o=this.dataResults,i=t.isNullOrUndefined(o.result)?this.parent.flatData.slice(0):o.result,s||(this.parent.flatData=[]),e&&e.dataSource&&s){var d=this.parent.flatData,l=e.dataSource instanceof n.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(l),i=this.parent.flatData,this.parent.flatData=d}return e=t.isNullOrUndefined(e)?{}:e,e.dataSource=new n.DataManager({json:i}),e.query=o.query,e},e.prototype.pdfQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var r={},n=i.getObject("data",e),o=t.isNullOrUndefined(n.filterLevel)?n.level:n.filterLevel;r.paragraphIndent=3*o,e.style=r}this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},e.prototype.pdfAggregateCellInfo=function(e){this.parent.trigger("pdfAggregateQueryCellInfo",e)},e}(),qe=function(){function e(e){i.Grid.Inject(i.Page),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("localPagedExpandCollapse",this.collapseExpandPagedchilds,this),this.parent.on("pagingActions",this.pageAction,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("localPagedExpandCollapse",this.collapseExpandPagedchilds),this.parent.off("pagingActions",this.pageAction))},e.prototype.getModuleName=function(){return"pager"},e.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},e.prototype.updateExternalMessage=function(e){if(t.isNullOrUndefined(e)){this.parent.trigger("actionFailure",{error:"The provided value for the message is undefined. Please ensure the message contains string."})}this.parent.grid.pagerModule.updateExternalMessage(e)},e.prototype.collapseExpandPagedchilds=function(e){if(e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded}),this.parent.enableImmutableMode){var i=this.parent.getPrimaryKeyFieldNames()[0],r=this.parent.flatData.filter(function(t){return t[""+i]===e.record[""+i]});r.length&&(r[0].expanded=e.record.expanded)}var n={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};if(t.getValue("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode){var o=void 0;"collapse"===n.action?(o=n.row.getElementsByClassName("e-treegridexpand")[0],t.isNullOrUndefined(o)||(t.removeClass([o],"e-treegridexpand"),t.addClass([o],"e-treegridcollapse"))):"expand"===n.action&&(o=n.row.getElementsByClassName("e-treegridcollapse")[0],t.isNullOrUndefined(o)||(t.removeClass([o],"e-treegridcollapse"),t.addClass([o],"e-treegridexpand")))}},e.prototype.pageRoot=function(e,i,r){for(var n=t.isNullOrUndefined(r)?[]:r,o=this,a=0;a<i.length;a++)!function(t){n.push(i[parseInt(t.toString(),10)]);var r=[];i[parseInt(t.toString(),10)].hasChildRecords&&(r=e.filter(function(e){return i[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),n=o.pageRoot(e,r,n))}(a);return n},e.prototype.updatePageSize=function(e){var t=e.count,i=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&i.pagerObj.pagerdropdownModule.dropDownListObject.value===i.pagerObj.getLocalizedLabel("All")&&(i.pagerObj.totalRecordsCount=t,this.parent.grid.pageSettings.pageSize=t)},e.prototype.pageAction=function(e){var t=this,i=new n.DataManager(e.result);if("Root"===this.parent.pageSettings.pageSizeMode){var r=[],o=this.parent.grid.filterSettings.columns.length>0&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",a=(new n.Query).where(o,"equal",0);r=i.executeLocal(a),e.count=r.length;m=(g=this.parent.grid.pageSettings.pageSize)*((f=this.parent.grid.pageSettings.currentPage)-1);a=a.skip(m).take(g),r=i.executeLocal(a);var s=this.pageRoot(e.result,r);e.result=s}else{var d=new n.DataManager(e.result),p=new n.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),c=d.executeLocal((new n.Query).where(p)),u=void 0;u=l(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?c:c.filter(function(e){return h(t.parent,e)}),e.count=u.length;var a=new n.Query,g=this.parent.grid.pageSettings.pageSize;this.updatePageSize(e);var f=this.parent.grid.pageSettings.currentPage;u.length<f*g&&(f=(f=Math.floor(u.length/g)+(u.length%g?1:0))||1,this.parent.grid.setProperties({pageSettings:{currentPage:f}},!0));var m=g*(f-1);a=a.skip(m).take(g),d.dataSource.json=u,e.result=d.executeLocal(a)}this.parent.notify("updateAction",e)},e}(),Te=function(){function e(e){i.Grid.Inject(i.Toolbar),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.addEventListener=function(){this.parent.on("rowSelected",this.refreshToolbar,this),this.parent.on("rowDeselected",this.refreshToolbar,this),this.parent.on("toolbarClick",this.toolbarClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowSelected",this.refreshToolbar),this.parent.off("rowDeselected",this.refreshToolbar),this.parent.off("toolbarClick",this.toolbarClickHandler))},e.prototype.refreshToolbar=function(e){var i=this.parent.grid.toolbarModule.getToolbar();if(!t.isNullOrUndefined(i)){var r=this.parent,n=void 0,o=void 0,a=r.element.id+"_gridcontrol_indent",s=r.element.id+"_gridcontrol_outdent",d=i.querySelector("#"+a),l=i.querySelector("#"+s),p=e.row,h=r.getSelectedRows()[0];if(t.isNullOrUndefined(p[0])||(p=p[0]),p=t.isNullOrUndefined(h)||h.rowIndex===p.rowIndex?p:h,null!==d&&null!==l){if(n=d.parentElement,o=l.parentElement,0===p.rowIndex||r.getSelectedRowIndexes().length>1)n.classList.add("e-hidden"),o.classList.add("e-hidden");else if("rowDeselected"!==e.name||!t.isNullOrUndefined(h)&&r.grid.isCheckBoxSelection){var c=r.getCurrentViewRecords()[p.rowIndex];t.isNullOrUndefined(c)||(c.level>r.getCurrentViewRecords()[p.rowIndex-1].level?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),c.level===r.getCurrentViewRecords()[p.rowIndex-1].level&&n.classList.remove("e-hidden"),0===c.level&&o.classList.add("e-hidden"),0!==c.level&&o.classList.remove("e-hidden"))}"rowDeselected"===e.name&&t.isNullOrUndefined(h)&&!r.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&n.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent")&&o.classList.add("e-hidden"))}}},e.prototype.toolbarClickHandler=function(e){var i=this.parent;"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===i.grid.element.id+"_indent"&&i.getSelectedRecords().length&&!t.isNullOrUndefined(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule.indentOutdentAction(null,"indent"),e.item.id===i.grid.element.id+"_outdent"&&i.getSelectedRecords().length&&!t.isNullOrUndefined(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule.indentOutdentAction(null,"outdent")},e.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},e.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},e.prototype.destroy=function(){this.removeEventListener()},e}(),Be=function(){function e(e){i.Grid.Inject(i.Aggregate),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}return e.prototype.getModuleName=function(){return"summary"},e.prototype.removeEventListener=function(){this.parent.isDestroyed},e.prototype.calculateSummaryValue=function(e,r,n){this.summaryQuery=e;var o,a,s=r.filter(function(e){return!i.getObject("isSummaryRow",e)}),d=p(s),l=s.slice(),h=Object.keys(this.parent.aggregates).length,c=Object.keys(d).length,u=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var g=0,f=c;g<f;g++)if(o=d[parseInt(g.toString(),10)],a=this.getChildRecordsLength(o,l)){for(var m=this,y=1,S=h;y<=S;y++)!function(e,r){var s=void 0;s={};for(var d=0;d<u.length;d++)s[""+(t.isNullOrUndefined(i.getObject("field",u[parseInt(d.toString(),10)]))?u[parseInt(d.toString(),10)]:i.getObject("field",u[parseInt(d.toString(),10)]))]=null;if(s=m.createSummaryItem(s,m.parent.aggregates[e-1]),!m.parent.aggregates[e-1].showChildSummary)return"continue";var p;l.map(function(e,t){if(e.uniqueID===o.uniqueID)return void(p=t)});var h=p+a+e,c=t.extend({},o);delete c.childRecords,delete c[m.parent.childMapping],t.setValue("parentItem",c,s);var g=i.getObject("level",c);if(t.setValue("level",g+1,s),t.setValue("isSummaryRow",!0,s),t.setValue("parentUniqueID",c.uniqueID,s),n){var f=i.getObject("childRecords",o);f.length&&f.push(s)}l.splice(h,0,s)}(y);this.flatChildRecords=[]}}else{for(var v={},w=0,I=u.length;w<I;w++)v[""+(t.isNullOrUndefined(i.getObject("field",u[parseInt(w.toString(),10)]))?u[parseInt(w.toString(),10)]:i.getObject("field",u[parseInt(w.toString(),10)]))]=null;for(var y=1,R=h;y<=R;y++)this.createSummaryItem(v,this.parent.aggregates[y-1])}return l},e.prototype.getChildRecordsLength=function(e,r){for(var n,o=0,a=Object.keys(r).length;o<a;o++)if(n=r[parseInt(o.toString(),10)],e===(t.isNullOrUndefined(n.parentItem)?null:r.filter(function(e){return e.uniqueID===n.parentItem.uniqueID})[0])){if(this.flatChildRecords.push(n),!i.getObject("hasChildRecords",n))continue;this.getChildRecordsLength(n,r)}return this.flatChildRecords.length},e.prototype.createSummaryItem=function(e,i){for(var r=0,o=Object.keys(i.columns).length;r<o;r++)for(var a=t.isNullOrUndefined(i.columns[parseInt(r.toString(),10)].columnName)?i.columns[parseInt(r.toString(),10)].field:i.columns[parseInt(r.toString(),10)].columnName,s=0,d=Object.keys(e);s<d.length;s++){var l=d[s];if(l===a)if(this.flatChildRecords.length)e[""+l]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],this.flatChildRecords);else if(this.parent.isLocalData){var p=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData;e[""+l]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],p)}}return e},e.prototype.getSummaryValues=function(e,r){var o=new n.Query,a={},s={},d=t.isNullOrUndefined(e.field)?void 0:this.parent.getColumnByField(e.field).type;e.setPropertiesSilent({format:this.getFormatFromType(e.format,d)}),e.setFormatter(this.parent.grid.locale);var l=e.getFormatter()||function(){return function(e){return e}}();e.setTemplate(s);var p=e.getTemplate(2);o.queries=this.summaryQuery,o.requiresCount();var h,c=new n.DataManager(r).executeLocal(o),u=e.type;u=[e.type];for(var g=0;g<u.length;g++){h=u[parseInt(g.toString(),10)];var f=e.field+" - "+u[parseInt(g.toString(),10)].toLowerCase(),m="Custom"!==u[parseInt(g.toString(),10)]?i.getObject("aggregates",c):i.calculateAggregate(u[parseInt(g.toString(),10)],c,e,this.parent),y=e.columnName,S="Custom"!==u[parseInt(g.toString(),10)]?m[""+f]:m;a[""+y]=a[""+y]||{},a[""+y][""+f]=S,a[""+y][u[parseInt(g.toString(),10)]]=t.isNullOrUndefined(m)?" ":l(S)}s.format=e.getFormatter();var v=t.createElement("td",{className:"e-summary"});if(this.parent.isReact&&"string"!=typeof e.footerTemplate){p.fn(a[e.columnName],this.parent,p.property,"",null,null,v),this.parent.renderReactTemplates()}else i.appendChildren(v,p.fn(a[e.columnName],this.parent,p.property));var w=a[""+e.columnName][""+h];return-1===v.innerHTML.indexOf(w)?v.innerHTML+w:v.innerHTML},e.prototype.getFormatFromType=function(e,i){if(t.isNullOrUndefined(i)||"string"!=typeof e)return e;var r;switch(i){case"number":r={format:e};break;case"datetime":r={type:"dateTime",skeleton:e};break;case"date":r={type:i,skeleton:e}}return r},e.prototype.destroy=function(){this.removeEventListener()},e}(),Ve=function(){function e(e){i.Grid.Inject(i.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!t.isNullOrUndefined(this.parent.parentIdMapping),this.addEventListener()}return e.prototype.getModuleName=function(){return"sort"},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},e.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},e.prototype.iterateSort=function(e,i){var r=this.parent.query,o=[];t.isNullOrUndefined(r)||(o=r.queries.filter(function(e){return"onWhere"===e.fn}));for(var a=0;a<e.length;a++)if(o.length>0||this.parent.grid.filterSettings.columns.length>0||""!==this.parent.grid.searchSettings.key?t.isNullOrUndefined(m(this.parent,e[parseInt(a.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(a.toString(),10)]):(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(a.toString(),10)]),e[parseInt(a.toString(),10)].hasChildRecords){var s=new n.DataManager(e[parseInt(a.toString(),10)].childRecords).executeLocal(i);if(this.parent.allowRowDragAndDrop&&-1!==e[parseInt(a.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var d=s.indexOf(this.parent.rowDragAndDropModule.draggedRecord);s.splice(d,1);var l=s.indexOf(this.parent.rowDragAndDropModule.droppedRecord);"topSegment"===this.parent.rowDragAndDropModule.dropPosition?s.splice(l,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&s.splice(l+1,0,this.parent.rowDragAndDropModule.draggedRecord)}this.iterateSort(s,i)}},e.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},e.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},e.prototype.updateModel=function(){this.parent.setProperties({sortSettings:i.getActualProperties(this.parent.grid.sortSettings)},!0)},e.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},e.prototype.destroy=function(){this.removeEventListener()},e}(),ze=function(){function e(e){i.Grid.Inject(i.ColumnMenu),this.parent=e}return e.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"columnMenu"},e}(),Le=function(){function e(e){i.Grid.Inject(i.ContextMenu),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick))},e.prototype.contextMenuOpen=function(e){var i=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),r=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),n=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),o=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element);i&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?i.style.display="none":i.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||t.isNullOrUndefined(r)||r.classList.contains("e-menu-hide")||(r.style.display="none");var a=this.parent,s=a.getSelectedRows()[0];if(!n&&!o||t.isNullOrUndefined(s)){if((n||o||a.grid.isEdit)&&t.isNullOrUndefined(s)){for(var d=0,l=e.items;d<l.length;d++){var p=l[d];"Outdent"!==p.text&&"Indent"!==p.text||a.grid.contextMenuModule.hiddenItems.includes(p.text)||a.grid.contextMenuModule.hiddenItems.push(p.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),(n||o)&&(n.style.display=o.style.display="none")}}else{var h=e.event.target.closest("td");if(!t.isNullOrUndefined(h)&&(t.isNullOrUndefined(h)||h.classList.contains("e-rowcell")&&0===h.querySelectorAll(".e-gridform").length)){if(0===s.rowIndex||a.getSelectedRowIndexes().length>1)n.style.display=o.style.display="none";else if("rowDeselected"!==e.name||!t.isNullOrUndefined(s)&&a.grid.isCheckBoxSelection){var c=a.getCurrentViewRecords()[s.rowIndex];t.isNullOrUndefined(c)||(c.level>a.getCurrentViewRecords()[s.rowIndex-1].level?n.style.display="none":n.style.display="block",c.level===a.getCurrentViewRecords()[s.rowIndex-1].level&&(n.style.display="block"),0===c.level?o.style.display="none":o.style.display="block")}}else{for(var u=0,g=e.items;u<g.length;u++)"Outdent"!==(p=g[u]).text&&"Indent"!==p.text||a.grid.contextMenuModule.hiddenItems.push(p.text);a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}},e.prototype.contextMenuClick=function(e){if("Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),(e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"||e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Outdent")&&!t.isNullOrUndefined(this.parent.rowDragAndDropModule)){var i=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent";this.parent.rowDragAndDropModule.indentOutdentAction(null,i)}},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()},e}(),Fe=function(){function e(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!t.isNullOrUndefined(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("cellSaved",this.cellSaved,this),this.parent.on("batchAdd",this.batchAdd,this),this.parent.on("beforeBatchAdd",this.beforeBatchAdd,this),this.parent.on("batchSave",this.batchSave,this),this.parent.on("beforeBatchDelete",this.beforeBatchDelete,this),this.parent.on("beforeBatchSave",this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this),this.parent.grid.on("cellfocused",this.onCellFocused,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("cellSaved",this.cellSaved),this.parent.off("batchAdd",this.batchAdd),this.parent.off("batchSave",this.batchSave),this.parent.off("beforeBatchAdd",this.beforeBatchAdd),this.parent.off("beforeBatchDelete",this.beforeBatchDelete),this.parent.off("beforeBatchSave",this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex),this.parent.grid.off("cellfocused",this.onCellFocused))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getBatchRecords=function(){return this.batchRecords},e.prototype.getAddRowIndex=function(){return this.addRowIndex},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.getBatchChildCount=function(){return this.batchChildCount},e.prototype.batchPageAction=function(){var e,i=this,r=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,o=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!t.isNullOrUndefined(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var a=0;a<this.batchAddedRecords.length;a++)!function(t){e=r.findIndex(function(e){return e[""+o]===i.batchAddedRecords[parseInt(t.toString(),10)][""+o]}),r.splice(e,1)}(a);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},e.prototype.cellSaved=function(e){if(e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition){var r=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,o=void 0,a=this.parent.grid.getPrimaryKeyFieldNames()[0],s=void 0,d=void 0,l=this.selectedIndex>-1?this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem:null,p=void 0,h=void 0,u=void 0,f="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1;if(f=this.getActualRowObjectIndex(f),this.newBatchRowAdded){if(this.batchRecords.length&&(p=this.batchRecords[this.addRowIndex][this.parent.idMapping],u=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem&&(h=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem.uniqueID)),this.batchAddedRecords=g(this.batchAddedRecords),this.batchAddRowRecord=g(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),o=this.parent.grid.getRowsObject()[parseInt(f.toString(),10)].changes,!t.isNullOrUndefined(o)&&(o.uniqueID=i.getUid(this.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+o.uniqueID,o,this.parent),!Object.prototype.hasOwnProperty.call(o,"level"))){if(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition){if(o.primaryParent=l,this.selectedIndex>-1){o.parentItem=t.extend({},this.batchRecords[this.addRowIndex]),o.parentUniqueID=o.parentItem.uniqueID,delete o.parentItem.childRecords,delete o.parentItem[this.parent.childMapping],o.level=o.parentItem.level+1,o.index=this.batchIndex;var m=c(this.batchRecords[this.addRowIndex]).length,y=c(this.batchRecords[this.addRowIndex])[m-1];y=t.isNullOrUndefined(y)?this.batchRecords[this.addRowIndex]:y,s=r.map(function(e){return e[""+a]}).indexOf(y[""+a]),this.isSelfReference&&(o[this.parent.parentIdMapping]=p),I(a,o.parentItem,"add",this.parent,this.isSelfReference,o)}}else if(("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&!t.isNullOrUndefined(this.batchRecords[this.addRowIndex])){if(o.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,o.level&&this.selectedIndex>-1&&(o.parentItem=l,o.parentUniqueID=h,delete o.parentItem.childRecords,delete o.parentItem[this.parent.childMapping]),o.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){var m=c(this.batchRecords[this.addRowIndex]).length,y=c(this.batchRecords[this.addRowIndex])[m-1];y=t.isNullOrUndefined(y)?this.batchRecords[this.addRowIndex]:y,s=r.map(function(e){return e[""+a]}).indexOf(y[""+a])}if("Above"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){y=this.batchRecords[this.addRowIndex];s=r.map(function(e){return e[""+a]}).indexOf(y[""+a])}this.isSelfReference&&(o[this.parent.parentIdMapping]=u)}o.index=-1===o.index?0:o.index,o.hasChildRecords=!1,o.childRecords=[],this.batchRecords.splice(o.index,0,o),this.currentViewRecords.splice(o.index,0,o),d=s||o.index,"Above"!==this.parent.editSettings.newRowPosition&&(d=0===o.index?d:d+1),r.splice(d,0,o),this.batchAddedRecords.push(o)}this.parent.grid.getRowsObject()[parseInt(f.toString(),10)].data=o,this.newBatchRowAdded=!1}}},e.prototype.beforeBatchAdd=function(e){if("Cell"===this.parent.editSettings.mode&&this.parent.editModule.isTabLastRow)return e.cancel=!0,void(this.parent.editModule.isTabLastRow=!1);!this.parent.editModule.isAddedRowByMethod||t.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=this.batchRecords.length?this.batchRecords[this.selectedIndex]:this.parent.getCurrentViewRecords()[this.selectedIndex])},e.prototype.batchAdd=function(e){if("Bottom"!==this.parent.editSettings.newRowPosition){this.isAdd=!0,this.newBatchRowAdded=!0;var i=0;if(this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=g(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=g(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!t.isNullOrUndefined(this.parent.editModule.addRowIndex)&&t.classList(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition){var r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchRecords),this.updateChildCount(r),this.parent.notify("beginAdd",{}),this.batchChildCount=0}this.updateRowIndex();var n=t.getValue("focusModule",this.parent.grid),o=this.parent.getContentTable();if(this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(i=e.row.rowIndex,n.getContent().matrix.matrix=this.matrix):i=o.getElementsByClassName("e-batchrow")[0].rowIndex,n.getContent().matrix.current=[i,n.getContent().matrix.current[1]],this.parent.editModule.isAddedRowByMethod&&!t.isNullOrUndefined(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){var a=this.parent.getBatchChanges().addedRecords,s=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[a.length-1].getAttribute("aria-rowindex"),10)-1;this.batchRecords.splice(s,0,a[a.length-1])}}},e.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=g(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=g(this.parent.grid.getCurrentViewRecords()));var i=t.getValue("focusModule",this.parent.grid);this.matrix=i.getContent().matrix.matrix;var r,n,o,a=[],s=[],d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=Array.isArray(e.row)?e.row[0]:e.row;t.isNullOrUndefined(l)||-1!==this.parent.getSelectedRows().indexOf(l)?(n=c(r=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),o=this.parent.getSelectedRows()[0].getAttribute("data-uid")):(n=c(r=e.rowData),o=l.getAttribute("data-uid"));var p=parseInt(this.parent.grid.getRowElementByUID(o).getAttribute("aria-rowindex"),10)-1;if(n.length)for(var h=p+n.length,u=p+1;u<=h;u++)a.push(this.parent.grid.getDataRows()[parseInt(u.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&a.push(this.parent.grid.getHeaderContent()[parseInt(u.toString(),10)]);if(!t.isNullOrUndefined(r.parentItem)){var f=m(this.parent,r.parentItem.uniqueID);if(!t.isNullOrUndefined(f)&&f.hasChildRecords){var y=f.childRecords.indexOf(r);f.childRecords.splice(y,1)}this.batchDeletedRecords=g(this.batchDeletedRecords),this.batchDeletedRecords.push(r)}n.push(r),s=n;for(var S=this,u=0;u<s.length;u++)!function(e){var t=S.batchRecords.findIndex(function(t){return t[""+d]===s[parseInt(e.toString(),10)][""+d]});-1!==t&&S.batchRecords.splice(t,1)}(u);for(u=0;u<a.length;u++)t.isNullOrUndefined(a[parseInt(u.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(a[parseInt(u.toString(),10)])},e.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},e.prototype.updateChildCount=function(e){for(var i=this.parent.grid.getPrimaryKeyFieldNames()[0],r=this.parent.getBatchChanges().addedRecords||[],n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<r.length;o++)t.isNullOrUndefined(r[parseInt(o.toString(),10)][""+n])||r[parseInt(o.toString(),10)][""+n][""+i]===e[parseInt(this.addRowIndex.toString(),10)][""+i]&&(this.batchChildCount=this.batchChildCount+1)},e.prototype.beforeBatchSave=function(e){var t=e.batchChanges.changedRecords;if(e.batchChanges.changedRecords.length)for(r=0;r<t.length;r++)S({value:t[parseInt(r.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,void 0);if(e.batchChanges.deletedRecords.length)for(var i=e.batchChanges.deletedRecords,r=0;r<i.length;r++){this.deleteUniqueID(i[parseInt(r.toString(),10)].uniqueID);for(var n=c(i[parseInt(r.toString(),10)]),o=0;o<n.length;o++)this.deleteUniqueID(n[parseInt(o.toString(),10)].uniqueID);e.batchChanges.deletedRecords=e.batchChanges.deletedRecords.concat(n)}this.isAdd=!1},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.batchCancelAction=function(){var e,i=this,r=this.parent.grid.getCurrentViewRecords(),o=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,a=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!t.isNullOrUndefined(this.batchAddedRecords))for(var s=this,d=0;d<this.batchAddedRecords.length;d++)!function(n){if(-1!==(e=o.findIndex(function(e){return e[""+a]===i.batchAddedRecords[parseInt(n.toString(),10)][""+a]}))&&o.splice(e,1),"Child"===s.parent.editSettings.newRowPosition&&(e=r.map(function(e){return e[""+a]}).indexOf(s.batchAddedRecords[parseInt(n.toString(),10)].parentItem?s.batchAddedRecords[parseInt(n.toString(),10)].parentItem[""+a]:s.batchAddedRecords[parseInt(n.toString(),10)][""+a]),!t.isNullOrUndefined(r[parseInt(e.toString(),10)])))for(var d=r[parseInt(e.toString(),10)].childRecords,l=0;d&&l<d.length;l++)d[parseInt(l.toString(),10)][""+a]===s.batchAddedRecords[parseInt(n.toString(),10)][""+a]&&d.splice(l,1)}(d);if(!t.isNullOrUndefined(this.parent.targetElement)){var l=this.parent.targetElement.closest("tr");this.parent.collapseRow(l),this.parent.targetElement=null}if(!t.isNullOrUndefined(this.batchDeletedRecords))for(d=0;d<this.batchDeletedRecords.length;d++)if(!t.isNullOrUndefined(this.batchDeletedRecords[parseInt(d.toString(),10)].parentItem)){e=r.map(function(e){return e[""+a]}).indexOf(this.batchDeletedRecords[parseInt(d.toString(),10)].parentItem[""+a]);var p=0===this.batchDeletedRecords[parseInt(d.toString(),10)].index?this.batchDeletedRecords[parseInt(d.toString(),10)].index:this.batchDeletedRecords[parseInt(d.toString(),10)].index-1;t.isNullOrUndefined(r[parseInt(e.toString(),10)])||r[parseInt(e.toString(),10)].childRecords.splice(p,0,this.batchDeletedRecords[parseInt(d.toString(),10)])}this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=g(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=g(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},e.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var i,r=void 0,o=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),a=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,s=this.parent.grid.getCurrentViewRecords(),d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=o.addedRecords,p=void 0,h=void 0;if(l.length>1&&"Bottom"!==this.parent.editSettings.newRowPosition&&l.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(a.splice(a.length-l.length,l.length),this.parent.editModule.isAddedRowByMethod&&l.length&&!t.isNullOrUndefined(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){l.reverse();for(var c=0;c<l.length;c++){var u=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(c.toString(),10)].getAttribute("aria-rowindex"),10)-1;a.splice(u,0,l[parseInt(c.toString(),10)])}}if(this.parent.allowPaging||a.length===s.length){var f=g(a);if(f.length&&0!==s.length){var m=f.map(function(e){return e[""+d]}).indexOf(s[0][""+d]),y=m+this.parent.grid.pageSettings.pageSize;s=f.splice(m,y)}}else s.length>l.length&&s.splice(s.length-l.length,l.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&l.reverse(),r=0;r<l.length;r++){var v=t.extend({},l[parseInt(r.toString(),10)]);if(delete v.parentItem,delete v.uniqueID,delete v.index,delete v.level,delete v.hasChildRecords,delete v.childRecords,delete v.parentUniqueID,t.isNullOrUndefined(v.primaryParent)||delete v.primaryParent,l.length>1&&this.parent.editModule.isAddedRowByContextMenu){var w=this.parent.editSettings.newRowPosition;this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=w}if(l[parseInt(r.toString(),10)].taskData=v,i=this.batchAddRowRecord[parseInt(r.toString(),10)],t.isNullOrUndefined(i)&&(i=this.batchAddRowRecord[r-1]),this.isSelfReference&&(t.isNullOrUndefined(l[parseInt(r.toString(),10)].parentItem)||I(d,l[parseInt(r.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,l[parseInt(r.toString(),10)])),t.isNullOrUndefined(i)||(h=i.index),t.isNullOrUndefined(l[parseInt(r.toString(),10)].index)&&(h=0),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&t.isNullOrUndefined(l[parseInt(r.toString(),10)].parentItem)&&-1===this.selectedIndex&&(p=-1,i=null),S({value:l[parseInt(r.toString(),10)],action:"add"},this.parent,this.isSelfReference,h,p,void 0,i),p=null,"Child"===this.parent.editSettings.newRowPosition&&!t.isNullOrUndefined(l[parseInt(r.toString(),10)].parentItem)&&(t.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.isSelfReference)){var R=s.map(function(e){return e[""+d]}).indexOf(l[parseInt(r.toString(),10)].parentItem[""+d]),x=s[parseInt(R.toString(),10)].childRecords;if(!t.isNullOrUndefined(h)&&x.some(function(e){return e.uniqueID===i.uniqueID}))for(var C=0;C<x.length;C++)x[parseInt(C.toString(),10)][""+d]===l[parseInt(r.toString(),10)][""+d]&&s[parseInt(R.toString(),10)].childRecords.splice(C,1)}}if(o.deletedRecords.length)for(r=0;r<o.deletedRecords.length;r++)S({value:o.deletedRecords[parseInt(r.toString(),10)],action:"delete"},this.parent,this.isSelfReference,h,p,void 0,i);this.parent.parentData=[];for(var b=0;b<a.length;b++)a[parseInt(b.toString(),10)].index=b,t.setValue("uniqueIDCollection."+a[parseInt(b.toString(),10)].uniqueID+".index",b,this.parent),a[parseInt(b.toString(),10)].level||this.parent.parentData.push(a[parseInt(b.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},e.prototype.getActualRowObjectIndex=function(e){var i=this.parent.grid.getDataRows();return("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&this.selectedIndex>-1&&(!t.isNullOrUndefined(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length?(e+=c(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.getBatchChildCount())):e+=c(this.batchRecords[this.addRowIndex]).length),e>=i.length&&(e=i.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0),e},e.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var r=0;r<i.length;r++)e.rows.splice(i[parseInt(r.toString(),10)].index,1)},e.prototype.nextCellIndex=function(e){var t=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&t.length>0?e.index=this.parent.getSelectedRecords()[0].index:e.index=this.parent.getSelectedRows()[0].rowIndex:e.index=this.batchIndex},e.prototype.onCellFocused=function(e){if("Cell"===this.parent.editSettings.mode&&this.parent.grid.isEdit&&e.keyArgs&&"shiftEnter"===e.keyArgs.action)return e.keyArgs.preventDefault(),void this.parent.endEdit()},e}(),je=function(){function e(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,this.isIndexUndefined=!1,i.Grid.Inject(i.Edit),this.parent=e,this.isSelfReference=!t.isNullOrUndefined(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new Fe(this.parent),this.addEventListener()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.addEventListener=function(){this.parent.on("crudAction",this.crudAction,this),this.parent.on("beginEdit",this.beginEdit,this),this.parent.on("beginAdd",this.beginAdd,this),this.parent.on("recordDoubleClick",this.recordDoubleClick,this),this.parent.on("cellSave",this.cellSave,this),this.parent.on("batchCancel",this.batchCancel,this),this.parent.grid.on("key-pressed",this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on("cellEdit",this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on("double-tap",this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on("edit-form",this.beforeStartEdit,this),this.parent.grid.on("before-batch-cancel",this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},e.prototype.gridDblClick=function(e){if(this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand")){var r=i.parentsUntil(e.target,"e-row"),n=r&&parseInt(r.getAttribute("aria-rowindex"),10)-1;!t.isNullOrUndefined(n)&&n>=0&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[n].dataset.uid=this.parent.grid.contentModule.getRows()[n].uid)}},e.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},e.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger("actionBegin",e)},e.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger("actionComplete",e))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("crudAction",this.crudAction),this.parent.off("beginEdit",this.beginEdit),this.parent.off("beginAdd",this.beginAdd),this.parent.off("recordDoubleClick",this.recordDoubleClick),this.parent.off("batchCancel",this.batchCancel),this.parent.grid.off("key-pressed",this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off("cellEdit",this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off("double-tap",this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off("edit-form",this.beforeStartEdit),this.parent.grid.off("before-batch-cancel",this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},e.prototype.editActionEvents=function(e){var r=i.getObject("editAction",e),o=i.getObject("name",r),s=this.parent,d=!t.isNullOrUndefined(s.dataSource)&&s.dataSource.adaptor;if(!t.isNullOrUndefined(d)&&(a(s)||d instanceof n.RemoteSaveAdaptor)&&"save"===r.requestType&&"add"===r.action&&("Child"===s.editSettings.newRowPosition||"Below"===s.editSettings.newRowPosition||"Above"===s.editSettings.newRowPosition))if("actionBegin"===o){var l=t.isNullOrUndefined(r.row)||!Object.keys(r.row).length?this.selectedIndex:r.row.rowIndex-1,p=t.isNullOrUndefined(l)||-1===l?-1:s.getCurrentViewRecords()[parseInt(l.toString(),10)][s.getPrimaryKeyFieldNames()[0]];s.grid.query.addParams("relationalKey",p)}else if("actionComplete"===o)for(var h=s.grid.query.params.length,c=0;c<h;c++)"relationalKey"===s.grid.query.params[parseInt(c.toString(),10)].key&&s.grid.query.params.splice(c);this.parent.enableInfiniteScrolling&&"actionComplete"===o&&this.infiniteAddAction(r),"Batch"===this.parent.editSettings.mode&&"paging"===r.requestType&&this.parent.notify("batchPageAction",{})},e.prototype.infiniteAddAction=function(e){if("save"===e.requestType&&"add"===e.action||"delete"===e.requestType){if("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action){var t=this.parent.grid.getRowsObject(),r=t.splice(0,1)[0],n=this.addRowIndex,o=this.parent.getCurrentViewRecords();"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(n+=c(o[n+1]).length),n="Below"===this.parent.editSettings.newRowPosition?n+1:n,t.splice(n,0,r);var a=o.splice(0,1)[0];o.splice(n,0,a),this.updateInfiniteCurrentViewData(a,this.addRowIndex)}var s=this.parent.grid.getRows(),d=this.parent.grid.getRowsObject(),l=this.parent.infiniteScrollSettings.enableCache;l||(i.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!l&&this.parent.getFrozenColumns()>0&&(i.resetRowIndex(this.parent.grid,d,s,0),this.updateIndex(this.parent.grid.dataSource,s,this.parent.getCurrentViewRecords()))}},e.prototype.updateInfiniteCurrentViewData=function(e,i){var r=this,n=Math.ceil(i/this.parent.grid.pageSettings.pageSize),o=n>0?n:1,a=i-(o-1)*this.parent.pageSettings.pageSize,s=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData;s[1].splice(0,1);var d=s[parseInt(o.toString(),10)];t.isNullOrUndefined(this.addRowRecord)||(d.filter(function(e,t){e.uniqueID===r.addRowRecord.uniqueID&&(a=t)}),(this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(a+=c(this.addRowRecord).length)),a>=this.parent.pageSettings.pageSize&&(o+=1,d=s[parseInt(o.toString(),10)],a=a-this.parent.pageSettings.pageSize>=0?a-this.parent.pageSettings.pageSize:0),a="Below"===this.parent.editSettings.newRowPosition?a+1:a,d.splice(a,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},e.prototype.recordDoubleClick=function(e){var r=e.target;if(!t.isNullOrUndefined(r.closest("td.e-rowcell"))&&this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit){var n=this.parent.grid.getColumnByIndex(+r.closest("td.e-rowcell").getAttribute("aria-colindex")-1);if("Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&n&&!n.isPrimaryKey&&this.parent.editSettings.allowEditing&&n.allowEditing&&!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick){if(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization){var o=i.parentsUntil(e.target,"e-row");this.prevAriaRowIndex=o.getAttribute("aria-rowindex"),o.setAttribute("aria-rowindex",o.rowIndex+1+"")}this.updateGridEditMode("Batch")}else"Cell"!==this.parent.editSettings.mode||n.allowEditing&&!n.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch"))}},e.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),i.getObject("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},e.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},e.prototype.keyPressed=function(e){(this.isOnBatch||"tab"===e.action||"shiftTab"===e.action)&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.cellEdit=function(e){var i=this,r=e.promise;if(delete e.promise,this.parent.enableVirtualization&&!t.isNullOrUndefined(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger("cellEdit",e,function(e){e.cancel||"Cell"!==i.parent.editSettings.mode?e.cancel&&"Cell"===i.parent.editSettings.mode&&(i.isOnBatch=!1,i.updateGridEditMode("Normal")):i.enableToolbarItems("edit"),t.isNullOrUndefined(r)||r.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell")))return e.cancel=!0,void(this.doubleClickTarget=null);"Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,t.setValue("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index)},e.prototype.enableToolbarItems=function(e){if(!t.isNullOrUndefined(this.parent.grid.toolbarModule)){var i=this.parent.element.id+"_gridcontrol_";this.parent.grid.toolbarModule.enableItems([i+"add",i+"edit",i+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([i+"update",i+"cancel"],"edit"===e)}},e.prototype.batchCancel=function(){if("Cell"===this.parent.editSettings.mode){var e=t.getValue("editModule.cellDetails",this.parent.grid.editModule);t.isNullOrUndefined(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex);var i=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex);this.parent.renderModule.cellRender({data:e.rowData,cell:i,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1}"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},e.prototype.customCellSave=function(e){s(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},e.prototype.cellSave=function(e){var i=this;if("Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")){e.cancel=!0;t.setValue("isEditCollapse",!0,this.parent),e.rowData[e.columnName]=e.value;var r;r=t.isNullOrUndefined(e.cell)?this.parent.grid.editModule.editModule.form.parentElement.parentNode:e.cell.parentNode;var o,d=this.parent.getPrimaryKeyFieldNames();if(t.isNullOrUndefined(r))this.parent.grid.getCurrentViewRecords().filter(function(t,i){if(t[d[0]]===e.rowData[d[0]])return void(o=i)});else{var l=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;o=l?(this.parent.getRows().indexOf(r),this.parent.getRows().indexOf(r)):-1===this.parent.getRows().indexOf(r)&&this.parent.getFrozenColumns()>0?this.parent.grid.getRows().indexOf(r):this.parent.getRows().indexOf(r)}var p={};if(t.extend(p,e),p.cancel=!1,p.type="save",r=this.parent.grid.getRows()[r.rowIndex],this.parent.trigger("actionBegin",p),p.cancel)this.parent.grid.isEdit=!0;else if(r.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),a(this.parent)||this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.adaptor instanceof n.RemoteSaveAdaptor){if(a(this.parent)||this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.adaptor instanceof n.RemoteSaveAdaptor){var h=this.parent.grid.query;if(this.parent.isGantt&&this.parent.loadChildOnDemand)this.updateCell(e,o),t.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(e,r);else{this.parent.grid.dataSource.update(d[0],e.rowData,h.fromTable,h,e.previousValue).then(function(n){t.isNullOrUndefined(n)||(e.rowData[e.columnName]=n[e.columnName]),i.updateCell(e,o),t.setValue("isEdit",!1,i.parent.grid),i.afterCellSave(e,r)})}}}else if(s(this.parent)){var c={requestType:"save",data:e.rowData,action:"edit",row:r,rowIndex:o,rowData:e.rowData,columnName:e.columnName,filterChoiceCount:null,excelSearchOperator:null};this.parent.grid.getDataModule().eventPromise(c,this.parent.grid.query)}else this.updateCell(e,o),t.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(e,r)}this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},e.prototype.afterCellSave=function(e,i){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),t.removeClass([i],["e-editedrow","e-batchrow"]),t.removeClass(i.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),S({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),i.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);var r={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:i,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger("actionComplete",r)},e.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},e.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},e.prototype.crudAction=function(e,i){S(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,i,this.addRowRecord),this.parent.parentData=[];for(var r=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,o=0;o<r.length;o++){r[parseInt(o.toString(),10)].index=o;var s=this.parent.grid.getPrimaryKeyFieldNames()[0];e.value[""+s]===r[parseInt(o.toString(),10)][""+s]&&"add"===e.action&&(r[parseInt(o.toString(),10)].level=this.internalProperties.level,r[parseInt(o.toString(),10)].taskData=this.internalProperties.taskData,r[parseInt(o.toString(),10)].uniqueID=this.internalProperties.uniqueID,t.isNullOrUndefined(this.internalProperties.parentItem)||(r[parseInt(o.toString(),10)].parentItem=this.internalProperties.parentItem,r[parseInt(o.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),r[parseInt(o.toString(),10)].childRecords=this.internalProperties.childRecords),t.setValue("uniqueIDCollection."+r[parseInt(o.toString(),10)].uniqueID+".index",o,this.parent);var d=this.parent.dataSource.adaptor;(a(this.parent)||d instanceof n.RemoteSaveAdaptor)&&t.setValue("uniqueIDCollection."+r[parseInt(o.toString(),10)].uniqueID,r[parseInt(o.toString(),10)],this.parent),r[parseInt(o.toString(),10)].level||this.parent.parentData.push(r[parseInt(o.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},e.prototype.updateIndex=function(e,i,r){for(var n=0;n<this.parent.getDataRows().length;n++){var o=r[parseInt(n.toString(),10)];if(!t.isNullOrUndefined(o)){u=t.getValue("uniqueIDCollection."+o.uniqueID+".index",this.parent);if(o.index=u,!t.isNullOrUndefined(o.parentItem)){var a=t.getValue("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent);o.parentItem.index=a}}}var s=-1,d=this.parent.treeColumnIndex;if(this.parent.getFrozenColumns()>0)for(var l=i[0].querySelectorAll(".e-rowcell"),p=0;p<l.length;p++)if(l[parseInt(p.toString(),10)].classList.contains("e-gridrowindex0level0")){d=p;break}for(var h=0;h<this.parent.getRows().length;h++){i[parseInt(h.toString(),10)].classList.contains("e-detailrow")||s++;var c=r[parseInt(s.toString(),10)];if(!t.isNullOrUndefined(c)){var u=c.index,g=c.level,f=i[parseInt(h.toString(),10)];t.isNullOrUndefined(c.parentItem)||(u=t.getValue("uniqueIDCollection."+c.parentItem.uniqueID+".index",this.parent));var m=f.cells[parseInt(d.toString(),10)];if(!t.isNullOrUndefined(m)){for(p=0;p<m.classList.length;p++){var y=m.classList[parseInt(p.toString(),10)],S=y.match(/e-gridrowindex/i),v=y.match(/e-griddetailrowindex/i);null!=S&&t.removeClass([m],y),null!=v&&t.removeClass([m],y)}i[parseInt(h.toString(),10)].classList.contains("e-detailrow")?t.addClass([m],"e-griddetailrowindex"+u+"level"+g):t.addClass([m],"e-gridrowindex"+u+"level"+g)}}}},e.prototype.beginAdd=function(){var e,i=this.addRowIndex,r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchEditModule.getBatchRecords()));var n=this.parent.grid.getDataRows(),o=n.length?+n[0].getAttribute("aria-rowindex")-1:0,a=n.length?+n[n.length-1].getAttribute("aria-rowindex")-1:0,s=this.selectedIndex>=o&&this.selectedIndex<=a,d=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode&&("Above"===this.parent.editSettings.newRowPosition?e="before":("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(this.selectedIndex>-1||d)&&s&&(e="after",!t.isNullOrUndefined(r[parseInt(i.toString(),10)])&&r[parseInt(i.toString(),10)].expanded&&("Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)?(i+=c(r[parseInt(i.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition&&(i+=this.batchEditModule.getBatchChildCount())):this.parent.enableVirtualization||(i+=c(r[parseInt(i.toString(),10)]).length))),(this.selectedIndex>-1||d)&&s&&(i||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition))){i>=n.length-1&&(i=n.length-2);var l="rows",p=this.parent.grid.contentModule[""+l][0],h=document.activeElement;n[i+1][""+e](n[0]),t.setValue("batchIndex",i+1,this.batchEditModule);var u="Above"===this.parent.editSettings.newRowPosition?i:i+1;if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[""+l].splice(0,1),this.parent.grid.contentModule[""+l].splice(u,0,p)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var g=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),f=0;f<g.length;f++)g[parseInt(f.toString(),10)].remove();t.setValue("errorRules",[],this.parent.grid.editModule.formObj)}d&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,h.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}if("Batch"===this.parent.editSettings.mode&&!t.isNullOrUndefined(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var m=this.parent.getBatchChanges().addedRecords,y=void 0;if(m.length)for(f=0;f<m.length;f++)t.isNullOrUndefined(m[parseInt(f.toString(),10)].uniqueID)&&(y=m[parseInt(f.toString(),10)]);var S={action:"add",data:y,index:i,seletedRow:0};this.beginAddEdit(S),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(S.data)}},e.prototype.beginEdit=function(e){if(0!==this.parent.flatData.length||t.isNullOrUndefined(this.addRowRecord)||(this.addRowRecord=void 0),"refresh"===e.requestType&&this.isOnBatch)return void(e.cancel=!0);if("Cell"===this.parent.editSettings.mode&&"beginEdit"===e.requestType)return void(e.cancel=!0);if(this.doubleClickTarget&&"delete"!==e.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))return e.cancel=!0,void(this.doubleClickTarget=null);if("delete"===e.requestType){var i=e.data;if(t.isNullOrUndefined(e.data[0].uniqueID))for(var r=this.parent.getPrimaryKeyFieldNames(),n=this,o=0;o<i.length;o++)!function(t){n.parent.flatData.filter(function(n){n[""+r[0]]===e.data[parseInt(t.toString(),10)][r[0]]&&(i[parseInt(t.toString(),10)]=n)})}(o);for(o=0;o<i.length;o++){this.deleteUniqueID(i[parseInt(o.toString(),10)].uniqueID);for(var a=c(i[parseInt(o.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.data=e.data.concat(a)}}if("add"===e.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){if((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||e.index!==this.parent.grid.selectedRowIndex)&&0!==e.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization){var d='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',l=void 0;this.selectedIndex>-1&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),l=this.parent.getContent().querySelector(d),this.addRowIndex=l?l.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(d='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',l=this.parent.getContent().querySelector(d),this.addRowIndex=l?l.rowIndex:0):this.addRowIndex=0}else this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==e.index?this.addRowIndex=e.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0;var p=this.parent.getSelectedRecords()[0];(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):t.isNullOrUndefined(p)||(this.addRowRecord=p)}this.isAddedRowByMethod&&0!==e.index&&(this.addRowRecord=this.parent.flatData[e.index],this.addRowIndex=e.index),"Child"!==this.parent.editSettings.newRowPosition||!this.isIndexUndefined&&!this.isAddedRowByMethod||t.isNullOrUndefined(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0],this.isIndexUndefined=!1),t.isNullOrUndefined(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===e.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,e=this.beginAddEdit(e)},e.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},e.prototype.beginAddEdit=function(e){var r=e.data;if("add"===e.action){var o=this.parent.grid.getPrimaryKeyFieldNames()[0],a=null;r.taskData=t.isNullOrUndefined(r.taskData)?t.extend({},e.data):r.taskData;var s=void 0;s=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!t.isNullOrUndefined(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex);var d=this.addRowIndex;r.uniqueID=i.getUid(this.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+r.uniqueID,r,this.parent);var l=0,p=void 0,h=void 0,u=void 0,g=void 0,f=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex,y=this.parent.getRows(),S=y.length?s.indexOf(s[0]):0,v=y.length?+y[y.length-1].getAttribute("aria-rowindex")-1:0,w=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=S&&this.selectedIndex<=v;if(s.length&&!t.isNullOrUndefined(d)&&(p=s[this.addRowIndex][this.parent.idMapping],g=s[this.addRowIndex][this.parent.parentIdMapping],s[this.addRowIndex].parentItem&&(h=s[this.addRowIndex].parentItem.uniqueID),u=s[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&s.length&&!t.isNullOrUndefined(d)){if(l=s[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition)a="before",d=s[this.addRowIndex].index;else if("Below"===this.parent.editSettings.newRowPosition){a="after";var R=c(s[this.addRowIndex]).length,x=s[this.addRowIndex].index;d=R>0?x+R:x}else if("Child"===this.parent.editSettings.newRowPosition){a="after",(this.selectedIndex>-1||f)&&w&&(r.parentItem=t.extend({},s[this.addRowIndex]),r.parentUniqueID=r.parentItem.uniqueID,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]);var C=c(s[this.addRowIndex]).length,b=s[this.addRowIndex].index;this.selectedIndex>=0&&(r.level=l+1),d=C>0?b+C:b,this.isSelfReference&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?r.taskData[this.parent.parentIdMapping]=r[this.parent.parentIdMapping]=p:r.taskData[this.parent.parentIdMapping]=r[this.parent.parentIdMapping]=null,t.isNullOrUndefined(r.parentItem)||I(o,r.parentItem,"add",this.parent,this.isSelfReference,r))}if("Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((this.selectedIndex>-1||f)&&l&&w&&(r.parentUniqueID=h,r.parentItem=t.extend({},u),delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]),r.level=l,this.isSelfReference&&(r.taskData[this.parent.parentIdMapping]=r[this.parent.parentIdMapping]=g,t.isNullOrUndefined(r.parentItem)||I(o,r.parentItem,"add",this.parent,this.isSelfReference,r))),null!=a&&(this.selectedIndex>-1||f)&&w&&(e.index="before"===a?d:d+1),"Bottom"===this.parent.editSettings.newRowPosition){l=0;var D=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;e.index=D.length}}t.isNullOrUndefined(r.level)&&(r.level=l),r.hasChildRecords=!1,r.childRecords=[],r.index=0}if("add"===e.action&&(this.internalProperties={level:r.level,parentItem:r.parentItem,uniqueID:r.uniqueID,taskData:r.taskData,parentUniqueID:t.isNullOrUndefined(r.parentItem)?void 0:r.parentItem.uniqueID,childRecords:r.childRecords}),"delete"===e.requestType){var M=e.data,O=this.parent.getPrimaryKeyFieldNames();if(!t.isNullOrUndefined(O)&&O.length>0)for(var P=this,A=0;A<M.length;A++)!function(e){var i=M[parseInt(e.toString(),10)].parentItem;if(i){var r=m(P.parent,i.uniqueID);if(!t.isNullOrUndefined(r)&&r.hasChildRecords){var n=r.childRecords.findIndex(function(t){return M[parseInt(e.toString(),10)][O[0]]===t[O[0]]});r.childRecords.splice(n,1)}}}(A)}return e},e.prototype.addRecord=function(e,i,r){if(this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),t.isNullOrUndefined(i)&&(this.isIndexUndefined=!0),this.isSelfReference||t.isNullOrUndefined(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping))e?(i>-1?(this.selectedIndex=i,this.addRowIndex=i):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),r&&this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.parent.grid.editModule.addRecord(e,i)):this.parent.grid.editModule.addRecord(e,i);else{var n=[],o=this.parent.editSettings.mode,a=this.parent.grid.editSettings.mode;n.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),t.isNullOrUndefined(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0);var s={addedRecords:n,changedRecords:[],deletedRecords:[]};this.parent.notify("batchSave",{updatedRecords:s,index:i}),this.parent.setProperties({editSettings:{mode:o}},!0),this.parent.grid.setProperties({editSettings:{mode:a}},!0),this.parent.refresh()}},e.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},e.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},e.prototype.contentready=function(e){t.isNullOrUndefined(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},e.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},e.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&this.parent.grid.pageSettings.currentPage>1&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()},e}(),_e=function(){function e(e){i.Grid.Inject(i.CommandColumn),this.parent=e}return e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){},e}(),He=function(){function e(e){i.Grid.Inject(i.DetailRow),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"detailRow"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},e.prototype.setIndentVisibility=function(e){e.visible=!1},e.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)].getElementsByClassName("e-detailrowcollapse"),o=this.parent.grid.getRowObjectFromUID(e[parseInt(r.toString(),10)].getAttribute("data-Uid")),a=i.getObject("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(r.toString(),10)]);(t.isNullOrUndefined(a)||!t.isNullOrUndefined(a)&&h(this.parent,o.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(n[0])}},e.prototype.childRowExpand=function(e){var i=e.row.getElementsByClassName("e-detailrowcollapse");t.isNullOrUndefined(i[0])||this.parent.grid.detailRowModule.expand(i[0])},e.prototype.rowExpandCollapse=function(e){if(!a(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},e.prototype.detaildataBound=function(e){var i=e.data,r=e.detailElement.parentElement.previousSibling,n="e-gridrowindex"+(t.isNullOrUndefined(i.parentItem)?i.index:i.parentItem.index)+"level"+i.level,o=r.querySelector("."+n).classList,a=[].slice.call(o).filter(function(e){return e===n}),s=a[0].length,d="e-griddetail"+a.toString().slice(6,s);t.addClass([e.detailElement.parentElement],d)},e.prototype.actioncomplete=function(e){if("beginEdit"===e.requestType||"add"===e.requestType){var t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),r=parseInt(t,10)-1;e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",r.toString())}for(var n=this.parent.grid.contentModule.getRows(),o=0;o<n.length;o++)n[parseInt(o.toString(),10)].cells[0].visible=!1;i.getObject("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},e.prototype.destroy=function(){this.removeEventListener()},e}(),Ge=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qe=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.isExpandCollapse=!1,r.translateY=0,r.maxiPage=0,r.recordAdded=!1,r.startIndex=-1,r.endIndex=-1,r.preTranslate=0,r.isRemoteExpand=!1,r.isDataSourceChanged=!1,r.addEventListener(),r}return Ge(r,e),r.prototype.getModelGenerator=function(){return new Ee(this.parent)},r.prototype.getRowByIndex=function(e){if(this.parent.enableVirtualization&&this.parent.isFrozenGrid())return this.getRowCollection(e,!0);var t=this.parent.getDataRows().find(function(t){return parseInt(t.getAttribute("aria-rowindex"),10)-1===e});return!t&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=e?this.parent.getRows()[parseInt(e.toString(),10)]:void 0:t},r.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},r.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute("aria-rowindex"),10)-1,o=this.parent.getDataRows(),a=(i?this.parent.getCurrentViewRecords():o)[e-n];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?o[parseInt(e.toString(),10)]:o[e-n+this.parent.frozenRows]),null==a&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t&&(a=o[parseInt(e.toString(),10)]),a},r.prototype.addEventListener=function(){this.parent.on("virtual-action-args",this.virtualOtherAction,this),this.parent.on("index-modifier",this.indexModifier,this)},r.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},r.prototype.indexModifier=function(e){var t=this.parent.getContent().querySelector(".e-content"),i=this.parent.pageSettings.pageSize;if((this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&this.startIndex>-1&&this.endIndex>-1){if(this.endIndex>e.count-i){var r=~~(t.scrollTop/this.parent.getRowHeight()),n=r+this.parent.getRows().length;n>e.count&&(n=r+(e.count-r)),this.startIndex=n-this.parent.getRows().length,this.endIndex=n}else("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1);this.recordAdded=!1}this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=i-1),this.endIndex-this.startIndex!==i&&this.totalRecords>i&&this.endIndex===this.totalRecords?(e.startIndex=this.endIndex-i,e.endIndex=this.endIndex):(e.startIndex=this.startIndex,e.endIndex=this.endIndex)},r.prototype.eventListener=function(t){var i=this;this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&s(this.parent)?e.prototype.eventListener.call(this,"on"):(this.parent[""+t]("data-ready",this.onDataReady,this),this.parent[""+t]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){i.observers.observes(function(e){return i.scrollListeners(e)},i.onEnteredAction(),i.parent);var e=i.parent;if(e.root.enablePersistence&&e.root.scrollPosition){i.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(i.content.scrollLeft=e.root.scrollPosition.left);var t={direction:"down",sentinel:i.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element};i.scrollListeners(t)}i.parent.off("content-ready",i.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+t]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener("actionBegin",this.handleActionBegin.bind(this)),this.parent.addEventListener("actionComplete",this.onActionComplete.bind(this)),this.parent[""+t]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+t]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+t]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+t]("edit-reset",this.resetIseditValue,this),this.parent[""+t]("get-virtual-data",this.getData,this),this.parent[""+t]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+t]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+t]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+t]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+t]("virtual-scroll-edit",this.restoreEditState,this),this.parent[""+t]("set-virtual-page-query",this.SetVirtualPageQury,this))},r.prototype.cellFocus=function(t){e.prototype.virtualCellFocus.call(this,t)},r.prototype.onDataReady=function(i){if(e.prototype.onDataReady.call(this,i),!(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&s(this.parent))){if(!t.isNullOrUndefined(i.count)){if(this.totalRecords=i.count,this.parent.isFrozenGrid()&&i.count<Object.keys(this.parent.dataSource).length){var r=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",o=this.parent.getRowHeight()*i.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize;t.getValue("virtualEle",this).setVirtualHeight(o,r)}this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()||t.getValue("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*i.count,"100%")}(!t.isNullOrUndefined(i.requestType)&&"collapseAll"===i.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1)}},r.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&s(this.parent)||(t.getValue("observer",this).options.debounceEvent=!1,this.observers=new Ke(t.getValue("observer",this).element,t.getValue("observer",this).options),this.contents=this.getPanel().firstChild)},r.prototype.getTranslateY=function(t,i,r,o){if(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=e.prototype.getTranslateY.call(this,t,i,r,o)}return e.prototype.getTranslateY.call(this,t,i,r,o)},r.prototype.dataBoundEvent=function(){if(!t.isNullOrUndefined(this.parent.getRows())&&this.parent.getRows().length&&!t.isNullOrUndefined(this.parent.getRowByIndex(0))&&!this.initialRowTop){var i=this.parent.getRowByIndex(0).getBoundingClientRect().top,r=this.parent.element.getBoundingClientRect().top;i>0?this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-r:-1===this.parent.selectedRowIndex&&(this.initialRowTop=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)}e.prototype.dataBound.call(this)},r.prototype.rowSelectedEvent=function(t){e.prototype.rowSelected.call(this,t),this.parent.notify("virtualTransform",{requestType:"transformChange"})},r.prototype.toSelectVirtualRow=function(i){if(!this.parent.isEdit){t.isNullOrUndefined(this.observer.containerRect)&&(this.observer.containerRect=this.observers.containerRect);var r=this.parent.clipboardModule.treeGridParent;if(t.isNullOrUndefined(r.editModule)||t.isNullOrUndefined(r.editModule.addRowIndex)||0!==i.selectedIndex){if(!t.isNullOrUndefined(r.grid.sortModule)&&r.grid.sortModule.sortedColumns.length>0){var n=r.dataModule.sortedData;if(!t.isNullOrUndefined(n)&&n.length>0){var o=n.findIndex(function(e){return e.index===i.selectedIndex});i.selectedIndex=o}}e.prototype.selectVirtualRow.call(this,i)}}},r.prototype.refreshCell=function(e){e.cells=this.generateCells()},r.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},r.prototype.getVirtualRowIndex=function(e){return t.isNullOrUndefined(this.prevInfo)?e:this.parent.getRowsObject()[0].index+e},r.prototype.generateCell=function(e,r,n,o,a,s){var d={visible:e.visible,isDataCell:!t.isNullOrUndefined(e.field||e.template),isTemplate:!t.isNullOrUndefined(e.template),rowID:r,column:e,cellType:t.isNullOrUndefined(n)?i.CellType.Data:n,colSpan:o,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&t.getValue(e.field,s)};return(d.isDataCell||"checkbox"===d.column.type||d.commands)&&(d.index=a),new i.Cell(d)},r.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',i=this.parent.getContent().querySelector(t).rowIndex,r=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)];e.data=r},r.prototype.beginAdd=function(t){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=i.dataRowIndex;var r=this.parent.getRows(),n=r.length?+r[0].getAttribute("aria-rowindex")-1:0,o=r.length?+r[r.length-1].getAttribute("aria-rowindex")-1:0,a=this.parent.selectedRowIndex>=n&&this.parent.selectedRowIndex<=o;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&a)||e.prototype.addActionBegin.call(this,t)},r.prototype.restoreEditState=function(){e.prototype.restoreEdit.call(this)},r.prototype.SetVirtualPageQury=function(e){var t=[];if(this.prevInfo&&this.prevInfo.blockIndexes&&(t=i.getVisiblePage(this.prevInfo.blockIndexes)),"refresh"===this.requestType&&t.length)return e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),void(e.skipPage=!0)},r.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||e.prototype.resetIsedit.call(this)},r.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},r.prototype.cancelEdit=function(t){e.prototype.editCancel.call(this,t)},r.prototype.toSelectRowOnContextOpen=function(t){e.prototype.selectRowOnContextOpen.call(this,t)},r.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},r.prototype.getData=function(t){e.prototype.getVirtualData.call(this,t)},r.prototype.handleActionBegin=function(t){e.prototype.actionBegin.call(this,t)},r.prototype.onActionComplete=function(t){if("add"===t.requestType){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex}e.prototype.actionComplete.call(this,t)},r.prototype.onEnteredAction=function(){var e=this;return function(i,r,n,o,a,s){if(!e.parent.directVirtualRender){!t.Browser.isIE||a||!s||e.preventEvent||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.parent.enableVirtualMaskRow&&!e.preventEvent&&setTimeout(function(){e.parent.showMaskRow(r.axis),e.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0);var d=e.content.getBoundingClientRect().height,l=e.prevInfo.offsets?e.prevInfo.offsets.top:null,p="X"===r.axis,h=e.getColumnOffset(p?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(e.parent.isFrozenGrid()&&e.parent.enableColumnVirtualization&&e.currentInfo&&e.currentInfo.columnIndexes){var c=e.currentInfo.columnIndexes[0]-1,u=0;e.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(u+=parseInt(e.width.toString(),10))}),c>e.parent.getVisibleFrozenLeftCount()&&(h-=u)}if(p){var g=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,f=e.vgenerator.cOffsets[g-1];h=h>f?f:h}var m=e.getTranslateY(o.top,d,p&&l===o.top?e.prevInfo:void 0,!0);if(!e.parent.isFrozenGrid()||e.parent.enableVirtualMaskRow){if(e.parent.enableVirtualMaskRow){var y=o.top-e.translateY<0;m=Math.round(e.translateY)>m&&!y?Math.round(e.translateY):m,e.virtualEle.adjustTable(h,m)}else e.virtualEle.adjustTable(h,e.translateY);e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(h,0),e.parent.isFrozenGrid()&&e.parent.contentModule.resetStickyLeftPos(h))}}}},r.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var i,r=e.sentinel,o=this.parent.getRowHeight(),s=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2);t.isNullOrUndefined(this.parent.contentModule)||(i=this.parent.getContent().querySelector(".e-content"));var d=s*o,l=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,p=Math.ceil(e.offset.top-this.translateY)+o>=d,h=this.parent.currentViewData;if(l&&"right"!==e.direction&&"left"!==e.direction&&!t.isNullOrUndefined(i)){var c=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),u=Math.floor(i.scrollTop/o)+Math.ceil(c/o)-this.parent.pageSettings.pageSize;if(u=u>0?u:0,!t.isNullOrUndefined(this.selectedRowIndex)&&-1!==this.selectedRowIndex&&u!==this.selectedRowIndex&&this.parent.rowHeight*this.parent.pageSettings.pageSize<i.scrollTop&&!this.parent.allowRowDragAndDrop&&(u=this.selectedRowIndex),this.startIndex=u,this.endIndex=u+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords){var g=this.totalRecords,f=this.endIndex%g;this.endIndex=g,this.startIndex=this.startIndex-f<0?0:this.startIndex-f}h.length&&h[0].index>=this.parent.pageSettings.pageSize/2&&h[0].index-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=h[0].index-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize);var m=Math.ceil(e.offset.top/o);m%=this.parent.pageSettings.pageSize;var y=0;t.isNullOrUndefined(this.parent.getRows()[parseInt(m.toString(),10)])||t.isNullOrUndefined(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(m.toString(),10)])||(y=+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(m.toString(),10)].querySelector("td").getAttribute("index")),0===y?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=t.isNullOrUndefined(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight?this.parent.rowHeight:this.parent.getRowHeight()):this.startIndex===this.selectedRowIndex?this.translateY=e.offset.top:this.translateY=e.offset.top-s*o>0?e.offset.top-s*o+o:0:this.parent.getFrozenColumns()>0?(e.offset.top=e.offset.top+80,this.translateY=e.offset.top-s*o>0?e.offset.top-s*o+10:0):this.translateY=e.offset.top-s*o>0?e.offset.top-s*o+10:0}else if(p&&"right"!==e.direction&&"left"!==e.direction&&!t.isNullOrUndefined(i)){var S=~~(i.scrollTop/o),v=!(this.selectedRowIndex+this.parent.pageSettings.pageSize<this.totalRecords);t.isNullOrUndefined(this.selectedRowIndex)||-1===this.selectedRowIndex||S===this.selectedRowIndex||v||this.parent.allowRowDragAndDrop||(S=this.selectedRowIndex);var w=S+this.parent.pageSettings.pageSize;w>this.totalRecords&&(w=S+(this.totalRecords-S)),this.startIndex=!v||t.isNullOrUndefined(this.selectedRowIndex)?w-this.parent.pageSettings.pageSize:S,this.endIndex=w,S+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-S<this.parent.pageSettings.pageSize/2&&(this.startIndex=w-this.parent.pageSettings.pageSize/2),e.offset.top>o*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,i.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o+o:this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o):this.parent.getFrozenColumns()>0?this.translateY=e.offset.top-(2*o+this.parent.pageSettings.pageSize):this.translateY=e.offset.top}if(p&&"up"!==e.direction&&e.offset.top<o*this.totalRecords||l||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url){var I=this.currentInfo=t.getValue("getInfoFromView",this).apply(this,[e.direction,r,e.offset]);if(this.previousInfo=I,this.prevInfo&&a(this.parent.root)&&"model-changed"!==I.event&&("Y"===r.axis&&this.prevInfo.blockIndexes.toString()===I.blockIndexes.toString()||"X"===r.axis&&this.prevInfo.columnIndexes.toString()===I.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=I.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(I.columnIndexes.toString())))return this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,void("Y"===r.axis&&this.restoreEditState());this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?I.columnIndexes:[]);var R=I.loadNext&&!I.loadSelf?I.nextInfo.page:I.page;this.parent.setProperties({pageSettings:{currentPage:R}},!0),this.requestType="virtualscroll","right"===e.direction||"left"===e.direction||a(this.parent.root)||(I.event="refresh-virtual-block"===I.event?"model-changed":I.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(r.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(I.event,{requestType:"virtualscroll",virtualInfo:I,focusElement:e.focusElement})}else this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},r.prototype.shouldPreventScrolling=function(e){if(this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top)return void this.parent.closeEdit()},r.prototype.appendContent=function(i,r,o){if(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent)||this.parent.isFrozenGrid()&&(void 0===o.requestType||!t.isNullOrUndefined(o.virtualInfo)&&("right"===o.virtualInfo.direction||"left"===o.virtualInfo.direction)))t.getValue("isExpandCollapse",o)&&(this.isRemoteExpand=!0),e.prototype.appendContent.call(this,i,r,o),-1!==t.getValue("requestTypes",this).indexOf("isFrozen")&&(t.getValue("requestTypes",this).splice(t.getValue("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType);else{var a=o.virtualInfo.sentinelInfo&&"Y"===o.virtualInfo.sentinelInfo.axis&&t.getValue("currentInfo",this).page&&t.getValue("currentInfo",this).page!==o.virtualInfo.page?t.getValue("currentInfo",this):o.virtualInfo,d=a.columnIndexes[0]-1,l=this.getColumnOffset(d),p=void 0;if(this.parent.enableColumnVirtualization){this.header.virtualEle.adjustTable(l,0);u=a.columnIndexes;p=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",this.header.virtualEle.setWrapperWidth(p)}this.virtualEle.setWrapperWidth(p,t.Browser.isIE||"edge"===t.Browser.info.name),(i=this.parent.createElement("tbody")).appendChild(r);this.getTable().querySelector("tbody").replaceWith(i),"virtualscroll"===o.requestType&&"Y"===o.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1);var h=0;if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){var c=0;this.parent.getColumns().filter(function(e){e.visible&&(h+=parseInt(e.width.toString(),10),"Left"===e.freeze&&(c+=parseInt(e.width.toString(),10)))});var u=a.columnIndexes;p=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",d>this.parent.getVisibleFrozenLeftCount()&&(l-=c),this.resetStickyLeftPos(l,r)}this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,t.getValue("virtualEle",this).adjustTable(l,this.translateY),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(l,0),this.parent.isFrozenGrid()&&this.resetStickyLeftPos(l))),t.setValue("prevInfo",this.previousInfo?this.previousInfo:a,this),"virtualscroll"===o.requestType&&"X"===o.virtualInfo.sentinelInfo.axis&&this.parent.notify("auto-col",{});e.prototype.focusCell.call(this,o);this.isAdd&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&this.addRowIndex>-1&&(this.isAdd=!1,this.parent.isEdit=!1)),this.restoreEditState(),e.prototype.restoreAdd.call(this),e.prototype.ensureSelectedRowPosition.call(this)}},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off("virtual-action-args",this.virtualOtherAction),this.parent.off("index-modifier",this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState))},r}(i.VirtualContentRenderer),Ke=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.isWheeling=!1,t.newPos=0,t.lastPos=0,t.timer=0,t}return Ge(i,e),i.prototype.observes=function(i,r,n){if(e.prototype.containerRect=t.getValue("options",this).container.getBoundingClientRect(),t.EventHandler.add(t.getValue("options",this).container,"scroll",this.virtualScrollHandlers(i,r,n),this),t.getValue("options",this).movableContainer){e.prototype.movableContainerRect=t.getValue("options",this).movableContainer.getBoundingClientRect(),t.EventHandler.add(t.getValue("options",this).movableContainer,"scroll",this.virtualScrollHandlers(i,r,n),this)}},i.prototype.clear=function(){this.lastPos=null},i.prototype.virtualScrollHandlers=function(e,i,r){var o=this,a="chrome"===t.Browser.info.name?200:100,d=t.debounce(e,a),l=t.debounce(e,50);this.options.prevTop=this.options.prevLeft=0;return function(t){var a;if(r&&r.root&&r.root.editModule&&r.root.editModule.keyPress&&(a=r.root.editModule.keyPress),r.isEdit&&r.root.editModule.isScrollByFocus||r.isEdit&&("tab"===a||"shiftTab"===a))return void(r.root.editModule.isScrollByFocus=!1);var p=o.options.movableContainer?o.options.container.scrollTop:t.target.scrollTop,h=o.options.movableContainer?o.options.scrollbar.scrollLeft:t.target.scrollLeft,c=o.options.prevTop<p?"down":"up";c=o.options.prevLeft===h?c:o.options.prevLeft<h?"right":"left",o.options.prevTop=p,o.options.prevLeft=h;var u=o.sentinelInfo[""+c],g=0;if(o.newPos=p,null!=o.lastPos&&(g=o.newPos-o.lastPos),o.lastPos=o.newPos,o.timer&&clearTimeout(o.timer),o.timer=setTimeout(o.clear,0),(g>100||g<-100)&&t&&t.preventDefault&&(t.returnValue=!1,t.preventDefault()),-1!==o.options.axes.indexOf(u.axis)){o.containerRect=o.options.container.getBoundingClientRect();var f=o.check(c);if(u.entered&&("X"===u.axis||r.enableVirtualMaskRow)&&(!o.movableEle||"right"!==c&&"left"!==c?i(o.element,u,c,{top:p,left:h},o.fromWheel,f):i(o.movableEle,u,c,{top:p,left:h},o.fromWheel,f)),f){var m=l;"X"===u.axis?m({direction:c,sentinel:u,offset:{top:p,left:h},focusElement:document.activeElement}):r.dataSource instanceof n.DataManager&&void 0!==r.dataSource.dataSource.url&&!r.dataSource.dataSource.offline&&""!==r.dataSource.dataSource.url||s(r)||r.enableVirtualMaskRow?(m=r.enableVirtualMaskRow?d:m)({direction:c,sentinel:u,offset:{top:p,left:h},focusElement:document.activeElement}):e({direction:c,sentinel:u,offset:{top:p,left:h},focusElement:document.activeElement})}o.fromWheel=!1}}},i}(i.InterSectionObserver),We=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ye=function(){function e(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,i.Grid.Inject(Je),this.addEventListener()}return e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("localPagedExpandCollapse",this.collapseExpandVirtualchilds,this),this.parent.on("pagingActions",this.virtualPageAction,this),this.parent.on("destroy",this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("localPagedExpandCollapse",this.collapseExpandVirtualchilds),this.parent.off("pagingActions",this.virtualPageAction),this.parent.off("destroy",this.destroy))},e.prototype.collapseExpandVirtualchilds=function(e){this.parent.grid.notify("virtual-action-args",{isExpandCollapse:!0}),this.expandCollapseRec=e.record,e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded});var i={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};this.handleSelection();var r=t.getValue("isCollapseAll",this.parent)?"collapseAll":"refresh";t.getValue("grid.renderModule",this.parent).dataManagerSuccess(i,{requestType:r})},e.prototype.handleSelection=function(){("Cell"===this.parent.selectionSettings.mode||"Row"===this.parent.selectionSettings.mode&&!this.parent.selectionSettings.persistSelection)&&this.parent.grid.clearSelection(),t.getValue("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&this.parent.getSelectedRecords().length>0&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},e.prototype.virtualPageAction=function(e){var r=this,o=new n.DataManager(e.result),a=new n.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),s=o.executeLocal((new n.Query).where(a)).filter(function(e){return h(r.parent,e)});this.visualData=s,e.count=s.length,this.parent.grid.notify("data-listener",{data:s});var d={startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType};this.parent.grid.notify("index-modifier",d);var l=d.startIndex,p=d.endIndex;if(e.count=s.length,-1===l&&-1===p){var c=new n.Query,u=this.parent.grid.pageSettings.pageSize,g=u*(this.parent.grid.pageSettings.currentPage-1);c=c.skip(g).take(u),o.dataSource.json=s,e.result=o.executeLocal(c)}else{var f=e.actionArgs.requestType;("filtering"===f||"collapseAll"===f||"searching"===f||"refresh"===f&&t.getValue("isExpandAll",this.parent)||"refresh"===f&&this.parent.enableCollapseAll&&p>s.length&&t.isNullOrUndefined(this.expandCollapseRec))&&(l=0,p=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify("virtual-action-args",{setTop:!0})),("save"===f&&e.actionArgs.index>=d.count-this.parent.grid.pageSettings.pageSize||"refresh"===f&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=d.endIndex),(d.endIndex+this.parent.pageSettings.pageSize>=d.count&&this.parent.root&&d.count!==this.ganttEndIndex&&this.parent.isAddedFromGantt||!this.parent.isGantt||!this.parent.isAddedFromGantt)&&(l=d.startIndex+(d.count-d.endIndex),p=d.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=p,this.parent.isAddedFromGantt=!1);var m=this.parent.grid.contentModule.virtualEle.wrapper,y=i.getTransformValues(m).height;if(!t.isNullOrUndefined(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&l!==this.prevstartIndex)&&l<this.parent.getRows().length&&p<=l+this.parent.getRows().length&&0===y&&(l=0),"save"===e.actionArgs.requestType&&l!==this.prevstartIndex&&l<this.parent.getRows().length&&p<=l+this.parent.getRows().length&&0===y&&(p=(l=0)+this.parent.grid.pageSettings.pageSize),!t.isNullOrUndefined(this.expandCollapseRec)){var S=this.parent.grid.pageSettings.pageSize,v=s.indexOf(this.expandCollapseRec);if(s.slice(v,v+S).length<S&&v>=0&&0!==l){if(v=s.length-S,v=v>0?v:0,(p=s.length)-l<S&&(l=v,s.indexOf(this.expandCollapseRec)>s.length-S/2)){var w=l*this.parent.grid.getRowHeight();this.parent.grid.contentModule.translateY=w,this.parent.grid.contentModule.virtualEle.adjustTable(0,w)}}else t.getValue("isCollapseAll",this.parent)&&(l=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify("virtual-action-args",{setTop:!0}))}"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||t.isNullOrUndefined(this.parent.idMapping)||0!==l||(l=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify("virtual-action-args",{setTop:!0})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||t.isNullOrUndefined(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?l=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(l=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,l=l<0?0:l,0===p&&s.length>0?e.result=s:e.result=s.slice(l,p),this.prevstartIndex=l,this.prevendIndex=p,this.prevrequestType=e.actionArgs.requestType}this.parent.notify("updateAction",e)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length&&e.target.classList.contains("e-uncheck"))for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&!this.parent.getRows()[parseInt(t.toString(),10)].querySelector(".e-checkbox-disabled")&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},e}(),Je=function(e){function r(i,r){var n=e.call(this,i,r)||this;return t.getValue("parent",n).off("initial-load",t.getValue("instantiateRenderer",n),n),t.getValue("parent",n).on("initial-load",n.instantiateRenderers,n),n}return We(r,e),r.prototype.getModuleName=function(){return"treeVirtualScroll"},r.prototype.instantiateRenderers=function(){var e=t.getValue("parent",this);t.getValue("parent",this).log(["limitation","virtual_height"],"virtualization");var r=t.getValue("locator",this).getService("rendererFactory");e.enableColumnVirtualization&&t.getValue("addRenderer",r).apply(r,[i.RenderType.Header,new i.VirtualHeaderRenderer(t.getValue("parent",this),t.getValue("locator",this))]),t.getValue("addRenderer",r).apply(r,[i.RenderType.Content,new Qe(t.getValue("parent",this),t.getValue("locator",this))]),this.ensurePageSize()},r.prototype.ensurePageSize=function(){var e=t.getValue("parent",this),i=e.getRowHeight();t.isNullOrUndefined(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var r=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/i),n=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:n<r?r:n}},!0)},r}(i.VirtualScroll),Xe=function(){function e(e){i.Grid.Inject(i.Freeze),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},e.prototype.rowExpandCollapse=function(e){var i,r,n=this.parent.getDataRows(),o=this.parent.getRows(),a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;a&&(r=this.parent.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))})),i=e.detailrows.length?e.detailrows:n.filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))});for(var s=0;s<i.length;s++){var d=i[parseInt(s.toString(),10)],l=this.parent.grid.getRowObjectFromUID(d.getAttribute("data-uid")).data;!t.isNullOrUndefined(n)&&d.parentElement.firstElementChild.clientHeight>0&&(d.style.height=d.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(d,e.action),a&&r.length&&this.parent.toggleRowVisibility(r[parseInt(s.toString(),10)],e.action);var p="e-childrow-hidden"===e.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand";if(o[d.rowIndex].querySelector(p)){for(var h=[],c=0;c<n.length;c++)n[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&h.push(n[parseInt(c.toString(),10)]);if(h.length){var u=this.parent.getCurrentViewRecords()[h[0].rowIndex];this.rowExpandCollapse({detailrows:h,action:e.action,record:u})}}}},e.prototype.dblClickHandler=function(e){i.parentsUntil(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit(i.parentsUntil(e.target,"e-row"))},e.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&t.addClass([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getModuleName=function(){return"freeze"},e}(),$e=function(){function e(e){i.Grid.Inject(i.ColumnChooser),this.parent=e}return e.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"ColumnChooser"},e}(),Ze=function(){function e(e){this.parent=e,i.Grid.Inject(i.InfiniteScroll),this.addEventListener()}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on("pagingActions",this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off("pagingActions",this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},e.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),r=this.parent.grid.infiniteScrollModule.serviceLocator,n=new i.RowRenderer(r,null,this.parent.grid),o=this.parent.getRows(),a=e.index===o.length-1?"after":"before",s=this.parent.grid.getColumns(),d=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),l=[],p=0;p<d.length;p++)l.push(n.render(d[parseInt(p.toString(),10)],s));t.splice.apply(t,[e.index+1,0].concat(d));for(p=0;p<l.length;p++)"after"===a?o[e.index+p][""+a](l[parseInt(p.toString(),10)]):o[e.index+p+1][""+a](l[parseInt(p.toString(),10)]),o.splice(e.index+1+p,0,l[parseInt(p.toString(),10)]);i.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},e.prototype.contentready=function(){if(this.parent.infiniteScrollSettings.enableCache&&!t.isNullOrUndefined(this.parent.editModule)){this.parent.editModule.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns()&&this.parent.editModule.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())}},e.prototype.infinitePageAction=function(e){var i=new n.DataManager(e.result),r=new n.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),o=i.executeLocal((new n.Query).where(r)),a=t.getValue("actionArgs",e.actionArgs),s=t.getValue("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var d=!!s.some(function(e){return e===a.requestType})||!!this.parent.initialRender;if(this.visualData=o,e.count=o.length,t.getValue("isPrinting",e.actionArgs))e.result=o;else{var l=new n.Query,p=this.parent.infiniteScrollSettings.enableCache;p&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var h=d?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,c=this.parent.grid.pageSettings.currentPage;if(t.isNullOrUndefined(a))l=l.page(c,h);else{var u=t.getValue("lastIndex",this.parent.grid.infiniteScrollModule),g=t.getValue("firstIndex",this.parent.grid.infiniteScrollModule);if(p||"delete"!==a.requestType)l=p&&"delete"===a.requestType||"save"===a.requestType&&"add"===a.action?(l=l.skip(g)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):l.page(c,h);else{var f=u-a.data.length+1,m=a.data.length;l=l.skip(f).take(m)}}i.dataSource.json=o,p||t.isNullOrUndefined(a)||"save"!==a.requestType||"add"!==a.action?e.result=i.executeLocal(l):e.result=[a.data]}this.parent.notify("updateAction",e)},e.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&e.result.length>1)for(var r=1;r<e.result.length;r++)t[i[i.length-1]].push(e.result[parseInt(r.toString(),10)])},e.prototype.infiniteDeleteHandler=function(e){if("delete"===e.requestType){var t=this.parent.grid.getRowsObject(),i=this.parent.getRows(),r=e.data instanceof Array?e.data:[e.data],n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(this.removeRows(i,t,r,n,!0),this.parent.getFrozenColumns()>0){var o=this.parent.grid.getRowsObject(),a=this.parent.grid.getRows();this.removeRows(a,o,r,n)}}},e.prototype.removeRows=function(e,i,r,n,o){for(var a=this,s=0;s<r.length;s++)!function(s){i.filter(function(d,l){if(d.data[""+n]===r[parseInt(s.toString(),10)][""+n]){if(o){var p=Math.ceil((l+1)/a.parent.grid.pageSettings.pageSize);a.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(p,l)}i.splice(l,1),t.remove(e[parseInt(l.toString(),10)]),e.splice(l,1)}})}(s)},e.prototype.createRows=function(e){var r,n=e.args.e,o=e.row,a=this.parent.grid.infiniteScrollModule.serviceLocator,s=new i.RowRenderer(a,null,this.parent.grid),d=this.parent.getCurrentViewRecords(),l=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows();r=e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content").querySelector("tbody"):this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid.getContent().querySelector("tbody")):this.parent.getContent().querySelector("tbody"),this.parent.frozenRows&&(r=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?this.parent.grid.isFrozenGrid()?e.isMovable?this.parent.grid.getHeaderContent().querySelector("tbody"):e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header").querySelector("tbody"):this.parent.grid.getHeaderContent().querySelector("tbody"):this.parent.getHeaderContent().querySelector("tbody"):r);for(var p,h=this.parent.editModule.addRowIndex,u=0;u<o.length;u++){var g=s.render(o[parseInt(u.toString(),10)],this.parent.grid.getColumns());"save"===n.requestType&&"add"===n.action?-1!==t.getValue("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(p="after",h+=c(d[parseInt(h.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&(h-=1),l[parseInt(h.toString(),10)][""+p](g)):"Above"===this.parent.editSettings.newRowPosition&&(p="before",l[this.parent.editModule.addRowIndex][""+p](g)):"Bottom"===this.parent.editSettings.newRowPosition?r.appendChild(g):r.insertBefore(g,r.firstElementChild):"delete"===n.requestType&&r.appendChild(g)}e.cancel=!0},e.prototype.destroy=function(){this.removeEventListener()},e}();return xe.Inject(Ne,qe,Ve,Ce,Te,Be,be,ze,Ue,ke,_e,Le,je,G,Ye,He,De,Xe,$e,F,Ze),e.Aggregate=Be,e.AggregateColumn=ae,e.AggregateRow=se,e.Column=C,e.ColumnChooser=$e,e.ColumnMenu=ze,e.CommandColumn=_e,e.ContextMenu=Le,e.DataManipulation=ee,e.DetailRow=He,e.Edit=je,e.EditSettings=pe,e.ExcelExport=Ue,e.Filter=Ne,e.FilterSettings=U,e.Freeze=Xe,e.InfiniteScroll=Ze,e.InfiniteScrollSettings=ye,e.LoadingIndicator=P,e.Logger=F,e.Page=qe,e.PageSettings=re,e.PdfExport=ke,e.Predicate=N,e.Render=Z,e.Reorder=Ce,e.Resize=be,e.RowDD=De,e.RowDropSettings=Pe,e.SearchSettings=Y,e.Selection=G,e.SelectionSettings=$,e.Sort=Ve,e.SortDescriptor=ue,e.SortSettings=ge,e.StackedColumn=D,e.Toolbar=Te,e.TreeClipboard=H,e.TreeGrid=xe,e.TreeGridColumn=b,e.TreeVirtual=Je,e.TreeVirtualRowModelGenerator=Ee,e.VirtualScroll=Ye,e.actionBegin="actionBegin",e.actionComplete="actionComplete",e.actionFailure="actionFailure",e.ariaColIndex="aria-colindex",e.ariaRowIndex="aria-rowindex",e.autoCol="auto-col",e.batchAdd="batchAdd",e.batchCancel="batchCancel",e.batchDelete="batchDelete",e.batchEditFormRendered="batcheditform-rendered",e.batchSave="batchSave",e.beforeBatchAdd="beforeBatchAdd",e.beforeBatchCancel="before-batch-cancel",e.beforeBatchDelete="beforeBatchDelete",e.beforeBatchSave="beforeBatchSave",e.beforeCopy="beforeCopy",e.beforeDataBound="beforeDataBound",e.beforeExcelExport="beforeExcelExport",e.beforePaste="beforePaste",e.beforePdfExport="beforePdfExport",e.beforeStartEdit="edit-form",e.beginAdd="beginAdd",e.beginEdit="beginEdit",e.cellEdit="cellEdit",e.cellSave="cellSave",e.cellSaved="cellSaved",e.checkboxChange="checkboxChange",e.collapsed="collapsed",e.collapsing="collapsing",e.content="e-content",e.contextMenuClick="contextMenuClick",e.contextMenuOpen="contextMenuOpen",e.crudAction="crudAction",e.dataBound="dataBound",e.dataListener="data-listener",e.dataStateChange="dataStateChange",e.destroy="destroy",e.detailDataBound="detailDataBound",e.doubleTap="double-tap",e.expanded="expanded",e.expanding="expanding",e.extendArray=g,e.findChildrenRecords=c,e.findParentRecords=p,e.frozenContent="e-frozencontent",e.frozenHeader="e-frozenheader",e.frozenLeft="frozen-left",e.frozenRight="frozen-right",e.getExpandStatus=h,e.getParentData=m,e.getPlainData=f,e.headerContent="e-headercontent",e.indexModifier="index-modifier",e.isCheckboxcolumn=d,e.isCountRequired=s,e.isFilterChildHierarchy=l,e.isHidden=y,e.isOffline=u,e.isRemoteData=a,e.keyPressed="key-pressed",e.leftRight="Left-Right",e.load="load",e.localPagedExpandCollapse="localPagedExpandCollapse",e.movableContent="e-movablecontent",e.movableHeader="e-movableheader",e.pagingActions="pagingActions",e.printGridInit="printGrid-Init",e.queryCellInfo="queryCellInfo",e.recordDoubleClick="recordDoubleClick",e.remoteExpand="remoteExpand",e.resizeStop="resizeStop",e.rowDataBound="rowDataBound",e.rowDeselected="rowDeselected",e.rowDeselecting="rowDeselecting",e.rowDrag="rowDrag",e.rowDragStart="rowDragStart",e.rowDragStartHelper="rowDragStartHelper",e.rowDrop="rowDrop",e.rowDropped="row-dropped",e.rowSelected="rowSelected",e.rowSelecting="rowSelecting",e.rowdraging="row-draging",e.rowsAdd="rows-add",e.rowsRemove="rows-remove",e.savePreviousRowPosition="savePreviousRowPosition",e.table="e-table",e.toolbarClick="toolbarClick",e.treeGridDetails=j,e.updateData="update-data",e.virtualActionArgs="virtual-action-args",e.virtualColumnIndex="virtualColumnIndex",e}({},ej.base,ej.grids,ej.buttons,ej.data,ej.popups),this.ejs=ej;
|
|
1
|
+
this.ej=this.ej||{},this.ej.treegrid=function(e,t,i,r,n,o){"use strict";function a(e){if(e.treeGrid&&e.treeGrid.isGantt)return!!e.taskFields.hasChildMapping&&(e.dataSource instanceof n.DataManager&&((t=e.dataSource.adaptor)instanceof n.ODataAdaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.UrlAdaptor));if(e.dataSource instanceof n.DataManager){var t=e.dataSource.adaptor;return t instanceof n.ODataAdaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.UrlAdaptor}return!1}function s(e){return!!(e.dataSource&&"result"in e.dataSource)}function d(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function l(e){return!((t.isNullOrUndefined(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function p(e){for(var t=[],r=0,n=Object.keys(e).length;r<n;r++)i.getObject("hasChildRecords",e[parseInt(r.toString(),10)])&&t.push(e[parseInt(r.toString(),10)]);return t}function h(e,i,r){var n,o=t.isNullOrUndefined(i.parentItem)?null:m(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||t.isNullOrUndefined(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||(n=m(e,o.parentItem.uniqueID),n&&e.initialRender&&!t.isNullOrUndefined(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||h(e,n)))):(o.expanded=!1,!1))}function c(e){var i=[];if(t.isNullOrUndefined(e)||!e.hasChildRecords&&!t.isNullOrUndefined(e.childRecords)&&!e.childRecords.length)return[];if(!t.isNullOrUndefined(e.childRecords))for(var r=e.childRecords.filter(function(e){return!e.isSummaryRow}),n=0,o=Object.keys(r).length;n<o;n++)i.push(r[parseInt(n.toString(),10)]),(r[parseInt(n.toString(),10)].hasChildRecords||!t.isNullOrUndefined(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(c(r[parseInt(n.toString(),10)])));return i}function u(e){if(a(e)){var i=e.dataSource;return!t.isNullOrUndefined(i.ready)}return!0}function g(e){for(var t,i,r=[],n=0;e&&n<e.length;n++){i=Object.keys(e[parseInt(n.toString(),10)]),t={};for(var o=0;o<i.length;o++)t[i[parseInt(o.toString(),10)]]=e[parseInt(n.toString(),10)][i[parseInt(o.toString(),10)]];r.push(t)}return r}function f(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function m(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function y(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}function S(e,i,r,o,a,s,d){var l,p,h,c=e.value,u=e.action,f=i.grid.getPrimaryKeyFieldNames()[0],y=i.dataSource instanceof n.DataManager?i.dataSource.dataSource.json:i.dataSource,S=i.grid.dataSource,R=[],x=c,C=!1;if("Batch"===i.editSettings.mode&&(h=i.grid.editModule.getBatchChanges()),"add"===u||"batchsave"===u&&"Batch"===i.editSettings.mode&&h.addedRecords.length){var b=v(e,y,i,r,o,a,d);c=b.value,C=b.isSkip}if(c instanceof Array?R=g(c):R.push(t.extend({},c)),!C&&("add"!==u||"Top"!==i.editSettings.newRowPosition&&"Bottom"!==i.editSettings.newRowPosition))for(var D=0;D<R.length;D++){"object"==typeof R[parseInt(D.toString(),10)][""+f]&&(R[parseInt(D.toString(),10)]=R[parseInt(D.toString(),10)][""+f]);var M=R[parseInt(D.toString(),10)].taskData?Object.keys(R[parseInt(D.toString(),10)].taskData):Object.keys(R[parseInt(D.toString(),10)]);l=0===y.length&&1===S.length?S.length:y.length;for(;l--&&l>=0&&"break"!==function(){if(0===y.length&&1===S.length&&S[parseInt(l.toString(),10)][""+f]===R[parseInt(D.toString(),10)][""+f]||y[parseInt(l.toString(),10)][""+f]===R[parseInt(D.toString(),10)][""+f]){if("delete"!==u){if("edit"===u){for(p=0;p<M.length;p++)if(Object.prototype.hasOwnProperty.call(y[parseInt(l.toString(),10)],M[parseInt(p.toString(),10)])&&("Cell"!==i.editSettings.mode||!t.isNullOrUndefined(h)&&0===h.changedRecords.length||M[parseInt(p.toString(),10)]===s)){var e=m(i,R[parseInt(D.toString(),10)].uniqueID);y[parseInt(l.toString(),10)][M[parseInt(p.toString(),10)]]=R[parseInt(D.toString(),10)][M[parseInt(p.toString(),10)]],e&&e.taskData&&(e.taskData[M[parseInt(p.toString(),10)]]=e[M[parseInt(p.toString(),10)]]=y[parseInt(l.toString(),10)][M[parseInt(p.toString(),10)]])}}else if("add"===u||"batchsave"===u){var n=void 0;"Child"===i.editSettings.newRowPosition?0===y.length&&1===S.length?y.push(x.taskData):r?(x.taskData[""+i.parentIdMapping]=y[parseInt(l.toString(),10)][""+i.idMapping],y.splice(l+1,0,x.taskData)):(Object.prototype.hasOwnProperty.call(y[parseInt(l.toString(),10)],i.childMapping)||(y[parseInt(l.toString(),10)][""+i.childMapping]=[]),y[parseInt(l.toString(),10)][""+i.childMapping].push(x.taskData),I(f,y[parseInt(l.toString(),10)],u,i,r,x)):"Below"===i.editSettings.newRowPosition?(y.splice(l+1,0,x.taskData),t.isNullOrUndefined(x.parentItem)||I(f,y[l+1],u,i,r,x)):o?"Above"===i.editSettings.newRowPosition&&(y.splice(l,0,x.taskData),t.isNullOrUndefined(x.parentItem)||I(f,y[parseInt(l.toString(),10)],u,i,r,x)):(n=0,y.splice(n,0,x.taskData))}return"break"}var a=y[parseInt(l.toString(),10)];if(y.splice(l,1),r){if(!t.isNullOrUndefined(a[""+i.parentIdMapping]))for(var d=i.flatData.filter(function(e){return e[""+i.idMapping]===a[""+i.parentIdMapping]})[0],c=d?d[""+i.childMapping]:[],g=c.length-1;g>=0;g--)if(c[parseInt(g.toString(),10)][""+i.idMapping]===a[""+i.idMapping]){i.enableImmutableMode||d.childRecords.length!==d.Children.length||d.childRecords.splice(g,1),c.splice(g,1),c.length||(d.hasChildRecords=!1,I(f,d,u,i,r));break}return"break"}}else t.isNullOrUndefined(y[parseInt(l.toString(),10)][""+i.childMapping])||w(y[parseInt(l.toString(),10)][""+i.childMapping],R[parseInt(D.toString(),10)],u,f,i,r,x,s)&&I(f,y[parseInt(l.toString(),10)],u,i,r)}(););}}function v(e,i,r,n,o,a,s){var d,l=!1,p=r.grid.getCurrentViewRecords();switch(d=t.extend({},e.value),d=f(d),r.editSettings.newRowPosition){case"Top":i.unshift(d),l=!0;break;case"Bottom":i.push(d),l=!0;break;case"Above":d=f(t.isNullOrUndefined(s)?0===p.length?d:d=t.extend({},p[o+1]):d=t.extend({},s));break;case"Below":case"Child":if(t.isNullOrUndefined(s)){var h=r.grid.getPrimaryKeyFieldNames()[0],c=p.length>0?p[parseInt(o.toString(),10)]:[];d=f(d=!t.isNullOrUndefined(c)&&c[""+h]===e.value[""+h]||-1!==a&&0!==i.length?t.extend({},c):t.extend({},e.value));r.editModule.internalProperties.taskData=d}else d=f(d=t.extend({},s));-1===a&&(i.unshift(d),l=!0)}return{value:d,isSkip:l}}function w(e,i,r,n,o,a,s,d){for(var l=!1,p=e.length;p--&&p>=0;)if(e[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&e[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h=Object.keys(i),c=m(o,i.uniqueID),u=0;u<h.length;u++)if(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],h[parseInt(u.toString(),10)])&&("Cell"!==o.editSettings.mode||h[parseInt(u.toString(),10)]===d)&&(c[h[parseInt(u.toString(),10)]]=c.taskData[h[parseInt(u.toString(),10)]]=e[parseInt(p.toString(),10)][h[parseInt(u.toString(),10)]]=i[h[parseInt(u.toString(),10)]],"Normal"===o.grid.editSettings.mode&&"Cell"===o.editSettings.mode&&!t.isNullOrUndefined(o.grid.editModule))){o.grid.editModule.editModule.editRowIndex=i.index,o.grid.editModule.editModule.updateCurrentViewData(i)}break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?a?(s[""+o.parentIdMapping]=e[parseInt(p.toString(),10)][o.idMapping],e.splice(p+1,0,s),I(n,e[parseInt(p.toString(),10)],r,o,a,s)):(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],o.childMapping)||(e[parseInt(p.toString(),10)][o.childMapping]=[]),e[parseInt(p.toString(),10)][o.childMapping].push(s.taskData),I(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(e.splice(p,0,s.taskData),t.isNullOrUndefined(s.parentItem)||I(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(e.splice(p+1,0,s.taskData),t.isNullOrUndefined(s.parentItem)||I(n,e[parseInt(p.toString(),10)],r,o,a,s)):(e.splice(p,1),e.length||(l=!0))}else t.isNullOrUndefined(e[parseInt(p.toString(),10)][o.childMapping])||w(e[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&I(n,e[parseInt(p.toString(),10)],r,o,a);return l}function I(e,i,r,o,a,s){if("Above"!==o.editSettings.newRowPosition&&"Below"!==o.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||t.isNullOrUndefined(s.parentItem)){var d,l=o.grid.getCurrentViewRecords();if(l.map(function(t,r){if(t[""+e]===i[""+e])return void(d=r)}),o.enableVirtualization&&t.isNullOrUndefined(d)){var p=t.getValue("uniqueIDCollection."+s.parentUniqueID,o);i=p}if(t.isNullOrUndefined(d)||(i=l[parseInt(d.toString(),10)]),o.enableVirtualization&&t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&(i=t.getValue("uniqueIDCollection."+s.parentUniqueID,o)),a||t.isNullOrUndefined(i.childRecords)||!i.childRecords.length?i.hasChildRecords=!1:i.hasChildRecords=!0,"add"===r||"batchsave"===r){i.expanded=!0,i.hasChildRecords=!0,o.sortSettings.columns.length&&t.isNullOrUndefined(s)&&(s=l.filter(function(e){return e.parentUniqueID===i.uniqueID?e:null}));var h=s?s instanceof Array?s[0]:s:l[d+1];"Below"!==o.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(i,"childRecords")?t.isNullOrUndefined(s)||i[""+e]===s[""+e]||i.childRecords.some(function(e){return e.uniqueID===s.uniqueID})||i.childRecords.push(s):i.childRecords=[],-1===i.childRecords.indexOf(h)&&i[""+e]!==s[""+e]&&i.childRecords.unshift(h),a&&(Object.prototype.hasOwnProperty.call(i,o.childMapping)||(i[o.childMapping]=[]),-1===i[""+o.childMapping].indexOf(h)&&i[""+e]!==s[""+e]&&i[o.childMapping].unshift(h)))}for(var c=o.grid.getPrimaryKeyFieldNames()[0],u=o.grid.dataSource instanceof n.DataManager?o.grid.dataSource.dataSource.json:o.grid.dataSource,g=0;g<u.length;g++)if(u[parseInt(g.toString(),10)][""+c]===i[""+c]){u[parseInt(g.toString(),10)]=i;break}o.grid.setRowData(e,i);var f=o.getRowByIndex(d);"Batch"===o.editSettings.mode&&(f="add"===r?o.getRows()[o.grid.getCurrentViewRecords().indexOf(i)]:o.getRows()[o.grid.getRowIndexByPrimaryKey(i[""+e])]);var y=void 0;if((o.frozenRows||o.getFrozenColumns())&&(y=o.getRowByIndex(d)),!o.enableVirtualization&&!t.isNullOrUndefined(f)||!t.isNullOrUndefined(y)){var S=o.treeColumnIndex;o.allowRowDragAndDrop&&o.enableImmutableMode&&(S+=1),o.renderModule.cellRender({data:i,cell:f.cells[parseInt(S.toString(),10)]?f.cells[parseInt(S.toString(),10)]:y.cells[S-o.getFrozenColumns()],column:o.grid.getColumns()[o.treeColumnIndex],requestType:r}),(o.enableImmutableMode&&"indenting"===o.action||"outdenting"===o.action)&&o.renderModule.RowModifier({data:i,row:f})}}else m(o,s.parentItem.uniqueID).childRecords.push(s)}var R=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),x=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},C=function(){function e(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},this.enableRowSpan=!0,this.enableColumnSpan=!0,t.merge(this,e)}return e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)if(this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]){this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)}},e}(),b=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),x([t.Property(null)],i.prototype,"columns",void 0),i}(C),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return R(t,e),t}(b),M=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),O=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return M(i,e),O([t.Property("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),A=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),E=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),E([t.Property()],i.prototype,"field",void 0),E([t.Property()],i.prototype,"operator",void 0),E([t.Property()],i.prototype,"value",void 0),E([t.Property()],i.prototype,"matchCase",void 0),E([t.Property()],i.prototype,"ignoreAccent",void 0),E([t.Property()],i.prototype,"predicate",void 0),E([t.Property({})],i.prototype,"actualFilterValue",void 0),E([t.Property({})],i.prototype,"actualOperator",void 0),E([t.Property()],i.prototype,"type",void 0),E([t.Property()],i.prototype,"ejpredicate",void 0),E([t.Property()],i.prototype,"uid",void 0),E([t.Property()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return A(i,e),E([t.Collection([],N)],i.prototype,"columns",void 0),E([t.Property("FilterBar")],i.prototype,"type",void 0),E([t.Property()],i.prototype,"mode",void 0),E([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),E([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),E([t.Property()],i.prototype,"operators",void 0),E([t.Property(!1)],i.prototype,"ignoreAccent",void 0),E([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),k=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),q=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),q([t.Property("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),T=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),V="https://ej2.syncfusion.com/documentation/treegrid",z="https://ej2.syncfusion.com/documentation",L=!1,F=function(e){function r(t){return i.Grid.Inject(i.Logger),e.call(this,t)||this}return T(r,e),r.prototype.getModuleName=function(){return"logger"},r.prototype.log=function(e,r){e instanceof Array||(e=[e]);for(var n=e,o=0;o<n.length;o++){var a=i.detailLists[n[parseInt(o.toString(),10)]],s=a.check(r,this.parent);if(s.success){var d=a.generateMessage(r,this.parent,s.options);d=d.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),L&&"primary_column_missing"===n[parseInt(o.toString(),10)]&&(d=d.replace("Editing","Row DragAndDrop"),L=!1);var l=d.indexOf("https"),p=d.substring(l);"module_missing"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/modules"):"primary_column_missing"===n[parseInt(o.toString(),10)]||"selection_key_missing"===n[parseInt(o.toString(),10)]?d=d.replace(p,z+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/edit"):"virtual_height"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/virtual"):"check_datasource_columns"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/columns"):"locale_missing"===n[parseInt(o.toString(),10)]&&(d=d.replace(p,V+"/global-local/#localization")),"datasource_syntax_mismatch"===n[parseInt(o.toString(),10)]?t.isNullOrUndefined(this.treeGridObj)||t.isNullOrUndefined(this.treeGridObj.dataStateChange)||console[a.logType](d):console[a.logType](d)}}},r.prototype.treeLog=function(e,t,i){this.treeGridObj=i,e instanceof Array||(e=[e]);var r=e;i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(L=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=j[r[parseInt(n.toString(),10)]],a=o.check(t,i);if(a.success){var s=o.generateMessage(t,i,a.options);console[o.logType](s)}}},r}(i.Logger),j={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return(t.isNullOrUndefined(i.idMapping)&&t.isNullOrUndefined(i.childMapping)&&t.isNullOrUndefined(i.parentIdMapping)||!t.isNullOrUndefined(i.idMapping)&&t.isNullOrUndefined(i.parentIdMapping)||t.isNullOrUndefined(i.idMapping)&&!t.isNullOrUndefined(i.parentIdMapping))&&(r={success:!0}),r},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+z+"/api/treegrid#childmapping\n"+z+"/api/treegrid#idmapping\n"+z+"/api/treegrid#$parentidmapping"}}},_=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),H=function(e){function i(t,i){var r=e.call(this,t.grid,i)||this;return r.treeCopyContent="",r.copiedUniqueIdCollection=[],r.treeGridParent=t,r.serviceLocator=i,r}return _(i,e),i.prototype.setCopyData=function(i){var r=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";var n=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var o=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),a=0;a<o.length;a++){a>0&&(this.treeCopyContent+="\n");var s=o[parseInt(a.toString(),10)];if(!n[s].classList.contains("e-summaryrow")){var d=[].slice.call(n[s].querySelectorAll(".e-rowcell")),l=this.treeGridParent.getSelectedRecords()[parseInt(a.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(l)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(r,s,n,i,a),this.getCopyData(d,!1,"\t",i),this.treeCopyContent+=this.copyContent,this.copiedUniqueIdCollection.push(l),this.copyContent="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(r,o[parseInt(a.toString(),10)],n,i))}}if(i){var p=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText});this.getCopyData(p,!1,"\t",i),this.treeCopyContent=this.copyContent+"\n"+this.treeCopyContent}var h={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger("beforeCopy",h),h.cancel)return;this.clipBoardTextArea.value=this.copyContent=h.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent=""}else e.prototype.setCopyData.call(this,i)}},i.prototype.parentContentData=function(e,i,r,n,o){if(!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem))for(var a=e[parseInt(i.toString(),10)].parentItem.level,s=0;s<a+1;s++)for(var d=0;d<e.length;d++)if(!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)&&e[parseInt(d.toString(),10)].uniqueID===e[parseInt(i.toString(),10)].parentItem.uniqueID){i=d;var l=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),p=e[parseInt(d.toString(),10)].uniqueID;if(-1===this.copiedUniqueIdCollection.indexOf(p)){this.getCopyData(l,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this.copyContent+"\n":this.copyContent+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(p),this.copyContent="";break}}},i.prototype.copy=function(t){e.prototype.copy.call(this,t)},i.prototype.paste=function(t,i,r){e.prototype.paste.call(this,t,i,r)},i.prototype.getModuleName=function(){return"clipboard"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.childContentData=function(e,i,r,n){if(e[parseInt(i.toString(),10)].hasChildRecords)for(var o=e[parseInt(i.toString(),10)].childRecords,a=0;a<o.length;a++)for(var s=0;s<e.length;s++)if(!t.isNullOrUndefined(o[parseInt(a.toString(),10)].uniqueID)&&e[parseInt(s.toString(),10)].uniqueID===o[parseInt(a.toString(),10)].uniqueID){if(!t.isNullOrUndefined(r[parseInt(s.toString(),10)])&&!r[parseInt(s.toString(),10)].classList.contains("e-summaryrow")){var d=[].slice.call(r[parseInt(s.toString(),10)].querySelectorAll(".e-rowcell")),l=e[parseInt(s.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(l)&&(this.getCopyData(d,!1,"\t",n),this.treeCopyContent+="\n"+this.copyContent,this.copyContent="",this.copiedUniqueIdCollection.push(l),this.childContentData(e,s,r,n))}break}},i}(i.Clipboard),G=function(){function e(e){this.headerCheckboxFrameEl=null,this.checkboxColIndexCache=-2,this.parentSelectionCounters={},this.selectedUidMap=new Map,this.totalSelectableCount=0,this.headerSelectionState="uncheck",this.checkedItemCount=0,this.visibleUidIndex={},this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.buildVisibleUidMap=function(){this.visibleUidIndex={};var e=this.parent.grid.currentViewData;if(e)for(var t=0,i=e.length;t<i;t++){var r=e[parseInt(t.toString(),10)];r&&r.uniqueID&&(this.visibleUidIndex[r.uniqueID]=t)}},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},e.prototype.destroy=function(){this.resetSelectionCaches(),this.removeEventListener()},e.prototype.checkboxSelection=function(e){var r,n,o=i.getObject("target",e),s=i.parentsUntil(o,"e-checkbox-wrapper");if(s&&s.querySelectorAll(".e-treecheckselect").length>0){n=s.querySelector('input[type="checkbox"]');var d=[];this.parent.frozenRows?d.push(parseInt(o.closest("tr").getAttribute("aria-rowindex"),10)-1):d.push(o.closest("tr").rowIndex),this.selectCheckboxes(d);var l=n.nextElementSibling.classList.contains("e-check");this.triggerChkChangeEvent(n,l,o.closest("tr"))}else if(s&&s.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var p=s.querySelector(".e-frame"),h=!p.classList.contains("e-check")&&!p.classList.contains("e-stop");this.headerSelection(h),n=s.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(n,h,o.closest("tr"))}!t.isNullOrUndefined(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(this.parent)&&this.parent.parentQuery.length>0&&((r=this.parent.query.queries).push.apply(r,this.parent.parentQuery),this.parent.parentQuery=[])},e.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],n={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger("checkboxChange",n)},e.prototype.getCheckboxcolumnIndex=function(){if(-2!==this.checkboxColIndexCache)return this.checkboxColIndexCache;for(var e,i=-1,r=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].showCheckbox){e=r[parseInt(n.toString(),10)].uid;break}for(var o=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv"),a=0;a<o.length;a++)if(o[parseInt(a.toString(),10)].getAttribute("data-mappinguid")===e){i=a;break}return this.checkboxColIndexCache=t.isNullOrUndefined(i)?-1:i,this.checkboxColIndexCache},e.prototype.headerCheckbox=function(){if(this.buildVisibleUidMap(),this.totalSelectableCount=this.countSelectableRecords(this.resolveHeaderSelectionList(!0)),this.columnIndex=this.getCheckboxcolumnIndex(),this.columnIndex>-1){var e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex];if(e&&0===e.querySelectorAll(".e-treeselectall").length){var i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),n=r.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "});n.classList.add("e-hierarchycheckbox"),n.insertBefore(i.cloneNode(),n.firstChild),t.isNullOrUndefined(e)||e.insertBefore(n,e.firstChild),this.headerCheckboxFrameEl=n.querySelector(".e-frame"),this.parent.autoCheckHierarchy&&this.headerSelection()}else e&&e.querySelectorAll(".e-treeselectall").length>0&&(this.headerCheckboxFrameEl=e.querySelector(".e-frame"),this.parent.autoCheckHierarchy&&this.headerSelection())}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),n=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var o="check"===n.checkboxState,a=r.createCheckBox(this.parent.createElement,!1,{checked:o,label:" "});if(a.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(a.querySelector(".e-frame").style.width="18px"),"indeterminate"===n.checkboxState){s=a.querySelectorAll(".e-frame")[0];t.removeClass([s],["e-check","e-stop","e-uncheck"]),a.querySelector(".e-frame").classList.add("e-stop")}else if("uncheck"===n.checkboxState){s=a.querySelectorAll(".e-frame")[0];t.removeClass([s],["e-check","e-stop","e-uncheck"]),a.querySelector(".e-frame").classList.add("e-uncheck")}else if("check"===n.checkboxState){var s=a.querySelectorAll(".e-frame")[0];t.removeClass([s],["e-check","e-stop","e-uncheck"]),a.querySelector(".e-frame").classList.add("e-check")}return a.insertBefore(i.cloneNode(),a.firstChild),a},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if(t.isNullOrUndefined(r)){var n=this.parent.createElement("span",{className:"e-treecheckbox"}),o=e.cell.innerHTML;e.cell.innerHTML="",n.innerHTML=o;var a=this.parent.createElement("div",{className:"e-treecheckbox-container"});a.appendChild(i),a.appendChild(n),e.cell.appendChild(a)}else e.cell.querySelector(".e-hierarchycheckbox")||r.insertBefore(i,r.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){for(var t=0;t<e.length;t++){var i=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],r=m(this.parent,i.uniqueID),n="check"===r.checkboxState?"uncheck":"check";r.checkboxState=n,this.traverSelection(r,n,!1)}},e.prototype.traverSelection=function(e,t,i){var r=e.checkboxState;i||this.buildVisibleUidMap();var n=Array.isArray(e.childRecords)?e.childRecords:[];if(n&&0!==n.length||!this.parent.autoCheckHierarchy||(n=this.getChildrenFromFlat(e)),this.parent.filterModule&&this.parent.filterModule.filteredResult.length>0&&n&&n.length&&(n=this.getFilteredChildRecords(n)),!this.parent.autoCheckHierarchy||!n||0===n.length)return this.updateSelectedItems(e,t),void(i||(e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),""),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState()));for(var o=0,a=0,s=0,d=0;d<n.length;d++){var l=n[parseInt(d.toString(),10)];l&&!l.isSummaryRow&&(o++,this.updateSelectedItems(l,t,!0),l.hasChildRecords&&this.traverSelection(l,t,!0),"check"===l.checkboxState?a++:"indeterminate"===l.checkboxState&&s++)}e.uniqueID&&(this.parentSelectionCounters[e.uniqueID]={total:o,checked:a,indeterminate:s});var p=this.parentSelectionCounters[e.uniqueID],h=this.deriveParentState(e,p);if("check"===t&&p.total>0&&p.checked===p.total&&0===p.indeterminate&&(h="check"),this.updateSelectedItems(e,h),!i&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem,r,h),!i){var c=this.resolveHeaderSelectionList();this.updateSelectedCollectionsAfterBulk(c,""),this.refreshVisibleCheckboxes(),this.updateHeaderCheckboxState()}},e.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return t.parent.filterModule.filteredResult.indexOf(e)>-1})},e.prototype.getChildrenFromFlat=function(e){var t=this.parent.flatData;if(!t||!e)return[];for(var i=e.uniqueID,r=[],n=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)];if(o&&!o.isSummaryRow){var a=o.parentItem;a&&a.uniqueID===i&&r.push(o)}}return r},e.prototype.updateParentSelection=function(e,t,i){var r=m(this.parent,e.uniqueID);if(r){var n=this.buildSelectionSummary(r);t&&this.applySummaryDelta(n,t,-1),i&&this.applySummaryDelta(n,i,1),r.uniqueID&&(this.parentSelectionCounters[r.uniqueID]=n);var o=this.deriveParentState(r,n);if(r.checkboxState!==o){var a=r.checkboxState;r.checkboxState=o,this.updateSelectedItems(r,o),r.parentItem&&this.updateParentSelection(r.parentItem,a,o)}}},e.prototype.buildSelectionSummary=function(e,t){var i={total:0,checked:0,indeterminate:0},r=[];r=e&&Array.isArray(e.childRecords)&&e.childRecords.length?e.childRecords:this.getChildrenFromFlat(e),!t&&this.parent.filterModule&&this.parent.filterModule.filteredResult.length>0&&(r=this.getFilteredChildRecords(r));for(var n=0;n<r.length;n++){var o=r[parseInt(n.toString(),10)];o&&!o.isSummaryRow&&(i.total++,"check"===o.checkboxState?i.checked++:"indeterminate"===o.checkboxState&&i.indeterminate++)}return i},e.prototype.applySummaryDelta=function(e,t,i){"check"===t?e.checked=Math.max(0,e.checked+i):"indeterminate"===t&&(e.indeterminate=Math.max(0,e.indeterminate+i))},e.prototype.deriveParentState=function(e,t){var i=t.total,r=t.checked;return t.indeterminate>0||r>0&&r!==i?"indeterminate":r===i&&i>0?"check":"uncheck"},e.prototype.headerSelection=function(e){if(!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var i=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=i),this.parent.grid.searchSettings.key.length?this.searchingRecords=i:this.filteredList===i||this.parent.grid.searchSettings.key.length||(this.filteredList=i,this.searchingRecords=[])}this.searchingRecords.length>0&&!t.isNullOrUndefined(e)?this.filteredList=this.searchingRecords:this.filteredList.length>0&&!this.parent.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(this.filteredList=[]);var r=this.resolveHeaderSelectionList(!0);if(!t.isNullOrUndefined(e)){this.resetSelectionCaches();var n=e?"check":"uncheck";return this.headerSelectionState=n,this.processHeaderSelection(r,n),this.finalizeParentsAfterBulk(r),this.updateSelectedCollectionsAfterBulk(r,""),this.refreshVisibleCheckboxes(),void this.updateHeaderCheckboxState()}this.totalSelectableCount=this.countSelectableRecords(r),this.updateHeaderCheckboxState()},e.prototype.finalizeParentsAfterBulk=function(e){for(var t=e,i=0;i<t.length;i++){var r=t[parseInt(i.toString(),10)];if(r&&r.hasChildRecords){var n=this.buildSelectionSummary(r,!0);this.parentSelectionCounters[r.uniqueID]=n;var o=this.deriveParentState(r,n);"check"===this.headerSelectionState&&n.total>0&&n.checked===n.total&&0===n.indeterminate?o="check":"uncheck"===this.headerSelectionState&&(o="uncheck"),r.checkboxState!==o&&this.updateSelectedItems(r,o)}}},e.prototype.processHeaderSelection=function(e,t){for(var i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)];r&&(r.checkboxState!==t&&(r.checkboxState=t,this.updateSelectedItems(r,t,!0)))}},e.prototype.updateSelectedCollectionsAfterBulk=function(e,t){for(var i=!!(this.parent.filterModule&&this.parent.filterModule.filteredResult&&this.parent.filterModule.filteredResult.length),r=!!(this.parent.grid&&this.parent.grid.searchSettings&&this.parent.grid.searchSettings.key&&this.parent.grid.searchSettings.key.length),n=i||r||"refresh"===t||"searching"===t,o=n?e:this.selectedItems.slice(),a=[],s=new Map,d=[],l=0,p=o;l<p.length;l++)(y=p[l]).hasChildRecords&&n&&0===y.level&&this.updateParentSelection(y),y.uniqueID&&"check"===y.checkboxState&&(a.push(y),s.set(y.uniqueID,!0));if(!n){var h=this.parent.flatData;if(h)for(var c=0,u=h;c<u.length;c++){var g=u[c];g&&!g.isSummaryRow&&(g.uniqueID&&"check"===g.checkboxState&&!s.has(g.uniqueID)&&(a.push(g),s.set(g.uniqueID,!0)))}}this.selectedItems=a,this.selectedUidMap=s,this.buildVisibleUidMap();for(var f=0,m=this.selectedItems;f<m.length;f++){var y=m[f],S=this.visibleUidIndex[y.uniqueID];void 0!==S&&d.push(S)}this.selectedIndexes=d,this.checkedItemCount=this.selectedItems.length,this.totalSelectableCount=this.countSelectableRecords(e)},e.prototype.refreshVisibleCheckboxes=function(){this.buildVisibleUidMap();for(var e=this.parent.getCurrentViewRecords(),i=this.parent.uniqueIDCollection,r=0;e&&r<e.length;r++){var n=e[parseInt(r.toString(),10)];if(n){var o=n.uniqueID,a=i&&null!=o?i[String(o)]:n,s=a&&a.checkboxState?a.checkboxState:"uncheck",d=null,l=n.uid;if(l&&(d=this.parent.grid.getRowElementByUID(l)),!d){var p=this.parent.getRows();if(d=p&&p[parseInt(r.toString(),10)],(this.parent.frozenRows||this.parent.getFrozenColumns())&&!d){var h=this.parent.getDataRows();d=h&&h[parseInt(r.toString(),10)]}}if(d){var c=d.querySelector(".e-hierarchycheckbox .e-frame");if(c){t.removeClass([c],["e-check","e-stop","e-uncheck"]),c.classList.add("indeterminate"===s?"e-stop":"e-"+s);var u=d.querySelector(".e-treecheckselect");u&&u.setAttribute("aria-checked","check"===s?"true":"uncheck"===s?"false":"mixed")}}}}},e.prototype.resetSelectionCaches=function(){this.parentSelectionCounters={},this.selectedUidMap=new Map,this.selectedItems=[],this.selectedIndexes=[],this.totalSelectableCount=0,this.headerSelectionState="uncheck",this.checkedItemCount=0},e.prototype.countSelectableRecords=function(e){var t=0;if(!e)return t;for(var i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)];r&&!r.isSummaryRow&&t++}return t},e.prototype.resolveHeaderSelectionList=function(e){var t=[];if(a(this.parent))t=this.parent.getCurrentViewRecords();else{var i=!!(this.parent.filterModule&&this.parent.filterModule.filteredResult&&this.parent.filterModule.filteredResult.length),r=!!(this.parent.grid&&this.parent.grid.searchSettings&&this.parent.grid.searchSettings.key&&this.parent.grid.searchSettings.key.length);t=i?this.filteredList&&this.filteredList.length?this.filteredList:this.parent.filterModule.filteredResult:r&&this.searchingRecords&&this.searchingRecords.length?this.searchingRecords:this.parent.flatData}return t},e.prototype.updateHeaderCheckboxState=function(){var e=this.headerCheckboxFrameEl;if(e){var i=this.resolveHeaderSelectionList(!0);this.totalSelectableCount=this.countSelectableRecords(i);for(var r=0,n=0,o=i;n<o.length;n++){var a=o[n];a&&!a.isSummaryRow&&"check"===a.checkboxState&&r++}t.removeClass([e],["e-check","e-stop","e-uncheck"]),0===this.totalSelectableCount?e.classList.add("e-uncheck"):0===r?e.classList.add("e-uncheck"):r===this.totalSelectableCount?e.classList.add("e-check"):e.classList.add("e-stop")}},e.prototype.updateSelectedItems=function(e,i,r){this.buildVisibleUidMap();var n=e.uniqueID,o=this.parent.uniqueIDCollection,a=o&&null!=n&&o[String(n)]?o[String(n)]:e,s=!0===e.isSummaryRow,d=a.checkboxState,l=this.visibleUidIndex[String(n)];if(a.checkboxState=i,!r){if(!s&&d!==i)if("check"===i)this.checkedItemCount++,this.selectedUidMap.has(String(n))||(a.uniqueID&&this.selectedUidMap.set(String(a.uniqueID),!0),this.selectedItems.push(a),void 0!==l&&-1===this.selectedIndexes.indexOf(l)&&this.selectedIndexes.push(l));else if(("check"===d||"indeterminate"===d)&&(this.checkedItemCount>0&&this.checkedItemCount--,a&&a.uniqueID&&this.selectedUidMap.has(String(a.uniqueID)))){this.selectedUidMap.delete(String(a.uniqueID));var p=this.selectedItems.indexOf(a);if(-1!==p&&this.selectedItems.splice(p,1),void 0!==l){var h=this.selectedIndexes.indexOf(l);h>-1&&this.selectedIndexes.splice(h,1)}}var c=null,u=e.uid;if(u&&(c=this.parent.grid.getRowElementByUID(u)),!c){var g=void 0!==l?l:"number"==typeof this.visibleUidIndex[String(n)]?this.visibleUidIndex[String(n)]:-1;g>-1&&((c=this.parent.getRows()[parseInt(g.toString(),10)])||!this.parent.frozenRows&&!this.parent.getFrozenColumns()||(c=this.parent.getDataRows()[parseInt(g.toString(),10)]))}if(c){var f=c.querySelector(".e-hierarchycheckbox .e-frame");f&&(t.removeClass([f],["e-check","e-stop","e-uncheck"]),f.classList.add("indeterminate"===i?"e-stop":"e-"+i));var m=c.querySelector(".e-treecheckselect");m&&m.setAttribute("aria-checked","check"===i?"true":"uncheck"===i?"false":"mixed")}}},e.prototype.updateGridActions=function(e){var i=e.requestType;if(d(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===i||"paging"===i)this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),""),this.refreshVisibleCheckboxes(),this.updateHeaderCheckboxState();else if("delete"===i||"add"===e.action){var r=[];"delete"===i?r=e.data:r.push(e.data);for(var n=0;n<r.length;n++)"delete"===i&&this.updateSelectedItems(r[parseInt(n.toString(),10)],"uncheck",!1),t.isNullOrUndefined(r[parseInt(n.toString(),10)].parentItem)||this.updateParentSelection(r[parseInt(n.toString(),10)].parentItem);this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(!0),""),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState()}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":"filtering"!==i&&"searching"!==i&&"refresh"!==i||(this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),i),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState());else"filtering"!==i&&"searching"!==i&&"refresh"!==i&&"sorting"!==i&&"paging"!==i&&"expanding"!==i&&"expand"!==i&&"collapsing"!==i&&"collapse"!==i||a(this.parent)||(this.selectedItems=[],this.selectedUidMap=new Map,this.selectedIndexes=[],this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState())},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){this.buildVisibleUidMap();for(var e=[],t=0,i=this.selectedItems;t<i.length;t++){var r=i[t].uniqueID;void 0!==r&&void 0!==this.visibleUidIndex[r]&&e.push(this.visibleUidIndex[r])}return e},e}(),Q=function(){function e(e){this.parent=e,i.Grid.Inject(i.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on("printGrid-Init",this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off("printGrid-Init",this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var r=i.getObject("printgrid",e),n=i.getObject("element",e);r.addEventListener("queryCellInfo",this.parent.grid.queryCellInfo),r.addEventListener("rowDataBound",this.parent.grid.rowDataBound),r.addEventListener("beforeDataBound",this.parent.grid.beforeDataBound),t.addClass([n],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),K=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),W=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return K(i,e),W([t.Property()],i.prototype,"fields",void 0),W([t.Property(!1)],i.prototype,"ignoreCase",void 0),W([t.Property("contains")],i.prototype,"operator",void 0),W([t.Property()],i.prototype,"key",void 0),W([t.Property()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),J=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),X=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},$=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return J(i,e),X([t.Property("Row")],i.prototype,"mode",void 0),X([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),X([t.Property("Single")],i.prototype,"type",void 0),X([t.Property(!1)],i.prototype,"persistSelection",void 0),X([t.Property("Default")],i.prototype,"checkboxMode",void 0),X([t.Property(!1)],i.prototype,"checkboxOnly",void 0),X([t.Property(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Z=function(){function e(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}return e.prototype.RowModifier=function(e){if(e.data){var r=e.data,n=r.parentItem;if(!t.isNullOrUndefined(r.parentItem)&&!l(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||a(this.parent)&&!u(this.parent))&&(this.parent.initialRender&&(!(t.isNullOrUndefined(n[this.parent.expandStateMapping])||n[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!h(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!t.isNullOrUndefined(e.row)){this.parent.toggleRowVisibility(e.row,"e-childrow-hidden");var o=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||t.isNullOrUndefined(e.row.getAttribute("data-uid"))||(o.filter(function(t){return t.uid===e.row.getAttribute("data-uid")})[0].visible=!1)}if(a(this.parent)&&!u(this.parent)){var s=this.parent,d=this.parent.getCurrentViewRecords().filter(function(e){return t.getValue(s.idMapping,e)===t.getValue(s.parentIdMapping,r)});if(d.length>0&&!d[0].isSummaryRow&&!t.isNullOrUndefined(e.row)){var p=d[0].expanded?"e-childrow-visible":"e-childrow-hidden";this.parent.toggleRowVisibility(e.row,p)}}i.getObject("isSummaryRow",e.data)&&t.addClass([e.row],"e-summaryrow"),t.isNullOrUndefined(e.row)||(e.row.querySelector(".e-treegridexpand")?e.row.setAttribute("aria-expanded","true"):e.row.querySelector(".e-treegridcollapse")&&e.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&(t.isNullOrUndefined(r.parentItem)||this.parent.toggleRowVisibility(e.row,"e-childrow-hidden")));if(this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight){this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==e.data.uniqueID||t.isNullOrUndefined(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var c=this;c.parent.renderReactTemplates(function(){c.parent.trigger("rowDataBound",e)})}else this.parent.trigger("rowDataBound",e)}},e.prototype.cellRender=function(e){if(e.data){var r,n,o=this.parent.grid,s=e.data,d=t.isNullOrUndefined(s.filterLevel)?s.level:s.filterLevel,l=0,p=this.parent.getColumnByUid(e.column.uid),c=s.isSummaryRow,u=this.parent.getFrozenColumns();r=t.isNullOrUndefined(s.parentItem)?s.index:s.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):o.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!t.isNullOrUndefined(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var g=t.createElement("div",{className:"e-treecolumn-container"}),f=t.createElement("span",{className:"e-icons e-none"});f.style.width="10px",f.style.display="inline-block";for(var m=0;m<d;m++)l+=10,g.appendChild(f.cloneNode());var y=t.isNullOrUndefined(s.hasFilteredChildRecords)?s.hasChildRecords:s.hasFilteredChildRecords;if(y&&!t.isNullOrUndefined(s.childRecords)&&(y=this.parent.isFromGantt&&this.parent.loadChildOnDemand?s.hasChildRecords:!(0===s.childRecords.length)),y){t.addClass([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",s.expanded?"true":"false");var S=t.createElement("span",{className:"e-icons"}),v=void 0;if(this.parent.initialRender)v=s.expanded&&(t.isNullOrUndefined(s[this.parent.expandStateMapping])||s[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll;else if(v=!(!s.expanded||!h(this.parent,s,this.parent.grid.getCurrentViewRecords())),"Cell"===this.parent.editSettings.mode&&!a(this.parent)){var w=this.parent.flatData.find(function(e){return e.uniqueID===s.uniqueID});t.isNullOrUndefined(w)||(v=s.expanded!==w.expanded?w.expanded:s.expanded)}t.addClass([S],v?"e-treegridexpand":"e-treegridcollapse"),l+=18,g.appendChild(S),f.style.width="4px",l+=7,g.appendChild(f.cloneNode())}else(d||!d&&!s.level)&&(l+=20,g.appendChild(f.cloneNode()),g.appendChild(f.cloneNode()));n=t.createElement("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(n.style.width="Calc(100% - "+l+"px)"),t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level),this.updateTreeCell(e,n),g.appendChild(n),e.cell.appendChild(g)}if(o.getFrozenLeftColumnsCount()>0||o.getFrozenRightColumnsCount()>0){var I=o.getFrozenRightColumns(),R=o.getFrozenLeftColumns(),x=o.getMovableColumns();I.length>0&&I[0].field===e.column.field?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):R.length>0&&R[0].field===e.column.field?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):x.length>0&&x[0].field===e.column.field&&t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level)}else u>this.parent.treeColumnIndex&&u>0&&o.getColumnIndexByUid(e.column.uid)===u?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):u<this.parent.treeColumnIndex&&u>0&&(o.getColumnIndexByUid(e.column.uid)===u||o.getColumnIndexByUid(e.column.uid)===u-1)?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):u===this.parent.treeColumnIndex&&u>0&&o.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1&&t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level);if(!t.isNullOrUndefined(p)&&p.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var C=e.cell.querySelectorAll(".e-frame")[0];l+=parseInt(C.style.width,16),l+=10,(n=o.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+l+"px)"}if(c){t.addClass([e.cell],"e-summarycell");var b=i.getObject(e.column.field,e.data);b=t.isNullOrUndefined(b)?null:b,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=b:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=b}this.parent.args=e;var D=t.getValue("columnModel",this.parent)[this.parent.treeColumnIndex];if(t.isNullOrUndefined(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger("queryCellInfo",e);else if(this.parent.isReact&&D.field!==e.column.field){var M=this;M.parent.renderReactTemplates(function(){M.parent.trigger("queryCellInfo",e)})}}},e.prototype.updateTreeCell=function(e,r){var n=t.getValue("columnModel",this.parent)[this.parent.treeColumnIndex],o=e.column.index;t.isNullOrUndefined(n.field)&&e.cell.setAttribute("aria-colindex",o+1+""),n.field!==e.column.field||t.isNullOrUndefined(n.template)||(e.column.template=n.template,e.column.templateFn=i.templateCompiler(e.column.template),e.cell.classList.add("e-templatecell"));var a=null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML:e.cell.innerHTML;if("object"==typeof e.column.template&&this.templateResult)i.appendChildren(r,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var s=e.cell.children.length,d=this.parent.element.id+e.column.uid;if(n.field!==e.column.field||t.isNullOrUndefined(n.template))for(;0<s;s=e.cell.children.length)r.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{if(this.parent.isReact&&"string"!=typeof e.column.template){e.column.templateFn(e.data,this.parent,"columnTemplate",d,null,null,r),t.isNullOrUndefined(this.parent.grid.portals)&&(this.parent.grid.portals=this.parent.portals),this.parent.notify("renderReactTemplate",this.parent.portals);var l=this;l.parent.renderReactTemplates(function(){l.parent.trigger("queryCellInfo",e)})}else{var p=e.column.templateFn(i.extend({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);i.appendChildren(r,p)}delete e.column.template,delete e.column.templateFn,e.cell.innerHTML=""}}else r.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var r=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var n=r.parent.grid.getRowsObject(),o=r.parent.getDataRows(),a=r.parent.grid.getIndentCount(),s=r.parent.grid.getNormalizedColumnIndex(e);if(0!==o.length)for(var d=0;d<n.length;d++)if(n[parseInt(d.toString(),10)].isDataRow&&!t.isNullOrUndefined(n[parseInt(d.toString(),10)].index)){var l=n[parseInt(d.toString(),10)].cells[parseInt(s.toString(),10)],p=new i.CellRenderer(r.parent.grid,r.parent.grid.serviceLocator),h=o.length>=n.length?r.parent.getCellFromIndex(n[parseInt(d.toString(),10)].index,s-a):o[n[parseInt(d.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,l,n[parseInt(d.toString(),10)].data,{index:n[parseInt(d.toString(),10)].index});var c=r.parent.getRows()[parseInt(d.toString(),10)].cells[parseInt(s.toString(),10)];r.cellRender({data:n[parseInt(d.toString(),10)].data,cell:c,column:l.column})}})},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){this.parent.portals=e,this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),ee=function(){function e(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!t.isNullOrUndefined(this.parent.parentIdMapping)}return e.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on("remoteExpand",this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("remoteExpand",this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},e.prototype.destroy=function(){this.removeEventListener(),this.hierarchyData=null},e.prototype.isRemote=function(){return this.parent.dataSource instanceof n.DataManager},e.prototype.convertToFlatData=function(e){var i=this;if(this.parent.flatData=t.isNullOrUndefined(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof n.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],a(this.parent)&&!u(this.parent)&&e instanceof n.DataManager&&!(e instanceof Array)){var r=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=t.isNullOrUndefined(this.parent.query)?new n.Query:this.parent.query,this.parent.parentIdMapping){var o=this.parent.query.params.filter(function(e){return"IdMapping"===e.key});this.parent.initialRender&&!o.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var s=this.parent.query.clone();s.queries=[],(s=s.select([this.parent.parentIdMapping])).isCountRequired=!0,r.executeQuery(s).then(function(e){i.parentItems=n.DataUtil.distinct(e.result,i.parent.parentIdMapping,!1);0===(e.result?0:1)&&(t.setValue("grid.contentModule.isLoaded",!0,i.parent),t.isNullOrUndefined(i.zerothLevelData)||(t.setValue("cancel",!1,i.zerothLevelData),t.getValue("grid.renderModule",i.parent).dataManagerSuccess(i.zerothLevelData),i.zerothLevelData=null),i.parent.grid.hideSpinner())})}}}else e instanceof Array&&this.convertJSONData(e)},e.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var i=Object.keys(e),r=0;r<i.length;r++){var o=e[parseInt(r.toString(),10)];this.hierarchyData.push(t.extend({},o)),t.isNullOrUndefined(o[this.parent.idMapping])||this.taskIds.push(o[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var a=[],s=new n.DataManager(this.hierarchyData).executeLocal((new n.Query).group(this.parent.parentIdMapping)),r=0;r<s.length;r++){var d=s[parseInt(r.toString(),10)],l=this.taskIds.indexOf(d.key);if(!t.isNullOrUndefined(d.key)&&l>-1){var p=d.items;this.hierarchyData[parseInt(l.toString(),10)][this.parent.childMapping]=p}else a.push.apply(a,d.items)}this.hierarchyData=this.selfReferenceUpdate(a)}if(Object.keys(this.hierarchyData).length)this.createRecords(this.hierarchyData);else{var h=!(this.parent.dataSource instanceof n.DataManager)&&this.parent.isGantt;this.parent.flatData=h?this.parent.dataSource:[]}this.storedIndex=-1},e.prototype.selfReferenceUpdate=function(e){for(var t=[];this.hierarchyData.length>0&&e.length>0;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},e.prototype.updateParentRemoteData=function(e){var r=this;a(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e.actionArgs.requestType&&this.parent.hideSpinner();var n=e.result;if(a(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===e.actionArgs.requestType||"clearFilter"===e.actionArgs.action||""===e.actionArgs.searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var o=this,d=0;d<n.length;d++)!function(d){if(s(o.parent)&&n[parseInt(d.toString(),10)].hasChildRecords&&o.parent.initialRender&&(n[parseInt(d.toString(),10)].expanded=!1),a(o.parent)&&o.parent.enableVirtualization){var l=[],p=o.parent;n.filter(function(e){e[""+p.parentIdMapping]===n[parseInt(d.toString(),10)][""+p.idMapping]&&l.push(e)}),l.length?n[parseInt(d.toString(),10)].expanded=!0:n[parseInt(d.toString(),10)].hasChildRecords&&(n[parseInt(d.toString(),10)].expanded=!1)}if(t.isNullOrUndefined(n[parseInt(d.toString(),10)].index)){if(n[parseInt(d.toString(),10)].taskData=t.extend({},n[parseInt(d.toString(),10)]),n[parseInt(d.toString(),10)].uniqueID=i.getUid(o.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+n[parseInt(d.toString(),10)].uniqueID,n[parseInt(d.toString(),10)],o.parent),a(o.parent)&&o.parent.enableVirtualization&&n[parseInt(d.toString(),10)][""+o.parent.parentIdMapping]&&(t.isNullOrUndefined(n[parseInt(d.toString(),10)].level)||0===n[parseInt(d.toString(),10)].level)){var h=n[parseInt(d.toString(),10)][""+o.parent.parentIdMapping],c=n.find(function(e){return e[""+r.parent.idMapping]===h});if(c)n[parseInt(d.toString(),10)].level=c.level+1;else{var u=e.actual.flatData.find(function(e){return e[""+r.parent.idMapping]===h});t.isNullOrUndefined(u[""+o.parent.parentIdMapping])?n[parseInt(d.toString(),10)].level=1:n[parseInt(d.toString(),10)].level=u.level+1}}else n[parseInt(d.toString(),10)].level=0;n[parseInt(d.toString(),10)].index=Math.ceil(1e3*Math.random()),(n[parseInt(d.toString(),10)][o.parent.hasChildMapping]||-1!==o.parentItems.indexOf(n[parseInt(d.toString(),10)][o.parent.idMapping]))&&(n[parseInt(d.toString(),10)].hasChildRecords=!0),n[parseInt(d.toString(),10)].checkboxState="uncheck"}}(d);else{t.isNullOrUndefined(n)||!this.parent.loadChildOnDemand&&s(this.parent)&&!t.isNullOrUndefined(this.parent.dataResults.expandRecord)||a(this.parent)&&!this.parent.loadChildOnDemand&&e.actionArgs.isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(n)}else this.zerothLevelData=e,t.setValue("cancel",!0,e);if(a(this.parent)&&!this.parent.loadChildOnDemand&&e.actionArgs.isExpandCollapse&&this.parent.enableVirtualization?e.result=n:a(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?e.result=n:e.result=this.parent.loadChildOnDemand?n:this.parent.flatData,a(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var l=e.query.queries.filter(function(e){return"onAggregates"===e.fn});e.result=this.parent.summaryModule.calculateSummaryValue(l,this.parent.flatData,!0)}this.parent.notify("updateResults",e)},e.prototype.collectExpandingRecs=function(e,i){var r=this.parent.getRows();if(this.parent.rowTemplate){var n=this.parent.getContentTable().rows;r=[].slice.call(n)}var o;if(e.rows.length>0){i||(e.record.expanded=!0);for(var a=0;a<e.rows.length;a++){if(this.parent.toggleRowVisibility(e.rows[parseInt(a.toString(),10)],"e-childrow-visible"),!this.parent.loadChildOnDemand){var s=e.rows[parseInt(a.toString(),10)].getElementsByClassName("e-treegridcollapse")[0];o=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(a.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(a.toString(),10)].getAttribute("data-uid")).data,!t.isNullOrUndefined(s)&&o.expanded&&(t.addClass([s],"e-treegridexpand"),t.removeClass([s],"e-treegridcollapse"));var d=[];(d=r.filter(function(e){return e.querySelector(".e-gridrowindex"+o.index+"level"+(o.level+1))})).length&&o.expanded&&this.collectExpandingRecs({record:o,rows:d,parentRow:e.parentRow},!0)}var l=e.rows[parseInt(a.toString(),10)].querySelector(".e-detailrowcollapse");t.isNullOrUndefined(l)||this.parent.grid.detailRowModule.expand(l)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},e.prototype.fetchRemoteChildData=function(e){var r=this,a={row:e.parentRow,data:e.record},s=this.parent.dataSource,d=this.parent.grid.getDataModule().generateQuery(),l=d.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn});d.queries=l,d.isCountRequired=!0;var p=parseInt(e.record[this.parent.idMapping],10);if(isNaN(p)&&(p=e.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===e.action)d.take(this.parent.grid.pageSettings.pageSize),(h=[]).push("ExpandingAction",p.toString()),d.expand(h);else if(this.parent.enableVirtualization&&"collapse"===e.action){d.take(this.parent.grid.pageSettings.pageSize);var h=[];h.push("CollapsingAction",p.toString()),d.expand(h)}if(d.where(this.parent.parentIdMapping,"equal",e.record[this.parent.idMapping]),"remoteExpand"===e.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length){var c=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates});d.queries.push(c[0])}o.showSpinner(this.parent.element),s.executeQuery(d).then(function(s){var d,l=r.parent.grid.currentViewData.slice(),p=r.parent.idMapping;if(r.parent.isGantt&&r.parent.loadChildOnDemand&&r.parent.hasChildMapping){for(g=0;g<r.parent.grid.currentViewData.length;g++)if(e.record[p]===r.parent.grid.currentViewData[g][p]){d=g;break}}else d=l.indexOf(e.record);if(r.parent.enableVirtualization&&("collapse"===e.action||"remoteExpand"===e.action)){l=[];for(g=0;g<d;g++)l.push(r.parent.grid.currentViewData[parseInt(g.toString(),10)])}-1===d&&r.parent.grid.getRowsObject().forEach(function(t){t.data.uniqueID===e.record.uniqueID&&(d=t.index)});var h=i.getObject("actual.nextLevel",s),c=s.result,u=[];if("remoteExpand"===e.action&&r.parent.grid.filterModule&&r.parent.grid.filterModule.value){for(g=0;g<l.length;g++)Object.prototype.hasOwnProperty.call(l[parseInt(g.toString(),10)],r.parent.parentIdMapping)&&null!==l[parseInt(g.toString(),10)][""+r.parent.parentIdMapping]&&0===l[parseInt(g.toString(),10)].level&&(l.splice(g,1),g--);for(g=0;g<c.length;g++)e.record[""+r.parent.idMapping]!==c[parseInt(g.toString(),10)][""+r.parent.idMapping]&&e.record[""+r.parent.idMapping]===c[parseInt(g.toString(),10)][""+r.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(c,g)&&u.push(c[parseInt(g.toString(),10)]);c=u}if(r.parent.enableVirtualization&&"remoteExpand"===e.action){e.record.childRecords=[];for(var g=0;g<c.length;g++)e.record[""+r.parent.idMapping]!==c[parseInt(g.toString(),10)][""+r.parent.idMapping]&&e.record[""+r.parent.idMapping]===c[parseInt(g.toString(),10)][""+r.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(c,g)&&e.record.childRecords.push(c[parseInt(g.toString(),10)])}else e.record.childRecords=c;for(var f=0;f<c.length;f++)!function(n){var o=c[parseInt(n.toString(),10)];if(r.parent.enableVirtualization&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping]&&"remoteExpand"===e.action)r.parent.remoteExpandedData.push(e.record);else if(r.parent.enableVirtualization&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping]&&"collapse"===e.action)for(p=0;p<r.parent.remoteExpandedData.length;p++)e.record[""+r.parent.idMapping]===r.parent.remoteExpandedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&r.parent.remoteExpandedData.splice(p,1);if(o.taskData=t.extend({},o),o[""+r.parent.parentIdMapping]&&r.parent.enableVirtualization&&r.parent.remoteExpandedData.length)for(p=0;p<r.parent.remoteExpandedData.length;p++)o[""+r.parent.parentIdMapping]===r.parent.remoteExpandedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&(o.level=r.parent.remoteExpandedData[parseInt(p.toString(),10)].level+1,delete(a=r.parent.remoteExpandedData[parseInt(p.toString(),10)]).childRecords,o.parentItem=a,o.parentUniqueID=a.uniqueID);else if(r.parent.enableVirtualization)!o[""+r.parent.hasChildMapping]&&-1===r.parentItems.indexOf(o[""+r.parent.idMapping])||h&&!h[parseInt(n.toString(),10)]?(delete(a=t.extend({},e.record)).childRecords,o.parentItem=a,o.parentUniqueID=e.record.uniqueID):t.isNullOrUndefined(o[""+r.parent.parentIdMapping])?(o.level=0,"remoteExpand"===e.action&&(o.childRecords=[],o.childRecords=e.record.childRecords)):o.level=e.record.level;else{o.level=e.record.level+1;var a=t.extend({},e.record);delete a.childRecords,o.parentItem=a,o.parentUniqueID=e.record.uniqueID}if(o.index=Math.ceil(1e3*Math.random()),o.uniqueID=i.getUid(r.parent.element.id+"_data_"),e.record[""+r.parent.idMapping]===o[""+r.parent.idMapping]&&(e.record.uniqueID=o.uniqueID),o.checkboxState="uncheck",r.parent.enableVirtualization&&t.isNullOrUndefined(o.level))for(var s=0;s<r.parent.grid.currentViewData.length;s++)r.parent.grid.currentViewData[parseInt(s.toString(),10)][""+r.parent.idMapping]===o[""+r.parent.parentIdMapping]&&(o.level=r.parent.grid.currentViewData[parseInt(s.toString(),10)].level+1);if(t.setValue("uniqueIDCollection."+o.uniqueID,o,r.parent),(o[""+r.parent.hasChildMapping]||-1!==r.parentItems.indexOf(o[""+r.parent.idMapping]))&&(!h||h[parseInt(n.toString(),10)]))if(o.hasChildRecords=!0,r.parent.enableVirtualization&&!r.parent.loadChildOnDemand){for(p=0;p<r.parent.remoteCollapsedData.length;p++)o[""+r.parent.idMapping]===r.parent.remoteCollapsedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&(o.expanded=r.parent.remoteCollapsedData[parseInt(p.toString(),10)].expanded);if("collapse"===e.action&&o[""+r.parent.idMapping]!==e.record[""+r.parent.idMapping]&&!1!==o.expanded)o.expanded=!0;else if("collapse"===e.action&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping])o.expanded=!1,r.parent.remoteCollapsedData.push(e.record);else if("remoteExpand"===e.action){for(p=0;p<r.parent.grid.currentViewData.length;p++)r.parent.grid.currentViewData[parseInt(p.toString(),10)][""+r.parent.idMapping]===o[""+r.parent.idMapping]&&c.splice(n,1,r.parent.grid.currentViewData[parseInt(p.toString(),10)]);if(o[r.parent.idMapping]===e.record[""+r.parent.idMapping])for(var p=0;p<r.parent.remoteCollapsedData.length;p++)e.record[""+r.parent.idMapping]===r.parent.remoteCollapsedData[parseInt(p.toString(),10)][""+r.parent.idMapping]&&r.parent.remoteCollapsedData.splice(p,1);!1!==o.expanded&&(o.expanded=!0)}}else r.parent.enableVirtualization&&o[""+r.parent.idMapping]===e.record[""+r.parent.idMapping]&&"collapse"!==e.action?o.expanded=!0:r.parent.enableVirtualization&&!r.parent.loadChildOnDemand||(o.expanded=!1);l.some(function(e){return e[""+r.parent.idMapping]===o[r.parent.idMapping]})||l.splice(d+n+1,0,o)}(f);var m=r.parent.idMapping;if(r.parent.enableVirtualization&&r.parent.loadChildOnDemand&&l.sort(function(e,t){return e[""+m]-t[""+m]}),t.setValue("result",l,s),t.setValue("action","beforecontentrender",s),r.parent.trigger("actionComplete",s),o.hideSpinner(r.parent.element),r.parent.grid.aggregates.length>0&&!r.parent.enableVirtualization){var y=i.getObject("query",s);if(t.isNullOrUndefined(y)&&(y=t.getValue("grid.renderModule.data",r.parent).aggregateQuery(new n.Query)),!t.isNullOrUndefined(y)){var S=y.queries.filter(function(e){return"onAggregates"===e.fn});s.result=r.parent.summaryModule.calculateSummaryValue(S,s.result,!0)}}"remoteExpand"===e.action&&r.parent.allowPaging&&"All"===r.parent.pageSettings.pageSizeMode&&(r.parent.grid.pageSettings.totalRecordsCount=r.parent.grid.pageSettings.totalRecordsCount+c.length),r.parent.enableVirtualization&&(r.parent.grid.pageSettings.totalRecordsCount=s.count),s.count=r.parent.grid.pageSettings.totalRecordsCount;var v={};r.parent.enableVirtualization&&r.remoteVirtualAction(v);var w={index:d,childData:c};r.parent.enableInfiniteScrolling?r.parent.notify("infinite-remote-expand",w):t.getValue("grid.renderModule",r.parent).dataManagerSuccess(s,v),r.parent.trigger("expanded",a)})},e.prototype.remoteVirtualAction=function(e){e.requestType="refresh",t.setValue("isExpandCollapse",!0,e);var i=t.getValue("grid.contentModule",this.parent),r=t.getValue("currentInfo",i),n=t.getValue("prevInfo",i);r.loadNext&&this.parent.grid.pageSettings.currentPage===r.nextInfo.page&&!this.parent.loadChildOnDemand&&(this.parent.grid.pageSettings.currentPage=n.page)},e.prototype.beginSorting=function(){if(this.isSortAction=!0,a(this.parent)&&this.parent.enableVirtualization){var e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]);-1!==e&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length&&this.parent.query.sortBy(null,null)}},e.prototype.createRecords=function(e,r){for(var n=[],o=0,d=Object.keys(e).length;o<d;o++){var l=t.extend({},e[parseInt(o.toString(),10)]);l.taskData=e[parseInt(o.toString(),10)];var p=0;this.storedIndex++,Object.prototype.hasOwnProperty.call(l,"index")||(l.index=this.storedIndex);var h=l[this.parent.childMapping],c=!t.isNullOrUndefined(h)&&h.length>0,u=s(this.parent),g=l[this.parent.hasChildMapping];if(l.hasChildRecords=!!(c&&!u||g&&u),(!t.isNullOrUndefined(h)&&!u||g&&u)&&(this.parent.enableCollapseAll||!t.isNullOrUndefined(this.parent.dataStateChange)&&t.isNullOrUndefined(h)?l.expanded=!1:l.expanded=!!t.isNullOrUndefined(l[this.parent.expandStateMapping])||l[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(l,"index")||(l.index=(l.hasChildRecords,this.storedIndex)),this.isSelfReference&&t.isNullOrUndefined(l[this.parent.parentIdMapping])&&this.parent.parentData.push(l),l.uniqueID=i.getUid(this.parent.element.id+"_data_"),this.parent.uniqueIDCollection[l.uniqueID]=l,!t.isNullOrUndefined(r)){var f=t.extend({},r);delete f.childRecords,delete f[this.parent.childMapping],this.isSelfReference&&delete f.taskData[this.parent.childMapping],l.parentItem=f,l.parentUniqueID=f.uniqueID,p=r.level+1}Object.prototype.hasOwnProperty.call(l,"level")||(l.level=p),l.checkboxState="uncheck";if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&a(this.parent)&&!this.parent.initialRender){if(!l.hasChildRecords&&t.isNullOrUndefined(l[""+this.parent.parentIdMapping])){l.hasChildRecords=!0;for(var m=0;m<this.parent.remoteCollapsedData.length;m++)this.parent.remoteCollapsedData[parseInt(m.toString(),10)][""+this.parent.idMapping]===l[""+this.parent.idMapping]&&(l.expanded=!1)}else 0===l.level&&t.isNullOrUndefined(r)&&!l.hasChildRecords&&(l.level=l.level+1);l[""+this.parent.hasChildMapping]&&!t.isNullOrUndefined(l[""+this.parent.expandStateMapping])&&(l.expanded=l[""+this.parent.expandStateMapping],l.hasChildRecords=!0),this.parent.flatData.push(l)}else(t.isNullOrUndefined(l[""+this.parent.parentIdMapping])||l.parentItem)&&(t.isNullOrUndefined(this.parent.rowDropSettings.targetID)?this.parent.flatData.push(l):this.parent.rowDragAndDropModule.isDuplicateData(l)||this.parent.flatData.push(l),this.parent.infiniteScrollData.push(l));if(this.isSelfReference||0!==l.level||this.parent.parentData.push(l),!t.isNullOrUndefined(l[this.parent.childMapping]&&l[this.parent.childMapping].length)){var y=this.createRecords(l[this.parent.childMapping],l);l.childRecords=y}n.push(l)}return n},e.prototype.dataProcessor=function(e){var r,o=i.getObject("isExport",e),a=i.getObject("expresults",e),d=i.getObject("exportType",e),l=i.getObject("isPrinting",e),p=i.getObject("actionArgs",e),h=i.getObject("requestType",e),c=i.getObject("data",e),g=i.getObject("action",e),f=p,m=this.parent.getPrimaryKeyFieldNames()[0],y=i.getObject("data",f);t.isNullOrUndefined(f)||t.isNullOrUndefined(f.action)||"add"!==f.action||t.isNullOrUndefined(f.data)||!t.isNullOrUndefined(f.data[""+m])||(f.data[""+m]=e.result[f.index][""+m],y.taskData[""+m]=e.result[f.index][""+m]),(!t.isNullOrUndefined(p)&&Object.keys(p).length||"save"===h)&&(h=h||p.requestType,c=c||i.getObject("data",p),g=g||i.getObject("action",p),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData&&this.updateAction(c,g,h));var S,v,w=(r=o&&!t.isNullOrUndefined(a)?a:s(this.parent)?t.getValue("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof n.DataManager?r.dataSource.json:r,I=s(this.parent)?t.getValue("count",this.parent.dataSource):w.length,R=new n.Query,x=i.getObject("query",e);if(t.isNullOrUndefined(x)||(S=x.queries.filter(function(e){return"onWhere"===e.fn}),v=x.queries.filter(function(e){return"onSearch"===e.fn})),this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||this.parent.grid.searchSettings.key.length>0||!t.isNullOrUndefined(x)&&(S.length||v.length)&&this.parent.isLocalData){t.isNullOrUndefined(x)&&(x=new n.Query,x=t.getValue("grid.renderModule.data",this.parent).filterQuery(x),x=t.getValue("grid.renderModule.data",this.parent).searchQuery(x));var C=x.queries.filter(function(e){return"onWhere"===e.fn}),b=x.queries.filter(function(e){return"onSearch"===e.fn});R.queries=C.concat(b);var D=new n.DataManager(w).executeLocal(R);if(this.parent.notify("updateFilterRecs",{data:D}),w=this.dataResults.result,this.dataResults.result=null,this.parent.grid.aggregates.length>0){P=i.getObject("query",e);if(t.isNullOrUndefined(x)&&(x=t.getValue("grid.renderModule.data",this.parent).aggregateQuery(new n.Query)),!t.isNullOrUndefined(P)){V=P.queries.filter(function(e){return"onAggregates"===e.fn});w=this.parent.summaryModule.calculateSummaryValue(V,w,!0)}}}if(this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var M=i.getObject("query",e);t.isNullOrUndefined(M)&&(M=t.getValue("grid.renderModule.data",this.parent).aggregateQuery(new n.Query));V=M.queries.filter(function(e){return"onAggregates"===e.fn});w=this.parent.summaryModule.calculateSummaryValue(V,this.parent.flatData,!0)}if(this.parent.grid.sortSettings.columns.length>0||this.isSortAction){this.isSortAction=!1;for(var O=this.parent.parentData,P=i.getObject("query",e),A=new n.Query,E=this.parent.grid.sortSettings.columns.length-1;E>=0;E--){var N=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(E.toString(),10)].field),U=N.sortComparer&&u(this.parent)?N.sortComparer.bind(N):this.parent.grid.sortSettings.columns[parseInt(E.toString(),10)].direction;A.sortBy(this.parent.grid.sortSettings.columns[parseInt(E.toString(),10)].field,U)}var k=new n.DataManager(O).executeLocal(A);if(this.parent.allowRowDragAndDrop&&!t.isNullOrUndefined(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var q=k.indexOf(this.parent.rowDragAndDropModule.draggedRecord);k.splice(q,1);var B=k.indexOf(this.parent.rowDragAndDropModule.droppedRecord);this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?k.splice(B,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&k.splice(B+1,0,this.parent.rowDragAndDropModule.draggedRecord)}var T={modifiedData:k,filteredData:w,srtQry:A};if(this.parent.notify("createSort",T),w=T.modifiedData,this.dataResults.result=null,this.sortedData=w,this.parent.notify("updateModel",{}),this.parent.grid.aggregates.length>0&&!t.isNullOrUndefined(P)){var V=i.getObject("query",e).queries.filter(function(e){return"onAggregates"===e.fn});w=this.parent.summaryModule.calculateSummaryValue(V,this.sortedData,!1)}}I=s(this.parent)?t.getValue("count",this.parent.dataSource):w.length;var z=this.paging(w,I,o,l,d,e);w=z.result,I=z.count,e.result=w,e.count=I,this.parent.notify("updateResults",e)},e.prototype.paging=function(e,i,r,n,o,a){if(!this.parent.allowPaging||r&&"CurrentPage"!==o||n&&"CurrentPage"!==this.parent.printMode){if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(!r||"CurrentPage"===o)&&"save"!==t.getValue("requestType",a)){var d=this.parent.enableInfiniteScrolling?a:t.getValue("actionArgs",a);this.parent.notify("pagingActions",{result:e,count:i,actionArgs:d}),e=this.dataResults.result,i=this.dataResults.count}}else this.parent.notify("pagingActions",{result:e,count:i,actionArgs:a}),e=this.dataResults.result,i=s(this.parent)?t.getValue("count",this.parent.dataSource):this.dataResults.count;if((!0===n||a.isPdfExport&&(t.isNullOrUndefined(a.isCollapsedStatePersist)||a.isCollapsedStatePersist))&&"AllPages"===this.parent.printMode){for(var l=[],p=0;p<e.length;p++)h(this.parent,e[parseInt(p.toString(),10)],this.parent.parentData)&&l.push(e[parseInt(p.toString(),10)]);i=(e=l).length}return{result:e,count:i}},e.prototype.updateData=function(e){this.dataResults=e},e.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify("crudAction",{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchSave",{})},e}();!function(e){e[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Search=5]="Search",e[e.ExpandAll=6]="ExpandAll",e[e.CollapseAll=7]="CollapseAll",e[e.ExcelExport=8]="ExcelExport",e[e.PdfExport=9]="PdfExport",e[e.CsvExport=10]="CsvExport",e[e.Print=11]="Print",e[e.RowIndent=12]="RowIndent",e[e.RowOutdent=13]="RowOutdent"}(e.ToolbarItem||(e.ToolbarItem={})),function(e){e[e.AutoFit=0]="AutoFit",e[e.AutoFitAll=1]="AutoFitAll",e[e.SortAscending=2]="SortAscending",e[e.SortDescending=3]="SortDescending",e[e.Edit=4]="Edit",e[e.Delete=5]="Delete",e[e.Save=6]="Save",e[e.Cancel=7]="Cancel",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.FirstPage=11]="FirstPage",e[e.PrevPage=12]="PrevPage",e[e.LastPage=13]="LastPage",e[e.NextPage=14]="NextPage",e[e.AddRow=15]="AddRow",e[e.RowIndent=16]="RowIndent",e[e.RowOutdent=17]="RowOutdent"}(e.ContextMenuItems||(e.ContextMenuItems={}));var te=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ie=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return te(i,e),ie([t.Property(12)],i.prototype,"pageSize",void 0),ie([t.Property(8)],i.prototype,"pageCount",void 0),ie([t.Property(1)],i.prototype,"currentPage",void 0),ie([t.Property()],i.prototype,"totalRecordsCount",void 0),ie([t.Property(!1)],i.prototype,"enableQueryString",void 0),ie([t.Property(!1)],i.prototype,"pageSizes",void 0),ie([t.Property(null)],i.prototype,"template",void 0),ie([t.Property("All")],i.prototype,"pageSizeMode",void 0),i}(t.ChildProperty),ne=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oe=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ae=function(e){function r(){var i=null!==e&&e.apply(this,arguments)||this;return i.intl=new t.Internationalization,i.templateFn={},i}return ne(r,e),r.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},r.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},r.prototype.getFormatter=function(){return this.formatFn},r.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[t.getEnumValue(i.CellType,i.CellType.Summary)]={fn:t.compile(this.footerTemplate,e),property:"footerTemplate"})},r.prototype.getTemplate=function(e){return this.templateFn[t.getEnumValue(i.CellType,e)]},r.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},oe([t.Property()],r.prototype,"type",void 0),oe([t.Property()],r.prototype,"footerTemplate",void 0),oe([t.Property()],r.prototype,"field",void 0),oe([t.Property()],r.prototype,"format",void 0),oe([t.Property()],r.prototype,"columnName",void 0),oe([t.Property()],r.prototype,"customAggregate",void 0),r}(t.ChildProperty),se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ne(i,e),oe([t.Collection([],ae)],i.prototype,"columns",void 0),oe([t.Property(!0)],i.prototype,"showChildSummary",void 0),i}(t.ChildProperty),de=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),le=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return de(i,e),le([t.Property(!1)],i.prototype,"allowAdding",void 0),le([t.Property(!1)],i.prototype,"allowEditing",void 0),le([t.Property(!1)],i.prototype,"allowDeleting",void 0),le([t.Property("Cell")],i.prototype,"mode",void 0),le([t.Property("Top")],i.prototype,"newRowPosition",void 0),le([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),le([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),le([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),le([t.Property("")],i.prototype,"template",void 0),le([t.Property({})],i.prototype,"dialog",void 0),le([t.Property(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),he=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ce=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),ce([t.Property()],i.prototype,"field",void 0),ce([t.Property()],i.prototype,"direction",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return he(i,e),ce([t.Collection([],ue)],i.prototype,"columns",void 0),ce([t.Property(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty),fe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),me=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fe(i,e),me([t.Property(!1)],i.prototype,"enableCache",void 0),me([t.Property(3)],i.prototype,"maxBlocks",void 0),me([t.Property(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Se=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ve=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},we=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Se(i,e),ve([t.Property("startsWith")],i.prototype,"operator",void 0),ve([t.Property(!1)],i.prototype,"ignoreAccent",void 0),ve([t.Property(null)],i.prototype,"headerTemplate",void 0),ve([t.Property(null)],i.prototype,"template",void 0),ve([t.Property(null)],i.prototype,"footerTemplate",void 0),ve([t.Property(!0)],i.prototype,"enableSearching",void 0),ve([t.Property(null)],i.prototype,"renderCustomColumnChooser",void 0),i}(t.ChildProperty),Ie=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Re=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},xe=function(r){function d(e,n){var o=r.call(this,e,n)||this;o.dataResults={},o.uniqueIDCollection={},o.uniqueIDFilterCollection={},o.changedRecords="changedRecords",o.deletedRecords="deletedRecords",o.addedRecords="addedRecords",o.indentOutdentAction="indentOutdentAction",o.isFromChartSide=!1,o.modifiedRecords=[],o.stackedHeader=!1,o.freezeColumnRefresh=!0,o.componentRefresh=t.Component.prototype.refresh,o.isComponentRefresh=!1,o.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),r=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],o=0;o<i.length;o++)if(!(e[i[parseInt(o.toString(),10)]]===t[i[parseInt(o.toString(),10)]]||-1!==n.indexOf(i[parseInt(o.toString(),10)])||e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date&&e[i[parseInt(o.toString(),10)]].getTime()===t[i[parseInt(o.toString(),10)]].getTime())){r=!1;break}return r}return!1},l.Inject(G,F),t.setValue("mergePersistData",o.mergePersistTreeGridData,o);t.isNullOrUndefined(o.injectedModules.Logger)||i.Grid.Inject(i.Logger);o.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&i.Grid.Inject(i.Freeze)});return o.grid=new i.Grid,o}Ie(d,r),l=d,d.prototype.excelExport=function(e,t,i,r){return this.allowExcelExport?this.excelExportModule.Map(e,t,i,r,!1):null},d.prototype.csvExport=function(e,t,i,r){return this.allowExcelExport?this.excelExportModule.Map(e,t,i,r,!0):null},d.prototype.pdfExport=function(e,t,i,r){return this.allowPdfExport?this.pdfExportModule.Map(e,t,i,r):null},d.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},d.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},d.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},d.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),i=(new n.UrlAdaptor).processQuery(new n.DataManager({url:""}),t),r=JSON.parse(i.data),o=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"])),a=["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"];o.filterSettings.columns=r.where,o.searchSettings.fields=r.search&&r.search[0].fields||[],o.sortSettings.columns=r.sorted,o.columns=this.setHeaderText(o.columns,a);var s=this.createElement("form",{id:"ExportForm"});s.style.display="none";var d=this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}});d.value=JSON.stringify(o),s.method="POST",s.action=e,s.appendChild(d),document.body.appendChild(s),s.submit(),s.remove()},d.prototype.setHeaderText=function(e,r){for(var n=0;n<e.length;n++){var o=this.getColumnByUid(e[parseInt(n.toString(),10)].uid);this.stackedHeader&&t.isNullOrUndefined(o)&&(o=t.isNullOrUndefined(e[parseInt(n.toString(),10)].field)?e[parseInt(n.toString(),10)]:this.getColumnByField(e[parseInt(n.toString(),10)].field)),e[parseInt(n.toString(),10)].headerText=o.headerText,t.isNullOrUndefined(o.template)||(e[parseInt(n.toString(),10)].template="true"),e[parseInt(n.toString(),10)].format&&(e[parseInt(n.toString(),10)].format=i.getNumberFormat(this.getFormat(o.format),o.type,!1,this.currencyCode),this.isExcel||"datetime"!==o.type&&"date"!==o.type||(e[parseInt(n.toString(),10)].format=e[parseInt(n.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(n.toString(),10)].type=o.type),e[parseInt(n.toString(),10)].columns&&this.setHeaderText(e[parseInt(n.toString(),10)].columns,r);for(var a=Object.keys(e[parseInt(n.toString(),10)]),s=0;s<a.length;s++)r.indexOf(a[parseInt(s.toString(),10)])<0&&delete e[parseInt(n.toString(),10)][a[parseInt(s.toString(),10)]]}return e},d.prototype.getFormat=function(e){return"object"==typeof e?t.isNullOrUndefined(e.format)?e.skeleton:e.format:e},d.prototype.getModuleName=function(){return"treegrid"},d.prototype.refreshLayout=function(){this.componentRefresh()},d.prototype.setProperties=function(e,t){r.prototype.setProperties.call(this,e,t)},d.prototype.preRender=function(){this.isComponentRefresh&&(this.grid=new i.Grid),this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&t.isNullOrUndefined(this.childMapping)&&(this.childMapping="Children")},d.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},d.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},d.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},d.prototype.search=function(e){this.grid.search(e)},d.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},d.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},d.prototype.TreeGridLocale=function(){if(!t.isNullOrUndefined(this.locale)){var e=t.L10n.locale,r={};t.setValue(this.locale,{},r);var n=void 0;n={},n=i.getObject(this.locale,e);var o=void 0;o={},o=i.getObject(this.getModuleName(),n),t.setValue("grid",o,i.getObject(this.locale,r)),t.L10n.load(r)}},d.prototype.print=function(){this.printModule.print()},d.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var r=void 0,n=void 0,o=void 0,a=void 0,s=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":o=(r=e.target).closest(".e-rowcell"),t.isNullOrUndefined(o)||(a=o.closest("tr"),t.isNullOrUndefined(a)||t.isNullOrUndefined(a.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridexpand")));break;case"ctrlShiftDownArrow":o=(r=e.target).closest(".e-rowcell"),t.isNullOrUndefined(o)||(a=o.closest("tr"),t.isNullOrUndefined(a)||t.isNullOrUndefined(a.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridcollapse")));break;case"downArrow":if(!this.enableVirtualization&&t.isNullOrUndefined(this.rowTemplate)&&(r=e.target,t.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=i.parentsUntil(r,"e-rowcell")),!t.isNullOrUndefined(r)&&(n=r.parentElement,!t.isNullOrUndefined(n))))if((h=n.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(h).editType&&t.isNullOrUndefined(this.grid.getColumnByIndex(h).edit.obj)&&(n=r),null!==(s=this.findnextRowElement(n))){var d=r.cellIndex,l=s.children[parseInt(d.toString(),10)];t.isNullOrUndefined(l)||this.grid.isEdit||((g=this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus")).forEach(function(e){t.removeClass([e],["e-focused","e-focus"])}),t.addClass([l],["e-focused","e-focus"]))}else{var p=this.grid.getContent().querySelector(".e-table tbody");n&&p&&n!==p.lastElementChild&&this.clearSelection()}break;case"upArrow":if(!this.enableVirtualization&&t.isNullOrUndefined(this.rowTemplate)&&(r=e.target,t.isNullOrUndefined(r.querySelectorAll(".e-rowcell"))||(r=i.parentsUntil(r,"e-rowcell")),!t.isNullOrUndefined(r)&&(n=r.parentElement,!t.isNullOrUndefined(n)))){var h=n.cellIndex;if(h&&"dropdownedit"===this.grid.getColumnByIndex(h).editType&&t.isNullOrUndefined(this.grid.getColumnByIndex(h).edit.obj)&&(n=r),null!==(s=this.findPreviousRowElement(n))){var c=r.cellIndex;if(!t.isNullOrUndefined(c)){var u=s.children[parseInt(c.toString(),10)];if(!t.isNullOrUndefined(u)&&!this.grid.isEdit){var g=this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus");g.forEach(function(e){t.removeClass([e],["e-focused","e-focus"])}),t.addClass([u],["e-focused","e-focus"])}}}else this.clearSelection()}}}},d.prototype.findnextRowElement=function(e){var t=e.nextElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findnextRowElement(t)),t},d.prototype.findPreviousRowElement=function(e){var t=e.previousElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findPreviousRowElement(t)),t},d.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.freezeColumnRefresh=!0,this.componentRefresh=t.Component.prototype.refresh,this.isComponentRefresh=!1,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof n.DataManager)||this.dataSource.dataSource.offline||!t.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof n.RemoteSaveAdaptor,this.isSelfReference=!t.isNullOrUndefined(this.parentIdMapping)},d.prototype.wireEvents=function(){t.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},d.prototype.requiredModules=function(){var e=[];if(this.mergedColumns&&(this.grid.mergedColumns=this.mergedColumns),t.isNullOrUndefined(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed)return e;e.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),t.isNullOrUndefined(this.toolbar)||e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&e.push({member:"sort",args:[this],name:"Sort"}),this.aggregates.length>0&&e.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this],name:"ExcelExport"});var i=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),r=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||r)&&i.length>0&&e.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&e.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(e),e},d.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},d.prototype.extendRequiredModules=function(e){var i=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||i.length)&&(t.isNullOrUndefined(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!t.isNullOrUndefined(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},d.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},d.prototype.unwireEvents=function(){this.grid&&this.grid.element&&t.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard&&this.element.removeAttribute("tabIndex"))},d.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},d.prototype.render=function(){var e=this;this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),o.createSpinner({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new Z(this),this.dataModule=new ee(this),this.printModule=new Q(this),this.trigger("load"),this.autoGenerateColumns(),this.initialRender=!0,t.isNullOrUndefined(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener();var i=t.createElement("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"});t.addClass([this.element],"e-treegrid"),t.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),t.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(i);var r=this.grid.requiredModules;this.grid.requiredModules=function(){var e=[];e=r.apply(this);for(var t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e};this.grid.root=this.root?this.root:this,this.grid.appendTo(i),this.actionFailureHandler(),this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var n=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table");t.isNullOrUndefined(n)||n.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.updateColumnModel(),this.wireEvents(),this.renderComplete();var a=this.grid.destroyTemplate;this.grid.destroyTemplate=function(i,r,n){a.apply(e.grid);e.isReact&&t.isNullOrUndefined(e.portals)?t.isNullOrUndefined(n)||n():e.clearTemplate(i,r,n)}},d.prototype.actionFailureHandler=function(){var e=this,i=[],r=this.getPrimaryKeyFieldNames(),n=this.flatData.length;(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===r.length&&0!==n&&i.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===r.length&&0!==n&&i.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&i.push("Paging is not allowed in virtualization case."),0===n&&0===this.columns.length&&i.push("Either of the Data source or columns should be given."),this.frozenColumns>0&&this.columnModel.filter(function(e){return e.isFrozen})&&i.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!t.isNullOrUndefined(this.detailTemplate)&&i.push("Virtual scrolling is not compatible with the detail template"),!(this.frozenColumns>0||this.frozenRows>0||this.columnModel.filter(function(e){return e.isFrozen}))||t.isNullOrUndefined(this.detailTemplate)&&t.isNullOrUndefined(this.rowTemplate)||i.push("Frozen rows and columns are not supported with the Detail template and row template."),(this.frozenColumns>0||this.columnModel.filter(function(e){return e.isFrozen}).length>0||this.frozenRows>0)&&"Cell"===this.editSettings.mode&&i.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!t.isNullOrUndefined(this.rowTemplate)&&i.push("Selection is not supported in RowTemplate"),this.allowExcelExport||"csvExport"!==this.action||i.push("CSV export is not allowed when allowExcelExport is disabled."),this.allowPdfExport||"pdfExport"!==this.action||i.push("PDF export is not allowed when allowPdfExport is disabled"),this.allowExcelExport||"excelExport"!==this.action||i.push("Excel export is not allowed when allowExcelExport is disabled."),this.treeColumnIndex>=this.columns.length&&i.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&i.push("column width and height should be in pixels"),"Children"===this.childMapping||t.isNullOrUndefined(this.idMapping)||i.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!t.isNullOrUndefined(this.idMapping)&&t.isNullOrUndefined(this.parentIdMapping)||t.isNullOrUndefined(this.idMapping)&&!t.isNullOrUndefined(this.parentIdMapping))&&i.push("IdMapping and ParentIdMapping properties should be defined and vice versa.");var o=this.columnModel.filter(function(e){return e.showCheckbox}),a=this.columns[this.treeColumnIndex];0!==o.length&&(o!==a&&i.push("ShowCheckbox column should not be defined other than the tree column."),o.length>1&&i.push("Only one column can have the ShowCheckbox option enabled."));if(null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&this.treeColumnIndex<this.columns.length&&0!==this.columnModel.filter(function(t){return"Right"===t.textAlign&&t.field===e.columnModel[e.treeColumnIndex].field}).length&&i.push("TextAlign right for the tree column is not applicable."),i.length>0){var s={error:{}};i.forEach(function(e,t){s.error[parseInt(t.toString(),10)]=e}),this.trigger("actionFailure",s)}},d.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",r=e.querySelector("#"+t).parentElement,n=e.querySelector("#"+i).parentElement;r.classList.add("e-hidden"),n.classList.add("e-hidden")},d.prototype.afterGridRender=function(){t.isNullOrUndefined(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new H(this,this.grid.serviceLocator)},d.prototype.convertTreeData=function(e){if(s(this)&&(e=t.getValue("result",e)),e instanceof Array&&e.length>0&&Object.prototype.hasOwnProperty.call(e[0],"level")){this.flatData=e;for(var i=this,r=0,n=this.flatData.length;r<n;r++)!function(e,r){var n=i.flatData[parseInt(e.toString(),10)];t.setValue("uniqueIDCollection."+n.uniqueID,n,i),0!==n.level||i.parentData.some(function(e){return e.uniqueID===n.uniqueID})||i.parentData.push(n)}(r)}else if(s(this)){var o=t.getValue("result",this.dataSource);this.dataModule.convertToFlatData(o)}else this.dataModule.convertToFlatData(e)},d.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=i.getActualProperties(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowMultiSorting=this.allowMultiSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=i.getActualProperties(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=i.getActualProperties(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.columnChooserSettings=this.columnChooserSettings,this.grid.filterSettings=i.getActualProperties(this.filterSettings),this.grid.selectionSettings=i.getActualProperties(this.selectionSettings),this.grid.sortSettings=i.getActualProperties(this.sortSettings),this.grid.searchSettings=i.getActualProperties(this.searchSettings),this.grid.aggregates=i.getActualProperties(this.aggregates),this.grid.textWrapSettings=i.getActualProperties(this.textWrapSettings),this.grid.printMode=i.getActualProperties(this.printMode),this.grid.locale=i.getActualProperties(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=i.getActualProperties(this.getContextMenu()),this.grid.columnMenuItems=i.getActualProperties(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=i.getActualProperties(this.rowTemplate),this.grid.detailTemplate=i.getActualProperties(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=i.getActualProperties(this.clipMode),this.grid.enableColumnSpan=this.enableColumnSpan,this.grid.enableRowSpan=this.enableRowSpan;this.grid.templateDotnetInstance=this.templateDotnetInstance;this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer,this.grid.enableStickyHeader=this.enableStickyHeader,this.grid.emptyRecordTemplate=this.emptyRecordTemplate,this.grid.isRowSelectable=this.isRowSelectable;this.grid.isTreeGrid=!0},d.prototype.triggerEvents=function(e){this.trigger(i.getObject("name",e),e)},d.prototype.IsExpandCollapseClicked=function(e){if(!this.isFromChartSide&&!t.isNullOrUndefined(e.target)&&(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))&&!this.selectionSettings.checkboxOnly&&(!t.isNullOrUndefined(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&t.isNullOrUndefined(e.data)))return void(e.cancel=!0)},d.prototype.bindGridEvents=function(){var e=this;this.grid.rowSelecting=function(i){e.IsExpandCollapseClicked(i),!t.isNullOrUndefined(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(e)&&(t.isNullOrUndefined(i.data.parentItem)&&!i.isHeaderCheckboxClicked||(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0))),"Root"===e.pageSettings.pageSizeMode&&(e.grid.selectionModule.totalRecordsCount=e.grid.currentViewData.length),i.cancel||e.trigger("rowSelecting",i)},this.grid.rowDeselecting=function(i){e.IsExpandCollapseClicked(i),!t.isNullOrUndefined(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(e)&&(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0)),e.trigger("rowDeselecting",i)},this.grid.rowSelected=function(t){e.enableVirtualization&&e.virtualScrollModule.updateSelection(t),e.selectedRowIndex=e.grid.selectedRowIndex,e.notify("rowSelected",t),e.trigger("rowSelected",t)},this.grid.rowDeselected=function(i){e.selectedRowIndex=e.grid.selectedRowIndex,t.isNullOrUndefined(i.data)||e.notify("rowDeselected",i),e.trigger("rowDeselected",i)},this.grid.resizeStop=function(t){e.updateColumnModel(),e.trigger("resizeStop",t)},this.grid.excelQueryCellInfo=function(t){e.notify("excelCellInfo",t),t=e.dataResults},this.grid.excelAggregateQueryCellInfo=function(t){e.notify("excelAggregateCellInfo",t),t=e.dataResults},this.grid.pdfAggregateQueryCellInfo=function(t){e.notify("pdfAggregateCellInfo",t),t=e.dataResults},this.grid.pdfQueryCellInfo=function(t){e.notify("pdfCellInfo",t),t=e.dataResults},this.grid.checkBoxChange=function(t){e.trigger("checkboxChange",t)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(t){for(var i=e.getRows();i[t.rowIndex].classList.contains("e-summaryrow");)t.rowIndex++;e.trigger("beforePaste",t)},this.grid.load=function(){if(e.grid.on("initial-end",e.afterGridRender,e),!t.isNullOrUndefined(e.loggerModule)){e.loggerModule=e.grid.loggerModule=new F(e.grid)}},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(t){e.trigger("actionFailure",t)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},d.prototype.lastRowBorder=function(e,i){for(var r=0;r<e.cells.length;r++)i?t.addClass([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell"):t.removeClass([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell")},d.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},d.prototype.extendedGridDataBoundEvent=function(){var e=this;this.grid.dataBound=function(i){if(e.lastRowBorderEventListener(),e.updateRowTemplate(),e.updateColumnModel(),e.updateAltRow(e.getRows()),e.notify("dataBoundArg",i),a(e)&&!u(e)&&!e.hasChildMapping){var r=void 0;r=e.dataResults.result?0:1,t.setValue("grid.contentModule.isLoaded",!(r>0),e)}if(e.isPixelHeight()&&e.initialRender)for(var n=e.getContentTable().rows,o=[].slice.call(n),s=o.length-1;s>0;s--)if(!y(o[parseInt(s.toString(),10)])){o[parseInt(s.toString(),10)].nextElementSibling&&e.lastRowBorder(o[parseInt(s.toString(),10)],!0);break}if(e.enableVirtualization&&e.selectionSettings.persistSelection&&("expand"===e.dataResults.action||"collapse"===e.dataResults.action)){if(e.grid.selectionModule.refreshPersistSelection(),"Single"===e.grid.selectionSettings.type){var d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.grid.selectionModule.data);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}}if(e.enableVirtualization&&e.selectionSettings.persistSelection&&!t.isNullOrUndefined(e.virtualScrollModule.prevSelectedRecord))for(s=0;s<e.virtualScrollModule.prevSelectedRecord.length;s++){var d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.virtualScrollModule.prevSelectedRecord[parseInt(s.toString(),10)]);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}e.trigger("dataBound",i),e.initialRender=!1};var r=this;this.grid.beforeDataBound=function(e){var o=i.getObject("action",e);if((a(r)&&!u(r)||s(this))&&"edit"!==o)r.notify("updateRemoteLevel",e),e=r.dataResults;else if(0===r.flatData.length&&u(r)&&r.dataSource instanceof n.DataManager){var d=r.dataSource;r.dataModule.convertToFlatData(d.dataSource.json),e.result=r.grid.dataSource.dataSource.json=r.flatData}if(a(r)||s(this)||t.isNullOrUndefined(r.dataSource)||(this.isPrinting&&t.setValue("isPrinting",!0,e),r.notify("dataProcessor",e)),t.extend(e,r.dataResults),r.enableImmutableMode&&(e.result=e.result.slice()),r.initialRender&&(this.contentModule.objectEqualityChecker=r.objectEqualityChecker),!this.isPrinting){var l=new n.Deferred;return r.trigger("beforeDataBound",e,function(e){l.resolve(e)}),l}},this.grid.log=function(t,i){e.loggerModule&&e.loggerModule.log(t,i)}},d.prototype.lastRowBorderEventListener=function(){this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},d.prototype.bindCallBackEvents=function(){var e=this;this.grid.toolbarClick=function(t){if(!(t.item.id===e.grid.element.id+"_excelexport"&&!1===e.allowExcelExport||t.item.id===e.grid.element.id+"_pdfexport"&&!1===e.allowPdfExport||t.item.id===e.grid.element.id+"_csvexport"&&!1===e.allowExcelExport)){var i=new n.Deferred;return e.trigger("toolbarClick",t,function(r){r.cancel||e.notify("toolbarClick",t),i.resolve(r)}),i}},this.grid.cellSelecting=function(r){var o=e.grid.selectionModule.actualTarget;t.isNullOrUndefined(o)||!o.classList.contains("e-treegridexpand")&&!o.classList.contains("e-treegridcollapse")||(r.cancel=!0);var a=new n.Deferred;return e.trigger(i.getObject("name",r),r,function(e){a.resolve(e)}),a},this.grid.beginEdit=function(i){if(!t.isNullOrUndefined(i.row)&&i.row.classList.contains("e-summaryrow"))return void(i.cancel=!0);var r=new n.Deferred;return e.trigger("beginEdit",i,function(e){r.resolve(e)}),r}},d.prototype.extendedGridEditEvents=function(){var e=this;this.grid.dataStateChange=function(i){e.isExpandRefresh?(e.isExpandRefresh=!1,e.grid.dataSource={result:e.flatData,count:t.getValue("count",e.grid.dataSource)}):("infiniteScroll"!==i.action.requestType&&(e.infiniteScrollData=[]),e.trigger("dataStateChange",i))},this.grid.cellSave=function(i){if(e.grid.isContextMenuOpen()){var r=e.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0];(t.isNullOrUndefined(r)||r.id!==e.element.id+"_gridcontrol_cmenu_Save")&&(i.cancel=!0)}var o=new n.Deferred;return e.trigger("cellSave",i,function(t){t.cancel||e.notify("cellSave",t),o.resolve(t)}),o},this.grid.cellSaved=function(t){e.trigger("cellSaved",t),e.notify("cellSaved",t)},this.grid.cellEdit=function(t){var i=new n.Deferred;return t.promise=i,e.notify("cellEdit",t),i},this.grid.batchAdd=function(t){e.trigger("batchAdd",t),e.notify("batchAdd",t)},this.grid.beforeBatchSave=function(t){e.trigger("beforeBatchSave",t),e.notify("beforeBatchSave",t)},this.grid.beforeBatchAdd=function(t){e.trigger("beforeBatchAdd",t),e.notify("beforeBatchAdd",t)},this.grid.batchDelete=function(t){e.trigger("batchDelete",t),e.notify("batchDelete",t)},this.grid.beforeBatchDelete=function(t){e.trigger("beforeBatchDelete",t),e.notify("beforeBatchDelete",t)},this.grid.batchCancel=function(t){"Cell"!==e.editSettings.mode&&e.trigger("batchCancel",t),e.notify("batchCancel",t)}},d.prototype.updateRowTemplate=function(){var e=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(e.treeColumnRowTemplate(),e.enableCollapseAll)for(var t=e.getCurrentViewRecords(),i=e.getContentTable().rows,r=0;r<i.length;r++){var n={data:t[parseInt(r.toString(),10)],row:i[parseInt(r.toString(),10)]};e.renderModule.RowModifier(n)}},0):this.treeColumnRowTemplate())},d.prototype.bindedDataSource=function(){if(this.dataSource&&s(this)){var e=this.flatData,i=t.getValue("count",this.dataSource);this.grid.dataSource={result:e,count:i}}else this.grid.dataSource=this.dataSource instanceof n.DataManager?new n.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0):this.flatData;if(this.dataSource instanceof n.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)){this.grid.dataSource.dataSource.json=g(this.dataSource.dataSource.json),this.grid.dataSource.ready=this.dataSource.ready;var r=this;t.isNullOrUndefined(this.grid.dataSource.ready)||this.grid.dataSource.ready.then(function(e){var t=r.grid.dataSource;t.dataSource.offline=!0,t.isDataAvailable=!0,t.dataSource.json=e.result,t.adaptor=new n.JsonAdaptor})}},d.prototype.extendedGridActionEvents=function(){var e=this;this.grid.actionBegin=function(r){if("sorting"===r.requestType&&r.target&&r.target.parentElement&&r.target.parentElement.classList.contains("e-hierarchycheckbox"))return void(r.cancel=!0);if("reorder"===i.getObject("requestType",r)&&e.notify("getColumnIndex",{}),a(e)&&e.enableVirtualization&&("virtualscroll"===r.requestType?(e.query.expand("VirtualScrollingAction"),e.showSpinner()):"searching"===r.requestType&&""===r.searchString?e.query.expand("ClearSearchingAction"):"clearFilter"===r.action&&e.query.expand("ClearFilteringAction")),e.notify("actionBegin",{editAction:r}),a(e)||t.isNullOrUndefined(e.filterModule)||s(e)||0!==e.grid.filterSettings.columns.length||0!==e.grid.searchSettings.key.length||(e.notify("clearFilters",{flatData:e.grid.dataSource}),e.grid.setProperties({dataSource:e.dataResults.result},!0),t.isNullOrUndefined(e.grid.changedProperties.dataSource)&&(e.grid.renderModule.data.dataManager=e.grid.dataSource instanceof n.DataManager?e.grid.dataSource:t.isNullOrUndefined(e.grid.dataSource)?new n.DataManager:new n.DataManager(e.grid.dataSource),e.grid.renderModule.data.isQueryInvokedFromData=!0,e.grid.query=e.grid.query instanceof n.Query?e.grid.query:new n.Query)),"indenting"!==e.action&&"outdenting"!==e.action){var o=new n.Deferred;return e.trigger("actionBegin",r,function(t){t.cancel||e.notify("beginEdit",t),o.resolve(t)}),o}},this.grid.actionComplete=function(t){if(e.notify("actioncomplete",t),e.updateColumnModel(),e.updateTreeGridModel(),"reorder"===t.requestType&&e.notify("setColumnIndex",{}),e.notify("actionComplete",{editAction:t}),"add"===t.requestType&&"Top"!==e.editSettings.newRowPosition&&"Bottom"!==e.editSettings.newRowPosition&&e.notify("beginAdd",t),"batchsave"===t.requestType&&e.notify("batchSave",t),e.notify("updateGridActions",t),"save"===t.requestType&&e.aggregates.map(function(e){return!0===e.showChildSummary}).length&&e.grid.refresh(),"filter"===t.action&&(t.isCollapseMaintain||""===e.filterModule.currentFilterObject||!e.enableVirtualization||e.initialRender||e.expandStateMapping||a(e)&&e.enableVirtualization||e.expandAll()),"searching"===t.requestType&&(t.isCollapseMaintain||""===e.searchSettings.key||!e.enableVirtualization||e.initialRender||e.expandStateMapping||a(e)&&e.enableVirtualization||e.expandAll()),"clearFilter"===t.action&&e.enableCollapseAll&&e.collapseAll(),"indenting"===e.action||"outdenting"===e.action){e.action="indenting"===e.action?"indented":"outdented";var i=[e.selectedRecords],r={data:i,dropIndex:e.dropIndex,dropPosition:e.dropPosition,modifiedRecords:e.modifiedRecords,requestType:e.action,row:e.selectedRows};e.trigger("actionComplete",r),e.getCurrentViewRecords().filter(function(e){return e.uniqueID===i[0].uniqueID}).length||e.refreshToolbarItems(),e.action="",e.selectedRecords=e.selectedRows=e.modifiedRecords=[]}else{if(e.grid.isFrozenGrid()&&e.enableVirtualization&&"movable"===t.tableName){var n=e.grid.element.querySelector(".e-movablecontent"),o=e.grid.element.querySelector(".e-frozencontent");n.style.height=o.style.height="auto"}e.trigger("actionComplete",t)}}},d.prototype.extendedGridEvents=function(){var e=this,i=this;this.grid.recordDoubleClick=function(t){e.trigger("recordDoubleClick",t),e.notify("recordDoubleClick",t)},this.grid.detailDataBound=function(t){e.notify("detaildataBound",t),e.trigger("detailDataBound",t)},this.grid.rowDataBound=function(e){t.isNullOrUndefined(this.isPrinting)?t.setValue("isPrinting",!1,e):t.setValue("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){t.isNullOrUndefined(this.isPrinting)?t.setValue("isPrinting",!1,e):t.setValue("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(t){e.notify("contextMenuClick",t),e.trigger("contextMenuClick",t)},this.grid.contextMenuOpen=function(t){e.notify("contextMenuOpen",t),e.trigger("contextMenuOpen",t)},this.grid.queryCellInfo=function(t){e.renderModule.cellRender(t)}},d.prototype.bindGridDragEvents=function(){var e=this;this.grid.rowDragStartHelper=function(t){e.trigger("rowDragStartHelper",t)},this.grid.rowDragStart=function(t){e.trigger("rowDragStart",t)},this.grid.rowDrag=function(t){if(e.grid.isEdit)return void(t.cancel=!0);e.notify("row-draging",t),e.trigger("rowDrag",t)},this.grid.rowDrop=function(t){if(e.grid.isEdit)return void(t.cancel=!0);e.notify("row-dropped",t),t.cancel=!0}},d.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),t.setValue("registeredTemplate",this.registeredTemplate,this.grid);t.setValue("viewContainerRef",this.viewContainerRef,this.grid)},d.prototype.autoGenerateColumns=function(){var e=this;if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];var t=this.dataSource[0],i=Object.keys(t);this.columns=i.filter(function(t){return-1===[e.childMapping,e.parentIdMapping].indexOf(t)})}},d.prototype.getGridEditSettings=function(){var e={};switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e.guid=this.editSettings.guid,e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},d.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var t=[],i=0;i<this.contextMenuItems.length;i++)switch(this.contextMenuItems[parseInt(i.toString(),10)]){case"AddRow":case e.ContextMenuItems.AddRow:t.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case e.ContextMenuItems.RowIndent:t.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case e.ContextMenuItems.RowOutdent:t.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:t.push(this.contextMenuItems[parseInt(i.toString(),10)])}return t}return null},d.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale);for(var i=[],r=void 0,n=0;n<this.toolbar.length;n++)switch(this.toolbar[parseInt(n.toString(),10)]){case"Search":case e.ToolbarItem.Search:i.push("Search");break;case"Print":case e.ToolbarItem.Print:i.push("Print");break;case"ExpandAll":case e.ToolbarItem.ExpandAll:r=this.l10n.getConstant("ExpandAll"),i.push({text:r,tooltipText:r,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case e.ToolbarItem.CollapseAll:r=this.l10n.getConstant("CollapseAll"),i.push({text:r,tooltipText:r,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case e.ToolbarItem.RowIndent:r=this.l10n.getConstant("RowIndent"),i.push({text:r,tooltipText:r,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case e.ToolbarItem.RowOutdent:r=this.l10n.getConstant("RowOutdent"),i.push({text:r,tooltipText:r,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:i.push(this.toolbar[parseInt(n.toString(),10)])}return i}return null},d.prototype.getGridColumns=function(e,i,r){void 0===i&&(i=!0),void 0===r&&(r=0);var n=e;i&&(this.columnModel=[]);var o,a;0===this.columnModel.length&&(r=0===r?-1:r);for(var s=[],d=0;d<n.length;d++){r+=1;var l=this.grid.getColumnByUid(n[parseInt(d.toString(),10)].uid);if(a=l||{},o={},"string"==typeof this.columns[parseInt(d.toString(),10)])a.field=o.field=this.columns[parseInt(d.toString(),10)];else for(var p=Object.keys(n[parseInt(d.toString(),10)]),h=0;h<p.length;h++){var c=p[parseInt(h.toString(),10)];r===this.treeColumnIndex&&"template"===c?o[""+c]=n[parseInt(d.toString(),10)][""+c]:"columns"!==c||t.isNullOrUndefined(n[parseInt(d.toString(),10)][""+c])?this.initialRender&&!t.isNullOrUndefined(l)&&this.enablePersistence&&"edit"===c?a[""+c]=o[""+c]=l[""+c]:l&&"sortComparer"===c||(a[""+c]=o[""+c]=n[parseInt(d.toString(),10)][""+c]):(a[""+c]=this.getGridColumns(n[parseInt(d.toString(),10)][""+c],!1,this.columnModel.length-1),o[""+c]=n[parseInt(d.toString(),10)][""+c])}o.columns||this.columnModel.push(new C(o)),s.push(a),!t.isNullOrUndefined(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&a.field===this.columnModel[this.treeColumnIndex].field&&(t.isNullOrUndefined(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),a.textAlign="Right")}return s},d.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),t=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});if(t.length>0){var i=t[t.length-1];this.lastRowBorder(i,!0)}},d.prototype.onPropertyChanged=function(e){for(var r=!1,o=0,a=Object.keys(e);o<a.length;o++){var d=a[o];switch(d){case"columns":t.isNullOrUndefined(e.columns)||this.refreshColumns(),r=!0;break;case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=i.getActualProperties(this.pageSettings),r=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=i.getActualProperties(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=i.getActualProperties(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=i.getActualProperties(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=i.getActualProperties(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=i.getActualProperties(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":if(this.isLocalData=!(this.dataSource instanceof n.DataManager)||!t.isNullOrUndefined(this.dataSource.ready)||this.dataSource.adaptor instanceof n.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData){if(s(this)){var l=t.getValue("count",this.dataSource);this.grid.dataSource={result:this.flatData,count:l}}else{var p=this.dataSource;this.grid.dataSource=p instanceof n.DataManager?new n.DataManager(p.dataSource,p.defaultQuery,p.adaptor):this.flatData}this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)}else this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable());break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+d]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=i.getActualProperties(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight,this.refresh();break;case"height":t.isNullOrUndefined(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":t.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"columnChooserSettings":this.grid.columnChooserSettings=i.getActualProperties(this.columnChooserSettings);break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":t.isNullOrUndefined(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=i.getActualProperties(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=i.getActualProperties(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=i.getActualProperties(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=i.getActualProperties(this.columnMenuItems);break;case"enableStickyHeader":this.grid.enableStickyHeader=this.enableStickyHeader;break;case"emptyRecordTemplate":this.grid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"isRowSelectable":this.grid.isRowSelectable=this.isRowSelectable;break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+d].mode&&("Cell"===e[""+d].mode||"Row"===e[""+d].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings();break;case"enableRowSpan":case"enableColumnSpan":this.grid.enableRowSpan=this.enableRowSpan,this.grid.enableColumnSpan=this.enableColumnSpan,this.refreshColumns()}}r&&(this.isFrozenGrid()?this.refreshLayout():this.grid.refresh())},d.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},d.prototype.destroy=function(){this.isComponentRefresh=!0;var e=this.element;if(e){var t=!(!e.querySelector(".e-gridheader")||!e.querySelector(".e-gridcontent"));t&&this.unwireEvents(),this.removeListener(),this.dataModule&&this.dataModule.destroy(),this.grid&&(this.grid.dataSource=null,this.grid.destroy()),t&&r.prototype.destroy.call(this),this.infiniteScrollData=null,this.remoteCollapsedData=null,this.remoteExpandedData=null,this.parentData=null;for(var i=["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"],n=0;n<i.length;n++)this[i[parseInt(n.toString(),10)]]&&(this[i[parseInt(n.toString(),10)]]=null);this.dataResults=null,this.uniqueIDCollection={},this.uniqueIDFilterCollection={},this.element.innerHTML="",this.grid=null}},d.prototype.dataBind=function(){t.isNullOrUndefined(this.grid)||(!t.isNullOrUndefined(this.rowDropSettings.targetID)&&t.isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),r.prototype.dataBind.call(this),this.grid.dataBind())},d.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],i={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],n=0;n<e.length;n++)for(var o=this[e[parseInt(n.toString(),10)]],a=0,s=i[e[parseInt(n.toString(),10)]];!t.isNullOrUndefined(s)&&a<s.length;a++)delete o[""+s[parseInt(a.toString(),10)]];return this.ignoreInArrays(r,this.columns),this.addOnPersist(e)},d.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},d.prototype.ignoreInColumn=function(e,i){if(t.isNullOrUndefined(i.template))for(var r=0;r<e.length;r++)delete i[e[parseInt(r.toString(),10)]],i.filter={}},d.prototype.mouseClickHandler=function(e){var i=this;if(t.isNullOrUndefined(e.touches)){var r=e.target;!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(r);if((r.classList.contains("e-treegridexpand")||r.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:r}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length){var n=this.grid.getHeaderContent().querySelector(".e-checkselectall"),o=this.grid.getSelectedRowIndexes().length,a=this.getCurrentViewRecords().length;if(a>0&&o===a){var s=n.nextElementSibling;t.removeClass([s],["e-stop","e-uncheck"]),t.addClass([s],["e-check"])}}if((r.classList.contains("e-flmenu-cancelbtn")||r.classList.contains("e-flmenu-okbtn")||r.classList.contains("e-content")||r.classList.contains("e-rowcell"))&&!t.isNullOrUndefined(this.grid.filterModule)&&this.isReact&&!t.isNullOrUndefined(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate){var d=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id);this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&d&&this.clearTemplate(["filterTemplate"],void 0,function(){i.grid.filterModule.filterModule.dlgObj.destroy()})}}},d.prototype.getRows=function(){return this.grid.getRows()},d.prototype.getPager=function(){return this.grid.getPager()},d.prototype.addRecord=function(e,t,i){if(this.editModule){this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i)}},d.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},d.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},d.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},d.prototype.updateRow=function(e,i){if(this.grid.editModule)if(t.isNullOrUndefined(e))this.grid.editModule.updateRow(e,i);else{var r=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)];t.extend(r,i),this.grid.editModule.updateRow(e,r)}},d.prototype.deleteRecord=function(e,i){if(t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)||this.getSelectedRecords().length<=0){this.trigger("actionFailure",{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."})}this.grid.editModule&&this.grid.editModule.deleteRecord(e,i)},d.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},d.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},d.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},d.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},d.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},d.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},d.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},d.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);var r=this.grid.getRowIndexByPrimaryKey(e),n=this.getCurrentViewRecords()[parseInt(r.toString(),10)];S({value:n,action:"edit"},this,this.isSelfReference,n.index,this.grid.selectedRowIndex,t)},d.prototype.setRowData=function(e,t){var i=this.getCurrentViewRecords(),r=this.grid.getPrimaryKeyFieldNames()[0],n=0,o={};i.some(function(t){return t[""+r]===e&&(o=t,!0)}),n=o.level,t.level=n,t.index=o.index,t.childRecords=o.childRecords,t.taskData=o.taskData,t.uniqueID=o.uniqueID,t.parentItem=o.parentItem,t.checkboxState=o.checkboxState,t.hasChildRecords=o.hasChildRecords,t.parentUniqueID=o.parentUniqueID,t.expanded=o.expanded,this.grid.setRowData(e,t);var a=this.getVisibleRecords();if(a.length>0&&e===a[a.length-1][""+r]){var s=this.getContentTable().scrollHeight,d=this.getContent().clientHeight;this.lastRowBorder(this.getRows()[i.indexOf(o)],s<=d)}},d.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},d.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},d.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},d.prototype.getColumnByField=function(e){return i.iterateArrayOrObject(this.columnModel,function(t){if(t.field===e)return t})[0]},d.prototype.getColumnByUid=function(e){var t=this.initialRender?this.grid.columns:this.columns;return this.grid.columns.length!==this.columnModel.length&&(t=this.grid.columnModel),i.iterateArrayOrObject(t,function(t){if(t.uid===e)return t})[0]},d.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},d.prototype.getFooterContent=function(){return this.grid.getFooterContent()},d.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},d.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},d.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},d.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},d.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},d.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},d.prototype.getVirtualColIndexByUid=function(e){var r=i.iterateArrayOrObject(this.grid.columnModel,function(t,i){if(t.uid===e)return i})[0];return t.isNullOrUndefined(r)?-1:r},d.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},d.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},d.prototype.updateColumnModel=function(e){var i,r,n=t.isNullOrUndefined(e)?this.grid.getColumns():e;-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!t.isNullOrUndefined(this.columnModel[this.treeColumnIndex].template)&&(i=this.columnModel[this.treeColumnIndex].template,r=this.columnModel[this.treeColumnIndex].field);var o;if(!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===n.length){this.columnModel=[];for(var a=0;a<n.length;a++){o={};for(var s=0,d=Object.keys(n[parseInt(a.toString(),10)]);s<d.length;s++){var l=d[s];o[""+l]=n[parseInt(a.toString(),10)][""+l]}this.columnModel.push(new C(o)),r!==this.columnModel[parseInt(a.toString(),10)].field||"checkbox"===this.columnModel[parseInt(a.toString(),10)].type||t.isNullOrUndefined(i)||""===i||(this.columnModel[parseInt(a.toString(),10)].template=i)}}if(this.deepMerge=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!t.isNullOrUndefined(this.detailTemplate)){this.trigger("actionFailure",{error:"Stacked header is not compatible with the detail template"})}return this.stackedHeader&&this.allowResizing&&!t.isNullOrUndefined(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||t.isNullOrUndefined(this.columns)||t.merge(this.columns,this.columnModel),this.deepMerge=void 0,this.columnModel},d.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){if(!t.isNullOrUndefined(e)&&e.columns)i.updateColumnsWidth(e.columns);else if(!t.isNullOrUndefined(e)&&e.field){var r=i.grid.getColumnByField(e.field);t.isNullOrUndefined(r)||(e.width=r.width)}})},d.prototype.getContent=function(){return this.grid.getContent()},d.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},d.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},d.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this)},d.prototype.splitFrozenCount=function(e){var t=this.frozenColumns>0?this.grid:this;this.grid.splitFrozenCount.apply(t,[e])},d.prototype.removeBorder=function(e){this.grid.removeBorder.apply(this.grid,[e])},d.prototype.frozenLeftBorderColumns=function(e){this.grid.frozenLeftBorderColumns.apply(this.grid,[e])},d.prototype.frozenRightBorderColumns=function(e){this.grid.frozenRightBorderColumns.apply(this.grid,[e])},d.prototype.isFrozenGrid=function(){var e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return this.frozenColumns>0||this.frozenRows>0||this.getFrozenColumns()>0||e},d.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:i.getObject("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:i.getObject("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:i.getObject("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:i.getObject("properties",this.grid.sortSettings)},!0)},d.prototype.hasPreAndPostMiddleware=function(e){return e&&"function"==typeof e.applyPreRequestMiddlewares&&"function"==typeof e.applyPostRequestMiddlewares},d.prototype.getContentTable=function(){return this.grid.getContentTable()},d.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,r=t.length;i<r;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},d.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return t.isNullOrUndefined(e.isSummaryRow)})},d.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},d.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},d.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},d.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},d.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},d.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},d.prototype.getVisibleColumns=function(){return this.columnModel.filter(function(e){return e.visible})},d.prototype.showSpinner=function(){o.showSpinner(this.element)},d.prototype.hideSpinner=function(){o.hideSpinner(this.element)},d.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),s(this)||(this.dataSource instanceof n.DataManager?this.grid.setProperties({dataSource:new n.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},d.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},d.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=c(t[parseInt(i.toString(),10)]).length);return e},d.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},d.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},d.prototype.refreshColumns=function(e){t.isNullOrUndefined(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.isFrozenGrid()||this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},d.prototype.getTreeColumn=function(){var e=this.columnModel[this.treeColumnIndex],r=this.getColumns(),n=i.getObject("field",e),o=r.findIndex(function(e){return i.getObject("field",e)===n});t.isNullOrUndefined(o)||this.setProperties({treeColumnIndex:o},!0)},d.prototype.refreshHeader=function(){this.grid.refreshHeader()},d.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode){if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog){var t=this.grid.editModule.dialogObj;return this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e)}}if(this.rowTemplate){var i=e.closest(".e-treerowcell").parentElement,r=this.getCurrentViewRecords()[i.rowIndex];e.classList.contains("e-treegridexpand")?this.collapseRow(i,r):this.expandRow(i,r)}else{var n=this.grid.getRowInfo(e),r=n.rowData;if(this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(r).length){r=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===n.row.getAttribute("data-uid")})[0].data}this.enableImmutableMode&&(r=this.getCurrentViewRecords()[n.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(n.row,r):this.expandRow(n.row,r)}},d.prototype.expandRow=function(e,i,r,n){var o=this;this.isCollapseAll=!1;var s=this.parentData;if(this.enableVirtualization||(s=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!t.isNullOrUndefined(e)||!t.isNullOrUndefined(i))if(!t.isNullOrUndefined(e)&&e.cells&&e.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(e,!1),this.isExpandAll&&!a(this)){var d={data:s,row:e,cancel:!1},l=!1;this.grid.pagerModule&&!t.isNullOrUndefined(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(l=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||l&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(e,i,s):this.trigger("expanding",d,function(a){o.expandAllPrevent=a.cancel,a.cancel||t.isNullOrUndefined(i)||(a.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,s))}),this.isExpandingEventTriggered=!0}else if(!this.isExpandAll||this.isExpandAll&&a(this)){d={data:i,row:e,cancel:!1};this.trigger("expanding",d,function(t){t.cancel||(t.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,s))})}},d.prototype.expandRows=function(e,i,r){this.expandCollapse("expand",e,i);if((!a(this)||u(this))&&(!s(this)||!t.isNullOrUndefined(i.Children))){var n={data:i,row:e};t.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,n={data:r,row:e},this.trigger("expanded",n)):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!t.isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger("expanded",n)}},d.prototype.expandCollapseAllChildren=function(e,i,r,n){if((t.isNullOrUndefined(r)||e[this.getPrimaryKeyFieldNames()[0]]===r)&&(t.isNullOrUndefined(n)||n===e.level)){var o=c(e).filter(function(e){return e.hasChildRecords});o.unshift(e);for(var a=0;a<o.length;a++)this.expandCollapse(i,null,o[parseInt(a.toString(),10)])}},d.prototype.getCollapseExpandRecords=function(e,i){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&t.isNullOrUndefined(i)&&!a(this)?i=this.flatData.filter(function(e){return e.hasChildRecords}):t.isNullOrUndefined(i)&&!t.isNullOrUndefined(e)&&(i=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),i},d.prototype.collapseRow=function(e,i,r){var n=this;this.isExpandAll=!1;var o=this.parentData;if(this.enableVirtualization||(o=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!t.isNullOrUndefined(e)||!t.isNullOrUndefined(i))if(this.isCollapseAll&&!a(this)){s={data:o,row:e,cancel:!1};this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(e,i,o):this.trigger("collapsing",s,function(t){n.collapseAllPrevent=t.cancel,t.cancel||(t.collapseAll&&n.expandCollapseAllChildren(i,"collapse",r),n.collapseRows(e,i,o))}),this.isCollapsingEventTriggered=!0}else if(!this.isCollapseAll||this.isCollapseAll&&a(this)){var s={data:i,row:e,cancel:!1};this.trigger("collapsing",s,function(t){t.cancel||n.collapseRows(e,i,o)})}},d.prototype.collapseRows=function(e,i,r){this.expandCollapse("collapse",e,i);var n={data:i,row:e};a(this)||(t.isNullOrUndefined(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,n={data:r,row:e},this.trigger("collapsed",n)):this.isCollapseAll||this.trigger("collapsed",n),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},d.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)][this.expandStateMapping]=t,S({value:i[parseInt(r.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(r.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,S({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},d.prototype.expandAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!a(this)){t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!0),t.hasChildRecords&&t.level===e});this.expandAction(t,null,e,!0)}else{var t=this.getRecordDetails(e),r=i.getObject("records",t);this.expandAction(r,null,e)}},d.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},d.prototype.expandAction=function(e,i,r,n){void 0===n&&(n=!1);for(var o=this,s=0;s<e.length;s++)!function(s){if(!t.isNullOrUndefined(e[parseInt(s.toString(),10)].parentItem)){var d=e[parseInt(s.toString(),10)].parentItem.uniqueID,l=o.flatData.filter(function(e){return e.uniqueID===d});a(o)&&(l=o.getCurrentViewRecords().filter(function(e){return e.uniqueID===d})),!1===l[0].expanded?(e.push(l[0]),l[0].expanded=!0):h(o,l[0],o.parentData)||l[0].expanded&&void 0!==l[0].parentItem&&e.push(l[0])}n||o.expandRow(null,e[parseInt(s.toString(),10)],i,r)}(s);n&&this.expandRow(null,e,i,r)},d.prototype.getRecordDetails=function(e){var t=this.getRows().filter(function(t){return-1!==t.className.indexOf("level"+e)&&(t.querySelector(".e-treegridcollapse")||t.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(t){return t.level===e&&t.hasChildRecords}),rows:t}},d.prototype.collapseAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!a(this)){var t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!1),t.hasChildRecords&&t.level===e});this.collapseAction(t,null,!0)}else{var r=this.getRecordDetails(e),n=i.getObject("records",r);this.collapseAction(n)}},d.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},d.prototype.expandCollapseActionByKey=function(e,i){var r=this.getPrimaryKeyFieldNames()[0],n=a(this)?this.getCurrentViewRecords():this.grid.dataSource;if(!t.isNullOrUndefined(r)){var o=n.filter(function(t){return t[""+r].toString()===e.toString()});"Expand"===i?this.expandAction(o,e,null):this.collapseAction(o,e)}},d.prototype.collapseAction=function(e,t,i){if(void 0===i&&(i=!1),i)this.collapseRow(null,e);else for(var r=0;r<e.length;r++)this.collapseRow(null,e[parseInt(r.toString(),10)],t);if(!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length){this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1}},d.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger("actionFailure",{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("expand")},d.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger("actionFailure",{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("collapse")},d.prototype.expandCollapseAll=function(e){var i;if(!(i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))}):this.getRows().filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))})).length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!a(this)){if(this.flatData.filter(function(t){t.hasChildRecords&&(t.expanded="collapse"!==e)}),i.length)for(o=0;o<i.length;o++)if("collapse"===e){var r=this.frozenRows?this.getCurrentViewRecords()[parseInt(i[parseInt(o.toString(),10)].getAttribute("aria-rowindex"),10)-1]:this.getCurrentViewRecords()[i[parseInt(o.toString(),10)].rowIndex];t.isNullOrUndefined(r)||this.collapseRow(i[parseInt(o.toString(),10)])}else this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(o.toString(),10)]);else if(this.allowPaging){var n=this.enableCollapseAll;this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:n},!0)}}else for(var o=0;o<i.length;o++)"collapse"===e?this.collapseRow(i[parseInt(o.toString(),10)]):this.expandRow(i[parseInt(o.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},d.prototype.expandCollapse=function(e,i,r,n){var o,d=this,l={row:i,data:r,childData:[],requestType:e},p=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});(!a(this)&&"expand"===e&&this.isSelfReference&&s(this)&&!p.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!a(this)&&this.isSelfReference&&s(this))&&this.updateChildOnDemand(l);var c=this.getRows();if(this.rowTemplate){x=this.getContentTable().rows;c=[].slice.call(x)}var g;if(t.isNullOrUndefined(i)?(g=this.grid.currentViewData.indexOf(r),i=c[parseInt(g.toString(),10)]):g=+i.getAttribute("aria-rowindex")-1,t.isNullOrUndefined(i)||i.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||a(this)||s(this)){var f=void 0;if("expand"===e){if(f="e-childrow-visible",n||(r.expanded=!0,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),t.isNullOrUndefined(i)||(o=i.getElementsByClassName("e-treegridcollapse")[0]),n&&!t.isNullOrUndefined(r[this.expandStateMapping])&&r[this.expandStateMapping]&&t.isNullOrUndefined(o)&&(o=i.getElementsByClassName("e-treegridexpand")[0]),t.isNullOrUndefined(o))return;o.classList.contains("e-treegridexpand")||t.addClass([o],"e-treegridexpand"),t.removeClass([o],"e-treegridcollapse")}else{if(f="e-childrow-hidden",n&&!s(this)||(r.expanded=!1,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),t.isNullOrUndefined(i)||(o=i.getElementsByClassName("e-treegridexpand")[0]),n&&!t.isNullOrUndefined(r[this.expandStateMapping])&&!r[this.expandStateMapping]&&t.isNullOrUndefined(o)&&(o=i.getElementsByClassName("e-treegridcollapse")[0]),t.isNullOrUndefined(o))return;o.classList.contains("e-treegridcollapse")||t.addClass([o],"e-treegridcollapse"),t.removeClass([o],"e-treegridexpand")}i.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");var m=c.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))});if(a(this)&&!u(this))this.remoteExpand(e,i,r);else{s(this)&&!p.length&&"collapse"!==e||this.localExpand(e,i,r);var S=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,v=this.getRowByIndex(S),w=v?v.nextElementSibling&&v.nextElementSibling.classList.contains("e-detailrow")?v.nextElementSibling:v:null;this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!t.isNullOrUndefined(w)&&!w.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(w,!0)}if(s(this)&&"expand"===e){var I=this.getCurrentViewRecords().filter(function(e){return h(d,e,d.parentData)});this.dataResults.result=I}if(!t.isNullOrUndefined(o)&&o.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(o.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),o.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!i.cells[0].classList.contains("e-lastrowcell"))for(var R=this.getRows(),x=this.getContentTable().rows,C=(R=[].slice.call(x)).length-1;C>=0;C--)if(!y(R[parseInt(C.toString(),10)])){var b=this.getContentTable().scrollHeight,D=this.getContent().clientHeight;this.lastRowBorder(R[parseInt(C.toString(),10)],b<=D);break}this.notify("rowExpandCollapse",{detailrows:m,action:f,record:r,row:i}),this.updateAltRow(c)}else this.notify("localPagedExpandCollapse",{action:e,row:i,record:r})},d.prototype.updateChildOnDemand=function(e){var r=this;if("collapse"===e.requestType&&s(this)){for(var o=this.flatData.slice(),a=0;a<o.length;a++)o[parseInt(a.toString(),10)].parentUniqueID===e.data.uniqueID&&(o.splice(a,1),a-=1);return void(this.dataResults.result=o)}var d,l=new n.Deferred;this.query?(d=this.grid.getDataModule().getStateEventArgument(this.query)).action=e:d=e,e.childDataBind=l.resolve;var p=e.data;this.trigger("dataStateChange",d),l.promise.then(function(){if(e.childData.length){s(r)&&(r.flatData=r.dataResults.result),r.enableInfiniteScrolling&&s(r)&&(r.flatData=r.infiniteScrollData);for(var n=r.flatData,o=0,a=0;a<n.length;a++)if(n[parseInt(a.toString(),10)].taskData===p.taskData){o=a;break}for(var d=t.getValue("result",r.dataSource),l=g(e.childData),h=p[r.childMapping]&&p[r.childMapping].length>l.length?p[r.childMapping].length:l.length,a=0;a<h;a++)p[r.childMapping]&&d.filter(function(e,t){e[r.parentIdMapping]===p[r.idMapping]&&d.splice(t,1)}),l[parseInt(a.toString(),10)]?(l[parseInt(a.toString(),10)].level=p.level+1,l[parseInt(a.toString(),10)].index=Math.ceil(1e3*Math.random()),l[parseInt(a.toString(),10)].parentItem=t.extend({},p),l[parseInt(a.toString(),10)].taskData=t.extend({},l[parseInt(a.toString(),10)]),delete l[parseInt(a.toString(),10)].parentItem.childRecords,delete l[parseInt(a.toString(),10)].taskData.parentItem,l[parseInt(a.toString(),10)].parentUniqueID=p.uniqueID,l[parseInt(a.toString(),10)].uniqueID=i.getUid(r.element.id+"_data_"),t.setValue("uniqueIDCollection."+l[parseInt(a.toString(),10)].uniqueID,l[parseInt(a.toString(),10)],r),(!t.isNullOrUndefined(l[parseInt(a.toString(),10)][r.childMapping])||l[parseInt(a.toString(),10)][r.hasChildMapping]&&s(r))&&(l[parseInt(a.toString(),10)].hasChildRecords=!0),s(r)&&p[r.childMapping]&&p[r.childMapping][parseInt(a.toString(),10)]?n.splice(o+1+a,0,l[parseInt(a.toString(),10)]):n.splice(o+1+a,p[r.childMapping]&&p[r.childMapping][parseInt(a.toString(),10)]?1:0,l[parseInt(a.toString(),10)])):n.splice(o+1+a,1);n[parseInt(o.toString(),10)][""+r.childMapping]=l,n[parseInt(o.toString(),10)].childRecords=l,n[parseInt(o.toString(),10)].expanded=!0,t.setValue("uniqueIDCollection."+n[parseInt(o.toString(),10)].uniqueID,n[parseInt(o.toString(),10)],r);for(var c=0;c<e.childData.length;c++)d.push(e.childData[parseInt(c.toString(),10)])}s(r)&&!r.loadChildOnDemand&&"expand"===e.requestType&&(r.dataResults.expandRecord={},r.dataResults.expandRecord=e.data),r.isExpandRefresh=!0;var u=r.getContentTable().parentElement.scrollTop;r.grid.refresh(),r.enableInfiniteScrolling&&(r.getContentTable().parentElement.scrollTop=u),r.trigger("expanded",e)})},d.prototype.remoteExpand=function(e,i,r){var n=this.getRows(),o=t.getValue("isCollapseAll",this)?"collapseAll":"refresh";if(this.grid.contentModule.requestType=o,this.rowTemplate){var a=this.getContentTable().rows;n=[].slice.call(a)}var s={data:r,row:i},d=[];if(d=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))||e.querySelector(".e-gridrowindex"+r.index+"level0.e-summarycell")}),"expand"===e){this.notify("remoteExpand",{record:r,rows:d,parentRow:i});var l={row:i,data:r};d.length>0&&this.trigger("expanded",l)}else"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:s.data,rows:null,parentRow:s.row}):(this.collapseRemoteChild({record:r,rows:d}),this.trigger("collapsed",s))},d.prototype.localExpand=function(e,i,r){var n,o=i.nextElementSibling&&i.nextElementSibling.classList.contains("e-detailrow")?i.nextElementSibling:null,d=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});this.isPixelHeight()&&i.cells[0].classList.contains("e-lastrowcell")?this.lastRowBorder(i,!1):this.isPixelHeight()&&o&&o.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(i.nextElementSibling,!1);var l,p,h=this.getRows();if(this.rowTemplate){var c=this.getContentTable().rows;h=[].slice.call(c)}var u="expand"===e?"e-childrow-visible":"e-childrow-hidden",g=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging){n=[];for(R=0;R<d.length;R++){var f=this.grid.getRowIndexByPrimaryKey(d[parseInt(R.toString(),10)][""+g]);n.push(this.getRows()[parseInt(f.toString(),10)])}}else n=h.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))});var m=this.grid.getFrozenLeftColumnsCount()>0||this.grid.getFrozenRightColumnsCount()>0;(this.frozenRows||this.frozenColumns||this.getFrozenColumns()||m)&&(l=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})),m&&(p=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}));var y=this.grid.getRowsObject(),S=this.grid.currentViewData,v=S.filter(function(e){return e.uniqueID===r.uniqueID}),w=S.indexOf(v[0]);t.isNullOrUndefined(y[parseInt(w.toString(),10)].visible)||!1===y[parseInt(w.toString(),10)].visible||(y[parseInt(w.toString(),10)].visible=!0),this.detailTemplate&&h.forEach(function(e){e.classList.contains("e-detailrow")&&"none"===e.style.display&&(e.style.display="")});for(var I=h.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))}),R=0;R<n.length;R++){if(t.isNullOrUndefined(n[parseInt(R.toString(),10)])||this.toggleRowVisibility(n[parseInt(R.toString(),10)],u),!t.isNullOrUndefined(n[parseInt(R.toString(),10)])&&!this.allowPaging&&!(this.enableVirtualization||this.enableInfiniteScrolling||a(this)||s(this))){t.isNullOrUndefined(y[n[parseInt(R.toString(),10)].rowIndex])||(y[n[parseInt(R.toString(),10)].rowIndex].visible="e-childrow-hidden"!==u);var x=S.filter(function(e){return e.uniqueID===v[0].parentUniqueID});!t.isNullOrUndefined(x[0])&&h[S.indexOf(x[0])].getElementsByClassName("e-treegridcollapse").length&&(y[parseInt(w.toString(),10)].visible=!1)}t.isNullOrUndefined(l)||this.toggleRowVisibility(l[parseInt(R.toString(),10)],u),t.isNullOrUndefined(p)||this.toggleRowVisibility(p[parseInt(R.toString(),10)],u),this.notify("childRowExpand",{row:n[parseInt(R.toString(),10)]}),!t.isNullOrUndefined(d)&&!t.isNullOrUndefined(d[parseInt(R.toString(),10)].childRecords)&&d[parseInt(R.toString(),10)].childRecords.length>0&&("expand"!==e||t.isNullOrUndefined(d[parseInt(R.toString(),10)].expanded)||d[parseInt(R.toString(),10)].expanded)&&(this.expandCollapse(e,n[parseInt(R.toString(),10)],d[parseInt(R.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex&&!t.isNullOrUndefined(l)&&this.expandCollapse(e,l[parseInt(R.toString(),10)],d[parseInt(R.toString(),10)],!0))}for(R=0;R<I.length;R++)t.isNullOrUndefined(I[parseInt(R.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||a(this)||s(this)||(y[I[parseInt(R.toString(),10)].rowIndex].visible="e-childrow-hidden"!==u,this.toggleRowVisibility(I[parseInt(R.toString(),10)],u));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||a(this)||s(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},d.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},d.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var i=0,r=0;e&&r<e.length;r++){var n=e[parseInt(r.toString(),10)];n.classList.contains("e-childrow-hidden")||(n.classList.contains("e-altrow")&&t.removeClass([n],"e-altrow"),i%2==0||n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||t.addClass([n],"e-altrow"),n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||i++)}},d.prototype.treeColumnRowTemplate=function(){var e=this.getContentTable().rows;e=[].slice.call(e);for(var t=this.grid.getRowsObject(),i=0;i<e.length;i++){var r=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],n=e[parseInt(i.toString(),10)],o={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(o)}},d.prototype.collapseRemoteChild=function(e,i){t.isNullOrUndefined(i)||i||!this.loadChildOnDemand||(e.record.expanded=!1);var r,n,o=e.rows,a=[],s=[],d=this.getFrozenLeftColumnsCount()>0||this.getFrozenRightColumnsCount()>0;d&&(a=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}),s=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}));for(var l=0;l<o.length;l++){this.toggleRowVisibility(o[parseInt(l.toString(),10)],"e-childrow-hidden"),r=o[parseInt(l.toString(),10)];var p=o[parseInt(l.toString(),10)].querySelector(".e-detailrowexpand");if(t.isNullOrUndefined(p)||this.grid.detailRowModule.collapse(p),d&&(this.toggleRowVisibility(a[parseInt(l.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(s[parseInt(l.toString(),10)],"e-childrow-hidden"),o[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(a[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?r=a[parseInt(l.toString(),10)]:s[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(r=s[parseInt(l.toString(),10)]))),r.querySelector(".e-treecolumn-container .e-treegridexpand")){var h=r.querySelector(".e-treecolumn-container .e-treegridexpand");n=this.rowTemplate?this.grid.getCurrentViewRecords()[o[parseInt(l.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(o[parseInt(l.toString(),10)].getAttribute("data-Uid")).data,!t.isNullOrUndefined(h)&&n.expanded&&(t.removeClass([h],"e-treegridexpand"),t.addClass([h],"e-treegridcollapse"));for(var c=[],u=this.getRows(),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))&&c.push(u[parseInt(g.toString(),10)]);c.length&&n.expanded&&this.collapseRemoteChild({record:n,rows:c},!1)}}this.grid.pageSettings.totalRecordsCount-=o.length},d.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?t.SanitizeHtmlHelper.sanitize(e):e},d.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("partial-filter-update",this.partialFilterUpdate,this),this.grid.on("get-row-cells",this.getCellsByTableName,this)},d.prototype.updateResultModel=function(e){this.dataResults=e},d.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated),this.grid.off("partial-filter-update",this.partialFilterUpdate),this.grid.off("get-row-cells",this.getCellsByTableName))},d.prototype.getCellsByTableName=function(e){if(Array.isArray(e.elements)||(e.elements=[]),e.rowIndex<this.grid.getDataRows().length){var t=[].slice.call(this.grid.getDataRows()[parseInt(e.rowIndex.toString(),10)].getElementsByClassName("e-rowcell"));Array.prototype.push.apply(e.elements,t)}},d.prototype.partialFilterUpdate=function(e){var t=e.gridFiltered;this.notify("updateFilterRecs",{data:t})},d.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},d.prototype.clearFiltering=function(){this.grid.clearFiltering()},d.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},d.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},d.prototype.selectRows=function(e){this.grid.selectRows(e)},d.prototype.clearSelection=function(){t.isNullOrUndefined(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},d.prototype.copy=function(e){this.clipboardModule.copy(e)},d.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},d.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},d.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},d.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},d.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},d.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},d.prototype.getMovableRows=function(){return this.grid.getRows()},d.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},d.prototype.getFrozenRightRows=function(){return this.grid.getRows()},d.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},d.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},d.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},d.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},d.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},d.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},d.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},d.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},d.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},d.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},d.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},d.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},d.prototype.getFrozenColumns=function(){return this.getFrozenCount(!t.isNullOrUndefined(this.columns)&&this.columns,0)+this.frozenColumns},d.prototype.getFrozenCount=function(e,t){for(var i=0,r=e.length;i<r;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},d.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},d.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},d.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},d.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},d.prototype.reorderRows=function(e,i,r){t.isNullOrUndefined(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,i,r)},d.prototype.indent=function(e){t.isNullOrUndefined(this.rowDragAndDropModule)||(e=e,this.rowDragAndDropModule[this.indentOutdentAction](e,"indent"))},d.prototype.outdent=function(e){t.isNullOrUndefined(this.rowDragAndDropModule)||(e=e,this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent"))},d.prototype.getPageSizeByHeight=function(e){if(t.isNullOrUndefined(e)){var i=document.getElementById(this.element.id);if(i)e=i.clientHeight;else{var r=this.element;e=r?r.offsetHeight||r.clientHeight||0:0}}if(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap){var n=0;if("string"==typeof e&&-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),e>this.grid.getNoncontentHeight()+this.grid.getRowHeight()){var o=this.grid.getNoncontentHeight(),a=document.getElementsByClassName("e-pagerexternalmsg")[0];a&&(o+=a.clientHeight),n=(e-o)/this.grid.getRowHeight()}return this.frozenRows>0&&(n+=this.frozenRows),n>0?Math.floor(n):0}return 0};var l;return Re([t.Property(0)],d.prototype,"frozenRows",void 0),Re([t.Property(0)],d.prototype,"frozenColumns",void 0),Re([t.Property("Ellipsis")],d.prototype,"clipMode",void 0),Re([t.Property([])],d.prototype,"columns",void 0),Re([t.Property(null)],d.prototype,"childMapping",void 0),Re([t.Property(null)],d.prototype,"hasChildMapping",void 0),Re([t.Property(0)],d.prototype,"treeColumnIndex",void 0),Re([t.Property(null)],d.prototype,"idMapping",void 0),Re([t.Property(null)],d.prototype,"parentIdMapping",void 0),Re([t.Property(!1)],d.prototype,"enableCollapseAll",void 0),Re([t.Property(null)],d.prototype,"expandStateMapping",void 0),Re([t.Property(!1)],d.prototype,"allowRowDragAndDrop",void 0),Re([t.Property([])],d.prototype,"dataSource",void 0),Re([t.Property()],d.prototype,"query",void 0),Re([t.Property()],d.prototype,"cloneQuery",void 0),Re([t.Property("AllPages")],d.prototype,"printMode",void 0),Re([t.Property(!1)],d.prototype,"allowPaging",void 0),Re([t.Property(!0)],d.prototype,"loadChildOnDemand",void 0),Re([t.Property(!1)],d.prototype,"allowTextWrap",void 0),Re([t.Complex({},B)],d.prototype,"textWrapSettings",void 0),Re([t.Property(!1)],d.prototype,"allowReordering",void 0),Re([t.Property(!1)],d.prototype,"allowResizing",void 0),Re([t.Property(!1)],d.prototype,"autoCheckHierarchy",void 0),Re([t.Complex({},re)],d.prototype,"pageSettings",void 0),Re([t.Complex({},i.RowDropSettings)],d.prototype,"rowDropSettings",void 0),Re([t.Property("USD")],d.prototype,"currencyCode",void 0),Re([t.Property()],d.prototype,"pagerTemplate",void 0),Re([t.Property(!1)],d.prototype,"showColumnMenu",void 0),Re([t.Property(!1)],d.prototype,"showColumnChooser",void 0),Re([t.Complex({},we)],d.prototype,"columnChooserSettings",void 0),Re([t.Property(!1)],d.prototype,"allowSorting",void 0),Re([t.Property(!0)],d.prototype,"allowMultiSorting",void 0),Re([t.Complex({},ge)],d.prototype,"sortSettings",void 0),Re([t.Collection([],se)],d.prototype,"aggregates",void 0),Re([t.Complex({},pe)],d.prototype,"editSettings",void 0),Re([t.Property(!1)],d.prototype,"allowFiltering",void 0),Re([t.Property()],d.prototype,"detailTemplate",void 0),Re([t.Complex({},U)],d.prototype,"filterSettings",void 0),Re([t.Complex({},Y)],d.prototype,"searchSettings",void 0),Re([t.Property()],d.prototype,"toolbar",void 0),Re([t.Property()],d.prototype,"toolbarTemplate",void 0),Re([t.Property("Default")],d.prototype,"gridLines",void 0),Re([t.Property()],d.prototype,"contextMenuItems",void 0),Re([t.Property()],d.prototype,"columnMenuItems",void 0),Re([t.Property()],d.prototype,"rowTemplate",void 0),Re([t.Property("Parent")],d.prototype,"copyHierarchyMode",void 0),Re([t.Property(null)],d.prototype,"rowHeight",void 0),Re([t.Property(!0)],d.prototype,"enableAltRow",void 0),Re([t.Property(!0)],d.prototype,"allowKeyboard",void 0),Re([t.Property(!1)],d.prototype,"enableHover",void 0),Re([t.Property(!1)],d.prototype,"enableAutoFill",void 0),Re([t.Property(!1)],d.prototype,"enableAdaptiveUI",void 0),Re([t.Property(!1)],d.prototype,"enableImmutableMode",void 0),Re([t.Property(!1)],d.prototype,"enableStickyHeader",void 0),Re([t.Property()],d.prototype,"emptyRecordTemplate",void 0),Re([t.Property("auto")],d.prototype,"height",void 0),Re([t.Property("auto")],d.prototype,"width",void 0),Re([t.Complex({},P)],d.prototype,"loadingIndicator",void 0),Re([t.Property(!0)],d.prototype,"enableVirtualMaskRow",void 0),Re([t.Property(!1)],d.prototype,"enableVirtualization",void 0),Re([t.Property(!1)],d.prototype,"enableColumnVirtualization",void 0),Re([t.Property(!1)],d.prototype,"enableHtmlSanitizer",void 0),Re([t.Property(!1)],d.prototype,"enableInfiniteScrolling",void 0),Re([t.Complex({},ye)],d.prototype,"infiniteScrollSettings",void 0),Re([t.Property("All")],d.prototype,"columnQueryMode",void 0),Re([t.Property(!0)],d.prototype,"allowSelection",void 0),Re([t.Property(-1)],d.prototype,"selectedRowIndex",void 0),Re([t.Property(null)],d.prototype,"isRowSelectable",void 0),Re([t.Complex({},$)],d.prototype,"selectionSettings",void 0),Re([t.Property(!1)],d.prototype,"allowExcelExport",void 0),Re([t.Property(!1)],d.prototype,"allowPdfExport",void 0),Re([t.Property(!1)],d.prototype,"enableColumnSpan",void 0),Re([t.Property(!1)],d.prototype,"enableRowSpan",void 0),Re([t.Event()],d.prototype,"created",void 0),Re([t.Event()],d.prototype,"load",void 0),Re([t.Event()],d.prototype,"expanding",void 0),Re([t.Event()],d.prototype,"expanded",void 0),Re([t.Event()],d.prototype,"collapsing",void 0),Re([t.Event()],d.prototype,"collapsed",void 0),Re([t.Event()],d.prototype,"cellSave",void 0),Re([t.Event()],d.prototype,"cellSaved",void 0),Re([t.Event()],d.prototype,"actionBegin",void 0),Re([t.Event()],d.prototype,"actionComplete",void 0),Re([t.Event()],d.prototype,"beginEdit",void 0),Re([t.Event()],d.prototype,"batchAdd",void 0),Re([t.Event()],d.prototype,"batchDelete",void 0),Re([t.Event()],d.prototype,"batchCancel",void 0),Re([t.Event()],d.prototype,"beforeBatchAdd",void 0),Re([t.Event()],d.prototype,"beforeBatchDelete",void 0),Re([t.Event()],d.prototype,"beforeBatchSave",void 0),Re([t.Event()],d.prototype,"cellEdit",void 0),Re([t.Event()],d.prototype,"actionFailure",void 0),Re([t.Event()],d.prototype,"dataBound",void 0),Re([t.Event()],d.prototype,"dataSourceChanged",void 0),Re([t.Event()],d.prototype,"dataStateChange",void 0),Re([t.Event()],d.prototype,"recordDoubleClick",void 0),Re([t.Event()],d.prototype,"rowDataBound",void 0),Re([t.Event()],d.prototype,"detailDataBound",void 0),Re([t.Event()],d.prototype,"queryCellInfo",void 0),Re([t.Event()],d.prototype,"rowSelecting",void 0),Re([t.Event()],d.prototype,"rowSelected",void 0),Re([t.Event()],d.prototype,"rowDeselecting",void 0),Re([t.Event()],d.prototype,"rowDeselected",void 0),Re([t.Event()],d.prototype,"headerCellInfo",void 0),Re([t.Event()],d.prototype,"cellSelecting",void 0),Re([t.Event()],d.prototype,"columnMenuOpen",void 0),Re([t.Event()],d.prototype,"columnMenuClick",void 0),Re([t.Event()],d.prototype,"cellSelected",void 0),Re([t.Event()],d.prototype,"cellDeselecting",void 0),Re([t.Event()],d.prototype,"cellDeselected",void 0),Re([t.Event()],d.prototype,"resizeStart",void 0),Re([t.Event()],d.prototype,"resizing",void 0),Re([t.Event()],d.prototype,"resizeStop",void 0),Re([t.Event()],d.prototype,"columnDragStart",void 0),Re([t.Event()],d.prototype,"columnDrag",void 0),Re([t.Event()],d.prototype,"columnDrop",void 0),Re([t.Event()],d.prototype,"checkboxChange",void 0),Re([t.Event()],d.prototype,"printComplete",void 0),Re([t.Event()],d.prototype,"beforePrint",void 0),Re([t.Event()],d.prototype,"toolbarClick",void 0),Re([t.Event()],d.prototype,"beforeDataBound",void 0),Re([t.Event()],d.prototype,"contextMenuOpen",void 0),Re([t.Event()],d.prototype,"contextMenuClick",void 0),Re([t.Event()],d.prototype,"beforeCopy",void 0),Re([t.Event()],d.prototype,"beforePaste",void 0),Re([t.Event()],d.prototype,"rowDrag",void 0),Re([t.Event()],d.prototype,"rowDragStart",void 0),Re([t.Event()],d.prototype,"rowDragStartHelper",void 0),Re([t.Event()],d.prototype,"rowDrop",void 0),Re([t.Event()],d.prototype,"pdfQueryCellInfo",void 0),Re([t.Event()],d.prototype,"pdfHeaderQueryCellInfo",void 0),Re([t.Event()],d.prototype,"excelQueryCellInfo",void 0),Re([t.Event()],d.prototype,"pdfAggregateQueryCellInfo",void 0),Re([t.Event()],d.prototype,"excelAggregateQueryCellInfo",void 0),Re([t.Event()],d.prototype,"excelHeaderQueryCellInfo",void 0),Re([t.Event()],d.prototype,"beforeExcelExport",void 0),Re([t.Event()],d.prototype,"excelExportComplete",void 0),Re([t.Event()],d.prototype,"beforePdfExport",void 0),Re([t.Event()],d.prototype,"pdfExportComplete",void 0),d=l=Re([t.NotifyPropertyChanges],d)}(t.Component),Ce=function(){function e(e){i.Grid.Inject(i.Reorder),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()},e}(),be=function(){function e(e){i.Grid.Inject(i.Resize),this.parent=e}return e.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},e.prototype.getModuleName=function(){return"resize"},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()},e}(),De=function(){function e(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,i.Grid.Inject(i.RowDD),this.parent=e,this.addEventListener()}return e.prototype.getChildrecordsByParentID=function(e){return(this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource).filter(function(t){return t.uniqueID===e})},e.prototype.addEventListener=function(){this.parent.on("row-draging",this.Rowdraging,this),this.parent.on("row-dropped",this.rowDropped,this),this.parent.on("rows-add",this.rowsAdded,this),this.parent.on("rows-remove",this.rowsRemoved,this)},e.prototype.reorderRows=function(e,i,r){var n=this.parent;if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){"above"===r&&(this.dropPosition="topSegment"),"below"===r&&(this.dropPosition="bottomSegment"),"child"===r&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var o=[],a=0;a<e.length;a++){l=this.parent.getRowByIndex(e[parseInt(a.toString(),10)]).rowIndex;o[parseInt(a.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(l.toString(),10)]}var d={data:o,dropIndex:i};if(s(this.parent)||this.dropRows(d,!0),n.isLocalData&&(n.flatData=this.orderToIndex(n.flatData)),"outdenting"===this.parent.action&&(t.isNullOrUndefined(o[0].parentItem)||(o[0].level=o[0].parentItem.level+1)),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition){var l=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent.action?this.parent.treeColumnIndex:void 0,p=this.parent.getRows()[e[0]],h=d.data[0],c=[];(y=[]).push(h),c.push(p);var u=m(this.parent,d.data[0].parentUniqueID),g=this.parent.getRows()[parseInt(i.toString(),10)];y.push(u),c.push(g),this.updateRowAndCellElements(y,c,l)}if(this.parent.enableImmutableMode&&"outdenting"===this.parent.action){var l=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent.action?this.parent.treeColumnIndex:void 0,f=d.data[0],p=this.parent.getRows()[e[0]],y=[],c=[];y.push(f),c.push(p),this.updateRowAndCellElements(y,c,l)}}}},e.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.parent.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},e.prototype.indentOutdentAction=function(e,i){var r=this.parent,n=-1;if(!t.isNullOrUndefined(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),this.selectedItem=t.isNullOrUndefined(e)?r.getCurrentViewRecords()[parseInt(n.toString(),10)]:e;var o=this.parent.getPrimaryKeyFieldNames()[0];if(o){var a=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+o]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==n?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(a),this.selectedRecord=this.parent[this.selectedRecords]=-1!==n?r.getCurrentViewRecords()[parseInt(n.toString(),10)]:this.selectedItem,"indent"===i){var s=r.getCurrentViewRecords()[this.selectedRow.rowIndex-1],d=void 0;if(0===this.selectedRow.rowIndex||-1===this.selectedRow.rowIndex||r.getCurrentViewRecords()[this.selectedRow.rowIndex].level-s.level==1)return;if(s.level>this.selectedRecord.level)for(var l=0;l<r.getCurrentViewRecords().length;l++)r.getCurrentViewRecords()[parseInt(l.toString(),10)].taskData===s.parentItem.taskData&&(d=l,r.enableVirtualization&&(d=parseInt(r.getRows()[parseInt(l.toString(),10)].getAttribute("aria-rowindex"),10)-1));else d=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||s.level>this.selectedRecord.level||(d=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),r.action="indenting",r.dropIndex=d,this.eventTrigger("indenting",d)}else if("outdent"===i){var p=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,h=0===r.getCurrentViewRecords()[this.selectedRow.rowIndex].level;if(p||h)return;var c=this.selectedRecord.parentItem;if(-1===(d=r.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===c.uniqueID})))return;if(this.parent.enableVirtualization&&this.selectedRecord){var u=this.parent.getRows()[parseInt(d.toString(),10)].getAttribute("aria-rowindex");d=parseInt(u,10)-1}r.action="outdenting",r.dropIndex=d,this.eventTrigger("outdenting",d)}}}},e.prototype.eventTrigger=function(e,t){var i=this,r={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger("actionBegin",r,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},e.prototype.orderToIndex=function(e){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].index=i,!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)){var r=t.getValue("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent);e[parseInt(i.toString(),10)].parentItem.index=r.index}return e},e.prototype.rowsAdded=function(e){for(var i,r=e.records,o=e.records.length-1;o>-1;o--)if((i=r[parseInt(o.toString(),10)]).parentUniqueID){var a=r.filter(function(e){return e.uniqueID===i.parentUniqueID});if(a.length){var s=a[0].childRecords.indexOf(i),d=a[0];-1!==s&&(t.isNullOrUndefined(this.parent.idMapping)&&(d.childRecords.splice(s,1),d.childRecords.length||(d.hasChildRecords=!1,d.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0)}}if(t.isNullOrUndefined(this.parent.dataSource)||!this.parent.dataSource.length){for(var l,p=this.parent,h=e.records,o=e.records.length-1;o>-1;o--){l=h[parseInt(o.toString(),10)],!o&&l.hasChildRecords&&(l.taskData[this.parent.parentIdMapping]=null);if(t.isNullOrUndefined(p.parentIdMapping)||(p.childMapping=null),t.isNullOrUndefined(l.taskData)||t.isNullOrUndefined(p.childMapping)||Object.prototype.hasOwnProperty.call(l.taskData,p.childMapping)||(l.taskData[p.childMapping]=[]),!t.isNullOrUndefined(l[p.childMapping])&&Object.prototype.hasOwnProperty.call(l,p.childMapping)&&l[p.childMapping].length&&!this.isDraggedWithChild&&!t.isNullOrUndefined(p.parentIdMapping))for(var c=l[p.childMapping],u=0;u<c.length;u++)-1===h.indexOf(c[parseInt(u.toString(),10)])&&(h.splice(u,0,c[parseInt(u.toString(),10)]),c[parseInt(u.toString(),10)].taskData=t.extend({},c[parseInt(u.toString(),10)]),o+=1);Object.prototype.hasOwnProperty.call(l,p.parentIdMapping)&&null!==l[p.parentIdMapping]&&!this.isDraggedWithChild&&(l.taskData[p.parentIdMapping]=null,delete l.parentItem,delete l.parentUniqueID),t.isNullOrUndefined(p.dataSource)&&(p.dataSource=[]),p.dataSource.splice(0,0,l.taskData)}p.setProperties({dataSource:p.dataSource},!1)}else{for(o=0;o<r.length;o++)t.setValue("uniqueIDCollection."+r[parseInt(o.toString(),10)].uniqueID,r[parseInt(o.toString(),10)],this.parent);var g={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof n.DataManager?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),t.isNullOrUndefined(this.dropPosition)&&(this.dropPosition="bottomSegment",g.dropIndex=this.parent.getCurrentViewRecords().length>1?this.parent.getCurrentViewRecords().length-1:g.dropIndex,g.data=g.data.map(function(e){return e.hasChildRecords&&t.isNullOrUndefined(e.parentItem)?(e.level=0,e):(delete e.parentItem,delete e.parentUniqueID,e.level=0,e)})),this.dropRows(g)}},e.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},e.prototype.refreshGridDataSource=function(){var e,i,r=this.draggedRecord,o=this.droppedRecord,a=this.parent;if(!(e=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?a.dataSource.dataSource.json:a.dataSource)||t.isNullOrUndefined(o)||o.parentItem||t.isNullOrUndefined(o.taskData)){if(!this.parent.parentIdMapping&&!t.isNullOrUndefined(o)&&o.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition))for(var s=this.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,d=0;d<s.length;d++)o.parentItem.taskData[this.parent.childMapping][parseInt(d.toString(),10)]=s[parseInt(d.toString(),10)].taskData}else{for(var l=Object.keys(e),d=0;d<l.length;d++)if(e[parseInt(d.toString(),10)][this.parent.childMapping])e[parseInt(d.toString(),10)][this.parent.childMapping]===o.taskData[this.parent.childMapping]&&(i=d);else{var p=this.parent.getPrimaryKeyFieldNames()[0];e[parseInt(d.toString(),10)][""+p]===o.taskData[""+p]&&(i=d)}if(!this.parent.idMapping){var h="topSegment"===this.dropPosition?0:1;"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||e.splice(i+h,0,r.taskData)}}this.parent.parentIdMapping&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.parentIdMapping]=o[this.parent.parentIdMapping],r.taskData[this.parent.parentIdMapping]=o[this.parent.parentIdMapping]):(r[this.parent.parentIdMapping]=o[this.parent.idMapping],r.taskData[this.parent.parentIdMapping]=o[this.parent.idMapping]):(r.taskData[this.parent.parentIdMapping]=null,r[this.parent.parentIdMapping]=null))},e.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;this.parent.element.getElementsByClassName("e-firstrow-border").length>0&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},e.prototype.removeLastrowBorder=function(e){if(e&&!(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"))){var t=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,i=this.parent.element.getElementsByClassName("e-lastrow-border")[0];i&&t&&i.remove()}},e.prototype.updateIcon=function(e,r,n){var o=n.target?t.closest(n.target,"tr"):null;this.dropPosition=void 0;var a=0;this.removeFirstrowBorder(o),this.removeLastrowBorder(o);for(var s=0;s<n.rows.length;s++)(t.isNullOrUndefined(o)||o.getAttribute("data-uid")!==n.rows[parseInt(s.toString(),10)].getAttribute("data-uid"))&&i.parentsUntil(n.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),t.isNullOrUndefined(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var d=this.parent,l=0,p=d.toolbar&&d.toolbar.length?document.getElementById(d.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(d.element),c=d.getHeaderContent().offsetHeight+h.top+p,u=d.getContent().firstElementChild.scrollTop;t.isNullOrUndefined(o)||(a=o.offsetTop-u),l=this.parent.enableVirtualization?o.getBoundingClientRect().top:a+c+0;var g=((0!==e[0].offsetHeight&&t.isNullOrUndefined(o)?l+e[0].offsetHeight:l+o.offsetHeight)-l)/3,f=l+g,m=f+g,y=m+g,S=i.getObject("originalEvent.event",n),v=i.getObject("originalEvent.event",n),w="mousemove"===S.type?S.pageY:t.isNullOrUndefined(v)||t.isNullOrUndefined(v.changedTouches)?null:v.changedTouches[0].pageY;this.parent.enableVirtualization&&(w="mousemove"===S.type?S.clientY:t.isNullOrUndefined(v)||t.isNullOrUndefined(v.changedTouches)?null:v.changedTouches[0].clientY);var I=w<=f,R=w>f&&w<=m,x=w>m&&w<=y,C=!0;if(I||R||x)if(I&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(o),this.removeErrorElem(),this.removeLastrowBorder(o)),R&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(o),this.addFirstrowBorder(o)),x&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(o),this.removeFirstrowBorder(o)),(I||x)&&"Invalid"!==this.dropPosition)C=this.updateBorderStatus(e,r),this.topOrBottomBorder(n.target,C);else if(R&&"Invalid"!==this.dropPosition){var b=[],D=t.closest(n.target,"tr");b=[].slice.call(D.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),C=this.updateBorderStatus(e,r),b.length>0&&C&&this.addRemoveClasses(b,!0,"e-childborder")}return this.dropPosition},e.prototype.updateBorderStatus=function(e,i){var r=this,n=!0,o=this.parent.grid.getRows(),a=[],s=!1;t.isNullOrUndefined(this.parent.detailTemplate)||(o=this.parent.getDataRows(),s=!0);var d=this.parent.treeColumnIndex,l=this.parent.allowRowDragAndDrop?s?d+2:d+1:s?d+1:d;t.isNullOrUndefined(this.parent.rowDropSettings.targetID)||(l=d);var p=e,h=[o[""+i]];return"topSegment"===this.dropPosition&&(e.filter(function(r){if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.cells)||t.isNullOrUndefined(h[0])||t.isNullOrUndefined(h[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null===r||void 0===r?void 0:r.cells[""+l].className.match(s),c=h[0].cells[""+l].className.match(s);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c)||t.isNullOrUndefined(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var m=0;m<o.length;m++)if(o[parseInt(m.toString(),10)]===p[0]&&(f=!0),f&&o[parseInt(m.toString(),10)]!==p[0]){var y=+o[parseInt(m.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(y!==u&&y>u))break;a.push(o[parseInt(m.toString(),10)])}return u===g&&(a.length>0&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-(a.length+1)||0===a.length&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1)&&(n=!1),!0}),n=!(!t.isNullOrUndefined(e)&&0===a.length&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1&&t.isNullOrUndefined(e[0]))&&n),"bottomSegment"===this.dropPosition&&(h.filter(function(r){if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.cells)||t.isNullOrUndefined(p[0])||t.isNullOrUndefined(p[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null===r||void 0===r?void 0:r.cells[""+l].className.match(s),c=p[0].cells[""+l].className.match(s);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var m=0;m<o.length;m++)if(o[parseInt(m.toString(),10)]===h[0]&&(f=!0),f&&o[parseInt(m.toString(),10)]!==h[0]){var y=+o[parseInt(m.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(y!==u&&y>u))break;a.push(o[parseInt(m.toString(),10)])}return!t.isNullOrUndefined(e)&&u===g&&(a.length>0&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+(a.length+1)||0===a.length&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1)&&(n=!1),!0}),n=!(!t.isNullOrUndefined(e)&&0===a.length&&!t.isNullOrUndefined(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1&&t.isNullOrUndefined(e[0]))&&n),"middleSegment"===this.dropPosition&&h.filter(function(e){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(e.cells)||t.isNullOrUndefined(p[0])||t.isNullOrUndefined(p[0].cells))return!0;for(var i=0;i<p.length;i++){var o=h[0].rowIndex,a=p[parseInt(i.toString(),10)].cells[""+l].className.match(/index(\d+)|level(\d+)/g);if(!a)return!0;var d=parseInt(a.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(s&&(o/=2),d!==o||r.parent.rowDropSettings.targetID){n=!0;break}n=!1}return n||(r.dropPosition="Invalid",r.addErrorElem()),n}),this.canDrop=n,n},e.prototype.removeChildBorder=function(){var e=[];(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length>0&&this.addRemoveClasses(e,!1,"e-childborder")},e.prototype.addFirstrowBorder=function(e){var i=this.parent.element,r=this.parent;if(e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")){var n=this.parent.createElement("div",{className:"e-firstrow-border"}),o=this.parent.getHeaderContent(),a=0;r.toolbar&&(a=r.toolbarModule.getToolbar().offsetHeight);var s=!t.isNullOrUndefined(this.parent.rowDropSettings.targetID);s&&(n.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+a+"px"),n.style.width=s?i.offsetWidth+"px":i.offsetWidth-this.getScrollWidth()+"px",o.querySelectorAll(".e-firstrow-border").length||o.appendChild(n)}},e.prototype.addLastRowborder=function(e){if(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));if(!t&&e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")){var i=this.parent.createElement("div",{className:"e-lastrow-border"}),r=this.parent.getContent();i.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",r.querySelectorAll(".e-lastrow-border").length||(r.classList.add("e-treegrid-relative"),r.appendChild(i),i.style.bottom=this.getScrollWidth()+"px")}}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?i.Scroll.getScrollBarWidth():0},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-cloneproperties")[0];if(!e.querySelectorAll(".e-errorelem").length&&!this.parent.rowDropSettings.targetID){var t=document.createElement("div");t.classList.add("e-errorcontainer","e-icons","e-errorelem");var i=e.querySelector(".e-rowcell"),r=e.querySelector(".errorValue"),n=i.innerHTML;r&&(n=this.parent.sanitize(r.innerHTML),r.parentNode.removeChild(r)),i.innerHTML="";var o=document.createElement("span");o.className="errorValue",o.style.paddingLeft="16px",o.innerHTML=this.parent.sanitize(n),i.appendChild(t),i.appendChild(o);var a=document.querySelector(".e-dropitemscount");if(this.hasDropItem&&a){var s=parseInt(a.style.left,10)+t.offsetWidth+16,d=this.parent.enableRtl?0:s;a.style.left=d+"px",this.hasDropItem=!1}}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");if(e){if(r){var n=parseInt(r.style.left,10)-e.offsetWidth-16;t.setStyleAttribute(i,{paddingLeft:"0px"}),this.parent.enableRtl||t.setStyleAttribute(r,{left:n+"px"})}e.remove()}this.hasDropItem=!0},e.prototype.topOrBottomBorder=function(e,i){void 0===i&&(i=!0);var r=t.closest(e,"tr"),n=r?Array.from(r.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];if(n.length){var o=i?this.addRemoveClasses.bind(this,n,!0):this.addRemoveClasses.bind(this,n,!1,"e-dragborder");if("topSegment"===this.dropPosition){o("e-droptop");var a=this.parent.element.querySelector(".e-lastrow-dragborder");a&&a.remove()}"bottomSegment"===this.dropPosition&&o("e-dropbottom")}},e.prototype.removetopOrBottomBorder=function(){var e=[];e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop")),this.parent.rowDropSettings.targetID&&(e=[].slice.call(document.querySelectorAll(".e-dropbottom, .e-droptop"))),e.length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},e.prototype.addRemoveClasses=function(e,t,i){for(var r=0,n=e.length;r<n;r++)t?e[parseInt(r.toString(),10)].classList.add(i):e[parseInt(r.toString(),10)].classList.remove(i)},e.prototype.getOffset=function(e){var t=e.getBoundingClientRect(),i=document.body,r=document.documentElement,n=window.pageYOffset||r.scrollTop||i.scrollTop,o=window.pageXOffset||r.scrollLeft||i.scrollLeft,a=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,d=t.top+n-a,l=t.left+o-s;return{top:Math.round(d),left:Math.round(l)}},e.prototype.Rowdraging=function(e){var r=this.parent,n=this.parent.element.querySelector(".e-cloneproperties");if(n){n.style.cursor="";var o=e.target?t.closest(e.target,"tr"):null,a=-1;if(-1===(a=t.isNullOrUndefined(this.parent.detailTemplate)?o?o.rowIndex:-1:o?this.parent.getDataRows().indexOf(o):-1))return this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),void this.removeChildBorder();var s=Array.isArray(e.data)?e.data:[e.data],d=r.getCurrentViewRecords()[parseInt(a.toString(),10)];if(r.rowDropSettings.targetID&&(p=i.parentsUntil(e.target,"e-treegrid"))&&p.id===this.parent.rowDropSettings.targetID&&(d=(l=p.ej2_instances[0]).getCurrentViewRecords()[parseInt(a.toString(),10)]),this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(s,d),r.rowDropSettings.targetID||!this.canDrop||t.isNullOrUndefined(e.rows[0])||r.rowDragAndDropModule.updateIcon(e.rows,a,e),r.rowDropSettings.targetID&&(p=i.parentsUntil(e.target,"e-treegrid"))&&p.id===this.parent.rowDropSettings.targetID){var l=p.ej2_instances[0];l.rowDragAndDropModule.updateIcon(e.rows,a,e),this.dropPosition=l.rowDragAndDropModule.dropPosition}if(e.target&&t.closest(e.target,"#"+r.rowDropSettings.targetID)){var p=i.parentsUntil(e.target,"e-treegrid");p||(n.style.cursor="default")}}},e.prototype.rowDropped=function(e){var r=this.parent;if(r.rowDropSettings.targetID){if((e.target&&t.closest(e.target,"#"+r.rowDropSettings.targetID)||i.parentsUntil(e.target,"e-treegrid")&&i.parentsUntil(e.target,"e-treegrid").id===r.rowDropSettings.targetID||e.target&&document.getElementById(r.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),t.setValue("dropPosition",this.dropPosition,e),r.trigger("rowDrop",e),!e.cancel&&r.rowDropSettings.targetID)){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),r.isLocalData&&(r.flatData=this.orderToIndex(r.flatData))}}else if((i.parentsUntil(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),t.setValue("dropPosition",this.dropPosition,e),r.trigger("rowDrop",e),!e.cancel)){if(!s(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;s(this.parent)||this.dropRows(e),r.isLocalData&&(r.flatData=this.orderToIndex(r.flatData)),r.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!t.isNullOrUndefined(e.data[0].parentItem)){var n=this.parent.treeColumnIndex;n+=1;var o=this.parent.getPrimaryKeyFieldNames()[0],a=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+o]),d=this.parent.getRows()[parseInt(a.toString(),10)],l=e.data[0];if("middleSegment"===this.dropPosition){var p=[],h=[];p.push(l),h.push(d);l=m(this.parent,e.data[0].parentUniqueID),a=this.parent.grid.getRowIndexByPrimaryKey(l[""+o]);var c=this.parent.getRows()[parseInt(a.toString(),10)];p.push(l),h.push(c);for(var u=0;u<p.length;u++)this.parent.renderModule.cellRender({data:p[parseInt(u.toString(),10)],cell:h[parseInt(u.toString(),10)].cells[parseInt(n.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});var g=c.getElementsByClassName("e-treegridcollapse")[0];t.isNullOrUndefined(g)||(t.removeClass([g],"e-treegridcollapse"),t.addClass([g],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:l,cell:d.cells[parseInt(n.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},e.prototype.removeRowBorders=function(){var e=this;["e-firstrow-border","e-lastrow-border"].forEach(function(t){var i=e.parent.element.getElementsByClassName(t)[0];i&&i.remove()})},e.prototype.dragDropGrid=function(e){var r,n=this.parent,o=t.closest(e.target,"tr"),d=isNaN(this.getTargetIdx(o))?0:this.getTargetIdx(o),l=i.parentsUntil(e.target,"e-treegrid");if(l&&l.id===this.parent.rowDropSettings.targetID&&!a(this.parent)&&!s(this.parent)){r=l.ej2_instances[0];for(var p=n.getSelectedRecords(),h=[],u=0;u<p.length;u++)h[parseInt(u.toString(),10)]=p[parseInt(u.toString(),10)].index;var g=r.dataSource;if(null!==this.parent.idMapping&&(t.isNullOrUndefined(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!g.length){for(var f=[],u=0;u<p.length;u++)if(p[parseInt(u.toString(),10)].hasChildRecords){f.push(p[parseInt(u.toString(),10)]);for(var m=c(p[parseInt(u.toString(),10)]),y=0;y<m.length;y++)f.push(m[parseInt(y.toString(),10)])}f.length&&(p=f)}n.notify("rows-remove",{indexes:h,records:p}),r.notify("rows-add",{toIndex:d,records:p});var S=r.rowDragAndDropModule.treeGridData;if(!t.isNullOrUndefined(S))for(u=0;u<S.length;u++)if(S[parseInt(u.toString(),10)].index=u,!t.isNullOrUndefined(S[parseInt(u.toString(),10)].parentItem)){var v=t.getValue("uniqueIDCollection."+S[parseInt(u.toString(),10)].parentUniqueID+".index",r);S[parseInt(u.toString(),10)].parentItem.index=v}n.grid.refresh(),r.grid.refresh(),r.grid.dataSource.length>1&&(r.grid.refresh(),t.isNullOrUndefined(r.getHeaderContent().querySelector(".e-firstrow-border"))||r.getHeaderContent().querySelector(".e-firstrow-border").remove(),t.isNullOrUndefined(r.getContent().querySelector(".e-lastrow-border"))||r.getContent().querySelector(".e-lastrow-border").remove())}s(this.parent)&&(r=l.ej2_instances[0],n.grid.refresh(),r.grid.refresh())},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},e.prototype.getParentData=function(e,t){var i=e.parentItem,r=-1;if(this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?r=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(r=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition){var n=this.parent.getPrimaryKeyFieldNames()[0],o=-1===r?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+n]):this.parent.getSelectedRowIndexes()[0],a=this.parent.getCurrentViewRecords()[parseInt(o.toString(),10)];this.droppedRecord=m(this.parent,a.parentItem.uniqueID)}"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===i.level?this.droppedRecord=m(this.parent,i.uniqueID):this.getParentData(i))},e.prototype.dropRows=function(e,i){if("Invalid"!==this.dropPosition&&!a(this.parent)){var r,n=this.parent,o=void 0;if(t.isNullOrUndefined(e.dropIndex)){var s=this.parent.getPrimaryKeyFieldNames()[0],d=-1===n.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+s])-1:n.getSelectedRowIndexes()[0]-1,l=n.getCurrentViewRecords()[parseInt(d.toString(),10)];this.getParentData(l,e.data)}else if(e.dropIndex=e.dropIndex===e.fromIndex?this.getTargetIdx(e.target.parentElement):e.dropIndex,this.parent.enableVirtualization){var p=this.parent.getRowByIndex(e.dropIndex).rowIndex;this.droppedRecord=n.getCurrentViewRecords()[parseInt(p.toString(),10)]}else if(t.isNullOrUndefined(this.parent.rowDropSettings.targetID))this.droppedRecord=n.getCurrentViewRecords()[e.dropIndex];else{var h=this.parent.grid.getRowsObject();this.droppedRecord=h.length>0?h[e.dropIndex].data:void 0}var c=[];o=this.droppedRecord,e.data[0]?c=e.data:c.push(e.data),this.parent[this.modifiedRecords].push(e.data[0],o);var u=0,g=this.parent.rowDropSettings.targetID;this.isMultipleGrid=g,g?this.isaddtoBottom=g&&this.isDraggedWithChild:this.ensuredropPosition(c,o);var f=c.length;(!t.isNullOrUndefined(this.parent.idMapping)||"bottomSegment"===this.dropPosition&&c.length>1&&t.isNullOrUndefined(this.parent.idMapping))&&c.reverse();for(var m=this,y=0;y<f;y++)!function(a){if(r=c[parseInt(a.toString(),10)],m.draggedRecord=r,!m.draggedRecord.hasChildRecords)for(var s=0,d=c;s<d.length;s++){var l=d[s];t.isNullOrUndefined(l.childRecords)||-1===l.childRecords.indexOf(m.draggedRecord)||(m.draggedRecord=void 0)}if(!t.isNullOrUndefined(m.draggedRecord)){if("Invalid"!==m.dropPosition&&!t.isNullOrUndefined(m.droppedRecord)){if(n.rowDropSettings.targetID&&!i||m.deleteDragRow(),m.draggedRecord===m.droppedRecord){var p=m.getTargetIdx(e.target.offsetParent.parentElement);isNaN(p)&&(p=m.getTargetIdx(e.target.parentElement)),e.dropIndex=p,o=m.droppedRecord=m.parent.getCurrentViewRecords()[e.dropIndex]}(o.parentItem||"middleSegment"===m.dropPosition)&&-1!==(S=(y=n.parentData).indexOf(m.draggedRecord))&&y.splice(S,1);var h=m.treeGridData.indexOf(o);if(m.dropAtTop(h),"bottomSegment"===m.dropPosition){if(o.hasChildRecords?(u=m.getChildCount(o,0),m.parent.parentIdMapping&&m.treeData.splice(h+u+1,0,m.draggedRecord.taskData),m.treeGridData.splice(h+u+1,0,m.draggedRecord)):(m.parent.parentIdMapping&&m.treeData.splice(h+1,0,m.draggedRecord.taskData),m.treeGridData.splice(h+1,0,m.draggedRecord)),t.isNullOrUndefined(o.parentItem)&&(delete r.parentItem,delete r.parentUniqueID,r.level=0,m.parent.parentIdMapping&&(r[m.parent.parentIdMapping]=null)),o.parentItem){var g=m.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,f=g.indexOf(o)+1;g.splice(f,0,r),r.parentItem=o.parentItem,r.parentUniqueID=o.parentUniqueID,r.level=o.level,m.parent.parentIdMapping&&(r[m.parent.parentIdMapping]=o[m.parent.parentIdMapping],r.parentItem=o.parentItem,r.level=o.level)}if(r.hasChildRecords){m.updateChildRecordLevel(r,1),m.updateChildRecord(r,h+u+1)}}m.dropMiddle(h)}if(t.isNullOrUndefined(r.parentItem)){var y=n.parentData,S=y.indexOf(m.droppedRecord),v=0;y.filter(function(e){r.uniqueID===e.uniqueID&&v++}),"bottomSegment"===m.dropPosition&&0===v?y.splice(S+1,0,r):"topSegment"===m.dropPosition&&0===v&&y.splice(S,0,r)}n.rowDragAndDropModule.refreshGridDataSource()}}(y)}},e.prototype.dropMiddle=function(e){var i=this.parent,r=c(this.droppedRecord),n=t.isNullOrUndefined(r)||0===r.length?e+1:r.length+e+1;"middleSegment"===this.dropPosition&&(i.parentIdMapping?(this.treeData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord)):this.treeGridData.splice(n,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n))},e.prototype.dropAtTop=function(e){var t=this.parent;if("topSegment"===this.dropPosition){t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData);var i=this.treeGridData[parseInt(e.toString(),10)];if(this.draggedRecord.parentItem=i.parentItem,this.draggedRecord.parentUniqueID=i.parentUniqueID,this.draggedRecord.level=i.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords){this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)}if(this.droppedRecord.parentItem){var r=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords,n=r.indexOf(this.droppedRecord);r.splice(n,0,this.draggedRecord)}}},e.prototype.recordLevel=function(){var e=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=e.childMapping;if(r.hasChildRecords||(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,(t.isNullOrUndefined(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!e.parentIdMapping&&t.isNullOrUndefined(r.taskData[""+n])&&(r.taskData[""+n]=[]))),"middleSegment"===this.dropPosition){var o=t.extend({},r);delete o.childRecords,i.parentItem=o,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i),t.setValue("uniqueIDCollection."+i.uniqueID,i,e);if(e.isSelfReference&&(r[e.childMapping]=[],r[e.childMapping].splice(r[e.childMapping].length,0,i)),t.isNullOrUndefined(i)||e.parentIdMapping||t.isNullOrUndefined(r.taskData[""+n])||r.taskData[e.childMapping].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords){i.level=r.level+1,this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof n.DataManager&&u(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=m(this.parent,this.draggedRecord.uniqueID);!t.isNullOrUndefined(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},e.prototype.updateChildRecord=function(e,i){var r,n=this.parent,o=0;if(!e.hasChildRecords)return 0;o=e.childRecords.length;for(var a=0;a<o;a++)r=this.isMultipleGrid?e.childRecords[parseInt(a.toString(),10)]:t.getValue("uniqueIDCollection."+e.childRecords[parseInt(a.toString(),10)].uniqueID,n),i++,n.flatData.splice(i,0,r),t.setValue("uniqueIDCollection."+r.uniqueID,r,this.parent),n.parentIdMapping&&this.treeData.splice(i,0,r.taskData),r.hasChildRecords&&(i=this.updateChildRecord(r,i));return i},e.prototype.updateChildRecordLevel=function(e,i){var r,n=0;if(i++,!e.hasChildRecords)return 0;n=e.childRecords.length;for(var o=0;o<n;o++){r=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:t.getValue("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,this.parent);var a=void 0;e.parentItem&&(a=m(this.parent,e.parentItem.uniqueID)),t.isNullOrUndefined(a)&&!t.isNullOrUndefined(e.parentItem)&&(a=e.parentItem),r.level=e.parentItem?a.level+i:e.level+1,r.hasChildRecords&&(i--,i=this.updateChildRecordLevel(r,i))}return i},e.prototype.removeRecords=function(e){var i,r=this,o=this.parent;i=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;var a=e,s=!t.isNullOrUndefined(o.parentIdMapping),d=this.getChildrecordsByParentID(a.parentUniqueID)[0];if(a){if(a.parentItem){var l=d?d.childRecords:[],p=0;l&&l.length>0&&(p=l.indexOf(a),d.childRecords.splice(p,1),this.parent.parentIdMapping&&!o.enableImmutableMode||S({value:a,action:"delete"},this.parent,s,a.index,a.index))}if(o.parentIdMapping){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);var h=i.findIndex(function(e){return e[r.parent.idMapping]===a.taskData[r.parent.idMapping]}),c=this.treeGridData.findIndex(function(e){return e[r.parent.idMapping]===a.taskData[r.parent.idMapping]});-1===h||t.isNullOrUndefined(h)||i.splice(h,1),-1===c||t.isNullOrUndefined(c)||this.treeGridData.splice(c,1)}var g=this.treeGridData.indexOf(a);if(!o.parentIdMapping){var f=this.parent.parentData.indexOf(a);-1!==f&&(o.parentData.splice(f,1),i.splice(f,1))}if(-1===g&&!o.parentIdMapping)for(var m=o.getPrimaryKeyFieldNames()[0],y=0;y<this.treeGridData.length;y++)this.treeGridData[parseInt(y.toString(),10)][""+m]===a[""+m]&&(g=y);if(!o.parentIdMapping){var v=this.getChildCount(a,0);this.treeGridData.splice(g,v+1)}a.parentItem&&d&&d.childRecords&&!d.childRecords.length&&(d.expanded=!1,d.hasChildRecords=!1,d.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(d)||t.isNullOrUndefined(d)||this.parent[this.modifiedRecords].push(d),t.isNullOrUndefined(d)||this.updateModifiedRecords(d)}},e.prototype.updateModifiedRecords=function(e){var i=m(this.parent,e.parentUniqueID);t.isNullOrUndefined(i)||(this.parent[this.modifiedRecords].push(i),this.updateModifiedRecords(i))},e.prototype.removeChildItem=function(e){var i,r,o,a;a=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var s=0;s<e.childRecords.length;s++){i=e.childRecords[parseInt(s.toString(),10)],!t.isNullOrUndefined(i.childRecords)&&i.childRecords.length&&(i.hasChildRecords=!0);var d=void 0;d=this.parent.dataSource instanceof n.DataManager&&u(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var l=0;l<d.length;l++)d[parseInt(l.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]&&(r=l);for(var p=0;p<this.treeGridData.length;p++)if(this.treeGridData[parseInt(p.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]){o=p;break}-1===r||t.isNullOrUndefined(r)||a.splice(r,1),-1===o||t.isNullOrUndefined(o)||this.treeGridData.splice(o,1),i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[parseInt(r.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.ensuredropPosition=function(e,i){var r=this;e.filter(function(e){if(e.hasChildRecords&&!t.isNullOrUndefined(e.childRecords)){if(-1!==e.childRecords.indexOf(i))return r.dropPosition="Invalid",r.addErrorElem(),r.canDrop=!1,void(t.isNullOrUndefined(r.parent.rowDropSettings.targetID)&&(r.removetopOrBottomBorder(),r.removeChildBorder()));r.ensuredropPosition(e.childRecords,i)}})},e.prototype.isDuplicateData=function(e){var t=this.parent.getPrimaryKeyFieldNames();return 0!==t.length&&this.parent.flatData.some(function(i){return t.every(function(t){return i[t]===e[t]})})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("row-draging",this.Rowdraging),this.parent.off("row-dropped",this.rowDropped),this.parent.off("rows-add",this.rowsAdded),this.parent.off("rows-remove",this.rowsRemoved))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e}(),Me=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oe=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Me(i,e),Oe([t.Property()],i.prototype,"targetID",void 0),i}(t.ChildProperty),Ae=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ee=function(e){function i(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return Ae(i,e),i.prototype.addEventListener=function(){this.parent.on("data-listener",this.getDatas,this)},i.prototype.getDatas=function(e){this.visualData=e.data},i.prototype.getDataInfo=function(){return e.prototype.getData.call(this)},i.prototype.generateRows=function(i,r){var o=this.getDataInfo();if("refresh"===r.requestType&&r.isExpandCollapse&&(r.virtualInfo=this.prevInfo),t.isNullOrUndefined(r.virtualInfo)||this.parent.root.loadChildOnDemand&&a(this.parent.root)||("right"!==r.virtualInfo.direction&&"left"!==r.virtualInfo.direction?a(this.parent.root)&&!s(this.parent)&&1!==r.virtualInfo.blockIndexes.length||(r.virtualInfo.blockIndexes=o.blockIndexes):r.virtualInfo.blockIndexes=this.getBlockIndexes(r.virtualInfo.page)),this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent))return e.prototype.generateRows.call(this,i,r);t.isNullOrUndefined(r.requestType)||"collapseAll"!==r.requestType.toString()||(r.requestType="refresh");var d=e.prototype.generateRows.call(this,i,r);if(!t.isNullOrUndefined(this.visualData))for(var l=0;l<d.length;l++)d[parseInt(l.toString(),10)].index=this.visualData.indexOf(d[parseInt(l.toString(),10)].data);return d},i.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(t){return e===t});if(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent)){var i=this.model.currentPage;t?(this.cache={},this.data={},this.groups={}):"virtualscroll"===e&&this.cache[parseInt(i.toString(),10)]&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&(this.cache[parseInt(i.toString(),10)]=this.cache[parseInt(i.toString(),10)].slice(0,this.parent.contentModule.getBlockSize()))}else(t||"virtualscroll"===e)&&(this.cache={},this.data={},this.groups={});return t},i}(i.VirtualRowModelGenerator),Ne=function(){function e(e){i.Grid.Inject(i.Filter),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},e.prototype.updatedFilteredRecord=function(e){t.setValue("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var r=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode,n=0;n<this.flatFilteredData.length;n++){var o=this.flatFilteredData[parseInt(n.toString(),10)];this.addParentRecord(o),"Child"!==r&&"None"!==r||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0);var a=i.getObject("childRecords",o);!t.isNullOrUndefined(a)&&a.length&&t.setValue("hasFilteredChildRecords",this.checkChildExsist(o),o);var s=i.getObject("parentItem",o);if(!t.isNullOrUndefined(s)){var d=m(this.parent,o.parentItem.uniqueID,!0);t.setValue("hasFilteredChildRecords",!0,d),d&&d.parentItem&&this.updateParentFilteredRecord(d)}}this.flatFilteredData.length>0&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},e.prototype.updateParentFilteredRecord=function(e){var i=m(this.parent,e.parentItem.uniqueID,!0),r=t.getValue("uniqueIDFilterCollection",this.parent);i&&Object.prototype.hasOwnProperty.call(r,i.uniqueID)&&t.setValue("hasFilteredChildRecords",!0,i),i&&i.parentItem&&this.updateParentFilteredRecord(i)},e.prototype.addParentRecord=function(e){var i=m(this.parent,e.parentUniqueID);if("None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)t.isNullOrUndefined(i)||("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key?this.addParentRecord(i):-1!==this.flatFilteredData.indexOf(i)&&this.addParentRecord(i)),-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent));else if(t.isNullOrUndefined(i)){if(-1!==this.flatFilteredData.indexOf(e))return void(-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0))}else this.addParentRecord(i),-1!==this.flatFilteredData.indexOf(i)||-1!==this.filteredResult.indexOf(i)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),t.setValue("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))},e.prototype.checkChildExsist=function(e){for(var r=i.getObject("childRecords",e),n=!1,o=0;o<r.length;o++){var a=r[parseInt(o.toString(),10)].childRecords,s=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;if(!("Child"!==s&&"Both"!==s||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)){var d=t.getValue("uniqueIDFilterCollection",this.parent);Object.prototype.hasOwnProperty.call(d,r[parseInt(o.toString(),10)].uniqueID)||(this.filteredResult.push(r[parseInt(o.toString(),10)]),t.setValue("uniqueIDFilterCollection."+r[parseInt(o.toString(),10)].uniqueID,r[parseInt(o.toString(),10)],this.parent),n=!0)}if("None"===s&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(r[parseInt(o.toString(),10)])){n=!0;break}!t.isNullOrUndefined(a)&&a.length&&(n=this.checkChildExsist(r[parseInt(o.toString(),10)])),"Child"!==s&&"Both"!==s||!r.length||(n=!0)}return n},e.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=m(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);if(-1!==e.indexOf(r)){var n=m(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0);e[parseInt(i.toString(),10)].filterLevel=n.filterLevel+1}else e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)])}},e.prototype.clearFilterLevel=function(e){var i,r=0,n=e.flatData,o=n.length;for(r;r<o;r++){var a=(i=n[parseInt(r.toString(),10)]).filterLevel;!a&&0!==a&&t.isNullOrUndefined(i.hasFilteredChildRecords)||(i.hasFilteredChildRecords=null,i.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:n,count:n.length})},e}(),Ue=function(){function e(e){this.isCollapsedStatePersist=!1,i.Grid.Inject(i.ExcelExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"ExcelExport"},e.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.on("excelAggregateCellInfo",this.excelAggregateCellInfo,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.off("excelAggregateCellInfo",this.excelAggregateCellInfo),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},e.prototype.updateExcelResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,r,o,a,s){var d=this,l=this.parent.dataSource,p=new i.Data(this.parent.grid),h=Object();if(t.setValue("isCsv",s,h),t.setValue("cancel",!1,h),t.isNullOrUndefined(e)||(this.isCollapsedStatePersist=e.isCollapsedStatePersist),!t.isNullOrUndefined(e)){if(!this.isLocal()&&!t.isNullOrUndefined(e.dataSource)&&!e.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,e,r,o,s,a);if("CurrentPage"===e.exportType)return e.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,e,r,o,s,a)}return new Promise(function(c){var u=!d.isLocal()||l instanceof n.DataManager?d.parent.dataSource:new n.DataManager(l),g=new n.Query;if(d.isLocal()||((g=d.generateQuery(g)).queries=d.parent.grid.getDataModule().generateQuery().queries,g=i.ExportHelper.getQuery(d.parent.grid,p),t.isNullOrUndefined(d.parent.filterModule)&&(g.queries=g.queries.slice(1,2),g.params=g.params.slice(0,0)),t.setValue("query",g,h)),d.parent.trigger("beforeExcelExport",t.extend(h,e)),i.getObject("cancel",h))return null;u.executeQuery(g).then(function(i){var n=null;return t.isNullOrUndefined(e)||t.isNullOrUndefined(e.dataSource)||(n=e.dataSource),e=d.manipulateExportProperties(e,l,i),d.parent.grid.excelExportModule.Map(d.parent.grid,e,r,o,s,a).then(function(t){null!=n?e.dataSource=n:delete e.dataSource,c(t)})})})},e.prototype.generateQuery=function(e,r){return!t.isNullOrUndefined(r)&&"CurrentPage"===r.exportType&&this.parent.allowPaging&&(r.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=i.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulateExportProperties=function(e,r,o){var a=Object();if(t.isNullOrUndefined(this.parent.grid.getDataModule())||t.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),a),t.setValue("isExport",!0,a),t.isNullOrUndefined(e)||t.isNullOrUndefined(e.exportType)||t.setValue("exportType",e.exportType,a),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(i.getObject("result",o)),t.setValue("expresults",this.parent.flatData,a)),this.parent.notify("dataProcessor",a),a=this.dataResults,r=t.isNullOrUndefined(a.result)?this.parent.flatData.slice(0):a.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource){var s=this.parent.flatData,d=e.dataSource instanceof n.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(d),r=this.parent.flatData,this.parent.flatData=s}return e=t.isNullOrUndefined(e)?Object():e,e.dataSource=new n.DataManager({json:r}),this.parent.aggregates.length>0&&(e.query=a.query),e},e.prototype.excelQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=e.data,n=t.isNullOrUndefined(r.filterLevel)?r.level:r.filterLevel;i.indent=n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},e.prototype.excelAggregateCellInfo=function(e){this.parent.trigger("excelAggregateQueryCellInfo",e)},e.prototype.exportRowDataBound=function(e){if("excel"===e.type){var i=e.rowObj.data,r=this.parent.grid.filterSettings.columns.length,n=e.excelRows.length,o=i.level;if(i.parentItem&&m(this.parent,i.parentItem.uniqueID,Boolean(r))){var a=!1,s=!1,d=h(this.parent,i,this.parent.parentData);!this.isCollapsedStatePersist||d&&this.parent.isLocalData||(a=!0,s=!i.expanded),e.excelRows[n-1].grouping={outlineLevel:o,isCollapsed:s,isHidden:a}}else i.hasChildRecords&&t.isNullOrUndefined(i.parentItem)&&(e.excelRows[n-1].grouping={outlineLevel:o})}},e.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},e.prototype.isLocal=function(){return!a(this.parent)&&u(this.parent)},e}(),ke=function(){function e(e){i.Grid.Inject(i.PdfExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this),this.parent.on("pdfAggregateCellInfo",this.pdfAggregateCellInfo,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel),this.parent.off("pdfAggregateCellInfo",this.pdfAggregateCellInfo))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updatePdfResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,r,o,s){var d=this,l=this.parent.dataSource,p=Object(),h=!a(this.parent)&&u(this.parent);return t.setValue("cancel",!1,p),new Promise(function(a){var c=!h||l instanceof n.DataManager?d.parent.dataSource:new n.DataManager(l),u=new n.Query;if(h||(u=d.generateQuery(u),t.setValue("query",u,p)),d.parent.trigger("beforePdfExport",t.extend(p,e)),i.getObject("cancel",p))return null;c.executeQuery(u).then(function(i){var n=null;return t.isNullOrUndefined(e)||t.isNullOrUndefined(e.dataSource)||(n=e.dataSource),e=d.manipulatePdfProperties(e,l,i),d.parent.grid.pdfExportModule.Map(d.parent.grid,e,r,o,s).then(function(t){null!=n?e.dataSource=n:delete e.dataSource,a(t)})})})},e.prototype.generateQuery=function(e,r){return!t.isNullOrUndefined(r)&&"CurrentPage"===r.exportType&&this.parent.allowPaging&&(r.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=i.getObject("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulatePdfProperties=function(e,i,r){var o={},s=!a(this.parent)&&u(this.parent);if(t.setValue("query",this.parent.grid.getDataModule().generateQuery(!0),o),t.setValue("isExport",!0,o),t.setValue("isPdfExport",!0,o),t.isNullOrUndefined(e)||t.isNullOrUndefined(e.isCollapsedStatePersist)||t.setValue("isCollapsedStatePersist",e.isCollapsedStatePersist,o),t.isNullOrUndefined(e)||t.isNullOrUndefined(e.exportType)||t.setValue("exportType",e.exportType,o),s||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(t.getValue("result",r)),t.setValue("expresults",this.parent.flatData,o)),this.parent.notify("dataProcessor",o),o=this.dataResults,i=t.isNullOrUndefined(o.result)?this.parent.flatData.slice(0):o.result,s||(this.parent.flatData=[]),e&&e.dataSource&&s){var d=this.parent.flatData,l=e.dataSource instanceof n.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(l),i=this.parent.flatData,this.parent.flatData=d}return e=t.isNullOrUndefined(e)?{}:e,e.dataSource=new n.DataManager({json:i}),e.query=o.query,e},e.prototype.pdfQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var r={},n=i.getObject("data",e),o=t.isNullOrUndefined(n.filterLevel)?n.level:n.filterLevel;r.paragraphIndent=3*o,e.style=r}this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},e.prototype.pdfAggregateCellInfo=function(e){this.parent.trigger("pdfAggregateQueryCellInfo",e)},e}(),qe=function(){function e(e){i.Grid.Inject(i.Page),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("localPagedExpandCollapse",this.collapseExpandPagedchilds,this),this.parent.on("pagingActions",this.pageAction,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("localPagedExpandCollapse",this.collapseExpandPagedchilds),this.parent.off("pagingActions",this.pageAction))},e.prototype.getModuleName=function(){return"pager"},e.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},e.prototype.updateExternalMessage=function(e){if(t.isNullOrUndefined(e)){this.parent.trigger("actionFailure",{error:"The provided value for the message is undefined. Please ensure the message contains string."})}this.parent.grid.pagerModule.updateExternalMessage(e)},e.prototype.collapseExpandPagedchilds=function(e){if(e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded}),this.parent.enableImmutableMode){var i=this.parent.getPrimaryKeyFieldNames()[0],r=this.parent.flatData.filter(function(t){return t[""+i]===e.record[""+i]});r.length&&(r[0].expanded=e.record.expanded)}var n={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};if(t.getValue("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode){var o=void 0;"collapse"===n.action?(o=n.row.getElementsByClassName("e-treegridexpand")[0],t.isNullOrUndefined(o)||(t.removeClass([o],"e-treegridexpand"),t.addClass([o],"e-treegridcollapse"))):"expand"===n.action&&(o=n.row.getElementsByClassName("e-treegridcollapse")[0],t.isNullOrUndefined(o)||(t.removeClass([o],"e-treegridcollapse"),t.addClass([o],"e-treegridexpand")))}},e.prototype.pageRoot=function(e,i,r){for(var n=t.isNullOrUndefined(r)?[]:r,o=this,a=0;a<i.length;a++)!function(t){n.push(i[parseInt(t.toString(),10)]);var r=[];i[parseInt(t.toString(),10)].hasChildRecords&&(r=e.filter(function(e){return i[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),n=o.pageRoot(e,r,n))}(a);return n},e.prototype.updatePageSize=function(e){var t=e.count,i=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&i.pagerObj.pagerdropdownModule.dropDownListObject.value===i.pagerObj.getLocalizedLabel("All")&&(i.pagerObj.totalRecordsCount=t,this.parent.grid.pageSettings.pageSize=t)},e.prototype.pageAction=function(e){var t=this,i=new n.DataManager(e.result);if("Root"===this.parent.pageSettings.pageSizeMode){var r=[],o=this.parent.grid.filterSettings.columns.length>0&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",a=(new n.Query).where(o,"equal",0);r=i.executeLocal(a),e.count=r.length;m=(g=this.parent.grid.pageSettings.pageSize)*((f=this.parent.grid.pageSettings.currentPage)-1);a=a.skip(m).take(g),r=i.executeLocal(a);var s=this.pageRoot(e.result,r);e.result=s}else{var d=new n.DataManager(e.result),p=new n.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),c=d.executeLocal((new n.Query).where(p)),u=void 0;u=l(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?c:c.filter(function(e){return h(t.parent,e)}),e.count=u.length;var a=new n.Query,g=this.parent.grid.pageSettings.pageSize;this.updatePageSize(e);var f=this.parent.grid.pageSettings.currentPage;u.length<f*g&&(f=(f=Math.floor(u.length/g)+(u.length%g?1:0))||1,this.parent.grid.setProperties({pageSettings:{currentPage:f}},!0));var m=g*(f-1);a=a.skip(m).take(g),d.dataSource.json=u,e.result=d.executeLocal(a)}this.parent.notify("updateAction",e)},e}(),Be=function(){function e(e){i.Grid.Inject(i.Toolbar),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.addEventListener=function(){this.parent.on("rowSelected",this.refreshToolbar,this),this.parent.on("rowDeselected",this.refreshToolbar,this),this.parent.on("toolbarClick",this.toolbarClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowSelected",this.refreshToolbar),this.parent.off("rowDeselected",this.refreshToolbar),this.parent.off("toolbarClick",this.toolbarClickHandler))},e.prototype.refreshToolbar=function(e){var i=this.parent.grid.toolbarModule.getToolbar();if(!t.isNullOrUndefined(i)){var r=this.parent,n=void 0,o=void 0,a=r.element.id+"_gridcontrol_indent",s=r.element.id+"_gridcontrol_outdent",d=i.querySelector("#"+a),l=i.querySelector("#"+s),p=e.row,h=r.getSelectedRows()[0];if(t.isNullOrUndefined(p[0])||(p=p[0]),p=t.isNullOrUndefined(h)||h.rowIndex===p.rowIndex?p:h,null!==d&&null!==l){if(n=d.parentElement,o=l.parentElement,0===p.rowIndex||r.getSelectedRowIndexes().length>1)n.classList.add("e-hidden"),o.classList.add("e-hidden");else if("rowDeselected"!==e.name||!t.isNullOrUndefined(h)&&r.grid.isCheckBoxSelection){var c=r.getCurrentViewRecords()[p.rowIndex];t.isNullOrUndefined(c)||(c.level>r.getCurrentViewRecords()[p.rowIndex-1].level?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),c.level===r.getCurrentViewRecords()[p.rowIndex-1].level&&n.classList.remove("e-hidden"),0===c.level&&o.classList.add("e-hidden"),0!==c.level&&o.classList.remove("e-hidden"))}"rowDeselected"===e.name&&t.isNullOrUndefined(h)&&!r.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&n.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent")&&o.classList.add("e-hidden"))}}},e.prototype.toolbarClickHandler=function(e){var i=this.parent;"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===i.grid.element.id+"_indent"&&i.getSelectedRecords().length&&!t.isNullOrUndefined(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule.indentOutdentAction(null,"indent"),e.item.id===i.grid.element.id+"_outdent"&&i.getSelectedRecords().length&&!t.isNullOrUndefined(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule.indentOutdentAction(null,"outdent")},e.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},e.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},e.prototype.destroy=function(){this.removeEventListener()},e}(),Te=function(){function e(e){i.Grid.Inject(i.Aggregate),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}return e.prototype.getModuleName=function(){return"summary"},e.prototype.removeEventListener=function(){this.parent.isDestroyed},e.prototype.calculateSummaryValue=function(e,r,n){this.summaryQuery=e;var o,a,s=r.filter(function(e){return!i.getObject("isSummaryRow",e)}),d=p(s),l=s.slice(),h=Object.keys(this.parent.aggregates).length,c=Object.keys(d).length,u=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var g=0,f=c;g<f;g++)if(o=d[parseInt(g.toString(),10)],a=this.getChildRecordsLength(o,l)){for(var m=this,y=1,S=h;y<=S;y++)!function(e,r){var s=void 0;s={};for(var d=0;d<u.length;d++)s[""+(t.isNullOrUndefined(i.getObject("field",u[parseInt(d.toString(),10)]))?u[parseInt(d.toString(),10)]:i.getObject("field",u[parseInt(d.toString(),10)]))]=null;if(s=m.createSummaryItem(s,m.parent.aggregates[e-1]),!m.parent.aggregates[e-1].showChildSummary)return"continue";var p;l.map(function(e,t){if(e.uniqueID===o.uniqueID)return void(p=t)});var h=p+a+e,c=t.extend({},o);delete c.childRecords,delete c[m.parent.childMapping],t.setValue("parentItem",c,s);var g=i.getObject("level",c);if(t.setValue("level",g+1,s),t.setValue("isSummaryRow",!0,s),t.setValue("parentUniqueID",c.uniqueID,s),n){var f=i.getObject("childRecords",o);f.length&&f.push(s)}l.splice(h,0,s)}(y);this.flatChildRecords=[]}}else{for(var v={},w=0,I=u.length;w<I;w++)v[""+(t.isNullOrUndefined(i.getObject("field",u[parseInt(w.toString(),10)]))?u[parseInt(w.toString(),10)]:i.getObject("field",u[parseInt(w.toString(),10)]))]=null;for(var y=1,R=h;y<=R;y++)this.createSummaryItem(v,this.parent.aggregates[y-1])}return l},e.prototype.getChildRecordsLength=function(e,r){for(var n,o=0,a=Object.keys(r).length;o<a;o++)if(n=r[parseInt(o.toString(),10)],e===(t.isNullOrUndefined(n.parentItem)?null:r.filter(function(e){return e.uniqueID===n.parentItem.uniqueID})[0])){if(this.flatChildRecords.push(n),!i.getObject("hasChildRecords",n))continue;this.getChildRecordsLength(n,r)}return this.flatChildRecords.length},e.prototype.createSummaryItem=function(e,i){for(var r=0,o=Object.keys(i.columns).length;r<o;r++)for(var a=t.isNullOrUndefined(i.columns[parseInt(r.toString(),10)].columnName)?i.columns[parseInt(r.toString(),10)].field:i.columns[parseInt(r.toString(),10)].columnName,s=0,d=Object.keys(e);s<d.length;s++){var l=d[s];if(l===a)if(this.flatChildRecords.length)e[""+l]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],this.flatChildRecords);else if(this.parent.isLocalData){var p=this.parent.dataSource instanceof n.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData;e[""+l]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],p)}}return e},e.prototype.getSummaryValues=function(e,r){var o=new n.Query,a={},s={},d=t.isNullOrUndefined(e.field)?void 0:this.parent.getColumnByField(e.field).type;e.setPropertiesSilent({format:this.getFormatFromType(e.format,d)}),e.setFormatter(this.parent.grid.locale);var l=e.getFormatter()||function(){return function(e){return e}}();e.setTemplate(s);var p=e.getTemplate(2);o.queries=this.summaryQuery,o.requiresCount();var h,c=new n.DataManager(r).executeLocal(o),u=e.type;u=[e.type];for(var g=0;g<u.length;g++){h=u[parseInt(g.toString(),10)];var f=e.field+" - "+u[parseInt(g.toString(),10)].toLowerCase(),m="Custom"!==u[parseInt(g.toString(),10)]?i.getObject("aggregates",c):i.calculateAggregate(u[parseInt(g.toString(),10)],c,e,this.parent),y=e.columnName,S="Custom"!==u[parseInt(g.toString(),10)]?m[""+f]:m;a[""+y]=a[""+y]||{},a[""+y][""+f]=S,a[""+y][u[parseInt(g.toString(),10)]]=t.isNullOrUndefined(m)||t.isNullOrUndefined(S)?" ":l(S)}s.format=e.getFormatter();var v=t.createElement("td",{className:"e-summary"});if(this.parent.isReact&&"string"!=typeof e.footerTemplate){p.fn(a[e.columnName],this.parent,p.property,"",null,null,v),this.parent.renderReactTemplates()}else i.appendChildren(v,p.fn(a[e.columnName],this.parent,p.property));var w=a[""+e.columnName][""+h];return-1===v.innerHTML.indexOf(w)?v.innerHTML+w:v.innerHTML},e.prototype.getFormatFromType=function(e,i){if(t.isNullOrUndefined(i)||"string"!=typeof e)return e;var r;switch(i){case"number":r={format:e};break;case"datetime":r={type:"dateTime",skeleton:e};break;case"date":r={type:i,skeleton:e}}return r},e.prototype.destroy=function(){this.removeEventListener()},e}(),Ve=function(){function e(e){i.Grid.Inject(i.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!t.isNullOrUndefined(this.parent.parentIdMapping),this.addEventListener()}return e.prototype.getModuleName=function(){return"sort"},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},e.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},e.prototype.iterateSort=function(e,i){var r=this.parent.query,o=[];t.isNullOrUndefined(r)||(o=r.queries.filter(function(e){return"onWhere"===e.fn}));for(var a=0;a<e.length;a++)if(o.length>0||this.parent.grid.filterSettings.columns.length>0||""!==this.parent.grid.searchSettings.key?t.isNullOrUndefined(m(this.parent,e[parseInt(a.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(a.toString(),10)]):(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(a.toString(),10)]),e[parseInt(a.toString(),10)].hasChildRecords){var s=new n.DataManager(e[parseInt(a.toString(),10)].childRecords).executeLocal(i);if(this.parent.allowRowDragAndDrop&&-1!==e[parseInt(a.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var d=s.indexOf(this.parent.rowDragAndDropModule.draggedRecord);s.splice(d,1);var l=s.indexOf(this.parent.rowDragAndDropModule.droppedRecord);"topSegment"===this.parent.rowDragAndDropModule.dropPosition?s.splice(l,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&s.splice(l+1,0,this.parent.rowDragAndDropModule.draggedRecord)}this.iterateSort(s,i)}},e.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},e.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},e.prototype.updateModel=function(){this.parent.setProperties({sortSettings:i.getActualProperties(this.parent.grid.sortSettings)},!0)},e.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},e.prototype.destroy=function(){this.removeEventListener()},e}(),ze=function(){function e(e){i.Grid.Inject(i.ColumnMenu),this.parent=e}return e.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"columnMenu"},e}(),Le=function(){function e(e){i.Grid.Inject(i.ContextMenu),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this),this.parent.on("contextMenuItemClick",this.contextMenuItemClick,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick),this.parent.off("contextMenuItemClick",this.contextMenuItemClick))},e.prototype.contextMenuItemClick=function(e){(e.item&&e.item.id?e.item.id:"")===this.parent.element.id+"_gridcontrol_cmenu_Delete"&&(this.parent.getSelectedRecords()[0].hasChildRecords||this.parent.getSelectedRecords().length>1?this.parent.deleteRecord():this.parent.deleteRow(this.parent.getSelectedRows()[0]),e.cancel=!0)},e.prototype.contextMenuOpen=function(e){var i=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),r=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),n=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),o=t.select("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element);i&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?i.style.display="none":i.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||t.isNullOrUndefined(r)||r.classList.contains("e-menu-hide")||(r.style.display="none");var a=this.parent,s=a.getSelectedRows()[0];if(!n&&!o||t.isNullOrUndefined(s)){if((n||o||a.grid.isEdit)&&t.isNullOrUndefined(s)){for(var d=0,l=e.items;d<l.length;d++){var p=l[d];"Outdent"!==p.text&&"Indent"!==p.text||a.grid.contextMenuModule.hiddenItems.includes(p.text)||a.grid.contextMenuModule.hiddenItems.push(p.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),(n||o)&&(n.style.display=o.style.display="none")}}else{var h=e.event.target.closest("td");if(!t.isNullOrUndefined(h)&&(t.isNullOrUndefined(h)||h.classList.contains("e-rowcell")&&0===h.querySelectorAll(".e-gridform").length)){if(0===s.rowIndex||a.getSelectedRowIndexes().length>1)n.style.display=o.style.display="none";else if("rowDeselected"!==e.name||!t.isNullOrUndefined(s)&&a.grid.isCheckBoxSelection){var c=a.getCurrentViewRecords()[s.rowIndex];t.isNullOrUndefined(c)||(c.level>a.getCurrentViewRecords()[s.rowIndex-1].level?n.style.display="none":n.style.display="block",c.level===a.getCurrentViewRecords()[s.rowIndex-1].level&&(n.style.display="block"),0===c.level?o.style.display="none":o.style.display="block")}}else{for(var u=0,g=e.items;u<g.length;u++)"Outdent"!==(p=g[u]).text&&"Indent"!==p.text||a.grid.contextMenuModule.hiddenItems.push(p.text);a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}},e.prototype.contextMenuClick=function(e){if("Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),(e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"||e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Outdent")&&!t.isNullOrUndefined(this.parent.rowDragAndDropModule)){var i=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent";this.parent.rowDragAndDropModule.indentOutdentAction(null,i)}},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()},e}(),Fe=function(){function e(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!t.isNullOrUndefined(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("cellSaved",this.cellSaved,this),this.parent.on("batchAdd",this.batchAdd,this),this.parent.on("beforeBatchAdd",this.beforeBatchAdd,this),this.parent.on("batchSave",this.batchSave,this),this.parent.on("beforeBatchDelete",this.beforeBatchDelete,this),this.parent.on("beforeBatchSave",this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this),this.parent.grid.on("cellfocused",this.onCellFocused,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("cellSaved",this.cellSaved),this.parent.off("batchAdd",this.batchAdd),this.parent.off("batchSave",this.batchSave),this.parent.off("beforeBatchAdd",this.beforeBatchAdd),this.parent.off("beforeBatchDelete",this.beforeBatchDelete),this.parent.off("beforeBatchSave",this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex),this.parent.grid.off("cellfocused",this.onCellFocused))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getBatchRecords=function(){return this.batchRecords},e.prototype.getAddRowIndex=function(){return this.addRowIndex},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.getBatchChildCount=function(){return this.batchChildCount},e.prototype.batchPageAction=function(){var e,i=this,r=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,o=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!t.isNullOrUndefined(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var a=0;a<this.batchAddedRecords.length;a++)!function(t){e=r.findIndex(function(e){return e[""+o]===i.batchAddedRecords[parseInt(t.toString(),10)][""+o]}),r.splice(e,1)}(a);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},e.prototype.cellSaved=function(e){if(e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition){var r=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,o=void 0,a=this.parent.grid.getPrimaryKeyFieldNames()[0],s=void 0,d=void 0,l=this.selectedIndex>-1?this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem:null,p=void 0,h=void 0,u=void 0,f="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1;if(f=this.getActualRowObjectIndex(f),this.newBatchRowAdded){if(this.batchRecords.length&&(p=this.batchRecords[this.addRowIndex][this.parent.idMapping],u=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem&&(h=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem.uniqueID)),this.batchAddedRecords=g(this.batchAddedRecords),this.batchAddRowRecord=g(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),o=this.parent.grid.getRowsObject()[parseInt(f.toString(),10)].changes,!t.isNullOrUndefined(o)&&(o.uniqueID=i.getUid(this.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+o.uniqueID,o,this.parent),!Object.prototype.hasOwnProperty.call(o,"level"))){if(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition){if(o.primaryParent=l,this.selectedIndex>-1){o.parentItem=t.extend({},this.batchRecords[this.addRowIndex]),o.parentUniqueID=o.parentItem.uniqueID,delete o.parentItem.childRecords,delete o.parentItem[this.parent.childMapping],o.level=o.parentItem.level+1,o.index=this.batchIndex;var m=c(this.batchRecords[this.addRowIndex]).length,y=c(this.batchRecords[this.addRowIndex])[m-1];y=t.isNullOrUndefined(y)?this.batchRecords[this.addRowIndex]:y,s=r.map(function(e){return e[""+a]}).indexOf(y[""+a]),this.isSelfReference&&(o[this.parent.parentIdMapping]=p),I(a,o.parentItem,"add",this.parent,this.isSelfReference,o)}}else if(("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&!t.isNullOrUndefined(this.batchRecords[this.addRowIndex])){if(o.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,o.level&&this.selectedIndex>-1&&(o.parentItem=l,o.parentUniqueID=h,delete o.parentItem.childRecords,delete o.parentItem[this.parent.childMapping]),o.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){var m=c(this.batchRecords[this.addRowIndex]).length,y=c(this.batchRecords[this.addRowIndex])[m-1];y=t.isNullOrUndefined(y)?this.batchRecords[this.addRowIndex]:y,s=r.map(function(e){return e[""+a]}).indexOf(y[""+a])}if("Above"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){y=this.batchRecords[this.addRowIndex];s=r.map(function(e){return e[""+a]}).indexOf(y[""+a])}this.isSelfReference&&(o[this.parent.parentIdMapping]=u)}o.index=-1===o.index?0:o.index,o.hasChildRecords=!1,o.childRecords=[],this.batchRecords.splice(o.index,0,o),this.currentViewRecords.splice(o.index,0,o),d=s||o.index,"Above"!==this.parent.editSettings.newRowPosition&&(d=0===o.index?d:d+1),r.splice(d,0,o),this.batchAddedRecords.push(o)}this.parent.grid.getRowsObject()[parseInt(f.toString(),10)].data=o,this.newBatchRowAdded=!1}}},e.prototype.beforeBatchAdd=function(e){if("Cell"===this.parent.editSettings.mode&&this.parent.editModule.isTabLastRow)return e.cancel=!0,void(this.parent.editModule.isTabLastRow=!1);!this.parent.editModule.isAddedRowByMethod||t.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=this.batchRecords.length?this.batchRecords[this.selectedIndex]:this.parent.getCurrentViewRecords()[this.selectedIndex])},e.prototype.batchAdd=function(e){if("Bottom"!==this.parent.editSettings.newRowPosition){this.isAdd=!0,this.newBatchRowAdded=!0;var i=0;if(this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=g(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=g(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!t.isNullOrUndefined(this.parent.editModule.addRowIndex)&&t.classList(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition){var r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchRecords),this.updateChildCount(r),this.parent.notify("beginAdd",{}),this.batchChildCount=0}this.updateRowIndex();var n=t.getValue("focusModule",this.parent.grid),o=this.parent.getContentTable();if(this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(i=e.row.rowIndex,n.getContent().matrix.matrix=this.matrix):i=this.parent.frozenRows?this.batchIndex:this.parent.editModule.isAddedMultipleRowsByMethod?e.index:o.getElementsByClassName("e-batchrow")[0].rowIndex,n.getContent().matrix.current=[i,n.getContent().matrix.current[1]],this.parent.editModule.isAddedRowByMethod&&!t.isNullOrUndefined(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu&&!this.parent.editModule.isAddedMultipleRowsByMethod){var a=this.parent.getBatchChanges().addedRecords,s=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[a.length-1].getAttribute("aria-rowindex"),10)-1;this.batchRecords.splice(s,0,a[a.length-1])}}},e.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=g(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=g(this.parent.grid.getCurrentViewRecords()));var i=t.getValue("focusModule",this.parent.grid);this.matrix=i.getContent().matrix.matrix;var r,n,o,a=[],s=[],d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=Array.isArray(e.row)?e.row[0]:e.row;t.isNullOrUndefined(l)||-1!==this.parent.getSelectedRows().indexOf(l)?(n=c(r=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),o=this.parent.getSelectedRows()[0].getAttribute("data-uid")):(n=c(r=e.rowData),o=l.getAttribute("data-uid"));var p=parseInt(this.parent.grid.getRowElementByUID(o).getAttribute("aria-rowindex"),10)-1;if(n.length)for(var h=p+n.length,u=p+1;u<=h;u++)a.push(this.parent.grid.getDataRows()[parseInt(u.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&a.push(this.parent.grid.getHeaderContent()[parseInt(u.toString(),10)]);if(!t.isNullOrUndefined(r.parentItem)){var f=m(this.parent,r.parentItem.uniqueID);if(!t.isNullOrUndefined(f)&&f.hasChildRecords){var y=f.childRecords.indexOf(r);f.childRecords.splice(y,1)}this.batchDeletedRecords=g(this.batchDeletedRecords),this.batchDeletedRecords.push(r)}n.push(r),s=n;for(var S=this,u=0;u<s.length;u++)!function(e){var t=S.batchRecords.findIndex(function(t){return t[""+d]===s[parseInt(e.toString(),10)][""+d]});-1!==t&&S.batchRecords.splice(t,1)}(u);for(u=0;u<a.length;u++)t.isNullOrUndefined(a[parseInt(u.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(a[parseInt(u.toString(),10)])},e.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},e.prototype.updateChildCount=function(e){for(var i=this.parent.grid.getPrimaryKeyFieldNames()[0],r=this.parent.getBatchChanges().addedRecords||[],n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<r.length;o++)t.isNullOrUndefined(r[parseInt(o.toString(),10)][""+n])||r[parseInt(o.toString(),10)][""+n][""+i]===e[parseInt(this.addRowIndex.toString(),10)][""+i]&&(this.batchChildCount=this.batchChildCount+1)},e.prototype.beforeBatchSave=function(e){var t=e.batchChanges.changedRecords;if(e.batchChanges.changedRecords.length)for(r=0;r<t.length;r++)S({value:t[parseInt(r.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,void 0);if(e.batchChanges.deletedRecords.length)for(var i=e.batchChanges.deletedRecords,r=0;r<i.length;r++){this.deleteUniqueID(i[parseInt(r.toString(),10)].uniqueID);for(var n=c(i[parseInt(r.toString(),10)]),o=0;o<n.length;o++)this.deleteUniqueID(n[parseInt(o.toString(),10)].uniqueID);e.batchChanges.deletedRecords=e.batchChanges.deletedRecords.concat(n)}this.isAdd=!1},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.batchCancelAction=function(){var e,i=this,r=this.parent.grid.getCurrentViewRecords(),o=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,a=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!t.isNullOrUndefined(this.batchAddedRecords))for(var s=this,d=0;d<this.batchAddedRecords.length;d++)!function(n){if(-1!==(e=o.findIndex(function(e){return e[""+a]===i.batchAddedRecords[parseInt(n.toString(),10)][""+a]}))&&o.splice(e,1),"Child"===s.parent.editSettings.newRowPosition&&(e=r.map(function(e){return e[""+a]}).indexOf(s.batchAddedRecords[parseInt(n.toString(),10)].parentItem?s.batchAddedRecords[parseInt(n.toString(),10)].parentItem[""+a]:s.batchAddedRecords[parseInt(n.toString(),10)][""+a]),!t.isNullOrUndefined(r[parseInt(e.toString(),10)])))for(var d=r[parseInt(e.toString(),10)].childRecords,l=0;d&&l<d.length;l++)d[parseInt(l.toString(),10)][""+a]===s.batchAddedRecords[parseInt(n.toString(),10)][""+a]&&d.splice(l,1)}(d);if(!t.isNullOrUndefined(this.parent.targetElement)){var l=this.parent.targetElement.closest("tr");this.parent.collapseRow(l),this.parent.targetElement=null}if(!t.isNullOrUndefined(this.batchDeletedRecords))for(d=0;d<this.batchDeletedRecords.length;d++)if(!t.isNullOrUndefined(this.batchDeletedRecords[parseInt(d.toString(),10)].parentItem)){e=r.map(function(e){return e[""+a]}).indexOf(this.batchDeletedRecords[parseInt(d.toString(),10)].parentItem[""+a]);var p=0===this.batchDeletedRecords[parseInt(d.toString(),10)].index?this.batchDeletedRecords[parseInt(d.toString(),10)].index:this.batchDeletedRecords[parseInt(d.toString(),10)].index-1;t.isNullOrUndefined(r[parseInt(e.toString(),10)])||r[parseInt(e.toString(),10)].childRecords.splice(p,0,this.batchDeletedRecords[parseInt(d.toString(),10)])}this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=g(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=g(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},e.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var i,r=void 0,o=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),a=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,s=this.parent.grid.getCurrentViewRecords(),d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=o.addedRecords,p=void 0,h=void 0;if(l.length>1&&"Bottom"!==this.parent.editSettings.newRowPosition&&l.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(a.splice(a.length-l.length,l.length),this.parent.editModule.isAddedRowByMethod&&l.length&&!t.isNullOrUndefined(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){l.reverse();for(var c=0;c<l.length;c++){var u=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(c.toString(),10)].getAttribute("aria-rowindex"),10)-1;a.splice(u,0,l[parseInt(c.toString(),10)])}}if(this.parent.allowPaging||a.length===s.length){var f=g(a);if(f.length&&0!==s.length){var m=f.map(function(e){return e[""+d]}).indexOf(s[0][""+d]),y=m+this.parent.grid.pageSettings.pageSize;s=f.splice(m,y)}}else s.length>l.length&&s.splice(s.length-l.length,l.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&l.reverse(),r=0;r<l.length;r++){var v=t.extend({},l[parseInt(r.toString(),10)]);if(delete v.parentItem,delete v.uniqueID,delete v.index,delete v.level,delete v.hasChildRecords,delete v.childRecords,delete v.parentUniqueID,t.isNullOrUndefined(v.primaryParent)||delete v.primaryParent,l.length>1&&this.parent.editModule.isAddedRowByContextMenu){var w=this.parent.editSettings.newRowPosition;this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=w}if(l[parseInt(r.toString(),10)].taskData=v,i=this.batchAddRowRecord.length>1?this.batchAddRowRecord[parseInt(r.toString(),10)]:this.batchAddRowRecord[0],t.isNullOrUndefined(i)&&(i=this.batchAddRowRecord[r-1]),this.isSelfReference&&(t.isNullOrUndefined(l[parseInt(r.toString(),10)].parentItem)||I(d,l[parseInt(r.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,l[parseInt(r.toString(),10)])),t.isNullOrUndefined(i)||(h=i.index),t.isNullOrUndefined(l[parseInt(r.toString(),10)].index)&&(h=0),this.parent.editModule.isAddedMultipleRowsByMethod&&this.isSelfReference&&("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&(h=e.index,i=this.parent.flatData[e.index]),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&t.isNullOrUndefined(l[parseInt(r.toString(),10)].parentItem)&&-1===this.selectedIndex&&(p=-1,i=null),S({value:l[parseInt(r.toString(),10)],action:"add"},this.parent,this.isSelfReference,h,p,void 0,i),p=null,"Child"===this.parent.editSettings.newRowPosition&&!t.isNullOrUndefined(l[parseInt(r.toString(),10)].parentItem)&&(t.isNullOrUndefined(this.parent.editModule.addRowIndex)||this.isSelfReference)){var R=s.map(function(e){return e[""+d]}).indexOf(l[parseInt(r.toString(),10)].parentItem[""+d]),x=s[parseInt(R.toString(),10)].childRecords;if(!t.isNullOrUndefined(h)&&x.some(function(e){return e.uniqueID===i.uniqueID}))for(var C=0;C<x.length;C++)x[parseInt(C.toString(),10)][""+d]===l[parseInt(r.toString(),10)][""+d]&&s[parseInt(R.toString(),10)].childRecords.splice(C,1)}}if(o.deletedRecords.length)for(r=0;r<o.deletedRecords.length;r++)S({value:o.deletedRecords[parseInt(r.toString(),10)],action:"delete"},this.parent,this.isSelfReference,h,p,void 0,i);this.parent.parentData=[];for(var b=0;b<a.length;b++)a[parseInt(b.toString(),10)].index=b,t.setValue("uniqueIDCollection."+a[parseInt(b.toString(),10)].uniqueID+".index",b,this.parent),a[parseInt(b.toString(),10)].level||this.parent.parentData.push(a[parseInt(b.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},e.prototype.getActualRowObjectIndex=function(e){var i=this.parent.grid.getDataRows();return("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&this.selectedIndex>-1&&(!t.isNullOrUndefined(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length?(e+=c(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition&&(e+=this.getBatchChildCount())):e+=c(this.batchRecords[this.addRowIndex]).length),e>=i.length&&(e=i.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0),e},e.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var r=0;r<i.length;r++)e.rows.splice(i[parseInt(r.toString(),10)].index,1)},e.prototype.nextCellIndex=function(e){var t=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&t.length>0?e.index=this.parent.getSelectedRecords()[0].index:e.index=this.parent.getSelectedRows()[0].rowIndex:e.index=this.batchIndex},e.prototype.onCellFocused=function(e){if("Cell"===this.parent.editSettings.mode&&this.parent.grid.isEdit&&e.keyArgs&&"shiftEnter"===e.keyArgs.action)return e.keyArgs.preventDefault(),void this.parent.endEdit()},e}(),je=function(){function e(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,this.isIndexUndefined=!1,this.isAddedMultipleRowsByMethod=!1,i.Grid.Inject(i.Edit),this.parent=e,this.isSelfReference=!t.isNullOrUndefined(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new Fe(this.parent),this.addEventListener()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.addEventListener=function(){this.parent.on("crudAction",this.crudAction,this),this.parent.on("beginEdit",this.beginEdit,this),this.parent.on("beginAdd",this.beginAdd,this),this.parent.on("recordDoubleClick",this.recordDoubleClick,this),this.parent.on("cellSave",this.cellSave,this),this.parent.on("batchCancel",this.batchCancel,this),this.parent.grid.on("key-pressed",this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on("cellEdit",this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on("double-tap",this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on("edit-form",this.beforeStartEdit,this),this.parent.grid.on("before-batch-cancel",this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},e.prototype.gridDblClick=function(e){if(this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand")){var r=i.parentsUntil(e.target,"e-row"),n=r&&parseInt(r.getAttribute("aria-rowindex"),10)-1;!t.isNullOrUndefined(n)&&n>=0&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[n].dataset.uid=this.parent.grid.contentModule.getRows()[n].uid)}},e.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},e.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger("actionBegin",e)},e.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger("actionComplete",e))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("crudAction",this.crudAction),this.parent.off("beginEdit",this.beginEdit),this.parent.off("beginAdd",this.beginAdd),this.parent.off("recordDoubleClick",this.recordDoubleClick),this.parent.off("batchCancel",this.batchCancel),this.parent.grid.off("key-pressed",this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off("cellEdit",this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off("double-tap",this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off("edit-form",this.beforeStartEdit),this.parent.grid.off("before-batch-cancel",this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},e.prototype.editActionEvents=function(e){var r=i.getObject("editAction",e),o=i.getObject("name",r),s=this.parent,d=!t.isNullOrUndefined(s.dataSource)&&s.dataSource.adaptor;if(!t.isNullOrUndefined(d)&&(a(s)||d instanceof n.RemoteSaveAdaptor)&&"save"===r.requestType&&"add"===r.action&&("Child"===s.editSettings.newRowPosition||"Below"===s.editSettings.newRowPosition||"Above"===s.editSettings.newRowPosition))if("actionBegin"===o){var l=t.isNullOrUndefined(r.row)||!Object.keys(r.row).length?this.selectedIndex:r.row.rowIndex-1,p=t.isNullOrUndefined(l)||-1===l?-1:s.getCurrentViewRecords()[parseInt(l.toString(),10)][s.getPrimaryKeyFieldNames()[0]];s.grid.query.addParams("relationalKey",p)}else if("actionComplete"===o)for(var h=s.grid.query.params.length,c=0;c<h;c++)"relationalKey"===s.grid.query.params[parseInt(c.toString(),10)].key&&s.grid.query.params.splice(c);this.parent.enableInfiniteScrolling&&"actionComplete"===o&&this.infiniteAddAction(r),"Batch"===this.parent.editSettings.mode&&"paging"===r.requestType&&this.parent.notify("batchPageAction",{})},e.prototype.infiniteAddAction=function(e){if("save"===e.requestType&&"add"===e.action||"delete"===e.requestType){if("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action){var t=this.parent.grid.getRowsObject(),r=t.splice(0,1)[0],n=this.addRowIndex,o=this.parent.getCurrentViewRecords();"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(n+=c(o[n+1]).length),n="Below"===this.parent.editSettings.newRowPosition?n+1:n,t.splice(n,0,r);var a=o.splice(0,1)[0];o.splice(n,0,a),this.updateInfiniteCurrentViewData(a,this.addRowIndex)}var s=this.parent.grid.getRows(),d=this.parent.grid.getRowsObject(),l=this.parent.infiniteScrollSettings.enableCache;l||(i.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!l&&this.parent.getFrozenColumns()>0&&(i.resetRowIndex(this.parent.grid,d,s,0),this.updateIndex(this.parent.grid.dataSource,s,this.parent.getCurrentViewRecords()))}},e.prototype.updateInfiniteCurrentViewData=function(e,i){var r=this,n=Math.ceil(i/this.parent.grid.pageSettings.pageSize),o=n>0?n:1,a=i-(o-1)*this.parent.pageSettings.pageSize,s=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData;s[1].splice(0,1);var d=s[parseInt(o.toString(),10)];t.isNullOrUndefined(this.addRowRecord)||(d.filter(function(e,t){e.uniqueID===r.addRowRecord.uniqueID&&(a=t)}),(this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(a+=c(this.addRowRecord).length)),a>=this.parent.pageSettings.pageSize&&(o+=1,d=s[parseInt(o.toString(),10)],a=a-this.parent.pageSettings.pageSize>=0?a-this.parent.pageSettings.pageSize:0),a="Below"===this.parent.editSettings.newRowPosition?a+1:a,d.splice(a,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},e.prototype.recordDoubleClick=function(e){var r=e.target;if(!t.isNullOrUndefined(r.closest("td.e-rowcell"))&&this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit){var n=this.parent.grid.getColumnByIndex(+r.closest("td.e-rowcell").getAttribute("aria-colindex")-1);if("Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&n&&!n.isPrimaryKey&&this.parent.editSettings.allowEditing&&n.allowEditing&&!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick){if(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization){var o=i.parentsUntil(e.target,"e-row");this.prevAriaRowIndex=o.getAttribute("aria-rowindex"),o.setAttribute("aria-rowindex",o.rowIndex+1+"")}this.updateGridEditMode("Batch")}else"Cell"!==this.parent.editSettings.mode||n.allowEditing&&!n.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch"))}},e.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),i.getObject("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},e.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},e.prototype.keyPressed=function(e){(this.isOnBatch||"tab"===e.action||"shiftTab"===e.action)&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.cellEdit=function(e){var i=this,r=e.promise;if(delete e.promise,this.parent.enableVirtualization&&!t.isNullOrUndefined(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger("cellEdit",e,function(e){e.cancel||"Cell"!==i.parent.editSettings.mode?e.cancel&&"Cell"===i.parent.editSettings.mode&&(i.isOnBatch=!1,i.updateGridEditMode("Normal")):i.enableToolbarItems("edit"),t.isNullOrUndefined(r)||r.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell")))return e.cancel=!0,void(this.doubleClickTarget=null);"Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,t.setValue("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index)},e.prototype.enableToolbarItems=function(e){if(!t.isNullOrUndefined(this.parent.grid.toolbarModule)){var i=this.parent.element.id+"_gridcontrol_";this.parent.grid.toolbarModule.enableItems([i+"add",i+"edit",i+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([i+"update",i+"cancel"],"edit"===e)}},e.prototype.batchCancel=function(){if("Cell"===this.parent.editSettings.mode){var e=t.getValue("editModule.cellDetails",this.parent.grid.editModule);t.isNullOrUndefined(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex);var i=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex);this.parent.renderModule.cellRender({data:e.rowData,cell:i,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1}"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},e.prototype.customCellSave=function(e){s(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},e.prototype.cellSave=function(e){var i=this;if("Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")){e.cancel=!0;t.setValue("isEditCollapse",!0,this.parent),e.rowData[e.columnName]=e.value;var r;r=t.isNullOrUndefined(e.cell)?this.parent.grid.editModule.editModule.form.parentElement.parentNode:e.cell.parentNode;var o,d=this.parent.getPrimaryKeyFieldNames();if(t.isNullOrUndefined(r))this.parent.grid.getCurrentViewRecords().filter(function(t,i){if(t[d[0]]===e.rowData[d[0]])return void(o=i)});else{var l=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;o=l?(this.parent.getRows().indexOf(r),this.parent.getRows().indexOf(r)):-1===this.parent.getRows().indexOf(r)&&this.parent.getFrozenColumns()>0?this.parent.grid.getRows().indexOf(r):this.parent.getRows().indexOf(r)}var p={};if(t.extend(p,e),p.cancel=!1,p.type="save",r=this.parent.grid.getRows()[r.rowIndex],this.parent.trigger("actionBegin",p),p.cancel)this.parent.grid.isEdit=!0;else if(r.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),a(this.parent)||this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.adaptor instanceof n.RemoteSaveAdaptor){if(a(this.parent)||this.parent.dataSource instanceof n.DataManager&&this.parent.dataSource.adaptor instanceof n.RemoteSaveAdaptor){var h=this.parent.grid.query;if(this.parent.isGantt&&this.parent.loadChildOnDemand)this.updateCell(e,o),t.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(e,r);else{this.parent.grid.dataSource.update(d[0],e.rowData,h.fromTable,h,e.previousValue).then(function(n){t.isNullOrUndefined(n)||(e.rowData[e.columnName]=n[e.columnName]),i.updateCell(e,o),t.setValue("isEdit",!1,i.parent.grid),i.afterCellSave(e,r)})}}}else if(s(this.parent)){var c={requestType:"save",data:e.rowData,action:"edit",row:r,rowIndex:o,rowData:e.rowData,columnName:e.columnName,filterChoiceCount:null,excelSearchOperator:null};this.parent.grid.getDataModule().eventPromise(c,this.parent.grid.query)}else this.updateCell(e,o),t.setValue("isEdit",!1,this.parent.grid),this.afterCellSave(e,r)}this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},e.prototype.afterCellSave=function(e,i){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),t.removeClass([i],["e-editedrow","e-batchrow"]),t.removeClass(i.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),S({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),i.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);var r={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:i,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger("actionComplete",r)},e.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},e.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},e.prototype.crudAction=function(e,i){S(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,i,this.addRowRecord),this.parent.parentData=[];for(var r=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,o=0;o<r.length;o++){r[parseInt(o.toString(),10)].index=o;var s=this.parent.grid.getPrimaryKeyFieldNames()[0];e.value[""+s]===r[parseInt(o.toString(),10)][""+s]&&"add"===e.action&&(r[parseInt(o.toString(),10)].level=this.internalProperties.level,r[parseInt(o.toString(),10)].taskData=this.internalProperties.taskData,r[parseInt(o.toString(),10)].uniqueID=this.internalProperties.uniqueID,t.isNullOrUndefined(this.internalProperties.parentItem)||(r[parseInt(o.toString(),10)].parentItem=this.internalProperties.parentItem,r[parseInt(o.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),r[parseInt(o.toString(),10)].childRecords=this.internalProperties.childRecords),t.setValue("uniqueIDCollection."+r[parseInt(o.toString(),10)].uniqueID+".index",o,this.parent);var d=this.parent.dataSource.adaptor;(a(this.parent)||d instanceof n.RemoteSaveAdaptor)&&t.setValue("uniqueIDCollection."+r[parseInt(o.toString(),10)].uniqueID,r[parseInt(o.toString(),10)],this.parent),r[parseInt(o.toString(),10)].level||this.parent.parentData.push(r[parseInt(o.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},e.prototype.updateIndex=function(e,i,r){for(var n=0;n<this.parent.getDataRows().length;n++){var o=r[parseInt(n.toString(),10)];if(!t.isNullOrUndefined(o)){u=t.getValue("uniqueIDCollection."+o.uniqueID+".index",this.parent);if(o.index=u,!t.isNullOrUndefined(o.parentItem)){var a=t.getValue("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent);o.parentItem.index=a}}}var s=-1,d=this.parent.treeColumnIndex;if(this.parent.getFrozenColumns()>0)for(var l=i[0].querySelectorAll(".e-rowcell"),p=0;p<l.length;p++)if(l[parseInt(p.toString(),10)].classList.contains("e-gridrowindex0level0")){d=p;break}for(var h=0;h<this.parent.getRows().length;h++){i[parseInt(h.toString(),10)].classList.contains("e-detailrow")||s++;var c=r[parseInt(s.toString(),10)];if(!t.isNullOrUndefined(c)){var u=c.index,g=c.level,f=i[parseInt(h.toString(),10)];t.isNullOrUndefined(c.parentItem)||(u=t.getValue("uniqueIDCollection."+c.parentItem.uniqueID+".index",this.parent));var m=f.cells[parseInt(d.toString(),10)];if(!t.isNullOrUndefined(m)){for(p=0;p<m.classList.length;p++){var y=m.classList[parseInt(p.toString(),10)],S=y.match(/e-gridrowindex/i),v=y.match(/e-griddetailrowindex/i);null!=S&&t.removeClass([m],y),null!=v&&t.removeClass([m],y)}i[parseInt(h.toString(),10)].classList.contains("e-detailrow")?t.addClass([m],"e-griddetailrowindex"+u+"level"+g):t.addClass([m],"e-gridrowindex"+u+"level"+g)}}}},e.prototype.beginAdd=function(){var e,i=this.addRowIndex,r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchEditModule.getBatchRecords()));var n=this.parent.grid.getDataRows(),o=n.length?+n[0].getAttribute("aria-rowindex")-1:0,a=n.length?+n[n.length-1].getAttribute("aria-rowindex")-1:0,s=this.selectedIndex>=o&&this.selectedIndex<=a,d=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode&&("Above"===this.parent.editSettings.newRowPosition?e="before":("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(this.selectedIndex>-1||d)&&s&&(e="after",!t.isNullOrUndefined(r[parseInt(i.toString(),10)])&&r[parseInt(i.toString(),10)].expanded&&("Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)?(i+=c(r[parseInt(i.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition&&(i+=this.batchEditModule.getBatchChildCount())):this.parent.enableVirtualization||(i+=c(r[parseInt(i.toString(),10)]).length))),(this.selectedIndex>-1||d)&&s&&(i||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition))){i>=n.length-1&&(i=n.length-2);var l="rows",p=this.parent.grid.contentModule[""+l][0],h=document.activeElement;n[i+1][""+e](n[0]),t.setValue("batchIndex",i+1,this.batchEditModule);var u="Above"===this.parent.editSettings.newRowPosition?i:i+1;if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[""+l].splice(0,1),this.parent.grid.contentModule[""+l].splice(u,0,p)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var g=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),f=0;f<g.length;f++)g[parseInt(f.toString(),10)].remove();t.setValue("errorRules",[],this.parent.grid.editModule.formObj)}d&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,h.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}if("Batch"!==this.parent.editSettings.mode||t.isNullOrUndefined(this.addRowIndex)||-1===this.addRowIndex||this.isAddedMultipleRowsByMethod||!this.isAddedRowByMethod||this.isAddedRowByContextMenu){if("Batch"===this.parent.editSettings.mode&&this.isAddedMultipleRowsByMethod&&("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)){i=this.multipleRowIndex,this.selectedIndex=this.multipleRowIndex;var m=this.updatedRecords.addedRecords,y=void 0;if(m.length)for(f=0;f<m.length;f++){t.isNullOrUndefined(m[parseInt(f.toString(),10)].uniqueID)&&(y=m[parseInt(f.toString(),10)]);S={action:"add",data:y,index:i,seletedRow:0};this.beginAddEdit(S),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(S.data)}}}else{i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();y=void 0;if((m=this.parent.getBatchChanges().addedRecords).length)for(f=0;f<m.length;f++)t.isNullOrUndefined(m[parseInt(f.toString(),10)].uniqueID)&&(y=m[parseInt(f.toString(),10)]);var S={action:"add",data:y,index:i,seletedRow:0};this.beginAddEdit(S),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(S.data)}},e.prototype.beginEdit=function(e){if(0!==this.parent.flatData.length||t.isNullOrUndefined(this.addRowRecord)||(this.addRowRecord=void 0),"refresh"===e.requestType&&this.isOnBatch)return void(e.cancel=!0);if("Cell"===this.parent.editSettings.mode&&"beginEdit"===e.requestType)return void(e.cancel=!0);if(this.doubleClickTarget&&"delete"!==e.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))return e.cancel=!0,void(this.doubleClickTarget=null);if("delete"===e.requestType){var i=e.data;if(t.isNullOrUndefined(e.data[0].uniqueID))for(var r=this.parent.getPrimaryKeyFieldNames(),n=this,o=0;o<i.length;o++)!function(t){n.parent.flatData.filter(function(n){n[""+r[0]]===e.data[parseInt(t.toString(),10)][r[0]]&&(i[parseInt(t.toString(),10)]=n)})}(o);for(o=0;o<i.length;o++){this.deleteUniqueID(i[parseInt(o.toString(),10)].uniqueID);for(var a=c(i[parseInt(o.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.data=e.data.concat(a)}}if("add"===e.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){if((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||e.index!==this.parent.grid.selectedRowIndex)&&0!==e.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization){var d='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',l=void 0;this.selectedIndex>-1&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),l=this.parent.getContent().querySelector(d),this.addRowIndex=l?l.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(d='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',l=this.parent.getContent().querySelector(d),this.addRowIndex=l?l.rowIndex:0):this.addRowIndex=0}else this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==e.index?this.addRowIndex=e.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0;var p=this.parent.getSelectedRecords()[0];(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):t.isNullOrUndefined(p)||(this.addRowRecord=p)}this.isAddedRowByMethod&&0!==e.index&&(this.addRowRecord=this.parent.flatData[e.index],this.addRowIndex=e.index),"Child"!==this.parent.editSettings.newRowPosition||!this.isIndexUndefined&&!this.isAddedRowByMethod||t.isNullOrUndefined(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0],this.isIndexUndefined=!1),t.isNullOrUndefined(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===e.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,e=this.beginAddEdit(e)},e.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},e.prototype.beginAddEdit=function(e){var r=e.data;if("add"===e.action){var o=this.parent.grid.getPrimaryKeyFieldNames()[0],a=null;r.taskData=t.isNullOrUndefined(r.taskData)?t.extend({},e.data):r.taskData;var s=void 0;s=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!t.isNullOrUndefined(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex);var d=this.addRowIndex;r.uniqueID=i.getUid(this.parent.element.id+"_data_"),t.setValue("uniqueIDCollection."+r.uniqueID,r,this.parent);var l=0,p=void 0,h=void 0,u=void 0,g=void 0,f=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex,y=this.parent.getRows(),S=y.length?s.indexOf(s[0]):0,v=y.length?+y[y.length-1].getAttribute("aria-rowindex")-1:0,w=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=S&&this.selectedIndex<=v;if(s.length&&!t.isNullOrUndefined(d)&&(p=s[this.addRowIndex][this.parent.idMapping],g=s[this.addRowIndex][this.parent.parentIdMapping],s[this.addRowIndex].parentItem&&(h=s[this.addRowIndex].parentItem.uniqueID),u=s[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&s.length&&!t.isNullOrUndefined(d)){if(l=s[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition)a="before",d=s[this.addRowIndex].index;else if("Below"===this.parent.editSettings.newRowPosition){a="after";var R=c(s[this.addRowIndex]).length,x=s[this.addRowIndex].index;d=R>0?x+R:x}else if("Child"===this.parent.editSettings.newRowPosition){a="after",(this.selectedIndex>-1||f)&&w&&(r.parentItem=t.extend({},s[this.addRowIndex]),r.parentUniqueID=r.parentItem.uniqueID,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]);var C=c(s[this.addRowIndex]).length,b=s[this.addRowIndex].index;this.selectedIndex>=0&&(r.level=l+1),d=C>0?b+C:b,this.isSelfReference&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?r.taskData[this.parent.parentIdMapping]=r[this.parent.parentIdMapping]=p:r.taskData[this.parent.parentIdMapping]=r[this.parent.parentIdMapping]=null,t.isNullOrUndefined(r.parentItem)||I(o,r.parentItem,"add",this.parent,this.isSelfReference,r))}if("Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((this.selectedIndex>-1||f)&&l&&w&&(r.parentUniqueID=h,r.parentItem=t.extend({},u),delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]),r.level=l,this.isSelfReference&&(r.taskData[this.parent.parentIdMapping]=r[this.parent.parentIdMapping]=g,t.isNullOrUndefined(r.parentItem)||I(o,r.parentItem,"add",this.parent,this.isSelfReference,r))),null!=a&&(this.selectedIndex>-1||f)&&w&&(e.index="before"===a?d:d+1),"Bottom"===this.parent.editSettings.newRowPosition){l=0;var D=this.parent.grid.dataSource instanceof n.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;e.index=D.length}}t.isNullOrUndefined(r.level)&&(r.level=l),r.hasChildRecords=!1,r.childRecords=[],r.index=0}if("add"===e.action&&(this.internalProperties={level:r.level,parentItem:r.parentItem,uniqueID:r.uniqueID,taskData:r.taskData,parentUniqueID:t.isNullOrUndefined(r.parentItem)?void 0:r.parentItem.uniqueID,childRecords:r.childRecords}),"delete"===e.requestType){var M=e.data,O=this.parent.getPrimaryKeyFieldNames();if(!t.isNullOrUndefined(O)&&O.length>0)for(var P=this,A=0;A<M.length;A++)!function(e){var i=M[parseInt(e.toString(),10)].parentItem;if(i){var r=m(P.parent,i.uniqueID);if(!t.isNullOrUndefined(r)&&r.hasChildRecords){var n=r.childRecords.findIndex(function(t){return M[parseInt(e.toString(),10)][O[0]]===t[O[0]]});r.childRecords.splice(n,1)}}}(A)}return e},e.prototype.addRecord=function(e,i,r){if(this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),t.isNullOrUndefined(i)&&(this.isIndexUndefined=!0),!t.isNullOrUndefined(e)&&Array.isArray(e)){var n=[],o=this.parent.editSettings.mode,a=this.parent.grid.editSettings.mode;this.isSelfReference||t.isNullOrUndefined(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping)?Array.isArray(e)&&(n=e):n.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),t.isNullOrUndefined(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.updatedRecords={addedRecords:n,changedRecords:[],deletedRecords:[]},"Above"!==r&&"Below"!==r||!this.isSelfReference||(this.isAddedMultipleRowsByMethod=!0,this.multipleRowIndex=i,this.addRowIndex=i,this.parent.notify("batchAdd",{updatedRecords:this.updatedRecords,index:i}));s=this.updatedRecords;this.parent.notify("batchSave",{updatedRecords:s,index:i}),this.parent.setProperties({editSettings:{mode:o}},!0),this.parent.grid.setProperties({editSettings:{mode:a}},!0),this.parent.refresh()}else if(this.isSelfReference||t.isNullOrUndefined(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping))e?(i>-1?(this.selectedIndex=i,this.addRowIndex=i):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),r&&this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.parent.grid.editModule.addRecord(e,i)):this.parent.grid.editModule.addRecord(e,i);else{var n=[],o=this.parent.editSettings.mode,a=this.parent.grid.editSettings.mode;n.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),t.isNullOrUndefined(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.updatedRecords={addedRecords:n,changedRecords:[],deletedRecords:[]};var s=this.updatedRecords;this.parent.notify("batchSave",{updatedRecords:s,index:i}),this.parent.setProperties({editSettings:{mode:o}},!0),this.parent.grid.setProperties({editSettings:{mode:a}},!0),this.parent.refresh()}},e.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},e.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},e.prototype.contentready=function(e){t.isNullOrUndefined(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},e.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},e.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&this.parent.grid.pageSettings.currentPage>1&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()},e}(),_e=function(){function e(e){i.Grid.Inject(i.CommandColumn),this.parent=e}return e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){},e}(),He=function(){function e(e){i.Grid.Inject(i.DetailRow),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"detailRow"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},e.prototype.setIndentVisibility=function(e){e.visible=!1},e.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)].getElementsByClassName("e-detailrowcollapse"),o=this.parent.grid.getRowObjectFromUID(e[parseInt(r.toString(),10)].getAttribute("data-Uid")),a=i.getObject("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(r.toString(),10)]);(t.isNullOrUndefined(a)||!t.isNullOrUndefined(a)&&h(this.parent,o.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(n[0])}},e.prototype.childRowExpand=function(e){var i=e.row.getElementsByClassName("e-detailrowcollapse");t.isNullOrUndefined(i[0])||this.parent.grid.detailRowModule.expand(i[0])},e.prototype.rowExpandCollapse=function(e){if(!a(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},e.prototype.detaildataBound=function(e){var i=e.data,r=e.detailElement.parentElement.previousSibling,n="e-gridrowindex"+(t.isNullOrUndefined(i.parentItem)?i.index:i.parentItem.index)+"level"+i.level,o=r.querySelector("."+n).classList,a=[].slice.call(o).filter(function(e){return e===n}),s=a[0].length,d="e-griddetail"+a.toString().slice(6,s);t.addClass([e.detailElement.parentElement],d)},e.prototype.actioncomplete=function(e){if("beginEdit"===e.requestType||"add"===e.requestType){var t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),r=parseInt(t,10)-1;e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",r.toString())}for(var n=this.parent.grid.contentModule.getRows(),o=0;o<n.length;o++)n[parseInt(o.toString(),10)].cells[0].visible=!1;i.getObject("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},e.prototype.destroy=function(){this.removeEventListener()},e}(),Ge=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qe=function(e){function r(t,i){var r=e.call(this,t,i)||this;return r.isExpandCollapse=!1,r.translateY=0,r.maxiPage=0,r.recordAdded=!1,r.startIndex=-1,r.endIndex=-1,r.preTranslate=0,r.isRemoteExpand=!1,r.isDataSourceChanged=!1,r.addEventListener(),r}return Ge(r,e),r.prototype.getModelGenerator=function(){return new Ee(this.parent)},r.prototype.getRowByIndex=function(e){if(this.parent.enableVirtualization&&this.parent.isFrozenGrid())return this.getRowCollection(e,!0);var t=this.parent.getDataRows().find(function(t){return parseInt(t.getAttribute("aria-rowindex"),10)-1===e});return!t&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=e?this.parent.getRows()[parseInt(e.toString(),10)]:void 0:t},r.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},r.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute("aria-rowindex"),10)-1,o=this.parent.getDataRows(),a=(i?this.parent.getCurrentViewRecords():o)[e-n];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?o[parseInt(e.toString(),10)]:o[e-n+this.parent.frozenRows]),null==a&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t&&(a=o[parseInt(e.toString(),10)]),a},r.prototype.addEventListener=function(){this.parent.on("virtual-action-args",this.virtualOtherAction,this),this.parent.on("index-modifier",this.indexModifier,this)},r.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},r.prototype.indexModifier=function(e){var t=this.parent.getContent().querySelector(".e-content"),i=this.parent.pageSettings.pageSize;if((this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&this.startIndex>-1&&this.endIndex>-1){if(this.endIndex>e.count-i){var r=~~(t.scrollTop/this.parent.getRowHeight()),n=r+this.parent.getRows().length;n>e.count&&(n=r+(e.count-r)),this.startIndex=n-this.parent.getRows().length,this.endIndex=n}else("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1);this.recordAdded=!1}this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=i-1),this.endIndex-this.startIndex!==i&&this.totalRecords>i&&this.endIndex===this.totalRecords?(e.startIndex=this.endIndex-i,e.endIndex=this.endIndex):(e.startIndex=this.startIndex,e.endIndex=this.endIndex)},r.prototype.eventListener=function(t){var i=this;this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&s(this.parent)?e.prototype.eventListener.call(this,"on"):(this.parent[""+t]("data-ready",this.onDataReady,this),this.parent[""+t]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){i.observers.observes(function(e){return i.scrollListeners(e)},i.onEnteredAction(),i.parent);var e=i.parent;if(e.root.enablePersistence&&e.root.scrollPosition){i.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(i.content.scrollLeft=e.root.scrollPosition.left);var t={direction:"down",sentinel:i.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element};i.scrollListeners(t)}i.parent.off("content-ready",i.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+t]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener("actionBegin",this.handleActionBegin.bind(this)),this.parent.addEventListener("actionComplete",this.onActionComplete.bind(this)),this.parent[""+t]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+t]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+t]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+t]("edit-reset",this.resetIseditValue,this),this.parent[""+t]("get-virtual-data",this.getData,this),this.parent[""+t]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+t]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+t]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+t]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+t]("virtual-scroll-edit",this.restoreEditState,this),this.parent[""+t]("set-virtual-page-query",this.SetVirtualPageQury,this))},r.prototype.cellFocus=function(t){e.prototype.virtualCellFocus.call(this,t)},r.prototype.onDataReady=function(i){if(e.prototype.onDataReady.call(this,i),!(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&s(this.parent))){if(!t.isNullOrUndefined(i.count)){if(this.totalRecords=i.count,this.parent.isFrozenGrid()&&i.count<Object.keys(this.parent.dataSource).length){var r=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",o=this.parent.getRowHeight()*i.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize;t.getValue("virtualEle",this).setVirtualHeight(o,r)}this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()||t.getValue("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*i.count,"100%")}(!t.isNullOrUndefined(i.requestType)&&"collapseAll"===i.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1)}},r.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&s(this.parent)||(this.observers&&this.observers.disconnect(),t.getValue("observer",this).options.debounceEvent=!1,this.observers=new Ke(t.getValue("observer",this).element,t.getValue("observer",this).options),this.contents=this.getPanel().firstChild)},r.prototype.getTranslateY=function(t,i,r,o){if(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=e.prototype.getTranslateY.call(this,t,i,r,o)}return e.prototype.getTranslateY.call(this,t,i,r,o)},r.prototype.dataBoundEvent=function(){if(!t.isNullOrUndefined(this.parent.getRows())&&this.parent.getRows().length&&!t.isNullOrUndefined(this.parent.getRowByIndex(0))&&!this.initialRowTop){var i=this.parent.getRowByIndex(0).getBoundingClientRect().top,r=this.parent.element.getBoundingClientRect().top;i>0?this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-r:-1===this.parent.selectedRowIndex&&(this.initialRowTop=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)}e.prototype.dataBound.call(this)},r.prototype.rowSelectedEvent=function(t){e.prototype.rowSelected.call(this,t),this.parent.notify("virtualTransform",{requestType:"transformChange"})},r.prototype.toSelectVirtualRow=function(i){if(!this.parent.isEdit){t.isNullOrUndefined(this.observer.containerRect)&&(this.observer.containerRect=this.observers.containerRect);var r=this.parent.clipboardModule.treeGridParent;if(t.isNullOrUndefined(r.editModule)||t.isNullOrUndefined(r.editModule.addRowIndex)||0!==i.selectedIndex){if(!t.isNullOrUndefined(r.grid.sortModule)&&r.grid.sortModule.sortedColumns.length>0){var n=r.dataModule.sortedData;if(!t.isNullOrUndefined(n)&&n.length>0){var o=n.findIndex(function(e){return e.index===i.selectedIndex});i.selectedIndex=o}}e.prototype.selectVirtualRow.call(this,i)}}},r.prototype.refreshCell=function(e){e.cells=this.generateCells()},r.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},r.prototype.getVirtualRowIndex=function(e){return t.isNullOrUndefined(this.prevInfo)?e:this.parent.getRowsObject()[0].index+e},r.prototype.generateCell=function(e,r,n,o,a,s){var d={visible:e.visible,isDataCell:!t.isNullOrUndefined(e.field||e.template),isTemplate:!t.isNullOrUndefined(e.template),rowID:r,column:e,cellType:t.isNullOrUndefined(n)?i.CellType.Data:n,colSpan:o,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&t.getValue(e.field,s)};return(d.isDataCell||"checkbox"===d.column.type||d.commands)&&(d.index=a),new i.Cell(d)},r.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',i=this.parent.getContent().querySelector(t).rowIndex,r=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)];e.data=r},r.prototype.beginAdd=function(t){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=i.dataRowIndex;var r=this.parent.getRows(),n=r.length?+r[0].getAttribute("aria-rowindex")-1:0,o=r.length?+r[r.length-1].getAttribute("aria-rowindex")-1:0,a=this.parent.selectedRowIndex>=n&&this.parent.selectedRowIndex<=o;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&a)||e.prototype.addActionBegin.call(this,t)},r.prototype.restoreEditState=function(){e.prototype.restoreEdit.call(this)},r.prototype.SetVirtualPageQury=function(e){var t=[];if(this.prevInfo&&this.prevInfo.blockIndexes&&(t=i.getVisiblePage(this.prevInfo.blockIndexes)),"refresh"===this.requestType&&t.length)return e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),void(e.skipPage=!0)},r.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||e.prototype.resetIsedit.call(this)},r.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},r.prototype.cancelEdit=function(t){e.prototype.editCancel.call(this,t)},r.prototype.toSelectRowOnContextOpen=function(t){e.prototype.selectRowOnContextOpen.call(this,t)},r.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},r.prototype.getData=function(t){e.prototype.getVirtualData.call(this,t)},r.prototype.handleActionBegin=function(t){e.prototype.actionBegin.call(this,t)},r.prototype.onActionComplete=function(t){if("add"===t.requestType){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex}e.prototype.actionComplete.call(this,t)},r.prototype.onEnteredAction=function(){var e=this;return function(i,r,n,o,a,s){if(!e.parent.directVirtualRender){!t.Browser.isIE||a||!s||e.preventEvent||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.parent.enableVirtualMaskRow&&!e.preventEvent&&setTimeout(function(){e.parent.showMaskRow(r.axis),e.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0);var d=e.content.getBoundingClientRect().height,l=e.prevInfo.offsets?e.prevInfo.offsets.top:null,p="X"===r.axis,h=e.getColumnOffset(p?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(e.parent.isFrozenGrid()&&e.parent.enableColumnVirtualization&&e.currentInfo&&e.currentInfo.columnIndexes){var c=e.currentInfo.columnIndexes[0]-1,u=0;e.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(u+=parseInt(e.width.toString(),10))}),c>e.parent.getVisibleFrozenLeftCount()&&(h-=u)}if(p){var g=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,f=e.vgenerator.cOffsets[g-1];h=h>f?f:h}var m=e.getTranslateY(o.top,d,p&&l===o.top?e.prevInfo:void 0,!0);if(!e.parent.isFrozenGrid()||e.parent.enableVirtualMaskRow){if(e.parent.enableVirtualMaskRow){var y=o.top-e.translateY<0;m=Math.round(e.translateY)>m&&!y?Math.round(e.translateY):m,e.virtualEle.adjustTable(h,m)}else e.virtualEle.adjustTable(h,e.translateY);e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(h,0),e.parent.isFrozenGrid()&&e.parent.contentModule.resetStickyLeftPos(h))}}}},r.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var i,r=e.sentinel,o=this.parent.getRowHeight(),s=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2);t.isNullOrUndefined(this.parent.contentModule)||(i=this.parent.getContent().querySelector(".e-content"));var d=s*o,l=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,p=Math.ceil(e.offset.top-this.translateY)+o>=d,h=this.parent.currentViewData;if(l&&"right"!==e.direction&&"left"!==e.direction&&!t.isNullOrUndefined(i)){var c=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),u=Math.floor(i.scrollTop/o)+Math.ceil(c/o)-this.parent.pageSettings.pageSize;if(u=u>0?u:0,!t.isNullOrUndefined(this.selectedRowIndex)&&-1!==this.selectedRowIndex&&u!==this.selectedRowIndex&&this.parent.rowHeight*this.parent.pageSettings.pageSize<i.scrollTop&&!this.parent.allowRowDragAndDrop&&(u=this.selectedRowIndex),this.startIndex=u,this.endIndex=u+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords){var g=this.totalRecords,f=this.endIndex%g;this.endIndex=g,this.startIndex=this.startIndex-f<0?0:this.startIndex-f}h.length&&h[0].index>=this.parent.pageSettings.pageSize/2&&h[0].index-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=h[0].index-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize);var m=Math.ceil(e.offset.top/o);m%=this.parent.pageSettings.pageSize;var y=0;t.isNullOrUndefined(this.parent.getRows()[parseInt(m.toString(),10)])||t.isNullOrUndefined(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(m.toString(),10)])||(y=+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(m.toString(),10)].querySelector("td").getAttribute("index")),0===y?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=t.isNullOrUndefined(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight?this.parent.rowHeight:this.parent.getRowHeight()):this.startIndex===this.selectedRowIndex?this.translateY=e.offset.top:this.translateY=e.offset.top-s*o>0?e.offset.top-s*o+o:0:this.parent.getFrozenColumns()>0?(e.offset.top=e.offset.top+80,this.translateY=e.offset.top-s*o>0?e.offset.top-s*o+10:0):this.translateY=e.offset.top-s*o>0?e.offset.top-s*o+10:0}else if(p&&"right"!==e.direction&&"left"!==e.direction&&!t.isNullOrUndefined(i)){var S=~~(i.scrollTop/o),v=!(this.selectedRowIndex+this.parent.pageSettings.pageSize<this.totalRecords);t.isNullOrUndefined(this.selectedRowIndex)||-1===this.selectedRowIndex||S===this.selectedRowIndex||v||this.parent.allowRowDragAndDrop||(S=this.selectedRowIndex);var w=S+this.parent.pageSettings.pageSize;w>this.totalRecords&&(w=S+(this.totalRecords-S)),this.startIndex=!v||t.isNullOrUndefined(this.selectedRowIndex)?w-this.parent.pageSettings.pageSize:S,this.endIndex=w,S+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-S<this.parent.pageSettings.pageSize/2&&(this.startIndex=w-this.parent.pageSettings.pageSize/2),e.offset.top>o*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,i.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o+o:this.translateY=this.totalRecords*o-this.parent.pageSettings.pageSize*o):this.parent.getFrozenColumns()>0?this.translateY=e.offset.top-(2*o+this.parent.pageSettings.pageSize):this.translateY=e.offset.top}if(p&&"up"!==e.direction&&e.offset.top<o*this.totalRecords||l||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url){var I=this.currentInfo=t.getValue("getInfoFromView",this).apply(this,[e.direction,r,e.offset]);if(this.previousInfo=I,this.prevInfo&&a(this.parent.root)&&"model-changed"!==I.event&&("Y"===r.axis&&this.prevInfo.blockIndexes.toString()===I.blockIndexes.toString()||"X"===r.axis&&this.prevInfo.columnIndexes.toString()===I.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=I.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(I.columnIndexes.toString())))return this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,void("Y"===r.axis&&this.restoreEditState());this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?I.columnIndexes:[]);var R=I.loadNext&&!I.loadSelf?I.nextInfo.page:I.page;this.parent.setProperties({pageSettings:{currentPage:R}},!0),this.requestType="virtualscroll","right"===e.direction||"left"===e.direction||a(this.parent.root)||(I.event="refresh-virtual-block"===I.event?"model-changed":I.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(r.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(I.event,{requestType:"virtualscroll",virtualInfo:I,focusElement:e.focusElement})}else this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},r.prototype.shouldPreventScrolling=function(e){if(this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top)return void this.parent.closeEdit()},r.prototype.appendContent=function(i,r,o){if(this.parent.dataSource instanceof n.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||s(this.parent)||this.parent.isFrozenGrid()&&(void 0===o.requestType||!t.isNullOrUndefined(o.virtualInfo)&&("right"===o.virtualInfo.direction||"left"===o.virtualInfo.direction)))t.getValue("isExpandCollapse",o)&&(this.isRemoteExpand=!0),e.prototype.appendContent.call(this,i,r,o),-1!==t.getValue("requestTypes",this).indexOf("isFrozen")&&(t.getValue("requestTypes",this).splice(t.getValue("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType);else{var a=o.virtualInfo.sentinelInfo&&"Y"===o.virtualInfo.sentinelInfo.axis&&t.getValue("currentInfo",this).page&&t.getValue("currentInfo",this).page!==o.virtualInfo.page?t.getValue("currentInfo",this):o.virtualInfo,d=a.columnIndexes[0]-1,l=this.getColumnOffset(d),p=void 0;if(this.parent.enableColumnVirtualization){this.header.virtualEle.adjustTable(l,0);u=a.columnIndexes;p=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",this.header.virtualEle.setWrapperWidth(p)}this.virtualEle.setWrapperWidth(p,t.Browser.isIE||"edge"===t.Browser.info.name),(i=this.parent.createElement("tbody")).appendChild(r);this.getTable().querySelector("tbody").replaceWith(i),"virtualscroll"===o.requestType&&"Y"===o.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1);var h=0;if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){var c=0;this.parent.getColumns().filter(function(e){e.visible&&(h+=parseInt(e.width.toString(),10),"Left"===e.freeze&&(c+=parseInt(e.width.toString(),10)))});var u=a.columnIndexes;p=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",d>this.parent.getVisibleFrozenLeftCount()&&(l-=c),this.resetStickyLeftPos(l,r)}this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,t.getValue("virtualEle",this).adjustTable(l,this.translateY),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(l,0),this.parent.isFrozenGrid()&&this.resetStickyLeftPos(l))),t.setValue("prevInfo",this.previousInfo?this.previousInfo:a,this),"virtualscroll"===o.requestType&&"X"===o.virtualInfo.sentinelInfo.axis&&this.parent.notify("auto-col",{});e.prototype.focusCell.call(this,o);this.isAdd&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&this.addRowIndex>-1&&(this.isAdd=!1,this.parent.isEdit=!1)),this.restoreEditState(),e.prototype.restoreAdd.call(this),e.prototype.ensureSelectedRowPosition.call(this)}},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off("virtual-action-args",this.virtualOtherAction),this.parent.off("index-modifier",this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState),this.observers&&this.observers.disconnect())},r}(i.VirtualContentRenderer),Ke=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.isWheeling=!1,t.newPos=0,t.lastPos=0,t.timer=0,t}return Ge(i,e),i.prototype.observes=function(i,r,n){if(e.prototype.containerRect=t.getValue("options",this).container.getBoundingClientRect(),this.containerEl=t.getValue("options",this).container,this.containerScrollHandler=this.virtualScrollHandlers(i,r,n),t.EventHandler.add(this.containerEl,"scroll",this.containerScrollHandler,this),t.getValue("options",this).movableContainer){e.prototype.movableContainerRect=t.getValue("options",this).movableContainer.getBoundingClientRect(),this.movableContainerEl=t.getValue("options",this).movableContainer,this.movableScrollHandler=this.virtualScrollHandlers(i,r,n),t.EventHandler.add(this.movableContainerEl,"scroll",this.movableScrollHandler,this)}},i.prototype.disconnect=function(){this.containerEl&&this.containerScrollHandler&&(t.EventHandler.remove(this.containerEl,"scroll",this.containerScrollHandler),this.containerScrollHandler=null),this.movableContainerEl&&this.movableScrollHandler&&(t.EventHandler.remove(this.movableContainerEl,"scroll",this.movableScrollHandler),this.movableScrollHandler=null),this.containerEl=null,this.movableContainerEl=null},i.prototype.clear=function(){this.lastPos=null},i.prototype.virtualScrollHandlers=function(e,i,r){var o=this,a="chrome"===t.Browser.info.name?200:100,d=t.debounce(e,a),l=t.debounce(e,50);this.options.prevTop=this.options.prevLeft=0;return function(t){var a;if(r&&r.root&&r.root.editModule&&r.root.editModule.keyPress&&(a=r.root.editModule.keyPress),r.isEdit&&r.root.editModule.isScrollByFocus||r.isEdit&&("tab"===a||"shiftTab"===a))return void(r.root.editModule.isScrollByFocus=!1);var p=o.options.movableContainer?o.options.container.scrollTop:t.target.scrollTop,h=o.options.movableContainer?o.options.scrollbar.scrollLeft:t.target.scrollLeft,c=o.options.prevTop<p?"down":"up";c=o.options.prevLeft===h?c:o.options.prevLeft<h?"right":"left",o.options.prevTop=p,o.options.prevLeft=h;var u=o.sentinelInfo[""+c],g=0;if(o.newPos=p,null!=o.lastPos&&(g=o.newPos-o.lastPos),o.lastPos=o.newPos,o.timer&&clearTimeout(o.timer),o.timer=setTimeout(o.clear,0),(g>100||g<-100)&&t&&t.preventDefault&&(t.returnValue=!1,t.preventDefault()),-1!==o.options.axes.indexOf(u.axis)){o.containerRect=o.options.container.getBoundingClientRect();var f=o.check(c);if(u.entered&&("X"===u.axis||r.enableVirtualMaskRow)&&(!o.movableEle||"right"!==c&&"left"!==c?i(o.element,u,c,{top:p,left:h},o.fromWheel,f):i(o.movableEle,u,c,{top:p,left:h},o.fromWheel,f)),f){var m=l;"X"===u.axis?m({direction:c,sentinel:u,offset:{top:p,left:h},focusElement:document.activeElement}):r.dataSource instanceof n.DataManager&&void 0!==r.dataSource.dataSource.url&&!r.dataSource.dataSource.offline&&""!==r.dataSource.dataSource.url||s(r)||r.enableVirtualMaskRow?(m=r.enableVirtualMaskRow?d:m)({direction:c,sentinel:u,offset:{top:p,left:h},focusElement:document.activeElement}):e({direction:c,sentinel:u,offset:{top:p,left:h},focusElement:document.activeElement})}o.fromWheel=!1}}},i}(i.InterSectionObserver),We=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ye=function(){function e(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,i.Grid.Inject(Je),this.addEventListener()}return e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("localPagedExpandCollapse",this.collapseExpandVirtualchilds,this),this.parent.on("pagingActions",this.virtualPageAction,this),this.parent.on("destroy",this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("localPagedExpandCollapse",this.collapseExpandVirtualchilds),this.parent.off("pagingActions",this.virtualPageAction),this.parent.off("destroy",this.destroy))},e.prototype.collapseExpandVirtualchilds=function(e){this.parent.grid.notify("virtual-action-args",{isExpandCollapse:!0}),this.expandCollapseRec=e.record,e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded});var i={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};this.handleSelection();var r=t.getValue("isCollapseAll",this.parent)?"collapseAll":"refresh";t.getValue("grid.renderModule",this.parent).dataManagerSuccess(i,{requestType:r})},e.prototype.handleSelection=function(){("Cell"===this.parent.selectionSettings.mode||"Row"===this.parent.selectionSettings.mode&&!this.parent.selectionSettings.persistSelection)&&this.parent.grid.clearSelection(),t.getValue("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&this.parent.getSelectedRecords().length>0&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},e.prototype.virtualPageAction=function(e){var r=this,o=new n.DataManager(e.result),a=new n.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),s=o.executeLocal((new n.Query).where(a)),d="filtering"===e.actionArgs.requestType,l="Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode,p=d&&l?s:s.filter(function(e){return h(r.parent,e)});this.visualData=p,e.count=p.length,this.parent.grid.notify("data-listener",{data:p});var c={startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType};this.parent.grid.notify("index-modifier",c);var u=c.startIndex,g=c.endIndex;if(e.count=p.length,-1===u&&-1===g){var f=new n.Query,m=this.parent.grid.pageSettings.pageSize,y=m*(this.parent.grid.pageSettings.currentPage-1);f=f.skip(y).take(m),o.dataSource.json=p,e.result=o.executeLocal(f)}else{var S=e.actionArgs.requestType;("filtering"===S||"collapseAll"===S||"searching"===S||"refresh"===S&&t.getValue("isExpandAll",this.parent)||"refresh"===S&&this.parent.enableCollapseAll&&g>p.length&&t.isNullOrUndefined(this.expandCollapseRec))&&(u=0,g=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify("virtual-action-args",{setTop:!0})),("save"===S&&e.actionArgs.index>=c.count-this.parent.grid.pageSettings.pageSize||"refresh"===S&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=c.endIndex),(c.endIndex+this.parent.pageSettings.pageSize>=c.count&&this.parent.root&&c.count!==this.ganttEndIndex&&this.parent.isAddedFromGantt||!this.parent.isGantt||!this.parent.isAddedFromGantt)&&(u=c.startIndex+(c.count-c.endIndex),g=c.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=g,this.parent.isAddedFromGantt=!1);var v=this.parent.grid.contentModule.virtualEle.wrapper,w=i.getTransformValues(v).height;if(!t.isNullOrUndefined(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&u!==this.prevstartIndex)&&u<this.parent.getRows().length&&g<=u+this.parent.getRows().length&&0===w&&(u=0),"save"===e.actionArgs.requestType&&u!==this.prevstartIndex&&u<this.parent.getRows().length&&g<=u+this.parent.getRows().length&&0===w&&(g=(u=0)+this.parent.grid.pageSettings.pageSize),!t.isNullOrUndefined(this.expandCollapseRec)){var I=this.parent.grid.pageSettings.pageSize,R=p.indexOf(this.expandCollapseRec);if(p.slice(R,R+I).length<I&&R>=0&&0!==u){if(R=p.length-I,R=R>0?R:0,(g=p.length)-u<I&&(u=R,p.indexOf(this.expandCollapseRec)>p.length-I/2)){var x=u*this.parent.grid.getRowHeight();this.parent.grid.contentModule.translateY=x,this.parent.grid.contentModule.virtualEle.adjustTable(0,x)}}else t.getValue("isCollapseAll",this.parent)&&(u=0,g=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify("virtual-action-args",{setTop:!0}))}"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||t.isNullOrUndefined(this.parent.idMapping)||0!==u||(u=0,g=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify("virtual-action-args",{setTop:!0})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||t.isNullOrUndefined(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?u=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(u=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,u=u<0?0:u,0===g&&p.length>0?e.result=p:e.result=p.slice(u,g),this.prevstartIndex=u,this.prevendIndex=g,this.prevrequestType=e.actionArgs.requestType}this.parent.notify("updateAction",e)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length&&e.target.classList.contains("e-uncheck"))for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&!this.parent.getRows()[parseInt(t.toString(),10)].querySelector(".e-checkbox-disabled")&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},e}(),Je=function(e){function r(i,r){var n=e.call(this,i,r)||this;return t.getValue("parent",n).off("initial-load",t.getValue("instantiateRenderer",n),n),t.getValue("parent",n).on("initial-load",n.instantiateRenderers,n),n}return We(r,e),r.prototype.getModuleName=function(){return"treeVirtualScroll"},r.prototype.instantiateRenderers=function(){var e=t.getValue("parent",this);t.getValue("parent",this).log(["limitation","virtual_height"],"virtualization");var r=t.getValue("locator",this).getService("rendererFactory");e.enableColumnVirtualization&&t.getValue("addRenderer",r).apply(r,[i.RenderType.Header,new i.VirtualHeaderRenderer(t.getValue("parent",this),t.getValue("locator",this))]),t.getValue("addRenderer",r).apply(r,[i.RenderType.Content,new Qe(t.getValue("parent",this),t.getValue("locator",this))]),this.ensurePageSize()},r.prototype.ensurePageSize=function(){var e=t.getValue("parent",this),i=e.getRowHeight();t.isNullOrUndefined(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var r=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/i),n=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:n<r?r:n}},!0)},r}(i.VirtualScroll),Xe=function(){function e(e){i.Grid.Inject(i.Freeze),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},e.prototype.rowExpandCollapse=function(e){var i,r,n=this.parent.getDataRows(),o=this.parent.getRows(),a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;a&&(r=this.parent.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))})),i=e.detailrows.length?e.detailrows:n.filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))});for(var s=0;s<i.length;s++){var d=i[parseInt(s.toString(),10)],l=this.parent.grid.getRowObjectFromUID(d.getAttribute("data-uid")).data;!t.isNullOrUndefined(n)&&d.parentElement.firstElementChild.clientHeight>0&&(d.style.height=d.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(d,e.action),a&&r.length&&this.parent.toggleRowVisibility(r[parseInt(s.toString(),10)],e.action);var p="e-childrow-hidden"===e.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand";if(o[parseInt(d.getAttribute("aria-rowindex"),10)-1].querySelector(p)){for(var h=[],c=0;c<n.length;c++)n[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&h.push(n[parseInt(c.toString(),10)]);if(h.length){var u=this.parent.getCurrentViewRecords()[h[0].rowIndex];this.rowExpandCollapse({detailrows:h,action:e.action,record:u})}}}},e.prototype.dblClickHandler=function(e){i.parentsUntil(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit(i.parentsUntil(e.target,"e-row"))},e.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&t.addClass([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getModuleName=function(){return"freeze"},e}(),$e=function(){function e(e){i.Grid.Inject(i.ColumnChooser),this.parent=e}return e.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"ColumnChooser"},e}(),Ze=function(){function e(e){this.parent=e,i.Grid.Inject(i.InfiniteScroll),this.addEventListener()}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on("pagingActions",this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off("pagingActions",this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},e.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),r=this.parent.grid.infiniteScrollModule.serviceLocator,n=new i.RowRenderer(r,null,this.parent.grid),o=this.parent.getRows(),a=e.index===o.length-1?"after":"before",s=this.parent.grid.getColumns(),d=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),l=[],p=0;p<d.length;p++)l.push(n.render(d[parseInt(p.toString(),10)],s));t.splice.apply(t,[e.index+1,0].concat(d));for(p=0;p<l.length;p++)"after"===a?o[e.index+p][""+a](l[parseInt(p.toString(),10)]):o[e.index+p+1][""+a](l[parseInt(p.toString(),10)]),o.splice(e.index+1+p,0,l[parseInt(p.toString(),10)]);i.resetRowIndex(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},e.prototype.contentready=function(){if(this.parent.infiniteScrollSettings.enableCache&&!t.isNullOrUndefined(this.parent.editModule)){this.parent.editModule.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns()&&this.parent.editModule.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())}},e.prototype.infinitePageAction=function(e){var i=new n.DataManager(e.result),r=new n.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),o=i.executeLocal((new n.Query).where(r)),a=t.getValue("actionArgs",e.actionArgs),s=t.getValue("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var d=!!s.some(function(e){return e===a.requestType})||!!this.parent.initialRender;if(this.visualData=o,e.count=o.length,t.getValue("isPrinting",e.actionArgs))e.result=o;else{var l=new n.Query,p=this.parent.infiniteScrollSettings.enableCache;p&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var h=d?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,c=this.parent.grid.pageSettings.currentPage;if(t.isNullOrUndefined(a))l=l.page(c,h);else{var u=t.getValue("lastIndex",this.parent.grid.infiniteScrollModule),g=t.getValue("firstIndex",this.parent.grid.infiniteScrollModule);if(p||"delete"!==a.requestType)l=p&&"delete"===a.requestType||"save"===a.requestType&&"add"===a.action?(l=l.skip(g)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):l.page(c,h);else{var f=u-a.data.length+1,m=a.data.length;l=l.skip(f).take(m)}}i.dataSource.json=o,p||t.isNullOrUndefined(a)||"save"!==a.requestType||"add"!==a.action?e.result=i.executeLocal(l):e.result=[a.data]}this.parent.notify("updateAction",e)},e.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&e.result.length>1)for(var r=1;r<e.result.length;r++)t[i[i.length-1]].push(e.result[parseInt(r.toString(),10)])},e.prototype.infiniteDeleteHandler=function(e){if("delete"===e.requestType){var t=this.parent.grid.getRowsObject(),i=this.parent.getRows(),r=e.data instanceof Array?e.data:[e.data],n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(this.removeRows(i,t,r,n,!0),this.parent.getFrozenColumns()>0){var o=this.parent.grid.getRowsObject(),a=this.parent.grid.getRows();this.removeRows(a,o,r,n)}}},e.prototype.removeRows=function(e,i,r,n,o){for(var a=this,s=0;s<r.length;s++)!function(s){i.filter(function(d,l){if(d.data[""+n]===r[parseInt(s.toString(),10)][""+n]){if(o){var p=Math.ceil((l+1)/a.parent.grid.pageSettings.pageSize);a.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(p,l)}i.splice(l,1),t.remove(e[parseInt(l.toString(),10)]),e.splice(l,1)}})}(s)},e.prototype.createRows=function(e){var r,n=e.args.e,o=e.row,a=this.parent.grid.infiniteScrollModule.serviceLocator,s=new i.RowRenderer(a,null,this.parent.grid),d=this.parent.getCurrentViewRecords(),l=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows();r=e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content").querySelector("tbody"):this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid.getContent().querySelector("tbody")):this.parent.getContent().querySelector("tbody"),this.parent.frozenRows&&(r=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?this.parent.grid.isFrozenGrid()?e.isMovable?this.parent.grid.getHeaderContent().querySelector("tbody"):e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header").querySelector("tbody"):this.parent.grid.getHeaderContent().querySelector("tbody"):this.parent.getHeaderContent().querySelector("tbody"):r);for(var p,h=this.parent.editModule.addRowIndex,u=0;u<o.length;u++){var g=s.render(o[parseInt(u.toString(),10)],this.parent.grid.getColumns());"save"===n.requestType&&"add"===n.action?-1!==t.getValue("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(p="after",h+=c(d[parseInt(h.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&(h-=1),l[parseInt(h.toString(),10)][""+p](g)):"Above"===this.parent.editSettings.newRowPosition&&(p="before",l[this.parent.editModule.addRowIndex][""+p](g)):"Bottom"===this.parent.editSettings.newRowPosition?r.appendChild(g):r.insertBefore(g,r.firstElementChild):"delete"===n.requestType&&r.appendChild(g)}e.cancel=!0},e.prototype.destroy=function(){this.removeEventListener()},e}();return xe.Inject(Ne,qe,Ve,Ce,Be,Te,be,ze,Ue,ke,_e,Le,je,G,Ye,He,De,Xe,$e,F,Ze),e.Aggregate=Te,e.AggregateColumn=ae,e.AggregateRow=se,e.Column=C,e.ColumnChooser=$e,e.ColumnMenu=ze,e.CommandColumn=_e,e.ContextMenu=Le,e.DataManipulation=ee,e.DetailRow=He,e.Edit=je,e.EditSettings=pe,e.ExcelExport=Ue,e.Filter=Ne,e.FilterSettings=U,e.Freeze=Xe,e.InfiniteScroll=Ze,e.InfiniteScrollSettings=ye,e.LoadingIndicator=P,e.Logger=F,e.Page=qe,e.PageSettings=re,e.PdfExport=ke,e.Predicate=N,e.Render=Z,e.Reorder=Ce,e.Resize=be,e.RowDD=De,e.RowDropSettings=Pe,e.SearchSettings=Y,e.Selection=G,e.SelectionSettings=$,e.Sort=Ve,e.SortDescriptor=ue,e.SortSettings=ge,e.StackedColumn=D,e.Toolbar=Be,e.TreeClipboard=H,e.TreeGrid=xe,e.TreeGridColumn=b,e.TreeVirtual=Je,e.TreeVirtualRowModelGenerator=Ee,e.VirtualScroll=Ye,e.actionBegin="actionBegin",e.actionComplete="actionComplete",e.actionFailure="actionFailure",e.ariaColIndex="aria-colindex",e.ariaRowIndex="aria-rowindex",e.autoCol="auto-col",e.batchAdd="batchAdd",e.batchCancel="batchCancel",e.batchDelete="batchDelete",e.batchEditFormRendered="batcheditform-rendered",e.batchSave="batchSave",e.beforeBatchAdd="beforeBatchAdd",e.beforeBatchCancel="before-batch-cancel",e.beforeBatchDelete="beforeBatchDelete",e.beforeBatchSave="beforeBatchSave",e.beforeCopy="beforeCopy",e.beforeDataBound="beforeDataBound",e.beforeExcelExport="beforeExcelExport",e.beforePaste="beforePaste",e.beforePdfExport="beforePdfExport",e.beforeStartEdit="edit-form",e.beginAdd="beginAdd",e.beginEdit="beginEdit",e.cellEdit="cellEdit",e.cellSave="cellSave",e.cellSaved="cellSaved",e.checkboxChange="checkboxChange",e.collapsed="collapsed",e.collapsing="collapsing",e.content="e-content",e.contextMenuClick="contextMenuClick",e.contextMenuOpen="contextMenuOpen",e.crudAction="crudAction",e.dataBound="dataBound",e.dataListener="data-listener",e.dataStateChange="dataStateChange",e.destroy="destroy",e.detailDataBound="detailDataBound",e.doubleTap="double-tap",e.expanded="expanded",e.expanding="expanding",e.extendArray=g,e.findChildrenRecords=c,e.findParentRecords=p,e.frozenContent="e-frozencontent",e.frozenHeader="e-frozenheader",e.frozenLeft="frozen-left",e.frozenRight="frozen-right",e.getExpandStatus=h,e.getParentData=m,e.getPlainData=f,e.headerContent="e-headercontent",e.indexModifier="index-modifier",e.isCheckboxcolumn=d,e.isCountRequired=s,e.isFilterChildHierarchy=l,e.isHidden=y,e.isOffline=u,e.isRemoteData=a,e.keyPressed="key-pressed",e.leftRight="Left-Right",e.load="load",e.localPagedExpandCollapse="localPagedExpandCollapse",e.movableContent="e-movablecontent",e.movableHeader="e-movableheader",e.pagingActions="pagingActions",e.printGridInit="printGrid-Init",e.queryCellInfo="queryCellInfo",e.recordDoubleClick="recordDoubleClick",e.remoteExpand="remoteExpand",e.resizeStop="resizeStop",e.rowDataBound="rowDataBound",e.rowDeselected="rowDeselected",e.rowDeselecting="rowDeselecting",e.rowDrag="rowDrag",e.rowDragStart="rowDragStart",e.rowDragStartHelper="rowDragStartHelper",e.rowDrop="rowDrop",e.rowDropped="row-dropped",e.rowSelected="rowSelected",e.rowSelecting="rowSelecting",e.rowdraging="row-draging",e.rowsAdd="rows-add",e.rowsRemove="rows-remove",e.savePreviousRowPosition="savePreviousRowPosition",e.table="e-table",e.toolbarClick="toolbarClick",e.treeGridDetails=j,e.updateData="update-data",e.virtualActionArgs="virtual-action-args",e.virtualColumnIndex="virtualColumnIndex",e}({},ej.base,ej.grids,ej.buttons,ej.data,ej.popups),this.ejs=ej;
|
|
11
2
|
//# sourceMappingURL=ej2-treegrid.min.js.map
|