@syncfusion/ej2-treegrid 25.2.6 → 26.1.35
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/.eslintrc.json +3 -2
- package/dist/ej2-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +621 -462
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +922 -762
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -10
- package/src/treegrid/actions/edit.js +8 -7
- package/src/treegrid/actions/excel-export.js +4 -3
- package/src/treegrid/actions/page.js +4 -0
- package/src/treegrid/actions/rowdragdrop.js +13 -11
- package/src/treegrid/actions/selection.js +4 -1
- package/src/treegrid/base/constant.d.ts +2 -0
- package/src/treegrid/base/constant.js +2 -0
- package/src/treegrid/base/data.js +2 -1
- package/src/treegrid/base/interface.js +0 -1
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +3 -0
- package/src/treegrid/base/treegrid.js +230 -62
- package/src/treegrid/renderer/virtual-row-model-generator.js +2 -2
- package/src/treegrid/renderer/virtual-tree-content-render.js +2 -1
- package/styles/bootstrap-dark.css +76 -48
- package/styles/bootstrap-dark.scss +18 -1
- package/styles/bootstrap.css +76 -49
- package/styles/bootstrap.scss +18 -1
- package/styles/bootstrap4.css +77 -48
- package/styles/bootstrap4.scss +18 -1
- package/styles/bootstrap5-dark.css +77 -49
- package/styles/bootstrap5-dark.scss +18 -1
- package/styles/bootstrap5.css +77 -49
- package/styles/bootstrap5.scss +18 -1
- package/styles/fabric-dark.css +74 -47
- package/styles/fabric-dark.scss +18 -1
- package/styles/fabric.css +74 -47
- package/styles/fabric.scss +18 -1
- package/styles/fluent-dark.css +77 -49
- package/styles/fluent-dark.scss +18 -1
- package/styles/fluent.css +77 -49
- package/styles/fluent.scss +18 -1
- package/styles/fluent2.css +1721 -0
- package/styles/fluent2.scss +18 -0
- package/styles/highcontrast-light.css +74 -47
- package/styles/highcontrast-light.scss +18 -1
- package/styles/highcontrast.css +74 -47
- package/styles/highcontrast.scss +18 -1
- package/styles/material-dark.css +111 -54
- package/styles/material-dark.scss +18 -1
- package/styles/material.css +125 -57
- package/styles/material.scss +18 -1
- package/styles/material3-dark.css +111 -56
- package/styles/material3-dark.scss +18 -1
- package/styles/material3.css +111 -56
- package/styles/material3.scss +18 -1
- package/styles/tailwind-dark.css +87 -51
- package/styles/tailwind-dark.scss +18 -1
- package/styles/tailwind.css +87 -51
- package/styles/tailwind.scss +18 -1
- package/styles/treegrid/_bds-definition.scss +0 -4
- package/styles/treegrid/_bootstrap-dark-definition.scss +0 -1
- package/styles/treegrid/_bootstrap-definition.scss +0 -1
- package/styles/treegrid/_bootstrap4-definition.scss +0 -1
- package/styles/treegrid/_bootstrap5-definition.scss +0 -4
- package/styles/treegrid/_bootstrap5.3-definition.scss +24 -0
- package/styles/treegrid/_fabric-dark-definition.scss +0 -1
- package/styles/treegrid/_fabric-definition.scss +0 -1
- package/styles/treegrid/_fluent-definition.scss +0 -4
- package/styles/treegrid/_fluent2-definition.scss +24 -0
- package/styles/treegrid/_fusionnew-definition.scss +0 -4
- package/styles/treegrid/_highcontrast-definition.scss +0 -1
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -1
- package/styles/treegrid/_layout.scss +81 -85
- package/styles/treegrid/_material-dark-definition.scss +0 -1
- package/styles/treegrid/_material-definition.scss +0 -1
- package/styles/treegrid/_material3-definition.scss +0 -4
- package/styles/treegrid/_tailwind-definition.scss +0 -4
- package/styles/treegrid/bootstrap-dark.css +76 -48
- package/styles/treegrid/bootstrap.css +76 -49
- package/styles/treegrid/bootstrap4.css +77 -48
- package/styles/treegrid/bootstrap5-dark.css +77 -49
- package/styles/treegrid/bootstrap5.css +77 -49
- package/styles/treegrid/fabric-dark.css +74 -47
- package/styles/treegrid/fabric.css +74 -47
- package/styles/treegrid/fluent-dark.css +77 -49
- package/styles/treegrid/fluent.css +77 -49
- package/styles/treegrid/fluent2.css +1721 -0
- package/styles/treegrid/fluent2.scss +18 -0
- package/styles/treegrid/highcontrast-light.css +74 -47
- package/styles/treegrid/highcontrast.css +74 -47
- package/styles/treegrid/icons/_bootstrap5.3.scss +37 -0
- package/styles/treegrid/icons/_fluent2.scss +37 -0
- package/styles/treegrid/material-dark.css +111 -54
- package/styles/treegrid/material.css +125 -57
- package/styles/treegrid/material3-dark.css +111 -56
- package/styles/treegrid/material3.css +111 -56
- package/styles/treegrid/tailwind-dark.css +87 -51
- package/styles/treegrid/tailwind.css +87 -51
- package/CHANGELOG.md +0 -264
package/dist/ej2-treegrid.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-treegrid.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 26.1.35
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionGrids"),require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionPopups"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionGrids","SyncfusionBase","SyncfusionData","SyncfusionPopups","SyncfusionButtons"],t):"object"==typeof exports?exports.SyncfusionTreegrid=t(require("SyncfusionGrids"),require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionPopups"),require("SyncfusionButtons")):e.SyncfusionTreegrid=t(e.SyncfusionGrids,e.SyncfusionBase,e.SyncfusionData,e.SyncfusionPopups,e.SyncfusionButtons)}(this,function(e,t,i,r,n){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=27)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t,i){"use strict";function r(e){if(e.dataSource instanceof y.DataManager){var t=e.dataSource.adaptor;return t instanceof y.ODataAdaptor||t instanceof y.WebApiAdaptor||t instanceof y.WebMethodAdaptor||t instanceof y.CacheAdaptor||t instanceof y.UrlAdaptor}return!1}function n(e){return!!(e.dataSource&&"result"in e.dataSource)}function o(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function a(e){return!((i.i(m.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 s(e){for(var t=[],r=Object.keys(e).length,n=0,o=r;n<o;n++){i.i(f.getObject)("hasChildRecords",e[parseInt(n.toString(),10)])&&t.push(e[parseInt(n.toString(),10)])}return t}function d(e,t,r){var n,o=i.i(m.isNullOrUndefined)(t.parentItem)?null:u(e,t.parentItem.uniqueID);return null==o||(!e.initialRender||i.i(m.isNullOrUndefined)(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||(n=u(e,o.parentItem.uniqueID),n&&e.initialRender&&!i.i(m.isNullOrUndefined)(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||d(e,n,r)))):(o.expanded=!1,!1))}function l(e){var t=[];if(i.i(m.isNullOrUndefined)(e)||!e.hasChildRecords&&!i.i(m.isNullOrUndefined)(e.childRecords)&&!e.childRecords.length)return[];if(!i.i(m.isNullOrUndefined)(e.childRecords))for(var r=e.childRecords.filter(function(e){return!e.isSummaryRow}),n=Object.keys(r),o=0,a=n.length;o<a;o++)t.push(r[parseInt(o.toString(),10)]),(r[parseInt(o.toString(),10)].hasChildRecords||!i.i(m.isNullOrUndefined)(r[parseInt(o.toString(),10)].childRecords)&&r[parseInt(o.toString(),10)].childRecords.length)&&(t=t.concat(l(r[parseInt(o.toString(),10)])));return t}function p(e){if(r(e)){var t=e.dataSource;return!i.i(m.isNullOrUndefined)(t.ready)}return!0}function c(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 h(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 u(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function g(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}t.a=r,t.b=n,t.c=o,t.d=a,t.e=s,t.f=d,t.g=l,t.h=p,t.i=c,t.j=h,t.k=u,t.l=g;var f=i(0),y=(i.n(f),i(4)),m=(i.n(y),i(1));i.n(m)},function(e,t,i){"use strict";i.d(t,"K",function(){return r}),i.d(t,"I",function(){return n}),i.d(t,"L",function(){return o}),i.d(t,"J",function(){return a}),i.d(t,"M",function(){return s}),i.d(t,"v",function(){return d}),i.d(t,"N",function(){return l}),i.d(t,"h",function(){return p}),i.d(t,"O",function(){return c}),i.d(t,"D",function(){return h}),i.d(t,"j",function(){return u}),i.d(t,"E",function(){return g}),i.d(t,"F",function(){return f}),i.d(t,"H",function(){return y}),i.d(t,"G",function(){return m}),i.d(t,"P",function(){return v}),i.d(t,"Q",function(){return S}),i.d(t,"R",function(){return I}),i.d(t,"S",function(){return w}),i.d(t,"T",function(){return R}),i.d(t,"U",function(){return x}),i.d(t,"b",function(){return C}),i.d(t,"a",function(){return b}),i.d(t,"V",function(){return D}),i.d(t,"W",function(){return M}),i.d(t,"X",function(){return O}),i.d(t,"C",function(){return P}),i.d(t,"Y",function(){return E}),i.d(t,"Z",function(){return A}),i.d(t,"k",function(){return N}),i.d(t,"l",function(){return _}),i.d(t,"m",function(){return k}),i.d(t,"n",function(){return U}),i.d(t,"o",function(){return q}),i.d(t,"x",function(){return V}),i.d(t,"r",function(){return B}),i.d(t,"_0",function(){return T}),i.d(t,"p",function(){return L}),i.d(t,"y",function(){return z}),i.d(t,"A",function(){return j}),i.d(t,"z",function(){return F}),i.d(t,"B",function(){return G}),i.d(t,"w",function(){return H}),i.d(t,"q",function(){return Q}),i.d(t,"_1",function(){return K}),i.d(t,"s",function(){return W}),i.d(t,"_2",function(){return Y}),i.d(t,"d",function(){return J}),i.d(t,"c",function(){return X}),i.d(t,"e",function(){return Z}),i.d(t,"f",function(){return $}),i.d(t,"t",function(){return ee}),i.d(t,"u",function(){return te}),i.d(t,"_3",function(){return ie}),i.d(t,"_4",function(){return re}),i.d(t,"_5",function(){return ne}),i.d(t,"_6",function(){return oe}),i.d(t,"_7",function(){return ae}),i.d(t,"_8",function(){return se}),i.d(t,"_9",function(){return de}),i.d(t,"_10",function(){return le}),i.d(t,"_11",function(){return pe}),i.d(t,"_12",function(){return ce}),i.d(t,"i",function(){return he}),i.d(t,"_13",function(){return ue}),i.d(t,"_14",function(){return ge}),i.d(t,"_15",function(){return fe}),i.d(t,"_16",function(){return ye}),i.d(t,"_17",function(){return me}),i.d(t,"_18",function(){return ve}),i.d(t,"_19",function(){return Se}),i.d(t,"_20",function(){return Ie}),i.d(t,"_21",function(){return we}),i.d(t,"_22",function(){return Re}),i.d(t,"_23",function(){return xe}),i.d(t,"_24",function(){return Ce}),i.d(t,"_25",function(){return be}),i.d(t,"g",function(){return De}),i.d(t,"_26",function(){return Me});var r="load",n="rowDataBound",o="dataBound",a="queryCellInfo",s="beforeDataBound",d="actionBegin",l="dataStateChange",p="actionComplete",c="rowSelecting",h="rowSelected",u="checkboxChange",g="rowDeselected",f="toolbarClick",y="beforeExcelExport",m="beforePdfExport",v="resizeStop",S="expanded",I="expanding",w="collapsed",R="collapsing",x="remoteExpand",C="localPagedExpandCollapse",b="pagingActions",D="printGrid-Init",M="contextMenuOpen",O="contextMenuClick",P="beforeCopy",E="beforePaste",A="savePreviousRowPosition",N="crudAction",_="beginEdit",k="beginAdd",U="recordDoubleClick",q="cellSave",V="cellSaved",B="cellEdit",T="batchDelete",L="batchCancel",z="batchAdd",j="beforeBatchDelete",F="beforeBatchAdd",G="beforeBatchSave",H="batchSave",Q="key-pressed",K="update-data",W="double-tap",Y="virtualColumnIndex",J="virtual-action-args",X="destroy",Z="data-listener",$="index-modifier",ee="edit-form",te="before-batch-cancel",ie="batcheditform-rendered",re="detailDataBound",ne="rowDrag",oe="rowDragStartHelper",ae="rowDrop",se="rowDragStart",de="rows-add",le="rows-remove",pe="row-draging",ce="row-dropped",he="auto-col",ue="rowDeselecting",ge="e-headercontent",fe="e-movablecontent",ye="e-movableheader",me="e-frozencontent",ve="e-frozenheader",Se="e-content",Ie="e-table",we="Left-Right",Re="frozen-right",xe="frozen-left",Ce="data-colindex",be="aria-colindex",De="data-rowindex",Me="aria-rowindex"},function(e,t){e.exports=i},function(e,t,i){"use strict";function r(e,t,r,p,c,h,u){var g,f,y,m=e.value,v=e.action,S=t.grid.getPrimaryKeyFieldNames()[0],I=t.dataSource instanceof d.DataManager?t.dataSource.dataSource.json:t.dataSource,w=[],R=m,x=!1;if("Batch"===t.editSettings.mode&&(y=t.grid.editModule.getBatchChanges()),"add"===v||"batchsave"===v&&"Batch"===t.editSettings.mode&&y.addedRecords.length){var C=n(e,I,t,r,p,c,u);m=C.value,x=C.isSkip}if(m instanceof Array?w=i.i(l.i)(m):w.push(i.i(s.extend)({},m)),!x&&("add"!==v||"Top"!==t.editSettings.newRowPosition&&"Bottom"!==t.editSettings.newRowPosition))for(var b=0;b<w.length;b++){"object"==typeof w[parseInt(b.toString(),10)][""+S]&&(w[parseInt(b.toString(),10)]=w[parseInt(b.toString(),10)][""+S]);var D=w[parseInt(b.toString(),10)].taskData?Object.keys(w[parseInt(b.toString(),10)].taskData):Object.keys(w[parseInt(b.toString(),10)]);g=I.length;for(;g--&&g>=0;){var M=function(){if(I[parseInt(g.toString(),10)][""+S]===w[parseInt(b.toString(),10)][""+S]){if("delete"!==v){if("edit"===v){for(f=0;f<D.length;f++)if(Object.prototype.hasOwnProperty.call(I[parseInt(g.toString(),10)],D[parseInt(f.toString(),10)])&&("Cell"!==t.editSettings.mode||!i.i(s.isNullOrUndefined)(y)&&0===y.changedRecords.length||D[parseInt(f.toString(),10)]===h)){var e=i.i(l.k)(t,w[parseInt(b.toString(),10)].uniqueID);I[parseInt(g.toString(),10)][D[parseInt(f.toString(),10)]]=w[parseInt(b.toString(),10)][D[parseInt(f.toString(),10)]],e&&e.taskData&&(e.taskData[D[parseInt(f.toString(),10)]]=e[D[parseInt(f.toString(),10)]]=I[parseInt(g.toString(),10)][D[parseInt(f.toString(),10)]])}}else if("add"===v||"batchsave"===v){var n=void 0;"Child"===t.editSettings.newRowPosition?r?(R.taskData[""+t.parentIdMapping]=I[parseInt(g.toString(),10)][""+t.idMapping],I.splice(g+1,0,R.taskData)):(Object.prototype.hasOwnProperty.call(I[parseInt(g.toString(),10)],t.childMapping)||(I[parseInt(g.toString(),10)][""+t.childMapping]=[]),I[parseInt(g.toString(),10)][""+t.childMapping].push(R.taskData),a(S,I[parseInt(g.toString(),10)],v,t,r,R)):"Below"===t.editSettings.newRowPosition?(I.splice(g+1,0,R.taskData),i.i(s.isNullOrUndefined)(R.parentItem)||a(S,I[g+1],v,t,r,R)):p?"Above"===t.editSettings.newRowPosition&&(I.splice(g,0,R.taskData),i.i(s.isNullOrUndefined)(R.parentItem)||a(S,I[parseInt(g.toString(),10)],v,t,r,R)):(n=0,I.splice(n,0,R.taskData))}return"break"}var d=I[parseInt(g.toString(),10)];if(I.splice(g,1),r){if(!i.i(s.isNullOrUndefined)(d[""+t.parentIdMapping]))for(var c=t.flatData.filter(function(e){return e[""+t.idMapping]===d[""+t.parentIdMapping]})[0],u=c?c[""+t.childMapping]:[],m=u.length-1;m>=0;m--)if(u[parseInt(m.toString(),10)][""+t.idMapping]===d[""+t.idMapping]){t.enableImmutableMode||c.childRecords.length!==c.Children.length||c.childRecords.splice(m,1),u.splice(m,1),u.length||(c.hasChildRecords=!1,a(S,c,v,t,r));break}return"break"}}else i.i(s.isNullOrUndefined)(I[parseInt(g.toString(),10)][""+t.childMapping])||o(I[parseInt(g.toString(),10)][""+t.childMapping],w[parseInt(b.toString(),10)],v,S,t,r,R,h)&&a(S,I[parseInt(g.toString(),10)],v,t,r)}();if("break"===M)break}}}function n(e,t,r,n,o,a,d){var p,c=!1,h=r.grid.getCurrentViewRecords();switch(p=i.i(s.extend)({},e.value),p=i.i(l.j)(p),r.editSettings.newRowPosition){case"Top":t.unshift(p),c=!0;break;case"Bottom":t.push(p),c=!0;break;case"Above":i.i(s.isNullOrUndefined)(d)?(p=i.i(s.extend)({},h[o+1]),p=i.i(l.j)(p)):(p=i.i(s.extend)({},d),p=i.i(l.j)(p));break;case"Below":case"Child":if(i.i(s.isNullOrUndefined)(d)){var u=r.grid.getPrimaryKeyFieldNames()[0],g=h[parseInt(o.toString(),10)];p=!i.i(s.isNullOrUndefined)(g)&&g[""+u]===e.value[""+u]||-1!==a?i.i(s.extend)({},g):i.i(s.extend)({},e.value),p=i.i(l.j)(p);r.editModule.internalProperties.taskData=p}else p=i.i(s.extend)({},d),p=i.i(l.j)(p);-1===a&&(t.unshift(p),c=!0)}return{value:p,isSkip:c}}function o(e,t,r,n,d,p,c,h){for(var u=!1,g=e.length;g--&&g>=0;)if(e[parseInt(g.toString(),10)][""+n]===t[""+n]||p&&e[parseInt(g.toString(),10)][d.parentIdMapping]===t[d.idMapping]){if("edit"===r){for(var f=Object.keys(t),y=i.i(l.k)(d,t.uniqueID),m=0;m<f.length;m++)if(Object.prototype.hasOwnProperty.call(e[parseInt(g.toString(),10)],f[parseInt(m.toString(),10)])&&("Cell"!==d.editSettings.mode||f[parseInt(m.toString(),10)]===h)&&(y[f[parseInt(m.toString(),10)]]=y.taskData[f[parseInt(m.toString(),10)]]=e[parseInt(g.toString(),10)][f[parseInt(m.toString(),10)]]=t[f[parseInt(m.toString(),10)]],"Normal"===d.grid.editSettings.mode&&"Cell"===d.editSettings.mode)){d.grid.editModule.editModule.editRowIndex=t.index,d.grid.editModule.editModule.updateCurrentViewData(t)}break}"add"===r||"batchsave"===r?"Child"===d.editSettings.newRowPosition?p?(c[""+d.parentIdMapping]=e[parseInt(g.toString(),10)][d.idMapping],e.splice(g+1,0,c),a(n,e[parseInt(g.toString(),10)],r,d,p,c)):(Object.prototype.hasOwnProperty.call(e[parseInt(g.toString(),10)],d.childMapping)||(e[parseInt(g.toString(),10)][d.childMapping]=[]),e[parseInt(g.toString(),10)][d.childMapping].push(c.taskData),a(n,e[parseInt(g.toString(),10)],r,d,p,c)):"Above"===d.editSettings.newRowPosition?(e.splice(g,0,c.taskData),i.i(s.isNullOrUndefined)(c.parentItem)||a(n,e[parseInt(g.toString(),10)],r,d,p,c)):"Below"===d.editSettings.newRowPosition&&(e.splice(g+1,0,c.taskData),i.i(s.isNullOrUndefined)(c.parentItem)||a(n,e[parseInt(g.toString(),10)],r,d,p,c)):(e.splice(g,1),e.length||(u=!0))}else i.i(s.isNullOrUndefined)(e[parseInt(g.toString(),10)][d.childMapping])||o(e[parseInt(g.toString(),10)][d.childMapping],t,r,n,d,p,c,h)&&a(n,e[parseInt(g.toString(),10)],r,d,p);return u}function a(e,t,r,n,o,a){if("Above"!==n.editSettings.newRowPosition&&"Below"!==n.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||i.i(s.isNullOrUndefined)(a.parentItem)){var p,c=n.grid.getCurrentViewRecords();if(c.map(function(i,r){if(i[""+e]===t[""+e])return void(p=r)}),n.enableVirtualization&&i.i(s.isNullOrUndefined)(p)){var h=i.i(s.getValue)("uniqueIDCollection."+a.parentUniqueID,n);t=h}if(i.i(s.isNullOrUndefined)(p)||(t=c[parseInt(p.toString(),10)]),n.enableVirtualization&&i.i(s.isNullOrUndefined)(t)&&!i.i(s.isNullOrUndefined)(a)&&(t=i.i(s.getValue)("uniqueIDCollection."+a.parentUniqueID,n)),o||i.i(s.isNullOrUndefined)(t.childRecords)||!t.childRecords.length?t.hasChildRecords=!1:t.hasChildRecords=!0,"add"===r||"batchsave"===r){t.expanded=!0,t.hasChildRecords=!0,n.sortSettings.columns.length&&i.i(s.isNullOrUndefined)(a)&&(a=c.filter(function(e){return e.parentUniqueID===t.uniqueID?e:null}));var u=a?a instanceof Array?a[0]:a:c[p+1];"Below"!==n.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(t,"childRecords")?i.i(s.isNullOrUndefined)(a)||t[""+e]===a[""+e]||t.childRecords.push(a):t.childRecords=[],-1===t.childRecords.indexOf(u)&&t[""+e]!==a[""+e]&&t.childRecords.unshift(u),o&&(Object.prototype.hasOwnProperty.call(t,n.childMapping)||(t[n.childMapping]=[]),-1===t[""+n.childMapping].indexOf(u)&&t[""+e]!==a[""+e]&&t[n.childMapping].unshift(u)))}for(var g=n.grid.getPrimaryKeyFieldNames()[0],f=n.grid.dataSource instanceof d.DataManager?n.grid.dataSource.dataSource.json:n.grid.dataSource,y=0;y<f.length;y++)if(f[parseInt(y.toString(),10)][""+g]===t[""+g]){f[parseInt(y.toString(),10)]=t;break}n.grid.setRowData(e,t);var m=n.getRowByIndex(p);"Batch"===n.editSettings.mode&&(m="add"===r?n.getRows()[n.grid.getCurrentViewRecords().indexOf(t)]:n.getRows()[n.grid.getRowIndexByPrimaryKey(t[""+e])]);var v=void 0;if((n.frozenRows||n.getFrozenColumns())&&(v=n.getRowByIndex(p)),!n.enableVirtualization&&!i.i(s.isNullOrUndefined)(m)||!i.i(s.isNullOrUndefined)(v)){var S=n.treeColumnIndex;n.allowRowDragAndDrop&&n.enableImmutableMode&&(S+=1),n.renderModule.cellRender({data:t,cell:m.cells[parseInt(S.toString(),10)]?m.cells[parseInt(S.toString(),10)]:v.cells[S-n.getFrozenColumns()],column:n.grid.getColumns()[n.treeColumnIndex],requestType:r}),(n.enableImmutableMode&&"indenting"===n.action||"outdenting"===n.action)&&n.renderModule.RowModifier({data:t,row:m})}}else{i.i(l.k)(n,a.parentItem.uniqueID).childRecords.push(a)}}t.a=r,t.b=a;var s=i(1),d=(i.n(s),i(4)),l=(i.n(d),i(2))},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(3),n=i(1),o=(i.n(n),i(0)),a=(i.n(o),this&&this.__extends||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)}}()),s=function(e){function t(t,i){var r=e.call(this,t.grid,i)||this;return r.treeCopyContent="",r.copiedUniqueIdCollection=[],r.treeGridParent=t,r.serviceLocator=i,r}return a(t,e),t.prototype.setCopyData=function(t){var i=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";var o=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var a=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),s=0;s<a.length;s++)if(s>0&&(this.treeCopyContent+="\n"),!o[a[parseInt(s.toString(),10)]].classList.contains("e-summaryrow")){var d=[].slice.call(o[a[parseInt(s.toString(),10)]].querySelectorAll(".e-rowcell")),l=this.treeGridParent.getSelectedRecords()[parseInt(s.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(l)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(i,a[parseInt(s.toString(),10)],o,t,s),this.getCopyData(d,!1,"\t",t),this.treeCopyContent+=this.copyContent,this.copiedUniqueIdCollection.push(l),this.copyContent="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(i,a[parseInt(s.toString(),10)],o,t))}if(t){for(var p=[],s=0;s<this.treeGridParent.getVisibleColumns().length;s++)p[parseInt(s.toString(),10)]=this.treeGridParent.getVisibleColumns()[parseInt(s.toString(),10)].headerText;this.getCopyData(p,!1,"\t",t),this.treeCopyContent=this.copyContent+"\n"+this.treeCopyContent}var c={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger(r.C,c),c.cancel)return;this.clipBoardTextArea.value=this.copyContent=c.data,n.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,t)}},t.prototype.parentContentData=function(e,t,r,o,a){if(!i.i(n.isNullOrUndefined)(e[parseInt(t.toString(),10)].parentItem))for(var s=e[parseInt(t.toString(),10)].parentItem.level,d=0;d<s+1;d++)for(var l=0;l<e.length;l++)if(!i.i(n.isNullOrUndefined)(e[parseInt(t.toString(),10)].parentItem)&&e[parseInt(l.toString(),10)].uniqueID===e[parseInt(t.toString(),10)].parentItem.uniqueID){t=l;var p=[].slice.call(r[parseInt(t.toString(),10)].querySelectorAll(".e-rowcell")),c=e[parseInt(l.toString(),10)].uniqueID;if(-1===this.copiedUniqueIdCollection.indexOf(c)){this.getCopyData(p,!1,"\t",o),this.treeCopyContent=a>0?this.treeCopyContent+this.copyContent+"\n":this.copyContent+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(c),this.copyContent="";break}}},t.prototype.copy=function(t){e.prototype.copy.call(this,t)},t.prototype.paste=function(t,i,r){e.prototype.paste.call(this,t,i,r)},t.prototype.getModuleName=function(){return"clipboard"},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.prototype.childContentData=function(e,t,r,o){if(e[parseInt(t.toString(),10)].hasChildRecords)for(var a=e[parseInt(t.toString(),10)].childRecords,s=0;s<a.length;s++)for(var d=0;d<e.length;d++)if(!i.i(n.isNullOrUndefined)(a[parseInt(s.toString(),10)].uniqueID)&&e[parseInt(d.toString(),10)].uniqueID===a[parseInt(s.toString(),10)].uniqueID){if(!i.i(n.isNullOrUndefined)(r[parseInt(d.toString(),10)])&&!r[parseInt(d.toString(),10)].classList.contains("e-summaryrow")){var l=[].slice.call(r[parseInt(d.toString(),10)].querySelectorAll(".e-rowcell")),p=e[parseInt(d.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(p)&&(this.getCopyData(l,!1,"\t",o),this.treeCopyContent+="\n"+this.copyContent,this.copyContent="",this.copiedUniqueIdCollection.push(p),this.childContentData(e,d,r,o))}break}},t}(o.Clipboard)},function(e,t,i){"use strict";i.d(t,"a",function(){return l}),i.d(t,"b",function(){return p});var r=i(1),n=(i.n(r),i(0)),o=(i.n(n),this&&this.__extends||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)}}()),a="https://ej2.syncfusion.com/documentation/treegrid",s="https://ej2.syncfusion.com/documentation",d=!1,l=function(e){function t(t){return n.Grid.Inject(n.Logger),e.call(this,t)||this}return o(t,e),t.prototype.getModuleName=function(){return"logger"},t.prototype.log=function(e,t){e instanceof Array||(e=[e]);for(var o=e,l=0;l<o.length;l++){var p=n.detailLists[o[parseInt(l.toString(),10)]],c=p.check(t,this.parent);if(c.success){var h=p.generateMessage(t,this.parent,c.options);h=h.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),d&&"primary_column_missing"===o[parseInt(l.toString(),10)]&&(h=h.replace("Editing","Row DragAndDrop"),d=!1);var u=h.indexOf("https"),g=h.substring(u);"module_missing"===o[parseInt(l.toString(),10)]?h=h.replace(g,a+"/modules"):"primary_column_missing"===o[parseInt(l.toString(),10)]||"selection_key_missing"===o[parseInt(l.toString(),10)]?h=h.replace(g,s+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===o[parseInt(l.toString(),10)]?h=h.replace(g,a+"/edit"):"virtual_height"===o[parseInt(l.toString(),10)]?h=h.replace(g,a+"/virtual"):"check_datasource_columns"===o[parseInt(l.toString(),10)]?h=h.replace(g,a+"/columns"):"locale_missing"===o[parseInt(l.toString(),10)]&&(h=h.replace(g,a+"/global-local/#localization")),"datasource_syntax_mismatch"===o[parseInt(l.toString(),10)]?i.i(r.isNullOrUndefined)(this.treeGridObj)||i.i(r.isNullOrUndefined)(this.treeGridObj.dataStateChange)||console[p.logType](h):console[p.logType](h)}}},t.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&&(d=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=p[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)}}},t}(n.Logger),p={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,t){var n={success:!1};return(i.i(r.isNullOrUndefined)(t.idMapping)&&i.i(r.isNullOrUndefined)(t.childMapping)&&i.i(r.isNullOrUndefined)(t.parentIdMapping)||!i.i(r.isNullOrUndefined)(t.idMapping)&&i.i(r.isNullOrUndefined)(t.parentIdMapping)||i.i(r.isNullOrUndefined)(t.idMapping)&&!i.i(r.isNullOrUndefined)(t.parentIdMapping))&&(n={success:!0}),n},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"+s+"/api/treegrid#childmapping\n"+s+"/api/treegrid#idmapping\n"+s+"/api/treegrid#$parentidmapping"}}}},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){r.Grid.Inject(r.Reorder),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.getTreeColumn,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.getTreeColumn)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getTreeColumn=function(){for(var e,t=this.parent.columnModel[this.parent.treeColumnIndex],n=this.parent.getColumns(),o=0;o<n.length;o++){if(i.i(r.getObject)("field",t)===i.i(r.getObject)("field",n[parseInt(o.toString(),10)])){e=o;break}}this.parent.setProperties({treeColumnIndex:e},!0)},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){r.Grid.Inject(r.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}())},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(1),n=(i.n(r),i(55)),o=(i.n(n),i(0)),a=(i.n(o),i(3)),s=i(2),d=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 t,r=i.i(o.getObject)("target",e),n=i.i(o.parentsUntil)(r,"e-checkbox-wrapper");if(n&&n.querySelectorAll(".e-treecheckselect").length>0){t=n.querySelector('input[type="checkbox"]');var a=[];a.push(r.closest("tr").rowIndex),this.selectCheckboxes(a),this.triggerChkChangeEvent(t,t.nextElementSibling.classList.contains("e-check"),r.closest("tr"))}else if(n&&n.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var s=!n.querySelector(".e-frame").classList.contains("e-check")&&!n.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(s),t=n.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(t,s,r.closest("tr"))}},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(a.j,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("e-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],t=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),o=i.i(n.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "});o.classList.add("e-hierarchycheckbox"),o.insertBefore(t.cloneNode(),o.firstChild),i.i(r.isNullOrUndefined)(e)||e.insertBefore(o,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var o=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0],a=o.querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&a&&this.headerSelection(a)}},e.prototype.renderColumnCheckbox=function(e){var t=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),o=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var a=!i.i(r.isNullOrUndefined)(o.checkboxState)&&"uncheck"!==o.checkboxState,s=i.i(n.createCheckBox)(this.parent.createElement,!1,{checked:a,label:" "});if(s.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(s.querySelector(".e-frame").style.width="18px"),"indeterminate"===o.checkboxState){var d=s.querySelectorAll(".e-frame")[0];i.i(r.removeClass)([d],["e-check","e-stop","e-uncheck"]),s.querySelector(".e-frame").classList.add("e-stop")}return s.insertBefore(t.cloneNode(),s.firstChild),s},e.prototype.columnCheckbox=function(e){var t=this.renderColumnCheckbox(e),n=e.cell.querySelector(".e-treecolumn-container");if(i.i(r.isNullOrUndefined)(n)){var o=this.parent.createElement("span",{className:"e-treecheckbox"}),a=e.cell.innerHTML;e.cell.innerHTML="",o.innerHTML=a;var s=this.parent.createElement("div",{className:"e-treecheckbox-container"});s.appendChild(t),s.appendChild(o),e.cell.appendChild(s)}else e.cell.querySelector(".e-hierarchycheckbox")||n.insertBefore(t,n.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){for(var t=0;t<e.length;t++){var r=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],n=i.i(s.k)(this.parent,r.uniqueID);r=n;var o="uncheck"===r.checkboxState?"check":"uncheck";r.checkboxState=o;for(var a=Object.keys(r),d=0;d<a.length;d++)Object.prototype.hasOwnProperty.call(n,a[parseInt(d.toString(),10)])&&(n[a[parseInt(d.toString(),10)]]=r[a[parseInt(d.toString(),10)]]);this.traverSelection(r,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},e.prototype.traverSelection=function(e,t,n){var o=0;if(this.updateSelectedItems(e,t),!n&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy){var a=e.childRecords;!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(a=this.getFilteredChildRecords(a)),o=a.length;for(var s=0;s<o;s++)a[parseInt(s.toString(),10)].isSummaryRow||(a[parseInt(s.toString(),10)].hasChildRecords?this.traverSelection(a[parseInt(s.toString(),10)],t,!0):this.updateSelectedItems(a[parseInt(s.toString(),10)],t))}},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 t=0,n=[],o=i.i(s.k)(this.parent,e.uniqueID);o&&o.childRecords&&(n=o.childRecords),!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(n=this.getFilteredChildRecords(n)),t=n&&n.length;var a=0,d=0;if(!i.i(r.isNullOrUndefined)(o)){for(var l=0;l<n.length;l++){var p=i.i(s.k)(this.parent,n[parseInt(l.toString(),10)].uniqueID),c=p;i.i(r.isNullOrUndefined)(c)||("indeterminate"===c.checkboxState?a++:"check"===c.checkboxState&&d++)}a>0||d>0&&d!==t?o.checkboxState="indeterminate":(0!==d||o.hasFilteredChildRecords&&!i.i(r.isNullOrUndefined)(o.hasFilteredChildRecords)||i.i(r.isNullOrUndefined)(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==o.checkboxState)&&(0===d&&0===a||0===d&&o.hasFilteredChildRecords&&!i.i(r.isNullOrUndefined)(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===o.checkboxState)?o.checkboxState="uncheck":o.checkboxState="check",this.updateSelectedItems(o,o.checkboxState),o.parentItem&&this.updateParentSelection(o.parentItem)}},e.prototype.headerSelection=function(e){var t=this,n=0,o=!1;if(!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var a=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=a),this.parent.grid.searchSettings.key.length?this.searchingRecords=a:this.filteredList!==a?(this.filteredList=a,o=!0):o=!1}this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!i.i(r.isNullOrUndefined)(e)&&(this.filteredList=this.searchingRecords));var d;if(d=!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0?this.filteredList:!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,d=i.i(s.a)(this.parent)?this.parent.getCurrentViewRecords():d,!i.i(r.isNullOrUndefined)(e))for(var l=0;l<d.length;l++)if(e){if("check"===d[parseInt(l.toString(),10)].checkboxState)continue;if(o)continue;d[parseInt(l.toString(),10)].checkboxState="check",this.updateSelectedItems(d[parseInt(l.toString(),10)],d[parseInt(l.toString(),10)].checkboxState)}else this.selectedItems.indexOf(d[parseInt(l.toString(),10)])>-1&&(d[parseInt(l.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(d[parseInt(l.toString(),10)],d[parseInt(l.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(d[parseInt(l.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],d.filter(function(e){e.checkboxState="uncheck",t.updateSelectedItems(e,e.checkboxState)})),n=this.selectedItems.length;var p=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];n>0&&d.length>0?n===d.length||e?(i.i(r.removeClass)([p],["e-stop"]),p.classList.add("e-check")):(i.i(r.removeClass)([p],["e-check"]),p.classList.add("e-stop")):i.i(r.removeClass)([p],["e-check","e-stop"])},e.prototype.updateSelectedItems=function(e,t){var n,o,a=this.parent.grid.currentViewData.filter(function(t){return t.uniqueID===e.uniqueID}),d=this.parent.grid.currentViewData.indexOf(a[0]),l=i.i(s.k)(this.parent,e.uniqueID),p=this.parent.getRows()[parseInt(d.toString(),10)];if(d>-1){var c=void 0;(this.parent.frozenRows||this.parent.getFrozenColumns())&&(c=this.parent.getDataRows()[parseInt(d.toString(),10)]),o=p.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?p.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]:c.querySelectorAll(".e-hierarchycheckbox .e-frame")[0],i.i(r.isNullOrUndefined)(o)||i.i(r.removeClass)([o],["e-check","e-stop","e-uncheck"])}if(n=l,i.i(r.isNullOrUndefined)(n)&&(n=e),n.checkboxState=t,"check"===t&&i.i(r.isNullOrUndefined)(e.isSummaryRow))-1!==d&&-1===this.selectedIndexes.indexOf(d)&&this.selectedIndexes.push(d),-1===this.selectedItems.indexOf(n)&&-1!==d&&!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(n),-1===this.selectedItems.indexOf(n)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(n),-1!==this.selectedItems.indexOf(n)||i.i(r.isNullOrUndefined)(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(n),-1===this.selectedItems.indexOf(n)&&i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.selectedItems.push(n);else if(("uncheck"===t||"indeterminate"===t)&&i.i(r.isNullOrUndefined)(e.isSummaryRow)){var h=this.selectedItems.indexOf(n);if(-1!==h&&this.selectedItems.splice(h,1),-1!==this.selectedIndexes.indexOf(d)){var u=this.selectedIndexes.indexOf(d);this.selectedIndexes.splice(u,1)}}var g="indeterminate"===t?"e-stop":"e-"+t;if(d>-1&&!i.i(r.isNullOrUndefined)(o)){o.classList.add(g);p.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===t?"true":"uncheck"===t?"false":"mixed")}},e.prototype.updateGridActions=function(e){var t,n,o=this,a=e.requestType;if(i.i(s.c)(this.parent)&&this.parent.autoCheckHierarchy)if("sorting"===a||"paging"===a){var d=this.parent.grid.getRows();t=this.parent.getCurrentViewRecords(),n=t.length,this.selectedIndexes=[];for(var l=0;l<n;l++)d[parseInt(l.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(t[parseInt(l.toString(),10)],t[parseInt(l.toString(),10)].checkboxState)}else if("delete"===a||"add"===e.action){var p=[];"delete"===a?p=e.data:p.push(e.data);for(var l=0;l<p.length;l++){if("delete"===a){var c=this.parent.flatData.indexOf(p[parseInt(l.toString(),10)]),h=this.selectedIndexes.indexOf(c);this.selectedIndexes.splice(h,1),this.updateSelectedItems(p[parseInt(l.toString(),10)],"uncheck")}i.i(r.isNullOrUndefined)(p[parseInt(l.toString(),10)].parentItem)||this.updateParentSelection(p[parseInt(l.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===a||"searching"===a||"refresh"===a&&!i.i(s.a)(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],t=!i.i(r.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0?this.parent.filterModule.filteredResult:this.parent.flatData,t.forEach(function(e){if(o.parent.enableVirtualization){e.hasChildRecords&&e.childRecords.length>0?o.updateParentSelection(e):o.updateSelectedItems(e,e.checkboxState);var t=i.i(s.g)(e);t=o.getFilteredChildRecords(t);for(var n=0;n<t.length;n++)t[parseInt(n.toString(),10)].hasChildRecords?o.updateParentSelection(t[parseInt(n.toString(),10)]):t[parseInt(n.toString(),10)].hasChildRecords||i.i(r.isNullOrUndefined)(t[parseInt(n.toString(),10)])||o.updateSelectedItems(t[parseInt(n.toString(),10)],t[parseInt(n.toString(),10)].checkboxState)}else e.hasChildRecords?o.updateParentSelection(e):o.updateSelectedItems(e,e.checkboxState)}),this.headerSelection())},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(1),n=(i.n(r),i(4)),o=(i.n(n),i(25)),a=(i.n(o),i(0)),s=(i.n(a),i(2)),d=i(3),l=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=!i.i(r.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(d.U,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(d.U,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 t=this;if(this.parent.flatData=0!==Object.keys(e).length||this.parent.dataSource instanceof n.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],i.i(s.a)(this.parent)&&!i.i(s.h)(this.parent)&&e instanceof n.DataManager&&!(e instanceof Array)){var o=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=i.i(r.isNullOrUndefined)(this.parent.query)?new n.Query:this.parent.query,this.parent.parentIdMapping){var a=this.parent.query.params.filter(function(e){return"IdMapping"===e.key});this.parent.initialRender&&!a.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var d=this.parent.query.clone();d.queries=[],d=d.select([this.parent.parentIdMapping]),d.isCountRequired=!0,o.executeQuery(d).then(function(e){t.parentItems=n.DataUtil.distinct(e.result,t.parent.parentIdMapping,!1);var o;0===(o=e.result?0:1)&&(i.i(r.setValue)("grid.contentModule.isLoaded",!0,t.parent),i.i(r.isNullOrUndefined)(t.zerothLevelData)||(i.i(r.setValue)("cancel",!1,t.zerothLevelData),i.i(r.getValue)("grid.renderModule",t.parent).dataManagerSuccess(t.zerothLevelData),t.zerothLevelData=null),t.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 t=Object.keys(e),o=0;o<t.length;o++){var a=e[parseInt(o.toString(),10)];this.hierarchyData.push(i.i(r.extend)({},a)),i.i(r.isNullOrUndefined)(a[this.parent.idMapping])||this.taskIds.push(a[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var s=[],d=new n.DataManager(this.hierarchyData).executeLocal((new n.Query).group(this.parent.parentIdMapping)),o=0;o<d.length;o++){var l=d[parseInt(o.toString(),10)],p=this.taskIds.indexOf(l.key);if(!i.i(r.isNullOrUndefined)(l.key)&&p>-1){var c=l.items;this.hierarchyData[parseInt(p.toString(),10)][this.parent.childMapping]=c}else s.push.apply(s,l.items)}this.hierarchyData=this.selfReferenceUpdate(s)}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){i.i(s.a)(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e.actionArgs.requestType&&this.parent.hideSpinner();var t=e.result;if(i.i(s.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){i.i(r.isNullOrUndefined)(t)||this.parent.loadChildOnDemand&&i.i(s.b)(this.parent)&&!i.i(r.isNullOrUndefined)(this.parent.dataResults.expandRecord)||i.i(s.a)(this.parent)&&this.parent.loadChildOnDemand&&e.actionArgs.isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(t)}else for(var n=this,o=0;o<t.length;o++)!function(e){if(i.i(s.b)(n.parent)&&t[parseInt(e.toString(),10)].hasChildRecords&&n.parent.initialRender&&(t[parseInt(e.toString(),10)].expanded=!1),i.i(s.a)(n.parent)&&n.parent.enableVirtualization){var o=[],d=n.parent;t.filter(function(i){i[""+d.parentIdMapping]===t[parseInt(e.toString(),10)][""+d.idMapping]&&o.push(i)}),o.length?t[parseInt(e.toString(),10)].expanded=!0:t[parseInt(e.toString(),10)].hasChildRecords&&(t[parseInt(e.toString(),10)].expanded=!1)}i.i(r.isNullOrUndefined)(t[parseInt(e.toString(),10)].index)&&(t[parseInt(e.toString(),10)].taskData=i.i(r.extend)({},t[parseInt(e.toString(),10)]),t[parseInt(e.toString(),10)].uniqueID=i.i(a.getUid)(n.parent.element.id+"_data_"),i.i(r.setValue)("uniqueIDCollection."+t[parseInt(e.toString(),10)].uniqueID,t[parseInt(e.toString(),10)],n.parent),t[parseInt(e.toString(),10)].level=0,i.i(s.a)(n.parent)&&n.parent.enableVirtualization&&t[parseInt(e.toString(),10)][""+n.parent.parentIdMapping]&&0===t[parseInt(e.toString(),10)].level&&(t[parseInt(e.toString(),10)].level=t[parseInt(e.toString(),10)].level+1),t[parseInt(e.toString(),10)].index=Math.ceil(1e3*Math.random()),(t[parseInt(e.toString(),10)][n.parent.hasChildMapping]||-1!==n.parentItems.indexOf(t[parseInt(e.toString(),10)][n.parent.idMapping]))&&(t[parseInt(e.toString(),10)].hasChildRecords=!0),t[parseInt(e.toString(),10)].checkboxState="uncheck")}(o);else this.zerothLevelData=e,i.i(r.setValue)("cancel",!0,e);if(i.i(s.a)(this.parent)&&this.parent.loadChildOnDemand&&e.actionArgs.isExpandCollapse&&this.parent.enableVirtualization?e.result=t:i.i(s.a)(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand?e.result=t:e.result=this.parent.loadChildOnDemand?this.parent.flatData:t,i.i(s.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 d=e.query.queries.filter(function(e){return"onAggregates"===e.fn});e.result=this.parent.summaryModule.calculateSummaryValue(d,this.parent.flatData,!0)}this.parent.notify("updateResults",e)},e.prototype.collectExpandingRecs=function(e,t){var n=this.parent.getRows();if(this.parent.rowTemplate){var o=this.parent.getContentTable().rows;n=[].slice.call(o)}var a;if(e.rows.length>0){t||(e.record.expanded=!0);for(var s=0;s<e.rows.length;s++){if(e.rows[parseInt(s.toString(),10)].style.display="table-row",this.parent.loadChildOnDemand){var d=e.rows[parseInt(s.toString(),10)].getElementsByClassName("e-treegridcollapse")[0];a=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(s.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(s.toString(),10)].getAttribute("data-Uid")).data,!i.i(r.isNullOrUndefined)(d)&&a.expanded&&(i.i(r.addClass)([d],"e-treegridexpand"),i.i(r.removeClass)([d],"e-treegridcollapse"));var l=[];l=n.filter(function(e){return e.querySelector(".e-gridrowindex"+a.index+"level"+(a.level+1))}),l.length&&a.expanded&&this.collectExpandingRecs({record:a,rows:l,parentRow:e.parentRow},!0)}var p=e.rows[parseInt(s.toString(),10)].querySelector(".e-detailrowcollapse");i.i(r.isNullOrUndefined)(p)||this.parent.grid.detailRowModule.expand(p)}}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},e.prototype.fetchRemoteChildData=function(e){var t=this,s={row:e.parentRow,data:e.record},l=this.parent.dataSource,p=this.parent.grid.getDataModule().generateQuery(),c=p.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn});if(p.queries=c,p.isCountRequired=!0,this.parent.enableVirtualization&&"remoteExpand"===e.action){p.take(this.parent.pageSettings.pageSize);var h=[];h.push("ExpandingAction",parseInt(e.record[this.parent.idMapping],10).toString()),p.expand(h)}else if(this.parent.enableVirtualization&&"collapse"===e.action){p.take(this.parent.grid.pageSettings.pageSize);var h=[];h.push("CollapsingAction",parseInt(e.record[this.parent.idMapping],10).toString()),p.expand(h)}if(p.where(this.parent.parentIdMapping,"equal",e.record[this.parent.idMapping]),"remoteExpand"===e.action&&this.parent.grid.filterModule&&this.parent.grid.filterModule.value){var u=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates});p.queries.push(u[0])}i.i(o.showSpinner)(this.parent.element),l.executeQuery(p).then(function(l){var p,c=t.parent.grid.currentViewData.slice(),h=t.parent.idMapping;if(t.parent.isGantt&&!t.parent.loadChildOnDemand&&t.parent.hasChildMapping){for(var u=0;u<t.parent.grid.currentViewData.length;u++)if(e.record[h]===t.parent.grid.currentViewData[u][h]){p=u;break}}else p=c.indexOf(e.record);if(t.parent.enableVirtualization&&("collapse"===e.action||"remoteExpand"===e.action)){c=[];for(var u=0;u<p;u++)c.push(t.parent.grid.currentViewData[parseInt(u.toString(),10)])}-1===p&&t.parent.grid.getRowsObject().forEach(function(t){t.data.uniqueID===e.record.uniqueID&&(p=t.index)});var g=i.i(a.getObject)("actual.nextLevel",l),f=l.result,y=[];if("remoteExpand"===e.action&&t.parent.grid.filterModule&&t.parent.grid.filterModule.value){for(var u=0;u<c.length;u++)Object.prototype.hasOwnProperty.call(c[parseInt(u.toString(),10)],t.parent.parentIdMapping)&&null!==c[parseInt(u.toString(),10)][""+t.parent.parentIdMapping]&&0===c[parseInt(u.toString(),10)].level&&(c.splice(u,1),u--);for(var u=0;u<f.length;u++)e.record[""+t.parent.idMapping]!==f[parseInt(u.toString(),10)][""+t.parent.idMapping]&&e.record[""+t.parent.idMapping]===f[parseInt(u.toString(),10)][""+t.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(f,u)&&y.push(f[parseInt(u.toString(),10)]);f=y}if(t.parent.enableVirtualization&&"remoteExpand"===e.action){e.record.childRecords=[];for(var u=0;u<f.length;u++)e.record[""+t.parent.idMapping]!==f[parseInt(u.toString(),10)][""+t.parent.idMapping]&&e.record[""+t.parent.idMapping]===f[parseInt(u.toString(),10)][""+t.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(f,u)&&e.record.childRecords.push(f[parseInt(u.toString(),10)])}else e.record.childRecords=f;for(var m=0;m<f.length;m++){if(t.parent.enableVirtualization&&f[parseInt(m.toString(),10)][""+t.parent.idMapping]===e.record[""+t.parent.idMapping]&&"remoteExpand"===e.action)t.parent.remoteExpandedData.push(e.record);else if(t.parent.enableVirtualization&&f[parseInt(m.toString(),10)][""+t.parent.idMapping]===e.record[""+t.parent.idMapping]&&"collapse"===e.action)for(var u=0;u<t.parent.remoteExpandedData.length;u++)e.record[""+t.parent.idMapping]===t.parent.remoteExpandedData[parseInt(u.toString(),10)][""+t.parent.idMapping]&&t.parent.remoteExpandedData.splice(u,1);if(f[parseInt(m.toString(),10)].taskData=i.i(r.extend)({},f[parseInt(m.toString(),10)]),f[parseInt(m.toString(),10)][""+t.parent.parentIdMapping]&&t.parent.enableVirtualization&&t.parent.remoteExpandedData.length){for(var u=0;u<t.parent.remoteExpandedData.length;u++)if(f[parseInt(m.toString(),10)][""+t.parent.parentIdMapping]===t.parent.remoteExpandedData[parseInt(u.toString(),10)][""+t.parent.idMapping]){f[parseInt(m.toString(),10)].level=t.parent.remoteExpandedData[parseInt(u.toString(),10)].level+1;var v=t.parent.remoteExpandedData[parseInt(u.toString(),10)];delete v.childRecords,f[parseInt(m.toString(),10)].parentItem=v,f[parseInt(m.toString(),10)].parentUniqueID=e.record.uniqueID}}else if(t.parent.enableVirtualization)if(!f[parseInt(m.toString(),10)][""+t.parent.hasChildMapping]&&-1===t.parentItems.indexOf(f[parseInt(m.toString(),10)][""+t.parent.idMapping])||g&&!g[parseInt(m.toString(),10)]){var v=i.i(r.extend)({},e.record);delete v.childRecords,f[parseInt(m.toString(),10)].parentItem=v,f[parseInt(m.toString(),10)].parentUniqueID=e.record.uniqueID}else i.i(r.isNullOrUndefined)(f[parseInt(m.toString(),10)][""+t.parent.parentIdMapping])?(f[parseInt(m.toString(),10)].level=0,"remoteExpand"===e.action&&(f[parseInt(m.toString(),10)].childRecords=[],f[parseInt(m.toString(),10)].childRecords=e.record.childRecords)):f[parseInt(m.toString(),10)].level=e.record.level;else{f[parseInt(m.toString(),10)].level=e.record.level+1;var v=i.i(r.extend)({},e.record);delete v.childRecords,f[parseInt(m.toString(),10)].parentItem=v,f[parseInt(m.toString(),10)].parentUniqueID=e.record.uniqueID}if(f[parseInt(m.toString(),10)].index=Math.ceil(1e3*Math.random()),f[parseInt(m.toString(),10)].uniqueID=i.i(a.getUid)(t.parent.element.id+"_data_"),f[parseInt(m.toString(),10)].checkboxState="uncheck",t.parent.enableVirtualization&&i.i(r.isNullOrUndefined)(f[parseInt(m.toString(),10)].level))for(var S=0;S<t.parent.grid.currentViewData.length;S++)t.parent.grid.currentViewData[parseInt(S.toString(),10)][""+t.parent.idMapping]===f[parseInt(m.toString(),10)][""+t.parent.parentIdMapping]&&(f[parseInt(m.toString(),10)].level=t.parent.grid.currentViewData[parseInt(S.toString(),10)].level+1);if(i.i(r.setValue)("uniqueIDCollection."+f[parseInt(m.toString(),10)].uniqueID,f[parseInt(m.toString(),10)],t.parent),(f[parseInt(m.toString(),10)][""+t.parent.hasChildMapping]||-1!==t.parentItems.indexOf(f[parseInt(m.toString(),10)][""+t.parent.idMapping]))&&(!g||g[parseInt(m.toString(),10)]))if(f[parseInt(m.toString(),10)].hasChildRecords=!0,t.parent.enableVirtualization&&t.parent.loadChildOnDemand){for(var u=0;u<t.parent.remoteCollapsedData.length;u++)f[parseInt(m.toString(),10)][""+t.parent.idMapping]===t.parent.remoteCollapsedData[parseInt(u.toString(),10)][""+t.parent.idMapping]&&(f[parseInt(m.toString(),10)].expanded=t.parent.remoteCollapsedData[parseInt(u.toString(),10)].expanded);if("collapse"===e.action&&f[parseInt(m.toString(),10)][""+t.parent.idMapping]!==e.record[""+t.parent.idMapping]&&!1!==f[parseInt(m.toString(),10)].expanded)f[parseInt(m.toString(),10)].expanded=!0;else if("collapse"===e.action&&f[parseInt(m.toString(),10)][""+t.parent.idMapping]===e.record[""+t.parent.idMapping])f[parseInt(m.toString(),10)].expanded=!1,t.parent.remoteCollapsedData.push(e.record);else if("remoteExpand"===e.action){for(var u=0;u<t.parent.grid.currentViewData.length;u++)t.parent.grid.currentViewData[parseInt(u.toString(),10)][""+t.parent.idMapping]===f[parseInt(m.toString(),10)][""+t.parent.idMapping]&&f.splice(m,1,t.parent.grid.currentViewData[parseInt(u.toString(),10)]);if(f[parseInt(m.toString(),10)][t.parent.idMapping]===e.record[""+t.parent.idMapping])for(var u=0;u<t.parent.remoteCollapsedData.length;u++)e.record[""+t.parent.idMapping]===t.parent.remoteCollapsedData[parseInt(u.toString(),10)][""+t.parent.idMapping]&&t.parent.remoteCollapsedData.splice(u,1);!1!==f[parseInt(m.toString(),10)].expanded&&(f[parseInt(m.toString(),10)].expanded=!0)}}else t.parent.enableVirtualization&&f[parseInt(m.toString(),10)][""+t.parent.idMapping]===e.record[""+t.parent.idMapping]&&"collapse"!==e.action?f[parseInt(m.toString(),10)].expanded=!0:t.parent.enableVirtualization&&t.parent.loadChildOnDemand||(f[parseInt(m.toString(),10)].expanded=!1);c.splice(p+m+1,0,f[parseInt(m.toString(),10)])}if(i.i(r.setValue)("result",c,l),i.i(r.setValue)("action","beforecontentrender",l),t.parent.trigger(d.h,l),i.i(o.hideSpinner)(t.parent.element),t.parent.grid.aggregates.length>0&&!t.parent.enableVirtualization){var I=i.i(a.getObject)("query",l);if(i.i(r.isNullOrUndefined)(I)&&(I=i.i(r.getValue)("grid.renderModule.data",t.parent).aggregateQuery(new n.Query)),!i.i(r.isNullOrUndefined)(I)){var w=I.queries.filter(function(e){return"onAggregates"===e.fn});l.result=t.parent.summaryModule.calculateSummaryValue(w,l.result,!0)}}t.parent.enableVirtualization&&(t.parent.grid.pageSettings.totalRecordsCount=l.count),l.count=t.parent.grid.pageSettings.totalRecordsCount;var R={};t.parent.enableVirtualization&&t.remoteVirtualAction(R);var x={index:p,childData:f};t.parent.enableInfiniteScrolling?t.parent.notify("infinite-remote-expand",x):i.i(r.getValue)("grid.renderModule",t.parent).dataManagerSuccess(l,R),t.parent.trigger(d.Q,s)})},e.prototype.remoteVirtualAction=function(e){e.requestType="refresh",i.i(r.setValue)("isExpandCollapse",!0,e);var t=i.i(r.getValue)("grid.contentModule",this.parent),n=i.i(r.getValue)("currentInfo",t),o=i.i(r.getValue)("prevInfo",t);n.loadNext&&this.parent.grid.pageSettings.currentPage===n.nextInfo.page&&(this.parent.grid.pageSettings.currentPage=o.page)},e.prototype.beginSorting=function(){if(this.isSortAction=!0,i.i(s.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,t){for(var n=[],o=Object.keys(e),d=0,l=o.length;d<l;d++){var p=i.i(r.extend)({},e[parseInt(d.toString(),10)]);p.taskData=e[parseInt(d.toString(),10)];var c=0;if(this.storedIndex++,Object.prototype.hasOwnProperty.call(p,"index")||(p.index=this.storedIndex),(!i.i(r.isNullOrUndefined)(p[this.parent.childMapping])&&!i.i(s.b)(this.parent)||p[this.parent.hasChildMapping]&&i.i(s.b)(this.parent))&&(p.hasChildRecords=!0,this.parent.enableCollapseAll||!i.i(r.isNullOrUndefined)(this.parent.dataStateChange)&&i.i(r.isNullOrUndefined)(p[this.parent.childMapping])?p.expanded=!1:p.expanded=!!i.i(r.isNullOrUndefined)(p[this.parent.expandStateMapping])||p[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(p,"index")||(p.index=(p.hasChildRecords,this.storedIndex)),this.isSelfReference&&i.i(r.isNullOrUndefined)(p[this.parent.parentIdMapping])&&this.parent.parentData.push(p),p.uniqueID=i.i(a.getUid)(this.parent.element.id+"_data_"),i.i(r.setValue)("uniqueIDCollection."+p.uniqueID,p,this.parent),!i.i(r.isNullOrUndefined)(t)){var h=i.i(r.extend)({},t);delete h.childRecords,delete h[this.parent.childMapping],this.isSelfReference&&delete h.taskData[this.parent.childMapping],p.parentItem=h,p.parentUniqueID=h.uniqueID,c=t.level+1}Object.prototype.hasOwnProperty.call(p,"level")||(p.level=c),p.checkboxState="uncheck";if(this.parent.enableVirtualization&&this.parent.loadChildOnDemand&&i.i(s.a)(this.parent)&&!this.parent.initialRender){if(!p.hasChildRecords&&i.i(r.isNullOrUndefined)(p[""+this.parent.parentIdMapping])){p.hasChildRecords=!0;for(var u=0;u<this.parent.remoteCollapsedData.length;u++)this.parent.remoteCollapsedData[parseInt(u.toString(),10)][""+this.parent.idMapping]===p[""+this.parent.idMapping]&&(p.expanded=!1)}else 0===p.level&&i.i(r.isNullOrUndefined)(t)&&!p.hasChildRecords&&(p.level=p.level+1);p[""+this.parent.hasChildMapping]&&!i.i(r.isNullOrUndefined)(p[""+this.parent.expandStateMapping])&&(p.expanded=p[""+this.parent.expandStateMapping],p.hasChildRecords=!0),this.parent.flatData.push(p)}else(i.i(r.isNullOrUndefined)(p[""+this.parent.parentIdMapping])||p.parentItem)&&(this.parent.flatData.push(p),this.parent.infiniteScrollData.push(p));if(this.isSelfReference||0!==p.level||this.parent.parentData.push(p),!i.i(r.isNullOrUndefined)(p[this.parent.childMapping]&&p[this.parent.childMapping].length)){var g=this.createRecords(p[this.parent.childMapping],p);p.childRecords=g}n.push(p)}return n},e.prototype.dataProcessor=function(e){var t,o=i.i(a.getObject)("isExport",e),d=i.i(a.getObject)("expresults",e),l=i.i(a.getObject)("exportType",e),p=i.i(a.getObject)("isPrinting",e),c=i.i(a.getObject)("actionArgs",e),h=i.i(a.getObject)("requestType",e),u=i.i(a.getObject)("data",e),g=i.i(a.getObject)("action",e),f=c,y=this.parent.getPrimaryKeyFieldNames()[0],m=i.i(a.getObject)("data",f);i.i(r.isNullOrUndefined)(f)||i.i(r.isNullOrUndefined)(f.action)||"add"!==f.action||i.i(r.isNullOrUndefined)(f.data)||!i.i(r.isNullOrUndefined)(f.data[""+y])||(f.data[""+y]=e.result[f.index][""+y],m.taskData[""+y]=e.result[f.index][""+y]),(!i.i(r.isNullOrUndefined)(c)&&Object.keys(c).length||"save"===h)&&(h=h||c.requestType,u=u||i.i(a.getObject)("data",c),g=g||i.i(a.getObject)("action",c),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData&&this.updateAction(u,g,h)),t=o&&!i.i(r.isNullOrUndefined)(d)?d:i.i(s.b)(this.parent)?i.i(r.getValue)("result",this.parent.grid.dataSource):this.parent.grid.dataSource;var v,S,I=t instanceof n.DataManager?t.dataSource.json:t,w=i.i(s.b)(this.parent)?i.i(r.getValue)("count",this.parent.dataSource):I.length,R=new n.Query,x=i.i(a.getObject)("query",e);if(i.i(r.isNullOrUndefined)(x)||(v=x.queries.filter(function(e){return"onWhere"===e.fn}),S=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||!i.i(r.isNullOrUndefined)(x)&&(v.length||S.length)&&this.parent.isLocalData){i.i(r.isNullOrUndefined)(x)&&(x=new n.Query,x=i.i(r.getValue)("grid.renderModule.data",this.parent).filterQuery(x),x=i.i(r.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(I).executeLocal(R);if(this.parent.notify("updateFilterRecs",{data:D}),I=this.dataResults.result,this.dataResults.result=null,this.parent.grid.aggregates.length>0){var M=i.i(a.getObject)("query",e);if(i.i(r.isNullOrUndefined)(x)&&(x=i.i(r.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new n.Query)),!i.i(r.isNullOrUndefined)(M)){var O=M.queries.filter(function(e){return"onAggregates"===e.fn});I=this.parent.summaryModule.calculateSummaryValue(O,I,!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 P=i.i(a.getObject)("query",e);i.i(r.isNullOrUndefined)(P)&&(P=i.i(r.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new n.Query));var O=P.queries.filter(function(e){return"onAggregates"===e.fn});I=this.parent.summaryModule.calculateSummaryValue(O,this.parent.flatData,!0)}if(this.parent.grid.sortSettings.columns.length>0||this.isSortAction){this.isSortAction=!1;for(var E=this.parent.parentData,M=i.i(a.getObject)("query",e),A=new n.Query,N=this.parent.grid.sortSettings.columns.length-1;N>=0;N--){var _=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(N.toString(),10)].field),k=_.sortComparer&&i.i(s.h)(this.parent)?_.sortComparer.bind(_):this.parent.grid.sortSettings.columns[parseInt(N.toString(),10)].direction;A.sortBy(this.parent.grid.sortSettings.columns[parseInt(N.toString(),10)].field,k)}var U=new n.DataManager(E).executeLocal(A);if(this.parent.allowRowDragAndDrop&&!i.i(r.isNullOrUndefined)(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var q=U.indexOf(this.parent.rowDragAndDropModule.draggedRecord);U.splice(q,1);var V=U.indexOf(this.parent.rowDragAndDropModule.droppedRecord);this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?U.splice(V,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&U.splice(V+1,0,this.parent.rowDragAndDropModule.draggedRecord)}var B={modifiedData:U,filteredData:I,srtQry:A};if(this.parent.notify("createSort",B),I=B.modifiedData,this.dataResults.result=null,this.sortedData=I,this.parent.notify("updateModel",{}),this.parent.grid.aggregates.length>0&&!i.i(r.isNullOrUndefined)(M)){var T=i.i(a.getObject)("query",e),O=T.queries.filter(function(e){return"onAggregates"===e.fn});I=this.parent.summaryModule.calculateSummaryValue(O,this.sortedData,!1)}}w=i.i(s.b)(this.parent)?i.i(r.getValue)("count",this.parent.dataSource):I.length;var L=this.paging(I,w,o,p,l,e);I=L.result,w=L.count,e.result=I,e.count=w,this.parent.notify("updateResults",e)},e.prototype.paging=function(e,t,n,o,a,l){if(!this.parent.allowPaging||n&&"CurrentPage"!==a||o&&"CurrentPage"!==this.parent.printMode){if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(!n||"CurrentPage"===a)&&"save"!==i.i(r.getValue)("requestType",l)){var p=this.parent.enableInfiniteScrolling?l:i.i(r.getValue)("actionArgs",l);this.parent.notify(d.a,{result:e,count:t,actionArgs:p}),e=this.dataResults.result,t=this.dataResults.count}}else this.parent.notify(d.a,{result:e,count:t,actionArgs:l}),e=this.dataResults.result,t=i.i(s.b)(this.parent)?i.i(r.getValue)("count",this.parent.dataSource):this.dataResults.count;if((!0===o||l.isPdfExport&&(i.i(r.isNullOrUndefined)(l.isCollapsedStatePersist)||l.isCollapsedStatePersist))&&"AllPages"===this.parent.printMode){for(var c=[],h=0;h<e.length;h++){i.i(s.f)(this.parent,e[parseInt(h.toString(),10)],this.parent.parentData)&&c.push(e[parseInt(h.toString(),10)])}e=c,t=e.length}return{result:e,count:t}},e.prototype.updateData=function(e){this.dataResults=e},e.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify(d.k,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(d.w,{})},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r}),i.d(t,"b",function(){return n});var r;!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"}(r||(r={}));var n;!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"}(n||(n={}))},function(e,t,i){"use strict";i.d(t,"a",function(){return a}),i.d(t,"b",function(){return s}),i.d(t,"c",function(){return d});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=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={},i.i(r.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}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)(null)],t.prototype,"columns",void 0),t}(a),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(s)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)(!1)],t.prototype,"allowAdding",void 0),o([i.i(r.Property)(!1)],t.prototype,"allowEditing",void 0),o([i.i(r.Property)(!1)],t.prototype,"allowDeleting",void 0),o([i.i(r.Property)("Cell")],t.prototype,"mode",void 0),o([i.i(r.Property)("Top")],t.prototype,"newRowPosition",void 0),o([i.i(r.Property)(!0)],t.prototype,"allowEditOnDblClick",void 0),o([i.i(r.Property)(!0)],t.prototype,"showConfirmDialog",void 0),o([i.i(r.Property)(!1)],t.prototype,"showDeleteConfirmDialog",void 0),o([i.i(r.Property)("")],t.prototype,"template",void 0),o([i.i(r.Property)({})],t.prototype,"dialog",void 0),o([i.i(r.Property)(!1)],t.prototype,"allowNextRowEdit",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a}),i.d(t,"b",function(){return s});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)()],t.prototype,"field",void 0),o([i.i(r.Property)()],t.prototype,"operator",void 0),o([i.i(r.Property)()],t.prototype,"value",void 0),o([i.i(r.Property)()],t.prototype,"matchCase",void 0),o([i.i(r.Property)()],t.prototype,"ignoreAccent",void 0),o([i.i(r.Property)()],t.prototype,"predicate",void 0),o([i.i(r.Property)({})],t.prototype,"actualFilterValue",void 0),o([i.i(r.Property)({})],t.prototype,"actualOperator",void 0),o([i.i(r.Property)()],t.prototype,"type",void 0),o([i.i(r.Property)()],t.prototype,"ejpredicate",void 0),o([i.i(r.Property)()],t.prototype,"uid",void 0),o([i.i(r.Property)()],t.prototype,"isForeignKey",void 0),t}(r.ChildProperty),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Collection)([],a)],t.prototype,"columns",void 0),o([i.i(r.Property)("FilterBar")],t.prototype,"type",void 0),o([i.i(r.Property)()],t.prototype,"mode",void 0),o([i.i(r.Property)(!0)],t.prototype,"showFilterBarStatus",void 0),o([i.i(r.Property)(1500)],t.prototype,"immediateModeDelay",void 0),o([i.i(r.Property)()],t.prototype,"operators",void 0),o([i.i(r.Property)(!1)],t.prototype,"ignoreAccent",void 0),o([i.i(r.Property)("Parent")],t.prototype,"hierarchyMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)(!1)],t.prototype,"enableCache",void 0),o([i.i(r.Property)(3)],t.prototype,"maxBlocks",void 0),o([i.i(r.Property)(3)],t.prototype,"initialBlocks",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)("Spinner")],t.prototype,"indicatorType",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)(12)],t.prototype,"pageSize",void 0),o([i.i(r.Property)(8)],t.prototype,"pageCount",void 0),o([i.i(r.Property)(1)],t.prototype,"currentPage",void 0),o([i.i(r.Property)()],t.prototype,"totalRecordsCount",void 0),o([i.i(r.Property)(!1)],t.prototype,"enableQueryString",void 0),o([i.i(r.Property)(!1)],t.prototype,"pageSizes",void 0),o([i.i(r.Property)(null)],t.prototype,"template",void 0),o([i.i(r.Property)("All")],t.prototype,"pageSizeMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)()],t.prototype,"fields",void 0),o([i.i(r.Property)(!1)],t.prototype,"ignoreCase",void 0),o([i.i(r.Property)("contains")],t.prototype,"operator",void 0),o([i.i(r.Property)()],t.prototype,"key",void 0),o([i.i(r.Property)()],t.prototype,"hierarchyMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)("Row")],t.prototype,"mode",void 0),o([i.i(r.Property)("Flow")],t.prototype,"cellSelectionMode",void 0),o([i.i(r.Property)("Single")],t.prototype,"type",void 0),o([i.i(r.Property)(!1)],t.prototype,"persistSelection",void 0),o([i.i(r.Property)("Default")],t.prototype,"checkboxMode",void 0),o([i.i(r.Property)(!1)],t.prototype,"checkboxOnly",void 0),o([i.i(r.Property)(!0)],t.prototype,"enableToggle",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a}),i.d(t,"b",function(){return s});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)()],t.prototype,"field",void 0),o([i.i(r.Property)()],t.prototype,"direction",void 0),t}(r.ChildProperty),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Collection)([],a)],t.prototype,"columns",void 0),o([i.i(r.Property)(!0)],t.prototype,"allowUnsort",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s}),i.d(t,"b",function(){return d});var r=i(1),n=(i.n(r),i(0)),o=(i.n(n),this&&this.__extends||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)}}()),a=this&&this.__decorate||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},s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.intl=new r.Internationalization,t.templateFn={},t}return o(t,e),t.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},t.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},t.prototype.getFormatter=function(){return this.formatFn},t.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[i.i(r.getEnumValue)(n.CellType,n.CellType.Summary)]={fn:i.i(r.compile)(this.footerTemplate,e),property:"footerTemplate"})},t.prototype.getTemplate=function(e){return this.templateFn[i.i(r.getEnumValue)(n.CellType,e)]},t.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},a([i.i(r.Property)()],t.prototype,"type",void 0),a([i.i(r.Property)()],t.prototype,"footerTemplate",void 0),a([i.i(r.Property)()],t.prototype,"field",void 0),a([i.i(r.Property)()],t.prototype,"format",void 0),a([i.i(r.Property)()],t.prototype,"columnName",void 0),a([i.i(r.Property)()],t.prototype,"customAggregate",void 0),t}(r.ChildProperty),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),a([i.i(r.Collection)([],s)],t.prototype,"columns",void 0),a([i.i(r.Property)(!0)],t.prototype,"showChildSummary",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),i(3)),a=i(2),s=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 t=e.data,s=t.parentItem;if(!i.i(n.isNullOrUndefined)(t.parentItem)&&!i.i(a.d)(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||i.i(a.a)(this.parent)&&!i.i(a.h)(this.parent))){if((this.parent.initialRender&&(!(i.i(n.isNullOrUndefined)(s[this.parent.expandStateMapping])||s[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!i.i(a.f)(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!i.i(n.isNullOrUndefined)(e.row)){e.row.style.display="none";var d=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||i.i(n.isNullOrUndefined)(e.row.getAttribute("data-uid"))||(d.filter(function(t){return t.uid===e.row.getAttribute("data-uid")})[0].visible=!1)}}if(i.i(a.a)(this.parent)&&!i.i(a.h)(this.parent)){var l=this.parent,p=this.parent.getCurrentViewRecords().filter(function(e){return i.i(n.getValue)(l.idMapping,e)===i.i(n.getValue)(l.parentIdMapping,t)});if(p.length>0&&!p[0].isSummaryRow&&!i.i(n.isNullOrUndefined)(e.row)){var c=p[0].expanded?"table-row":"none";e.row.setAttribute("style","display: "+c+";")}}i.i(r.getObject)("isSummaryRow",e.data)&&i.i(n.addClass)([e.row],"e-summaryrow"),i.i(n.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&&(i.i(n.isNullOrUndefined)(t.parentItem)||(e.row.style.display="none")));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||i.i(n.isNullOrUndefined)(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var h=this;h.parent.renderReactTemplates(function(){h.parent.trigger(o.I,e)})}else this.parent.trigger(o.I,e)}},e.prototype.cellRender=function(e){if(e.data){var t,s,d=this.parent.grid,l=e.data,p=i.i(n.isNullOrUndefined)(l.filterLevel),c=p?l.level:l.filterLevel,h=0,u=this.parent.getColumnByUid(e.column.uid),g=l.isSummaryRow,f=this.parent.getFrozenColumns();t=i.i(n.isNullOrUndefined)(l.parentItem)?l.index:l.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):d.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!i.i(n.isNullOrUndefined)(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{for(var y=i.i(n.createElement)("div",{className:"e-treecolumn-container"}),m=i.i(n.createElement)("span",{className:"e-icons e-none",styles:"width: 10px; display: inline-block"}),v=0;v<c;v++)h+=10,y.appendChild(m.cloneNode());var S=i.i(n.isNullOrUndefined)(l.hasFilteredChildRecords)?l.hasChildRecords:l.hasFilteredChildRecords;if(S&&!i.i(n.isNullOrUndefined)(l.childRecords)&&(S=this.parent.isFromGantt&&!this.parent.loadChildOnDemand?l.hasChildRecords:!(0===l.childRecords.length)),S){i.i(n.addClass)([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",l.expanded?"true":"false");var I=i.i(n.createElement)("span",{className:"e-icons"}),w=void 0;w=this.parent.initialRender?l.expanded&&(i.i(n.isNullOrUndefined)(l[this.parent.expandStateMapping])||l[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll:!(!l.expanded||!i.i(a.f)(this.parent,l,this.parent.grid.getCurrentViewRecords())),i.i(n.addClass)([I],w?"e-treegridexpand":"e-treegridcollapse"),h+=18,y.appendChild(I),m.style.width="4px",h+=7,y.appendChild(m.cloneNode())}else(c||!c&&!l.level)&&(h+=20,y.appendChild(m.cloneNode()),y.appendChild(m.cloneNode()));s=i.i(n.createElement)("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(s.style.width="Calc(100% - "+h+"px)"),i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level),this.updateTreeCell(e,s),y.appendChild(s),e.cell.appendChild(y)}if(d.getFrozenLeftColumnsCount()>0||d.getFrozenRightColumnsCount()>0){var R=d.getFrozenRightColumns(),x=d.getFrozenLeftColumns(),C=d.getMovableColumns();R.length>0&&R[0].field===e.column.field?i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level):x.length>0&&x[0].field===e.column.field?i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level):C.length>0&&C[0].field===e.column.field&&i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level)}else f>this.parent.treeColumnIndex&&f>0&&d.getColumnIndexByUid(e.column.uid)===f?i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level):f<this.parent.treeColumnIndex&&f>0&&(d.getColumnIndexByUid(e.column.uid)===f||d.getColumnIndexByUid(e.column.uid)===f-1)?i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level):f===this.parent.treeColumnIndex&&f>0&&d.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1&&i.i(n.addClass)([e.cell],"e-gridrowindex"+t+"level"+l.level);if(!i.i(n.isNullOrUndefined)(u)&&u.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var b=e.cell.querySelectorAll(".e-frame")[0];h+=parseInt(b.style.width,16),h+=10,s=d.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox"),s.style.width="Calc(100% - "+h+"px)"}if(g){i.i(n.addClass)([e.cell],"e-summarycell");var D=i.i(r.getObject)(e.column.field,e.data);D=i.i(n.isNullOrUndefined)(D)?null:D,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=D:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=D}this.parent.args=e;var M=i.i(n.getValue)("columnModel",this.parent),O=M[this.parent.treeColumnIndex];if(i.i(n.isNullOrUndefined)(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger(o.J,e);else if(this.parent.isReact&&O.field!==e.column.field){var P=this;P.parent.renderReactTemplates(function(){P.parent.trigger(o.J,e)})}}},e.prototype.updateTreeCell=function(e,t){var a=i.i(n.getValue)("columnModel",this.parent),s=a[this.parent.treeColumnIndex],d=e.column.index;i.i(n.isNullOrUndefined)(s.field)&&e.cell.setAttribute("data-colindex",d+""),s.field!==e.column.field||i.i(n.isNullOrUndefined)(s.template)||(e.column.template=s.template,e.column.templateFn=i.i(r.templateCompiler)(e.column.template),e.cell.classList.add("e-templatecell"));var l=null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML:e.cell.innerHTML;if("object"==typeof e.column.template&&this.templateResult)i.i(r.appendChildren)(t,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var p=e.cell.children.length,c=this.parent.element.id+e.column.uid;if(s.field!==e.column.field||i.i(n.isNullOrUndefined)(s.template))for(var h=0;h<p;p=e.cell.children.length)t.appendChild(e.cell.children[parseInt(h.toString(),10)]);else{if(this.parent.isReact&&"string"!=typeof e.column.template){e.column.templateFn(e.data,this.parent,"columnTemplate",c,null,null,t),i.i(n.isNullOrUndefined)(this.parent.grid.portals)&&(this.parent.grid.portals=this.parent.portals),this.parent.notify("renderReactTemplate",this.parent.portals);var u=this;u.parent.renderReactTemplates(function(){u.parent.trigger(o.J,e)})}else{var g=e.column.templateFn(i.i(r.extend)({index:""},e.data),this.parent,"template",c,this.parent.isStringTemplate);i.i(r.appendChildren)(t,g)}delete e.column.template,delete e.column.templateFn,e.cell.innerHTML=""}}else t.innerHTML=l,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var t=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var o=t.parent.grid.getRowsObject(),a=t.parent.getDataRows(),s=t.parent.grid.getIndentCount(),d=t.parent.grid.getNormalizedColumnIndex(e);if(0!==a.length)for(var l=0;l<o.length;l++)if(o[parseInt(l.toString(),10)].isDataRow&&!i.i(n.isNullOrUndefined)(o[parseInt(l.toString(),10)].index)){var p=o[parseInt(l.toString(),10)].cells[parseInt(d.toString(),10)],c=new r.CellRenderer(t.parent.grid,t.parent.grid.serviceLocator),h=a.length>=o.length?t.parent.getCellFromIndex(o[parseInt(l.toString(),10)].index,d-s):t.parent.getRows()[o[parseInt(l.toString(),10)].index].querySelector(".e-templatecell");c.refreshTD(h,p,o[parseInt(l.toString(),10)].data,{index:o[parseInt(l.toString(),10)].index});var u=t.parent.getRows()[parseInt(l.toString(),10)].cells[parseInt(d.toString(),10)];t.cellRender({data:o[parseInt(l.toString(),10)].data,cell:u,column:p.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}()},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(0),n=(i.n(r),i(3)),o=i(1),a=(i.n(o),i(4)),s=(i.n(a),i(2)),d=this&&this.__extends||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)}}(),l=function(e){function t(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return d(t,e),t.prototype.addEventListener=function(){this.parent.on(n.e,this.getDatas,this)},t.prototype.getDatas=function(e){this.visualData=e.data},t.prototype.getDataInfo=function(){return e.prototype.getData.call(this)},t.prototype.generateRows=function(t,r){!i.i(o.isNullOrUndefined)(r.virtualInfo)&&r.virtualInfo.loadNext&&r.virtualInfo.nextInfo.page!==this.parent.pageSettings.currentPage?this.parent.setProperties({pageSettings:{currentPage:r.virtualInfo.nextInfo.page}},!0):i.i(o.isNullOrUndefined)(r.virtualInfo)||r.virtualInfo.loadNext||r.virtualInfo.page===this.parent.pageSettings.currentPage||this.parent.setProperties({pageSettings:{currentPage:r.virtualInfo.page}},!0);var n=this.getDataInfo();if(i.i(o.isNullOrUndefined)(r.virtualInfo)||("right"!==r.virtualInfo.direction&&"left"!==r.virtualInfo.direction?(this.parent.dataSource instanceof a.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||i.i(s.b)(this.parent))&&1!==r.virtualInfo.blockIndexes.length||(r.virtualInfo.blockIndexes=n.blockIndexes):r.virtualInfo.blockIndexes=this.getBlockIndexes(r.virtualInfo.page)),this.parent.dataSource instanceof a.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||i.i(s.b)(this.parent))return e.prototype.generateRows.call(this,t,r);i.i(o.isNullOrUndefined)(r.requestType)||"collapseAll"!==r.requestType.toString()||(r.requestType="refresh");var d=e.prototype.generateRows.call(this,t,r);if(!i.i(o.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},t.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 a.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||i.i(s.b)(this.parent)){var r=this.model.currentPage;t?(this.cache={},this.data={},this.groups={}):"virtualscroll"===e&&this.cache[parseInt(r.toString(),10)]&&this.cache[parseInt(r.toString(),10)].length>this.parent.contentModule.getBlockSize()&&delete this.cache[parseInt(r.toString(),10)]}else(t||"virtualscroll"===e)&&(this.cache={},this.data={},this.groups={});return t},t}(r.VirtualRowModelGenerator)},function(e,t){e.exports=r},function(e,t,i){"use strict";var r=i(48);i.d(t,"o",function(){return r.a}),i.d(t,"p",function(){return r.b}),i.d(t,"q",function(){return r.c}),i.d(t,"r",function(){return r.d}),i.d(t,"s",function(){return r.e}),i.d(t,"t",function(){return r.f}),i.d(t,"u",function(){return r.g}),i.d(t,"v",function(){return r.h}),i.d(t,"w",function(){return r.i}),i.d(t,"x",function(){return r.j}),i.d(t,"y",function(){return r.k}),i.d(t,"z",function(){return r.l}),i.d(t,"A",function(){return r.m}),i.d(t,"B",function(){return r.n}),i.d(t,"C",function(){return r.o}),i.d(t,"D",function(){return r.p}),i.d(t,"E",function(){return r.q}),i.d(t,"F",function(){return r.r}),i.d(t,"G",function(){return r.s}),i.d(t,"H",function(){return r.t}),i.d(t,"I",function(){return r.u}),i.d(t,"J",function(){return r.v}),i.d(t,"K",function(){return r.w}),i.d(t,"L",function(){return r.x}),i.d(t,"M",function(){return r.y}),i.d(t,"N",function(){return r.z}),i.d(t,"O",function(){return r.A}),i.d(t,"P",function(){return r.B}),i.d(t,"Q",function(){return r.C}),i.d(t,"R",function(){return r.D}),i.d(t,"S",function(){return r.E}),i.d(t,"T",function(){return r.F}),i.d(t,"U",function(){return r.G}),i.d(t,"V",function(){return r.H}),i.d(t,"W",function(){return r.I}),i.d(t,"X",function(){return r.J}),i.d(t,"Y",function(){return r.K}),i.d(t,"Z",function(){return r.L}),i.d(t,"_0",function(){return r.M}),i.d(t,"_1",function(){return r.N}),i.d(t,"_2",function(){return r.O}),i.d(t,"_3",function(){return r.P}),i.d(t,"_4",function(){return r.Q}),i.d(t,"_5",function(){return r.R}),i.d(t,"_6",function(){return r.S}),i.d(t,"_7",function(){return r.T}),i.d(t,"_8",function(){return r.U}),i.d(t,"_9",function(){return r.V}),i.d(t,"_10",function(){return r.W}),i.d(t,"_11",function(){return r.X}),i.d(t,"_12",function(){return r.Y}),i.d(t,"_13",function(){return r.Z}),i.d(t,"_14",function(){return r._0}),i.d(t,"_15",function(){return r._1}),i.d(t,"_16",function(){return r._2}),i.d(t,"_17",function(){return r._3}),i.d(t,"_18",function(){return r._4}),i.d(t,"_19",function(){return r._5}),i.d(t,"_20",function(){return r._6}),i.d(t,"_21",function(){return r._7}),i.d(t,"_22",function(){return r._8}),i.d(t,"_23",function(){return r._9}),i.d(t,"_24",function(){return r._10}),i.d(t,"_25",function(){return r._11}),i.d(t,"_26",function(){return r._12}),i.d(t,"_27",function(){return r._13}),i.d(t,"_28",function(){return r._14}),i.d(t,"_29",function(){return r._15}),i.d(t,"_30",function(){return r._16}),i.d(t,"_31",function(){return r._17}),i.d(t,"_32",function(){return r._18}),i.d(t,"_33",function(){return r._19}),i.d(t,"_34",function(){return r._20}),i.d(t,"_35",function(){return r._21}),i.d(t,"_36",function(){return r._22}),i.d(t,"_37",function(){return r._23}),i.d(t,"_38",function(){return r._24}),i.d(t,"_39",function(){return r._25}),i.d(t,"_40",function(){return r._26}),i.d(t,"_41",function(){return r._27}),i.d(t,"_42",function(){return r._28}),i.d(t,"_43",function(){return r._29}),i.d(t,"_44",function(){return r._30}),i.d(t,"_45",function(){return r._31});var n=i(50);i.d(t,"_46",function(){return n.a}),i.d(t,"_47",function(){return n.b}),i.d(t,"_48",function(){return n.c}),i.d(t,"_49",function(){return n.d}),i.d(t,"_50",function(){return n.e}),i.d(t,"_51",function(){return n.f}),i.d(t,"_52",function(){return n.g}),i.d(t,"_53",function(){return n.h}),i.d(t,"_54",function(){return n.i}),i.d(t,"_55",function(){return n.j}),i.d(t,"_56",function(){return n.k}),i.d(t,"_57",function(){return n.l}),i.d(t,"_58",function(){return n.m}),i.d(t,"_59",function(){return n.n}),i.d(t,"_60",function(){return n.o}),i.d(t,"_61",function(){return n.p});var o=i(53);i.d(t,"_62",function(){return o.a}),i.d(t,"_63",function(){return o.b});var a=i(2);i.d(t,"a",function(){return a.a}),i.d(t,"b",function(){return a.b}),i.d(t,"c",function(){return a.c}),i.d(t,"d",function(){return a.d}),i.d(t,"e",function(){return a.e}),i.d(t,"f",function(){return a.f}),i.d(t,"g",function(){return a.g}),i.d(t,"h",function(){return a.h}),i.d(t,"i",function(){return a.i}),i.d(t,"j",function(){return a.j}),i.d(t,"k",function(){return a.k}),i.d(t,"l",function(){return a.l});var s=i(12);i.d(t,"m",function(){return s.a}),i.d(t,"n",function(){return s.b});var d=i(38);i.d(t,"_64",function(){return d.a}),i.d(t,"_65",function(){return d.b}),i.d(t,"_66",function(){return d.c}),i.d(t,"_67",function(){return d.d}),i.d(t,"_68",function(){return d.e}),i.d(t,"_69",function(){return d.f}),i.d(t,"_70",function(){return d.g}),i.d(t,"_71",function(){return d.h}),i.d(t,"_72",function(){return d.i}),i.d(t,"_73",function(){return d.j}),i.d(t,"_74",function(){return d.k}),i.d(t,"_75",function(){return d.l}),i.d(t,"_76",function(){return d.m}),i.d(t,"_77",function(){return d.n}),i.d(t,"_78",function(){return d.o}),i.d(t,"_79",function(){return d.p}),i.d(t,"_80",function(){return d.q}),i.d(t,"_81",function(){return d.r}),i.d(t,"_82",function(){return d.s}),i.d(t,"_83",function(){return d.t}),i.d(t,"_84",function(){return d.u})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(26);i.d(t,"isRemoteData",function(){return r.a}),i.d(t,"isCountRequired",function(){return r.b}),i.d(t,"isCheckboxcolumn",function(){return r.c}),i.d(t,"isFilterChildHierarchy",function(){return r.d}),i.d(t,"findParentRecords",function(){return r.e}),i.d(t,"getExpandStatus",function(){return r.f}),i.d(t,"findChildrenRecords",function(){return r.g}),i.d(t,"isOffline",function(){return r.h}),i.d(t,"extendArray",function(){return r.i}),i.d(t,"getPlainData",function(){return r.j}),i.d(t,"getParentData",function(){return r.k}),i.d(t,"isHidden",function(){return r.l}),i.d(t,"ToolbarItem",function(){return r.m}),i.d(t,"ContextMenuItems",function(){return r.n}),i.d(t,"TreeGrid",function(){return r.o}),i.d(t,"load",function(){return r.p}),i.d(t,"rowDataBound",function(){return r.q}),i.d(t,"dataBound",function(){return r.r}),i.d(t,"queryCellInfo",function(){return r.s}),i.d(t,"beforeDataBound",function(){return r.t}),i.d(t,"actionBegin",function(){return r.u}),i.d(t,"dataStateChange",function(){return r.v}),i.d(t,"actionComplete",function(){return r.w}),i.d(t,"rowSelecting",function(){return r.x}),i.d(t,"rowSelected",function(){return r.y}),i.d(t,"checkboxChange",function(){return r.z}),i.d(t,"rowDeselected",function(){return r.A}),i.d(t,"toolbarClick",function(){return r.B}),i.d(t,"beforeExcelExport",function(){return r.C}),i.d(t,"beforePdfExport",function(){return r.D}),i.d(t,"resizeStop",function(){return r.E}),i.d(t,"expanded",function(){return r.F}),i.d(t,"expanding",function(){return r.G}),i.d(t,"collapsed",function(){return r.H}),i.d(t,"collapsing",function(){return r.I}),i.d(t,"remoteExpand",function(){return r.J}),i.d(t,"localPagedExpandCollapse",function(){return r.K}),i.d(t,"pagingActions",function(){return r.L}),i.d(t,"printGridInit",function(){return r.M}),i.d(t,"contextMenuOpen",function(){return r.N}),i.d(t,"contextMenuClick",function(){return r.O}),i.d(t,"beforeCopy",function(){return r.P}),i.d(t,"beforePaste",function(){return r.Q}),i.d(t,"savePreviousRowPosition",function(){return r.R}),i.d(t,"crudAction",function(){return r.S}),i.d(t,"beginEdit",function(){return r.T}),i.d(t,"beginAdd",function(){return r.U}),i.d(t,"recordDoubleClick",function(){return r.V}),i.d(t,"cellSave",function(){return r.W}),i.d(t,"cellSaved",function(){return r.X}),i.d(t,"cellEdit",function(){return r.Y}),i.d(t,"batchDelete",function(){return r.Z}),i.d(t,"batchCancel",function(){return r._0}),i.d(t,"batchAdd",function(){return r._1}),i.d(t,"beforeBatchDelete",function(){return r._2}),i.d(t,"beforeBatchAdd",function(){return r._3}),i.d(t,"beforeBatchSave",function(){return r._4}),i.d(t,"batchSave",function(){return r._5}),i.d(t,"keyPressed",function(){return r._6}),i.d(t,"updateData",function(){return r._7}),i.d(t,"doubleTap",function(){return r._8}),i.d(t,"virtualColumnIndex",function(){return r._9}),i.d(t,"virtualActionArgs",function(){return r._10}),i.d(t,"destroy",function(){return r._11}),i.d(t,"dataListener",function(){return r._12}),i.d(t,"indexModifier",function(){return r._13}),i.d(t,"beforeStartEdit",function(){return r._14}),i.d(t,"beforeBatchCancel",function(){return r._15}),i.d(t,"batchEditFormRendered",function(){return r._16}),i.d(t,"detailDataBound",function(){return r._17}),i.d(t,"rowDrag",function(){return r._18}),i.d(t,"rowDragStartHelper",function(){return r._19}),i.d(t,"rowDrop",function(){return r._20}),i.d(t,"rowDragStart",function(){return r._21}),i.d(t,"rowsAdd",function(){return r._22}),i.d(t,"rowsRemove",function(){return r._23}),i.d(t,"rowdraging",function(){return r._24}),i.d(t,"rowDropped",function(){return r._25}),i.d(t,"autoCol",function(){return r._26}),i.d(t,"rowDeselecting",function(){return r._27}),i.d(t,"headerContent",function(){return r._28}),i.d(t,"movableContent",function(){return r._29}),i.d(t,"movableHeader",function(){return r._30}),i.d(t,"frozenContent",function(){return r._31}),i.d(t,"frozenHeader",function(){return r._32}),i.d(t,"content",function(){return r._33}),i.d(t,"table",function(){return r._34}),i.d(t,"leftRight",function(){return r._35}),i.d(t,"frozenRight",function(){return r._36}),i.d(t,"frozenLeft",function(){return r._37}),i.d(t,"dataColIndex",function(){return r._38}),i.d(t,"ariaColIndex",function(){return r._39}),i.d(t,"dataRowIndex",function(){return r._40}),i.d(t,"ariaRowIndex",function(){return r._41}),i.d(t,"DataManipulation",function(){return r._42}),i.d(t,"Reorder",function(){return r._43}),i.d(t,"Resize",function(){return r._44}),i.d(t,"RowDD",function(){return r._45}),i.d(t,"Column",function(){return r._46}),i.d(t,"TreeGridColumn",function(){return r._47}),i.d(t,"StackedColumn",function(){return r._48}),i.d(t,"EditSettings",function(){return r._49}),i.d(t,"Predicate",function(){return r._50}),i.d(t,"FilterSettings",function(){return r._51}),i.d(t,"PageSettings",function(){return r._52}),i.d(t,"SearchSettings",function(){return r._53}),i.d(t,"SelectionSettings",function(){return r._54}),i.d(t,"AggregateColumn",function(){return r._55}),i.d(t,"AggregateRow",function(){return r._56}),i.d(t,"SortDescriptor",function(){return r._57}),i.d(t,"SortSettings",function(){return r._58}),i.d(t,"RowDropSettings",function(){return r._59}),i.d(t,"InfiniteScrollSettings",function(){return r._60}),i.d(t,"LoadingIndicator",function(){return r._61}),i.d(t,"Render",function(){return r._62}),i.d(t,"TreeVirtualRowModelGenerator",function(){return r._63}),i.d(t,"Filter",function(){return r._64}),i.d(t,"ExcelExport",function(){return r._65}),i.d(t,"PdfExport",function(){return r._66}),i.d(t,"Page",function(){return r._67}),i.d(t,"Toolbar",function(){return r._68}),i.d(t,"Aggregate",function(){return r._69}),i.d(t,"Sort",function(){return r._70}),i.d(t,"TreeClipboard",function(){return r._71}),i.d(t,"ColumnMenu",function(){return r._72}),i.d(t,"ContextMenu",function(){return r._73}),i.d(t,"Edit",function(){return r._74}),i.d(t,"CommandColumn",function(){return r._75}),i.d(t,"Selection",function(){return r._76}),i.d(t,"DetailRow",function(){return r._77}),i.d(t,"VirtualScroll",function(){return r._78}),i.d(t,"TreeVirtual",function(){return r._79}),i.d(t,"Freeze",function(){return r._80}),i.d(t,"ColumnChooser",function(){return r._81}),i.d(t,"Logger",function(){return r._82}),i.d(t,"treeGridDetails",function(){return r._83}),i.d(t,"InfiniteScroll",function(){return r._84})},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(1),n=(i.n(r),i(3)),o=i(4),a=(i.n(o),i(2)),s=i(0),d=(i.n(s),i(5)),l=function(){function e(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!i.i(r.isNullOrUndefined)(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(n.x,this.cellSaved,this),this.parent.on(n.y,this.batchAdd,this),this.parent.on(n.z,this.beforeBatchAdd,this),this.parent.on(n.w,this.batchSave,this),this.parent.on(n.A,this.beforeBatchDelete,this),this.parent.on(n.B,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)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(n.x,this.cellSaved),this.parent.off(n.y,this.batchAdd),this.parent.off(n.w,this.batchSave),this.parent.off(n.z,this.beforeBatchAdd),this.parent.off(n.A,this.beforeBatchDelete),this.parent.off(n.B,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))},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,t=this.parent.grid.dataSource instanceof o.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!i.i(r.isNullOrUndefined)(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var a=0;a<this.batchAddedRecords.length;a++)e=t.map(function(e){return e[""+n]}).indexOf(this.batchAddedRecords[parseInt(a.toString(),10)][""+n]),t.splice(e,1);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 t=this.parent.grid.dataSource instanceof o.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=void 0,l=this.parent.grid.getPrimaryKeyFieldNames()[0],p=void 0,c=void 0,h=this.selectedIndex>-1?this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem:null,u=void 0,g=void 0,f=void 0,y="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1;if(y=this.getActualRowObjectIndex(y),this.newBatchRowAdded){if(this.batchRecords.length&&(u=this.batchRecords[this.addRowIndex][this.parent.idMapping],f=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem&&(g=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].parentItem.uniqueID)),this.batchAddedRecords=i.i(a.i)(this.batchAddedRecords),this.batchAddRowRecord=i.i(a.i)(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),n=this.parent.grid.getRowsObject()[parseInt(y.toString(),10)].changes,n.uniqueID=i.i(s.getUid)(this.parent.element.id+"_data_"),i.i(r.setValue)("uniqueIDCollection."+n.uniqueID,n,this.parent),!Object.prototype.hasOwnProperty.call(n,"level")){if(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition){if(n.primaryParent=h,this.selectedIndex>-1){n.parentItem=i.i(r.extend)({},this.batchRecords[this.addRowIndex]),n.parentUniqueID=n.parentItem.uniqueID,delete n.parentItem.childRecords,delete n.parentItem[this.parent.childMapping],n.level=n.parentItem.level+1,n.index=this.batchIndex;var m=i.i(a.g)(this.batchRecords[this.addRowIndex]).length,v=i.i(a.g)(this.batchRecords[this.addRowIndex])[m-1];v=i.i(r.isNullOrUndefined)(v)?this.batchRecords[this.addRowIndex]:v,p=t.map(function(e){return e[""+l]}).indexOf(v[""+l]),this.isSelfReference&&(n[this.parent.parentIdMapping]=u),i.i(d.b)(l,n.parentItem,"add",this.parent,this.isSelfReference,n)}}else if(("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&!i.i(r.isNullOrUndefined)(this.batchRecords[this.addRowIndex])){if(n.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,n.level&&this.selectedIndex>-1&&(n.parentItem=h,n.parentUniqueID=g,delete n.parentItem.childRecords,delete n.parentItem[this.parent.childMapping]),n.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){var m=i.i(a.g)(this.batchRecords[this.addRowIndex]).length,v=i.i(a.g)(this.batchRecords[this.addRowIndex])[m-1];v=i.i(r.isNullOrUndefined)(v)?this.batchRecords[this.addRowIndex]:v,p=t.map(function(e){return e[""+l]}).indexOf(v[""+l])}if("Above"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){var v=this.batchRecords[this.addRowIndex];p=t.map(function(e){return e[""+l]}).indexOf(v[""+l])}this.isSelfReference&&(n[this.parent.parentIdMapping]=f)}n.index=-1===n.index?0:n.index,n.hasChildRecords=!1,n.childRecords=[],this.batchRecords.splice(n.index,0,n),this.currentViewRecords.splice(n.index,0,n),c=p||n.index,"Above"!==this.parent.editSettings.newRowPosition&&(c=0===n.index?c:c+1),t.splice(c,0,n),this.batchAddedRecords.push(n)}this.parent.grid.getRowsObject()[parseInt(y.toString(),10)].data=n,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||i.i(r.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 t=0;if(this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=i.i(a.i)(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=i.i(a.i)(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!i.i(r.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&i.i(r.classList)(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition){var o=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(o=this.batchRecords),this.updateChildCount(o),this.parent.notify(n.m,{}),this.batchChildCount=0}this.updateRowIndex();var s=i.i(r.getValue)("focusModule",this.parent.grid),d=this.parent.getContentTable();if(this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(t=e.row.rowIndex,s.getContent().matrix.matrix=this.matrix):t=d.getElementsByClassName("e-batchrow")[0].rowIndex,s.getContent().matrix.current=[t,s.getContent().matrix.current[1]],this.parent.editModule.isAddedRowByMethod&&!i.i(r.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){var l=this.parent.getBatchChanges().addedRecords,p=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[l.length-1].getAttribute("data-rowindex"),10);this.batchRecords.splice(p,0,l[l.length-1])}}},e.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=i.i(a.i)(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=i.i(a.i)(this.parent.grid.getCurrentViewRecords()));var t=i.i(r.getValue)("focusModule",this.parent.grid);this.matrix=t.getContent().matrix.matrix;var n,o,s,d=[],l=[],p=this.parent.grid.getPrimaryKeyFieldNames()[0];i.i(r.isNullOrUndefined)(e.row)||-1!==this.parent.getSelectedRows().indexOf(e.row)?(n=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1],o=i.i(a.g)(n),s=this.parent.getSelectedRows()[0].getAttribute("data-uid")):(n=e.rowData,o=i.i(a.g)(n),s=e.row.getAttribute("data-uid"));var c=parseInt(this.parent.grid.getRowElementByUID(s).getAttribute("data-rowindex"),10);if(o.length)for(var h=c+o.length,u=c+1,g=u;g<=h;g++)d.push(this.parent.grid.getDataRows()[parseInt(g.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&d.push(this.parent.grid.getHeaderContent()[parseInt(g.toString(),10)]);if(!i.i(r.isNullOrUndefined)(n.parentItem)){var f=i.i(a.k)(this.parent,n.parentItem.uniqueID);if(!i.i(r.isNullOrUndefined)(f)&&f.hasChildRecords){var y=f.childRecords.indexOf(n);f.childRecords.splice(y,1)}this.batchDeletedRecords=i.i(a.i)(this.batchDeletedRecords),this.batchDeletedRecords.push(n)}o.push(n),l=o;for(var g=0;g<l.length;g++){var m=this.batchRecords.map(function(e){return e[""+p]}).indexOf(l[parseInt(g.toString(),10)][""+p]);-1!==m&&this.batchRecords.splice(m,1)}for(var g=0;g<d.length;g++)i.i(r.isNullOrUndefined)(d[parseInt(g.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(d[parseInt(g.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("data-rowindex",t.toString())},e.prototype.updateChildCount=function(e){for(var t=this.parent.grid.getPrimaryKeyFieldNames()[0],n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<this.parent.getBatchChanges().addedRecords.length;o++)i.i(r.isNullOrUndefined)(this.parent.getBatchChanges().addedRecords[parseInt(o.toString(),10)][""+n])||this.parent.getBatchChanges().addedRecords[parseInt(o.toString(),10)][""+n][""+t]===e[parseInt(this.addRowIndex.toString(),10)][""+t]&&(this.batchChildCount=this.batchChildCount+1)},e.prototype.beforeBatchSave=function(e){var t=e.batchChanges.changedRecords;if(e.batchChanges.changedRecords.length)for(var r=0;r<t.length;r++)i.i(d.a)({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 n=e.batchChanges.deletedRecords,o=n,r=0;r<o.length;r++){this.deleteUniqueID(o[parseInt(r.toString(),10)].uniqueID);for(var s=i.i(a.g)(o[parseInt(r.toString(),10)]),l=0;l<s.length;l++)this.deleteUniqueID(s[parseInt(l.toString(),10)].uniqueID);e.batchChanges.deletedRecords=e.batchChanges.deletedRecords.concat(s)}this.isAdd=!1},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.batchCancelAction=function(){var e,t=this.parent.grid.getCurrentViewRecords(),n=this.parent.grid.dataSource instanceof o.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,s=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!i.i(r.isNullOrUndefined)(this.batchAddedRecords))for(var d=0;d<this.batchAddedRecords.length;d++)if(e=n.map(function(e){return e[""+s]}).indexOf(this.batchAddedRecords[parseInt(d.toString(),10)][""+s]),-1!==e&&n.splice(e,1),"Child"===this.parent.editSettings.newRowPosition&&(e=t.map(function(e){return e[""+s]}).indexOf(this.batchAddedRecords[parseInt(d.toString(),10)].parentItem?this.batchAddedRecords[parseInt(d.toString(),10)].parentItem[""+s]:this.batchAddedRecords[parseInt(d.toString(),10)][""+s]),!i.i(r.isNullOrUndefined)(t[parseInt(e.toString(),10)])))for(var l=t[parseInt(e.toString(),10)].childRecords,p=0;l&&p<l.length;p++)l[parseInt(p.toString(),10)][""+s]===this.batchAddedRecords[parseInt(d.toString(),10)][""+s]&&t[parseInt(e.toString(),10)].childRecords.splice(p,1);if(!i.i(r.isNullOrUndefined)(this.parent.targetElement)){var c=this.parent.targetElement.closest("tr");this.parent.collapseRow(c),this.parent.targetElement=null}if(!i.i(r.isNullOrUndefined)(this.batchDeletedRecords))for(var d=0;d<this.batchDeletedRecords.length;d++)if(!i.i(r.isNullOrUndefined)(this.batchDeletedRecords[parseInt(d.toString(),10)].parentItem)){e=t.map(function(e){return e[""+s]}).indexOf(this.batchDeletedRecords[parseInt(d.toString(),10)].parentItem[""+s]);var h=0===this.batchDeletedRecords[parseInt(d.toString(),10)].index?this.batchDeletedRecords[parseInt(d.toString(),10)].index:this.batchDeletedRecords[parseInt(d.toString(),10)].index-1;i.i(r.isNullOrUndefined)(t[parseInt(e.toString(),10)])||t[parseInt(e.toString(),10)].childRecords.splice(h,0,this.batchDeletedRecords[parseInt(d.toString(),10)])}this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=i.i(a.i)(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=i.i(a.i)(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},e.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var t=void 0,n=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),s=this.parent.grid.dataSource instanceof o.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,l=this.parent.grid.getCurrentViewRecords(),p=this.parent.grid.getPrimaryKeyFieldNames()[0],c=n.addedRecords,h=void 0,u=void 0,g=void 0;if(c.length>1&&"Bottom"!==this.parent.editSettings.newRowPosition&&c.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(s.splice(s.length-c.length,c.length),this.parent.editModule.isAddedRowByMethod&&c.length&&!i.i(r.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){c.reverse();for(var f=0;f<c.length;f++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(f.toString(),10)].getAttribute("data-rowindex"),10);s.splice(y,0,c[parseInt(f.toString(),10)])}}if(this.parent.allowPaging||s.length===l.length){var m=i.i(a.i)(s);if(m.length){var v=m.map(function(e){return e[""+p]}).indexOf(l[0][""+p]),S=v+this.parent.grid.pageSettings.pageSize;l=m.splice(v,S)}}else l.length>c.length&&l.splice(l.length-c.length,c.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&c.reverse(),t=0;t<c.length;t++){var I=i.i(r.extend)({},c[parseInt(t.toString(),10)]);if(delete I.parentItem,delete I.uniqueID,delete I.index,delete I.level,delete I.hasChildRecords,delete I.childRecords,delete I.parentUniqueID,i.i(r.isNullOrUndefined)(I.primaryParent)||delete I.primaryParent,c.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(c[parseInt(t.toString(),10)].taskData=I,g=this.batchAddRowRecord[parseInt(t.toString(),10)],i.i(r.isNullOrUndefined)(g)&&(g=this.batchAddRowRecord[t-1]),this.isSelfReference&&(i.i(r.isNullOrUndefined)(c[parseInt(t.toString(),10)].parentItem)||i.i(d.b)(p,c[parseInt(t.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,c[parseInt(t.toString(),10)])),i.i(r.isNullOrUndefined)(g)||(u=g.index),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&i.i(r.isNullOrUndefined)(c[parseInt(t.toString(),10)].parentItem)&&-1===this.selectedIndex&&(h=-1,g=null),i.i(d.a)({value:c[parseInt(t.toString(),10)],action:"add"},this.parent,this.isSelfReference,u,h,void 0,g),h=null,"Child"===this.parent.editSettings.newRowPosition&&!i.i(r.isNullOrUndefined)(c[parseInt(t.toString(),10)].parentItem)&&(i.i(r.isNullOrUndefined)(this.parent.editModule.addRowIndex)||this.isSelfReference))for(var R=l.map(function(e){return e[""+p]}).indexOf(c[parseInt(t.toString(),10)].parentItem[""+p]),x=l[parseInt(R.toString(),10)].childRecords,C=0;C<x.length;C++)x[parseInt(C.toString(),10)][""+p]===c[parseInt(t.toString(),10)][""+p]&&l[parseInt(R.toString(),10)].childRecords.splice(C,1)}if(n.deletedRecords.length)for(t=0;t<n.deletedRecords.length;t++)i.i(d.a)({value:n.deletedRecords[parseInt(t.toString(),10)],action:"delete"},this.parent,this.isSelfReference,u,h,void 0,g);this.parent.parentData=[];for(var b=0;b<s.length;b++)s[parseInt(b.toString(),10)].index=b,i.i(r.setValue)("uniqueIDCollection."+s[parseInt(b.toString(),10)].uniqueID+".index",b,this.parent),s[parseInt(b.toString(),10)].level||this.parent.parentData.push(s[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 t=this.parent.grid.getDataRows();if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&this.selectedIndex>-1){if(!i.i(r.isNullOrUndefined)(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded)if(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length){if(e+=i.i(a.g)(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition){var n=this.getBatchChildCount();e+=n}}else e+=i.i(a.g)(this.batchRecords[this.addRowIndex]).length;e>=t.length&&(e=t.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0}return 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){this.parent.getSelectedRows().length?e.index=this.parent.getSelectedRows()[0].rowIndex:e.index=this.batchIndex},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){r.Grid.Inject(r.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}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){r.Grid.Inject(r.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}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=(i.n(r),function(){function e(e){r.Grid.Inject(r.CommandColumn),this.parent=e}return e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),function(){function e(e){r.Grid.Inject(r.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 t=i.i(n.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),r=i.i(n.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),o=i.i(n.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),a=i.i(n.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element);t&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?t.style.display="none":t.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||i.i(n.isNullOrUndefined)(r)||r.classList.contains("e-menu-hide")||(r.style.display="none");var s=this.parent,d=s.getSelectedRows()[0];if(!o&&!a||i.i(n.isNullOrUndefined)(d)){if((o||a||s.grid.isEdit)&&i.i(n.isNullOrUndefined)(d)){for(var l=0,p=e.items;l<p.length;l++){var c=p[l];"Outdent"!==c.text&&"Indent"!==c.text||s.grid.contextMenuModule.hiddenItems.push(c.text)}s.grid.contextMenuModule.contextMenu.hideItems(s.grid.contextMenuModule.hiddenItems),o.style.display=a.style.display="none"}}else{var h=e.event.target.closest("td");if(!i.i(n.isNullOrUndefined)(h)&&(i.i(n.isNullOrUndefined)(h)||h.classList.contains("e-rowcell")&&0===h.querySelectorAll(".e-gridform").length)){if(0===d.rowIndex||s.getSelectedRowIndexes().length>1)o.style.display=a.style.display="none";else if("rowDeselected"!==e.name||!i.i(n.isNullOrUndefined)(d)&&s.grid.isCheckBoxSelection){var u=s.getCurrentViewRecords()[d.rowIndex];i.i(n.isNullOrUndefined)(u)||(u.level>s.getCurrentViewRecords()[d.rowIndex-1].level?o.style.display="none":o.style.display="block",u.level===s.getCurrentViewRecords()[d.rowIndex-1].level&&(o.style.display="block"),0===u.level?a.style.display="none":a.style.display="block")}}else{for(var g=0,f=e.items;g<f.length;g++){var c=f[g];"Outdent"!==c.text&&"Indent"!==c.text||s.grid.contextMenuModule.hiddenItems.push(c.text)}s.grid.contextMenuModule.contextMenu.hideItems(s.grid.contextMenuModule.hiddenItems),o.style.display=a.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")&&!i.i(n.isNullOrUndefined)(this.parent.rowDragAndDropModule)){var t=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent";this.parent.rowDragAndDropModule.indentOutdentAction(null,t)}},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),i(2)),a=function(){function e(e){r.Grid.Inject(r.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")}),t=0;t<e.length;t++){var a=e[parseInt(t.toString(),10)].getElementsByClassName("e-detailrowcollapse"),s=this.parent.grid.getRowObjectFromUID(e[parseInt(t.toString(),10)].getAttribute("data-Uid")),d=i.i(r.getObject)("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(t.toString(),10)]);(i.i(n.isNullOrUndefined)(d)||!i.i(n.isNullOrUndefined)(d)&&i.i(o.f)(this.parent,s.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(a[0])}},e.prototype.childRowExpand=function(e){var t=e.row.getElementsByClassName("e-detailrowcollapse");i.i(n.isNullOrUndefined)(t[0])||this.parent.grid.detailRowModule.expand(t[0])},e.prototype.rowExpandCollapse=function(e){if(!i.i(o.a)(this.parent))for(var t=0;t<e.detailrows.length;t++)e.detailrows[parseInt(t.toString(),10)].style.display=e.action},e.prototype.detaildataBound=function(e){var t=e.data,r=e.detailElement.parentElement.previousSibling,o=i.i(n.isNullOrUndefined)(t.parentItem)?t.index:t.parentItem.index,a="e-gridrowindex"+o+"level"+t.level,s=r.querySelector("."+a).classList,d=[].slice.call(s).filter(function(e){return e===a}),l=d[0].length,p=d.toString().slice(6,l),c="e-griddetail"+p;i.i(n.addClass)([e.detailElement.parentElement],c)},e.prototype.actioncomplete=function(e){if("beginEdit"===e.requestType||"add"===e.requestType){var t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),n=parseInt(t,10)-1,o=n.toString();e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",o)}for(var a=this.parent.grid.contentModule.getRows(),s=0;s<a.length;s++)a[parseInt(s.toString(),10)].cells[0].visible=!1;i.i(r.getObject)("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},e.prototype.destroy=function(){this.removeEventListener()},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return p});var r=i(0),n=(i.n(r),i(3)),o=i(1),a=(i.n(o),i(4)),s=(i.n(a),i(2)),d=i(5),l=i(28),p=function(){function e(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,r.Grid.Inject(r.Edit),this.parent=e,this.isSelfReference=!i.i(o.isNullOrUndefined)(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new l.a(this.parent),this.addEventListener()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.addEventListener=function(){this.parent.on(n.k,this.crudAction,this),this.parent.on(n.l,this.beginEdit,this),this.parent.on(n.m,this.beginAdd,this),this.parent.on(n.n,this.recordDoubleClick,this),this.parent.on(n.o,this.cellSave,this),this.parent.on(n.p,this.batchCancel,this),this.parent.grid.on(n.q,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(n.r,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(n.s,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(n.t,this.beforeStartEdit,this),this.parent.grid.on(n.u,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 t=i.i(r.parentsUntil)(e.target,"e-row"),n=t&&parseInt(t.getAttribute("data-rowindex"),10);!i.i(o.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(n.v,e)},e.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(n.h,e))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(n.k,this.crudAction),this.parent.off(n.l,this.beginEdit),this.parent.off(n.m,this.beginAdd),this.parent.off(n.n,this.recordDoubleClick),this.parent.off(n.p,this.batchCancel),this.parent.grid.off(n.q,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(n.r,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(n.s,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(n.t,this.beforeStartEdit),this.parent.grid.off(n.u,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 t=i.i(r.getObject)("editAction",e),n=i.i(r.getObject)("name",t),d=this.parent,l=d.dataSource.adaptor;if((i.i(s.a)(d)||l instanceof a.RemoteSaveAdaptor)&&"save"===t.requestType&&"add"===t.action&&("Child"===d.editSettings.newRowPosition||"Below"===d.editSettings.newRowPosition||"Above"===d.editSettings.newRowPosition))if("actionBegin"===n){var p=i.i(o.isNullOrUndefined)(t.row)||!Object.keys(t.row).length?this.selectedIndex:t.row.rowIndex-1,c=i.i(o.isNullOrUndefined)(p)||-1===p?-1:d.getCurrentViewRecords()[parseInt(p.toString(),10)][d.getPrimaryKeyFieldNames()[0]];d.grid.query.addParams("relationalKey",c)}else if("actionComplete"===n)for(var h=d.grid.query.params.length,u=0;u<h;u++)"relationalKey"===d.grid.query.params[parseInt(u.toString(),10)].key&&d.grid.query.params.splice(u);this.parent.enableInfiniteScrolling&&"actionComplete"===n&&this.infiniteAddAction(t),"Batch"===this.parent.editSettings.mode&&"paging"===t.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(),n=t.splice(0,1)[0],o=this.addRowIndex,a=this.parent.getCurrentViewRecords();"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(o+=i.i(s.g)(a[o+1]).length),o="Below"===this.parent.editSettings.newRowPosition?o+1:o,t.splice(o,0,n);var d=a.splice(0,1)[0];a.splice(o,0,d),this.updateInfiniteCurrentViewData(d,this.addRowIndex)}var l=this.parent.grid.getRows(),p=this.parent.grid.getRowsObject(),c=this.parent.infiniteScrollSettings.enableCache;c||(i.i(r.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())),!c&&this.parent.getFrozenColumns()>0&&(i.i(r.resetRowIndex)(this.parent.grid,p,l,0),this.updateIndex(this.parent.grid.dataSource,l,this.parent.getCurrentViewRecords()))}},e.prototype.updateInfiniteCurrentViewData=function(e,t){var r=this,n=Math.ceil(t/this.parent.grid.pageSettings.pageSize),a=n>0?n:1,d=t-(a-1)*this.parent.pageSettings.pageSize,l=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData;l[1].splice(0,1);var p=l[parseInt(a.toString(),10)];i.i(o.isNullOrUndefined)(this.addRowRecord)||(p.filter(function(e,t){e.uniqueID===r.addRowRecord.uniqueID&&(d=t)}),(this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(d+=i.i(s.g)(this.addRowRecord).length)),d>=this.parent.pageSettings.pageSize&&(a+=1,p=l[parseInt(a.toString(),10)],d=d-this.parent.pageSettings.pageSize>=0?d-this.parent.pageSettings.pageSize:0),d="Below"===this.parent.editSettings.newRowPosition?d+1:d,p.splice(d,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},e.prototype.recordDoubleClick=function(e){var t=e.target;if(!i.i(o.isNullOrUndefined)(t.closest("td.e-rowcell"))&&this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit){var n=this.parent.grid.getColumnByIndex(+t.closest("td.e-rowcell").getAttribute("data-colindex"));if("Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&n&&!n.isPrimaryKey&&this.parent.editSettings.allowEditing&&n.allowEditing&&!t.classList.contains("e-treegridexpand")&&!t.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick){if(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization){var a=i.i(r.parentsUntil)(e.target,"e-row");this.prevAriaRowIndex=a.getAttribute("data-rowindex"),a.setAttribute("data-rowindex",a.rowIndex+"")}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.i(r.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&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.parent.closeEdit()},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.cellEdit=function(e){var t=this,r=e.promise;if(delete e.promise,this.parent.enableVirtualization&&!i.i(o.isNullOrUndefined)(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("data-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(n.r,e,function(e){e.cancel||"Cell"!==t.parent.editSettings.mode?e.cancel&&"Cell"===t.parent.editSettings.mode&&(t.isOnBatch=!1,t.updateGridEditMode("Normal")):t.enableToolbarItems("edit"),i.i(o.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,i.i(o.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(!i.i(o.isNullOrUndefined)(this.parent.grid.toolbarModule)){var t=this.parent.element.id+"_gridcontrol_";this.parent.grid.toolbarModule.enableItems([t+"add",t+"edit",t+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([t+"update",t+"cancel"],"edit"===e)}},e.prototype.batchCancel=function(){if("Cell"===this.parent.editSettings.mode){var e=i.i(o.getValue)("editModule.cellDetails",this.parent.grid.editModule),t=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex);this.parent.renderModule.cellRender({data:e.rowData,cell:t,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){i.i(s.b)(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row,e.rowIndex))},e.prototype.cellSave=function(e){var t=this;if("Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")){e.cancel=!0;i.i(o.setValue)("isEditCollapse",!0,this.parent),e.rowData[e.columnName]=e.value;var r;r=i.i(o.isNullOrUndefined)(e.cell)?this.parent.grid.editModule.editModule.form.parentElement.parentNode:e.cell.parentNode;var d,l=this.parent.getPrimaryKeyFieldNames();if(i.i(o.isNullOrUndefined)(r))this.parent.grid.getCurrentViewRecords().filter(function(t,i){if(t[l[0]]===e.rowData[l[0]])return void(d=i)});else{var p=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;d=p?(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 c={};if(i.i(o.extend)(c,e),c.cancel=!1,c.type="save",r=this.parent.grid.getRows()[r.rowIndex],this.parent.trigger(n.v,c),c.cancel)this.parent.grid.isEdit=!0;else if(r.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),i.i(s.a)(this.parent)||this.parent.dataSource instanceof a.DataManager&&this.parent.dataSource.adaptor instanceof a.RemoteSaveAdaptor){if(i.i(s.a)(this.parent)||this.parent.dataSource instanceof a.DataManager&&this.parent.dataSource.adaptor instanceof a.RemoteSaveAdaptor){var h=this.parent.grid.query;if(this.parent.isGantt&&!this.parent.loadChildOnDemand)this.updateCell(e,d),i.i(o.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r,d);else{var u=null;u=this.parent.grid.dataSource.update(l[0],e.rowData,h.fromTable,h,e.previousValue),u.then(function(n){i.i(o.isNullOrUndefined)(n)||(e.rowData[e.columnName]=n[e.columnName]),t.updateCell(e,d),i.i(o.setValue)("isEdit",!1,t.parent.grid),t.afterCellSave(e,r,d)})}}}else if(i.i(s.b)(this.parent)){var g={requestType:"save",data:e.rowData,action:"edit",row:r,rowIndex:d,rowData:e.rowData,columnName:e.columnName,filterChoiceCount:null,excelSearchOperator:null};this.parent.grid.getDataModule().eventPromise(g,this.parent.grid.query)}else this.updateCell(e,d),i.i(o.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r,d)}this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},e.prototype.afterCellSave=function(e,t,r){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"),i.i(o.removeClass)([t],["e-editedrow","e-batchrow"]),i.i(o.removeClass)(t.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),i.i(d.a)({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),t.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);var a={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:t,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger(n.h,a)},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,t){i.i(d.a)(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,t,this.addRowRecord),this.parent.parentData=[];for(var r=this.parent.grid.dataSource instanceof a.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=0;n<r.length;n++){r[parseInt(n.toString(),10)].index=n;var l=this.parent.grid.getPrimaryKeyFieldNames()[0];e.value[""+l]===r[parseInt(n.toString(),10)][""+l]&&"add"===e.action&&(r[parseInt(n.toString(),10)].level=this.internalProperties.level,r[parseInt(n.toString(),10)].taskData=this.internalProperties.taskData,r[parseInt(n.toString(),10)].uniqueID=this.internalProperties.uniqueID,i.i(o.isNullOrUndefined)(this.internalProperties.parentItem)||(r[parseInt(n.toString(),10)].parentItem=this.internalProperties.parentItem,r[parseInt(n.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),r[parseInt(n.toString(),10)].childRecords=this.internalProperties.childRecords),i.i(o.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID+".index",n,this.parent);var p=this.parent.dataSource.adaptor;(i.i(s.a)(this.parent)||p instanceof a.RemoteSaveAdaptor)&&i.i(o.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent),r[parseInt(n.toString(),10)].level||this.parent.parentData.push(r[parseInt(n.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,t,r){for(var n=0;n<this.parent.getDataRows().length;n++){var a=r[parseInt(n.toString(),10)];if(!i.i(o.isNullOrUndefined)(a)){var s=i.i(o.getValue)("uniqueIDCollection."+a.uniqueID+".index",this.parent);if(a.index=s,!i.i(o.isNullOrUndefined)(a.parentItem)){var d=i.i(o.getValue)("uniqueIDCollection."+a.parentItem.uniqueID+".index",this.parent);a.parentItem.index=d}}}var l=-1,p=this.parent.treeColumnIndex;if(this.parent.getFrozenColumns()>0)for(var c=t[0].querySelectorAll(".e-rowcell"),h=0;h<c.length;h++)if(c[parseInt(h.toString(),10)].classList.contains("e-gridrowindex0level0")){p=h;break}for(var u=0;u<this.parent.getRows().length;u++){t[parseInt(u.toString(),10)].classList.contains("e-detailrow")||l++;var g=r[parseInt(l.toString(),10)];if(!i.i(o.isNullOrUndefined)(g)){var s=g.index,f=g.level,y=t[parseInt(u.toString(),10)];i.i(o.isNullOrUndefined)(g.parentItem)||(s=i.i(o.getValue)("uniqueIDCollection."+g.parentItem.uniqueID+".index",this.parent));var m=y.cells[parseInt(p.toString(),10)];if(!i.i(o.isNullOrUndefined)(m)){for(var h=0;h<m.classList.length;h++){var v=m.classList[parseInt(h.toString(),10)],S=/e-gridrowindex/i,I=/e-griddetailrowindex/i,w=v.match(S),R=v.match(I);null!=w&&i.i(o.removeClass)([m],v),null!=R&&i.i(o.removeClass)([m],v)}t[parseInt(u.toString(),10)].classList.contains("e-detailrow")?i.i(o.addClass)([m],"e-griddetailrowindex"+s+"level"+f):i.i(o.addClass)([m],"e-gridrowindex"+s+"level"+f)}}}},e.prototype.beginAdd=function(){var e,t=this.addRowIndex,r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(t=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(),a=n.length?+n[0].getAttribute("data-rowindex"):0,d=n.length?+n[n.length-1].getAttribute("data-rowindex"):0,l=this.selectedIndex>=a&&this.selectedIndex<=d,p=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode){if("Above"===this.parent.editSettings.newRowPosition)e="before";else if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(this.selectedIndex>-1||p)&&l&&(e="after",!i.i(o.isNullOrUndefined)(r[parseInt(t.toString(),10)])&&r[parseInt(t.toString(),10)].expanded))if("Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)){if(t+=i.i(s.g)(r[parseInt(t.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition){var c=this.batchEditModule.getBatchChildCount();t+=c}}else this.parent.enableVirtualization||(t+=i.i(s.g)(r[parseInt(t.toString(),10)]).length);if((this.selectedIndex>-1||p)&&l&&(t||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)){t>=n.length-1&&(t=n.length-2);var h="rows",u=this.parent.grid.contentModule[""+h][0],g=document.activeElement;n[t+1][""+e](n[0]),i.i(o.setValue)("batchIndex",t+1,this.batchEditModule);var f="Above"===this.parent.editSettings.newRowPosition?t:t+1;if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[""+h].splice(0,1),this.parent.grid.contentModule[""+h].splice(f,0,u)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var y=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),m=0;m<y.length;m++)y[parseInt(m.toString(),10)].remove();i.i(o.setValue)("errorRules",[],this.parent.grid.editModule.formObj)}p&&(this.prevAriaRowIndex="-1"),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length)&&g.focus(),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}}if("Batch"===this.parent.editSettings.mode&&!i.i(o.isNullOrUndefined)(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){t=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var v=this.parent.getBatchChanges().addedRecords,S=void 0;if(v.length)for(var m=0;m<v.length;m++)i.i(o.isNullOrUndefined)(v[parseInt(m.toString(),10)].uniqueID)&&(S=v[parseInt(m.toString(),10)]);var I={action:"add",data:S,index:t,seletedRow:0};this.beginAddEdit(I),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(I.data)}},e.prototype.beginEdit=function(e){if("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&&(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 t=e.data;if(i.i(o.isNullOrUndefined)(e.data[0].uniqueID))for(var r=this.parent.getPrimaryKeyFieldNames(),n=this,a=0;a<t.length;a++)!function(i){n.parent.flatData.filter(function(n){n[""+r[0]]===e.data[parseInt(i.toString(),10)][r[0]]&&(t[parseInt(i.toString(),10)]=n)})}(a);for(var a=0;a<t.length;a++){this.deleteUniqueID(t[parseInt(a.toString(),10)].uniqueID);for(var d=i.i(s.g)(t[parseInt(a.toString(),10)]),l=0;l<d.length;l++)this.deleteUniqueID(d[parseInt(l.toString(),10)].uniqueID);e.data=e.data.concat(d)}}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 p='.e-row[data-rowindex="'+this.selectedIndex+'"]',c=void 0;this.selectedIndex>-1&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),c=this.parent.getContent().querySelector(p),this.addRowIndex=c?c.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(p='.e-row[data-rowindex="'+this.prevAriaRowIndex+'"]',c=this.parent.getContent().querySelector(p),this.addRowIndex=c?c.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;(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])):this.addRowRecord=this.parent.getSelectedRecords()[0]}this.isAddedRowByMethod&&0!==e.index&&(this.addRowRecord=this.parent.flatData[e.index],this.addRowIndex=e.index),"Child"!==this.parent.editSettings.newRowPosition||i.i(o.isNullOrUndefined)(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0]),i.i(o.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 t=e.data;if("add"===e.action){var n=this.parent.grid.getPrimaryKeyFieldNames()[0],l=null;t.taskData=i.i(o.isNullOrUndefined)(t.taskData)?i.i(o.extend)({},e.data):t.taskData;var p=void 0;p=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!i.i(o.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 c=this.addRowIndex;t.uniqueID=i.i(r.getUid)(this.parent.element.id+"_data_"),i.i(o.setValue)("uniqueIDCollection."+t.uniqueID,t,this.parent);var h=0,u=void 0,g=void 0,f=void 0,y=void 0,m=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex,v=this.parent.getRows(),S=v.length?p.indexOf(p[0]):0,I=v.length?+v[v.length-1].getAttribute("data-rowindex"):0,w=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=S&&this.selectedIndex<=I;if(p.length&&(u=p[this.addRowIndex][this.parent.idMapping],y=p[this.addRowIndex][this.parent.parentIdMapping],p[this.addRowIndex].parentItem&&(g=p[this.addRowIndex].parentItem.uniqueID),f=p[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&p.length){if(h=p[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition)l="before",c=p[this.addRowIndex].index;else if("Below"===this.parent.editSettings.newRowPosition){l="after";var R=i.i(s.g)(p[this.addRowIndex]).length,x=p[this.addRowIndex].index;c=R>0?x+R:x}else if("Child"===this.parent.editSettings.newRowPosition){l="after",(this.selectedIndex>-1||m)&&w&&(t.parentItem=i.i(o.extend)({},p[this.addRowIndex]),t.parentUniqueID=t.parentItem.uniqueID,delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping]);var C=i.i(s.g)(p[this.addRowIndex]).length,b=p[this.addRowIndex].index;this.selectedIndex>=0&&(t.level=h+1),c=C>0?b+C:b,this.isSelfReference&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?t.taskData[this.parent.parentIdMapping]=t[this.parent.parentIdMapping]=u:t.taskData[this.parent.parentIdMapping]=t[this.parent.parentIdMapping]=null,i.i(o.isNullOrUndefined)(t.parentItem)||i.i(d.b)(n,t.parentItem,"add",this.parent,this.isSelfReference,t))}if("Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((this.selectedIndex>-1||m)&&h&&w&&(t.parentUniqueID=g,t.parentItem=i.i(o.extend)({},f),delete t.parentItem.childRecords,delete t.parentItem[this.parent.childMapping]),t.level=h,this.isSelfReference&&(t.taskData[this.parent.parentIdMapping]=t[this.parent.parentIdMapping]=y,i.i(o.isNullOrUndefined)(t.parentItem)||i.i(d.b)(n,t.parentItem,"add",this.parent,this.isSelfReference,t))),null!=l&&(this.selectedIndex>-1||m)&&w&&(e.index="before"===l?c:c+1),"Bottom"===this.parent.editSettings.newRowPosition){h=0;var D=this.parent.grid.dataSource instanceof a.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;e.index=D.length}}i.i(o.isNullOrUndefined)(t.level)&&(t.level=h),t.hasChildRecords=!1,t.childRecords=[],t.index=0}if("add"===e.action&&(this.internalProperties={level:t.level,parentItem:t.parentItem,uniqueID:t.uniqueID,taskData:t.taskData,parentUniqueID:i.i(o.isNullOrUndefined)(t.parentItem)?void 0:t.parentItem.uniqueID,childRecords:t.childRecords}),"delete"===e.requestType)for(var M=e.data,O=0;O<M.length;O++)if(M[parseInt(O.toString(),10)].parentItem){var f=i.i(s.k)(this.parent,M[parseInt(O.toString(),10)].parentItem.uniqueID);if(!i.i(o.isNullOrUndefined)(f)&&f.hasChildRecords){var P=f.childRecords.indexOf(M[parseInt(O.toString(),10)]);f.childRecords.splice(P,1)}}return e},e.prototype.addRecord=function(e,t,r){if(this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),this.isSelfReference||i.i(o.isNullOrUndefined)(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping))e?(t>-1?(this.selectedIndex=t,this.addRowIndex=t):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),r&&this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.parent.grid.editModule.addRecord(e,t)):this.parent.grid.editModule.addRecord(e,t);else{var a=[],s=this.parent.editSettings.mode,d=this.parent.grid.editSettings.mode;a.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),i.i(o.isNullOrUndefined)(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0);var l={addedRecords:a,changedRecords:[],deletedRecords:[]};this.parent.notify(n.w,{updatedRecords:l,index:t}),this.parent.setProperties({editSettings:{mode:s}},!0),this.parent.grid.setProperties({editSettings:{mode:d}},!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){i.i(o.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}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(2)),o=i(1),a=(i.n(o),i(4)),s=(i.n(a),i(3)),d=function(){function e(e){this.isCollapsedStatePersist=!1,r.Grid.Inject(r.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.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.grid.off("finalPageSetup",this.finalPageSetup))},e.prototype.updateExcelResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,t,n,d,l){var p=this,c=this.parent.dataSource,h=Object();return i.i(o.setValue)("isCsv",l,h),i.i(o.setValue)("cancel",!1,h),i.i(o.isNullOrUndefined)(e)||(this.isCollapsedStatePersist=e.isCollapsedStatePersist),i.i(o.isNullOrUndefined)(e)||i.i(o.isNullOrUndefined)(e.dataSource)||i.i(o.isNullOrUndefined)(e.dataSource instanceof a.DataManager)?new Promise(function(u){var g=!p.isLocal()||c instanceof a.DataManager?p.parent.dataSource:new a.DataManager(c),f=new a.Query;if(p.isLocal()||(f=p.generateQuery(f),f.queries=p.parent.grid.getDataModule().generateQuery().queries,i.i(o.setValue)("query",f,h)),p.parent.trigger(s.H,i.i(o.extend)(h,e)),i.i(r.getObject)("cancel",h))return null;g.executeQuery(f).then(function(r){var a=null;return i.i(o.isNullOrUndefined)(e)||i.i(o.isNullOrUndefined)(e.dataSource)||(a=e.dataSource),e=p.manipulateExportProperties(e,c,r),p.parent.grid.excelExportModule.Map(p.parent.grid,e,t,n,l,d).then(function(t){null!=a?e.dataSource=a:delete e.dataSource,u(t)})})}):this.parent.grid.excelExportModule.Map(this.parent.grid,e,t,n,l,d)},e.prototype.generateQuery=function(e,t){return!i.i(o.isNullOrUndefined)(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=i.i(r.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulateExportProperties=function(e,t,n){var s=Object();if(i.i(o.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),s),i.i(o.setValue)("isExport",!0,s),i.i(o.isNullOrUndefined)(e)||i.i(o.isNullOrUndefined)(e.exportType)||i.i(o.setValue)("exportType",e.exportType,s),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(i.i(r.getObject)("result",n)),i.i(o.setValue)("expresults",this.parent.flatData,s)),this.parent.notify("dataProcessor",s),s=this.dataResults,t=i.i(o.isNullOrUndefined)(s.result)?this.parent.flatData.slice(0):s.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource){var d=this.parent.flatData,l=e.dataSource instanceof a.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(l),t=this.parent.flatData,this.parent.flatData=d}return e=i.i(o.isNullOrUndefined)(e)?Object():e,e.dataSource=new a.DataManager({json:t}),this.parent.aggregates.length>0&&(e.query=s.query),e},e.prototype.excelQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var t={},r=e.data,n=i.i(o.isNullOrUndefined)(r.filterLevel),a=n?r.level:r.filterLevel;t.indent=a,e.style=t}this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},e.prototype.exportRowDataBound=function(e){if("excel"===e.type){var t=e.rowObj.data,r=this.parent.grid.filterSettings.columns.length,a=e.excelRows.length,s=t.level;if(t.parentItem&&i.i(n.k)(this.parent,t.parentItem.uniqueID,Boolean(r))){var d=!1,l=!1,p=i.i(n.f)(this.parent,t,this.parent.parentData);!this.isCollapsedStatePersist||p&&this.parent.isLocalData||(d=!0,l=!t.expanded),e.excelRows[a-1].grouping={outlineLevel:s,isCollapsed:l,isHidden:d}}else t.hasChildRecords&&i.i(o.isNullOrUndefined)(t.parentItem)&&(e.excelRows[a-1].grouping={outlineLevel:s})}},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!i.i(n.a)(this.parent)&&i.i(n.h)(this.parent)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),i(2)),a=function(){function e(e){r.Grid.Inject(r.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){i.i(n.setValue)("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var t=0;t<this.flatFilteredData.length;t++){var a=this.flatFilteredData[parseInt(t.toString(),10)];this.addParentRecord(a);var s=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;"Child"!==s&&"None"!==s||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0);var d=i.i(r.getObject)("childRecords",a);!i.i(n.isNullOrUndefined)(d)&&d.length&&i.i(n.setValue)("hasFilteredChildRecords",this.checkChildExsist(a),a);var l=i.i(r.getObject)("parentItem",a);if(!i.i(n.isNullOrUndefined)(l)){var p=i.i(o.k)(this.parent,a.parentItem.uniqueID,!0);i.i(n.setValue)("hasFilteredChildRecords",!0,p),p&&p.parentItem&&this.updateParentFilteredRecord(p)}}this.flatFilteredData.length>0&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},e.prototype.updateParentFilteredRecord=function(e){var t=i.i(o.k)(this.parent,e.parentItem.uniqueID,!0),r=i.i(n.getValue)("uniqueIDFilterCollection",this.parent);t&&Object.prototype.hasOwnProperty.call(r,t.uniqueID)&&i.i(n.setValue)("hasFilteredChildRecords",!0,t),t&&t.parentItem&&this.updateParentFilteredRecord(t)},e.prototype.addParentRecord=function(e){var t=i.i(o.k)(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)i.i(n.isNullOrUndefined)(t)||("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(t):-1!==this.flatFilteredData.indexOf(t)&&this.addParentRecord(t)),-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),i.i(n.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent));else if(i.i(n.isNullOrUndefined)(t)){if(-1!==this.flatFilteredData.indexOf(e))return void(-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),i.i(n.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0))}else this.addParentRecord(t),-1!==this.flatFilteredData.indexOf(t)||-1!==this.filteredResult.indexOf(t)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),i.i(n.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),i.i(n.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))},e.prototype.checkChildExsist=function(e){for(var t=i.i(r.getObject)("childRecords",e),o=!1,a=0;a<t.length;a++){var s=t[parseInt(a.toString(),10)].childRecords,d=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;if(!("Child"!==d&&"Both"!==d||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)){var l=i.i(n.getValue)("uniqueIDFilterCollection",this.parent);Object.prototype.hasOwnProperty.call(l,t[parseInt(a.toString(),10)].uniqueID)||(this.filteredResult.push(t[parseInt(a.toString(),10)]),i.i(n.setValue)("uniqueIDFilterCollection."+t[parseInt(a.toString(),10)].uniqueID,t[parseInt(a.toString(),10)],this.parent),o=!0)}if("None"===d&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(t[parseInt(a.toString(),10)])){o=!0;break}!i.i(n.isNullOrUndefined)(s)&&s.length&&(o=this.checkChildExsist(t[parseInt(a.toString(),10)])),"Child"!==d&&"Both"!==d||!t.length||(o=!0)}return o},e.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,r=0;r<t;r++){var n=i.i(o.k)(this.parent,e[parseInt(r.toString(),10)].parentUniqueID);if(-1!==e.indexOf(n)){var a=i.i(o.k)(this.parent,e[parseInt(r.toString(),10)].parentUniqueID,!0);e[parseInt(r.toString(),10)].filterLevel=a.filterLevel+1}else e[parseInt(r.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(r.toString(),10)])}},e.prototype.clearFilterLevel=function(e){var t,r=0,o=e.flatData,a=o.length;for(r;r<a;r++){t=o[parseInt(r.toString(),10)];var s=t.filterLevel;!s&&0!==s&&i.i(n.isNullOrUndefined)(t.hasFilteredChildRecords)||(t.hasFilteredChildRecords=null,t.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:o,count:o.length})},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),function(){function e(e){r.Grid.Inject(r.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 t,r,o=this.parent.getDataRows(),a=this.parent.getRows(),s=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;s&&(r=this.parent.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))})),t=e.detailrows.length?e.detailrows:o.filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))});for(var d=0;d<t.length;d++){var l=t[parseInt(d.toString(),10)],p=this.parent.grid.getRowObjectFromUID(l.getAttribute("data-Uid")).data;!i.i(n.isNullOrUndefined)(o)&&l.parentElement.firstElementChild.clientHeight>0&&(l.style.height=l.parentElement.firstElementChild.clientHeight+"px"),l.style.display=e.action,s&&r.length&&(r[parseInt(d.toString(),10)].style.display=e.action);var c="none"===e.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand";if(a[l.rowIndex].querySelector(c)){for(var h=[],u=0;u<o.length;u++)o[parseInt(u.toString(),10)].querySelector(".e-gridrowindex"+p.index+"level"+(p.level+1))&&h.push(o[parseInt(u.toString(),10)]);if(h.length){var g=this.parent.getCurrentViewRecords()[h[0].rowIndex];this.rowExpandCollapse({detailrows:h,action:e.action,record:g})}}}},e.prototype.dblClickHandler=function(e){i.i(r.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.i(r.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&&i.i(n.addClass)([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getModuleName=function(){return"freeze"},e}())},function(e,t,i){"use strict";var r=i(36);i.d(t,"a",function(){return r.a});var n=i(35);i.d(t,"b",function(){return n.a});var o=i(41);i.d(t,"c",function(){return o.a});var a=i(40);i.d(t,"d",function(){return a.a});var s=i(46);i.d(t,"e",function(){return s.a});var d=i(45);i.d(t,"f",function(){return d.a});var l=i(44);i.d(t,"g",function(){return l.a});var p=(i(8),i(9),i(6));i.d(t,"h",function(){return p.a});var c=i(30);i.d(t,"i",function(){return c.a});var h=i(32);i.d(t,"j",function(){return h.a});var u=i(34);i.d(t,"k",function(){return u.a});var g=i(31);i.d(t,"l",function(){return g.a});var f=i(10);i.d(t,"m",function(){return f.a});var y=i(33);i.d(t,"n",function(){return y.a});var m=i(47);i.d(t,"o",function(){return m.a}),i.d(t,"p",function(){return m.b});var v=i(37);i.d(t,"q",function(){return v.a});var S=i(29);i.d(t,"r",function(){return S.a});var I=i(7);i.d(t,"s",function(){return I.a}),i.d(t,"t",function(){return I.b});var w=i(39);i.d(t,"u",function(){return w.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),i(3)),a=i(4),s=(i.n(a),i(2)),d=function(){function e(e){this.parent=e,r.Grid.Inject(r.InfiniteScroll),this.addEventListener()}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(o.a,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(o.a,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(),n=this.parent.grid.infiniteScrollModule.serviceLocator,o=new r.RowRenderer(n,null,this.parent.grid),a=this.parent.getRows(),s=e.index===a.length-1?"after":"before",d=this.parent.grid.getColumns(),l=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),p=[],c=0;c<l.length;c++)p.push(o.render(l[parseInt(c.toString(),10)],d));t.splice.apply(t,[e.index+1,0].concat(l));for(var c=0;c<p.length;c++)"after"===s?a[e.index+c][""+s](p[parseInt(c.toString(),10)]):a[e.index+c+1][""+s](p[parseInt(c.toString(),10)]),a.splice(e.index+1+c,0,p[parseInt(c.toString(),10)]);i.i(r.resetRowIndex)(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},e.prototype.contentready=function(){if(this.parent.infiniteScrollSettings.enableCache&&!i.i(n.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 t=new a.DataManager(e.result),r=new a.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),o=t.executeLocal((new a.Query).where(r)),s=i.i(n.getValue)("actionArgs",e.actionArgs),d=i.i(n.getValue)("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var l=d.some(function(e){return e===s.requestType}),p=!!l||!!this.parent.initialRender;if(this.visualData=o,e.count=o.length,i.i(n.getValue)("isPrinting",e.actionArgs))e.result=o;else{var c=new a.Query,h=this.parent.infiniteScrollSettings.enableCache;h&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var u=p?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,g=this.parent.grid.pageSettings.currentPage;if(i.i(n.isNullOrUndefined)(s))c=c.page(g,u);else{var f=i.i(n.getValue)("lastIndex",this.parent.grid.infiniteScrollModule),y=i.i(n.getValue)("firstIndex",this.parent.grid.infiniteScrollModule);if(h||"delete"!==s.requestType)h&&"delete"===s.requestType||"save"===s.requestType&&"add"===s.action?(c=c.skip(y),c=c.take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize)):c=c.page(g,u);else{var m=f-s.data.length+1,v=s.data.length;c=c.skip(m).take(v)}}t.dataSource.json=o,h||i.i(n.isNullOrUndefined)(s)||"save"!==s.requestType||"add"!==s.action?e.result=t.executeLocal(c):e.result=[s.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,t,r,o,a){for(var s=this,d=0;d<r.length;d++)!function(d){t.filter(function(l,p){if(l.data[""+o]===r[parseInt(d.toString(),10)][""+o]){if(a){var c=Math.ceil((p+1)/s.parent.grid.pageSettings.pageSize);s.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(c,p)}t.splice(p,1),i.i(n.remove)(e[parseInt(p.toString(),10)]),e.splice(p,1)}})}(d)},e.prototype.createRows=function(e){var t,o=e.args.e,a=e.row,d=this.parent.grid.infiniteScrollModule.serviceLocator,l=new r.RowRenderer(d,null,this.parent.grid),p=this.parent.getCurrentViewRecords(),c=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows();t=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&&(t=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"):t);for(var h,u=this.parent.editModule.addRowIndex,g=0;g<a.length;g++){var f=l.render(a[parseInt(g.toString(),10)],this.parent.grid.getColumns());"save"===o.requestType&&"add"===o.action?-1!==i.i(n.getValue)("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(h="after",u+=i.i(s.g)(p[parseInt(u.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&(u-=1),c[parseInt(u.toString(),10)][""+h](f)):"Above"===this.parent.editSettings.newRowPosition&&(h="before",c[this.parent.editModule.addRowIndex][""+h](f)):"Bottom"===this.parent.editSettings.newRowPosition?t.appendChild(f):t.insertBefore(f,t.firstElementChild):"delete"===o.requestType&&t.appendChild(f)}e.cancel=!0},e.prototype.destroy=function(){this.removeEventListener()},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(3)),o=i(4),a=(i.n(o),i(1)),s=(i.n(a),i(2)),d=function(){function e(e){r.Grid.Inject(r.Page),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(n.b,this.collapseExpandPagedchilds,this),this.parent.on(n.a,this.pageAction,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(n.b,this.collapseExpandPagedchilds),this.parent.off(n.a,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){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 t=this.parent.getPrimaryKeyFieldNames()[0],r=this.parent.flatData.filter(function(i){return i[""+t]===e.record[""+t]});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(i.i(a.getValue)("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode){var o=void 0;"collapse"===n.action?(o=n.row.getElementsByClassName("e-treegridexpand")[0],i.i(a.isNullOrUndefined)(o)||(i.i(a.removeClass)([o],"e-treegridexpand"),i.i(a.addClass)([o],"e-treegridcollapse"))):"expand"===n.action&&(o=n.row.getElementsByClassName("e-treegridcollapse")[0],i.i(a.isNullOrUndefined)(o)||(i.i(a.removeClass)([o],"e-treegridcollapse"),i.i(a.addClass)([o],"e-treegridexpand")))}},e.prototype.pageRoot=function(e,t,r){for(var n=i.i(a.isNullOrUndefined)(r)?[]:r,o=this,s=0;s<t.length;s++)!function(i){n.push(t[parseInt(i.toString(),10)]);var r=[];t[parseInt(i.toString(),10)].hasChildRecords&&(r=e.filter(function(e){return t[parseInt(i.toString(),10)].uniqueID===e.parentUniqueID}),n=o.pageRoot(e,r,n))}(s);return n},e.prototype.updatePageSize=function(e){var t=e.result.length,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,r=new o.DataManager(e.result);if("Root"===this.parent.pageSettings.pageSizeMode){var n=[],a=this.parent.grid.filterSettings.columns.length>0&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",d=(new o.Query).where(a,"equal",0);n=r.executeLocal(d),e.count=n.length;var l=this.parent.grid.pageSettings.pageSize,p=this.parent.grid.pageSettings.currentPage,c=l*(p-1);d=d.skip(c).take(l),n=r.executeLocal(d);var h=this.pageRoot(e.result,n);e.result=h}else{var u=new o.DataManager(e.result),g=new o.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),f=u.executeLocal((new o.Query).where(g)),y=void 0;y=i.i(s.d)(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?f:f.filter(function(e){return i.i(s.f)(t.parent,e,f)}),e.count=y.length;var d=new o.Query,l=this.parent.grid.pageSettings.pageSize;this.updatePageSize(e);var p=this.parent.grid.pageSettings.currentPage;y.length<p*l&&(p=Math.floor(y.length/l)+(y.length%l?1:0),p=p||1,this.parent.grid.setProperties({pageSettings:{currentPage:p}},!0));var c=l*(p-1);d=d.skip(c).take(l),u.dataSource.json=y,e.result=u.executeLocal(d)}this.parent.notify("updateAction",e)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(0),n=(i.n(r),i(2)),o=i(1),a=(i.n(o),i(4)),s=(i.n(a),i(3)),d=function(){function e(e){r.Grid.Inject(r.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)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updatePdfResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,t,d,l){var p=this,c=this.parent.dataSource,h=Object(),u=!i.i(n.a)(this.parent)&&i.i(n.h)(this.parent);return i.i(o.setValue)("cancel",!1,h),new Promise(function(n){var g=!u||c instanceof a.DataManager?p.parent.dataSource:new a.DataManager(c),f=new a.Query;if(u||(f=p.generateQuery(f),i.i(o.setValue)("query",f,h)),p.parent.trigger(s.G,i.i(o.extend)(h,e)),i.i(r.getObject)("cancel",h))return null;g.executeQuery(f).then(function(r){var a=null;return i.i(o.isNullOrUndefined)(e)||i.i(o.isNullOrUndefined)(e.dataSource)||(a=e.dataSource),e=p.manipulatePdfProperties(e,c,r),p.parent.grid.pdfExportModule.Map(p.parent.grid,e,t,d,l).then(function(t){null!=a?e.dataSource=a:delete e.dataSource,n(t)})})})},e.prototype.generateQuery=function(e,t){return!i.i(o.isNullOrUndefined)(t)&&"CurrentPage"===t.exportType&&this.parent.allowPaging&&(t.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=i.i(r.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulatePdfProperties=function(e,t,r){var s={},d=!i.i(n.a)(this.parent)&&i.i(n.h)(this.parent);if(i.i(o.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),s),i.i(o.setValue)("isExport",!0,s),i.i(o.setValue)("isPdfExport",!0,s),i.i(o.isNullOrUndefined)(e)||i.i(o.isNullOrUndefined)(e.isCollapsedStatePersist)||i.i(o.setValue)("isCollapsedStatePersist",e.isCollapsedStatePersist,s),i.i(o.isNullOrUndefined)(e)||i.i(o.isNullOrUndefined)(e.exportType)||i.i(o.setValue)("exportType",e.exportType,s),d||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData(i.i(o.getValue)("result",r)),i.i(o.setValue)("expresults",this.parent.flatData,s)),this.parent.notify("dataProcessor",s),s=this.dataResults,t=i.i(o.isNullOrUndefined)(s.result)?this.parent.flatData.slice(0):s.result,d||(this.parent.flatData=[]),e&&e.dataSource&&d){var l=this.parent.flatData,p=e.dataSource instanceof a.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(p),t=this.parent.flatData,this.parent.flatData=l}return e=i.i(o.isNullOrUndefined)(e)?{}:e,e.dataSource=new a.DataManager({json:t}),e.query=s.query,e},e.prototype.pdfQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var t={},n=i.i(r.getObject)("data",e),a=i.i(o.isNullOrUndefined)(n.filterLevel),s=a?n.level:n.filterLevel;t.paragraphIndent=3*s,e.style=t}this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(3),n=i(0),o=(i.n(n),i(1)),a=(i.n(o),function(){function e(e){this.parent=e,n.Grid.Inject(n.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on(r.V,this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off(r.V,this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var t=i.i(n.getObject)("printgrid",e),a=i.i(n.getObject)("element",e);t.addEventListener(r.J,this.parent.grid.queryCellInfo),t.addEventListener(r.I,this.parent.grid.rowDataBound),t.addEventListener(r.M,this.parent.grid.beforeDataBound),i.i(o.addClass)([a],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return l});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),i(4)),a=(i.n(o),i(3)),s=i(5),d=i(2),l=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,r.Grid.Inject(r.RowDD),this.parent=e,this.addEventListener()}return e.prototype.getChildrecordsByParentID=function(e){var t;return t=this.parent.dataSource instanceof o.DataManager&&i.i(d.h)(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,t.filter(function(t){return t.uniqueID===e})},e.prototype.addEventListener=function(){this.parent.on(a._11,this.Rowdraging,this),this.parent.on(a._12,this.rowDropped,this),this.parent.on(a._9,this.rowsAdded,this),this.parent.on(a._10,this.rowsRemoved,this)},e.prototype.reorderRows=function(e,t,r){var o=this.parent;if(e[0]!==t&&-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 a=[],s=0;s<e.length;s++){var l=this.parent.getRowByIndex(e[parseInt(s.toString(),10)]).rowIndex;a[parseInt(s.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(l.toString(),10)]}var p={data:a,dropIndex:t};if(i.i(d.b)(this.parent)||this.dropRows(p,!0),o.isLocalData&&(o.flatData=this.orderToIndex(o.flatData)),"outdenting"===this.parent.action&&(i.i(n.isNullOrUndefined)(a[0].parentItem)||(a[0].level=a[0].parentItem.level+1)),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition){var l=void 0;this.parent.allowRowDragAndDrop?l=this.parent.treeColumnIndex+1:"indenting"===this.parent.action&&(l=this.parent.treeColumnIndex);var c=this.parent.getRows()[e[0]],h=p.data[0],u=[],g=[];u.push(h),g.push(c);var f=i.i(d.k)(this.parent,p.data[0].parentUniqueID),y=this.parent.getRows()[parseInt(t.toString(),10)];u.push(f),g.push(y),this.parent.updateRowAndCellElements(u,g,l)}if(this.parent.enableImmutableMode&&"outdenting"===this.parent.action){var l=void 0;this.parent.allowRowDragAndDrop?l=this.parent.treeColumnIndex+1:"outdenting"===this.parent.action&&(l=this.parent.treeColumnIndex);var m=p.data[0],c=this.parent.getRows()[e[0]],u=[],g=[];u.push(m),g.push(c),this.parent.updateRowAndCellElements(u,g,l)}}},e.prototype.indentOutdentAction=function(e,t){var r=this.parent,o=-1;if(!i.i(n.isNullOrUndefined)(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?o=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(o=this.parent.selectedRowIndex),this.selectedItem=i.i(n.isNullOrUndefined)(e)?r.getCurrentViewRecords()[parseInt(o.toString(),10)]:e;var a=this.parent.getPrimaryKeyFieldNames()[0],s=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+a]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==o?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(s),this.selectedRecord=this.parent[this.selectedRecords]=-1!==o?r.getCurrentViewRecords()[parseInt(o.toString(),10)]:this.selectedItem,"indent"===t){var d=r.getCurrentViewRecords()[this.selectedRow.rowIndex-1],l=void 0;if(0===this.selectedRow.rowIndex||-1===this.selectedRow.rowIndex||r.getCurrentViewRecords()[this.selectedRow.rowIndex].level-d.level==1)return;if(d.level>this.selectedRecord.level)for(var p=0;p<r.getCurrentViewRecords().length;p++)r.getCurrentViewRecords()[parseInt(p.toString(),10)].taskData===d.parentItem.taskData&&(l=p,r.enableVirtualization&&(l=parseInt(r.getRows()[parseInt(p.toString(),10)].getAttribute("data-rowindex"),10)));else l=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||d.level>this.selectedRecord.level||(l=parseInt(this.selectedRow.getAttribute("data-rowindex"),10)-1),r.action="indenting",r.dropIndex=l,this.eventTrigger("indenting",l)}else if("outdent"===t){if(-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex||0===r.getCurrentViewRecords()[this.selectedRow.rowIndex].level)return;for(var l=void 0,c=this.selectedRecord.parentItem,p=0;p<r.getCurrentViewRecords().length;p++)r.getCurrentViewRecords()[parseInt(p.toString(),10)].uniqueID===c.uniqueID&&(l=p);this.parent.enableVirtualization&&this.selectedRecord&&(l=parseInt(this.parent.getRows()[parseInt(l.toString(),10)].getAttribute("data-rowindex"),10)),r.action="outdenting",r.dropIndex=l,this.eventTrigger("outdenting",l)}}},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(a.v,r,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("data-rowindex"),10)],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("data-rowindex"),10)],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},e.prototype.orderToIndex=function(e){for(var t=0;t<e.length;t++)if(e[parseInt(t.toString(),10)].index=t,!i.i(n.isNullOrUndefined)(e[parseInt(t.toString(),10)].parentItem)){var r=i.i(n.getValue)("uniqueIDCollection."+e[parseInt(t.toString(),10)].parentUniqueID,this.parent);e[parseInt(t.toString(),10)].parentItem.index=r.index}return e},e.prototype.rowsAdded=function(e){for(var t,r=e.records,a=e.records.length-1;a>-1;a--)if(t=r[parseInt(a.toString(),10)],t.parentUniqueID){var s=r.filter(function(e){return e.uniqueID===t.parentUniqueID});if(s.length){var d=s[0].childRecords.indexOf(t),l=s[0];-1!==d&&(i.i(n.isNullOrUndefined)(this.parent.idMapping)&&(l.childRecords.splice(d,1),l.childRecords.length||(l.hasChildRecords=!1,l.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0)}}if(i.i(n.isNullOrUndefined)(this.parent.dataSource)||!this.parent.dataSource.length){for(var p,c=this.parent,h=e.records,u=e.records.length,a=u-1;a>-1;a--){p=h[parseInt(a.toString(),10)],!a&&p.hasChildRecords&&(p.taskData[this.parent.parentIdMapping]=null);if(i.i(n.isNullOrUndefined)(c.parentIdMapping)||(c.childMapping=null),i.i(n.isNullOrUndefined)(p.taskData)||i.i(n.isNullOrUndefined)(c.childMapping)||Object.prototype.hasOwnProperty.call(p.taskData,c.childMapping)||(p.taskData[c.childMapping]=[]),Object.prototype.hasOwnProperty.call(p,c.childMapping)&&p[c.childMapping].length&&!this.isDraggedWithChild&&!i.i(n.isNullOrUndefined)(c.parentIdMapping))for(var g=p[c.childMapping],f=0;f<g.length;f++)-1===h.indexOf(g[parseInt(f.toString(),10)])&&(h.splice(f,0,g[parseInt(f.toString(),10)]),g[parseInt(f.toString(),10)].taskData=i.i(n.extend)({},g[parseInt(f.toString(),10)]),a+=1);Object.prototype.hasOwnProperty.call(p,c.parentIdMapping)&&null!==p[c.parentIdMapping]&&!this.isDraggedWithChild&&(p.taskData[c.parentIdMapping]=null,delete p.parentItem,delete p.parentUniqueID),i.i(n.isNullOrUndefined)(c.dataSource)&&(c.dataSource=[]),c.dataSource.splice(0,0,p.taskData)}c.setProperties({dataSource:c.dataSource},!1)}else{for(var a=0;a<r.length;a++)i.i(n.setValue)("uniqueIDCollection."+r[parseInt(a.toString(),10)].uniqueID,r[parseInt(a.toString(),10)],this.parent);var y={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof o.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),i.i(n.isNullOrUndefined)(this.dropPosition)&&(this.dropPosition="bottomSegment",y.dropIndex=this.parent.getCurrentViewRecords().length>1?this.parent.getCurrentViewRecords().length-1:y.dropIndex,y.data=y.data.map(function(e){return e.hasChildRecords&&i.i(n.isNullOrUndefined)(e.parentItem)?(e.level=0,e):(delete e.parentItem,delete e.parentUniqueID,e.level=0,e)})),this.dropRows(y)}},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,t,r=this.draggedRecord,a=this.droppedRecord,s=this.parent;if(!(e=this.parent.dataSource instanceof o.DataManager&&i.i(d.h)(this.parent)?s.dataSource.dataSource.json:s.dataSource)||i.i(n.isNullOrUndefined)(a)||a.parentItem||i.i(n.isNullOrUndefined)(a.taskData)){if(!this.parent.parentIdMapping&&!i.i(n.isNullOrUndefined)(a)&&a.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition))for(var l=this.getChildrecordsByParentID(a.parentUniqueID)[0],p=l.childRecords,c=0;c<p.length;c++)a.parentItem.taskData[this.parent.childMapping][parseInt(c.toString(),10)]=p[parseInt(c.toString(),10)].taskData}else{for(var h=Object.keys(e),c=0;c<h.length;c++)e[parseInt(c.toString(),10)][this.parent.childMapping]===a.taskData[this.parent.childMapping]&&(t=c);"topSegment"===this.dropPosition?this.parent.idMapping||e.splice(t,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.idMapping||e.splice(t+1,0,r.taskData))}this.parent.parentIdMapping&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.parentIdMapping]=a[this.parent.parentIdMapping],r.taskData[this.parent.parentIdMapping]=a[this.parent.parentIdMapping]):(r[this.parent.parentIdMapping]=a[this.parent.idMapping],r.taskData[this.parent.parentIdMapping]=a[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){var t,i=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));t=this.parent.enableVirtualization?e&&!i&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")!==e.getAttribute("data-uid"):e&&!i&&this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid");var r=t||"topSegment"===this.dropPosition;this.parent.element.getElementsByClassName("e-lastrow-border").length>0&&e&&(t||r)&&this.parent.element.getElementsByClassName("e-lastrow-border")[0].remove()},e.prototype.updateIcon=function(e,t,o){var a=o.target?i.i(n.closest)(o.target,"tr"):null;this.dropPosition=void 0;var s=0;this.removeFirstrowBorder(a),this.removeLastrowBorder(a);for(var d=0;d<o.rows.length;d++)(i.i(n.isNullOrUndefined)(a)||a.getAttribute("data-uid")!==o.rows[parseInt(d.toString(),10)].getAttribute("data-uid"))&&i.i(r.parentsUntil)(o.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem());var l=this.parent,p=0,c=l.toolbar&&l.toolbar.length?document.getElementById(l.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(l.element),u=l.getHeaderContent().offsetHeight+h.top+c,g=l.getContent().firstElementChild.scrollTop;i.i(n.isNullOrUndefined)(a)||(s=a.offsetTop-g),p=this.parent.enableVirtualization?a.getBoundingClientRect().top:s+u+0;var f=p+e[0].offsetHeight,y=f-p,m=y/3,v=p+m,S=v+m,I=S+m,w=i.i(r.getObject)("originalEvent.event",o),R=i.i(r.getObject)("originalEvent.event",o),x="mousemove"===w.type?w.pageY:i.i(n.isNullOrUndefined)(R)||i.i(n.isNullOrUndefined)(R.changedTouches)?null:R.changedTouches[0].pageY;this.parent.enableVirtualization&&(x="mousemove"===w.type?w.clientY:i.i(n.isNullOrUndefined)(R)||i.i(n.isNullOrUndefined)(R.changedTouches)?null:R.changedTouches[0].clientY);var C=x<=v,b=x>v&&x<=S,D=x>S&&x<=I;if(C||b||D){if(C&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(a),this.removeErrorElem(),this.removeLastrowBorder(a),this.topOrBottomBorder(o.target)),b&&"Invalid"!==this.dropPosition){this.removetopOrBottomBorder();var M=[],O=i.i(n.closest)(o.target,"tr");M=[].slice.call(O.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),M.length>0&&this.addRemoveClasses(M,!0,"e-childborder"),this.addLastRowborder(a),this.addFirstrowBorder(a),this.dropPosition="middleSegment"}D&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(a),this.removeFirstrowBorder(a),this.topOrBottomBorder(o.target))}return this.dropPosition},e.prototype.removeChildBorder=function(){var e=[];e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder")),e.length>0&&this.addRemoveClasses(e,!1,"e-childborder")},e.prototype.addFirstrowBorder=function(e){var t=this.parent.element,r=this.parent;if(e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")){var o=this.parent.createElement("div",{className:"e-firstrow-border"}),a=this.parent.getHeaderContent(),s=0;r.toolbar&&(s=r.toolbarModule.getToolbar().offsetHeight);var d=!i.i(n.isNullOrUndefined)(this.parent.rowDropSettings.targetID);d&&(o.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+s+"px"),o.style.width=d?t.offsetWidth+"px":t.offsetWidth-this.getScrollWidth()+"px",a.querySelectorAll(".e-firstrow-border").length||a.appendChild(o)}},e.prototype.addLastRowborder=function(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));if(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?r.Scroll.getScrollBarWidth():0},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-cloneproperties")[0],t=e.querySelectorAll(".e-errorelem").length;if(!t&&!this.parent.rowDropSettings.targetID){var r=document.createElement("div");i.i(n.classList)(r,["e-errorcontainer"],[]),i.i(n.classList)(r,["e-icons","e-errorelem"],[]);var o=e.querySelector(".errorValue"),a=e.querySelector(".e-rowcell").innerHTML;o&&(a=this.parent.sanitize(o.innerHTML),o.parentNode.removeChild(o)),e.querySelector(".e-rowcell").innerHTML="";var s=document.createElement("span");s.className="errorValue",s.style.paddingLeft="16px",s.innerHTML=this.parent.sanitize(a),e.querySelector(".e-rowcell").appendChild(r),e.querySelector(".e-rowcell").appendChild(s);var d=document.querySelector(".e-dropitemscount");if(this.hasDropItem&&d){var l=parseInt(d.style.left,10)+r.offsetWidth+16,p=this.parent.enableRtl?0:l;d.style.left=p+"px",this.hasDropItem=!1}}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem"),t=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");if(e){if(r){var o=parseInt(r.style.left,10)-e.offsetWidth-16;i.i(n.setStyleAttribute)(t,{paddingLeft:"0px"}),this.parent.enableRtl||i.i(n.setStyleAttribute)(r,{left:o+"px"})}e.remove()}this.hasDropItem=!0},e.prototype.topOrBottomBorder=function(e){var t=[],r=i.i(n.closest)(e,"tr");t=r?[].slice.call(r.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")):[],t.length&&("topSegment"===this.dropPosition&&(this.addRemoveClasses(t,!0,"e-droptop"),this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0].remove()),"bottomSegment"===this.dropPosition&&this.addRemoveClasses(t,!0,"e-dropbottom"))},e.prototype.removetopOrBottomBorder=function(){var e=[];e=[].slice.call(this.parent.element.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 t=this.parent,o=this.parent.element.querySelector(".e-cloneproperties");o.style.cursor="";var a=e.target?i.i(n.closest)(e.target,"tr"):null,s=a?a.rowIndex:-1,d=[],l=t.getCurrentViewRecords()[parseInt(s.toString(),10)];if(this.removeErrorElem(),this.canDrop=!0,e.data[0]?d=e.data:d.push(e.data),-1!==s?this.ensuredropPosition(d,l):(this.canDrop=!1,this.addErrorElem()),!t.rowDropSettings.targetID&&this.canDrop&&t.rowDragAndDropModule.updateIcon(e.rows,s,e),i.i(n.isNullOrUndefined)(t.rowDropSettings.targetID)&&!this.canDrop&&this.removetopOrBottomBorder(),t.rowDropSettings.targetID){var p=i.i(r.parentsUntil)(e.target,"e-treegrid");if(p&&p.id===this.parent.rowDropSettings.targetID){p.ej2_instances[0].rowDragAndDropModule.updateIcon(e.rows,s,e)}}if(e.target&&i.i(n.closest)(e.target,"#"+t.rowDropSettings.targetID)){var p=i.i(r.parentsUntil)(e.target,"e-treegrid");p||(o.style.cursor="default")}},e.prototype.rowDropped=function(e){var t=this.parent;if(t.rowDropSettings.targetID?(e.target&&i.i(n.closest)(e.target,"#"+t.rowDropSettings.targetID)||i.i(r.parentsUntil)(e.target,"e-treegrid")&&i.i(r.parentsUntil)(e.target,"e-treegrid").id===t.rowDropSettings.targetID||e.target&&document.getElementById(t.rowDropSettings.targetID))&&(i.i(n.setValue)("dropPosition",this.dropPosition,e),t.trigger(a._7,e),!e.cancel&&t.rowDropSettings.targetID&&(this.dragDropGrid(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData)))):i.i(r.parentsUntil)(e.target,"e-content")&&(this.parent.element.querySelector(".e-errorelem")&&(this.dropPosition="Invalid"),i.i(n.setValue)("dropPosition",this.dropPosition,e),t.trigger(a._7,e),e.cancel||(i.i(d.b)(this.parent)||this.dropRows(e),t.isLocalData&&(t.flatData=this.orderToIndex(t.flatData)),t.grid.refresh(),i.i(n.isNullOrUndefined)(t.getHeaderContent().querySelector(".e-firstrow-border"))||t.getHeaderContent().querySelector(".e-firstrow-border").remove())),this.removetopOrBottomBorder(),this.removeChildBorder(),i.i(n.isNullOrUndefined)(this.parent.element.getElementsByClassName("e-firstrow-border")[0])?i.i(n.isNullOrUndefined)(this.parent.element.getElementsByClassName("e-lastrow-border")[0])||this.parent.element.getElementsByClassName("e-lastrow-border")[0].remove():this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!i.i(n.isNullOrUndefined)(e.data[0].parentItem)){var o=this.parent.treeColumnIndex;o+=1;var s=this.parent.getPrimaryKeyFieldNames()[0],l=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+s]),p=this.parent.getRows()[parseInt(l.toString(),10)],c=e.data[0];if("middleSegment"===this.dropPosition){var h=[],u=[];h.push(c),u.push(p);c=i.i(d.k)(this.parent,e.data[0].parentUniqueID),l=this.parent.grid.getRowIndexByPrimaryKey(c[""+s]);var g=this.parent.getRows()[parseInt(l.toString(),10)];h.push(c),u.push(g);for(var f=0;f<h.length;f++)this.parent.renderModule.cellRender({data:h[parseInt(f.toString(),10)],cell:u[parseInt(f.toString(),10)].cells[parseInt(o.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});var y=g.getElementsByClassName("e-treegridcollapse")[0];i.i(n.isNullOrUndefined)(y)||(i.i(n.removeClass)([y],"e-treegridcollapse"),i.i(n.addClass)([y],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:c,cell:p.cells[parseInt(o.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},e.prototype.dragDropGrid=function(e){var t,o=this.parent,s=i.i(n.closest)(e.target,"tr"),l=isNaN(this.getTargetIdx(s))?0:this.getTargetIdx(s),p=i.i(r.parentsUntil)(e.target,"e-treegrid");if(p&&p.id===this.parent.rowDropSettings.targetID&&!i.i(d.a)(this.parent)&&!i.i(d.b)(this.parent)){t=p.ej2_instances[0];for(var c=o.getSelectedRecords(),h=[],u=0;u<c.length;u++)h[parseInt(u.toString(),10)]=c[parseInt(u.toString(),10)].index;var g=t.dataSource;if(null!==this.parent.idMapping&&(i.i(n.isNullOrUndefined)(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!g.length){for(var f=[],u=0;u<c.length;u++)if(c[parseInt(u.toString(),10)].hasChildRecords){f.push(c[parseInt(u.toString(),10)]);for(var y=i.i(d.g)(c[parseInt(u.toString(),10)]),m=0;m<y.length;m++)f.push(y[parseInt(m.toString(),10)])}f.length&&(c=f)}o.notify(a._10,{indexes:h,records:c}),t.notify(a._9,{toIndex:l,records:c});var v=t.rowDragAndDropModule.treeGridData;if(!i.i(n.isNullOrUndefined)(v))for(var u=0;u<v.length;u++)if(v[parseInt(u.toString(),10)].index=u,!i.i(n.isNullOrUndefined)(v[parseInt(u.toString(),10)].parentItem)){var S=i.i(n.getValue)("uniqueIDCollection."+v[parseInt(u.toString(),10)].parentUniqueID+".index",t);v[parseInt(u.toString(),10)].parentItem.index=S}o.grid.refresh(),t.grid.refresh(),t.grid.dataSource.length>1&&(t.grid.refresh(),i.i(n.isNullOrUndefined)(t.getHeaderContent().querySelector(".e-firstrow-border"))||t.getHeaderContent().querySelector(".e-firstrow-border").remove(),i.i(n.isNullOrUndefined)(t.getContent().querySelector(".e-lastrow-border"))||t.getContent().querySelector(".e-lastrow-border").remove())}i.i(d.b)(this.parent)&&(t=p.ej2_instances[0],o.grid.refresh(),t.grid.refresh())},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("data-rowindex"),10):0},e.prototype.getParentData=function(e,t){var r=e.parentItem,n=-1;if(this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?n=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(n=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition){var o=this.parent.getPrimaryKeyFieldNames()[0],a=-1===n?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+o]):this.parent.getSelectedRowIndexes()[0],s=this.parent.getCurrentViewRecords()[parseInt(a.toString(),10)];this.droppedRecord=i.i(d.k)(this.parent,s.parentItem.uniqueID)}if("middleSegment"===this.dropPosition){this.parent.getCurrentViewRecords()[parseInt(n.toString(),10)].level===r.level?this.droppedRecord=i.i(d.k)(this.parent,r.uniqueID):this.getParentData(r)}},e.prototype.dropRows=function(e,t){if("Invalid"!==this.dropPosition&&!i.i(d.a)(this.parent)){var r,o=this.parent,a=void 0;if(i.i(n.isNullOrUndefined)(e.dropIndex)){var s=this.parent.getPrimaryKeyFieldNames()[0],l=-1===o.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+s])-1:o.getSelectedRowIndexes()[0]-1,p=o.getCurrentViewRecords()[parseInt(l.toString(),10)];this.getParentData(p,e.data)}else if(e.dropIndex=e.dropIndex===e.fromIndex?this.getTargetIdx(e.target.parentElement):e.dropIndex,this.parent.enableVirtualization){var c=this.parent.getRowByIndex(e.dropIndex).rowIndex;this.droppedRecord=o.getCurrentViewRecords()[parseInt(c.toString(),10)]}else this.droppedRecord=o.getCurrentViewRecords()[e.dropIndex];var h=[];a=this.droppedRecord,e.data[0]?h=e.data:h.push(e.data),this.parent[this.modifiedRecords].push(e.data[0],a);var u=0,g=this.parent.rowDropSettings.targetID;this.isMultipleGrid=g,g?this.isaddtoBottom=g&&this.isDraggedWithChild:this.ensuredropPosition(h,a);var f=h.length;i.i(n.isNullOrUndefined)(this.parent.idMapping)||h.reverse();for(var y=this,m=0;m<f;m++)!function(s){if(r=h[parseInt(s.toString(),10)],y.draggedRecord=r,"Invalid"!==y.dropPosition){if(o.rowDropSettings.targetID&&!t||y.deleteDragRow(),y.draggedRecord===y.droppedRecord){var d=y.getTargetIdx(e.target.offsetParent.parentElement);isNaN(d)&&(d=y.getTargetIdx(e.target.parentElement)),e.dropIndex=d,a=y.droppedRecord=y.parent.getCurrentViewRecords()[e.dropIndex]}if(a.parentItem||"middleSegment"===y.dropPosition){var l=o.parentData,p=l.indexOf(y.draggedRecord);-1!==p&&l.splice(p,1)}var c=y.treeGridData.indexOf(a);if(y.dropAtTop(c),"bottomSegment"===y.dropPosition){if(a.hasChildRecords?(u=y.getChildCount(a,0),y.parent.parentIdMapping&&y.treeData.splice(c+u+1,0,y.draggedRecord.taskData),y.treeGridData.splice(c+u+1,0,y.draggedRecord)):(y.parent.parentIdMapping&&y.treeData.splice(c+1,0,y.draggedRecord.taskData),y.treeGridData.splice(c+1,0,y.draggedRecord)),i.i(n.isNullOrUndefined)(a.parentItem)&&(delete r.parentItem,delete r.parentUniqueID,r.level=0,y.parent.parentIdMapping&&(r[y.parent.parentIdMapping]=null)),a.parentItem){var g=y.getChildrecordsByParentID(a.parentUniqueID),f=g[0].childRecords,m=f.indexOf(a)+1;f.splice(m,0,r),r.parentItem=a.parentItem,r.parentUniqueID=a.parentUniqueID,r.level=a.level,y.parent.parentIdMapping&&(r[y.parent.parentIdMapping]=a[y.parent.parentIdMapping],r.parentItem=a.parentItem,r.level=a.level)}if(r.hasChildRecords){y.updateChildRecordLevel(r,1),y.updateChildRecord(r,c+u+1)}}y.dropMiddle(c)}if(i.i(n.isNullOrUndefined)(r.parentItem)){var l=o.parentData,p=l.indexOf(y.droppedRecord),v=0;l.filter(function(e){r.uniqueID===e.uniqueID&&v++}),"bottomSegment"===y.dropPosition&&0===v?l.splice(p+1,0,r):"topSegment"===y.dropPosition&&0===v&&l.splice(p,0,r)}o.rowDragAndDropModule.refreshGridDataSource()}(m)}},e.prototype.dropMiddle=function(e){var t=this.parent,r=i.i(d.g)(this.droppedRecord),o=i.i(n.isNullOrUndefined)(r)||0===r.length?e+1:r.length+e+1;"middleSegment"===this.dropPosition&&(t.parentIdMapping?(this.treeData.splice(o,0,this.draggedRecord.taskData),this.treeGridData.splice(o,0,this.draggedRecord)):this.treeGridData.splice(o,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,o))},e.prototype.dropAtTop=function(e){var t=this.parent;if("topSegment"===this.dropPosition){if(t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData),this.draggedRecord.parentItem=this.treeGridData[parseInt(e.toString(),10)].parentItem,this.draggedRecord.parentUniqueID=this.treeGridData[parseInt(e.toString(),10)].parentUniqueID,this.draggedRecord.level=this.treeGridData[parseInt(e.toString(),10)].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 i=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID),r=i[0].childRecords,n=r.indexOf(this.droppedRecord);r.splice(n,0,this.draggedRecord)}}},e.prototype.recordLevel=function(){var e=this.parent,t=this.draggedRecord,r=this.droppedRecord,o=e.childMapping;if(r.hasChildRecords||(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,(i.i(n.isNullOrUndefined)(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!e.parentIdMapping&&i.i(n.isNullOrUndefined)(r.taskData[""+o])&&(r.taskData[""+o]=[]))),"middleSegment"===this.dropPosition){var a=i.i(n.extend)({},r);delete a.childRecords,t.parentItem=a,t.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,t);if(e.isSelfReference&&(r[e.childMapping]=[],r[e.childMapping].splice(r[e.childMapping].length,0,t)),i.i(n.isNullOrUndefined)(t)||e.parentIdMapping||i.i(n.isNullOrUndefined)(r.taskData[""+o])||r.taskData[e.childMapping].splice(r.childRecords.length,0,t.taskData),t.hasChildRecords){t.level=r.level+1,this.updateChildRecordLevel(t,1)}else t.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof o.DataManager&&i.i(d.h)(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=i.i(d.k)(this.parent,this.draggedRecord.uniqueID);!i.i(n.isNullOrUndefined)(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},e.prototype.updateChildRecord=function(e,t){var r,o=this.parent,a=0;if(!e.hasChildRecords)return 0;a=e.childRecords.length;for(var s=0;s<a;s++)r=this.isMultipleGrid?e.childRecords[parseInt(s.toString(),10)]:i.i(n.getValue)("uniqueIDCollection."+e.childRecords[parseInt(s.toString(),10)].uniqueID,o),t++,o.flatData.splice(t,0,r),i.i(n.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),o.parentIdMapping&&this.treeData.splice(t,0,r.taskData),r.hasChildRecords&&(t=this.updateChildRecord(r,t));return t},e.prototype.updateChildRecordLevel=function(e,t){var r,o=0;if(t++,!e.hasChildRecords)return 0;o=e.childRecords.length;for(var a=0;a<o;a++){r=this.isMultipleGrid?e.childRecords[parseInt(a.toString(),10)]:i.i(n.getValue)("uniqueIDCollection."+e.childRecords[parseInt(a.toString(),10)].uniqueID,this.parent);var s=void 0;e.parentItem&&(s=i.i(d.k)(this.parent,e.parentItem.uniqueID)),i.i(n.isNullOrUndefined)(s)&&!i.i(n.isNullOrUndefined)(e.parentItem)&&(s=e.parentItem),r.level=e.parentItem?s.level+t:e.level+1,r.hasChildRecords&&(t--,t=this.updateChildRecordLevel(r,t))}return t},e.prototype.removeRecords=function(e){var t,r=this.parent;t=this.parent.dataSource instanceof o.DataManager&&i.i(d.h)(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;var a=e,l=!i.i(n.isNullOrUndefined)(r.parentIdMapping),p=this.getChildrecordsByParentID(a.parentUniqueID)[0];if(a){if(a.parentItem){var c=p?p.childRecords:[],h=0;c&&c.length>0&&(h=c.indexOf(a),p.childRecords.splice(h,1),this.parent.parentIdMapping&&!r.enableImmutableMode||i.i(s.a)({value:a,action:"delete"},this.parent,l,a.index,a.index))}if(r.parentIdMapping){a.hasChildRecords&&a.childRecords.length>0&&this.removeChildItem(a);for(var u=void 0,g=void 0,f=t,y=0;y<f.length;y++)f[parseInt(y.toString(),10)][this.parent.idMapping]===a.taskData[this.parent.idMapping]&&(u=y);for(var y=0;y<this.treeGridData.length;y++)this.treeGridData[parseInt(y.toString(),10)][this.parent.idMapping]===a.taskData[this.parent.idMapping]&&(g=y);-1===u||i.i(n.isNullOrUndefined)(u)||t.splice(u,1),-1===g||i.i(n.isNullOrUndefined)(g)||this.treeGridData.splice(g,1)}var m=this.treeGridData.indexOf(a);if(!r.parentIdMapping){var v=this.parent.parentData.indexOf(a);-1!==v&&(r.parentData.splice(v,1),t.splice(v,1))}if(-1===m&&!r.parentIdMapping)for(var S=r.getPrimaryKeyFieldNames()[0],I=0;I<this.treeGridData.length;I++)this.treeGridData[parseInt(I.toString(),10)][""+S]===a[""+S]&&(m=I);if(!r.parentIdMapping){var w=this.getChildCount(a,0);this.treeGridData.splice(m,w+1)}a.parentItem&&p&&p.childRecords&&!p.childRecords.length&&(p.expanded=!1,p.hasChildRecords=!1,p.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(p)||i.i(n.isNullOrUndefined)(p)||this.parent[this.modifiedRecords].push(p),i.i(n.isNullOrUndefined)(p)||this.updateModifiedRecords(p)}},e.prototype.updateModifiedRecords=function(e){var t=i.i(d.k)(this.parent,e.parentUniqueID);i.i(n.isNullOrUndefined)(t)||(this.parent[this.modifiedRecords].push(t),this.updateModifiedRecords(t))},e.prototype.removeChildItem=function(e){var t,r,a,s;s=this.parent.dataSource instanceof o.DataManager&&i.i(d.h)(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var l=0;l<e.childRecords.length;l++){t=e.childRecords[parseInt(l.toString(),10)],!i.i(n.isNullOrUndefined)(t.childRecords)&&t.childRecords.length&&(t.hasChildRecords=!0);var p=void 0;p=this.parent.dataSource instanceof o.DataManager&&i.i(d.h)(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var c=0;c<p.length;c++)p[parseInt(c.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]&&(r=c);for(var h=0;h<this.treeGridData.length;h++)if(this.treeGridData[parseInt(h.toString(),10)][this.parent.idMapping]===t.taskData[this.parent.idMapping]){a=h;break}-1===r||i.i(n.isNullOrUndefined)(r)||s.splice(r,1),-1===a||i.i(n.isNullOrUndefined)(a)||this.treeGridData.splice(a,1),t.hasChildRecords&&this.removeChildItem(t)}},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)i=e.childRecords[parseInt(r.toString(),10)],t++,i.hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.ensuredropPosition=function(e,t){var r=this;e.filter(function(e){if(e.hasChildRecords&&!i.i(n.isNullOrUndefined)(e.childRecords)){if(-1!==e.childRecords.indexOf(t))return r.dropPosition="Invalid",r.addErrorElem(),void(r.canDrop=!1);r.ensuredropPosition(e.childRecords,t)}})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(a._11,this.Rowdraging),this.parent.off(a._12,this.rowDropped),this.parent.off(a._9,this.rowsAdded),this.parent.off(a._10,this.rowsRemoved))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(1),n=(i.n(r),i(4)),o=(i.n(n),i(0)),a=(i.n(o),i(2)),s=function(){function e(e){o.Grid.Inject(o.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!i.i(r.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,t){for(var o=0;o<e.length;o++)if(this.parent.grid.filterSettings.columns.length>0||""!==this.parent.grid.searchSettings.key?i.i(r.isNullOrUndefined)(i.i(a.k)(this.parent,e[parseInt(o.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(o.toString(),10)]):(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].hasChildRecords){var s=new n.DataManager(e[parseInt(o.toString(),10)].childRecords).executeLocal(t);if(this.parent.allowRowDragAndDrop&&-1!==e[parseInt(o.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,t)}},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.i(o.getActualProperties)(this.parent.grid.sortSettings)},!0)},e.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},e.prototype.destroy=function(){this.removeEventListener()},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(4),n=(i.n(r),i(0)),o=(i.n(n),i(2)),a=i(1),s=(i.n(a),function(){function e(e){n.Grid.Inject(n.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,t,r){this.summaryQuery=e;for(var s,d=Object.keys(t).length,l=[],p=0,c=d;p<c;p++){i.i(n.getObject)("isSummaryRow",t[parseInt(p.toString(),10)])||l.push(t[parseInt(p.toString(),10)])}var h,u=i.i(o.e)(l),g=l.slice(),f=Object.keys(this.parent.aggregates).length,y=Object.keys(u).length,m=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var v=0,c=y;v<c;v++)if(s=u[parseInt(v.toString(),10)],h=this.getChildRecordsLength(s,g)){for(var S=this,I=1,w=f;I<=w;I++)!function(e,t){var o=void 0;o={};for(var d=0;d<m.length;d++){o[""+(i.i(a.isNullOrUndefined)(i.i(n.getObject)("field",m[parseInt(d.toString(),10)]))?m[parseInt(d.toString(),10)]:i.i(n.getObject)("field",m[parseInt(d.toString(),10)]))]=null}if(o=S.createSummaryItem(o,S.parent.aggregates[e-1]),!S.parent.aggregates[e-1].showChildSummary)return"continue";var l;g.map(function(e,t){if(e.uniqueID===s.uniqueID)return void(l=t)});var p=l+h+e,c=i.i(a.extend)({},s);delete c.childRecords,delete c[S.parent.childMapping],i.i(a.setValue)("parentItem",c,o);var u=i.i(n.getObject)("level",c);if(i.i(a.setValue)("level",u+1,o),i.i(a.setValue)("isSummaryRow",!0,o),i.i(a.setValue)("parentUniqueID",c.uniqueID,o),r){var f=i.i(n.getObject)("childRecords",s);f.length&&f.push(o)}g.splice(p,0,o)}(I);this.flatChildRecords=[]}}else{for(var R={},x=0,C=m.length;x<C;x++){R[""+(i.i(a.isNullOrUndefined)(i.i(n.getObject)("field",m[parseInt(x.toString(),10)]))?m[parseInt(x.toString(),10)]:i.i(n.getObject)("field",m[parseInt(x.toString(),10)]))]=null}for(var I=1,b=f;I<=b;I++)this.createSummaryItem(R,this.parent.aggregates[I-1])}return g},e.prototype.getChildRecordsLength=function(e,t){for(var r,o=Object.keys(t).length,s=0,d=o;s<d;s++){r=t[parseInt(s.toString(),10)];if(e===(i.i(a.isNullOrUndefined)(r.parentItem)?null:t.filter(function(e){return e.uniqueID===r.parentItem.uniqueID})[0])){this.flatChildRecords.push(r);if(!i.i(n.getObject)("hasChildRecords",r))continue;this.getChildRecordsLength(r,t)}}return this.flatChildRecords.length},e.prototype.createSummaryItem=function(e,t){for(var n=Object.keys(t.columns).length,o=0,s=n;o<s;o++)for(var d=i.i(a.isNullOrUndefined)(t.columns[parseInt(o.toString(),10)].columnName)?t.columns[parseInt(o.toString(),10)].field:t.columns[parseInt(o.toString(),10)].columnName,l=Object.keys(e),p=0,c=l;p<c.length;p++){var h=c[p];if(h===d)if(this.flatChildRecords.length)e[""+h]=this.getSummaryValues(t.columns[parseInt(o.toString(),10)],this.flatChildRecords);else if(this.parent.isLocalData){var u=this.parent.dataSource instanceof r.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData;e[""+h]=this.getSummaryValues(t.columns[parseInt(o.toString(),10)],u)}}return e},e.prototype.getSummaryValues=function(e,t){var o=new r.Query,s={},d={},l=i.i(a.isNullOrUndefined)(e.field)?void 0:this.parent.getColumnByField(e.field).type;e.setPropertiesSilent({format:this.getFormatFromType(e.format,l)}),e.setFormatter(this.parent.grid.locale);var p=e.getFormatter()||function(){return function(e){return e}}();e.setTemplate(d);var c=e.getTemplate(2);o.queries=this.summaryQuery,o.requiresCount();var h,u=new r.DataManager(t).executeLocal(o),g=e.type;g=[e.type];for(var f=0;f<g.length;f++){h=g[parseInt(f.toString(),10)];var y=e.field+" - "+g[parseInt(f.toString(),10)].toLowerCase(),m="Custom"!==g[parseInt(f.toString(),10)]?i.i(n.getObject)("aggregates",u):i.i(n.calculateAggregate)(g[parseInt(f.toString(),10)],u,e,this.parent),v=e.columnName,S="Custom"!==g[parseInt(f.toString(),10)]?m[""+y]:m;s[""+v]=s[""+v]||{},s[""+v][""+y]=S,s[""+v][g[parseInt(f.toString(),10)]]=i.i(a.isNullOrUndefined)(m)?" ":p(S)}d.format=e.getFormatter();var I=i.i(a.createElement)("td",{className:"e-summary"});if(this.parent.isReact){c.fn(s[e.columnName],this.parent,c.property,"",null,null,I),this.parent.renderReactTemplates()}else i.i(n.appendChildren)(I,c.fn(s[e.columnName],this.parent,c.property));var w=s[""+e.columnName][""+h];return-1===I.innerHTML.indexOf(w)?I.innerHTML+w:I.innerHTML},e.prototype.getFormatFromType=function(e,t){if(i.i(a.isNullOrUndefined)(t)||"string"!=typeof e)return e;var r;switch(t){case"number":r={format:e};break;case"datetime":r={type:"dateTime",skeleton:e};break;case"date":r={type:t,skeleton:e}}return r},e.prototype.destroy=function(){this.removeEventListener()},e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(0),n=(i.n(r),i(3)),o=i(1),a=(i.n(o),function(){function e(e){r.Grid.Inject(r.Toolbar),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.addEventListener=function(){this.parent.on(n.D,this.refreshToolbar,this),this.parent.on(n.E,this.refreshToolbar,this),this.parent.on(n.F,this.toolbarClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(n.D,this.refreshToolbar),this.parent.off(n.E,this.refreshToolbar),this.parent.off(n.F,this.toolbarClickHandler))},e.prototype.refreshToolbar=function(e){var t=this.parent.grid.toolbarModule.getToolbar();if(!i.i(o.isNullOrUndefined)(t)){var r=this.parent,n=void 0,a=void 0,s=r.element.id+"_gridcontrol_indent",d=r.element.id+"_gridcontrol_outdent",l=t.querySelector("#"+s),p=t.querySelector("#"+d),c=e.row,h=r.getSelectedRows()[0];if(i.i(o.isNullOrUndefined)(c[0])||(c=c[0]),c=i.i(o.isNullOrUndefined)(h)||h.rowIndex===c.rowIndex?c:h,null!==l&&null!==p){if(n=t.querySelector("#"+s).parentElement,a=t.querySelector("#"+d).parentElement,0===c.rowIndex||r.getSelectedRowIndexes().length>1)n.classList.add("e-hidden"),a.classList.add("e-hidden");else if("rowDeselected"!==e.name||!i.i(o.isNullOrUndefined)(h)&&r.grid.isCheckBoxSelection){var u=r.getCurrentViewRecords()[c.rowIndex];i.i(o.isNullOrUndefined)(u)||(u.level>r.getCurrentViewRecords()[c.rowIndex-1].level?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),u.level===r.getCurrentViewRecords()[c.rowIndex-1].level&&n.classList.remove("e-hidden"),0===u.level&&a.classList.add("e-hidden"),0!==u.level&&a.classList.remove("e-hidden"))}"rowDeselected"===e.name&&i.i(o.isNullOrUndefined)(h)&&!r.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&n.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent")&&a.classList.add("e-hidden"))}}},e.prototype.toolbarClickHandler=function(e){var t=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===t.grid.element.id+"_indent"&&t.getSelectedRecords().length&&!i.i(o.isNullOrUndefined)(t.rowDragAndDropModule)&&this.parent.rowDragAndDropModule.indentOutdentAction(null,"indent"),e.item.id===t.grid.element.id+"_outdent"&&t.getSelectedRecords().length&&!i.i(o.isNullOrUndefined)(t.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}())},function(e,t,i){"use strict";i.d(t,"a",function(){return p}),i.d(t,"b",function(){return c});var r=i(0),n=(i.n(r),i(1)),o=(i.n(n),i(3)),a=i(4),s=(i.n(a),i(2)),d=i(54),l=this&&this.__extends||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)}}(),p=function(){function e(e){this.prevstartIndex=-1,this.prevendIndex=-1,this.parent=e,r.Grid.Inject(c),this.addEventListener()}return e.prototype.returnVisualData=function(e){e.data=this.visualData},e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(o.b,this.collapseExpandVirtualchilds,this),this.parent.on(o.a,this.virtualPageAction,this),this.parent.on(o.c,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(o.b,this.collapseExpandVirtualchilds),this.parent.off(o.a,this.virtualPageAction),this.parent.off(o.c,this.destroy))},e.prototype.collapseExpandVirtualchilds=function(e){this.parent.grid.notify(o.d,{isExpandCollapse:!0}),this.expandCollapseRec=e.record,e.record.expanded="collapse"!==e.action;var t={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};(this.parent.enableVirtualization&&"Cell"===this.parent.selectionSettings.mode||"Row"===this.parent.selectionSettings.mode&&!this.parent.selectionSettings.persistSelection)&&this.parent.grid.clearSelection();var r=i.i(n.getValue)("isCollapseAll",this.parent)?"collapseAll":"refresh";i.i(n.getValue)("grid.renderModule",this.parent).dataManagerSuccess(t,{requestType:r})},e.prototype.virtualPageAction=function(e){var t=this,d=new a.DataManager(e.result),l=new a.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),p=d.executeLocal((new a.Query).where(l)),c=p.filter(function(e){return i.i(s.f)(t.parent,e,p)});this.visualData=c,e.count=c.length,this.parent.grid.notify(o.e,{data:c});var h={startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType};this.parent.grid.notify(o.f,h);var u=h.startIndex,g=h.endIndex;if(e.count=c.length,-1===u&&-1===g){var f=new a.Query,y=this.parent.grid.pageSettings.pageSize,m=this.parent.grid.pageSettings.currentPage,v=y*(m-1);f=f.skip(v).take(y),d.dataSource.json=c,e.result=d.executeLocal(f)}else{var S=e.actionArgs.requestType;("filtering"===S||"collapseAll"===S||"searching"===S||"refresh"===S&&this.parent.enableCollapseAll&&g>c.length&&i.i(n.isNullOrUndefined)(this.expandCollapseRec))&&(u=0,g=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(o.d,{setTop:!0})),("save"===S&&e.actionArgs.index>=h.count-this.parent.grid.pageSettings.pageSize||"refresh"===S&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&((h.endIndex+this.parent.pageSettings.pageSize>=h.count&&this.parent.root&&h.count-h.endIndex==this.visualData.length-this.parent.root.previousFlatData.length||!this.parent.isGantt||!this.parent.isAddedFromGantt)&&(u=h.startIndex+(h.count-h.endIndex),g=h.count),this.parent.isAddedFromGantt=!1);var I=this.parent.grid.contentModule.virtualEle.wrapper,w=i.i(r.getTransformValues)(I).height;if(!i.i(n.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),!i.i(n.isNullOrUndefined)(this.expandCollapseRec)){var R=this.parent.getRows(),x=c.indexOf(this.expandCollapseRec);c.slice(x,x+R.length).length<R.length&&x>=0&&0!==u?(x=c.length-R.length,x=x>0?x:0,u=x,g=c.length):i.i(n.getValue)("isCollapseAll",this.parent)&&(u=0,g=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(o.d,{setTop:!0}))}!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||i.i(n.isNullOrUndefined)(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?u=0:this.parent.isExpandAll||(u=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,u=u<0?0:u,0===g&&c.length>0?e.result=c:e.result=c.slice(u,g),this.prevstartIndex=u,this.prevendIndex=g}this.parent.notify("updateAction",e)},e.prototype.destroy=function(){this.removeEventListener()},e}(),c=function(e){function t(t,r){var o=e.call(this,t,r)||this;return i.i(n.getValue)("parent",o).off("initial-load",i.i(n.getValue)("instantiateRenderer",o),o),i.i(n.getValue)("parent",o).on("initial-load",o.instantiateRenderers,o),o}return l(t,e),t.prototype.getModuleName=function(){return"treeVirtualScroll"},t.prototype.instantiateRenderers=function(){var e=i.i(n.getValue)("parent",this);i.i(n.getValue)("parent",this).log(["limitation","virtual_height"],"virtualization");var t=i.i(n.getValue)("locator",this).getService("rendererFactory");e.enableColumnVirtualization&&i.i(n.getValue)("addRenderer",t).apply(t,[r.RenderType.Header,new r.VirtualHeaderRenderer(i.i(n.getValue)("parent",this),i.i(n.getValue)("locator",this))]),i.i(n.getValue)("addRenderer",t).apply(t,[r.RenderType.Content,new d.a(i.i(n.getValue)("parent",this),i.i(n.getValue)("locator",this))]),this.ensurePageSize()},t.prototype.ensurePageSize=function(){var e=i.i(n.getValue)("parent",this),t=e.getRowHeight();i.i(n.isNullOrUndefined)(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var r=e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height,o=~~(r/t),a=2*o,s=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:s<a?a:s}},!0)},t}(r.VirtualScroll)},function(e,t,i){"use strict";var r=i(49);i.d(t,"a",function(){return r.a});var n=i(3);i.d(t,"b",function(){return n.K}),i.d(t,"c",function(){return n.I}),i.d(t,"d",function(){return n.L}),i.d(t,"e",function(){return n.J}),i.d(t,"f",function(){return n.M}),i.d(t,"g",function(){return n.v}),i.d(t,"h",function(){return n.N}),i.d(t,"i",function(){return n.h}),i.d(t,"j",function(){return n.O}),i.d(t,"k",function(){return n.D}),i.d(t,"l",function(){return n.j}),i.d(t,"m",function(){return n.E}),i.d(t,"n",function(){return n.F}),i.d(t,"o",function(){return n.H}),i.d(t,"p",function(){return n.G}),i.d(t,"q",function(){return n.P}),i.d(t,"r",function(){return n.Q}),i.d(t,"s",function(){return n.R}),i.d(t,"t",function(){return n.S}),i.d(t,"u",function(){return n.T}),i.d(t,"v",function(){return n.U}),i.d(t,"w",function(){return n.b}),i.d(t,"x",function(){return n.a}),i.d(t,"y",function(){return n.V}),i.d(t,"z",function(){return n.W}),i.d(t,"A",function(){return n.X}),i.d(t,"B",function(){return n.C}),i.d(t,"C",function(){return n.Y}),i.d(t,"D",function(){return n.Z}),i.d(t,"E",function(){return n.k}),i.d(t,"F",function(){return n.l}),i.d(t,"G",function(){return n.m}),i.d(t,"H",function(){return n.n}),i.d(t,"I",function(){return n.o}),i.d(t,"J",function(){return n.x}),i.d(t,"K",function(){return n.r}),i.d(t,"L",function(){return n._0}),i.d(t,"M",function(){return n.p}),i.d(t,"N",function(){return n.y}),i.d(t,"O",function(){return n.A}),i.d(t,"P",function(){return n.z}),i.d(t,"Q",function(){return n.B}),i.d(t,"R",function(){return n.w}),i.d(t,"S",function(){return n.q}),i.d(t,"T",function(){return n._1}),i.d(t,"U",function(){return n.s}),i.d(t,"V",function(){return n._2}),i.d(t,"W",function(){return n.d}),i.d(t,"X",function(){return n.c}),i.d(t,"Y",function(){return n.e}),i.d(t,"Z",function(){return n.f}),i.d(t,"_0",function(){return n.t}),i.d(t,"_1",function(){return n.u}),i.d(t,"_2",function(){return n._3}),i.d(t,"_3",function(){return n._4}),i.d(t,"_4",function(){return n._5}),i.d(t,"_5",function(){return n._6}),i.d(t,"_6",function(){return n._7}),i.d(t,"_7",function(){return n._8}),i.d(t,"_8",function(){return n._9}),i.d(t,"_9",function(){return n._10}),i.d(t,"_10",function(){return n._11}),i.d(t,"_11",function(){return n._12}),i.d(t,"_12",function(){return n.i}),i.d(t,"_13",function(){return n._13}),i.d(t,"_14",function(){return n._14}),i.d(t,"_15",function(){return n._15}),i.d(t,"_16",function(){return n._16}),i.d(t,"_17",function(){return n._17}),i.d(t,"_18",function(){return n._18}),i.d(t,"_19",function(){return n._19}),i.d(t,"_20",function(){return n._20}),i.d(t,"_21",function(){return n._21}),i.d(t,"_22",function(){return n._22}),i.d(t,"_23",function(){return n._23}),i.d(t,"_24",function(){return n._24}),i.d(t,"_25",function(){return n._25}),i.d(t,"_26",function(){return n.g}),i.d(t,"_27",function(){return n._26});var o=i(11);i.d(t,"_28",function(){return o.a});var a=i(8);i.d(t,"_29",function(){return a.a});var s=i(9);i.d(t,"_30",function(){return s.a});var d=i(43);i.d(t,"_31",function(){return d.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return E});var r=i(1),n=(i.n(r),i(13)),o=i(0),a=(i.n(o),i(17)),s=i(15),d=i(52),l=i(7),p=i(6),c=i(10),h=i(42),u=i(3),g=i(19),f=i(20),y=i(4),m=(i.n(y),i(25)),v=(i.n(m),i(2)),S=i(23),I=i(11),w=i(12),R=i(18),x=i(22),C=i(14),b=i(21),D=i(5),M=i(16),O=this&&this.__extends||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)}}(),P=this&&this.__decorate||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},E=function(e){function t(t,n){var a=e.call(this,t,n)||this;a.dataResults={},a.uniqueIDCollection={},a.uniqueIDFilterCollection={},a.changedRecords="changedRecords",a.deletedRecords="deletedRecords",a.addedRecords="addedRecords",a.indentOutdentAction="indentOutdentAction",a.modifiedRecords=[],a.stackedHeader=!1,a.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)])){var a=e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date;if(!a||e[i[parseInt(o.toString(),10)]].getTime()!==t[i[parseInt(o.toString(),10)]].getTime()){r=!1;break}}return r}return!1},E.Inject(c.a,l.a),i.i(r.setValue)("mergePersistData",a.mergePersistTreeGridData,a);i.i(r.isNullOrUndefined)(a.injectedModules.Logger)||o.Grid.Inject(o.Logger);a.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&o.Grid.Inject(o.Freeze)});return a.grid=new o.Grid,a}O(t,e),E=t,t.prototype.excelExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!1)},t.prototype.csvExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!0)},t.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule.Map(e,t,i,r)},t.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},t.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},t.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},t.prototype.exportTreeGrid=function(e){var t=this,i=t.grid.getDataModule().generateQuery(!0),r=(new y.UrlAdaptor).processQuery(new y.DataManager({url:""}),i),n=JSON.parse(r.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=n.where,o.searchSettings.fields=n.search&&n.search[0].fields||[],o.sortSettings.columns=n.sorted,o.columns=this.setHeaderText(o.columns,a);var s=this.createElement("form",{id:"ExportForm",styles:"display:none;"}),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()},t.prototype.setHeaderText=function(e,t){for(var n=0;n<e.length;n++){var a=this.getColumnByUid(e[parseInt(n.toString(),10)].uid);this.stackedHeader&&i.i(r.isNullOrUndefined)(a)&&(a=i.i(r.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=a.headerText,i.i(r.isNullOrUndefined)(a.template)||(e[parseInt(n.toString(),10)].template="true"),e[parseInt(n.toString(),10)].format&&(e[parseInt(n.toString(),10)].format=i.i(o.getNumberFormat)(this.getFormat(a.format),a.type,!1,this.currencyCode),this.isExcel||"datetime"!==a.type&&"date"!==a.type||(e[parseInt(n.toString(),10)].format=e[parseInt(n.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(n.toString(),10)].type=a.type),e[parseInt(n.toString(),10)].columns&&this.setHeaderText(e[parseInt(n.toString(),10)].columns,t);for(var s=Object.keys(e[parseInt(n.toString(),10)]),d=0;d<s.length;d++)t.indexOf(s[parseInt(d.toString(),10)])<0&&delete e[parseInt(n.toString(),10)][s[parseInt(d.toString(),10)]]}return e},t.prototype.getFormat=function(e){return"object"==typeof e?i.i(r.isNullOrUndefined)(e.format)?e.skeleton:e.format:e},t.prototype.getModuleName=function(){return"treegrid"},t.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 r.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&i.i(r.isNullOrUndefined)(this.childMapping)&&(this.childMapping="Children")},t.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},t.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},t.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},t.prototype.search=function(e){this.grid.search(e)},t.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},t.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},t.prototype.TreeGridLocale=function(){var e=r.L10n.locale,t={};i.i(r.setValue)(this.locale,{},t);var n;n={},n=i.i(o.getObject)(this.locale,e);var a;a={},a=i.i(o.getObject)(this.getModuleName(),n),i.i(r.setValue)("grid",a,i.i(o.getObject)(this.locale,t)),r.L10n.load(t)},t.prototype.print=function(){this.printModule.print()},t.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var t=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":t=e.target,o=t.closest(".e-rowcell"),i.i(r.isNullOrUndefined)(o)||(a=o.closest("tr"),i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(a.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridexpand")));break;case"ctrlShiftDownArrow":t=e.target,o=t.closest(".e-rowcell"),i.i(r.isNullOrUndefined)(o)||(a=o.closest("tr"),i.i(r.isNullOrUndefined)(a)||i.i(r.isNullOrUndefined)(a.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(a.querySelector(".e-treegridcollapse")));break;case"downArrow":if(!this.enableVirtualization&&(t=e.target,n=t.parentElement,!i.i(r.isNullOrUndefined)(n))){var d=n.cellIndex;if("dropdownedit"===this.grid.getColumnByIndex(d).editType&&i.i(r.isNullOrUndefined)(this.grid.getColumnByIndex(d).edit.obj)&&(n=t),null!==(s=this.findnextRowElement(n))){var l=e.target.cellIndex,p=s.children[parseInt(l.toString(),10)];i.i(r.addClass)([p],"e-focused"),i.i(r.addClass)([p],"e-focus")}else this.clearSelection()}break;case"upArrow":if(!this.enableVirtualization&&(t=e.target,n=t.parentElement,!i.i(r.isNullOrUndefined)(n))){var d=n.cellIndex;if("dropdownedit"===this.grid.getColumnByIndex(d).editType&&i.i(r.isNullOrUndefined)(this.grid.getColumnByIndex(d).edit.obj)&&(n=t),null!==(s=this.findPreviousRowElement(n))){var c=e.target.cellIndex,h=s.children[parseInt(c.toString(),10)];i.i(r.addClass)([h],"e-focused"),i.i(r.addClass)([h],"e-focus")}else this.clearSelection()}}}},t.prototype.findnextRowElement=function(e){var t=e.nextElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&"none"!==t.style.display||(t=this.findnextRowElement(t)),t},t.prototype.findPreviousRowElement=function(e){var t=e.previousElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&"none"!==t.style.display||(t=this.findPreviousRowElement(t)),t},t.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!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 y.DataManager)||this.dataSource.dataSource.offline||!i.i(r.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof y.RemoteSaveAdaptor,this.isSelfReference=!i.i(r.isNullOrUndefined)(this.parentIdMapping)},t.prototype.wireEvents=function(){r.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),r.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new r.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)},t.prototype.requiredModules=function(){var e=[];if(this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed)return e;e.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),i.i(r.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.allowResizing&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this],name:"ExcelExport"});var t=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()});return(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||this.grid.getFrozenLeftColumnsCount()||this.grid.getFrozenRightColumnsCount())&&t.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},t.prototype.extendRequiredModules=function(e){var t=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||t.length)&&(i.i(r.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"}),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]})},t.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},t.prototype.unwireEvents=function(){this.grid&&this.grid.element&&r.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(r.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard&&this.element.removeAttribute("tabIndex"))},t.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},t.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),i.i(m.createSpinner)({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new S.a(this),this.dataModule=new I.a(this),this.printModule=new h.a(this),this.trigger(u.K),this.autoGenerateColumns(),this.initialRender=!0,i.i(r.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 t=i.i(r.createElement)("div",{id:this.element.id+"_gridcontrol"});i.i(r.addClass)([this.element],"e-treegrid"),i.i(r.isNullOrUndefined)(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),i.i(r.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(t);var n=this.grid.requiredModules;this.grid.requiredModules=function(){var e=[];e=n.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(t),this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var o=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table");i.i(r.isNullOrUndefined)(o)||o.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.wireEvents(),this.renderComplete();var a=this.grid.destroyTemplate;this.grid.destroyTemplate=function(t,n){a.apply(e.grid);e.isReact&&i.i(r.isNullOrUndefined)(e.portals)||e.clearTemplate(t,n)}},t.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")},t.prototype.afterGridRender=function(){i.i(r.isNullOrUndefined)(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new p.a(this,this.grid.serviceLocator)},t.prototype.convertTreeData=function(e){var t=this;if(i.i(v.b)(this)&&(e=i.i(r.getValue)("result",e)),e instanceof Array&&e.length>0&&Object.prototype.hasOwnProperty.call(e[0],"level"))this.flatData=e,this.flatData.filter(function(e){i.i(r.setValue)("uniqueIDCollection."+e.uniqueID,e,t),0===e.level&&t.parentData.push(e)});else if(i.i(v.b)(this)){var n=i.i(r.getValue)("result",this.dataSource);this.dataModule.convertToFlatData(n)}else this.dataModule.convertToFlatData(e)},t.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.i(o.getActualProperties)(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,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.i(o.getActualProperties)(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=i.i(o.getActualProperties)(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.filterSettings=i.i(o.getActualProperties)(this.filterSettings),this.grid.selectionSettings=i.i(o.getActualProperties)(this.selectionSettings),this.grid.sortSettings=i.i(o.getActualProperties)(this.sortSettings),this.grid.searchSettings=i.i(o.getActualProperties)(this.searchSettings),this.grid.aggregates=i.i(o.getActualProperties)(this.aggregates),this.grid.textWrapSettings=i.i(o.getActualProperties)(this.textWrapSettings),this.grid.printMode=i.i(o.getActualProperties)(this.printMode),this.grid.locale=i.i(o.getActualProperties)(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=i.i(o.getActualProperties)(this.getContextMenu()),this.grid.columnMenuItems=i.i(o.getActualProperties)(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=i.i(o.getActualProperties)(this.rowTemplate),this.grid.detailTemplate=i.i(o.getActualProperties)(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=i.i(o.getActualProperties)(this.clipMode);this.grid.templateDotnetInstance=this.templateDotnetInstance;this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer},t.prototype.triggerEvents=function(e){this.trigger(i.i(o.getObject)("name",e),e)},t.prototype.IsExpandCollapseClicked=function(e){if(!i.i(r.isNullOrUndefined)(e.target)&&(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))&&!this.selectionSettings.checkboxOnly&&(!i.i(r.isNullOrUndefined)(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&i.i(r.isNullOrUndefined)(e.data)))return void(e.cancel=!0)},t.prototype.bindGridEvents=function(){var e=this;this.grid.rowSelecting=function(t){e.IsExpandCollapseClicked(t),e.trigger(u.O,t)},this.grid.rowDeselecting=function(t){e.IsExpandCollapseClicked(t),e.trigger(u._13,t)},this.grid.rowSelected=function(t){if(e.enableVirtualization&&t.isHeaderCheckboxClicked&&e.grid.currentViewData.length!==e.grid.selectionModule.selectedRowIndexes.length)for(var i=0;i<e.getRows().length;i++)e.getRows()[parseInt(i.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&e.grid.selectionModule.updateRowSelection(e.getRows()[parseInt(i.toString(),10)],e.getCurrentViewRecords()[parseInt(i.toString(),10)].index);e.selectedRowIndex=e.grid.selectedRowIndex,e.notify(u.D,t),e.trigger(u.D,t)},this.grid.rowDeselected=function(t){e.selectedRowIndex=e.grid.selectedRowIndex,i.i(r.isNullOrUndefined)(t.data)||e.notify(u.E,t),e.trigger(u.E,t)},this.grid.resizeStop=function(t){e.updateColumnModel(),e.trigger(u.P,t)},this.grid.excelQueryCellInfo=function(t){e.notify("excelCellInfo",t),t=e.dataResults},this.grid.pdfQueryCellInfo=function(t){e.notify("pdfCellInfo",t),t=e.dataResults},this.grid.checkBoxChange=function(t){e.trigger(u.j,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(u.Y,t)},this.grid.load=function(){if(e.grid.on("initial-end",e.afterGridRender,e),!i.i(r.isNullOrUndefined)(e.loggerModule)){e.loggerModule=e.grid.loggerModule=new l.a(e.grid)}},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=this.triggerEvents.bind(this),this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},t.prototype.lastRowBorder=function(e,t){for(var n=0;n<e.cells.length;n++)t?i.i(r.addClass)([e.cells[parseInt(n.toString(),10)]],"e-lastrowcell"):i.i(r.removeClass)([e.cells[parseInt(n.toString(),10)]],"e-lastrowcell")},t.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},t.prototype.extendedGridDataBoundEvent=function(){var e=this;this.grid.dataBound=function(t){if(e.updateRowTemplate(),e.updateColumnModel(),e.updateAltRow(e.getRows()),e.notify("dataBoundArg",t),i.i(v.a)(e)&&!i.i(v.h)(e)&&!e.hasChildMapping){var n=void 0;n=e.dataResults.result?0:1,i.i(r.setValue)("grid.contentModule.isLoaded",!(n>0),e)}if(e.isPixelHeight()&&e.initialRender)for(var o=e.getContentTable().rows,a=[].slice.call(o),s=a.length-1;s>0;s--)if(!i.i(v.l)(a[parseInt(s.toString(),10)])){a[parseInt(s.toString(),10)].nextElementSibling&&e.lastRowBorder(a[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=e.getCurrentViewRecords().indexOf(e.grid.selectionModule.data);e.grid.selectionModule.updateRowSelection(e.getRows()[parseInt(d.toString(),10)],d)}}e.trigger(u.L,t),e.initialRender=!1};var t=this;this.grid.beforeDataBound=function(e){var n=i.i(o.getObject)("action",e);if((i.i(v.a)(t)&&!i.i(v.h)(t)||i.i(v.b)(this))&&"edit"!==n)t.notify("updateRemoteLevel",e),e=t.dataResults;else if(0===t.flatData.length&&i.i(v.h)(t)&&t.dataSource instanceof y.DataManager){var a=t.dataSource;t.dataModule.convertToFlatData(a.dataSource.json),e.result=t.grid.dataSource.dataSource.json=t.flatData}if(i.i(v.a)(t)||i.i(v.b)(this)||i.i(r.isNullOrUndefined)(t.dataSource)||(this.isPrinting&&i.i(r.setValue)("isPrinting",!0,e),t.notify("dataProcessor",e)),i.i(r.extend)(e,t.dataResults),t.enableImmutableMode&&(e.result=e.result.slice()),t.initialRender&&(this.contentModule.objectEqualityChecker=t.objectEqualityChecker),!this.isPrinting){var s=new y.Deferred;return t.trigger(u.M,e,function(e){s.resolve(e)}),s}},this.grid.log=function(t,i){e.loggerModule&&e.loggerModule.log(t,i)}},t.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 y.Deferred;return e.trigger(u.F,t,function(r){r.cancel||e.notify(u.F,t),i.resolve(r)}),i}},this.grid.cellSelecting=function(t){var n=e.grid.selectionModule.actualTarget;i.i(r.isNullOrUndefined)(n)||!n.classList.contains("e-treegridexpand")&&!n.classList.contains("e-treegridcollapse")||(t.cancel=!0);var a=new y.Deferred;return e.trigger(i.i(o.getObject)("name",t),t,function(e){a.resolve(e)}),a},this.grid.beginEdit=function(t){if(!i.i(r.isNullOrUndefined)(t.row)&&t.row.classList.contains("e-summaryrow"))return void(t.cancel=!0);var n=new y.Deferred;return e.trigger(u.l,t,function(e){n.resolve(e)}),n}},t.prototype.extendedGridEditEvents=function(){var e=this;this.grid.dataStateChange=function(t){e.isExpandRefresh?(e.isExpandRefresh=!1,e.grid.dataSource={result:e.flatData,count:i.i(r.getValue)("count",e.grid.dataSource)}):("infiniteScroll"!==t.action.requestType&&(e.infiniteScrollData=[]),e.trigger(u.N,t))},this.grid.cellSave=function(t){if(e.grid.isContextMenuOpen()){var n=e.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0];(i.i(r.isNullOrUndefined)(n)||n.id!==e.element.id+"_gridcontrol_cmenu_Save")&&(t.cancel=!0)}var o=new y.Deferred;return e.trigger(u.o,t,function(t){t.cancel||e.notify(u.o,t),o.resolve(t)}),o},this.grid.cellSaved=function(t){e.trigger(u.x,t),e.notify(u.x,t)},this.grid.cellEdit=function(t){var i=new y.Deferred;return t.promise=i,e.notify(u.r,t),i},this.grid.batchAdd=function(t){e.trigger(u.y,t),e.notify(u.y,t)},this.grid.beforeBatchSave=function(t){e.trigger(u.B,t),e.notify(u.B,t)},this.grid.beforeBatchAdd=function(t){e.trigger(u.z,t),e.notify(u.z,t)},this.grid.batchDelete=function(t){e.trigger(u._0,t),e.notify(u._0,t)},this.grid.beforeBatchDelete=function(t){e.trigger(u.A,t),e.notify(u.A,t)},this.grid.batchCancel=function(t){"Cell"!==e.editSettings.mode&&e.trigger(u.p,t),e.notify(u.p,t)}},t.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())},t.prototype.bindedDataSource=function(){if(this.dataSource&&i.i(v.b)(this)){var e=this.flatData,t=i.i(r.getValue)("count",this.dataSource);this.grid.dataSource={result:e,count:t}}else this.grid.dataSource=this.dataSource instanceof y.DataManager?new y.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor):this.flatData;if(this.dataSource instanceof y.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)){this.grid.dataSource.dataSource.json=i.i(v.i)(this.dataSource.dataSource.json),this.grid.dataSource.ready=this.dataSource.ready;var n=this;i.i(r.isNullOrUndefined)(this.grid.dataSource.ready)||this.grid.dataSource.ready.then(function(e){var t=n.grid.dataSource;t.dataSource.offline=!0,t.isDataAvailable=!0,t.dataSource.json=e.result,t.adaptor=new y.JsonAdaptor})}},t.prototype.extendedGridActionEvents=function(){var e=this;this.grid.actionBegin=function(t){if("sorting"===t.requestType&&t.target&&t.target.parentElement&&t.target.parentElement.classList.contains("e-hierarchycheckbox")&&(t.cancel=!0),"reorder"===i.i(o.getObject)("requestType",t)&&e.notify("getColumnIndex",{}),i.i(v.a)(e)&&e.enableVirtualization&&("virtualscroll"===t.requestType?(e.query.expand("VirtualScrollingAction"),e.showSpinner()):"searching"===t.requestType&&""===t.searchString?e.query.expand("ClearSearchingAction"):"clearFilter"===t.action&&e.query.expand("ClearFilteringAction")),e.notify("actionBegin",{editAction:t}),i.i(v.a)(e)||i.i(r.isNullOrUndefined)(e.filterModule)||i.i(v.b)(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),i.i(r.isNullOrUndefined)(e.grid.changedProperties.dataSource)&&(e.grid.renderModule.data.dataManager=e.grid.dataSource instanceof y.DataManager?e.grid.dataSource:i.i(r.isNullOrUndefined)(e.grid.dataSource)?new y.DataManager:new y.DataManager(e.grid.dataSource),e.grid.renderModule.data.isQueryInvokedFromData=!0,e.grid.query=e.grid.query instanceof y.Query?e.grid.query:new y.Query)),"indenting"!==e.action&&"outdenting"!==e.action){var n=new y.Deferred;return e.trigger(u.v,t,function(t){t.cancel||e.notify(u.l,t),n.resolve(t)}),n}},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(u.m,t),"batchsave"===t.requestType&&e.notify(u.w,t),e.notify("updateGridActions",t),"save"===t.requestType&&e.aggregates.map(function(e){return!0===e.showChildSummary}).length&&e.grid.refresh(),"filter"===t.action&&(""===e.filterModule.currentFilterObject||!e.enableVirtualization||e.initialRender||i.i(v.a)(e)&&e.enableVirtualization||e.expandAll()),"searching"===t.requestType&&(""===e.searchSettings.key||!e.enableVirtualization||e.initialRender||i.i(v.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 r=[e.selectedRecords],n={data:r,dropIndex:e.dropIndex,dropPosition:e.dropPosition,modifiedRecords:e.modifiedRecords,requestType:e.action,row:e.selectedRows};e.trigger(u.h,n);e.getCurrentViewRecords().filter(function(e){return e.uniqueID===r[0].uniqueID}).length||e.refreshToolbarItems(),e.action="",e.selectedRecords=e.selectedRows=e.modifiedRecords=[]}else{if(e.grid.isFrozenGrid()&&e.enableVirtualization&&"movable"===t.tableName){var o=e.grid.element.querySelector("."+u._15),a=e.grid.element.querySelector("."+u._17);o.style.height=a.style.height="auto"}e.trigger(u.h,t)}}},t.prototype.extendedGridEvents=function(){var e=this,t=this;this.grid.recordDoubleClick=function(t){e.trigger(u.n,t),e.notify(u.n,t)},this.grid.detailDataBound=function(t){e.notify("detaildataBound",t),e.trigger(u._4,t)},this.grid.rowDataBound=function(e){i.i(r.isNullOrUndefined)(this.isPrinting)?i.i(r.setValue)("isPrinting",!1,e):i.i(r.setValue)("isPrinting",this.isPrinting,e),t.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){i.i(r.isNullOrUndefined)(this.isPrinting)?i.i(r.setValue)("isPrinting",!1,e):i.i(r.setValue)("isPrinting",this.isPrinting,e),t.renderModule.cellRender(e)},this.grid.contextMenuClick=function(t){e.notify(u.X,t),e.trigger(u.X,t)},this.grid.contextMenuOpen=function(t){e.notify(u.W,t),e.trigger(u.W,t)},this.grid.queryCellInfo=function(t){e.renderModule.cellRender(t)}},t.prototype.bindGridDragEvents=function(){var e=this;this.grid.rowDragStartHelper=function(t){e.trigger(u._6,t)},this.grid.rowDragStart=function(t){e.trigger(u._8,t)},this.grid.rowDrag=function(t){if(e.grid.isEdit)return void(t.cancel=!0);e.notify(u._11,t),e.trigger(u._5,t)},this.grid.rowDrop=function(t){if(e.grid.isEdit)return void(t.cancel=!0);e.notify(u._12,t),t.cancel=!0}},t.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),i.i(r.setValue)("registeredTemplate",this.registeredTemplate,this.grid);i.i(r.setValue)("viewContainerRef",this.viewContainerRef,this.grid)},t.prototype.autoGenerateColumns=function(){if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];for(var e=this.dataSource[0],t=Object.keys(e),i=0;i<t.length;i++)-1===[this.childMapping,this.parentIdMapping].indexOf(t[parseInt(i.toString(),10)])&&this.columns.push(t[parseInt(i.toString(),10)])}},t.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},t.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case w.b.AddRow:e.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 w.b.RowIndent:e.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 w.b.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},t.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new r.L10n("treegrid",this.defaultLocale,this.locale);for(var e=[],t=void 0,i=0;i<this.toolbar.length;i++)switch(this.toolbar[parseInt(i.toString(),10)]){case"Search":case w.a.Search:e.push("Search");break;case"Print":case w.a.Print:e.push("Print");break;case"ExpandAll":case w.a.ExpandAll:t=this.l10n.getConstant("ExpandAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case w.a.CollapseAll:t=this.l10n.getConstant("CollapseAll"),e.push({text:t,tooltipText:t,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case w.a.RowIndent:t=this.l10n.getConstant("RowIndent"),e.push({text:t,tooltipText:t,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case w.a.RowOutdent:t=this.l10n.getConstant("RowOutdent"),e.push({text:t,tooltipText:t,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(i.toString(),10)])}return e}return null},t.prototype.getGridColumns=function(e,t,o){void 0===t&&(t=!0),void 0===o&&(o=0);var a=e;t&&(this.columnModel=[]);var s,d;0===this.columnModel.length&&(o=0===o?-1:o);for(var l=[],p=0;p<a.length;p++){o+=1;var c=this.grid.getColumnByUid(a[parseInt(p.toString(),10)].uid);if(d=c||{},s={},"string"==typeof this.columns[parseInt(p.toString(),10)])d.field=s.field=this.columns[parseInt(p.toString(),10)];else for(var h=0,u=Object.keys(a[parseInt(p.toString(),10)]);h<u.length;h++){var g=u[h];o===this.treeColumnIndex&&"template"===g?s[""+g]=a[parseInt(p.toString(),10)][""+g]:"columns"!==g||i.i(r.isNullOrUndefined)(a[parseInt(p.toString(),10)][""+g])?this.initialRender&&!i.i(r.isNullOrUndefined)(c)&&this.enablePersistence&&"edit"===g?d[""+g]=s[""+g]=c[""+g]:c&&"sortComparer"===g||(d[""+g]=s[""+g]=a[parseInt(p.toString(),10)][""+g]):(d[""+g]=this.getGridColumns(a[parseInt(p.toString(),10)][""+g],!1,this.columnModel.length-1),s[""+g]=a[parseInt(p.toString(),10)][""+g])}s.columns||this.columnModel.push(new n.a(s)),l.push(d),!i.i(r.isNullOrUndefined)(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&d.field===this.columnModel[this.treeColumnIndex].field&&(i.i(r.isNullOrUndefined)(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),d.textAlign="Right")}return l},t.prototype.onPropertyChanged=function(e){for(var t=Object.keys(e),n=!1,a=0,s=t;a<s.length;a++){var d=s[a];switch(d){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=i.i(o.getActualProperties)(this.pageSettings),n=!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.i(o.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.i(o.getActualProperties)(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=i.i(o.getActualProperties)(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=i.i(o.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.i(o.getActualProperties)(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":if(this.isLocalData=!(this.dataSource instanceof y.DataManager)||!i.i(r.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof y.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData){if(i.i(v.b)(this)){var l=i.i(r.getValue)("count",this.dataSource);this.grid.dataSource={result:this.flatData,count:l}}else{var p=this.dataSource;this.grid.dataSource=p instanceof y.DataManager?new y.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.i(o.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;break;case"height":i.i(r.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":i.i(r.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"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":i.i(r.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.i(o.getActualProperties)(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=i.i(o.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.i(o.getActualProperties)(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=i.i(o.getActualProperties)(this.columnMenuItems);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()}n&&this.grid.refresh()}},t.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},t.prototype.destroy=function(){var t=this.element;if(t){var i=!(!t.querySelector(".e-gridheader")||!t.querySelector(".e-gridcontent"));i&&this.unwireEvents(),this.removeListener(),i&&e.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy();for(var r=["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<r.length;n++)this[r[parseInt(n.toString(),10)]]&&(this[r[parseInt(n.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},t.prototype.dataBind=function(){i.i(r.isNullOrUndefined)(this.grid)||(!i.i(r.isNullOrUndefined)(this.rowDropSettings.targetID)&&i.i(r.isNullOrUndefined)(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),e.prototype.dataBind.call(this),this.grid.dataBind())},t.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex"],t={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},n=["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],o=0;o<e.length;o++)for(var a=this[e[parseInt(o.toString(),10)]],s=0,d=t[e[parseInt(o.toString(),10)]];!i.i(r.isNullOrUndefined)(d)&&s<d.length;s++){var l=d[parseInt(s.toString(),10)];delete a[""+l]}return this.ignoreInArrays(n,this.columns),this.addOnPersist(e)},t.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)])},t.prototype.ignoreInColumn=function(e,t){if(i.i(r.isNullOrUndefined)(t.template))for(var n=0;n<e.length;n++)delete t[e[parseInt(n.toString(),10)]],t.filter={}},t.prototype.mouseClickHandler=function(e){if(i.i(r.isNullOrUndefined)(e.touches)){var t=e.target;!t.classList.contains("e-treegridexpand")&&!t.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(t);if((t.classList.contains("e-treegridexpand")||t.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:t}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length){var n=this.grid.getHeaderContent().querySelector(".e-checkselectall");if(this.grid.getSelectedRowIndexes().length===this.getCurrentViewRecords().length){var o=n.nextElementSibling;i.i(r.removeClass)([o],["e-stop","e-uncheck"]),i.i(r.addClass)([o],["e-check"])}}}},t.prototype.getRows=function(){return this.grid.getRows()},t.prototype.getPager=function(){return this.grid.getPager()},t.prototype.addRecord=function(e,t,i){if(this.editModule){this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i)}},t.prototype.closeEdit=function(){this.grid.editModule&&this.grid.editModule.closeEdit()},t.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},t.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},t.prototype.updateRow=function(e,t){if(this.grid.editModule)if(i.i(r.isNullOrUndefined)(e))this.grid.editModule.updateRow(e,t);else{var n=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)];i.i(r.extend)(n,t),this.grid.editModule.updateRow(e,n)}},t.prototype.deleteRecord=function(e,t){this.grid.editModule&&this.grid.editModule.deleteRecord(e,t)},t.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},t.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},t.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},t.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},t.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},t.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},t.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},t.prototype.setCellValue=function(e,t,n){this.grid.setCellValue(e,t,n);var o=this.grid.getRowIndexByPrimaryKey(e),a=this.getCurrentViewRecords()[parseInt(o.toString(),10)];i.i(r.isNullOrUndefined)(a)||i.i(D.a)({value:a,action:"edit"},this,this.isSelfReference,a.index,this.grid.selectedRowIndex,t)},t.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(),d=s.scrollHeight,l=this.getContent().clientHeight;this.lastRowBorder(this.getRows()[i.indexOf(o)],d<=l)}},t.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},t.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},t.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},t.prototype.getColumnByField=function(e){return i.i(o.iterateArrayOrObject)(this.columnModel,function(t){if(t.field===e)return t})[0]},t.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.i(o.iterateArrayOrObject)(t,function(t){if(t.uid===e)return t})[0]},t.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},t.prototype.getFooterContent=function(){return this.grid.getFooterContent()},t.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},t.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},t.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},t.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},t.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},t.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},t.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},t.prototype.getVirtualColIndexByUid=function(e){var t=i.i(o.iterateArrayOrObject)(this.grid.columnModel,function(t,i){if(t.uid===e)return i})[0];return i.i(r.isNullOrUndefined)(t)?-1:t},t.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},t.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},t.prototype.updateColumnModel=function(e){var t,o,a=i.i(r.isNullOrUndefined)(e)?this.grid.getColumns():e;-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!i.i(r.isNullOrUndefined)(this.columnModel[this.treeColumnIndex].template)&&(t=this.columnModel[this.treeColumnIndex].template,o=this.columnModel[this.treeColumnIndex].field);var s;if(!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===a.length){this.columnModel=[];for(var d=0;d<a.length;d++){s={};for(var l=0,p=Object.keys(a[parseInt(d.toString(),10)]);l<p.length;l++){var c=p[l];s[""+c]=a[parseInt(d.toString(),10)][""+c]}this.columnModel.push(new n.a(s)),o!==this.columnModel[parseInt(d.toString(),10)].field||"checkbox"===this.columnModel[parseInt(d.toString(),10)].type||i.i(r.isNullOrUndefined)(t)||""===t||(this.columnModel[parseInt(d.toString(),10)].template=t)}}return this.deepMerge=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&this.allowResizing&&this.updateColumnsWidth(this.columns),this.stackedHeader||i.i(r.merge)(this.columns,this.columnModel),this.deepMerge=void 0,this.columnModel},t.prototype.updateColumnsWidth=function(e){var t=this;e.forEach(function(e){if(e.columns)t.updateColumnsWidth(e.columns);else if(e.field){var n=t.grid.getColumnByField(e.field);i.i(r.isNullOrUndefined)(n)||(e.width=n.width)}})},t.prototype.getContent=function(){return this.grid.getContent()},t.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},t.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},t.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this.grid)},t.prototype.splitFrozenCount=function(e){this.grid.splitFrozenCount.apply(this.grid,[e])},t.prototype.isFrozenGrid=function(){return this.grid.isFrozenGrid()},t.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:i.i(o.getObject)("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:i.i(o.getObject)("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:i.i(o.getObject)("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:i.i(o.getObject)("properties",this.grid.sortSettings)},!0)},t.prototype.getContentTable=function(){return this.grid.getContentTable()},t.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},t.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return i.i(r.isNullOrUndefined)(e.isSummaryRow)})},t.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},t.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},t.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},t.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},t.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},t.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},t.prototype.getVisibleColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var r=i[t];r.visible&&e.push(r)}return e},t.prototype.showSpinner=function(){i.i(m.showSpinner)(this.element)},t.prototype.hideSpinner=function(){i.i(m.hideSpinner)(this.element)},t.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),i.i(v.b)(this)||(this.dataSource instanceof y.DataManager?this.grid.setProperties({dataSource:new y.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},t.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},t.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var r=0;r<t.length;r++)e.push(t[parseInt(r.toString(),10)]),t[parseInt(r.toString(),10)].expanded||(r+=i.i(v.g)(t[parseInt(r.toString(),10)]).length);return e},t.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},t.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},t.prototype.refreshColumns=function(e){i.i(r.isNullOrUndefined)(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},t.prototype.refreshHeader=function(){this.grid.refreshHeader()},t.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)}},t.prototype.expandRow=function(e,t,n,o){var a=this,s=this.parentData;if(this.enableVirtualization||(s=this.flatData.filter(function(e){return e.hasChildRecords})),t=this.getCollapseExpandRecords(e,t),!i.i(r.isNullOrUndefined)(e)&&e.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(e,!1),this.isExpandAll&&!i.i(v.a)(this)){var d={data:s,row:e,cancel:!1},l=!1;this.grid.pagerModule&&!i.i(r.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,t,s,n,o):this.trigger(u.R,d,function(d){a.expandAllPrevent=d.cancel,d.cancel||i.i(r.isNullOrUndefined)(t)||(d.expandAll&&a.expandCollapseAllChildren(t,"expand",n,o),a.expandRows(e,t,s,n,o))}),this.isExpandingEventTriggered=!0}else if(!this.isExpandAll||this.isExpandAll&&i.i(v.a)(this)){var d={data:t,row:e,cancel:!1};this.trigger(u.R,d,function(i){i.cancel||(i.expandAll&&a.expandCollapseAllChildren(t,"expand",n,o),a.expandRows(e,t,s,n,o))})}},t.prototype.expandRows=function(e,t,n,o,a){this.expandCollapse("expand",e,t);if((!i.i(v.a)(this)||i.i(v.h)(this))&&(!i.i(v.b)(this)||!i.i(r.isNullOrUndefined)(t.Children))){var s={data:t,row:e};i.i(r.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(s.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,s={data:n,row:e},this.trigger(u.Q,s)):this.isExpandAll||this.trigger(u.Q,s)}},t.prototype.expandCollapseAllChildren=function(e,t,n,o){if((i.i(r.isNullOrUndefined)(n)||e[this.getPrimaryKeyFieldNames()[0]]===n)&&(i.i(r.isNullOrUndefined)(o)||o===e.level)){var a=i.i(v.g)(e).filter(function(e){return e.hasChildRecords});a.unshift(e);for(var s=0;s<a.length;s++)this.expandCollapse(t,null,a[parseInt(s.toString(),10)])}},t.prototype.getCollapseExpandRecords=function(e,t){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&i.i(r.isNullOrUndefined)(t)&&!i.i(v.a)(this)?t=this.flatData.filter(function(e){return e.hasChildRecords}):i.i(r.isNullOrUndefined)(t)&&(t=this.detailTemplate?this.grid.getCurrentViewRecords()[e.getAttribute("data-rowindex")]:this.enableVirtualization&&this.isCollapseAll?this.isExpandAll&&-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("data-rowindex"),10)]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("data-rowindex"),10)]),t},t.prototype.collapseRow=function(e,t,n){var o=this,a=this.parentData;if(this.enableVirtualization||(a=this.flatData.filter(function(e){return e.hasChildRecords})),t=this.getCollapseExpandRecords(e,t),this.isCollapseAll&&!i.i(v.a)(this)){var s={data:a,row:e,cancel:!1};this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(e,t,a,n):this.trigger(u.T,s,function(i){o.collapseAllPrevent=i.cancel,i.cancel||(i.collapseAll&&o.expandCollapseAllChildren(t,"collapse",n),o.collapseRows(e,t,a,n))}),this.isCollapsingEventTriggered=!0}else if(!this.isCollapseAll||this.isCollapseAll&&i.i(v.a)(this)){var s={data:t,row:e,cancel:!1};this.trigger(u.T,s,function(s){s.cancel||i.i(r.isNullOrUndefined)(t)||o.collapseRows(e,t,a,n)})}},t.prototype.collapseRows=function(e,t,n,o){this.expandCollapse("collapse",e,t);var a={data:t,row:e};if(!i.i(v.a)(this)&&(i.i(r.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(a.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,a={data:n,row:e},this.trigger(u.S,a)):this.isCollapseAll||this.trigger(u.S,a),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())}},t.prototype.updateExpandStateMapping=function(e,t){var r=e;if(r.length)for(var n=0;n<r.length;n++)r[parseInt(n.toString(),10)][this.expandStateMapping]=t,i.i(D.a)({value:r[parseInt(n.toString(),10)],action:"edit"},this,this.isSelfReference,r[parseInt(n.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,i.i(D.a)({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},t.prototype.expandAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!i.i(v.a)(this)){var 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.i(o.getObject)("records",t);this.expandAction(r,null,e)}},t.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},t.prototype.expandAction=function(e,t,n,o){void 0===o&&(o=!1);for(var a=this,s=0;s<e.length;s++)!function(s){if(!i.i(r.isNullOrUndefined)(e[parseInt(s.toString(),10)].parentItem)){var d=e[parseInt(s.toString(),10)].parentItem.uniqueID,l=a.flatData.filter(function(e){return e.uniqueID===d});i.i(v.a)(a)&&(l=a.getCurrentViewRecords().filter(function(e){return e.uniqueID===d})),!1===l[0].expanded?(e.push(l[0]),l[0].expanded=!0):i.i(v.f)(a,l[0],a.parentData)||l[0].expanded&&void 0!==l[0].parentItem&&e.push(l[0])}o||a.expandRow(null,e[parseInt(s.toString(),10)],t,n)}(s);o&&this.expandRow(null,e,t,n)},t.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}},t.prototype.collapseAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!i.i(v.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.i(o.getObject)("records",r);this.collapseAction(n)}},t.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},t.prototype.expandCollapseActionByKey=function(e,t){var n=this.getPrimaryKeyFieldNames()[0],o=i.i(v.a)(this)?this.getCurrentViewRecords():this.grid.dataSource;if(!i.i(r.isNullOrUndefined)(n)){var a=o.filter(function(t){return t[""+n].toString()===e.toString()});"Expand"===t?this.expandAction(a,e,null):this.collapseAction(a,e)}},t.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}},t.prototype.expandAll=function(){this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,this.expandCollapseAll("expand")},t.prototype.collapseAll=function(){this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,this.expandCollapseAll("collapse")},t.prototype.expandCollapseAll=function(e){var t;if(t=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"))}),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization||this.enableInfiniteScrolling)&&!i.i(v.a)(this)){if(this.flatData.filter(function(t){t.hasChildRecords&&(t.expanded="collapse"!==e)}),t.length)for(var n=0;n<t.length;n++)"collapse"===e?i.i(r.isNullOrUndefined)(this.getCurrentViewRecords()[t[parseInt(n.toString(),10)].rowIndex])||this.collapseRow(t[parseInt(n.toString(),10)]):this.enableVirtualization?"true"!==t[0].getAttribute("aria-expanded")&&this.expandRow(t[0]):this.expandRow(t[parseInt(n.toString(),10)]);else if(this.allowPaging){var o=this.enableCollapseAll;this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:o},!0)}}else for(var n=0;n<t.length;n++)"collapse"===e?this.collapseRow(t[parseInt(n.toString(),10)]):this.expandRow(t[parseInt(n.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},t.prototype.expandCollapse=function(e,t,n,o){var a,s=this,d={row:t,data:n,childData:[],requestType:e},l=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===n.uniqueID});(!i.i(v.a)(this)&&"expand"===e&&this.isSelfReference&&i.i(v.b)(this)&&!l.length||"collapse"===e||this.isExpandAll&&this.loadChildOnDemand&&!i.i(v.a)(this)&&this.isSelfReference&&i.i(v.b)(this))&&this.updateChildOnDemand(d);var p=this.getRows();if(this.rowTemplate){var c=this.getContentTable().rows;p=[].slice.call(c)}var h;if(i.i(r.isNullOrUndefined)(t)?(h=this.grid.currentViewData.indexOf(n),t=p[parseInt(h.toString(),10)]):h=+t.getAttribute("data-rowindex"),i.i(r.isNullOrUndefined)(t)||t.setAttribute("aria-expanded","expand"===e?"true":"false"),!(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)||i.i(v.a)(this)||i.i(v.b)(this)){var g=void 0;if("expand"===e){if(g="table-row",o||(n.expanded=!0,this.uniqueIDCollection[n.uniqueID].expanded=n.expanded),i.i(r.isNullOrUndefined)(t)||(a=t.getElementsByClassName("e-treegridcollapse")[0]),o&&!i.i(r.isNullOrUndefined)(n[this.expandStateMapping])&&n[this.expandStateMapping]&&i.i(r.isNullOrUndefined)(a)&&(a=t.getElementsByClassName("e-treegridexpand")[0]),i.i(r.isNullOrUndefined)(a))return;a.classList.contains("e-treegridexpand")||i.i(r.addClass)([a],"e-treegridexpand"),i.i(r.removeClass)([a],"e-treegridcollapse")}else{if(g="none",o&&!i.i(v.b)(this)||(n.expanded=!1,this.uniqueIDCollection[n.uniqueID].expanded=n.expanded),i.i(r.isNullOrUndefined)(t)||(a=t.getElementsByClassName("e-treegridexpand")[0]),o&&!i.i(r.isNullOrUndefined)(n[this.expandStateMapping])&&!n[this.expandStateMapping]&&i.i(r.isNullOrUndefined)(a)&&(a=t.getElementsByClassName("e-treegridcollapse")[0]),i.i(r.isNullOrUndefined)(a))return;a.classList.contains("e-treegridcollapse")||i.i(r.addClass)([a],"e-treegridcollapse"),i.i(r.removeClass)([a],"e-treegridexpand")}t.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");var f=p.filter(function(e){return e.classList.contains("e-griddetailrowindex"+n.index+"level"+(n.level+1))});if(i.i(v.a)(this)&&!i.i(v.h)(this))this.remoteExpand(e,t,n);else{i.i(v.b)(this)&&!l.length&&"collapse"!==e||this.localExpand(e,t,n);var y=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,m=this.getRowByIndex(y);this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!i.i(r.isNullOrUndefined)(m)&&!m.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(m,!0)}if(i.i(v.b)(this)&&"expand"===e){var S=this.getCurrentViewRecords(),I=S.filter(function(e){return i.i(v.f)(s,e,s.parentData)});this.dataResults.result=I}if(!i.i(r.isNullOrUndefined)(a)&&a.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(a.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),a.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!t.cells[0].classList.contains("e-lastrowcell")){var w=this.getRows(),c=this.getContentTable().rows;w=[].slice.call(c);for(var R=w.length-1;R>=0;R--)if(!i.i(v.l)(w[parseInt(R.toString(),10)])){var x=this.getContentTable(),C=x.scrollHeight,b=this.getContent().clientHeight;this.lastRowBorder(w[parseInt(R.toString(),10)],C<=b);break}}this.notify("rowExpandCollapse",{detailrows:f,action:g,record:n,row:t}),this.updateAltRow(p)}else this.notify(u.b,{action:e,row:t,record:n})},t.prototype.updateChildOnDemand=function(e){var t=this;if("collapse"===e.requestType&&i.i(v.b)(this)){for(var n=this.flatData.slice(),a=0;a<n.length;a++)n[parseInt(a.toString(),10)].parentUniqueID===e.data.uniqueID&&(n.splice(a,1),a-=1);return void(this.dataResults.result=n)}var s=new y.Deferred;e.childDataBind=s.resolve;var d=e.data;this.trigger(u.N,e),s.promise.then(function(){if(e.childData.length){i.i(v.b)(t)&&(t.flatData=t.dataResults.result),t.enableInfiniteScrolling&&i.i(v.b)(t)&&(t.flatData=t.infiniteScrollData);for(var n=t.flatData,a=0,s=0;s<n.length;s++)if(n[parseInt(s.toString(),10)].taskData===d.taskData){a=s;break}for(var l=i.i(r.getValue)("result",t.dataSource),p=i.i(v.i)(e.childData),c=d[t.childMapping]&&d[t.childMapping].length>p.length?d[t.childMapping].length:p.length,s=0;s<c;s++)d[t.childMapping]&&l.filter(function(e,i){e[t.parentIdMapping]===d[t.idMapping]&&l.splice(i,1)}),p[parseInt(s.toString(),10)]?(p[parseInt(s.toString(),10)].level=d.level+1,p[parseInt(s.toString(),10)].index=Math.ceil(1e3*Math.random()),p[parseInt(s.toString(),10)].parentItem=i.i(r.extend)({},d),p[parseInt(s.toString(),10)].taskData=i.i(r.extend)({},p[parseInt(s.toString(),10)]),delete p[parseInt(s.toString(),10)].parentItem.childRecords,delete p[parseInt(s.toString(),10)].taskData.parentItem,p[parseInt(s.toString(),10)].parentUniqueID=d.uniqueID,p[parseInt(s.toString(),10)].uniqueID=i.i(o.getUid)(t.element.id+"_data_"),i.i(r.setValue)("uniqueIDCollection."+p[parseInt(s.toString(),10)].uniqueID,p[parseInt(s.toString(),10)],t),(!i.i(r.isNullOrUndefined)(p[parseInt(s.toString(),10)][t.childMapping])||p[parseInt(s.toString(),10)][t.hasChildMapping]&&i.i(v.b)(t))&&(p[parseInt(s.toString(),10)].hasChildRecords=!0),i.i(v.b)(t)&&d[t.childMapping]&&d[t.childMapping][parseInt(s.toString(),10)]?n.splice(a+1+s,0,p[parseInt(s.toString(),10)]):n.splice(a+1+s,d[t.childMapping]&&d[t.childMapping][parseInt(s.toString(),10)]?1:0,p[parseInt(s.toString(),10)])):n.splice(a+1+s,1);n[parseInt(a.toString(),10)][""+t.childMapping]=p,n[parseInt(a.toString(),10)].childRecords=p,n[parseInt(a.toString(),10)].expanded=!0,i.i(r.setValue)("uniqueIDCollection."+n[parseInt(a.toString(),10)].uniqueID,n[parseInt(a.toString(),10)],t);for(var h=0;h<e.childData.length;h++)l.push(e.childData[parseInt(h.toString(),10)])}i.i(v.b)(t)&&t.loadChildOnDemand&&"expand"===e.requestType&&(t.dataResults.expandRecord={},t.dataResults.expandRecord=e.data),t.isExpandRefresh=!0;var g=t.getContentTable().parentElement.scrollTop;t.grid.refresh(),t.enableInfiniteScrolling&&(t.getContentTable().parentElement.scrollTop=g),t.trigger(u.Q,e)})},t.prototype.remoteExpand=function(e,t,i){var r=this.getRows();if(this.rowTemplate){var n=this.getContentTable().rows;r=[].slice.call(n)}var o={data:i,row:t},a=[];if(a=r.filter(function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))||e.querySelector(".e-gridrowindex"+i.index+"level0.e-summarycell")}),"expand"===e){this.notify(u.U,{record:i,rows:a,parentRow:t});var s={row:t,data:i};a.length>0&&this.trigger(u.Q,s)}else"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:o.data,rows:null,parentRow:o.row}):(this.collapseRemoteChild({record:i,rows:a}),this.trigger(u.S,o))},t.prototype.localExpand=function(e,t,n){var o,a=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===n.uniqueID});this.isPixelHeight()&&t.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(t,!1);var s,d,l=this.getRows();if(this.rowTemplate){var p=this.getContentTable().rows;l=[].slice.call(p)}var c="expand"===e?"table-row":"none",h=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging){o=[];for(var u=0;u<a.length;u++){var g=this.grid.getRowIndexByPrimaryKey(a[parseInt(u.toString(),10)][""+h]);o.push(this.getRows()[parseInt(g.toString(),10)])}}else o=l.filter(function(e){return e.querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))});var f=this.grid.getFrozenLeftColumnsCount()>0||this.grid.getFrozenRightColumnsCount()>0;(this.frozenRows||this.frozenColumns||this.getFrozenColumns()||f)&&(s=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))})),f&&(d=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))}));var y=this.grid.getRowsObject(),m=this.grid.currentViewData,S=m.filter(function(e){return e.uniqueID===n.uniqueID}),I=m.indexOf(S[0]);i.i(r.isNullOrUndefined)(y[parseInt(I.toString(),10)].visible)||!1===y[parseInt(I.toString(),10)].visible||(y[parseInt(I.toString(),10)].visible=!0);for(var w=l.filter(function(e){return e.classList.contains("e-griddetailrowindex"+n.index+"level"+(n.level+1))}),u=0;u<o.length;u++){if(i.i(r.isNullOrUndefined)(o[parseInt(u.toString(),10)])||(o[parseInt(u.toString(),10)].style.display=c),!i.i(r.isNullOrUndefined)(o[parseInt(u.toString(),10)])&&!this.allowPaging&&!(this.enableVirtualization||this.enableInfiniteScrolling||i.i(v.a)(this)||i.i(v.b)(this))){y[o[parseInt(u.toString(),10)].rowIndex].visible="none"!==c;var R=m.filter(function(e){return e.uniqueID===S[0].parentUniqueID});!i.i(r.isNullOrUndefined)(R[0])&&l[m.indexOf(R[0])].getElementsByClassName("e-treegridcollapse").length&&(y[parseInt(I.toString(),10)].visible=!1)}i.i(r.isNullOrUndefined)(s)||(s[parseInt(u.toString(),10)].style.display=c),i.i(r.isNullOrUndefined)(d)||(d[parseInt(u.toString(),10)].style.display=c),this.notify("childRowExpand",{row:o[parseInt(u.toString(),10)]}),!i.i(r.isNullOrUndefined)(a[parseInt(u.toString(),10)].childRecords)&&a[parseInt(u.toString(),10)].childRecords.length>0&&("expand"!==e||i.i(r.isNullOrUndefined)(a[parseInt(u.toString(),10)].expanded)||a[parseInt(u.toString(),10)].expanded)&&(this.expandCollapse(e,o[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex&&!i.i(r.isNullOrUndefined)(s)&&this.expandCollapse(e,s[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],!0))}for(var u=0;u<w.length;u++)i.i(r.isNullOrUndefined)(w[parseInt(u.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||i.i(v.a)(this)||i.i(v.b)(this)||(y[w[parseInt(u.toString(),10)].rowIndex].visible="none"!==c,w[parseInt(u.toString(),10)].style.display=c);this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||i.i(v.a)(this)||i.i(v.b)(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},t.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var t=0,n=0;e&&n<e.length;n++){var o=e[parseInt(n.toString(),10)];"none"!==o.style.display&&(o.classList.contains("e-altrow")&&i.i(r.removeClass)([o],"e-altrow"),t%2==0||o.classList.contains("e-summaryrow")||o.classList.contains("e-detailrow")||i.i(r.addClass)([o],"e-altrow"),o.classList.contains("e-summaryrow")||o.classList.contains("e-detailrow")||t++)}},t.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=0!==t.length?t[parseInt(i.toString(),10)].data:new Object,a={data:o,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(a)}},t.prototype.collapseRemoteChild=function(e,t){i.i(r.isNullOrUndefined)(t)||t||this.loadChildOnDemand||(e.record.expanded=!1);var n,o,a=e.rows,s=[],d=[],l=this.getFrozenLeftColumnsCount()>0||this.getFrozenRightColumnsCount()>0;l&&(s=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}),d=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}));for(var p=0;p<a.length;p++){a[parseInt(p.toString(),10)].style.display="none",n=a[parseInt(p.toString(),10)];var c=a[parseInt(p.toString(),10)].querySelector(".e-detailrowexpand");if(i.i(r.isNullOrUndefined)(c)||this.grid.detailRowModule.collapse(c),l&&(s[parseInt(p.toString(),10)].style.display="none",d[parseInt(p.toString(),10)].style.display="none",a[parseInt(p.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(s[parseInt(p.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?n=s[parseInt(p.toString(),10)]:d[parseInt(p.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(n=d[parseInt(p.toString(),10)]))),n.querySelector(".e-treecolumn-container .e-treegridexpand")){var h=n.querySelector(".e-treecolumn-container .e-treegridexpand");o=this.rowTemplate?this.grid.getCurrentViewRecords()[a[parseInt(p.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(a[parseInt(p.toString(),10)].getAttribute("data-Uid")).data,!i.i(r.isNullOrUndefined)(h)&&o.expanded&&(i.i(r.removeClass)([h],"e-treegridexpand"),i.i(r.addClass)([h],"e-treegridcollapse"));for(var u=[],g=this.getRows(),f=0;f<g.length;f++)g[parseInt(f.toString(),10)].querySelector(".e-gridrowindex"+o.index+"level"+(o.level+1))&&u.push(g[parseInt(f.toString(),10)]);u.length&&o.expanded&&this.collapseRemoteChild({record:o,rows:u},!1)}}},t.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?r.SanitizeHtmlHelper.sanitize(e):e},t.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.grid.getColumns()[this.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.action&&"outdenting"!==this.action||this.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},t.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this)},t.prototype.updateResultModel=function(e){this.dataResults=e},t.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender))},t.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},t.prototype.clearFiltering=function(){this.grid.clearFiltering()},t.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},t.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},t.prototype.selectRows=function(e){this.grid.selectRows(e)},t.prototype.clearSelection=function(){this.grid.clearSelection()},t.prototype.copy=function(e){this.clipboardModule.copy(e)},t.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},t.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},t.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},t.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},t.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},t.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},t.prototype.getMovableRows=function(){return this.grid.getRows()},t.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},t.prototype.getFrozenRightRows=function(){return this.grid.getRows()},t.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},t.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},t.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},t.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},t.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},t.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},t.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},t.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},t.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},t.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},t.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},t.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},t.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},t.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},t.prototype.getFrozenColumns=function(){return this.getFrozenCount(this.columns,0)+this.frozenColumns},t.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},t.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},t.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},t.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},t.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},t.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},t.prototype.indent=function(e){i.i(r.isNullOrUndefined)(this.rowDragAndDropModule)||(e=e,this.rowDragAndDropModule[this.indentOutdentAction](e,"indent"))},t.prototype.outdent=function(e){i.i(r.isNullOrUndefined)(this.rowDragAndDropModule)||(e=e,this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent"))};var E;return P([i.i(r.Property)(0)],t.prototype,"frozenRows",void 0),P([i.i(r.Property)(0)],t.prototype,"frozenColumns",void 0),P([i.i(r.Property)("Ellipsis")],t.prototype,"clipMode",void 0),P([i.i(r.Property)([])],t.prototype,"columns",void 0),P([i.i(r.Property)(null)],t.prototype,"childMapping",void 0),P([i.i(r.Property)(null)],t.prototype,"hasChildMapping",void 0),P([i.i(r.Property)(0)],t.prototype,"treeColumnIndex",void 0),P([i.i(r.Property)(null)],t.prototype,"idMapping",void 0),P([i.i(r.Property)(null)],t.prototype,"parentIdMapping",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableCollapseAll",void 0),P([i.i(r.Property)(null)],t.prototype,"expandStateMapping",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowRowDragAndDrop",void 0),P([i.i(r.Property)([])],t.prototype,"dataSource",void 0),P([i.i(r.Property)()],t.prototype,"query",void 0),P([i.i(r.Property)()],t.prototype,"cloneQuery",void 0),P([i.i(r.Property)("AllPages")],t.prototype,"printMode",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowPaging",void 0),P([i.i(r.Property)(!1)],t.prototype,"loadChildOnDemand",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowTextWrap",void 0),P([i.i(r.Complex)({},d.a)],t.prototype,"textWrapSettings",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowReordering",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowResizing",void 0),P([i.i(r.Property)(!1)],t.prototype,"autoCheckHierarchy",void 0),P([i.i(r.Complex)({},R.a)],t.prototype,"pageSettings",void 0),P([i.i(r.Complex)({},o.RowDropSettings)],t.prototype,"rowDropSettings",void 0),P([i.i(r.Property)("USD")],t.prototype,"currencyCode",void 0),P([i.i(r.Property)()],t.prototype,"pagerTemplate",void 0),P([i.i(r.Property)(!1)],t.prototype,"showColumnMenu",void 0),P([i.i(r.Property)(!1)],t.prototype,"showColumnChooser",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowSorting",void 0),P([i.i(r.Property)(!0)],t.prototype,"allowMultiSorting",void 0),P([i.i(r.Complex)({},b.b)],t.prototype,"sortSettings",void 0),P([i.i(r.Collection)([],x.b)],t.prototype,"aggregates",void 0),P([i.i(r.Complex)({},C.a)],t.prototype,"editSettings",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowFiltering",void 0),P([i.i(r.Property)()],t.prototype,"detailTemplate",void 0),P([i.i(r.Complex)({},s.b)],t.prototype,"filterSettings",void 0),P([i.i(r.Complex)({},g.a)],t.prototype,"searchSettings",void 0),P([i.i(r.Property)()],t.prototype,"toolbar",void 0),P([i.i(r.Property)()],t.prototype,"toolbarTemplate",void 0),P([i.i(r.Property)("Default")],t.prototype,"gridLines",void 0),P([i.i(r.Property)()],t.prototype,"contextMenuItems",void 0),P([i.i(r.Property)()],t.prototype,"columnMenuItems",void 0),P([i.i(r.Property)()],t.prototype,"rowTemplate",void 0),P([i.i(r.Property)("Parent")],t.prototype,"copyHierarchyMode",void 0),P([i.i(r.Property)(null)],t.prototype,"rowHeight",void 0),P([i.i(r.Property)(!0)],t.prototype,"enableAltRow",void 0),P([i.i(r.Property)(!0)],t.prototype,"allowKeyboard",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableHover",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableAutoFill",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableAdaptiveUI",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableImmutableMode",void 0),P([i.i(r.Property)("auto")],t.prototype,"height",void 0),P([i.i(r.Property)("auto")],t.prototype,"width",void 0),P([i.i(r.Complex)({},a.a)],t.prototype,"loadingIndicator",void 0),P([i.i(r.Property)(!0)],t.prototype,"enableVirtualMaskRow",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableVirtualization",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableColumnVirtualization",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableHtmlSanitizer",void 0),P([i.i(r.Property)(!1)],t.prototype,"enableInfiniteScrolling",void 0),P([i.i(r.Complex)({},M.a)],t.prototype,"infiniteScrollSettings",void 0),P([i.i(r.Property)("All")],t.prototype,"columnQueryMode",void 0),P([i.i(r.Event)()],t.prototype,"created",void 0),P([i.i(r.Event)()],t.prototype,"load",void 0),P([i.i(r.Event)()],t.prototype,"expanding",void 0),P([i.i(r.Event)()],t.prototype,"expanded",void 0),P([i.i(r.Event)()],t.prototype,"collapsing",void 0),P([i.i(r.Event)()],t.prototype,"collapsed",void 0),P([i.i(r.Event)()],t.prototype,"cellSave",void 0),P([i.i(r.Event)()],t.prototype,"cellSaved",void 0),P([i.i(r.Event)()],t.prototype,"actionBegin",void 0),P([i.i(r.Event)()],t.prototype,"actionComplete",void 0),P([i.i(r.Event)()],t.prototype,"beginEdit",void 0),P([i.i(r.Event)()],t.prototype,"batchAdd",void 0),P([i.i(r.Event)()],t.prototype,"batchDelete",void 0),P([i.i(r.Event)()],t.prototype,"batchCancel",void 0),P([i.i(r.Event)()],t.prototype,"beforeBatchAdd",void 0),P([i.i(r.Event)()],t.prototype,"beforeBatchDelete",void 0),P([i.i(r.Event)()],t.prototype,"beforeBatchSave",void 0),P([i.i(r.Event)()],t.prototype,"cellEdit",void 0),P([i.i(r.Event)()],t.prototype,"actionFailure",void 0),P([i.i(r.Event)()],t.prototype,"dataBound",void 0),P([i.i(r.Event)()],t.prototype,"dataSourceChanged",void 0),P([i.i(r.Event)()],t.prototype,"dataStateChange",void 0),P([i.i(r.Event)()],t.prototype,"recordDoubleClick",void 0),P([i.i(r.Event)()],t.prototype,"rowDataBound",void 0),P([i.i(r.Event)()],t.prototype,"detailDataBound",void 0),P([i.i(r.Event)()],t.prototype,"queryCellInfo",void 0),P([i.i(r.Property)(!0)],t.prototype,"allowSelection",void 0),P([i.i(r.Event)()],t.prototype,"rowSelecting",void 0),P([i.i(r.Event)()],t.prototype,"rowSelected",void 0),P([i.i(r.Event)()],t.prototype,"rowDeselecting",void 0),P([i.i(r.Event)()],t.prototype,"rowDeselected",void 0),P([i.i(r.Event)()],t.prototype,"headerCellInfo",void 0),P([i.i(r.Event)()],t.prototype,"cellSelecting",void 0),P([i.i(r.Event)()],t.prototype,"columnMenuOpen",void 0),P([i.i(r.Event)()],t.prototype,"columnMenuClick",void 0),P([i.i(r.Event)()],t.prototype,"cellSelected",void 0),P([i.i(r.Event)()],t.prototype,"cellDeselecting",void 0),P([i.i(r.Event)()],t.prototype,"cellDeselected",void 0),P([i.i(r.Event)()],t.prototype,"resizeStart",void 0),P([i.i(r.Event)()],t.prototype,"resizing",void 0),P([i.i(r.Event)()],t.prototype,"resizeStop",void 0),P([i.i(r.Event)()],t.prototype,"columnDragStart",void 0),P([i.i(r.Event)()],t.prototype,"columnDrag",void 0),P([i.i(r.Event)()],t.prototype,"columnDrop",void 0),P([i.i(r.Event)()],t.prototype,"checkboxChange",void 0),P([i.i(r.Event)()],t.prototype,"printComplete",void 0),P([i.i(r.Event)()],t.prototype,"beforePrint",void 0),P([i.i(r.Event)()],t.prototype,"toolbarClick",void 0),P([i.i(r.Event)()],t.prototype,"beforeDataBound",void 0),P([i.i(r.Event)()],t.prototype,"contextMenuOpen",void 0),P([i.i(r.Event)()],t.prototype,"contextMenuClick",void 0),P([i.i(r.Event)()],t.prototype,"beforeCopy",void 0),P([i.i(r.Event)()],t.prototype,"beforePaste",void 0),P([i.i(r.Event)()],t.prototype,"rowDrag",void 0),P([i.i(r.Event)()],t.prototype,"rowDragStart",void 0),P([i.i(r.Event)()],t.prototype,"rowDragStartHelper",void 0),P([i.i(r.Event)()],t.prototype,"rowDrop",void 0),P([i.i(r.Property)(-1)],t.prototype,"selectedRowIndex",void 0),P([i.i(r.Complex)({},f.a)],t.prototype,"selectionSettings",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowExcelExport",void 0),P([i.i(r.Property)(!1)],t.prototype,"allowPdfExport",void 0),P([i.i(r.Event)()],t.prototype,"pdfQueryCellInfo",void 0),P([i.i(r.Event)()],t.prototype,"pdfHeaderQueryCellInfo",void 0),P([i.i(r.Event)()],t.prototype,"excelQueryCellInfo",void 0),P([i.i(r.Event)()],t.prototype,"excelHeaderQueryCellInfo",void 0),P([i.i(r.Event)()],t.prototype,"beforeExcelExport",void 0),P([i.i(r.Event)()],t.prototype,"excelExportComplete",void 0),P([i.i(r.Event)()],t.prototype,"beforePdfExport",void 0),P([i.i(r.Event)()],t.prototype,"pdfExportComplete",void 0),t=E=P([r.NotifyPropertyChanges],t)}(r.Component)},function(e,t,i){"use strict";var r=i(13);i.d(t,"a",function(){return r.a}),i.d(t,"b",function(){return r.b}),i.d(t,"c",function(){return r.c});var n=i(14);i.d(t,"d",function(){return n.a});var o=i(15);i.d(t,"e",function(){return o.a}),i.d(t,"f",function(){return o.b});var a=i(18);i.d(t,"g",function(){return a.a});var s=i(19);i.d(t,"h",function(){return s.a});var d=i(20);i.d(t,"i",function(){return d.a});var l=i(22);i.d(t,"j",function(){return l.a}),i.d(t,"k",function(){return l.b});var p=i(21);i.d(t,"l",function(){return p.a}),i.d(t,"m",function(){return p.b});var c=i(51);i.d(t,"n",function(){return c.a});var h=i(16);i.d(t,"o",function(){return h.a});var u=i(17);i.d(t,"p",function(){return u.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)()],t.prototype,"targetID",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=(i.n(r),this&&this.__extends||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=this&&this.__decorate||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},a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),o([i.i(r.Property)("Both")],t.prototype,"wrapMode",void 0),t}(r.ChildProperty)},function(e,t,i){"use strict";var r=i(23);i.d(t,"a",function(){return r.a});var n=i(24);i.d(t,"b",function(){return n.a})},function(e,t,i){"use strict";i.d(t,"a",function(){return p});var r=i(0),n=(i.n(r),i(3)),o=i(24),a=i(1),s=(i.n(a),i(4)),d=(i.n(s),i(2)),l=this&&this.__extends||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)}}(),p=function(e){function t(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 l(t,e),t.prototype.getModelGenerator=function(){return new o.a(this.parent)},t.prototype.getRowByIndex=function(e){return this.parent.enableVirtualization&&this.parent.isFrozenGrid()?this.getRowCollection(e,!0):this.parent.getDataRows().filter(function(t){return parseInt(t.getAttribute("data-rowindex"),10)===e})[0]},t.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},t.prototype.getRowCollection=function(e,t,i,r){var o=parseInt(this.parent.getRows()[0].getAttribute(n.g),10),a=this.parent.getDataRows(),s=i?this.parent.getCurrentViewRecords():a,d=s[e-o];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(d=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:d:e<=this.parent.frozenRows?a[parseInt(e.toString(),10)]:a[e-o+this.parent.frozenRows]),d},t.prototype.addEventListener=function(){this.parent.on(n.d,this.virtualOtherAction,this),this.parent.on(n.f,this.indexModifier,this)},t.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},t.prototype.indexModifier=function(e){var t=this.parent.getContent().querySelector(".e-content");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-this.parent.pageSettings.pageSize){var i=~~(t.scrollTop/this.parent.getRowHeight()),r=i+this.parent.getRows().length;r>e.count&&(r=i+(e.count-i)),this.startIndex=r-this.parent.getRows().length,this.endIndex=r}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=this.parent.pageSettings.pageSize-1),this.endIndex-this.startIndex!==this.parent.pageSettings.pageSize&&this.totalRecords>this.parent.pageSettings.pageSize&&this.endIndex===this.totalRecords?(e.startIndex=this.endIndex-this.parent.pageSettings.pageSize,e.endIndex=this.endIndex):(e.startIndex=this.startIndex,e.endIndex=this.endIndex)},t.prototype.eventListener=function(t){var r=this;this.parent.dataSource instanceof s.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&i.i(d.b)(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(){r.observers.observes(function(e){return r.scrollListeners(e)},r.onEnteredAction(),r.parent),r.parent.off("content-ready",r.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(n.h,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))},t.prototype.cellFocus=function(t){e.prototype.virtualCellFocus.call(this,t)},t.prototype.onDataReady=function(t){if(e.prototype.onDataReady.call(this,t),!(this.parent.dataSource instanceof s.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&i.i(d.b)(this.parent))){if(!i.i(a.isNullOrUndefined)(t.count)){if(this.totalRecords=t.count,this.parent.isFrozenGrid()&&t.count<Object.keys(this.parent.dataSource).length){var r=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",n=this.parent.getRowHeight()*t.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize;i.i(a.getValue)("virtualEle",this).setVirtualHeight(n,r)}this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()||i.i(a.getValue)("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*t.count,"100%")}(!i.i(a.isNullOrUndefined)(t.requestType)&&"collapseAll"===t.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1)}},t.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.parent.dataSource instanceof s.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&i.i(d.b)(this.parent)||(i.i(a.getValue)("observer",this).options.debounceEvent=!1,this.observers=new c(i.i(a.getValue)("observer",this).element,i.i(a.getValue)("observer",this).options),this.contents=this.getPanel().firstChild)},t.prototype.getTranslateY=function(t,r,n,o){return this.parent.dataSource instanceof s.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||i.i(d.b)(this.parent)?this.isRemoteExpand?(this.isRemoteExpand=!1,this.preTranslate):(this.preTranslate=e.prototype.getTranslateY.call(this,t,r,n,o),e.prototype.getTranslateY.call(this,t,r,n,o)):e.prototype.getTranslateY.call(this,t,r,n,o)},t.prototype.dataBoundEvent=function(){if(this.parent.getRows().length&&!i.i(a.isNullOrUndefined)(this.parent.getRowByIndex(0))&&!this.initialRowTop){var t=this.parent.getRowByIndex(0).getBoundingClientRect().top,r=this.parent.element.getBoundingClientRect().top;this.initialRowTop=t>0?this.parent.getRowByIndex(0).getBoundingClientRect().top-r:this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height}e.prototype.dataBound.call(this)},t.prototype.rowSelectedEvent=function(t){e.prototype.rowSelected.call(this,t)},t.prototype.toSelectVirtualRow=function(t){if(!this.parent.isEdit){i.i(a.isNullOrUndefined)(this.observer.containerRect)&&(this.observer.containerRect=this.observers.containerRect),(i.i(a.isNullOrUndefined)(this.parent.clipboardModule.treeGridParent.editModule)||0!==t.selectedIndex||i.i(a.isNullOrUndefined)(this.parent.clipboardModule.treeGridParent.editModule.addRowIndex))&&e.prototype.selectVirtualRow.call(this,t)}},t.prototype.refreshCell=function(e){e.cells=this.generateCells()},t.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},t.prototype.generateCell=function(e,t,n,o,s,d){var l={visible:e.visible,isDataCell:!i.i(a.isNullOrUndefined)(e.field||e.template),isTemplate:!i.i(a.isNullOrUndefined)(e.template),rowID:t,column:e,cellType:i.i(a.isNullOrUndefined)(n)?r.CellType.Data:n,colSpan:o,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&i.i(a.getValue)(e.field,d)};return(l.isDataCell||"checkbox"===l.column.type||l.commands)&&(l.index=s),new r.Cell(l)},t.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[data-rowindex="'+e.index+'"]',i=this.parent.getContent().querySelector(t).rowIndex,r=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)];e.data=r},t.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("data-rowindex"):0,o=r.length?+r[r.length-1].getAttribute("data-rowindex"):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)},t.prototype.restoreEditState=function(){e.prototype.restoreEdit.call(this)},t.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||e.prototype.resetIsedit.call(this)},t.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},t.prototype.cancelEdit=function(t){e.prototype.editCancel.call(this,t)},t.prototype.toSelectRowOnContextOpen=function(t){e.prototype.selectRowOnContextOpen.call(this,t)},t.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))},t.prototype.getData=function(t){e.prototype.getVirtualData.call(this,t)},t.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)},t.prototype.onEnteredAction=function(){var e=this;return function(t,i,r,n,o,s){if(!e.parent.directVirtualRender){!a.Browser.isIE||o||!s||e.preventEvent||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.parent.enableVirtualMaskRow&&!e.preventEvent&&setTimeout(function(){e.parent.showMaskRow(i.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"===i.axis,c=e.getColumnOffset(p?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(p){var h=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,u=e.vgenerator.cOffsets[h-1];c=c>u?u:c}var g=e.getTranslateY(n.top,d,p&&l===n.top?e.prevInfo:void 0,!0);if(!e.parent.isFrozenGrid()||e.parent.enableVirtualMaskRow){if(e.parent.enableVirtualMaskRow){var f=n.top-e.translateY<0;g=Math.round(e.translateY)>g&&!f?Math.round(e.translateY):g,e.virtualEle.adjustTable(c,g)}else e.virtualEle.adjustTable(c,e.translateY);e.parent.enableColumnVirtualization&&e.header.virtualEle.adjustTable(c,0)}}}},t.prototype.scrollListeners=function(e){this.scrollAfterEdit();var t=e.sentinel,r=this.parent.getRowHeight(),n=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2),o=this.parent.getContent().querySelector(".e-content"),l=n*r,p=e.offset.top-this.translateY<0,c=Math.ceil(e.offset.top-this.translateY)+r>=l,h=this.parent.currentViewData;if(p&&"right"!==e.direction&&"left"!==e.direction){var u=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),g=~~(o.scrollTop/r)+Math.ceil(u/r)-this.parent.pageSettings.pageSize;if(g=g>0?g:0,i.i(a.isNullOrUndefined)(this.selectedRowIndex)||-1===this.selectedRowIndex||g===this.selectedRowIndex||(g=this.selectedRowIndex),this.startIndex=g,this.endIndex=g+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords){var f=this.totalRecords-1,y=this.endIndex%f;this.endIndex=f,this.startIndex=this.startIndex-y<0?0:this.startIndex-y}h.length&&h[0].index>=this.parent.pageSettings.pageSize/2&&h[0].index-this.startIndex<this.parent.pageSettings.pageSize/2&&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/r);m%=this.parent.pageSettings.pageSize;var v=0;if(!i.i(a.isNullOrUndefined)(this.parent.getRows()[parseInt(m.toString(),10)])&&!i.i(a.isNullOrUndefined)(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(m.toString(),10)])){v=+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(m.toString(),10)].querySelector("td").getAttribute("index")}0===v?this.translateY=e.offset.top-n*r>0?e.offset.top-n*this.parent.getRowHeight()+r:0:this.parent.getFrozenColumns()>0?(e.offset.top=e.offset.top+80,this.translateY=e.offset.top-n*r>0?e.offset.top-n*r+10:0):this.translateY=e.offset.top-n*r>0?e.offset.top-n*r+10:0}else if(c&&"right"!==e.direction&&"left"!==e.direction){var S=~~(o.scrollTop/r),I=!(this.selectedRowIndex+this.parent.pageSettings.pageSize<this.totalRecords);i.i(a.isNullOrUndefined)(this.selectedRowIndex)||-1===this.selectedRowIndex||S===this.selectedRowIndex||I||(S=this.selectedRowIndex);var w=S+this.parent.pageSettings.pageSize;w>this.totalRecords&&(w=S+(this.totalRecords-S)),this.startIndex=!I||i.i(a.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),h.length&&this.startIndex>h[0].index&&this.startIndex-h[0].index<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule.isRowSelected&&(this.startIndex=h[0].index+this.parent.pageSettings.pageSize/2),e.offset.top>r*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,o.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.translateY=this.totalRecords*r-(this.endIndex-this.startIndex)*r:this.parent.allowRowDragAndDrop?this.translateY=e.offset.top-2*r:this.parent.getFrozenColumns()>0?this.translateY=e.offset.top-(2*r+this.parent.pageSettings.pageSize):this.translateY=e.offset.top}if(c&&e.offset.top<r*this.totalRecords||p||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof s.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&(c||p)||i.i(d.b)(this.parent)){var R=this.currentInfo=i.i(a.getValue)("getInfoFromView",this).apply(this,[e.direction,t,e.offset]);this.previousInfo=R,this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?R.columnIndexes:[]);var x=R.loadNext&&!R.loadSelf?R.nextInfo.page:R.page;c&&this.endIndex===this.totalRecords&&R.loadNext&&(R.loadNext=!1),this.parent.setProperties({pageSettings:{currentPage:x}},!0),this.requestType="virtualscroll","right"!==e.direction&&"left"!==e.direction&&(R.event="refresh-virtual-block"===R.event?"model-changed":R.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(R.event,{requestType:"virtualscroll",virtualInfo:R,focusElement:e.focusElement})}else this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},t.prototype.appendContent=function(t,r,o){if(this.parent.dataSource instanceof s.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||i.i(d.b)(this.parent)||this.parent.isFrozenGrid())i.i(a.getValue)("isExpandCollapse",o)&&(this.isRemoteExpand=!0),e.prototype.appendContent.call(this,t,r,o),-1!==i.i(a.getValue)("requestTypes",this).indexOf("isFrozen")&&(i.i(a.getValue)("requestTypes",this).splice(i.i(a.getValue)("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType);else{var l=o.virtualInfo.sentinelInfo&&"Y"===o.virtualInfo.sentinelInfo.axis&&i.i(a.getValue)("currentInfo",this).page&&i.i(a.getValue)("currentInfo",this).page!==o.virtualInfo.page?i.i(a.getValue)("currentInfo",this):o.virtualInfo,p=l.columnIndexes[0]-1,c=this.getColumnOffset(p),h=void 0;if(this.parent.enableColumnVirtualization){this.header.virtualEle.adjustTable(c,0);var u=l.columnIndexes;h=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",this.header.virtualEle.setWrapperWidth(h)}this.virtualEle.setWrapperWidth(h,a.Browser.isIE||"edge"===a.Browser.info.name),t=this.parent.createElement("tbody"),t.appendChild(r);this.getTable().querySelector("tbody").replaceWith(t),this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,i.i(a.getValue)("virtualEle",this).adjustTable(c,this.translateY)),i.i(a.setValue)("prevInfo",this.previousInfo?this.previousInfo:l,this),"virtualscroll"===o.requestType&&"X"===o.virtualInfo.sentinelInfo.axis&&this.parent.notify(n.i,{});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)}},t.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(n.d,this.virtualOtherAction),this.parent.off(n.f,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))},t}(r.VirtualContentRenderer),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isWheeling=!1,t.newPos=0,t.lastPos=0,t.timer=0,t}return l(t,e),t.prototype.observes=function(t,r,n){if(e.prototype.containerRect=i.i(a.getValue)("options",this).container.getBoundingClientRect(),a.EventHandler.add(i.i(a.getValue)("options",this).container,"scroll",this.virtualScrollHandlers(t,r,n),this),i.i(a.getValue)("options",this).movableContainer){e.prototype.movableContainerRect=i.i(a.getValue)("options",this).movableContainer.getBoundingClientRect(),a.EventHandler.add(i.i(a.getValue)("options",this).movableContainer,"scroll",this.virtualScrollHandlers(t,r,n),this)}},t.prototype.clear=function(){this.lastPos=null},t.prototype.virtualScrollHandlers=function(e,t,r){var n=this,o="chrome"===a.Browser.info.name?200:100,l=i.i(a.debounce)(e,o),p=i.i(a.debounce)(e,50);return this.options.prevTop=this.options.prevLeft=0,function(o){var a=n.options.movableContainer?n.options.container.scrollTop:o.target.scrollTop,c=n.options.movableContainer?n.options.scrollbar.scrollLeft:o.target.scrollLeft,h=n.options.prevTop<a?"down":"up";h=n.options.prevLeft===c?h:n.options.prevLeft<c?"right":"left",n.options.prevTop=a,n.options.prevLeft=c;var u=n.sentinelInfo[""+h],g=0;if(n.newPos=a,null!=n.lastPos&&(g=n.newPos-n.lastPos),n.lastPos=n.newPos,n.timer&&clearTimeout(n.timer),n.timer=setTimeout(n.clear,0),(g>100||g<-100)&&o&&o.preventDefault&&(o.returnValue=!1,o.preventDefault()),-1!==n.options.axes.indexOf(u.axis)){n.containerRect=n.options.container.getBoundingClientRect();var f=n.check(h);if(u.entered&&("X"===u.axis||r.enableVirtualMaskRow)&&(!n.movableEle||"right"!==h&&"left"!==h?t(n.element,u,h,{top:a,left:c},n.fromWheel,f):t(n.movableEle,u,h,{top:a,left:c},n.fromWheel,f)),f){var y=p;"X"===u.axis?y({direction:h,sentinel:u,offset:{top:a,left:c},focusElement:document.activeElement}):r.dataSource instanceof s.DataManager&&void 0!==r.dataSource.dataSource.url&&!r.dataSource.dataSource.offline&&""!==r.dataSource.dataSource.url||i.i(d.b)(r)||r.enableVirtualMaskRow?(y=r.enableVirtualMaskRow?l:y)({direction:h,sentinel:u,offset:{top:a,left:c},focusElement:document.activeElement}):e({direction:h,sentinel:u,offset:{top:a,left:c},focusElement:document.activeElement})}n.fromWheel=!1}}},t}(r.InterSectionObserver)},function(e,t){e.exports=n}])});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionGrids","SyncfusionButtons","SyncfusionData","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionTreegrid=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):e.SyncfusionTreegrid=t(e.SyncfusionBase,e.SyncfusionGrids,e.SyncfusionButtons,e.SyncfusionData,e.SyncfusionPopups)}(self,((e,t,i,r,n)=>(()=>{"use strict";var o={766:t=>{t.exports=e},741:e=>{e.exports=i},74:e=>{e.exports=r},707:e=>{e.exports=t},197:e=>{e.exports=n}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return o[e](i,i.exports,s),i.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{s.r(d),s.d(d,{Aggregate:()=>li,AggregateColumn:()=>Nt,AggregateRow:()=>Ut,Column:()=>n,ColumnChooser:()=>Ci,ColumnMenu:()=>hi,CommandColumn:()=>fi,ContextMenu:()=>ci,ContextMenuItems:()=>ft,DataManipulation:()=>Dt,DetailRow:()=>yi,Edit:()=>gi,EditSettings:()=>Tt,ExcelExport:()=>oi,Filter:()=>ni,FilterSettings:()=>y,Freeze:()=>xi,InfiniteScroll:()=>bi,InfiniteScrollSettings:()=>Qt,LoadingIndicator:()=>c,Logger:()=>C,Page:()=>si,PageSettings:()=>Pt,PdfExport:()=>ai,Predicate:()=>f,Render:()=>bt,Reorder:()=>Jt,Resize:()=>Xt,RowDD:()=>$t,RowDropSettings:()=>ti,SearchSettings:()=>wt,Selection:()=>yt,SelectionSettings:()=>xt,Sort:()=>pi,SortDescriptor:()=>Lt,SortSettings:()=>zt,StackedColumn:()=>a,Toolbar:()=>di,ToolbarItem:()=>gt,TreeClipboard:()=>Ze,TreeGrid:()=>Yt,TreeGridColumn:()=>o,TreeVirtual:()=>Ri,TreeVirtualRowModelGenerator:()=>ri,VirtualScroll:()=>Ii,actionBegin:()=>A,actionComplete:()=>U,actionFailure:()=>Xe,ariaColIndex:()=>We,ariaRowIndex:()=>Je,autoCol:()=>qe,batchAdd:()=>pe,batchCancel:()=>le,batchDelete:()=>de,batchEditFormRendered:()=>be,batchSave:()=>ge,beforeBatchAdd:()=>ce,beforeBatchCancel:()=>Ce,beforeBatchDelete:()=>he,beforeBatchSave:()=>ue,beforeCopy:()=>$,beforeDataBound:()=>E,beforeExcelExport:()=>L,beforePaste:()=>Z,beforePdfExport:()=>z,beforeStartEdit:()=>xe,beginAdd:()=>re,beginEdit:()=>ie,cellEdit:()=>se,cellSave:()=>oe,cellSaved:()=>ae,checkboxChange:()=>T,collapsed:()=>G,collapsing:()=>H,content:()=>je,contextMenuClick:()=>X,contextMenuOpen:()=>J,crudAction:()=>te,dataBound:()=>O,dataColIndex:()=>Ke,dataListener:()=>Ie,dataRowIndex:()=>Ye,dataStateChange:()=>N,destroy:()=>we,detailDataBound:()=>De,doubleTap:()=>me,expanded:()=>j,expanding:()=>_,extendArray:()=>pt,findChildrenRecords:()=>dt,findParentRecords:()=>at,frozenContent:()=>ze,frozenHeader:()=>Fe,frozenLeft:()=>Qe,frozenRight:()=>He,getExpandStatus:()=>st,getParentData:()=>ct,getPlainData:()=>ht,headerContent:()=>Ve,indexModifier:()=>Re,isCheckboxcolumn:()=>nt,isCountRequired:()=>rt,isFilterChildHierarchy:()=>ot,isHidden:()=>ut,isOffline:()=>lt,isRemoteData:()=>it,keyPressed:()=>fe,leftRight:()=>Ge,load:()=>D,localPagedExpandCollapse:()=>K,movableContent:()=>Be,movableHeader:()=>Le,pagingActions:()=>W,printGridInit:()=>Y,queryCellInfo:()=>P,recordDoubleClick:()=>ne,remoteExpand:()=>Q,resizeStop:()=>F,rowDataBound:()=>M,rowDeselected:()=>V,rowDeselecting:()=>Te,rowDrag:()=>Me,rowDragStart:()=>Ee,rowDragStartHelper:()=>Oe,rowDrop:()=>Pe,rowDropped:()=>ke,rowSelected:()=>q,rowSelecting:()=>k,rowdraging:()=>Ue,rowsAdd:()=>Ae,rowsRemove:()=>Ne,savePreviousRowPosition:()=>ee,table:()=>_e,toolbarClick:()=>B,treeGridDetails:()=>b,updateData:()=>ye,virtualActionArgs:()=>ve,virtualColumnIndex:()=>Se});var e,t=s(766),i=(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])},e(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),r=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(){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={},(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}(),o=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i(n,e),r([(0,t.Property)(null)],n.prototype,"columns",void 0),n}(n),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o),l=s(707),p=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])},e(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,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(e){function i(){return null!==e&&e.apply(this,arguments)||this}return p(i,e),h([(0,t.Property)("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),u=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])},e(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)}}(),g=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},f=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Property)()],i.prototype,"field",void 0),g([(0,t.Property)()],i.prototype,"operator",void 0),g([(0,t.Property)()],i.prototype,"value",void 0),g([(0,t.Property)()],i.prototype,"matchCase",void 0),g([(0,t.Property)()],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)()],i.prototype,"predicate",void 0),g([(0,t.Property)({})],i.prototype,"actualFilterValue",void 0),g([(0,t.Property)({})],i.prototype,"actualOperator",void 0),g([(0,t.Property)()],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"ejpredicate",void 0),g([(0,t.Property)()],i.prototype,"uid",void 0),g([(0,t.Property)()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Collection)([],f)],i.prototype,"columns",void 0),g([(0,t.Property)("FilterBar")],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"mode",void 0),g([(0,t.Property)(!0)],i.prototype,"showFilterBarStatus",void 0),g([(0,t.Property)(1500)],i.prototype,"immediateModeDelay",void 0),g([(0,t.Property)()],i.prototype,"operators",void 0),g([(0,t.Property)(!1)],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),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])},e(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)}}(),S=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},v=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return m(i,e),S([(0,t.Property)("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),w=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])},e(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)}}(),I="https://ej2.syncfusion.com/documentation/treegrid",R="https://ej2.syncfusion.com/documentation",x=!1,C=function(e){function i(t){return l.Grid.Inject(l.Logger),e.call(this,t)||this}return w(i,e),i.prototype.getModuleName=function(){return"logger"},i.prototype.log=function(e,i){e instanceof Array||(e=[e]);for(var r=e,n=0;n<r.length;n++){var o=l.detailLists[r[parseInt(n.toString(),10)]],a=o.check(i,this.parent);if(a.success){var s=o.generateMessage(i,this.parent,a.options);s=s.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),x&&"primary_column_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace("Editing","Row DragAndDrop"),x=!1);var d=s.indexOf("https"),p=s.substring(d);"module_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/modules"):"primary_column_missing"===r[parseInt(n.toString(),10)]||"selection_key_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,R+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/edit"):"virtual_height"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/virtual"):"check_datasource_columns"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/columns"):"locale_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace(p,I+"/global-local/#localization")),"datasource_syntax_mismatch"===r[parseInt(n.toString(),10)]&&((0,t.isNullOrUndefined)(this.treeGridObj)||(0,t.isNullOrUndefined)(this.treeGridObj.dataStateChange))||console[o.logType](s)}}},i.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&&(x=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=b[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)}}},i}(l.Logger),b={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return((0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.childMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||!(0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||(0,t.isNullOrUndefined)(i.idMapping)&&!(0,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"+R+"/api/treegrid#childmapping\n"+R+"/api/treegrid#idmapping\n"+R+"/api/treegrid#$parentidmapping"}}},D="load",M="rowDataBound",O="dataBound",P="queryCellInfo",E="beforeDataBound",A="actionBegin",N="dataStateChange",U="actionComplete",k="rowSelecting",q="rowSelected",T="checkboxChange",V="rowDeselected",B="toolbarClick",L="beforeExcelExport",z="beforePdfExport",F="resizeStop",j="expanded",_="expanding",G="collapsed",H="collapsing",Q="remoteExpand",K="localPagedExpandCollapse",W="pagingActions",Y="printGrid-Init",J="contextMenuOpen",X="contextMenuClick",$="beforeCopy",Z="beforePaste",ee="savePreviousRowPosition",te="crudAction",ie="beginEdit",re="beginAdd",ne="recordDoubleClick",oe="cellSave",ae="cellSaved",se="cellEdit",de="batchDelete",le="batchCancel",pe="batchAdd",he="beforeBatchDelete",ce="beforeBatchAdd",ue="beforeBatchSave",ge="batchSave",fe="key-pressed",ye="update-data",me="double-tap",Se="virtualColumnIndex",ve="virtual-action-args",we="destroy",Ie="data-listener",Re="index-modifier",xe="edit-form",Ce="before-batch-cancel",be="batcheditform-rendered",De="detailDataBound",Me="rowDrag",Oe="rowDragStartHelper",Pe="rowDrop",Ee="rowDragStart",Ae="rows-add",Ne="rows-remove",Ue="row-draging",ke="row-dropped",qe="auto-col",Te="rowDeselecting",Ve="e-headercontent",Be="e-movablecontent",Le="e-movableheader",ze="e-frozencontent",Fe="e-frozenheader",je="e-content",_e="e-table",Ge="Left-Right",He="frozen-right",Qe="frozen-left",Ke="data-colindex",We="aria-colindex",Ye="data-rowindex",Je="aria-rowindex",Xe="actionFailure",$e=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])},e(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)}}(),Ze=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 $e(i,e),i.prototype.setCopyData=function(i){var r="copyContent",n="getCopyData",o=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[""+r]="";var a=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var s=this.treeGridParent.getSelectedRowIndexes().sort((function(e,t){return e-t})),d=0;d<s.length;d++)if(d>0&&(this.treeCopyContent+="\n"),!a[s[parseInt(d.toString(),10)]].classList.contains("e-summaryrow")){var l=[].slice.call(a[s[parseInt(d.toString(),10)]].querySelectorAll(".e-rowcell")),p=this.treeGridParent.getSelectedRecords()[parseInt(d.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(p)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(o,s[parseInt(d.toString(),10)],a,i,d),this[""+n](l,!1,"\t",i),this.treeCopyContent+=this[""+r],this.copiedUniqueIdCollection.push(p),this[""+r]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(o,s[parseInt(d.toString(),10)],a,i))}if(i){var h=[];for(d=0;d<this.treeGridParent.getVisibleColumns().length;d++)h[parseInt(d.toString(),10)]=this.treeGridParent.getVisibleColumns()[parseInt(d.toString(),10)].headerText;this[""+n](h,!1,"\t",i),this.treeCopyContent=this[""+r]+"\n"+this.treeCopyContent}var c={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger($,c),c.cancel)return;this.clipBoardTextArea.value=this[""+r]=c.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){var a="copyContent",s="parentItem",d="uniqueID";if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s]))for(var l=e[parseInt(i.toString(),10)][""+s].level,p=0;p<l+1;p++)for(var h=0;h<e.length;h++)if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s])&&e[parseInt(h.toString(),10)][""+d]===e[parseInt(i.toString(),10)][""+s][""+d]){i=h;var c=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),u=e[parseInt(h.toString(),10)][""+d];if(-1===this.copiedUniqueIdCollection.indexOf(u)){this.getCopyData(c,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this[""+a]+"\n":this[""+a]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(u),this[""+a]="";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){var o="copyContent",a="uniqueID";if(e[parseInt(i.toString(),10)].hasChildRecords)for(var s=e[parseInt(i.toString(),10)].childRecords,d=0;d<s.length;d++)for(var l=0;l<e.length;l++)if(!(0,t.isNullOrUndefined)(s[parseInt(d.toString(),10)][""+a])&&e[parseInt(l.toString(),10)][""+a]===s[parseInt(d.toString(),10)][""+a]){if(!(0,t.isNullOrUndefined)(r[parseInt(l.toString(),10)])&&!r[parseInt(l.toString(),10)].classList.contains("e-summaryrow")){var p=[].slice.call(r[parseInt(l.toString(),10)].querySelectorAll(".e-rowcell")),h=e[parseInt(l.toString(),10)][""+a];-1===this.copiedUniqueIdCollection.indexOf(h)&&(this.getCopyData(p,!1,"\t",n),this.treeCopyContent+="\n"+this[""+o],this[""+o]="",this.copiedUniqueIdCollection.push(h),this.childContentData(e,l,r,n))}break}},i}(l.Clipboard),et=s(741),tt=s(74);function it(e){if(e.dataSource instanceof tt.DataManager){var t=e.dataSource.adaptor;return t instanceof tt.ODataAdaptor||t instanceof tt.WebApiAdaptor||t instanceof tt.WebMethodAdaptor||t instanceof tt.CacheAdaptor||t instanceof tt.UrlAdaptor}return!1}function rt(e){return!(!e.dataSource||!("result"in e.dataSource))}function nt(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function ot(e){return!(((0,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 at(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++){(0,l.getObject)("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)])}return t}function st(e,i,r){var n,o=(0,t.isNullOrUndefined)(i.parentItem)?null:ct(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||(0,t.isNullOrUndefined)(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||((n=ct(e,o.parentItem.uniqueID))&&e.initialRender&&!(0,t.isNullOrUndefined)(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||st(e,n,r)))):(o.expanded=!1,!1))}function dt(e){var i=[];if((0,t.isNullOrUndefined)(e)||!e.hasChildRecords&&!(0,t.isNullOrUndefined)(e.childRecords)&&!e.childRecords.length)return[];if(!(0,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||!(0,t.isNullOrUndefined)(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(dt(r[parseInt(n.toString(),10)])));return i}function lt(e){if(it(e)){var i=e.dataSource;return!(0,t.isNullOrUndefined)(i.ready)}return!0}function pt(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 ht(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 ct(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function ut(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}var gt,ft,yt=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 t,i=(0,l.getObject)("target",e),r=(0,l.parentsUntil)(i,"e-checkbox-wrapper");if(r&&r.querySelectorAll(".e-treecheckselect").length>0){t=r.querySelector('input[type="checkbox"]');var n=[];n.push(i.closest("tr").rowIndex),this.selectCheckboxes(n),this.triggerChkChangeEvent(t,t.nextElementSibling.classList.contains("e-check"),i.closest("tr"))}else if(r&&r.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var o=!r.querySelector(".e-frame").classList.contains("e-check")&&!r.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(o),t=r.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(t,o,i.closest("tr"))}},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(T,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("e-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"}});(r=(0,et.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),r.insertBefore(i.cloneNode(),r.firstChild),(0,t.isNullOrUndefined)(e)||e.insertBefore(r,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var r,n=(r=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&n&&this.headerSelection(n)}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),r=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var n=!(0,t.isNullOrUndefined)(r.checkboxState)&&"uncheck"!==r.checkboxState,o=(0,et.createCheckBox)(this.parent.createElement,!1,{checked:n,label:" "});if(o.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(o.querySelector(".e-frame").style.width="18px"),"indeterminate"===r.checkboxState){var a=o.querySelectorAll(".e-frame")[0];(0,t.removeClass)([a],["e-check","e-stop","e-uncheck"]),o.querySelector(".e-frame").classList.add("e-stop")}return o.insertBefore(i.cloneNode(),o.firstChild),o},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if((0,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((0,t.isNullOrUndefined)(e)){this.parent.trigger(Xe,{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=ct(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;!(0,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,r=[],n=ct(this.parent,e.uniqueID);n&&n.childRecords&&(r=n.childRecords),!(0,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(!(0,t.isNullOrUndefined)(n)){for(var s=0;s<r.length;s++){var d=ct(this.parent,r[parseInt(s.toString(),10)].uniqueID);(0,t.isNullOrUndefined)(d)||("indeterminate"===d.checkboxState?o++:"check"===d.checkboxState&&a++)}o>0||a>0&&a!==i?n.checkboxState="indeterminate":(0!==a||n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(n.hasFilteredChildRecords)||(0,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&&!(0,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,r,n=this,o=!1;if(!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var a=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=a),this.parent.grid.searchSettings.key.length?this.searchingRecords=a:this.filteredList!==a?(this.filteredList=a,o=!0):o=!1}if(this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!(0,t.isNullOrUndefined)(e)&&(this.filteredList=this.searchingRecords)),r=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0||!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,r=it(this.parent)?this.parent.getCurrentViewRecords():r,!(0,t.isNullOrUndefined)(e))for(var s=0;s<r.length;s++)if(e){if("check"===r[parseInt(s.toString(),10)].checkboxState)continue;if(o)continue;r[parseInt(s.toString(),10)].checkboxState="check",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState)}else this.selectedItems.indexOf(r[parseInt(s.toString(),10)])>-1&&(r[parseInt(s.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(r[parseInt(s.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],r.filter((function(e){e.checkboxState="uncheck",n.updateSelectedItems(e,e.checkboxState)}))),i=this.selectedItems.length;var d=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];i>0&&r.length>0?i===r.length||e?((0,t.removeClass)([d],["e-stop"]),d.classList.add("e-check")):((0,t.removeClass)([d],["e-check"]),d.classList.add("e-stop")):(0,t.removeClass)([d],["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=ct(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],(0,t.isNullOrUndefined)(n)||(0,t.removeClass)([n],["e-check","e-stop","e-uncheck"])}if(r=s,(0,t.isNullOrUndefined)(r)&&(r=e),r.checkboxState=i,"check"===i&&(0,t.isNullOrUndefined)(e.isSummaryRow))-1!==a&&-1===this.selectedIndexes.indexOf(a)&&this.selectedIndexes.push(a),-1===this.selectedItems.indexOf(r)&&-1!==a&&!(0,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)&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1!==this.selectedItems.indexOf(r)||(0,t.isNullOrUndefined)(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.selectedItems.push(r);else if(("uncheck"===i||"indeterminate"===i)&&(0,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&&((0,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(nt(this.parent)&&this.parent.autoCheckHierarchy)if("sorting"===o||"paging"===o){var a=this.parent.grid.getRows();r=(i=this.parent.getCurrentViewRecords()).length,this.selectedIndexes=[];for(var s=0;s<r;s++)a[parseInt(s.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(s.toString(),10)],i[parseInt(s.toString(),10)].checkboxState)}else if("delete"===o||"add"===e.action){var d=[];"delete"===o?d=e.data:d.push(e.data);for(s=0;s<d.length;s++){if("delete"===o){var l=this.parent.flatData.indexOf(d[parseInt(s.toString(),10)]),p=this.selectedIndexes.indexOf(l);this.selectedIndexes.splice(p,1),this.updateSelectedItems(d[parseInt(s.toString(),10)],"uncheck")}(0,t.isNullOrUndefined)(d[parseInt(s.toString(),10)].parentItem)||this.updateParentSelection(d[parseInt(s.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===o||"searching"===o||"refresh"===o&&!it(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],(i=!(0,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=dt(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||(0,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())},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}(),mt=function(){function e(e){this.parent=e,l.Grid.Inject(l.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on(Y,this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off(Y,this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var i=(0,l.getObject)("printgrid",e),r=(0,l.getObject)("element",e);i.addEventListener(P,this.parent.grid.queryCellInfo),i.addEventListener(M,this.parent.grid.rowDataBound),i.addEventListener(E,this.parent.grid.beforeDataBound),(0,t.addClass)([r],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),St=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])},e(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)}}(),vt=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},wt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return St(i,e),vt([(0,t.Property)()],i.prototype,"fields",void 0),vt([(0,t.Property)(!1)],i.prototype,"ignoreCase",void 0),vt([(0,t.Property)("contains")],i.prototype,"operator",void 0),vt([(0,t.Property)()],i.prototype,"key",void 0),vt([(0,t.Property)()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),It=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])},e(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)}}(),Rt=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},xt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return It(i,e),Rt([(0,t.Property)("Row")],i.prototype,"mode",void 0),Rt([(0,t.Property)("Flow")],i.prototype,"cellSelectionMode",void 0),Rt([(0,t.Property)("Single")],i.prototype,"type",void 0),Rt([(0,t.Property)(!1)],i.prototype,"persistSelection",void 0),Rt([(0,t.Property)("Default")],i.prototype,"checkboxMode",void 0),Rt([(0,t.Property)(!1)],i.prototype,"checkboxOnly",void 0),Rt([(0,t.Property)(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Ct=s(197),bt=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 i=e.data,r=i.parentItem;if(!(0,t.isNullOrUndefined)(i.parentItem)&&!ot(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||it(this.parent)&&!lt(this.parent)))if((this.parent.initialRender&&(!((0,t.isNullOrUndefined)(r[this.parent.expandStateMapping])||r[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!st(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!(0,t.isNullOrUndefined)(e.row)){e.row.style.display="none";var n=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||(0,t.isNullOrUndefined)(e.row.getAttribute("data-uid"))||(n.filter((function(t){return t.uid===e.row.getAttribute("data-uid")}))[0].visible=!1)}if(it(this.parent)&&!lt(this.parent)){var o=this.parent,a=this.parent.getCurrentViewRecords().filter((function(e){return(0,t.getValue)(o.idMapping,e)===(0,t.getValue)(o.parentIdMapping,i)}));if(a.length>0&&!a[0].isSummaryRow&&!(0,t.isNullOrUndefined)(e.row)){var s=a[0].expanded?"table-row":"none";e.row.setAttribute("style","display: "+s+";")}}(0,l.getObject)("isSummaryRow",e.data)&&(0,t.addClass)([e.row],"e-summaryrow"),(0,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&&((0,t.isNullOrUndefined)(i.parentItem)||(e.row.style.display="none")));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||(0,t.isNullOrUndefined)(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var d=this;d.parent.renderReactTemplates((function(){d.parent.trigger(M,e)}))}else this.parent.trigger(M,e)}},e.prototype.cellRender=function(e){if(e.data){var i,r,n=this.parent.grid,o=e.data,a=(0,t.isNullOrUndefined)(o.filterLevel)?o.level:o.filterLevel,s=0,d=this.parent.getColumnByUid(e.column.uid),p=o.isSummaryRow,h=this.parent.getFrozenColumns();i=(0,t.isNullOrUndefined)(o.parentItem)?o.index:o.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):n.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!(0,t.isNullOrUndefined)(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{for(var c=(0,t.createElement)("div",{className:"e-treecolumn-container"}),u=(0,t.createElement)("span",{className:"e-icons e-none",styles:"width: 10px; display: inline-block"}),g=0;g<a;g++)s+=10,c.appendChild(u.cloneNode());var f=(0,t.isNullOrUndefined)(o.hasFilteredChildRecords)?o.hasChildRecords:o.hasFilteredChildRecords;if(f&&!(0,t.isNullOrUndefined)(o.childRecords)&&(f=this.parent.isFromGantt&&!this.parent.loadChildOnDemand?o.hasChildRecords:!(0===o.childRecords.length)),f){(0,t.addClass)([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",o.expanded?"true":"false");var y=(0,t.createElement)("span",{className:"e-icons"}),m=void 0;m=this.parent.initialRender?o.expanded&&((0,t.isNullOrUndefined)(o[this.parent.expandStateMapping])||o[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll:!(!o.expanded||!st(this.parent,o,this.parent.grid.getCurrentViewRecords())),(0,t.addClass)([y],m?"e-treegridexpand":"e-treegridcollapse"),s+=18,c.appendChild(y),u.style.width="4px",s+=7,c.appendChild(u.cloneNode())}else(a||!a&&!o.level)&&(s+=20,c.appendChild(u.cloneNode()),c.appendChild(u.cloneNode()));r=(0,t.createElement)("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(r.style.width="Calc(100% - "+s+"px)"),(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level),this.updateTreeCell(e,r),c.appendChild(r),e.cell.appendChild(c)}if(n.getFrozenLeftColumnsCount()>0||n.getFrozenRightColumnsCount()>0){var S=n.getFrozenRightColumns(),v=n.getFrozenLeftColumns(),w=n.getMovableColumns();(S.length>0&&S[0].field===e.column.field||v.length>0&&v[0].field===e.column.field||w.length>0&&w[0].field===e.column.field)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level)}else(h>this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===h||h<this.parent.treeColumnIndex&&h>0&&(n.getColumnIndexByUid(e.column.uid)===h||n.getColumnIndexByUid(e.column.uid)===h-1)||h===this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level);if(!(0,t.isNullOrUndefined)(d)&&d.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var I=e.cell.querySelectorAll(".e-frame")[0];s+=parseInt(I.style.width,16),s+=10,(r=n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+s+"px)"}if(p){(0,t.addClass)([e.cell],"e-summarycell");var R=(0,l.getObject)(e.column.field,e.data);R=(0,t.isNullOrUndefined)(R)?null:R,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=R:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=R}this.parent.args=e;var x=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex];if((0,t.isNullOrUndefined)(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger(P,e);else if(this.parent.isReact&&x.field!==e.column.field){var C=this;C.parent.renderReactTemplates((function(){C.parent.trigger(P,e)}))}}},e.prototype.updateTreeCell=function(e,i){var r=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex],n="templateFn",o=e.column.index;(0,t.isNullOrUndefined)(r.field)&&e.cell.setAttribute("data-colindex",o+""),r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template)||(e.column.template=r.template,e.column[""+n]=(0,l.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)(0,l.appendChildren)(i,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(r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template))for(;0<s;s=e.cell.children.length)i.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{var p="portals";if(this.parent.isReact&&"string"!=typeof e.column.template){e.column[""+n](e.data,this.parent,"columnTemplate",d,null,null,i),(0,t.isNullOrUndefined)(this.parent.grid[""+p])&&(this.parent.grid[""+p]=this.parent[""+p]),this.parent.notify("renderReactTemplate",this.parent[""+p]);var h=this;h.parent.renderReactTemplates((function(){h.parent.trigger(P,e)}))}else{var c=e.column[""+n]((0,l.extend)({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);(0,l.appendChildren)(i,c)}delete e.column.template,delete e.column[""+n],e.cell.innerHTML=""}}else i.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,(function(){var r=i.parent.grid.getRowsObject(),n=i.parent.getDataRows(),o=i.parent.grid.getIndentCount(),a=i.parent.grid.getNormalizedColumnIndex(e);if(0!==n.length)for(var s=0;s<r.length;s++)if(r[parseInt(s.toString(),10)].isDataRow&&!(0,t.isNullOrUndefined)(r[parseInt(s.toString(),10)].index)){var d=r[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)],p=new l.CellRenderer(i.parent.grid,i.parent.grid.serviceLocator),h=n.length>=r.length?i.parent.getCellFromIndex(r[parseInt(s.toString(),10)].index,a-o):i.parent.getRows()[r[parseInt(s.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,d,r[parseInt(s.toString(),10)].data,{index:r[parseInt(s.toString(),10)].index});var c=i.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)];i.cellRender({data:r[parseInt(s.toString(),10)].data,cell:c,column:d.column})}}))},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[""+i]=e,this.parent.notify("renderReactTemplate",this.parent[""+i]),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),Dt=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=!(0,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(Q,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Q,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 tt.DataManager},e.prototype.convertToFlatData=function(e){var i=this;if(this.parent.flatData=(0,t.isNullOrUndefined)(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof tt.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],it(this.parent)&&!lt(this.parent)&&e instanceof tt.DataManager&&!(e instanceof Array)){var r=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=(0,t.isNullOrUndefined)(this.parent.query)?new tt.Query:this.parent.query,this.parent.parentIdMapping){var n=this.parent.query.params.filter((function(e){return"IdMapping"===e.key}));this.parent.initialRender&&!n.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var o=this.parent.query.clone();o.queries=[],(o=o.select([this.parent.parentIdMapping])).isCountRequired=!0,r.executeQuery(o).then((function(e){i.parentItems=tt.DataUtil.distinct(e.result,i.parent.parentIdMapping,!1),0===(e.result?0:1)&&((0,t.setValue)("grid.contentModule.isLoaded",!0,i.parent),(0,t.isNullOrUndefined)(i.zerothLevelData)||((0,t.setValue)("cancel",!1,i.zerothLevelData),(0,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 n=e[parseInt(r.toString(),10)];this.hierarchyData.push((0,t.extend)({},n)),(0,t.isNullOrUndefined)(n[this.parent.idMapping])||this.taskIds.push(n[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){var o=[],a=new tt.DataManager(this.hierarchyData).executeLocal((new tt.Query).group(this.parent.parentIdMapping));for(r=0;r<a.length;r++){var s=a[parseInt(r.toString(),10)],d=this.taskIds.indexOf(s.key);if(!(0,t.isNullOrUndefined)(s.key)&&d>-1){var l=s.items;this.hierarchyData[parseInt(d.toString(),10)][this.parent.childMapping]=l}else o.push.apply(o,s.items)}this.hierarchyData=this.selfReferenceUpdate(o)}if(Object.keys(this.hierarchyData).length)this.createRecords(this.hierarchyData);else{var p=!(this.parent.dataSource instanceof tt.DataManager)&&this.parent.isGantt;this.parent.flatData=p?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 i="actionArgs";it(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e[""+i].requestType&&this.parent.hideSpinner();var r=e.result;if(it(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===e[""+i].requestType||"clearFilter"===e[""+i].action||""===e[""+i].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand){(0,t.isNullOrUndefined)(r)||this.parent.loadChildOnDemand&&rt(this.parent)&&!(0,t.isNullOrUndefined)(this.parent.dataResults.expandRecord)||it(this.parent)&&this.parent.loadChildOnDemand&&e[""+i].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(r)}else for(var n=function(e){if(rt(o.parent)&&r[parseInt(e.toString(),10)].hasChildRecords&&o.parent.initialRender&&(r[parseInt(e.toString(),10)].expanded=!1),it(o.parent)&&o.parent.enableVirtualization){var i=[],n=o.parent;r.filter((function(t){t[""+n.parentIdMapping]===r[parseInt(e.toString(),10)][""+n.idMapping]&&i.push(t)})),i.length?r[parseInt(e.toString(),10)].expanded=!0:r[parseInt(e.toString(),10)].hasChildRecords&&(r[parseInt(e.toString(),10)].expanded=!1)}(0,t.isNullOrUndefined)(r[parseInt(e.toString(),10)].index)&&(r[parseInt(e.toString(),10)].taskData=(0,t.extend)({},r[parseInt(e.toString(),10)]),r[parseInt(e.toString(),10)].uniqueID=(0,l.getUid)(o.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+r[parseInt(e.toString(),10)].uniqueID,r[parseInt(e.toString(),10)],o.parent),r[parseInt(e.toString(),10)].level=0,it(o.parent)&&o.parent.enableVirtualization&&r[parseInt(e.toString(),10)][""+o.parent.parentIdMapping]&&0===r[parseInt(e.toString(),10)].level&&(r[parseInt(e.toString(),10)].level=r[parseInt(e.toString(),10)].level+1),r[parseInt(e.toString(),10)].index=Math.ceil(1e3*Math.random()),(r[parseInt(e.toString(),10)][o.parent.hasChildMapping]||-1!==o.parentItems.indexOf(r[parseInt(e.toString(),10)][o.parent.idMapping]))&&(r[parseInt(e.toString(),10)].hasChildRecords=!0),r[parseInt(e.toString(),10)].checkboxState="uncheck")},o=this,a=0;a<r.length;a++)n(a);else this.zerothLevelData=e,(0,t.setValue)("cancel",!0,e);if(it(this.parent)&&this.parent.loadChildOnDemand&&e[""+i].isExpandCollapse&&this.parent.enableVirtualization||it(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand?e.result=r:e.result=this.parent.loadChildOnDemand?this.parent.flatData:r,it(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 s=e.query.queries.filter((function(e){return"onAggregates"===e.fn}));e.result=this.parent.summaryModule.calculateSummaryValue(s,this.parent.flatData,!0)}this.parent.notify("updateResults",e)},e.prototype.collectExpandingRecs=function(e,i){var r,n=this.parent.getRows();if(this.parent.rowTemplate){var o=this.parent.getContentTable().rows;n=[].slice.call(o)}if(e.rows.length>0){i||(e.record.expanded=!0);for(var a=0;a<e.rows.length;a++){if(e.rows[parseInt(a.toString(),10)].style.display="table-row",this.parent.loadChildOnDemand){var s=e.rows[parseInt(a.toString(),10)].getElementsByClassName("e-treegridcollapse")[0];r=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,!(0,t.isNullOrUndefined)(s)&&r.expanded&&((0,t.addClass)([s],"e-treegridexpand"),(0,t.removeClass)([s],"e-treegridcollapse"));var d;(d=n.filter((function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}))).length&&r.expanded&&this.collectExpandingRecs({record:r,rows:d,parentRow:e.parentRow},!0)}var l=e.rows[parseInt(a.toString(),10)].querySelector(".e-detailrowcollapse");(0,t.isNullOrUndefined)(l)||this.parent.grid.detailRowModule.expand(l)}}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},e.prototype.fetchRemoteChildData=function(e){var i=this,r={row:e.parentRow,data:e.record},n=this.parent.dataSource,o=this.parent.grid.getDataModule().generateQuery(),a=o.queries.filter((function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn}));if(o.queries=a,o.isCountRequired=!0,this.parent.enableVirtualization&&"remoteExpand"===e.action)o.take(this.parent.pageSettings.pageSize),(s=[]).push("ExpandingAction",parseInt(e.record[this.parent.idMapping],10).toString()),o.expand(s);else if(this.parent.enableVirtualization&&"collapse"===e.action){var s;o.take(this.parent.grid.pageSettings.pageSize),(s=[]).push("CollapsingAction",parseInt(e.record[this.parent.idMapping],10).toString()),o.expand(s)}if(o.where(this.parent.parentIdMapping,"equal",e.record[this.parent.idMapping]),"remoteExpand"===e.action&&this.parent.grid.filterModule&&this.parent.grid.filterModule.value){var d=this.parent.grid.getDataModule().generateQuery().queries.filter((function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates}));o.queries.push(d[0])}(0,Ct.showSpinner)(this.parent.element),n.executeQuery(o).then((function(n){var o,a="remoteExpandedData",s="remoteCollapsedData",d=i.parent.grid.currentViewData.slice(),p=i.parent.idMapping;if(i.parent.isGantt&&!i.parent.loadChildOnDemand&&i.parent.hasChildMapping){for(var h=0;h<i.parent.grid.currentViewData.length;h++)if(e.record[p]===i.parent.grid.currentViewData[h][p]){o=h;break}}else o=d.indexOf(e.record);if(i.parent.enableVirtualization&&("collapse"===e.action||"remoteExpand"===e.action)){d=[];for(h=0;h<o;h++)d.push(i.parent.grid.currentViewData[parseInt(h.toString(),10)])}-1===o&&i.parent.grid.getRowsObject().forEach((function(t){t.data.uniqueID===e.record.uniqueID&&(o=t.index)}));var c=(0,l.getObject)("actual.nextLevel",n),u=n.result,g=[];if("remoteExpand"===e.action&&i.parent.grid.filterModule&&i.parent.grid.filterModule.value){for(h=0;h<d.length;h++)Object.prototype.hasOwnProperty.call(d[parseInt(h.toString(),10)],i.parent.parentIdMapping)&&null!==d[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&0===d[parseInt(h.toString(),10)].level&&(d.splice(h,1),h--);for(h=0;h<u.length;h++)e.record[""+i.parent.idMapping]!==u[parseInt(h.toString(),10)][""+i.parent.idMapping]&&e.record[""+i.parent.idMapping]===u[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(u,h)&&g.push(u[parseInt(h.toString(),10)]);u=g}if(i.parent.enableVirtualization&&"remoteExpand"===e.action){e.record.childRecords=[];for(h=0;h<u.length;h++)e.record[""+i.parent.idMapping]!==u[parseInt(h.toString(),10)][""+i.parent.idMapping]&&e.record[""+i.parent.idMapping]===u[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(u,h)&&e.record.childRecords.push(u[parseInt(h.toString(),10)])}else e.record.childRecords=u;for(var f=0;f<u.length;f++){if(i.parent.enableVirtualization&&u[parseInt(f.toString(),10)][""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"remoteExpand"===e.action)i.parent[""+a].push(e.record);else if(i.parent.enableVirtualization&&u[parseInt(f.toString(),10)][""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"collapse"===e.action)for(h=0;h<i.parent[""+a].length;h++)e.record[""+i.parent.idMapping]===i.parent[""+a][parseInt(h.toString(),10)][""+i.parent.idMapping]&&i.parent[""+a].splice(h,1);if(u[parseInt(f.toString(),10)].taskData=(0,t.extend)({},u[parseInt(f.toString(),10)]),u[parseInt(f.toString(),10)][""+i.parent.parentIdMapping]&&i.parent.enableVirtualization&&i.parent[""+a].length)for(h=0;h<i.parent[""+a].length;h++){if(u[parseInt(f.toString(),10)][""+i.parent.parentIdMapping]===i.parent[""+a][parseInt(h.toString(),10)][""+i.parent.idMapping])u[parseInt(f.toString(),10)].level=i.parent[""+a][parseInt(h.toString(),10)].level+1,delete(y=i.parent[""+a][parseInt(h.toString(),10)]).childRecords,u[parseInt(f.toString(),10)].parentItem=y,u[parseInt(f.toString(),10)].parentUniqueID=e.record.uniqueID}else if(i.parent.enableVirtualization){if(!u[parseInt(f.toString(),10)][""+i.parent.hasChildMapping]&&-1===i.parentItems.indexOf(u[parseInt(f.toString(),10)][""+i.parent.idMapping])||c&&!c[parseInt(f.toString(),10)])delete(y=(0,t.extend)({},e.record)).childRecords,u[parseInt(f.toString(),10)].parentItem=y,u[parseInt(f.toString(),10)].parentUniqueID=e.record.uniqueID;else(0,t.isNullOrUndefined)(u[parseInt(f.toString(),10)][""+i.parent.parentIdMapping])?(u[parseInt(f.toString(),10)].level=0,"remoteExpand"===e.action&&(u[parseInt(f.toString(),10)].childRecords=[],u[parseInt(f.toString(),10)].childRecords=e.record.childRecords)):u[parseInt(f.toString(),10)].level=e.record.level}else{var y;u[parseInt(f.toString(),10)].level=e.record.level+1,delete(y=(0,t.extend)({},e.record)).childRecords,u[parseInt(f.toString(),10)].parentItem=y,u[parseInt(f.toString(),10)].parentUniqueID=e.record.uniqueID}if(u[parseInt(f.toString(),10)].index=Math.ceil(1e3*Math.random()),u[parseInt(f.toString(),10)].uniqueID=(0,l.getUid)(i.parent.element.id+"_data_"),u[parseInt(f.toString(),10)].checkboxState="uncheck",i.parent.enableVirtualization&&(0,t.isNullOrUndefined)(u[parseInt(f.toString(),10)].level))for(var m=0;m<i.parent.grid.currentViewData.length;m++)i.parent.grid.currentViewData[parseInt(m.toString(),10)][""+i.parent.idMapping]===u[parseInt(f.toString(),10)][""+i.parent.parentIdMapping]&&(u[parseInt(f.toString(),10)].level=i.parent.grid.currentViewData[parseInt(m.toString(),10)].level+1);if((0,t.setValue)("uniqueIDCollection."+u[parseInt(f.toString(),10)].uniqueID,u[parseInt(f.toString(),10)],i.parent),(u[parseInt(f.toString(),10)][""+i.parent.hasChildMapping]||-1!==i.parentItems.indexOf(u[parseInt(f.toString(),10)][""+i.parent.idMapping]))&&(!c||c[parseInt(f.toString(),10)]))if(u[parseInt(f.toString(),10)].hasChildRecords=!0,i.parent.enableVirtualization&&i.parent.loadChildOnDemand){for(h=0;h<i.parent[""+s].length;h++)u[parseInt(f.toString(),10)][""+i.parent.idMapping]===i.parent[""+s][parseInt(h.toString(),10)][""+i.parent.idMapping]&&(u[parseInt(f.toString(),10)].expanded=i.parent[""+s][parseInt(h.toString(),10)].expanded);if("collapse"===e.action&&u[parseInt(f.toString(),10)][""+i.parent.idMapping]!==e.record[""+i.parent.idMapping]&&!1!==u[parseInt(f.toString(),10)].expanded)u[parseInt(f.toString(),10)].expanded=!0;else if("collapse"===e.action&&u[parseInt(f.toString(),10)][""+i.parent.idMapping]===e.record[""+i.parent.idMapping])u[parseInt(f.toString(),10)].expanded=!1,i.parent[""+s].push(e.record);else if("remoteExpand"===e.action){for(h=0;h<i.parent.grid.currentViewData.length;h++)i.parent.grid.currentViewData[parseInt(h.toString(),10)][""+i.parent.idMapping]===u[parseInt(f.toString(),10)][""+i.parent.idMapping]&&u.splice(f,1,i.parent.grid.currentViewData[parseInt(h.toString(),10)]);if(u[parseInt(f.toString(),10)][i.parent.idMapping]===e.record[""+i.parent.idMapping])for(h=0;h<i.parent[""+s].length;h++)e.record[""+i.parent.idMapping]===i.parent[""+s][parseInt(h.toString(),10)][""+i.parent.idMapping]&&i.parent[""+s].splice(h,1);!1!==u[parseInt(f.toString(),10)].expanded&&(u[parseInt(f.toString(),10)].expanded=!0)}}else i.parent.enableVirtualization&&u[parseInt(f.toString(),10)][""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"collapse"!==e.action?u[parseInt(f.toString(),10)].expanded=!0:i.parent.enableVirtualization&&i.parent.loadChildOnDemand||(u[parseInt(f.toString(),10)].expanded=!1);d.splice(o+f+1,0,u[parseInt(f.toString(),10)])}if((0,t.setValue)("result",d,n),(0,t.setValue)("action","beforecontentrender",n),i.parent.trigger(U,n),(0,Ct.hideSpinner)(i.parent.element),i.parent.grid.aggregates.length>0&&!i.parent.enableVirtualization){var S=(0,l.getObject)("query",n),v="result";if((0,t.isNullOrUndefined)(S)&&(S=(0,t.getValue)("grid.renderModule.data",i.parent).aggregateQuery(new tt.Query)),!(0,t.isNullOrUndefined)(S)){var w=S.queries.filter((function(e){return"onAggregates"===e.fn}));n[""+v]=i.parent.summaryModule.calculateSummaryValue(w,n[""+v],!0)}}i.parent.enableVirtualization&&(i.parent.grid.pageSettings.totalRecordsCount=n.count),n.count=i.parent.grid.pageSettings.totalRecordsCount;var I={};i.parent.enableVirtualization&&i.remoteVirtualAction(I);var R={index:o,childData:u};i.parent.enableInfiniteScrolling?i.parent.notify("infinite-remote-expand",R):(0,t.getValue)("grid.renderModule",i.parent).dataManagerSuccess(n,I),i.parent.trigger(j,r)}))},e.prototype.remoteVirtualAction=function(e){e.requestType="refresh",(0,t.setValue)("isExpandCollapse",!0,e);var i=(0,t.getValue)("grid.contentModule",this.parent),r=(0,t.getValue)("currentInfo",i),n=(0,t.getValue)("prevInfo",i);r.loadNext&&this.parent.grid.pageSettings.currentPage===r.nextInfo.page&&(this.parent.grid.pageSettings.currentPage=n.page)},e.prototype.beginSorting=function(){if(this.isSortAction=!0,it(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,i){for(var r=[],n=0,o=Object.keys(e).length;n<o;n++){var a=(0,t.extend)({},e[parseInt(n.toString(),10)]);a.taskData=e[parseInt(n.toString(),10)];var s=0;if(this.storedIndex++,Object.prototype.hasOwnProperty.call(a,"index")||(a.index=this.storedIndex),(!(0,t.isNullOrUndefined)(a[this.parent.childMapping])&&!rt(this.parent)||a[this.parent.hasChildMapping]&&rt(this.parent))&&(a.hasChildRecords=!0,this.parent.enableCollapseAll||!(0,t.isNullOrUndefined)(this.parent.dataStateChange)&&(0,t.isNullOrUndefined)(a[this.parent.childMapping])?a.expanded=!1:a.expanded=!!(0,t.isNullOrUndefined)(a[this.parent.expandStateMapping])||a[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(a,"index")||(a.index=(a.hasChildRecords,this.storedIndex)),this.isSelfReference&&(0,t.isNullOrUndefined)(a[this.parent.parentIdMapping])&&this.parent.parentData.push(a),a.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+a.uniqueID,a,this.parent),!(0,t.isNullOrUndefined)(i)){var d=(0,t.extend)({},i);delete d.childRecords,delete d[this.parent.childMapping],this.isSelfReference&&delete d.taskData[this.parent.childMapping],a.parentItem=d,a.parentUniqueID=d.uniqueID,s=i.level+1}Object.prototype.hasOwnProperty.call(a,"level")||(a.level=s),a.checkboxState="uncheck";var p="remoteCollapsedData";if(this.parent.enableVirtualization&&this.parent.loadChildOnDemand&&it(this.parent)&&!this.parent.initialRender){if(!a.hasChildRecords&&(0,t.isNullOrUndefined)(a[""+this.parent.parentIdMapping])){a.hasChildRecords=!0;for(var h=0;h<this.parent[""+p].length;h++)this.parent[""+p][parseInt(h.toString(),10)][""+this.parent.idMapping]===a[""+this.parent.idMapping]&&(a.expanded=!1)}else 0===a.level&&(0,t.isNullOrUndefined)(i)&&!a.hasChildRecords&&(a.level=a.level+1);a[""+this.parent.hasChildMapping]&&!(0,t.isNullOrUndefined)(a[""+this.parent.expandStateMapping])&&(a.expanded=a[""+this.parent.expandStateMapping],a.hasChildRecords=!0),this.parent.flatData.push(a)}else((0,t.isNullOrUndefined)(a[""+this.parent.parentIdMapping])||a.parentItem)&&(this.parent.flatData.push(a),this.parent.infiniteScrollData.push(a));if(this.isSelfReference||0!==a.level||this.parent.parentData.push(a),!(0,t.isNullOrUndefined)(a[this.parent.childMapping]&&a[this.parent.childMapping].length)){var c=this.createRecords(a[this.parent.childMapping],a);a.childRecords=c}r.push(a)}return r},e.prototype.dataProcessor=function(e){var i,r=(0,l.getObject)("isExport",e),n=(0,l.getObject)("expresults",e),o=(0,l.getObject)("exportType",e),a=(0,l.getObject)("isPrinting",e),s=(0,l.getObject)("actionArgs",e),d=(0,l.getObject)("requestType",e),p=(0,l.getObject)("data",e),h=(0,l.getObject)("action",e),c=s,u=this.parent.getPrimaryKeyFieldNames()[0],g=(0,l.getObject)("data",c);(0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(c.action)||"add"!==c.action||(0,t.isNullOrUndefined)(c.data)||!(0,t.isNullOrUndefined)(c.data[""+u])||(c.data[""+u]=e.result[c.index][""+u],g.taskData[""+u]=e.result[c.index][""+u]),(!(0,t.isNullOrUndefined)(s)&&Object.keys(s).length||"save"===d)&&(d=d||s.requestType,p=p||(0,l.getObject)("data",s),h=h||(0,l.getObject)("action",s),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData&&this.updateAction(p,h,d));var f,y,m=(i=r&&!(0,t.isNullOrUndefined)(n)?n:rt(this.parent)?(0,t.getValue)("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof tt.DataManager?i.dataSource.json:i,S=rt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):m.length,v=new tt.Query,w=(0,l.getObject)("query",e);if((0,t.isNullOrUndefined)(w)||(f=w.queries.filter((function(e){return"onWhere"===e.fn})),y=w.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||!(0,t.isNullOrUndefined)(w)&&(f.length||y.length)&&this.parent.isLocalData){(0,t.isNullOrUndefined)(w)&&(w=new tt.Query,w=(0,t.getValue)("grid.renderModule.data",this.parent).filterQuery(w),w=(0,t.getValue)("grid.renderModule.data",this.parent).searchQuery(w));var I=w.queries.filter((function(e){return"onWhere"===e.fn})),R=w.queries.filter((function(e){return"onSearch"===e.fn}));v.queries=I.concat(R);var x=new tt.DataManager(m).executeLocal(v);if(this.parent.notify("updateFilterRecs",{data:x}),m=this.dataResults.result,this.dataResults.result=null,this.parent.grid.aggregates.length>0){var C=(0,l.getObject)("query",e);if((0,t.isNullOrUndefined)(w)&&(w=(0,t.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new tt.Query)),!(0,t.isNullOrUndefined)(C)){var b=C.queries.filter((function(e){return"onAggregates"===e.fn}));m=this.parent.summaryModule.calculateSummaryValue(b,m,!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 D=(0,l.getObject)("query",e);(0,t.isNullOrUndefined)(D)&&(D=(0,t.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new tt.Query));b=D.queries.filter((function(e){return"onAggregates"===e.fn}));m=this.parent.summaryModule.calculateSummaryValue(b,this.parent.flatData,!0)}if(this.parent.grid.sortSettings.columns.length>0||this.isSortAction){this.isSortAction=!1;for(var M=this.parent.parentData,O=(C=(0,l.getObject)("query",e),new tt.Query),P=this.parent.grid.sortSettings.columns.length-1;P>=0;P--){var E=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].field),A=E.sortComparer&<(this.parent)?E.sortComparer.bind(E):this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].direction;O.sortBy(this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].field,A)}var N=new tt.DataManager(M).executeLocal(O);if(this.parent.allowRowDragAndDrop&&!(0,t.isNullOrUndefined)(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var U=N.indexOf(this.parent.rowDragAndDropModule.draggedRecord);N.splice(U,1);var k=N.indexOf(this.parent.rowDragAndDropModule.droppedRecord);this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?N.splice(k,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&N.splice(k+1,0,this.parent.rowDragAndDropModule.draggedRecord)}var q={modifiedData:N,filteredData:m,srtQry:O};if(this.parent.notify("createSort",q),m=q.modifiedData,this.dataResults.result=null,this.sortedData=m,this.parent.notify("updateModel",{}),this.parent.grid.aggregates.length>0&&!(0,t.isNullOrUndefined)(C)){b=(0,l.getObject)("query",e).queries.filter((function(e){return"onAggregates"===e.fn}));m=this.parent.summaryModule.calculateSummaryValue(b,this.sortedData,!1)}}S=rt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):m.length;var T=this.paging(m,S,r,a,o,e);m=T.result,S=T.count,e.result=m,e.count=S,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"!==(0,t.getValue)("requestType",a)){var s=this.parent.enableInfiniteScrolling?a:(0,t.getValue)("actionArgs",a);this.parent.notify(W,{result:e,count:i,actionArgs:s}),e=this.dataResults.result,i=this.dataResults.count}}else this.parent.notify(W,{result:e,count:i,actionArgs:a}),e=this.dataResults.result,i=rt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):this.dataResults.count;var d="isCollapsedStatePersist";if((!0===n||a.isPdfExport&&((0,t.isNullOrUndefined)(a[""+d])||a[""+d]))&&"AllPages"===this.parent.printMode){for(var l=[],p=0;p<e.length;p++){st(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(te,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(ge,{})},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"}(gt||(gt={})),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"}(ft||(ft={}));var Mt=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])},e(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)}}(),Ot=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},Pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Mt(i,e),Ot([(0,t.Property)(12)],i.prototype,"pageSize",void 0),Ot([(0,t.Property)(8)],i.prototype,"pageCount",void 0),Ot([(0,t.Property)(1)],i.prototype,"currentPage",void 0),Ot([(0,t.Property)()],i.prototype,"totalRecordsCount",void 0),Ot([(0,t.Property)(!1)],i.prototype,"enableQueryString",void 0),Ot([(0,t.Property)(!1)],i.prototype,"pageSizes",void 0),Ot([(0,t.Property)(null)],i.prototype,"template",void 0),Ot([(0,t.Property)("All")],i.prototype,"pageSizeMode",void 0),i}(t.ChildProperty),Et=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])},e(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)}}(),At=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},Nt=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.intl=new t.Internationalization,i.templateFn={},i}return Et(i,e),i.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},i.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},i.prototype.getFormatter=function(){return this.formatFn},i.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[(0,t.getEnumValue)(l.CellType,l.CellType.Summary)]={fn:(0,t.compile)(this.footerTemplate,e),property:"footerTemplate"})},i.prototype.getTemplate=function(e){return this.templateFn[(0,t.getEnumValue)(l.CellType,e)]},i.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},At([(0,t.Property)()],i.prototype,"type",void 0),At([(0,t.Property)()],i.prototype,"footerTemplate",void 0),At([(0,t.Property)()],i.prototype,"field",void 0),At([(0,t.Property)()],i.prototype,"format",void 0),At([(0,t.Property)()],i.prototype,"columnName",void 0),At([(0,t.Property)()],i.prototype,"customAggregate",void 0),i}(t.ChildProperty),Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Et(i,e),At([(0,t.Collection)([],Nt)],i.prototype,"columns",void 0),At([(0,t.Property)(!0)],i.prototype,"showChildSummary",void 0),i}(t.ChildProperty),kt=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])},e(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)}}(),qt=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},Tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return kt(i,e),qt([(0,t.Property)(!1)],i.prototype,"allowAdding",void 0),qt([(0,t.Property)(!1)],i.prototype,"allowEditing",void 0),qt([(0,t.Property)(!1)],i.prototype,"allowDeleting",void 0),qt([(0,t.Property)("Cell")],i.prototype,"mode",void 0),qt([(0,t.Property)("Top")],i.prototype,"newRowPosition",void 0),qt([(0,t.Property)(!0)],i.prototype,"allowEditOnDblClick",void 0),qt([(0,t.Property)(!0)],i.prototype,"showConfirmDialog",void 0),qt([(0,t.Property)(!1)],i.prototype,"showDeleteConfirmDialog",void 0),qt([(0,t.Property)("")],i.prototype,"template",void 0),qt([(0,t.Property)({})],i.prototype,"dialog",void 0),qt([(0,t.Property)(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),Vt=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])},e(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)}}(),Bt=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},Lt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),Bt([(0,t.Property)()],i.prototype,"field",void 0),Bt([(0,t.Property)()],i.prototype,"direction",void 0),i}(t.ChildProperty),zt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),Bt([(0,t.Collection)([],Lt)],i.prototype,"columns",void 0),Bt([(0,t.Property)(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty);function Ft(e,i,r,n,o,a,s){var d,l,p,h=e.value,c=e.action,u=i.grid.getPrimaryKeyFieldNames()[0],g=i.dataSource instanceof tt.DataManager?i.dataSource.dataSource.json:i.dataSource,f=[],y=h,m=!1;if("Batch"===i.editSettings.mode&&(p=i.grid.editModule.getBatchChanges()),"add"===c||"batchsave"===c&&"Batch"===i.editSettings.mode&&p.addedRecords.length){var S=function(e,i,r,n,o,a,s){var d,l=!1,p=r.grid.getCurrentViewRecords();switch(d=ht(d=(0,t.extend)({},e.value)),r.editSettings.newRowPosition){case"Top":i.unshift(d),l=!0;break;case"Bottom":i.push(d),l=!0;break;case"Above":d=(0,t.isNullOrUndefined)(s)?ht(d=(0,t.extend)({},p[o+1])):ht(d=(0,t.extend)({},s));break;case"Below":case"Child":if((0,t.isNullOrUndefined)(s)){var h=r.grid.getPrimaryKeyFieldNames()[0],c=p[parseInt(o.toString(),10)];d=ht(d=!(0,t.isNullOrUndefined)(c)&&c[""+h]===e.value[""+h]||-1!==a?(0,t.extend)({},c):(0,t.extend)({},e.value));var u="internalProperties";r.editModule[""+u].taskData=d}else d=ht(d=(0,t.extend)({},s));-1===a&&(i.unshift(d),l=!0)}return{value:d,isSkip:l}}(e,g,i,0,n,o,s);h=S.value,m=S.isSkip}if(h instanceof Array?f=pt(h):f.push((0,t.extend)({},h)),!m&&("add"!==c||"Top"!==i.editSettings.newRowPosition&&"Bottom"!==i.editSettings.newRowPosition))for(var v=0;v<f.length;v++){"object"==typeof f[parseInt(v.toString(),10)][""+u]&&(f[parseInt(v.toString(),10)]=f[parseInt(v.toString(),10)][""+u]);var w=f[parseInt(v.toString(),10)].taskData?Object.keys(f[parseInt(v.toString(),10)].taskData):Object.keys(f[parseInt(v.toString(),10)]);d=g.length;for(var I=function(){if(g[parseInt(d.toString(),10)][""+u]===f[parseInt(v.toString(),10)][""+u]){if("delete"!==c){if("edit"===c){for(l=0;l<w.length;l++)if(Object.prototype.hasOwnProperty.call(g[parseInt(d.toString(),10)],w[parseInt(l.toString(),10)])&&("Cell"!==i.editSettings.mode||!(0,t.isNullOrUndefined)(p)&&0===p.changedRecords.length||w[parseInt(l.toString(),10)]===a)){var e=ct(i,f[parseInt(v.toString(),10)].uniqueID);g[parseInt(d.toString(),10)][w[parseInt(l.toString(),10)]]=f[parseInt(v.toString(),10)][w[parseInt(l.toString(),10)]],e&&e.taskData&&(e.taskData[w[parseInt(l.toString(),10)]]=e[w[parseInt(l.toString(),10)]]=g[parseInt(d.toString(),10)][w[parseInt(l.toString(),10)]])}}else if("add"===c||"batchsave"===c){var o=void 0;"Child"===i.editSettings.newRowPosition?r?(y.taskData[""+i.parentIdMapping]=g[parseInt(d.toString(),10)][""+i.idMapping],g.splice(d+1,0,y.taskData)):(Object.prototype.hasOwnProperty.call(g[parseInt(d.toString(),10)],i.childMapping)||(g[parseInt(d.toString(),10)][""+i.childMapping]=[]),g[parseInt(d.toString(),10)][""+i.childMapping].push(y.taskData),_t(u,g[parseInt(d.toString(),10)],c,i,r,y)):"Below"===i.editSettings.newRowPosition?(g.splice(d+1,0,y.taskData),(0,t.isNullOrUndefined)(y.parentItem)||_t(u,g[d+1],c,i,r,y)):n?"Above"===i.editSettings.newRowPosition&&(g.splice(d,0,y.taskData),(0,t.isNullOrUndefined)(y.parentItem)||_t(u,g[parseInt(d.toString(),10)],c,i,r,y)):(o=0,g.splice(o,0,y.taskData))}return"break"}var s=g[parseInt(d.toString(),10)];if(g.splice(d,1),r){if(!(0,t.isNullOrUndefined)(s[""+i.parentIdMapping]))for(var h=i.flatData.filter((function(e){return e[""+i.idMapping]===s[""+i.parentIdMapping]}))[0],m=h?h[""+i.childMapping]:[],S=m.length-1;S>=0;S--)if(m[parseInt(S.toString(),10)][""+i.idMapping]===s[""+i.idMapping]){i.enableImmutableMode||h.childRecords.length!==h.Children.length||h.childRecords.splice(S,1),m.splice(S,1),m.length||(h.hasChildRecords=!1,_t(u,h,c,i,r));break}return"break"}}else(0,t.isNullOrUndefined)(g[parseInt(d.toString(),10)][""+i.childMapping])||jt(g[parseInt(d.toString(),10)][""+i.childMapping],f[parseInt(v.toString(),10)],c,u,i,r,y,a)&&_t(u,g[parseInt(d.toString(),10)],c,i,r)};d--&&d>=0;){if("break"===I())break}}}function jt(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=ct(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)){var g="editModule";o.grid.editModule[""+g].editRowIndex=i.index,o.grid.editModule[""+g].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),_t(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),_t(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(e.splice(p,0,s.taskData),(0,t.isNullOrUndefined)(s.parentItem)||_t(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(e.splice(p+1,0,s.taskData),(0,t.isNullOrUndefined)(s.parentItem)||_t(n,e[parseInt(p.toString(),10)],r,o,a,s)):(e.splice(p,1),e.length||(l=!0))}else(0,t.isNullOrUndefined)(e[parseInt(p.toString(),10)][o.childMapping])||jt(e[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&_t(n,e[parseInt(p.toString(),10)],r,o,a);return l}function _t(e,i,r,n,o,a){if("Above"!==n.editSettings.newRowPosition&&"Below"!==n.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||(0,t.isNullOrUndefined)(a.parentItem)){var s,d=n.grid.getCurrentViewRecords();if(d.map((function(t,r){t[""+e]!==i[""+e]||(s=r)})),n.enableVirtualization&&(0,t.isNullOrUndefined)(s)){var l=(0,t.getValue)("uniqueIDCollection."+a.parentUniqueID,n);i=l}if((0,t.isNullOrUndefined)(s)||(i=d[parseInt(s.toString(),10)]),n.enableVirtualization&&(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(a)&&(i=(0,t.getValue)("uniqueIDCollection."+a.parentUniqueID,n)),o||(0,t.isNullOrUndefined)(i.childRecords)||!i.childRecords.length?i.hasChildRecords=!1:i.hasChildRecords=!0,"add"===r||"batchsave"===r){i.expanded=!0,i.hasChildRecords=!0,n.sortSettings.columns.length&&(0,t.isNullOrUndefined)(a)&&(a=d.filter((function(e){return e.parentUniqueID===i.uniqueID?e:null})));var p=a?a instanceof Array?a[0]:a:d[s+1];"Below"!==n.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(i,"childRecords")?(0,t.isNullOrUndefined)(a)||i[""+e]===a[""+e]||i.childRecords.push(a):i.childRecords=[],-1===i.childRecords.indexOf(p)&&i[""+e]!==a[""+e]&&i.childRecords.unshift(p),o&&(Object.prototype.hasOwnProperty.call(i,n.childMapping)||(i[n.childMapping]=[]),-1===i[""+n.childMapping].indexOf(p)&&i[""+e]!==a[""+e]&&i[n.childMapping].unshift(p)))}for(var h=n.grid.getPrimaryKeyFieldNames()[0],c=n.grid.dataSource instanceof tt.DataManager?n.grid.dataSource.dataSource.json:n.grid.dataSource,u=0;u<c.length;u++)if(c[parseInt(u.toString(),10)][""+h]===i[""+h]){c[parseInt(u.toString(),10)]=i;break}n.grid.setRowData(e,i);var g=n.getRowByIndex(s);"Batch"===n.editSettings.mode&&(g="add"===r?n.getRows()[n.grid.getCurrentViewRecords().indexOf(i)]:n.getRows()[n.grid.getRowIndexByPrimaryKey(i[""+e])]);var f=void 0;if((n.frozenRows||n.getFrozenColumns())&&(f=n.getRowByIndex(s)),!n.enableVirtualization&&!(0,t.isNullOrUndefined)(g)||!(0,t.isNullOrUndefined)(f)){var y=n.treeColumnIndex;n.allowRowDragAndDrop&&n.enableImmutableMode&&(y+=1),n.renderModule.cellRender({data:i,cell:g.cells[parseInt(y.toString(),10)]?g.cells[parseInt(y.toString(),10)]:f.cells[y-n.getFrozenColumns()],column:n.grid.getColumns()[n.treeColumnIndex],requestType:r}),(n.enableImmutableMode&&"indenting"===n.action||"outdenting"===n.action)&&n.renderModule.RowModifier({data:i,row:g})}}else{ct(n,a.parentItem.uniqueID).childRecords.push(a)}}var Gt=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])},e(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)}}(),Ht=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},Qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gt(i,e),Ht([(0,t.Property)(!1)],i.prototype,"enableCache",void 0),Ht([(0,t.Property)(3)],i.prototype,"maxBlocks",void 0),Ht([(0,t.Property)(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Kt=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])},e(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)}}(),Wt=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},Yt=function(e){function i(i,n){var o=e.call(this,i,n)||this;o.dataResults={},o.uniqueIDCollection={},o.uniqueIDFilterCollection={},o.changedRecords="changedRecords",o.deletedRecords="deletedRecords",o.addedRecords="addedRecords",o.indentOutdentAction="indentOutdentAction",o.modifiedRecords=[],o.stackedHeader=!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)]))if(!(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},r.Inject(yt,C),(0,t.setValue)("mergePersistData",o.mergePersistTreeGridData,o);(0,t.isNullOrUndefined)(o.injectedModules.Logger)||l.Grid.Inject(l.Logger);o.injectedModules.filter((function(e){"freeze"===e.prototype.getModuleName()&&l.Grid.Inject(l.Freeze)}));return o.grid=new l.Grid,o}var r;return Kt(i,e),r=i,i.prototype.excelExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!1)},i.prototype.csvExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!0)},i.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule.Map(e,t,i,r)},i.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},i.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},i.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},i.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),i=(new tt.UrlAdaptor).processQuery(new tt.DataManager({url:""}),t),r=JSON.parse(i.data),n=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"]));n.filterSettings.columns=r.where,n.searchSettings.fields=r.search&&r.search[0].fields||[],n.sortSettings.columns=r.sorted,n.columns=this.setHeaderText(n.columns,["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"]);var o=this.createElement("form",{id:"ExportForm",styles:"display:none;"}),a=this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}});a.value=JSON.stringify(n),o.method="POST",o.action=e,o.appendChild(a),document.body.appendChild(o),o.submit(),o.remove()},i.prototype.setHeaderText=function(e,i){for(var r=0;r<e.length;r++){var n=this.getColumnByUid(e[parseInt(r.toString(),10)].uid);this.stackedHeader&&(0,t.isNullOrUndefined)(n)&&(n=(0,t.isNullOrUndefined)(e[parseInt(r.toString(),10)].field)?e[parseInt(r.toString(),10)]:this.getColumnByField(e[parseInt(r.toString(),10)].field)),e[parseInt(r.toString(),10)].headerText=n.headerText,(0,t.isNullOrUndefined)(n.template)||(e[parseInt(r.toString(),10)].template="true"),e[parseInt(r.toString(),10)].format&&(e[parseInt(r.toString(),10)].format=(0,l.getNumberFormat)(this.getFormat(n.format),n.type,!1,this.currencyCode),this.isExcel||"datetime"!==n.type&&"date"!==n.type||(e[parseInt(r.toString(),10)].format=e[parseInt(r.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(r.toString(),10)].type=n.type),e[parseInt(r.toString(),10)].columns&&this.setHeaderText(e[parseInt(r.toString(),10)].columns,i);for(var o=Object.keys(e[parseInt(r.toString(),10)]),a=0;a<o.length;a++)i.indexOf(o[parseInt(a.toString(),10)])<0&&delete e[parseInt(r.toString(),10)][o[parseInt(a.toString(),10)]]}return e},i.prototype.getFormat=function(e){return"object"==typeof e?(0,t.isNullOrUndefined)(e.format)?e.skeleton:e.format:e},i.prototype.getModuleName=function(){return"treegrid"},i.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&&(0,t.isNullOrUndefined)(this.childMapping)&&(this.childMapping="Children")},i.prototype.sortByColumn=function(e,i,r){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)){this.trigger(Xe,{error:"The provided value for the columnName and direction is undefined. Please ensure the columnName and direction contains string."})}this.sortModule&&this.sortModule.sortColumn(e,i,r)},i.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},i.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},i.prototype.search=function(e){this.grid.search(e)},i.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},i.prototype.reorderColumns=function(e,i){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)){this.trigger(Xe,{error:"The provided value for the fromFName and toFName is undefined. Please ensure the fromFName and toFName contains string."})}this.grid.reorderColumns(e,i)},i.prototype.TreeGridLocale=function(){if(!(0,t.isNullOrUndefined)(this.locale)){var e=t.L10n.locale,i={};(0,t.setValue)(this.locale,{},i);var r;({}),r=(0,l.getObject)(this.locale,e);var n;({}),n=(0,l.getObject)(this.getModuleName(),r),(0,t.setValue)("grid",n,(0,l.getObject)(this.locale,i)),t.L10n.load(i)}},i.prototype.print=function(){this.printModule.print()},i.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var i=void 0,r=void 0,n=void 0,o=void 0,a=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":n=(i=e.target).closest(".e-rowcell"),(0,t.isNullOrUndefined)(n)||(o=n.closest("tr"),(0,t.isNullOrUndefined)(o)||(0,t.isNullOrUndefined)(o.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(o.querySelector(".e-treegridexpand")));break;case"ctrlShiftDownArrow":n=(i=e.target).closest(".e-rowcell"),(0,t.isNullOrUndefined)(n)||(o=n.closest("tr"),(0,t.isNullOrUndefined)(o)||(0,t.isNullOrUndefined)(o.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(o.querySelector(".e-treegridcollapse")));break;case"downArrow":if(!this.enableVirtualization&&(0,t.isNullOrUndefined)(this.rowTemplate)&&(i=e.target,(0,t.isNullOrUndefined)(i.querySelectorAll(".e-rowcell"))||(i=(0,l.parentsUntil)(i,"e-rowcell")),!(0,t.isNullOrUndefined)(i)&&(r=i.parentElement,!(0,t.isNullOrUndefined)(r)))){var s=r.cellIndex;if("dropdownedit"===this.grid.getColumnByIndex(s).editType&&(0,t.isNullOrUndefined)(this.grid.getColumnByIndex(s).edit.obj)&&(r=i),null!==(a=this.findnextRowElement(r))){var d=i.cellIndex,p=a.children[parseInt(d.toString(),10)];(0,t.addClass)([p],"e-focused"),(0,t.addClass)([p],"e-focus")}else this.clearSelection()}break;case"upArrow":if(!this.enableVirtualization&&(0,t.isNullOrUndefined)(this.rowTemplate)&&(i=e.target,(0,t.isNullOrUndefined)(i.querySelectorAll(".e-rowcell"))||(i=(0,l.parentsUntil)(i,"e-rowcell")),!(0,t.isNullOrUndefined)(i)&&(r=i.parentElement,!(0,t.isNullOrUndefined)(r)))){s=r.cellIndex;if("dropdownedit"===this.grid.getColumnByIndex(s).editType&&(0,t.isNullOrUndefined)(this.grid.getColumnByIndex(s).edit.obj)&&(r=i),null!==(a=this.findPreviousRowElement(r))){var h=i.cellIndex;if(!(0,t.isNullOrUndefined)(h)){var c=a.children[parseInt(h.toString(),10)];(0,t.addClass)([c],"e-focused"),(0,t.addClass)([c],"e-focus")}}else this.clearSelection()}}}},i.prototype.findnextRowElement=function(e){var t=e.nextElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&"none"!==t.style.display||(t=this.findnextRowElement(t)),t},i.prototype.findPreviousRowElement=function(e){var t=e.previousElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&"none"!==t.style.display||(t=this.findPreviousRowElement(t)),t},i.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!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 tt.DataManager)||this.dataSource.dataSource.offline||!(0,t.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof tt.RemoteSaveAdaptor,this.isSelfReference=!(0,t.isNullOrUndefined)(this.parentIdMapping)},i.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)},i.prototype.requiredModules=function(){var e=[];if(this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed)return e;e.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),(0,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.allowResizing&&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()}));return(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||this.grid.getFrozenLeftColumnsCount()||this.grid.getFrozenRightColumnsCount())&&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},i.prototype.extendRequiredModules=function(e){var i=this.injectedModules.filter((function(e){return"rowDragAndDrop"===e.prototype.getModuleName()}));(this.allowRowDragAndDrop||i.length)&&((0,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"}),!(0,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]})},i.prototype.isCommandColumn=function(e){var t=this;return e.some((function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)}))},i.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"))},i.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},i.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),(0,Ct.createSpinner)({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new bt(this),this.dataModule=new Dt(this),this.printModule=new mt(this),this.trigger(D),this.autoGenerateColumns(),this.initialRender=!0,(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=(0,t.createElement)("div",{id:this.element.id+"_gridcontrol"});(0,t.addClass)([this.element],"e-treegrid"),(0,t.isNullOrUndefined)(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),(0,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};var n="root";this.grid[""+n]=this[""+n]?this[""+n]:this,this.grid.appendTo(i),this.actionFailureHandler(),this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var o=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table");(0,t.isNullOrUndefined)(o)||o.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.wireEvents(),this.renderComplete();var a="destroyTemplate",s=this.grid[""+a];this.grid[""+a]=function(i,r){s.apply(e.grid);e.isReact&&(0,t.isNullOrUndefined)(e.portals)||e.clearTemplate(i,r)}},i.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&&!(0,t.isNullOrUndefined)(this.detailTemplate)&&i.push("Virtual scrolling is not compatible with the detail template"),this.stackedHeader&&!(0,t.isNullOrUndefined)(this.detailTemplate)&&i.push("Virtual scrolling is not compatible with the detail template"),!(this.frozenColumns>0||this.columnModel.filter((function(e){return e.isFrozen}))||this.frozenRows>0)||(0,t.isNullOrUndefined)(this.detailTemplate)&&(0,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&&!(0,t.isNullOrUndefined)(this.rowTemplate)&&i.push("Selection is not supported in RowTemplate"),this.treeColumnIndex<0&&i.push("For showing tree structure it is must to set the TreeColumnIndex value."),this.treeColumnIndex>=this.columns.length&&i.push("TreeColumnIndex value should not exceed the total column count."),(this.enableVirtualization&&!/[0-9]$/.test(this.columnModel.filter((function(e){return e.width})).toString())&&!/[px]$/.test(this.columnModel.filter((function(e){return e.width})).toString())||/[0-9]$/.test(this.height.toString())&&/[px]$/.test(this.height.toString()))&&i.push("column width and height should be in pixels"),(0,t.isNullOrUndefined)(this.childMapping)||(0,t.isNullOrUndefined)(this.idMapping)||i.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!(0,t.isNullOrUndefined)(this.idMapping)&&(0,t.isNullOrUndefined)(this.parentIdMapping)||(0,t.isNullOrUndefined)(this.idMapping)&&!(0,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];if(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.")),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(Xe,s)}},i.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")},i.prototype.afterGridRender=function(){(0,t.isNullOrUndefined)(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new Ze(this,this.grid.serviceLocator)},i.prototype.convertTreeData=function(e){var i=this;if(rt(this)&&(e=(0,t.getValue)("result",e)),e instanceof Array&&e.length>0&&Object.prototype.hasOwnProperty.call(e[0],"level"))this.flatData=e,this.flatData.filter((function(e){(0,t.setValue)("uniqueIDCollection."+e.uniqueID,e,i),0===e.level&&i.parentData.push(e)}));else if(rt(this)){var r=(0,t.getValue)("result",this.dataSource);this.dataModule.convertToFlatData(r)}else this.dataModule.convertToFlatData(e)},i.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=(0,l.getActualProperties)(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,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=(0,l.getActualProperties)(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=(0,l.getActualProperties)(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.filterSettings=(0,l.getActualProperties)(this.filterSettings),this.grid.selectionSettings=(0,l.getActualProperties)(this.selectionSettings),this.grid.sortSettings=(0,l.getActualProperties)(this.sortSettings),this.grid.searchSettings=(0,l.getActualProperties)(this.searchSettings),this.grid.aggregates=(0,l.getActualProperties)(this.aggregates),this.grid.textWrapSettings=(0,l.getActualProperties)(this.textWrapSettings),this.grid.printMode=(0,l.getActualProperties)(this.printMode),this.grid.locale=(0,l.getActualProperties)(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=(0,l.getActualProperties)(this.getContextMenu()),this.grid.columnMenuItems=(0,l.getActualProperties)(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=(0,l.getActualProperties)(this.rowTemplate),this.grid.detailTemplate=(0,l.getActualProperties)(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=(0,l.getActualProperties)(this.clipMode);var e="templateDotnetInstance";this.grid[""+e]=this[""+e];this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer},i.prototype.triggerEvents=function(e){this.trigger((0,l.getObject)("name",e),e)},i.prototype.IsExpandCollapseClicked=function(e){(0,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||!(!(0,t.isNullOrUndefined)(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&(0,t.isNullOrUndefined)(e.data))||(e.cancel=!0)},i.prototype.bindGridEvents=function(){var e=this;this.grid.rowSelecting=function(t){e.IsExpandCollapseClicked(t),e.trigger(k,t)},this.grid.rowDeselecting=function(t){e.IsExpandCollapseClicked(t),e.trigger(Te,t)},this.grid.rowSelected=function(t){if(e.enableVirtualization&&t.isHeaderCheckboxClicked&&e.grid.currentViewData.length!==e.grid.selectionModule.selectedRowIndexes.length)for(var i=0;i<e.getRows().length;i++)e.getRows()[parseInt(i.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&e.grid.selectionModule.updateRowSelection(e.getRows()[parseInt(i.toString(),10)],e.getCurrentViewRecords()[parseInt(i.toString(),10)].index);e.selectedRowIndex=e.grid.selectedRowIndex,e.notify(q,t),e.trigger(q,t)},this.grid.rowDeselected=function(i){e.selectedRowIndex=e.grid.selectedRowIndex,(0,t.isNullOrUndefined)(i.data)||e.notify(V,i),e.trigger(V,i)},this.grid.resizeStop=function(t){e.updateColumnModel(),e.trigger(F,t)},this.grid.excelQueryCellInfo=function(t){e.notify("excelCellInfo",t),t=e.dataResults},this.grid.pdfQueryCellInfo=function(t){e.notify("pdfCellInfo",t),t=e.dataResults},this.grid.checkBoxChange=function(t){e.trigger(T,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(),r="rowIndex";i[t[""+r]].classList.contains("e-summaryrow");)t[""+r]++;e.trigger(Z,t)},this.grid.load=function(){if(e.grid.on("initial-end",e.afterGridRender,e),!(0,t.isNullOrUndefined)(e.loggerModule)){e.loggerModule=e.grid.loggerModule=new C(e.grid)}},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(t){e.trigger(Xe,t)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},i.prototype.lastRowBorder=function(e,i){for(var r=0;r<e.cells.length;r++)i?(0,t.addClass)([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell"):(0,t.removeClass)([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell")},i.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},i.prototype.extendedGridDataBoundEvent=function(){var e=this;this.grid.dataBound=function(i){if(e.updateRowTemplate(),e.updateColumnModel(),e.updateAltRow(e.getRows()),e.notify("dataBoundArg",i),it(e)&&!lt(e)&&!e.hasChildMapping){var r=void 0;r=e.dataResults.result?0:1,(0,t.setValue)("grid.contentModule.isLoaded",!(r>0),e)}if(e.isPixelHeight()&&e.initialRender)for(var n=e.getContentTable().rows,o=[].slice.call(n),a=o.length-1;a>0;a--)if(!ut(o[parseInt(a.toString(),10)])){o[parseInt(a.toString(),10)].nextElementSibling&&e.lastRowBorder(o[parseInt(a.toString(),10)],!0);break}var s="action";if(e.enableVirtualization&&e.selectionSettings.persistSelection&&("expand"===e.dataResults[""+s]||"collapse"===e.dataResults[""+s])){if(e.grid.selectionModule.refreshPersistSelection(),"Single"===e.grid.selectionSettings.type){var d=e.getCurrentViewRecords().indexOf(e.grid.selectionModule.data);e.grid.selectionModule.updateRowSelection(e.getRows()[parseInt(d.toString(),10)],d)}}e.trigger(O,i),e.initialRender=!1};var i=this;this.grid.beforeDataBound=function(e){var r=(0,l.getObject)("action",e);if((it(i)&&!lt(i)||rt(this))&&"edit"!==r)i.notify("updateRemoteLevel",e),e=i.dataResults;else if(0===i.flatData.length&<(i)&&i.dataSource instanceof tt.DataManager){var n=i.dataSource;i.dataModule.convertToFlatData(n.dataSource.json),e.result=i.grid.dataSource.dataSource.json=i.flatData}if(it(i)||rt(this)||(0,t.isNullOrUndefined)(i.dataSource)||(this.isPrinting&&(0,t.setValue)("isPrinting",!0,e),i.notify("dataProcessor",e)),(0,t.extend)(e,i.dataResults),i.enableImmutableMode&&(e.result=e.result.slice()),i.initialRender&&(this.contentModule.objectEqualityChecker=i.objectEqualityChecker),!this.isPrinting){var o=new tt.Deferred;return i.trigger(E,e,(function(e){o.resolve(e)})),o}},this.grid.log=function(t,i){e.loggerModule&&e.loggerModule.log(t,i)}},i.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 tt.Deferred;return e.trigger(B,t,(function(r){r.cancel||e.notify(B,t),i.resolve(r)})),i}},this.grid.cellSelecting=function(i){var r=e.grid.selectionModule.actualTarget;(0,t.isNullOrUndefined)(r)||!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||(i.cancel=!0);var n=new tt.Deferred;return e.trigger((0,l.getObject)("name",i),i,(function(e){n.resolve(e)})),n},this.grid.beginEdit=function(i){if((0,t.isNullOrUndefined)(i.row)||!i.row.classList.contains("e-summaryrow")){var r=new tt.Deferred;return e.trigger(ie,i,(function(e){r.resolve(e)})),r}i.cancel=!0}},i.prototype.extendedGridEditEvents=function(){var e=this;this.grid.dataStateChange=function(i){e.isExpandRefresh?(e.isExpandRefresh=!1,e.grid.dataSource={result:e.flatData,count:(0,t.getValue)("count",e.grid.dataSource)}):("infiniteScroll"!==i.action.requestType&&(e.infiniteScrollData=[]),e.trigger(N,i))},this.grid.cellSave=function(i){if(e.grid.isContextMenuOpen()){var r=e.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0];((0,t.isNullOrUndefined)(r)||r.id!==e.element.id+"_gridcontrol_cmenu_Save")&&(i.cancel=!0)}var n=new tt.Deferred;return e.trigger(oe,i,(function(t){t.cancel||e.notify(oe,t),n.resolve(t)})),n},this.grid.cellSaved=function(t){e.trigger(ae,t),e.notify(ae,t)},this.grid.cellEdit=function(t){var i=new tt.Deferred;return t.promise=i,e.notify(se,t),i},this.grid.batchAdd=function(t){e.trigger(pe,t),e.notify(pe,t)},this.grid.beforeBatchSave=function(t){e.trigger(ue,t),e.notify(ue,t)},this.grid.beforeBatchAdd=function(t){e.trigger(ce,t),e.notify(ce,t)},this.grid.batchDelete=function(t){e.trigger(de,t),e.notify(de,t)},this.grid.beforeBatchDelete=function(t){e.trigger(he,t),e.notify(he,t)},this.grid.batchCancel=function(t){"Cell"!==e.editSettings.mode&&e.trigger(le,t),e.notify(le,t)}},i.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())},i.prototype.bindedDataSource=function(){var e="dataSource",i="ready";if(this.dataSource&&rt(this)){var r=this.flatData,n=(0,t.getValue)("count",this.dataSource);this.grid.dataSource={result:r,count:n}}else this.grid.dataSource=this.dataSource instanceof tt.DataManager?new tt.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor):this.flatData;if(this.dataSource instanceof tt.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)){this.grid.dataSource[""+e].json=pt(this.dataSource[""+e].json),this.grid.dataSource[""+i]=this.dataSource.ready;var o=this;(0,t.isNullOrUndefined)(this.grid.dataSource[""+i])||this.grid.dataSource[""+i].then((function(t){var i=o.grid.dataSource;i[""+e].offline=!0,i.isDataAvailable=!0,i[""+e].json=t.result,i.adaptor=new tt.JsonAdaptor}))}},i.prototype.extendedGridActionEvents=function(){var e=this;this.grid.actionBegin=function(i){if("sorting"===i.requestType&&i.target&&i.target.parentElement&&i.target.parentElement.classList.contains("e-hierarchycheckbox")&&(i.cancel=!0),"reorder"===(0,l.getObject)("requestType",i)&&e.notify("getColumnIndex",{}),it(e)&&e.enableVirtualization&&("virtualscroll"===i.requestType?(e.query.expand("VirtualScrollingAction"),e.showSpinner()):"searching"===i.requestType&&""===i.searchString?e.query.expand("ClearSearchingAction"):"clearFilter"===i.action&&e.query.expand("ClearFilteringAction")),e.notify("actionBegin",{editAction:i}),it(e)||(0,t.isNullOrUndefined)(e.filterModule)||rt(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),(0,t.isNullOrUndefined)(e.grid.changedProperties.dataSource)&&(e.grid.renderModule.data.dataManager=e.grid.dataSource instanceof tt.DataManager?e.grid.dataSource:(0,t.isNullOrUndefined)(e.grid.dataSource)?new tt.DataManager:new tt.DataManager(e.grid.dataSource),e.grid.renderModule.data.isQueryInvokedFromData=!0,e.grid.query=e.grid.query instanceof tt.Query?e.grid.query:new tt.Query)),"indenting"!==e.action&&"outdenting"!==e.action){var r=new tt.Deferred;return e.trigger(A,i,(function(t){t.cancel||e.notify(ie,t),r.resolve(t)})),r}},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(re,t),"batchsave"===t.requestType&&e.notify(ge,t),e.notify("updateGridActions",t),"save"===t.requestType&&e.aggregates.map((function(e){return!0===e.showChildSummary})).length&&e.grid.refresh(),"filter"===t.action&&(""===e.filterModule.currentFilterObject||!e.enableVirtualization||e.initialRender||it(e)&&e.enableVirtualization||e.expandAll()),"searching"===t.requestType&&(""===e.searchSettings.key||!e.enableVirtualization||e.initialRender||it(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(U,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("."+Be),o=e.grid.element.querySelector("."+ze);n.style.height=o.style.height="auto"}e.trigger(U,t)}}},i.prototype.extendedGridEvents=function(){var e=this,i=this;this.grid.recordDoubleClick=function(t){e.trigger(ne,t),e.notify(ne,t)},this.grid.detailDataBound=function(t){e.notify("detaildataBound",t),e.trigger(De,t)},this.grid.rowDataBound=function(e){(0,t.isNullOrUndefined)(this.isPrinting)?(0,t.setValue)("isPrinting",!1,e):(0,t.setValue)("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){(0,t.isNullOrUndefined)(this.isPrinting)?(0,t.setValue)("isPrinting",!1,e):(0,t.setValue)("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(t){e.notify(X,t),e.trigger(X,t)},this.grid.contextMenuOpen=function(t){e.notify(J,t),e.trigger(J,t)},this.grid.queryCellInfo=function(t){e.renderModule.cellRender(t)}},i.prototype.bindGridDragEvents=function(){var e=this;this.grid.rowDragStartHelper=function(t){e.trigger(Oe,t)},this.grid.rowDragStart=function(t){e.trigger(Ee,t)},this.grid.rowDrag=function(t){e.grid.isEdit?t.cancel=!0:(e.notify(Ue,t),e.trigger(Me,t))},this.grid.rowDrop=function(t){e.grid.isEdit||e.notify(ke,t),t.cancel=!0}},i.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),(0,t.setValue)("registeredTemplate",this.registeredTemplate,this.grid);(0,t.setValue)("viewContainerRef",this.viewContainerRef,this.grid)},i.prototype.autoGenerateColumns=function(){if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];for(var e=this.dataSource[0],t=Object.keys(e),i=0;i<t.length;i++)-1===[this.childMapping,this.parentIdMapping].indexOf(t[parseInt(i.toString(),10)])&&this.columns.push(t[parseInt(i.toString(),10)])}},i.prototype.getGridEditSettings=function(){var e={},t="guid";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[""+t]=this.editSettings[""+t],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},i.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case ft.AddRow:e.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 ft.RowIndent:e.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 ft.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},i.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale);for(var e=[],i=void 0,r=0;r<this.toolbar.length;r++)switch(this.toolbar[parseInt(r.toString(),10)]){case"Search":case gt.Search:e.push("Search");break;case"Print":case gt.Print:e.push("Print");break;case"ExpandAll":case gt.ExpandAll:i=this.l10n.getConstant("ExpandAll"),e.push({text:i,tooltipText:i,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case gt.CollapseAll:i=this.l10n.getConstant("CollapseAll"),e.push({text:i,tooltipText:i,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case gt.RowIndent:i=this.l10n.getConstant("RowIndent"),e.push({text:i,tooltipText:i,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case gt.RowOutdent:i=this.l10n.getConstant("RowOutdent"),e.push({text:i,tooltipText:i,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(r.toString(),10)])}return e}return null},i.prototype.getGridColumns=function(e,i,r){void 0===i&&(i=!0),void 0===r&&(r=0);var o,a,s=e;i&&(this.columnModel=[]),0===this.columnModel.length&&(r=0===r?-1:r);for(var d=[],l=0;l<s.length;l++){r+=1;var p=this.grid.getColumnByUid(s[parseInt(l.toString(),10)].uid);if(a=p||{},o={},"string"==typeof this.columns[parseInt(l.toString(),10)])a.field=o.field=this.columns[parseInt(l.toString(),10)];else for(var h=0,c=Object.keys(s[parseInt(l.toString(),10)]);h<c.length;h++){var u=c[h];r===this.treeColumnIndex&&"template"===u?o[""+u]=s[parseInt(l.toString(),10)][""+u]:"columns"!==u||(0,t.isNullOrUndefined)(s[parseInt(l.toString(),10)][""+u])?this.initialRender&&!(0,t.isNullOrUndefined)(p)&&this.enablePersistence&&"edit"===u?a[""+u]=o[""+u]=p[""+u]:p&&"sortComparer"===u||(a[""+u]=o[""+u]=s[parseInt(l.toString(),10)][""+u]):(a[""+u]=this.getGridColumns(s[parseInt(l.toString(),10)][""+u],!1,this.columnModel.length-1),o[""+u]=s[parseInt(l.toString(),10)][""+u])}o.columns||this.columnModel.push(new n(o)),d.push(a),!(0,t.isNullOrUndefined)(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&a.field===this.columnModel[this.treeColumnIndex].field&&((0,t.isNullOrUndefined)(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),a.textAlign="Right")}return d},i.prototype.onPropertyChanged=function(e){for(var i=!1,r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];switch(o){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=(0,l.getActualProperties)(this.pageSettings),i=!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=(0,l.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=(0,l.getActualProperties)(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=(0,l.getActualProperties)(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=(0,l.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=(0,l.getActualProperties)(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":if(this.isLocalData=!(this.dataSource instanceof tt.DataManager)||!(0,t.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof tt.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData){if(rt(this)){var a=(0,t.getValue)("count",this.dataSource);this.grid.dataSource={result:this.flatData,count:a}}else{var s=this.dataSource;this.grid.dataSource=s instanceof tt.DataManager?new tt.DataManager(s.dataSource,s.defaultQuery,s.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[""+o]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=(0,l.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;break;case"height":(0,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":(0,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"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":(0,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=(0,l.getActualProperties)(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=(0,l.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=(0,l.getActualProperties)(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=(0,l.getActualProperties)(this.columnMenuItems);break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+o].mode&&("Cell"===e[""+o].mode||"Row"===e[""+o].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings()}i&&this.grid.refresh()}},i.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},i.prototype.destroy=function(){var t=this.element;if(t){var i=!(!t.querySelector(".e-gridheader")||!t.querySelector(".e-gridcontent"));i&&this.unwireEvents(),this.removeListener(),i&&e.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy();for(var r=["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<r.length;n++)this[r[parseInt(n.toString(),10)]]&&(this[r[parseInt(n.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},i.prototype.dataBind=function(){(0,t.isNullOrUndefined)(this.grid)||(!(0,t.isNullOrUndefined)(this.rowDropSettings.targetID)&&(0,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),e.prototype.dataBind.call(this),this.grid.dataBind())},i.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex"],i={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},r=0;r<e.length;r++)for(var n=this[e[parseInt(r.toString(),10)]],o=0,a=i[e[parseInt(r.toString(),10)]];!(0,t.isNullOrUndefined)(a)&&o<a.length;o++){delete n[""+a[parseInt(o.toString(),10)]]}return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},i.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)])},i.prototype.ignoreInColumn=function(e,i){if((0,t.isNullOrUndefined)(i.template))for(var r=0;r<e.length;r++)delete i[e[parseInt(r.toString(),10)]],i.filter={}},i.prototype.mouseClickHandler=function(e){if((0,t.isNullOrUndefined)(e.touches)){var i=e.target;!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(i);if((i.classList.contains("e-treegridexpand")||i.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:i}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map((function(e){return!0===e.showChildSummary})).length){var r=this.grid.getHeaderContent().querySelector(".e-checkselectall");if(this.grid.getSelectedRowIndexes().length===this.getCurrentViewRecords().length){var n=r.nextElementSibling;(0,t.removeClass)([n],["e-stop","e-uncheck"]),(0,t.addClass)([n],["e-check"])}}}},i.prototype.getRows=function(){return this.grid.getRows()},i.prototype.getPager=function(){return this.grid.getPager()},i.prototype.addRecord=function(e,t,i){if(this.editModule){this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i)}},i.prototype.closeEdit=function(){this.grid.editModule&&this.grid.editModule.closeEdit()},i.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},i.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},i.prototype.updateRow=function(e,i){if(this.grid.editModule)if((0,t.isNullOrUndefined)(e))this.grid.editModule.updateRow(e,i);else{var r=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)];(0,t.extend)(r,i),this.grid.editModule.updateRow(e,r)}},i.prototype.deleteRecord=function(e,i){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)||this.getSelectedRecords().length<=0){this.trigger(Xe,{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)},i.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},i.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},i.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},i.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},i.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},i.prototype.deleteRow=function(e){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the tr is undefined. Please ensure the tr contains HTMLTableRowElement."})}this.grid.editModule&&this.grid.editModule.deleteRow(e)},i.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},i.prototype.setCellValue=function(e,i,r){this.grid.setCellValue(e,i,r);var n=this.grid.getRowIndexByPrimaryKey(e),o=this.getCurrentViewRecords()[parseInt(n.toString(),10)];if((0,t.isNullOrUndefined)(o)){this.trigger(Xe,{error:"The provided value for the record is undefined. Please ensure the record contains ITreeData."})}Ft({value:o,action:"edit"},this,this.isSelfReference,o.index,this.grid.selectedRowIndex,i)},i.prototype.setRowData=function(e,t){var i,r=this.getCurrentViewRecords(),n=this.grid.getPrimaryKeyFieldNames()[0],o={};r.some((function(t){return t[""+n]===e&&(o=t,!0)})),i=o.level,t.level=i,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][""+n]){var s=this.getContentTable().scrollHeight,d=this.getContent().clientHeight;this.lastRowBorder(this.getRows()[r.indexOf(o)],s<=d)}},i.prototype.goToPage=function(e){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the pageNo is undefined. Please ensure the pageNo contains number."})}this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},i.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},i.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getColumnByField=function(e){return(0,l.iterateArrayOrObject)(this.columnModel,(function(t){if(t.field===e)return t}))[0]},i.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),(0,l.iterateArrayOrObject)(t,(function(t){if(t.uid===e)return t}))[0]},i.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},i.prototype.getFooterContent=function(){return this.grid.getFooterContent()},i.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},i.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},i.prototype.hideColumns=function(e,i){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the keys is undefined. Please ensure the keys contains string."})}this.grid.hideColumns(e,i),this.updateColumnModel()},i.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},i.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},i.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},i.prototype.getVirtualColIndexByUid=function(e){var i=(0,l.iterateArrayOrObject)(this.grid.columnModel,(function(t,i){if(t.uid===e)return i}))[0];return(0,t.isNullOrUndefined)(i)?-1:i},i.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},i.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},i.prototype.updateColumnModel=function(e){var i,r,o,a=(0,t.isNullOrUndefined)(e)?this.grid.getColumns():e;if(-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!(0,t.isNullOrUndefined)(this.columnModel[this.treeColumnIndex].template)&&(i=this.columnModel[this.treeColumnIndex].template,r=this.columnModel[this.treeColumnIndex].field),!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===a.length){this.columnModel=[];for(var s=0;s<a.length;s++){o={};for(var d=0,l=Object.keys(a[parseInt(s.toString(),10)]);d<l.length;d++){var p=l[d];o[""+p]=a[parseInt(s.toString(),10)][""+p]}this.columnModel.push(new n(o)),r!==this.columnModel[parseInt(s.toString(),10)].field||"checkbox"===this.columnModel[parseInt(s.toString(),10)].type||(0,t.isNullOrUndefined)(i)||""===i||(this.columnModel[parseInt(s.toString(),10)].template=i)}}var h="deepMerge";return this[""+h]=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&this.allowResizing&&!(0,t.isNullOrUndefined)(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||(0,t.isNullOrUndefined)(this.columns)||(0,t.merge)(this.columns,this.columnModel),this[""+h]=void 0,this.columnModel},i.prototype.updateColumnsWidth=function(e){var i=this;e.forEach((function(e){if(!(0,t.isNullOrUndefined)(e)&&e.columns)i.updateColumnsWidth(e.columns);else if(!(0,t.isNullOrUndefined)(e)&&e.field){var r=i.grid.getColumnByField(e.field);(0,t.isNullOrUndefined)(r)||(e.width=r.width)}}))},i.prototype.getContent=function(){return this.grid.getContent()},i.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},i.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},i.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this.grid)},i.prototype.splitFrozenCount=function(e){this.grid.splitFrozenCount.apply(this.grid,[e])},i.prototype.isFrozenGrid=function(){return this.grid.isFrozenGrid()},i.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:(0,l.getObject)("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:(0,l.getObject)("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:(0,l.getObject)("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:(0,l.getObject)("properties",this.grid.sortSettings)},!0)},i.prototype.getContentTable=function(){return this.grid.getContentTable()},i.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},i.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter((function(e){return(0,t.isNullOrUndefined)(e.isSummaryRow)}))},i.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},i.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},i.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},i.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},i.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},i.prototype.getVisibleColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var r=i[t];r.visible&&e.push(r)}return e},i.prototype.showSpinner=function(){(0,Ct.showSpinner)(this.element)},i.prototype.hideSpinner=function(){(0,Ct.hideSpinner)(this.element)},i.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),rt(this)||(this.dataSource instanceof tt.DataManager?this.grid.setProperties({dataSource:new tt.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},i.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},i.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+=dt(t[parseInt(i.toString(),10)]).length);return e},i.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},i.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},i.prototype.refreshColumns=function(e){(0,t.isNullOrUndefined)(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},i.prototype.refreshHeader=function(){this.grid.refreshHeader()},i.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)}},i.prototype.expandRow=function(e,i,r,n){var o=this;if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)&&(0,t.isNullOrUndefined)(n)){this.trigger(Xe,{error:"The provided value for the row is undefined. Please ensure the row contains row element."})}var a=this.parentData;if(this.enableVirtualization||(a=this.flatData.filter((function(e){return e.hasChildRecords}))),i=this.getCollapseExpandRecords(e,i),!(0,t.isNullOrUndefined)(e)&&e.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(e,!1),this.isExpandAll&&!it(this)){var s={data:a,row:e,cancel:!1},d=!1;this.grid.pagerModule&&!(0,t.isNullOrUndefined)(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(d=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||d&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(e,i,a):this.trigger(_,s,(function(s){o.expandAllPrevent=s.cancel,s.cancel||(0,t.isNullOrUndefined)(i)||(s.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,a))})),this.isExpandingEventTriggered=!0}else if(!this.isExpandAll||this.isExpandAll&&it(this)){s={data:i,row:e,cancel:!1};this.trigger(_,s,(function(t){t.cancel||(t.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,a))}))}},i.prototype.expandRows=function(e,i,r){this.expandCollapse("expand",e,i);if((!it(this)||lt(this))&&(!rt(this)||!(0,t.isNullOrUndefined)(i.Children))){var n={data:i,row:e};(0,t.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,n={data:r,row:e},this.trigger(j,n)):this.isExpandAll||this.trigger(j,n)}},i.prototype.expandCollapseAllChildren=function(e,i,r,n){if(((0,t.isNullOrUndefined)(r)||e[this.getPrimaryKeyFieldNames()[0]]===r)&&((0,t.isNullOrUndefined)(n)||n===e.level)){var o=dt(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)])}},i.prototype.getCollapseExpandRecords=function(e,i){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&(0,t.isNullOrUndefined)(i)&&!it(this)?i=this.flatData.filter((function(e){return e.hasChildRecords})):(0,t.isNullOrUndefined)(i)&&(i=this.detailTemplate?this.grid.getCurrentViewRecords()[e.getAttribute("data-rowindex")]:this.enableVirtualization&&this.isCollapseAll?this.isExpandAll&&-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("data-rowindex"),10)]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("data-rowindex"),10)]),i},i.prototype.collapseRow=function(e,i,r){var n=this;if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)){this.trigger(Xe,{error:"The provided value for the row is undefined. Please ensure the row contains row element."})}var o=this.parentData;if(this.enableVirtualization||(o=this.flatData.filter((function(e){return e.hasChildRecords}))),i=this.getCollapseExpandRecords(e,i),this.isCollapseAll&&!it(this)){var a={data:o,row:e,cancel:!1};this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(e,i,o):this.trigger(H,a,(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&&it(this)){a={data:i,row:e,cancel:!1};this.trigger(H,a,(function(r){r.cancel||(0,t.isNullOrUndefined)(i)||n.collapseRows(e,i,o)}))}},i.prototype.collapseRows=function(e,i,r){this.expandCollapse("collapse",e,i);var n={data:i,row:e};it(this)||((0,t.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,n={data:r,row:e},this.trigger(G,n)):this.isCollapseAll||this.trigger(G,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()))},i.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,Ft({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,Ft({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},i.prototype.expandAtLevel=function(e){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the level is undefined. Please ensure the level contains number."})}if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!it(this)){var i=this.grid.dataSource.filter((function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!0),t.hasChildRecords&&t.level===e}));this.expandAction(i,null,e,!0)}else{i=this.getRecordDetails(e);var r=(0,l.getObject)("records",i);this.expandAction(r,null,e)}},i.prototype.expandByKey=function(e){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the key is undefined. Please ensure the key contains number."})}this.expandCollapseActionByKey(e,"Expand")},i.prototype.expandAction=function(e,i,r,n){void 0===n&&(n=!1);for(var o=function(o){if(!(0,t.isNullOrUndefined)(e[parseInt(o.toString(),10)].parentItem)){var s=e[parseInt(o.toString(),10)].parentItem.uniqueID,d=a.flatData.filter((function(e){return e.uniqueID===s}));it(a)&&(d=a.getCurrentViewRecords().filter((function(e){return e.uniqueID===s}))),!1===d[0].expanded?(e.push(d[0]),d[0].expanded=!0):st(a,d[0],a.parentData)||d[0].expanded&&void 0!==d[0].parentItem&&e.push(d[0])}n||a.expandRow(null,e[parseInt(o.toString(),10)],i,r)},a=this,s=0;s<e.length;s++)o(s);n&&this.expandRow(null,e,i,r)},i.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}},i.prototype.collapseAtLevel=function(e){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the level is undefined. Please ensure the level contains number."})}if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!it(this)){var i=this.grid.dataSource.filter((function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!1),t.hasChildRecords&&t.level===e}));this.collapseAction(i,null,!0)}else{var r=this.getRecordDetails(e),n=(0,l.getObject)("records",r);this.collapseAction(n)}},i.prototype.collapseByKey=function(e){if((0,t.isNullOrUndefined)(e)){this.trigger(Xe,{error:"The provided value for the key is undefined. Please ensure the key contains number."})}this.expandCollapseActionByKey(e,"Collapse")},i.prototype.expandCollapseActionByKey=function(e,i){var r=this.getPrimaryKeyFieldNames()[0],n=it(this)?this.getCurrentViewRecords():this.grid.dataSource;if(!(0,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)}},i.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}},i.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger(Xe,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,this.expandCollapseAll("expand")},i.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger(Xe,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,this.expandCollapseAll("collapse")},i.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"))})),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization||this.enableInfiniteScrolling)&&!it(this)){if(this.flatData.filter((function(t){t.hasChildRecords&&(t.expanded="collapse"!==e)})),i.length)for(var r=0;r<i.length;r++)"collapse"===e?(0,t.isNullOrUndefined)(this.getCurrentViewRecords()[i[parseInt(r.toString(),10)].rowIndex])||this.collapseRow(i[parseInt(r.toString(),10)]):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(r.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(r=0;r<i.length;r++)"collapse"===e?this.collapseRow(i[parseInt(r.toString(),10)]):this.expandRow(i[parseInt(r.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},i.prototype.expandCollapse=function(e,i,r,n){var o,a=this,s={row:i,data:r,childData:[],requestType:e},d=this.grid.currentViewData.filter((function(e){return e.parentUniqueID===r.uniqueID}));(!it(this)&&"expand"===e&&this.isSelfReference&&rt(this)&&!d.length||"collapse"===e||this.isExpandAll&&this.loadChildOnDemand&&!it(this)&&this.isSelfReference&&rt(this))&&this.updateChildOnDemand(s);var l,p=this.getRows();if(this.rowTemplate){var h=this.getContentTable().rows;p=[].slice.call(h)}if((0,t.isNullOrUndefined)(i)?(l=this.grid.currentViewData.indexOf(r),i=p[parseInt(l.toString(),10)]):l=+i.getAttribute("data-rowindex"),(0,t.isNullOrUndefined)(i)||i.setAttribute("aria-expanded","expand"===e?"true":"false"),!(this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)||it(this)||rt(this)){var c=void 0;if("expand"===e){if(c="table-row",n||(r.expanded=!0,this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),(0,t.isNullOrUndefined)(i)||(o=i.getElementsByClassName("e-treegridcollapse")[0]),n&&!(0,t.isNullOrUndefined)(r[this.expandStateMapping])&&r[this.expandStateMapping]&&(0,t.isNullOrUndefined)(o)&&(o=i.getElementsByClassName("e-treegridexpand")[0]),(0,t.isNullOrUndefined)(o))return;o.classList.contains("e-treegridexpand")||(0,t.addClass)([o],"e-treegridexpand"),(0,t.removeClass)([o],"e-treegridcollapse")}else{if(c="none",n&&!rt(this)||(r.expanded=!1,this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),(0,t.isNullOrUndefined)(i)||(o=i.getElementsByClassName("e-treegridexpand")[0]),n&&!(0,t.isNullOrUndefined)(r[this.expandStateMapping])&&!r[this.expandStateMapping]&&(0,t.isNullOrUndefined)(o)&&(o=i.getElementsByClassName("e-treegridcollapse")[0]),(0,t.isNullOrUndefined)(o))return;o.classList.contains("e-treegridcollapse")||(0,t.addClass)([o],"e-treegridcollapse"),(0,t.removeClass)([o],"e-treegridexpand")}i.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");var u=p.filter((function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))}));if(it(this)&&!lt(this))this.remoteExpand(e,i,r);else{rt(this)&&!d.length&&"collapse"!==e||this.localExpand(e,i,r);var g=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,f=this.getRowByIndex(g);this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!(0,t.isNullOrUndefined)(f)&&!f.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(f,!0)}if(rt(this)&&"expand"===e){var y=this.getCurrentViewRecords().filter((function(e){return st(a,e,a.parentData)}));this.dataResults.result=y}if(!(0,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 m=this.getRows(),S=(h=this.getContentTable().rows,(m=[].slice.call(h)).length-1);S>=0;S--)if(!ut(m[parseInt(S.toString(),10)])){var v=this.getContentTable().scrollHeight,w=this.getContent().clientHeight;this.lastRowBorder(m[parseInt(S.toString(),10)],v<=w);break}this.notify("rowExpandCollapse",{detailrows:u,action:c,record:r,row:i}),this.updateAltRow(p)}else this.notify(K,{action:e,row:i,record:r})},i.prototype.updateChildOnDemand=function(e){var i=this;if("collapse"===e.requestType&&rt(this)){for(var r=this.flatData.slice(),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].parentUniqueID===e.data.uniqueID&&(r.splice(n,1),n-=1);this.dataResults.result=r}else{var o=new tt.Deferred;e.childDataBind=o.resolve;var a=e.data;this.trigger(N,e),o.promise.then((function(){if(e.childData.length){rt(i)&&(i.flatData=i.dataResults.result),i.enableInfiniteScrolling&&rt(i)&&(i.flatData=i.infiniteScrollData);for(var r=i.flatData,n=0,o=0;o<r.length;o++)if(r[parseInt(o.toString(),10)].taskData===a.taskData){n=o;break}var s=(0,t.getValue)("result",i.dataSource),d=pt(e.childData),p=a[i.childMapping]&&a[i.childMapping].length>d.length?a[i.childMapping].length:d.length;for(o=0;o<p;o++)a[i.childMapping]&&s.filter((function(e,t){e[i.parentIdMapping]===a[i.idMapping]&&s.splice(t,1)})),d[parseInt(o.toString(),10)]?(d[parseInt(o.toString(),10)].level=a.level+1,d[parseInt(o.toString(),10)].index=Math.ceil(1e3*Math.random()),d[parseInt(o.toString(),10)].parentItem=(0,t.extend)({},a),d[parseInt(o.toString(),10)].taskData=(0,t.extend)({},d[parseInt(o.toString(),10)]),delete d[parseInt(o.toString(),10)].parentItem.childRecords,delete d[parseInt(o.toString(),10)].taskData.parentItem,d[parseInt(o.toString(),10)].parentUniqueID=a.uniqueID,d[parseInt(o.toString(),10)].uniqueID=(0,l.getUid)(i.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+d[parseInt(o.toString(),10)].uniqueID,d[parseInt(o.toString(),10)],i),(!(0,t.isNullOrUndefined)(d[parseInt(o.toString(),10)][i.childMapping])||d[parseInt(o.toString(),10)][i.hasChildMapping]&&rt(i))&&(d[parseInt(o.toString(),10)].hasChildRecords=!0),rt(i)&&a[i.childMapping]&&a[i.childMapping][parseInt(o.toString(),10)]?r.splice(n+1+o,0,d[parseInt(o.toString(),10)]):r.splice(n+1+o,a[i.childMapping]&&a[i.childMapping][parseInt(o.toString(),10)]?1:0,d[parseInt(o.toString(),10)])):r.splice(n+1+o,1);r[parseInt(n.toString(),10)][""+i.childMapping]=d,r[parseInt(n.toString(),10)].childRecords=d,r[parseInt(n.toString(),10)].expanded=!0,(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],i);for(var h=0;h<e.childData.length;h++)s.push(e.childData[parseInt(h.toString(),10)])}rt(i)&&i.loadChildOnDemand&&"expand"===e.requestType&&(i.dataResults.expandRecord={},i.dataResults.expandRecord=e.data),i.isExpandRefresh=!0;var c=i.getContentTable().parentElement.scrollTop;i.grid.refresh(),i.enableInfiniteScrolling&&(i.getContentTable().parentElement.scrollTop=c),i.trigger(j,e)}))}},i.prototype.remoteExpand=function(e,t,i){var r=this.getRows();if(this.rowTemplate){var n=this.getContentTable().rows;r=[].slice.call(n)}var o,a={data:i,row:t};if(o=r.filter((function(e){return e.querySelector(".e-gridrowindex"+i.index+"level"+(i.level+1))||e.querySelector(".e-gridrowindex"+i.index+"level0.e-summarycell")})),"expand"===e){this.notify(Q,{record:i,rows:o,parentRow:t});var s={row:t,data:i};o.length>0&&this.trigger(j,s)}else"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:a.data,rows:null,parentRow:a.row}):(this.collapseRemoteChild({record:i,rows:o}),this.trigger(G,a))},i.prototype.localExpand=function(e,i,r){var n,o,a,s=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=this.getRows();if(this.rowTemplate){var l=this.getContentTable().rows;d=[].slice.call(l)}var p="expand"===e?"table-row":"none",h=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging){n=[];for(var c=0;c<s.length;c++){var u=this.grid.getRowIndexByPrimaryKey(s[parseInt(c.toString(),10)][""+h]);n.push(this.getRows()[parseInt(u.toString(),10)])}}else n=d.filter((function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}));var g=this.grid.getFrozenLeftColumnsCount()>0||this.grid.getFrozenRightColumnsCount()>0;(this.frozenRows||this.frozenColumns||this.getFrozenColumns()||g)&&(o=this.getRows().filter((function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}))),g&&(a=this.getRows().filter((function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})));var f=this.grid.getRowsObject(),y=this.grid.currentViewData,m=y.filter((function(e){return e.uniqueID===r.uniqueID})),S=y.indexOf(m[0]);(0,t.isNullOrUndefined)(f[parseInt(S.toString(),10)].visible)||!1===f[parseInt(S.toString(),10)].visible||(f[parseInt(S.toString(),10)].visible=!0);var v=d.filter((function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))}));for(c=0;c<n.length;c++){if((0,t.isNullOrUndefined)(n[parseInt(c.toString(),10)])||(n[parseInt(c.toString(),10)].style.display=p),!(0,t.isNullOrUndefined)(n[parseInt(c.toString(),10)])&&!this.allowPaging&&!(this.enableVirtualization||this.enableInfiniteScrolling||it(this)||rt(this))){f[n[parseInt(c.toString(),10)].rowIndex].visible="none"!==p;var w=y.filter((function(e){return e.uniqueID===m[0].parentUniqueID}));!(0,t.isNullOrUndefined)(w[0])&&d[y.indexOf(w[0])].getElementsByClassName("e-treegridcollapse").length&&(f[parseInt(S.toString(),10)].visible=!1)}(0,t.isNullOrUndefined)(o)||(o[parseInt(c.toString(),10)].style.display=p),(0,t.isNullOrUndefined)(a)||(a[parseInt(c.toString(),10)].style.display=p),this.notify("childRowExpand",{row:n[parseInt(c.toString(),10)]}),!(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)].childRecords)&&s[parseInt(c.toString(),10)].childRecords.length>0&&("expand"!==e||(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)].expanded)||s[parseInt(c.toString(),10)].expanded)&&(this.expandCollapse(e,n[parseInt(c.toString(),10)],s[parseInt(c.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex&&!(0,t.isNullOrUndefined)(o)&&this.expandCollapse(e,o[parseInt(c.toString(),10)],s[parseInt(c.toString(),10)],!0))}for(c=0;c<v.length;c++)(0,t.isNullOrUndefined)(v[parseInt(c.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||it(this)||rt(this)||(f[v[parseInt(c.toString(),10)].rowIndex].visible="none"!==p,v[parseInt(c.toString(),10)].style.display=p);this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||it(this)||rt(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},i.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)];"none"!==n.style.display&&(n.classList.contains("e-altrow")&&(0,t.removeClass)([n],"e-altrow"),i%2==0||n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||(0,t.addClass)([n],"e-altrow"),n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||i++)}},i.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)}},i.prototype.collapseRemoteChild=function(e,i){(0,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++){o[parseInt(l.toString(),10)].style.display="none",r=o[parseInt(l.toString(),10)];var p=o[parseInt(l.toString(),10)].querySelector(".e-detailrowexpand");if((0,t.isNullOrUndefined)(p)||this.grid.detailRowModule.collapse(p),d&&(a[parseInt(l.toString(),10)].style.display="none",s[parseInt(l.toString(),10)].style.display="none",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,!(0,t.isNullOrUndefined)(h)&&n.expanded&&((0,t.removeClass)([h],"e-treegridexpand"),(0,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)}}},i.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?t.SanitizeHtmlHelper.sanitize(e):e},i.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.grid.getColumns()[this.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.action&&"outdenting"!==this.action||this.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},i.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this)},i.prototype.updateResultModel=function(e){this.dataResults=e},i.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender))},i.prototype.filterByColumn=function(e,i,r,n,o,a,s,d){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)){this.trigger(Xe,{error:"The provided value for the fieldName, filterOperator and filterValue are undefined. Please ensure the fieldName, filterOperator and filterValue."})}this.grid.filterByColumn(e,i,r,n,o,a,s,d)},i.prototype.clearFiltering=function(){this.grid.clearFiltering()},i.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},i.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},i.prototype.selectRows=function(e){this.grid.selectRows(e)},i.prototype.clearSelection=function(){this.grid.clearSelection()},i.prototype.copy=function(e){this.clipboardModule.copy(e)},i.prototype.paste=function(e,i,r){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)){this.trigger(Xe,{error:"The provided value for the index is undefined. Please ensure the index contains number."})}this.clipboardModule.paste(e,i,r)},i.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},i.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},i.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},i.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getMovableRows=function(){return this.grid.getRows()},i.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getFrozenRightRows=function(){return this.grid.getRows()},i.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},i.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},i.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},i.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},i.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},i.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},i.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},i.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},i.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},i.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},i.prototype.getFrozenColumns=function(){return this.getFrozenCount(!(0,t.isNullOrUndefined)(this.columns)&&this.columns,0)+this.frozenColumns},i.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},i.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},i.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},i.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},i.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},i.prototype.reorderRows=function(e,i,r){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(r)){this.trigger(Xe,{error:"The provided value for the fromIndexes, toIndex and position is undefined. Please ensure the fromIndexes and toIndex contains number and position contains string."})}this.rowDragAndDropModule.reorderRows(e,i,r)},i.prototype.indent=function(e){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"indent")},i.prototype.outdent=function(e){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent")},Wt([(0,t.Property)(0)],i.prototype,"frozenRows",void 0),Wt([(0,t.Property)(0)],i.prototype,"frozenColumns",void 0),Wt([(0,t.Property)("Ellipsis")],i.prototype,"clipMode",void 0),Wt([(0,t.Property)([])],i.prototype,"columns",void 0),Wt([(0,t.Property)(null)],i.prototype,"childMapping",void 0),Wt([(0,t.Property)(null)],i.prototype,"hasChildMapping",void 0),Wt([(0,t.Property)(0)],i.prototype,"treeColumnIndex",void 0),Wt([(0,t.Property)(null)],i.prototype,"idMapping",void 0),Wt([(0,t.Property)(null)],i.prototype,"parentIdMapping",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableCollapseAll",void 0),Wt([(0,t.Property)(null)],i.prototype,"expandStateMapping",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowRowDragAndDrop",void 0),Wt([(0,t.Property)([])],i.prototype,"dataSource",void 0),Wt([(0,t.Property)()],i.prototype,"query",void 0),Wt([(0,t.Property)()],i.prototype,"cloneQuery",void 0),Wt([(0,t.Property)("AllPages")],i.prototype,"printMode",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowPaging",void 0),Wt([(0,t.Property)(!1)],i.prototype,"loadChildOnDemand",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowTextWrap",void 0),Wt([(0,t.Complex)({},v)],i.prototype,"textWrapSettings",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowReordering",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowResizing",void 0),Wt([(0,t.Property)(!1)],i.prototype,"autoCheckHierarchy",void 0),Wt([(0,t.Complex)({},Pt)],i.prototype,"pageSettings",void 0),Wt([(0,t.Complex)({},l.RowDropSettings)],i.prototype,"rowDropSettings",void 0),Wt([(0,t.Property)("USD")],i.prototype,"currencyCode",void 0),Wt([(0,t.Property)()],i.prototype,"pagerTemplate",void 0),Wt([(0,t.Property)(!1)],i.prototype,"showColumnMenu",void 0),Wt([(0,t.Property)(!1)],i.prototype,"showColumnChooser",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowSorting",void 0),Wt([(0,t.Property)(!0)],i.prototype,"allowMultiSorting",void 0),Wt([(0,t.Complex)({},zt)],i.prototype,"sortSettings",void 0),Wt([(0,t.Collection)([],Ut)],i.prototype,"aggregates",void 0),Wt([(0,t.Complex)({},Tt)],i.prototype,"editSettings",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowFiltering",void 0),Wt([(0,t.Property)()],i.prototype,"detailTemplate",void 0),Wt([(0,t.Complex)({},y)],i.prototype,"filterSettings",void 0),Wt([(0,t.Complex)({},wt)],i.prototype,"searchSettings",void 0),Wt([(0,t.Property)()],i.prototype,"toolbar",void 0),Wt([(0,t.Property)()],i.prototype,"toolbarTemplate",void 0),Wt([(0,t.Property)("Default")],i.prototype,"gridLines",void 0),Wt([(0,t.Property)()],i.prototype,"contextMenuItems",void 0),Wt([(0,t.Property)()],i.prototype,"columnMenuItems",void 0),Wt([(0,t.Property)()],i.prototype,"rowTemplate",void 0),Wt([(0,t.Property)("Parent")],i.prototype,"copyHierarchyMode",void 0),Wt([(0,t.Property)(null)],i.prototype,"rowHeight",void 0),Wt([(0,t.Property)(!0)],i.prototype,"enableAltRow",void 0),Wt([(0,t.Property)(!0)],i.prototype,"allowKeyboard",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableHover",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableAutoFill",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableAdaptiveUI",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableImmutableMode",void 0),Wt([(0,t.Property)("auto")],i.prototype,"height",void 0),Wt([(0,t.Property)("auto")],i.prototype,"width",void 0),Wt([(0,t.Complex)({},c)],i.prototype,"loadingIndicator",void 0),Wt([(0,t.Property)(!0)],i.prototype,"enableVirtualMaskRow",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableVirtualization",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableColumnVirtualization",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableHtmlSanitizer",void 0),Wt([(0,t.Property)(!1)],i.prototype,"enableInfiniteScrolling",void 0),Wt([(0,t.Complex)({},Qt)],i.prototype,"infiniteScrollSettings",void 0),Wt([(0,t.Property)("All")],i.prototype,"columnQueryMode",void 0),Wt([(0,t.Event)()],i.prototype,"created",void 0),Wt([(0,t.Event)()],i.prototype,"load",void 0),Wt([(0,t.Event)()],i.prototype,"expanding",void 0),Wt([(0,t.Event)()],i.prototype,"expanded",void 0),Wt([(0,t.Event)()],i.prototype,"collapsing",void 0),Wt([(0,t.Event)()],i.prototype,"collapsed",void 0),Wt([(0,t.Event)()],i.prototype,"cellSave",void 0),Wt([(0,t.Event)()],i.prototype,"cellSaved",void 0),Wt([(0,t.Event)()],i.prototype,"actionBegin",void 0),Wt([(0,t.Event)()],i.prototype,"actionComplete",void 0),Wt([(0,t.Event)()],i.prototype,"beginEdit",void 0),Wt([(0,t.Event)()],i.prototype,"batchAdd",void 0),Wt([(0,t.Event)()],i.prototype,"batchDelete",void 0),Wt([(0,t.Event)()],i.prototype,"batchCancel",void 0),Wt([(0,t.Event)()],i.prototype,"beforeBatchAdd",void 0),Wt([(0,t.Event)()],i.prototype,"beforeBatchDelete",void 0),Wt([(0,t.Event)()],i.prototype,"beforeBatchSave",void 0),Wt([(0,t.Event)()],i.prototype,"cellEdit",void 0),Wt([(0,t.Event)()],i.prototype,"actionFailure",void 0),Wt([(0,t.Event)()],i.prototype,"dataBound",void 0),Wt([(0,t.Event)()],i.prototype,"dataSourceChanged",void 0),Wt([(0,t.Event)()],i.prototype,"dataStateChange",void 0),Wt([(0,t.Event)()],i.prototype,"recordDoubleClick",void 0),Wt([(0,t.Event)()],i.prototype,"rowDataBound",void 0),Wt([(0,t.Event)()],i.prototype,"detailDataBound",void 0),Wt([(0,t.Event)()],i.prototype,"queryCellInfo",void 0),Wt([(0,t.Property)(!0)],i.prototype,"allowSelection",void 0),Wt([(0,t.Event)()],i.prototype,"rowSelecting",void 0),Wt([(0,t.Event)()],i.prototype,"rowSelected",void 0),Wt([(0,t.Event)()],i.prototype,"rowDeselecting",void 0),Wt([(0,t.Event)()],i.prototype,"rowDeselected",void 0),Wt([(0,t.Event)()],i.prototype,"headerCellInfo",void 0),Wt([(0,t.Event)()],i.prototype,"cellSelecting",void 0),Wt([(0,t.Event)()],i.prototype,"columnMenuOpen",void 0),Wt([(0,t.Event)()],i.prototype,"columnMenuClick",void 0),Wt([(0,t.Event)()],i.prototype,"cellSelected",void 0),Wt([(0,t.Event)()],i.prototype,"cellDeselecting",void 0),Wt([(0,t.Event)()],i.prototype,"cellDeselected",void 0),Wt([(0,t.Event)()],i.prototype,"resizeStart",void 0),Wt([(0,t.Event)()],i.prototype,"resizing",void 0),Wt([(0,t.Event)()],i.prototype,"resizeStop",void 0),Wt([(0,t.Event)()],i.prototype,"columnDragStart",void 0),Wt([(0,t.Event)()],i.prototype,"columnDrag",void 0),Wt([(0,t.Event)()],i.prototype,"columnDrop",void 0),Wt([(0,t.Event)()],i.prototype,"checkboxChange",void 0),Wt([(0,t.Event)()],i.prototype,"printComplete",void 0),Wt([(0,t.Event)()],i.prototype,"beforePrint",void 0),Wt([(0,t.Event)()],i.prototype,"toolbarClick",void 0),Wt([(0,t.Event)()],i.prototype,"beforeDataBound",void 0),Wt([(0,t.Event)()],i.prototype,"contextMenuOpen",void 0),Wt([(0,t.Event)()],i.prototype,"contextMenuClick",void 0),Wt([(0,t.Event)()],i.prototype,"beforeCopy",void 0),Wt([(0,t.Event)()],i.prototype,"beforePaste",void 0),Wt([(0,t.Event)()],i.prototype,"rowDrag",void 0),Wt([(0,t.Event)()],i.prototype,"rowDragStart",void 0),Wt([(0,t.Event)()],i.prototype,"rowDragStartHelper",void 0),Wt([(0,t.Event)()],i.prototype,"rowDrop",void 0),Wt([(0,t.Property)(-1)],i.prototype,"selectedRowIndex",void 0),Wt([(0,t.Complex)({},xt)],i.prototype,"selectionSettings",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowExcelExport",void 0),Wt([(0,t.Property)(!1)],i.prototype,"allowPdfExport",void 0),Wt([(0,t.Event)()],i.prototype,"pdfQueryCellInfo",void 0),Wt([(0,t.Event)()],i.prototype,"pdfHeaderQueryCellInfo",void 0),Wt([(0,t.Event)()],i.prototype,"excelQueryCellInfo",void 0),Wt([(0,t.Event)()],i.prototype,"excelHeaderQueryCellInfo",void 0),Wt([(0,t.Event)()],i.prototype,"beforeExcelExport",void 0),Wt([(0,t.Event)()],i.prototype,"excelExportComplete",void 0),Wt([(0,t.Event)()],i.prototype,"beforePdfExport",void 0),Wt([(0,t.Event)()],i.prototype,"pdfExportComplete",void 0),i=r=Wt([t.NotifyPropertyChanges],i)}(t.Component),Jt=function(){function e(e){l.Grid.Inject(l.Reorder),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.getTreeColumn,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.getTreeColumn)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getTreeColumn=function(){for(var e,t=this.parent.columnModel[this.parent.treeColumnIndex],i=this.parent.getColumns(),r=0;r<i.length;r++){if((0,l.getObject)("field",t)===(0,l.getObject)("field",i[parseInt(r.toString(),10)])){e=r;break}}this.parent.setProperties({treeColumnIndex:e},!0)},e}(),Xt=function(){function e(e){l.Grid.Inject(l.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}(),$t=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,l.Grid.Inject(l.RowDD),this.parent=e,this.addEventListener()}return e.prototype.getChildrecordsByParentID=function(e){return(this.parent.dataSource instanceof tt.DataManager&<(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(Ue,this.Rowdraging,this),this.parent.on(ke,this.rowDropped,this),this.parent.on(Ae,this.rowsAdded,this),this.parent.on(Ne,this.rowsRemoved,this)},e.prototype.reorderRows=function(e,i,r){var n=this.parent,o="action",a="updateRowAndCellElements";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 s=[],d=0;d<e.length;d++){var l=this.parent.getRowByIndex(e[parseInt(d.toString(),10)]).rowIndex;s[parseInt(d.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(l.toString(),10)]}var p={data:s,dropIndex:i};if(rt(this.parent)||this.dropRows(p,!0),n.isLocalData&&(n.flatData=this.orderToIndex(n.flatData)),"outdenting"===this.parent[""+o]&&((0,t.isNullOrUndefined)(s[0].parentItem)||(s[0].level=s[0].parentItem.level+1)),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition){l=void 0;this.parent.allowRowDragAndDrop?l=this.parent.treeColumnIndex+1:"indenting"===this.parent[""+o]&&(l=this.parent.treeColumnIndex);var h=this.parent.getRows()[e[0]],c=p.data[0],u=[];(y=[]).push(c),u.push(h);var g=ct(this.parent,p.data[0].parentUniqueID),f=this.parent.getRows()[parseInt(i.toString(),10)];y.push(g),u.push(f),this.parent[""+a](y,u,l)}if(this.parent.enableImmutableMode&&"outdenting"===this.parent[""+o]){l=void 0;this.parent.allowRowDragAndDrop?l=this.parent.treeColumnIndex+1:"outdenting"===this.parent[""+o]&&(l=this.parent.treeColumnIndex);var y,m=p.data[0];h=this.parent.getRows()[e[0]],u=[];(y=[]).push(m),u.push(h),this.parent[""+a](y,u,l)}}},e.prototype.indentOutdentAction=function(e,i){var r=this.parent,n="action",o="dropIndex",a=-1;if(!(0,t.isNullOrUndefined)(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?a=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(a=this.parent.selectedRowIndex),this.selectedItem=(0,t.isNullOrUndefined)(e)?r.getCurrentViewRecords()[parseInt(a.toString(),10)]:e;var s=this.parent.getPrimaryKeyFieldNames()[0],d=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+s]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==a?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(d),this.selectedRecord=this.parent[this.selectedRecords]=-1!==a?r.getCurrentViewRecords()[parseInt(a.toString(),10)]:this.selectedItem,"indent"===i){var l=r.getCurrentViewRecords()[this.selectedRow.rowIndex-1],p=void 0;if(0===this.selectedRow.rowIndex||-1===this.selectedRow.rowIndex||r.getCurrentViewRecords()[this.selectedRow.rowIndex].level-l.level==1)return;if(l.level>this.selectedRecord.level)for(var h=0;h<r.getCurrentViewRecords().length;h++)r.getCurrentViewRecords()[parseInt(h.toString(),10)].taskData===l.parentItem.taskData&&(p=h,r.enableVirtualization&&(p=parseInt(r.getRows()[parseInt(h.toString(),10)].getAttribute("data-rowindex"),10)));else p=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||l.level>this.selectedRecord.level||(p=parseInt(this.selectedRow.getAttribute("data-rowindex"),10)-1),r[""+n]="indenting",r[""+o]=p,this.eventTrigger("indenting",p)}else if("outdent"===i){if(-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex||0===r.getCurrentViewRecords()[this.selectedRow.rowIndex].level)return;p=void 0;var c=this.selectedRecord.parentItem;for(h=0;h<r.getCurrentViewRecords().length;h++)r.getCurrentViewRecords()[parseInt(h.toString(),10)].uniqueID===c.uniqueID&&(p=h);this.parent.enableVirtualization&&this.selectedRecord&&(p=parseInt(this.parent.getRows()[parseInt(p.toString(),10)].getAttribute("data-rowindex"),10)),r[""+n]="outdenting",r[""+o]=p,this.eventTrigger("outdenting",p)}}},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(A,r,(function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("data-rowindex"),10)],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("data-rowindex"),10)],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,!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)].parentItem)){var r=(0,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,n=e.records.length-1;n>-1;n--)if((i=r[parseInt(n.toString(),10)]).parentUniqueID){var o=r.filter((function(e){return e.uniqueID===i.parentUniqueID}));if(o.length){var a=o[0].childRecords.indexOf(i),s=o[0];-1!==a&&((0,t.isNullOrUndefined)(this.parent.idMapping)&&(s.childRecords.splice(a,1),s.childRecords.length||(s.hasChildRecords=!1,s.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0)}}if((0,t.isNullOrUndefined)(this.parent.dataSource)||!this.parent.dataSource.length){var d,l=this.parent,p=e.records;for(n=e.records.length-1;n>-1;n--){d=p[parseInt(n.toString(),10)],!n&&d.hasChildRecords&&(d.taskData[this.parent.parentIdMapping]=null);if((0,t.isNullOrUndefined)(l.parentIdMapping)||(l.childMapping=null),(0,t.isNullOrUndefined)(d.taskData)||(0,t.isNullOrUndefined)(l.childMapping)||Object.prototype.hasOwnProperty.call(d.taskData,l.childMapping)||(d.taskData[l.childMapping]=[]),!(0,t.isNullOrUndefined)(d[l.childMapping])&&Object.prototype.hasOwnProperty.call(d,l.childMapping)&&d[l.childMapping].length&&!this.isDraggedWithChild&&!(0,t.isNullOrUndefined)(l.parentIdMapping))for(var h=d[l.childMapping],c=0;c<h.length;c++)-1===p.indexOf(h[parseInt(c.toString(),10)])&&(p.splice(c,0,h[parseInt(c.toString(),10)]),h[parseInt(c.toString(),10)].taskData=(0,t.extend)({},h[parseInt(c.toString(),10)]),n+=1);Object.prototype.hasOwnProperty.call(d,l.parentIdMapping)&&null!==d[l.parentIdMapping]&&!this.isDraggedWithChild&&(d.taskData[l.parentIdMapping]=null,delete d.parentItem,delete d.parentUniqueID),(0,t.isNullOrUndefined)(l.dataSource)&&(l.dataSource=[]),l.dataSource.splice(0,0,d.taskData)}l.setProperties({dataSource:l.dataSource},!1)}else{for(n=0;n<r.length;n++)(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent);var u={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof tt.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),(0,t.isNullOrUndefined)(this.dropPosition)&&(this.dropPosition="bottomSegment",u.dropIndex=this.parent.getCurrentViewRecords().length>1?this.parent.getCurrentViewRecords().length-1:u.dropIndex,u.data=u.data.map((function(e){return e.hasChildRecords&&(0,t.isNullOrUndefined)(e.parentItem)?(e.level=0,e):(delete e.parentItem,delete e.parentUniqueID,e.level=0,e)}))),this.dropRows(u)}},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,n=this.droppedRecord,o=this.parent;if(!(e=this.parent.dataSource instanceof tt.DataManager&<(this.parent)?o.dataSource.dataSource.json:o.dataSource)||(0,t.isNullOrUndefined)(n)||n.parentItem||(0,t.isNullOrUndefined)(n.taskData)){if(!this.parent.parentIdMapping&&!(0,t.isNullOrUndefined)(n)&&n.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var a=this.getChildrecordsByParentID(n.parentUniqueID)[0].childRecords;for(d=0;d<a.length;d++)n.parentItem.taskData[this.parent.childMapping][parseInt(d.toString(),10)]=a[parseInt(d.toString(),10)].taskData}}else{for(var s=Object.keys(e),d=0;d<s.length;d++)e[parseInt(d.toString(),10)][this.parent.childMapping]===n.taskData[this.parent.childMapping]&&(i=d);"topSegment"===this.dropPosition?this.parent.idMapping||e.splice(i,0,r.taskData):"bottomSegment"===this.dropPosition&&(this.parent.idMapping||e.splice(i+1,0,r.taskData))}this.parent.parentIdMapping&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.parentIdMapping]=n[this.parent.parentIdMapping],r.taskData[this.parent.parentIdMapping]=n[this.parent.parentIdMapping]):(r[this.parent.parentIdMapping]=n[this.parent.idMapping],r.taskData[this.parent.parentIdMapping]=n[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){var t,i=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")),r=(t=this.parent.enableVirtualization?e&&!i&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")!==e.getAttribute("data-uid"):e&&!i&&this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid"))||"topSegment"===this.dropPosition;this.parent.element.getElementsByClassName("e-lastrow-border").length>0&&e&&(t||r)&&this.parent.element.getElementsByClassName("e-lastrow-border")[0].remove()},e.prototype.updateIcon=function(e,i,r){var n=r.target?(0,t.closest)(r.target,"tr"):null;this.dropPosition=void 0;var o=0;this.removeFirstrowBorder(n),this.removeLastrowBorder(n);for(var a=0;a<r.rows.length;a++)((0,t.isNullOrUndefined)(n)||n.getAttribute("data-uid")!==r.rows[parseInt(a.toString(),10)].getAttribute("data-uid"))&&(0,l.parentsUntil)(r.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem());var s=this.parent,d=0,p=s.toolbar&&s.toolbar.length?document.getElementById(s.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(s.element),c=s.getHeaderContent().offsetHeight+h.top+p,u=s.getContent().firstElementChild.scrollTop;(0,t.isNullOrUndefined)(n)||(o=n.offsetTop-u);var g=((d=this.parent.enableVirtualization?n.getBoundingClientRect().top:o+c+0)+e[0].offsetHeight-d)/3,f=d+g,y=f+g,m=y+g,S=(0,l.getObject)("originalEvent.event",r),v=(0,l.getObject)("originalEvent.event",r),w="mousemove"===S.type?S.pageY:(0,t.isNullOrUndefined)(v)||(0,t.isNullOrUndefined)(v.changedTouches)?null:v.changedTouches[0].pageY;this.parent.enableVirtualization&&(w="mousemove"===S.type?S.clientY:(0,t.isNullOrUndefined)(v)||(0,t.isNullOrUndefined)(v.changedTouches)?null:v.changedTouches[0].clientY);var I=w<=f,R=w>f&&w<=y,x=w>y&&w<=m;if(I||R||x){if(I&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(n),this.removeErrorElem(),this.removeLastrowBorder(n),this.topOrBottomBorder(r.target)),R&&"Invalid"!==this.dropPosition){this.removetopOrBottomBorder();var C,b=(0,t.closest)(r.target,"tr");(C=[].slice.call(b.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))).length>0&&this.addRemoveClasses(C,!0,"e-childborder"),this.addLastRowborder(n),this.addFirstrowBorder(n),this.dropPosition="middleSegment"}x&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(n),this.removeFirstrowBorder(n),this.topOrBottomBorder(r.target))}return this.dropPosition},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=!(0,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){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));if(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?l.Scroll.getScrollBarWidth():0},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-cloneproperties")[0],i="sanitize";if(!e.querySelectorAll(".e-errorelem").length&&!this.parent.rowDropSettings.targetID){var r=document.createElement("div");(0,t.classList)(r,["e-errorcontainer"],[]),(0,t.classList)(r,["e-icons","e-errorelem"],[]);var n=e.querySelector(".errorValue"),o=e.querySelector(".e-rowcell").innerHTML;n&&(o=this.parent[""+i](n.innerHTML),n.parentNode.removeChild(n)),e.querySelector(".e-rowcell").innerHTML="";var a=document.createElement("span");a.className="errorValue",a.style.paddingLeft="16px",a.innerHTML=this.parent[""+i](o),e.querySelector(".e-rowcell").appendChild(r),e.querySelector(".e-rowcell").appendChild(a);var s=document.querySelector(".e-dropitemscount");if(this.hasDropItem&&s){var d=parseInt(s.style.left,10)+r.offsetWidth+16,l=this.parent.enableRtl?0:d;s.style.left=l+"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;(0,t.setStyleAttribute)(i,{paddingLeft:"0px"}),this.parent.enableRtl||(0,t.setStyleAttribute)(r,{left:n+"px"})}e.remove()}this.hasDropItem=!0},e.prototype.topOrBottomBorder=function(e){var i,r=(0,t.closest)(e,"tr");(i=r?[].slice.call(r.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")):[]).length&&("topSegment"===this.dropPosition&&(this.addRemoveClasses(i,!0,"e-droptop"),this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0].remove()),"bottomSegment"===this.dropPosition&&this.addRemoveClasses(i,!0,"e-dropbottom"))},e.prototype.removetopOrBottomBorder=function(){var e;(e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop"))).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 i=this.parent,r=this.parent.element.querySelector(".e-cloneproperties");r.style.cursor="";var n,o=e.target?(0,t.closest)(e.target,"tr"):null,a=o?o.rowIndex:-1,s=[],d=i.getCurrentViewRecords()[parseInt(a.toString(),10)];(this.removeErrorElem(),this.canDrop=!0,e.data[0]?s=e.data:s.push(e.data),-1!==a?this.ensuredropPosition(s,d):(this.canDrop=!1,this.addErrorElem()),!i.rowDropSettings.targetID&&this.canDrop&&i.rowDragAndDropModule.updateIcon(e.rows,a,e),(0,t.isNullOrUndefined)(i.rowDropSettings.targetID)&&!this.canDrop&&this.removetopOrBottomBorder(),i.rowDropSettings.targetID)&&((n=(0,l.parentsUntil)(e.target,"e-treegrid"))&&n.id===this.parent.rowDropSettings.targetID&&n.ej2_instances[0].rowDragAndDropModule.updateIcon(e.rows,a,e));e.target&&(0,t.closest)(e.target,"#"+i.rowDropSettings.targetID)&&((n=(0,l.parentsUntil)(e.target,"e-treegrid"))||(r.style.cursor="default"))},e.prototype.rowDropped=function(e){var i=this.parent;if(i.rowDropSettings.targetID?(e.target&&(0,t.closest)(e.target,"#"+i.rowDropSettings.targetID)||(0,l.parentsUntil)(e.target,"e-treegrid")&&(0,l.parentsUntil)(e.target,"e-treegrid").id===i.rowDropSettings.targetID||e.target&&document.getElementById(i.rowDropSettings.targetID))&&((0,t.setValue)("dropPosition",this.dropPosition,e),i.trigger(Pe,e),!e.cancel&&i.rowDropSettings.targetID&&(this.dragDropGrid(e),i.isLocalData&&(i.flatData=this.orderToIndex(i.flatData)))):(0,l.parentsUntil)(e.target,"e-content")&&(this.parent.element.querySelector(".e-errorelem")&&(this.dropPosition="Invalid"),(0,t.setValue)("dropPosition",this.dropPosition,e),i.trigger(Pe,e),e.cancel||(rt(this.parent)||this.dropRows(e),i.isLocalData&&(i.flatData=this.orderToIndex(i.flatData)),i.grid.refresh(),(0,t.isNullOrUndefined)(i.getHeaderContent().querySelector(".e-firstrow-border"))||i.getHeaderContent().querySelector(".e-firstrow-border").remove())),this.removetopOrBottomBorder(),this.removeChildBorder(),(0,t.isNullOrUndefined)(this.parent.element.getElementsByClassName("e-firstrow-border")[0])?(0,t.isNullOrUndefined)(this.parent.element.getElementsByClassName("e-lastrow-border")[0])||this.parent.element.getElementsByClassName("e-lastrow-border")[0].remove():this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!(0,t.isNullOrUndefined)(e.data[0].parentItem)){var r=this.parent.treeColumnIndex;r+=1;var n=this.parent.getPrimaryKeyFieldNames()[0],o=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+n]),a=this.parent.getRows()[parseInt(o.toString(),10)],s=e.data[0];if("middleSegment"===this.dropPosition){var d=[],p=[];d.push(s),p.push(a);s=ct(this.parent,e.data[0].parentUniqueID),o=this.parent.grid.getRowIndexByPrimaryKey(s[""+n]);var h=this.parent.getRows()[parseInt(o.toString(),10)];d.push(s),p.push(h);for(var c=0;c<d.length;c++)this.parent.renderModule.cellRender({data:d[parseInt(c.toString(),10)],cell:p[parseInt(c.toString(),10)].cells[parseInt(r.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});var u=h.getElementsByClassName("e-treegridcollapse")[0];(0,t.isNullOrUndefined)(u)||((0,t.removeClass)([u],"e-treegridcollapse"),(0,t.addClass)([u],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:s,cell:a.cells[parseInt(r.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},e.prototype.dragDropGrid=function(e){var i,r=this.parent,n=(0,t.closest)(e.target,"tr"),o=isNaN(this.getTargetIdx(n))?0:this.getTargetIdx(n),a=(0,l.parentsUntil)(e.target,"e-treegrid");if(a&&a.id===this.parent.rowDropSettings.targetID&&!it(this.parent)&&!rt(this.parent)){i=a.ej2_instances[0];for(var s=r.getSelectedRecords(),d=[],p=0;p<s.length;p++)d[parseInt(p.toString(),10)]=s[parseInt(p.toString(),10)].index;var h=i.dataSource;if(null!==this.parent.idMapping&&((0,t.isNullOrUndefined)(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!h.length){var c=[];for(p=0;p<s.length;p++)if(s[parseInt(p.toString(),10)].hasChildRecords){c.push(s[parseInt(p.toString(),10)]);for(var u=dt(s[parseInt(p.toString(),10)]),g=0;g<u.length;g++)c.push(u[parseInt(g.toString(),10)])}c.length&&(s=c)}r.notify(Ne,{indexes:d,records:s}),i.notify(Ae,{toIndex:o,records:s});var f=i.rowDragAndDropModule.treeGridData;if(!(0,t.isNullOrUndefined)(f))for(p=0;p<f.length;p++)if(f[parseInt(p.toString(),10)].index=p,!(0,t.isNullOrUndefined)(f[parseInt(p.toString(),10)].parentItem)){var y=(0,t.getValue)("uniqueIDCollection."+f[parseInt(p.toString(),10)].parentUniqueID+".index",i);f[parseInt(p.toString(),10)].parentItem.index=y}r.grid.refresh(),i.grid.refresh(),i.grid.dataSource.length>1&&(i.grid.refresh(),(0,t.isNullOrUndefined)(i.getHeaderContent().querySelector(".e-firstrow-border"))||i.getHeaderContent().querySelector(".e-firstrow-border").remove(),(0,t.isNullOrUndefined)(i.getContent().querySelector(".e-lastrow-border"))||i.getContent().querySelector(".e-lastrow-border").remove())}rt(this.parent)&&(i=a.ej2_instances[0],r.grid.refresh(),i.grid.refresh())},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("data-rowindex"),10):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=ct(this.parent,a.parentItem.uniqueID)}"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===i.level?this.droppedRecord=ct(this.parent,i.uniqueID):this.getParentData(i))},e.prototype.dropRows=function(e,i){if("Invalid"!==this.dropPosition&&!it(this.parent)){var r,n=this.parent,o=void 0;if((0,t.isNullOrUndefined)(e.dropIndex)){var a=this.parent.getPrimaryKeyFieldNames()[0],s=-1===n.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+a])-1:n.getSelectedRowIndexes()[0]-1,d=n.getCurrentViewRecords()[parseInt(s.toString(),10)];this.getParentData(d,e.data)}else if(e.dropIndex=e.dropIndex===e.fromIndex?this.getTargetIdx(e.target.parentElement):e.dropIndex,this.parent.enableVirtualization){var l=this.parent.getRowByIndex(e.dropIndex).rowIndex;this.droppedRecord=n.getCurrentViewRecords()[parseInt(l.toString(),10)]}else this.droppedRecord=n.getCurrentViewRecords()[e.dropIndex];var p=[];o=this.droppedRecord,e.data[0]?p=e.data:p.push(e.data),this.parent[this.modifiedRecords].push(e.data[0],o);var h=0,c=this.parent.rowDropSettings.targetID;this.isMultipleGrid=c,c?this.isaddtoBottom=c&&this.isDraggedWithChild:this.ensuredropPosition(p,o);var u=p.length;(0,t.isNullOrUndefined)(this.parent.idMapping)||p.reverse();for(var g=function(a){if(r=p[parseInt(a.toString(),10)],f.draggedRecord=r,"Invalid"!==f.dropPosition){if(n.rowDropSettings.targetID&&!i||f.deleteDragRow(),f.draggedRecord===f.droppedRecord){var s=f.getTargetIdx(e.target.offsetParent.parentElement);isNaN(s)&&(s=f.getTargetIdx(e.target.parentElement)),e.dropIndex=s,o=f.droppedRecord=f.parent.getCurrentViewRecords()[e.dropIndex]}if(o.parentItem||"middleSegment"===f.dropPosition)-1!==(g=(u=n.parentData).indexOf(f.draggedRecord))&&u.splice(g,1);var d=f.treeGridData.indexOf(o);if(f.dropAtTop(d),"bottomSegment"===f.dropPosition){if(o.hasChildRecords?(h=f.getChildCount(o,0),f.parent.parentIdMapping&&f.treeData.splice(d+h+1,0,f.draggedRecord.taskData),f.treeGridData.splice(d+h+1,0,f.draggedRecord)):(f.parent.parentIdMapping&&f.treeData.splice(d+1,0,f.draggedRecord.taskData),f.treeGridData.splice(d+1,0,f.draggedRecord)),(0,t.isNullOrUndefined)(o.parentItem)&&(delete r.parentItem,delete r.parentUniqueID,r.level=0,f.parent.parentIdMapping&&(r[f.parent.parentIdMapping]=null)),o.parentItem){var l=f.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,c=l.indexOf(o)+1;l.splice(c,0,r),r.parentItem=o.parentItem,r.parentUniqueID=o.parentUniqueID,r.level=o.level,f.parent.parentIdMapping&&(r[f.parent.parentIdMapping]=o[f.parent.parentIdMapping],r.parentItem=o.parentItem,r.level=o.level)}if(r.hasChildRecords){f.updateChildRecordLevel(r,1),f.updateChildRecord(r,d+h+1)}}f.dropMiddle(d)}if((0,t.isNullOrUndefined)(r.parentItem)){var u,g=(u=n.parentData).indexOf(f.droppedRecord),y=0;u.filter((function(e){r.uniqueID===e.uniqueID&&y++})),"bottomSegment"===f.dropPosition&&0===y?u.splice(g+1,0,r):"topSegment"===f.dropPosition&&0===y&&u.splice(g,0,r)}n.rowDragAndDropModule.refreshGridDataSource()},f=this,y=0;y<u;y++)g(y)}},e.prototype.dropMiddle=function(e){var i=this.parent,r=dt(this.droppedRecord),n=(0,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){if(t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData),this.draggedRecord.parentItem=this.treeGridData[parseInt(e.toString(),10)].parentItem,this.draggedRecord.parentUniqueID=this.treeGridData[parseInt(e.toString(),10)].parentUniqueID,this.draggedRecord.level=this.treeGridData[parseInt(e.toString(),10)].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 i=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords,r=i.indexOf(this.droppedRecord);i.splice(r,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,((0,t.isNullOrUndefined)(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!e.parentIdMapping&&(0,t.isNullOrUndefined)(r.taskData[""+n])&&(r.taskData[""+n]=[]))),"middleSegment"===this.dropPosition){var o=(0,t.extend)({},r);delete o.childRecords,i.parentItem=o,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i);if(e.isSelfReference&&(r[e.childMapping]=[],r[e.childMapping].splice(r[e.childMapping].length,0,i)),(0,t.isNullOrUndefined)(i)||e.parentIdMapping||(0,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 tt.DataManager&<(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=ct(this.parent,this.draggedRecord.uniqueID);!(0,t.isNullOrUndefined)(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},e.prototype.updateChildRecord=function(e,i){var r,n,o=this.parent;if(!e.hasChildRecords)return 0;n=e.childRecords.length;for(var a=0;a<n;a++)r=this.isMultipleGrid?e.childRecords[parseInt(a.toString(),10)]:(0,t.getValue)("uniqueIDCollection."+e.childRecords[parseInt(a.toString(),10)].uniqueID,o),i++,o.flatData.splice(i,0,r),(0,t.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),o.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;if(i++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var o=0;o<r;o++){n=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:(0,t.getValue)("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,this.parent);var a=void 0;e.parentItem&&(a=ct(this.parent,e.parentItem.uniqueID)),(0,t.isNullOrUndefined)(a)&&!(0,t.isNullOrUndefined)(e.parentItem)&&(a=e.parentItem),n.level=e.parentItem?a.level+i:e.level+1,n.hasChildRecords&&(i--,i=this.updateChildRecordLevel(n,i))}return i},e.prototype.removeRecords=function(e){var i,r=this.parent;i=this.parent.dataSource instanceof tt.DataManager&<(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;var n=e,o=!(0,t.isNullOrUndefined)(r.parentIdMapping),a=this.getChildrecordsByParentID(n.parentUniqueID)[0];if(n){if(n.parentItem){var s=a?a.childRecords:[],d=0;s&&s.length>0&&(d=s.indexOf(n),a.childRecords.splice(d,1),this.parent.parentIdMapping&&!r.enableImmutableMode||Ft({value:n,action:"delete"},this.parent,o,n.index,n.index))}if(r.parentIdMapping){n.hasChildRecords&&n.childRecords.length>0&&this.removeChildItem(n);for(var l=void 0,p=void 0,h=i,c=0;c<h.length;c++)h[parseInt(c.toString(),10)][this.parent.idMapping]===n.taskData[this.parent.idMapping]&&(l=c);for(c=0;c<this.treeGridData.length;c++)this.treeGridData[parseInt(c.toString(),10)][this.parent.idMapping]===n.taskData[this.parent.idMapping]&&(p=c);-1===l||(0,t.isNullOrUndefined)(l)||i.splice(l,1),-1===p||(0,t.isNullOrUndefined)(p)||this.treeGridData.splice(p,1)}var u=this.treeGridData.indexOf(n);if(!r.parentIdMapping){var g=this.parent.parentData.indexOf(n);-1!==g&&(r.parentData.splice(g,1),i.splice(g,1))}if(-1===u&&!r.parentIdMapping)for(var f=r.getPrimaryKeyFieldNames()[0],y=0;y<this.treeGridData.length;y++)this.treeGridData[parseInt(y.toString(),10)][""+f]===n[""+f]&&(u=y);if(!r.parentIdMapping){var m=this.getChildCount(n,0);this.treeGridData.splice(u,m+1)}n.parentItem&&a&&a.childRecords&&!a.childRecords.length&&(a.expanded=!1,a.hasChildRecords=!1,a.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(a)||(0,t.isNullOrUndefined)(a)||this.parent[this.modifiedRecords].push(a),(0,t.isNullOrUndefined)(a)||this.updateModifiedRecords(a)}},e.prototype.updateModifiedRecords=function(e){var i=ct(this.parent,e.parentUniqueID);(0,t.isNullOrUndefined)(i)||(this.parent[this.modifiedRecords].push(i),this.updateModifiedRecords(i))},e.prototype.removeChildItem=function(e){var i,r,n,o;o=this.parent.dataSource instanceof tt.DataManager&<(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var a=0;a<e.childRecords.length;a++){i=e.childRecords[parseInt(a.toString(),10)],!(0,t.isNullOrUndefined)(i.childRecords)&&i.childRecords.length&&(i.hasChildRecords=!0);var s=void 0;s=this.parent.dataSource instanceof tt.DataManager&<(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var d=0;d<s.length;d++)s[parseInt(d.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]&&(r=d);for(var l=0;l<this.treeGridData.length;l++)if(this.treeGridData[parseInt(l.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]){n=l;break}-1===r||(0,t.isNullOrUndefined)(r)||o.splice(r,1),-1===n||(0,t.isNullOrUndefined)(n)||this.treeGridData.splice(n,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&&!(0,t.isNullOrUndefined)(e.childRecords)){if(-1!==e.childRecords.indexOf(i))return r.dropPosition="Invalid",r.addErrorElem(),void(r.canDrop=!1);r.ensuredropPosition(e.childRecords,i)}}))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ue,this.Rowdraging),this.parent.off(ke,this.rowDropped),this.parent.off(Ae,this.rowsAdded),this.parent.off(Ne,this.rowsRemoved))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e}(),Zt=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])},e(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)}}(),ei=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},ti=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Zt(i,e),ei([(0,t.Property)()],i.prototype,"targetID",void 0),i}(t.ChildProperty),ii=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])},e(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)}}(),ri=function(e){function i(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return ii(i,e),i.prototype.addEventListener=function(){this.parent.on(Ie,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){!(0,t.isNullOrUndefined)(r.virtualInfo)&&r.virtualInfo.loadNext&&r.virtualInfo.nextInfo.page!==this.parent.pageSettings.currentPage?this.parent.setProperties({pageSettings:{currentPage:r.virtualInfo.nextInfo.page}},!0):(0,t.isNullOrUndefined)(r.virtualInfo)||r.virtualInfo.loadNext||r.virtualInfo.page===this.parent.pageSettings.currentPage||this.parent.setProperties({pageSettings:{currentPage:r.virtualInfo.page}},!0);var n=this.getDataInfo();if((0,t.isNullOrUndefined)(r.virtualInfo)||("right"!==r.virtualInfo.direction&&"left"!==r.virtualInfo.direction?(this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||rt(this.parent))&&1!==r.virtualInfo.blockIndexes.length||(r.virtualInfo.blockIndexes=n.blockIndexes):r.virtualInfo.blockIndexes=this.getBlockIndexes(r.virtualInfo.page)),this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||rt(this.parent))return e.prototype.generateRows.call(this,i,r);(0,t.isNullOrUndefined)(r.requestType)||"collapseAll"!==r.requestType.toString()||(r.requestType="refresh");var o=e.prototype.generateRows.call(this,i,r);if(!(0,t.isNullOrUndefined)(this.visualData))for(var a=0;a<o.length;a++)o[parseInt(a.toString(),10)].index=this.visualData.indexOf(o[parseInt(a.toString(),10)].data);return o},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 tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||rt(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()&&delete this.cache[parseInt(i.toString(),10)]}else(t||"virtualscroll"===e)&&(this.cache={},this.data={},this.groups={});return t},i}(l.VirtualRowModelGenerator),ni=function(){function e(e){l.Grid.Inject(l.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){(0,t.setValue)("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var i=0;i<this.flatFilteredData.length;i++){var r=this.flatFilteredData[parseInt(i.toString(),10)];this.addParentRecord(r);var n=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;"Child"!==n&&"None"!==n||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0);var o=(0,l.getObject)("childRecords",r);!(0,t.isNullOrUndefined)(o)&&o.length&&(0,t.setValue)("hasFilteredChildRecords",this.checkChildExsist(r),r);var a=(0,l.getObject)("parentItem",r);if(!(0,t.isNullOrUndefined)(a)){var s=ct(this.parent,r.parentItem.uniqueID,!0);(0,t.setValue)("hasFilteredChildRecords",!0,s),s&&s.parentItem&&this.updateParentFilteredRecord(s)}}this.flatFilteredData.length>0&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},e.prototype.updateParentFilteredRecord=function(e){var i=ct(this.parent,e.parentItem.uniqueID,!0),r=(0,t.getValue)("uniqueIDFilterCollection",this.parent);i&&Object.prototype.hasOwnProperty.call(r,i.uniqueID)&&(0,t.setValue)("hasFilteredChildRecords",!0,i),i&&i.parentItem&&this.updateParentFilteredRecord(i)},e.prototype.addParentRecord=function(e){var i=ct(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){if(!(0,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||-1!==this.flatFilteredData.indexOf(i))&&this.addParentRecord(i);-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))}else if((0,t.isNullOrUndefined)(i)){if(-1!==this.flatFilteredData.indexOf(e))return void(-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,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),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))},e.prototype.checkChildExsist=function(e){for(var i=(0,l.getObject)("childRecords",e),r=!1,n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].childRecords,a=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;if(!("Child"!==a&&"Both"!==a||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)){var s=(0,t.getValue)("uniqueIDFilterCollection",this.parent);Object.prototype.hasOwnProperty.call(s,i[parseInt(n.toString(),10)].uniqueID)||(this.filteredResult.push(i[parseInt(n.toString(),10)]),(0,t.setValue)("uniqueIDFilterCollection."+i[parseInt(n.toString(),10)].uniqueID,i[parseInt(n.toString(),10)],this.parent),r=!0)}if("None"===a&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(i[parseInt(n.toString(),10)])){r=!0;break}!(0,t.isNullOrUndefined)(o)&&o.length&&(r=this.checkChildExsist(i[parseInt(n.toString(),10)])),"Child"!==a&&"Both"!==a||!i.length||(r=!0)}return r},e.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=ct(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);if(-1!==e.indexOf(r)){var n=ct(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){for(var i,r=0,n=e.flatData,o=n.length;r<o;r++){var a=(i=n[parseInt(r.toString(),10)]).filterLevel;!a&&0!==a&&(0,t.isNullOrUndefined)(i.hasFilteredChildRecords)||(i.hasFilteredChildRecords=null,i.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:n,count:n.length})},e}(),oi=function(){function e(e){this.isCollapsedStatePersist=!1,l.Grid.Inject(l.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.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.grid.off("finalPageSetup",this.finalPageSetup))},e.prototype.updateExcelResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,i,r,n,o){var a=this,s=this.parent.dataSource,d=Object();return(0,t.setValue)("isCsv",o,d),(0,t.setValue)("cancel",!1,d),(0,t.isNullOrUndefined)(e)||(this.isCollapsedStatePersist=e.isCollapsedStatePersist),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||e.dataSource.dataSource?new Promise((function(p){var h=!a.isLocal()||s instanceof tt.DataManager?a.parent.dataSource:new tt.DataManager(s),c=new tt.Query;if(a.isLocal()||((c=a.generateQuery(c)).queries=a.parent.grid.getDataModule().generateQuery().queries,(0,t.setValue)("query",c,d)),a.parent.trigger(L,(0,t.extend)(d,e)),(0,l.getObject)("cancel",d))return null;h.executeQuery(c).then((function(d){var l=null;return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||(l=e.dataSource),e=a.manipulateExportProperties(e,s,d),a.parent.grid.excelExportModule.Map(a.parent.grid,e,i,r,o,n).then((function(t){null!=l?e.dataSource=l:delete e.dataSource,p(t)}))}))})):this.parent.grid.excelExportModule.Map(this.parent.grid,e,i,r,o,n)},e.prototype.generateQuery=function(e,i){return!(0,t.isNullOrUndefined)(i)&&"CurrentPage"===i.exportType&&this.parent.allowPaging&&(i.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=(0,l.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulateExportProperties=function(e,i,r){var n=Object();if((0,t.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),n),(0,t.setValue)("isExport",!0,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.exportType)||(0,t.setValue)("exportType",e.exportType,n),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData((0,l.getObject)("result",r)),(0,t.setValue)("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,i=(0,t.isNullOrUndefined)(n.result)?this.parent.flatData.slice(0):n.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource){var o=this.parent.flatData,a=e.dataSource instanceof tt.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(a),i=this.parent.flatData,this.parent.flatData=o}return(e=(0,t.isNullOrUndefined)(e)?Object():e).dataSource=new tt.DataManager({json:i}),this.parent.aggregates.length>0&&(e.query=n.query),e},e.prototype.excelQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=e.data,n=(0,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.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&&ct(this.parent,i.parentItem.uniqueID,Boolean(r))){var a=!1,s=!1,d=st(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&&(0,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!it(this.parent)&<(this.parent)},e}(),ai=function(){function e(e){l.Grid.Inject(l.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)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updatePdfResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,i,r,n){var o=this,a=this.parent.dataSource,s=Object(),d=!it(this.parent)&<(this.parent);return(0,t.setValue)("cancel",!1,s),new Promise((function(p){var h=!d||a instanceof tt.DataManager?o.parent.dataSource:new tt.DataManager(a),c=new tt.Query;if(d||(c=o.generateQuery(c),(0,t.setValue)("query",c,s)),o.parent.trigger(z,(0,t.extend)(s,e)),(0,l.getObject)("cancel",s))return null;h.executeQuery(c).then((function(s){var d=null;return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||(d=e.dataSource),e=o.manipulatePdfProperties(e,a,s),o.parent.grid.pdfExportModule.Map(o.parent.grid,e,i,r,n).then((function(t){null!=d?e.dataSource=d:delete e.dataSource,p(t)}))}))}))},e.prototype.generateQuery=function(e,i){return!(0,t.isNullOrUndefined)(i)&&"CurrentPage"===i.exportType&&this.parent.allowPaging&&(i.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=(0,l.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulatePdfProperties=function(e,i,r){var n={},o=!it(this.parent)&<(this.parent);if((0,t.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),n),(0,t.setValue)("isExport",!0,n),(0,t.setValue)("isPdfExport",!0,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.isCollapsedStatePersist)||(0,t.setValue)("isCollapsedStatePersist",e.isCollapsedStatePersist,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.exportType)||(0,t.setValue)("exportType",e.exportType,n),o||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData((0,t.getValue)("result",r)),(0,t.setValue)("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,i=(0,t.isNullOrUndefined)(n.result)?this.parent.flatData.slice(0):n.result,o||(this.parent.flatData=[]),e&&e.dataSource&&o){var a=this.parent.flatData,s=e.dataSource instanceof tt.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(s),i=this.parent.flatData,this.parent.flatData=a}return(e=(0,t.isNullOrUndefined)(e)?{}:e).dataSource=new tt.DataManager({json:i}),e.query=n.query,e},e.prototype.pdfQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=(0,l.getObject)("data",e),n=(0,t.isNullOrUndefined)(r.filterLevel)?r.level:r.filterLevel;i.paragraphIndent=3*n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},e}(),si=function(){function e(e){l.Grid.Inject(l.Page),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(K,this.collapseExpandPagedchilds,this),this.parent.on(W,this.pageAction,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(K,this.collapseExpandPagedchilds),this.parent.off(W,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((0,t.isNullOrUndefined)(e)){this.parent.trigger(Xe,{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((0,t.getValue)("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode){var o="action",a=void 0;"collapse"===n[""+o]?(a=n.row.getElementsByClassName("e-treegridexpand")[0],(0,t.isNullOrUndefined)(a)||((0,t.removeClass)([a],"e-treegridexpand"),(0,t.addClass)([a],"e-treegridcollapse"))):"expand"===n[""+o]&&(a=n.row.getElementsByClassName("e-treegridcollapse")[0],(0,t.isNullOrUndefined)(a)||((0,t.removeClass)([a],"e-treegridcollapse"),(0,t.addClass)([a],"e-treegridexpand")))}},e.prototype.pageRoot=function(e,i,r){for(var n=(0,t.isNullOrUndefined)(r)?[]:r,o=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=a.pageRoot(e,r,n))},a=this,s=0;s<i.length;s++)o(s);return n},e.prototype.updatePageSize=function(e){var t=e.result.length,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 tt.DataManager(e.result);if("Root"===this.parent.pageSettings.pageSizeMode){var r=[],n=this.parent.grid.filterSettings.columns.length>0&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",o=(new tt.Query).where(n,"equal",0);r=i.executeLocal(o),e.count=r.length;var a=(c=this.parent.grid.pageSettings.pageSize)*((u=this.parent.grid.pageSettings.currentPage)-1);o=o.skip(a).take(c),r=i.executeLocal(o);var s=this.pageRoot(e.result,r);e.result=s}else{var d=new tt.DataManager(e.result),l=new tt.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),p=d.executeLocal((new tt.Query).where(l)),h=void 0;h=ot(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?p:p.filter((function(e){return st(t.parent,e,p)})),e.count=h.length;o=new tt.Query;var c=this.parent.grid.pageSettings.pageSize;this.updatePageSize(e);var u=this.parent.grid.pageSettings.currentPage;h.length<u*c&&(u=(u=Math.floor(h.length/c)+(h.length%c?1:0))||1,this.parent.grid.setProperties({pageSettings:{currentPage:u}},!0));a=c*(u-1);o=o.skip(a).take(c),d.dataSource.json=h,e.result=d.executeLocal(o)}this.parent.notify("updateAction",e)},e}(),di=function(){function e(e){l.Grid.Inject(l.Toolbar),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.addEventListener=function(){this.parent.on(q,this.refreshToolbar,this),this.parent.on(V,this.refreshToolbar,this),this.parent.on(B,this.toolbarClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(q,this.refreshToolbar),this.parent.off(V,this.refreshToolbar),this.parent.off(B,this.toolbarClickHandler))},e.prototype.refreshToolbar=function(e){var i=this.parent.grid.toolbarModule.getToolbar();if(!(0,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((0,t.isNullOrUndefined)(p[0])||(p=p[0]),p=(0,t.isNullOrUndefined)(h)||h.rowIndex===p.rowIndex?p:h,null!==d&&null!==l){if(n=i.querySelector("#"+a).parentElement,o=i.querySelector("#"+s).parentElement,0===p.rowIndex||r.getSelectedRowIndexes().length>1)n.classList.add("e-hidden"),o.classList.add("e-hidden");else if("rowDeselected"!==e.name||!(0,t.isNullOrUndefined)(h)&&r.grid.isCheckBoxSelection){var c=r.getCurrentViewRecords()[p.rowIndex];(0,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&&(0,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,r="indentOutdentAction";"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&&!(0,t.isNullOrUndefined)(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[""+r](null,"indent"),e.item.id===i.grid.element.id+"_outdent"&&i.getSelectedRecords().length&&!(0,t.isNullOrUndefined)(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[""+r](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}(),li=function(){function e(e){l.Grid.Inject(l.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,i,r){var n;this.summaryQuery=e;for(var o=[],a=0,s=Object.keys(i).length;a<s;a++){(0,l.getObject)("isSummaryRow",i[parseInt(a.toString(),10)])||o.push(i[parseInt(a.toString(),10)])}var d,p=at(o),h=o.slice(),c=Object.keys(this.parent.aggregates).length,u=Object.keys(p).length,g=this.parent.getColumns();if(this.parent.aggregates.filter((function(e){return e.showChildSummary})).length){var f=0;for(s=u;f<s;f++)if(n=p[parseInt(f.toString(),10)],d=this.getChildRecordsLength(n,h)){for(var y=function(e,i){var o,a=void 0;a={};for(var s=0;s<g.length;s++){a[""+((0,t.isNullOrUndefined)((0,l.getObject)("field",g[parseInt(s.toString(),10)]))?g[parseInt(s.toString(),10)]:(0,l.getObject)("field",g[parseInt(s.toString(),10)]))]=null}if(a=m.createSummaryItem(a,m.parent.aggregates[e-1]),!m.parent.aggregates[e-1].showChildSummary)return"continue";h.map((function(e,t){e.uniqueID!==n.uniqueID||(o=t)}));var p=o+d+e,c=(0,t.extend)({},n);delete c.childRecords,delete c[m.parent.childMapping],(0,t.setValue)("parentItem",c,a);var u=(0,l.getObject)("level",c);if((0,t.setValue)("level",u+1,a),(0,t.setValue)("isSummaryRow",!0,a),(0,t.setValue)("parentUniqueID",c.uniqueID,a),r){var f=(0,l.getObject)("childRecords",n);f.length&&f.push(a)}h.splice(p,0,a)},m=this,S=1,v=c;S<=v;S++)y(S);this.flatChildRecords=[]}}else{for(var w={},I=0,R=g.length;I<R;I++){w[""+((0,t.isNullOrUndefined)((0,l.getObject)("field",g[parseInt(I.toString(),10)]))?g[parseInt(I.toString(),10)]:(0,l.getObject)("field",g[parseInt(I.toString(),10)]))]=null}S=1;for(var x=c;S<=x;S++)this.createSummaryItem(w,this.parent.aggregates[S-1])}return h},e.prototype.getChildRecordsLength=function(e,i){for(var r,n=0,o=Object.keys(i).length;n<o;n++){if(r=i[parseInt(n.toString(),10)],e===((0,t.isNullOrUndefined)(r.parentItem)?null:i.filter((function(e){return e.uniqueID===r.parentItem.uniqueID}))[0])){if(this.flatChildRecords.push(r),!(0,l.getObject)("hasChildRecords",r))continue;this.getChildRecordsLength(r,i)}}return this.flatChildRecords.length},e.prototype.createSummaryItem=function(e,i){for(var r=0,n=Object.keys(i.columns).length;r<n;r++)for(var o=(0,t.isNullOrUndefined)(i.columns[parseInt(r.toString(),10)].columnName)?i.columns[parseInt(r.toString(),10)].field:i.columns[parseInt(r.toString(),10)].columnName,a=0,s=Object.keys(e);a<s.length;a++){var d=s[a];if(d===o)if(this.flatChildRecords.length)e[""+d]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],this.flatChildRecords);else if(this.parent.isLocalData){var l=this.parent.dataSource instanceof tt.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData;e[""+d]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],l)}}return e},e.prototype.getSummaryValues=function(e,i){var r=new tt.Query,n={},o={},a=(0,t.isNullOrUndefined)(e.field)?void 0:this.parent.getColumnByField(e.field).type;e.setPropertiesSilent({format:this.getFormatFromType(e.format,a)}),e.setFormatter(this.parent.grid.locale);var s=e.getFormatter()||function(e){return e};e.setTemplate(o);var d=e.getTemplate(2);r.queries=this.summaryQuery,r.requiresCount();var p,h=new tt.DataManager(i).executeLocal(r),c=e.type;c=[e.type];for(var u=0;u<c.length;u++){p=c[parseInt(u.toString(),10)];var g=e.field+" - "+c[parseInt(u.toString(),10)].toLowerCase(),f="Custom"!==c[parseInt(u.toString(),10)]?(0,l.getObject)("aggregates",h):(0,l.calculateAggregate)(c[parseInt(u.toString(),10)],h,e,this.parent),y=e.columnName,m="Custom"!==c[parseInt(u.toString(),10)]?f[""+g]:f;n[""+y]=n[""+y]||{},n[""+y][""+g]=m,n[""+y][c[parseInt(u.toString(),10)]]=(0,t.isNullOrUndefined)(f)?" ":s(m)}o.format=e.getFormatter();var S=(0,t.createElement)("td",{className:"e-summary"});if(this.parent.isReact){d.fn(n[e.columnName],this.parent,d.property,"",null,null,S),this.parent.renderReactTemplates()}else(0,l.appendChildren)(S,d.fn(n[e.columnName],this.parent,d.property));var v=n[""+e.columnName][""+p];return-1===S.innerHTML.indexOf(v)?S.innerHTML+v:S.innerHTML},e.prototype.getFormatFromType=function(e,i){if((0,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}(),pi=function(){function e(e){l.Grid.Inject(l.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!(0,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){for(var r=0;r<e.length;r++)if((this.parent.grid.filterSettings.columns.length>0||""!==this.parent.grid.searchSettings.key)&&(0,t.isNullOrUndefined)(ct(this.parent,e[parseInt(r.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].hasChildRecords){var n=new tt.DataManager(e[parseInt(r.toString(),10)].childRecords).executeLocal(i);if(this.parent.allowRowDragAndDrop&&-1!==e[parseInt(r.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var o=n.indexOf(this.parent.rowDragAndDropModule.draggedRecord);n.splice(o,1);var a=n.indexOf(this.parent.rowDragAndDropModule.droppedRecord);"topSegment"===this.parent.rowDragAndDropModule.dropPosition?n.splice(a,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&n.splice(a+1,0,this.parent.rowDragAndDropModule.draggedRecord)}this.iterateSort(n,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:(0,l.getActualProperties)(this.parent.grid.sortSettings)},!0)},e.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},e.prototype.destroy=function(){this.removeEventListener()},e}(),hi=function(){function e(e){l.Grid.Inject(l.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}(),ci=function(){function e(e){l.Grid.Inject(l.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=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),r=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),n=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),o=(0,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||(0,t.isNullOrUndefined)(r)||r.classList.contains("e-menu-hide")||(r.style.display="none");var a=this.parent,s=a.getSelectedRows()[0];if(!n&&!o||(0,t.isNullOrUndefined)(s)){if((n||o||a.grid.isEdit)&&(0,t.isNullOrUndefined)(s)){for(var d=0,l=e.items;d<l.length;d++){"Outdent"!==(g=l[d]).text&&"Indent"!==g.text||a.grid.contextMenuModule.hiddenItems.push(g.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}else{var p=e.event.target.closest("td");if(!(0,t.isNullOrUndefined)(p)&&((0,t.isNullOrUndefined)(p)||p.classList.contains("e-rowcell")&&0===p.querySelectorAll(".e-gridform").length)){if(0===s.rowIndex||a.getSelectedRowIndexes().length>1)n.style.display=o.style.display="none";else if("rowDeselected"!==e.name||!(0,t.isNullOrUndefined)(s)&&a.grid.isCheckBoxSelection){var h=a.getCurrentViewRecords()[s.rowIndex];(0,t.isNullOrUndefined)(h)||(h.level>a.getCurrentViewRecords()[s.rowIndex-1].level?n.style.display="none":n.style.display="block",h.level===a.getCurrentViewRecords()[s.rowIndex-1].level&&(n.style.display="block"),0===h.level?o.style.display="none":o.style.display="block")}}else{for(var c=0,u=e.items;c<u.length;c++){var g;"Outdent"!==(g=u[c]).text&&"Indent"!==g.text||a.grid.contextMenuModule.hiddenItems.push(g.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")&&!(0,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}(),ui=function(){function e(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!(0,t.isNullOrUndefined)(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(ae,this.cellSaved,this),this.parent.on(pe,this.batchAdd,this),this.parent.on(ce,this.beforeBatchAdd,this),this.parent.on(ge,this.batchSave,this),this.parent.on(he,this.beforeBatchDelete,this),this.parent.on(ue,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)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ae,this.cellSaved),this.parent.off(pe,this.batchAdd),this.parent.off(ge,this.batchSave),this.parent.off(ce,this.beforeBatchAdd),this.parent.off(he,this.beforeBatchDelete),this.parent.off(ue,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))},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.parent.grid.dataSource instanceof tt.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,r=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!(0,t.isNullOrUndefined)(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var n=0;n<this.batchAddedRecords.length;n++)e=i.map((function(e){return e[""+r]})).indexOf(this.batchAddedRecords[parseInt(n.toString(),10)][""+r]),i.splice(e,1);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 i=this.parent.grid.dataSource instanceof tt.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,r=void 0,n=this.parent.grid.getPrimaryKeyFieldNames()[0],o=void 0,a=void 0,s="parentItem",d=this.selectedIndex>-1?this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s]:null,p=void 0,h=void 0,c=void 0,u="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1;if(u=this.getActualRowObjectIndex(u),this.newBatchRowAdded){if(this.batchRecords.length&&(p=this.batchRecords[this.addRowIndex][this.parent.idMapping],c=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s]&&(h=this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s].uniqueID)),this.batchAddedRecords=pt(this.batchAddedRecords),this.batchAddRowRecord=pt(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),(r=this.parent.grid.getRowsObject()[parseInt(u.toString(),10)].changes).uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),!Object.prototype.hasOwnProperty.call(r,"level")){if(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition){if(r.primaryParent=d,this.selectedIndex>-1){r.parentItem=(0,t.extend)({},this.batchRecords[this.addRowIndex]),r.parentUniqueID=r.parentItem.uniqueID,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping],r.level=r.parentItem.level+1,r.index=this.batchIndex;var g=dt(this.batchRecords[this.addRowIndex]).length,f=dt(this.batchRecords[this.addRowIndex])[g-1];f=(0,t.isNullOrUndefined)(f)?this.batchRecords[this.addRowIndex]:f,o=i.map((function(e){return e[""+n]})).indexOf(f[""+n]),this.isSelfReference&&(r[this.parent.parentIdMapping]=p),_t(n,r.parentItem,"add",this.parent,this.isSelfReference,r)}}else if(("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&!(0,t.isNullOrUndefined)(this.batchRecords[this.addRowIndex])){if(r.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,r.level&&this.selectedIndex>-1&&(r.parentItem=d,r.parentUniqueID=h,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]),r.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){g=dt(this.batchRecords[this.addRowIndex]).length,f=dt(this.batchRecords[this.addRowIndex])[g-1];f=(0,t.isNullOrUndefined)(f)?this.batchRecords[this.addRowIndex]:f,o=i.map((function(e){return e[""+n]})).indexOf(f[""+n])}if("Above"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){f=this.batchRecords[this.addRowIndex];o=i.map((function(e){return e[""+n]})).indexOf(f[""+n])}this.isSelfReference&&(r[this.parent.parentIdMapping]=c)}r.index=-1===r.index?0:r.index,r.hasChildRecords=!1,r.childRecords=[],this.batchRecords.splice(r.index,0,r),this.currentViewRecords.splice(r.index,0,r),a=o||r.index,"Above"!==this.parent.editSettings.newRowPosition&&(a=0===r.index?a:a+1),i.splice(a,0,r),this.batchAddedRecords.push(r)}this.parent.grid.getRowsObject()[parseInt(u.toString(),10)].data=r,this.newBatchRowAdded=!1}}},e.prototype.beforeBatchAdd=function(e){var i="isTabLastRow";if("Cell"===this.parent.editSettings.mode&&this.parent.editModule[""+i])return e.cancel=!0,void(this.parent.editModule[""+i]=!1);!this.parent.editModule.isAddedRowByMethod||(0,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=pt(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=pt(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&(0,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(re,{}),this.batchChildCount=0}this.updateRowIndex();var n=(0,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&&!(0,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("data-rowindex"),10);this.batchRecords.splice(s,0,a[a.length-1])}}},e.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=pt(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=pt(this.parent.grid.getCurrentViewRecords()));var i=(0,t.getValue)("focusModule",this.parent.grid);this.matrix=i.getContent().matrix.matrix;var r,n,o,a,s=[],d=this.parent.grid.getPrimaryKeyFieldNames()[0];(0,t.isNullOrUndefined)(e.row)||-1!==this.parent.getSelectedRows().indexOf(e.row)?(o=dt(n=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),a=this.parent.getSelectedRows()[0].getAttribute("data-uid")):(o=dt(n=e.rowData),a=e.row.getAttribute("data-uid"));var l=parseInt(this.parent.grid.getRowElementByUID(a).getAttribute("data-rowindex"),10);if(o.length)for(var p=l+o.length,h=l+1;h<=p;h++)s.push(this.parent.grid.getDataRows()[parseInt(h.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&s.push(this.parent.grid.getHeaderContent()[parseInt(h.toString(),10)]);if(!(0,t.isNullOrUndefined)(n.parentItem)){var c=ct(this.parent,n.parentItem.uniqueID);if(!(0,t.isNullOrUndefined)(c)&&c.hasChildRecords){var u=c.childRecords.indexOf(n);c.childRecords.splice(u,1)}this.batchDeletedRecords=pt(this.batchDeletedRecords),this.batchDeletedRecords.push(n)}o.push(n),r=o;for(h=0;h<r.length;h++){var g=this.batchRecords.map((function(e){return e[""+d]})).indexOf(r[parseInt(h.toString(),10)][""+d]);-1!==g&&this.batchRecords.splice(g,1)}for(h=0;h<s.length;h++)(0,t.isNullOrUndefined)(s[parseInt(h.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(s[parseInt(h.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("data-rowindex",t.toString())},e.prototype.updateChildCount=function(e){for(var i=this.parent.grid.getPrimaryKeyFieldNames()[0],r="addedRecords",n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<this.parent.getBatchChanges()[""+r].length;o++)(0,t.isNullOrUndefined)(this.parent.getBatchChanges()[""+r][parseInt(o.toString(),10)][""+n])||this.parent.getBatchChanges()[""+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="changedRecords",i="deletedRecords",r=e.batchChanges[""+t];if(e.batchChanges[""+t].length)for(var n=0;n<r.length;n++)Ft({value:r[parseInt(n.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,undefined);if(e.batchChanges[""+i].length){var o=e.batchChanges[""+i];for(n=0;n<o.length;n++){this.deleteUniqueID(o[parseInt(n.toString(),10)].uniqueID);for(var a=dt(o[parseInt(n.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.batchChanges[""+i]=e.batchChanges[""+i].concat(a)}}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="targetElement",r="parentItem",n="index",o=this.parent.grid.getCurrentViewRecords(),a="childRecords",s=this.parent.grid.dataSource instanceof tt.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,d=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!(0,t.isNullOrUndefined)(this.batchAddedRecords))for(var l=0;l<this.batchAddedRecords.length;l++)if(-1!==(e=s.map((function(e){return e[""+d]})).indexOf(this.batchAddedRecords[parseInt(l.toString(),10)][""+d]))&&s.splice(e,1),"Child"===this.parent.editSettings.newRowPosition&&(e=o.map((function(e){return e[""+d]})).indexOf(this.batchAddedRecords[parseInt(l.toString(),10)][""+r]?this.batchAddedRecords[parseInt(l.toString(),10)][""+r][""+d]:this.batchAddedRecords[parseInt(l.toString(),10)][""+d]),!(0,t.isNullOrUndefined)(o[parseInt(e.toString(),10)])))for(var p=o[parseInt(e.toString(),10)][""+a],h=0;p&&h<p.length;h++)p[parseInt(h.toString(),10)][""+d]===this.batchAddedRecords[parseInt(l.toString(),10)][""+d]&&o[parseInt(e.toString(),10)][""+a].splice(h,1);if(!(0,t.isNullOrUndefined)(this.parent[""+i])){var c=this.parent[""+i].closest("tr");this.parent.collapseRow(c),this.parent[""+i]=null}if(!(0,t.isNullOrUndefined)(this.batchDeletedRecords))for(l=0;l<this.batchDeletedRecords.length;l++)if(!(0,t.isNullOrUndefined)(this.batchDeletedRecords[parseInt(l.toString(),10)][""+r])){e=o.map((function(e){return e[""+d]})).indexOf(this.batchDeletedRecords[parseInt(l.toString(),10)][""+r][""+d]);var u=0===this.batchDeletedRecords[parseInt(l.toString(),10)][""+n]?this.batchDeletedRecords[parseInt(l.toString(),10)][""+n]:this.batchDeletedRecords[parseInt(l.toString(),10)][""+n]-1;(0,t.isNullOrUndefined)(o[parseInt(e.toString(),10)])||o[parseInt(e.toString(),10)][""+a].splice(u,0,this.batchDeletedRecords[parseInt(l.toString(),10)])}this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=pt(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=pt(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},e.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var i=void 0,r=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),n="deletedRecords",o=this.parent.grid.dataSource instanceof tt.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,a=this.parent.grid.getCurrentViewRecords(),s=this.parent.grid.getPrimaryKeyFieldNames()[0],d=r.addedRecords,l="parentItem",p=void 0,h=void 0,c=void 0,u=void 0,g="childRecords";if(d.length>1&&"Bottom"!==this.parent.editSettings.newRowPosition&&d.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(o.splice(o.length-d.length,d.length),this.parent.editModule.isAddedRowByMethod&&d.length&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){d.reverse();for(var f=0;f<d.length;f++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(f.toString(),10)].getAttribute("data-rowindex"),10);o.splice(y,0,d[parseInt(f.toString(),10)])}}if(this.parent.allowPaging||o.length===a.length){var m=pt(o);if(m.length){var S=m.map((function(e){return e[""+s]})).indexOf(a[0][""+s]),v=S+this.parent.grid.pageSettings.pageSize;a=m.splice(S,v)}}else a.length>d.length&&a.splice(a.length-d.length,d.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&d.reverse(),i=0;i<d.length;i++){var w=(0,t.extend)({},d[parseInt(i.toString(),10)]);if(delete w.parentItem,delete w.uniqueID,delete w.index,delete w.level,delete w.hasChildRecords,delete w.childRecords,delete w.parentUniqueID,(0,t.isNullOrUndefined)(w.primaryParent)||delete w.primaryParent,d.length>1&&this.parent.editModule.isAddedRowByContextMenu){var I=this.parent.editSettings.newRowPosition;this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=I}if(d[parseInt(i.toString(),10)].taskData=w,u=this.batchAddRowRecord[parseInt(i.toString(),10)],(0,t.isNullOrUndefined)(u)&&(u=this.batchAddRowRecord[i-1]),this.isSelfReference&&((0,t.isNullOrUndefined)(d[parseInt(i.toString(),10)].parentItem)||_t(s,d[parseInt(i.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,d[parseInt(i.toString(),10)])),(0,t.isNullOrUndefined)(u)||(h=u.index),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&(0,t.isNullOrUndefined)(d[parseInt(i.toString(),10)].parentItem)&&-1===this.selectedIndex&&(p=-1,u=null),Ft({value:d[parseInt(i.toString(),10)],action:"add"},this.parent,this.isSelfReference,h,p,c,u),p=null,"Child"===this.parent.editSettings.newRowPosition&&!(0,t.isNullOrUndefined)(d[parseInt(i.toString(),10)][""+l])&&((0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)||this.isSelfReference))for(var R=a.map((function(e){return e[""+s]})).indexOf(d[parseInt(i.toString(),10)][""+l][""+s]),x=a[parseInt(R.toString(),10)][""+g],C=0;C<x.length;C++)x[parseInt(C.toString(),10)][""+s]===d[parseInt(i.toString(),10)][""+s]&&a[parseInt(R.toString(),10)][""+g].splice(C,1)}if(r[""+n].length)for(i=0;i<r[""+n].length;i++)Ft({value:r[""+n][parseInt(i.toString(),10)],action:"delete"},this.parent,this.isSelfReference,h,p,c,u);this.parent.parentData=[];for(var b=0;b<o.length;b++)o[parseInt(b.toString(),10)].index=b,(0,t.setValue)("uniqueIDCollection."+o[parseInt(b.toString(),10)].uniqueID+".index",b,this.parent),o[parseInt(b.toString(),10)].level||this.parent.parentData.push(o[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();if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&this.selectedIndex>-1){if(!(0,t.isNullOrUndefined)(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded)if(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length){if(e+=dt(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition)e+=this.getBatchChildCount()}else e+=dt(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}return 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="index";this.parent.getSelectedRows().length?e[""+t]=this.parent.getSelectedRows()[0].rowIndex:e[""+t]=this.batchIndex},e}(),gi=function(){function e(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,l.Grid.Inject(l.Edit),this.parent=e,this.isSelfReference=!(0,t.isNullOrUndefined)(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new ui(this.parent),this.addEventListener()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.addEventListener=function(){this.parent.on(te,this.crudAction,this),this.parent.on(ie,this.beginEdit,this),this.parent.on(re,this.beginAdd,this),this.parent.on(ne,this.recordDoubleClick,this),this.parent.on(oe,this.cellSave,this),this.parent.on(le,this.batchCancel,this),this.parent.grid.on(fe,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(se,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(me,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(xe,this.beforeStartEdit,this),this.parent.grid.on(Ce,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 i=(0,l.parentsUntil)(e.target,"e-row"),r=i&&parseInt(i.getAttribute("data-rowindex"),10);!(0,t.isNullOrUndefined)(r)&&r>=0&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[r].dataset.uid=this.parent.grid.contentModule.getRows()[r].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(A,e)},e.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(U,e))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(te,this.crudAction),this.parent.off(ie,this.beginEdit),this.parent.off(re,this.beginAdd),this.parent.off(ne,this.recordDoubleClick),this.parent.off(le,this.batchCancel),this.parent.grid.off(fe,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(se,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(me,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(xe,this.beforeStartEdit),this.parent.grid.off(Ce,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 i=(0,l.getObject)("editAction",e),r=(0,l.getObject)("name",i),n=this.parent,o=!(0,t.isNullOrUndefined)(n.dataSource)&&n.dataSource.adaptor;if(!(0,t.isNullOrUndefined)(o)&&(it(n)||o instanceof tt.RemoteSaveAdaptor)&&"save"===i.requestType&&"add"===i.action&&("Child"===n.editSettings.newRowPosition||"Below"===n.editSettings.newRowPosition||"Above"===n.editSettings.newRowPosition))if("actionBegin"===r){var a=(0,t.isNullOrUndefined)(i.row)||!Object.keys(i.row).length?this.selectedIndex:i.row.rowIndex-1,s=(0,t.isNullOrUndefined)(a)||-1===a?-1:n.getCurrentViewRecords()[parseInt(a.toString(),10)][n.getPrimaryKeyFieldNames()[0]];n.grid.query.addParams("relationalKey",s)}else if("actionComplete"===r)for(var d=n.grid.query.params.length,p=0;p<d;p++)"relationalKey"===n.grid.query.params[parseInt(p.toString(),10)].key&&n.grid.query.params.splice(p);this.parent.enableInfiniteScrolling&&"actionComplete"===r&&this.infiniteAddAction(i),"Batch"===this.parent.editSettings.mode&&"paging"===i.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(),i=t.splice(0,1)[0],r=this.addRowIndex,n=this.parent.getCurrentViewRecords();"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(r+=dt(n[r+1]).length),r="Below"===this.parent.editSettings.newRowPosition?r+1:r,t.splice(r,0,i);var o=n.splice(0,1)[0];n.splice(r,0,o),this.updateInfiniteCurrentViewData(o,this.addRowIndex)}var a=this.parent.grid.getRows(),s=this.parent.grid.getRowsObject(),d=this.parent.infiniteScrollSettings.enableCache;d||((0,l.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())),!d&&this.parent.getFrozenColumns()>0&&((0,l.resetRowIndex)(this.parent.grid,s,a,0),this.updateIndex(this.parent.grid.dataSource,a,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)];(0,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+=dt(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 i=e.target;if(!(0,t.isNullOrUndefined)(i.closest("td.e-rowcell"))&&this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit){var r=this.parent.grid.getColumnByIndex(+i.closest("td.e-rowcell").getAttribute("data-colindex"));if("Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&r&&!r.isPrimaryKey&&this.parent.editSettings.allowEditing&&r.allowEditing&&!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick){if(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization){var n=(0,l.parentsUntil)(e.target,"e-row");this.prevAriaRowIndex=n.getAttribute("data-rowindex"),n.setAttribute("data-rowindex",n.rowIndex+"")}this.updateGridEditMode("Batch")}else"Cell"!==this.parent.editSettings.mode||r.allowEditing&&!r.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch"))}},e.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),(0,l.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&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.parent.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="promise",n=e[""+r];if(delete e[""+r],this.parent.enableVirtualization&&!(0,t.isNullOrUndefined)(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("data-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(se,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"),(0,t.isNullOrUndefined)(n)||n.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,(0,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(!(0,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=(0,t.getValue)("editModule.cellDetails",this.parent.grid.editModule),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){rt(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;var r,n;(0,t.setValue)("isEditCollapse",!0,this.parent),e.rowData[e.columnName]=e.value,r=(0,t.isNullOrUndefined)(e.cell)?this.parent.grid.editModule.editModule.form.parentElement.parentNode:e.cell.parentNode;var o=this.parent.getPrimaryKeyFieldNames();if((0,t.isNullOrUndefined)(r))this.parent.grid.getCurrentViewRecords().filter((function(t,i){t[o[0]]!==e.rowData[o[0]]||(n=i)}));else{var a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;n=a?(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 s={};if((0,t.extend)(s,e),s.cancel=!1,s.type="save",r=this.parent.grid.getRows()[r.rowIndex],this.parent.trigger(A,s),s.cancel)this.parent.grid.isEdit=!0;else if(r.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),it(this.parent)||this.parent.dataSource instanceof tt.DataManager&&this.parent.dataSource.adaptor instanceof tt.RemoteSaveAdaptor){if(it(this.parent)||this.parent.dataSource instanceof tt.DataManager&&this.parent.dataSource.adaptor instanceof tt.RemoteSaveAdaptor){var d=this.parent.grid.query;if(this.parent.isGantt&&!this.parent.loadChildOnDemand)this.updateCell(e,n),(0,t.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r);else{this.parent.grid.dataSource.update(o[0],e.rowData,d.fromTable,d,e.previousValue).then((function(o){(0,t.isNullOrUndefined)(o)||(e.rowData[e.columnName]=o[e.columnName]),i.updateCell(e,n),(0,t.setValue)("isEdit",!1,i.parent.grid),i.afterCellSave(e,r)}))}}}else if(rt(this.parent)){var l={requestType:"save",data:e.rowData,action:"edit",row:r,rowIndex:n,rowData:e.rowData,columnName:e.columnName,filterChoiceCount:null,excelSearchOperator:null};this.parent.grid.getDataModule().eventPromise(l,this.parent.grid.query)}else this.updateCell(e,n),(0,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"),(0,t.removeClass)([i],["e-editedrow","e-batchrow"]),(0,t.removeClass)(i.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),Ft({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(U,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){Ft(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,i,this.addRowRecord),this.parent.parentData=[];for(var r=this.parent.grid.dataSource instanceof tt.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=0;n<r.length;n++){r[parseInt(n.toString(),10)].index=n;var o=this.parent.grid.getPrimaryKeyFieldNames()[0];e.value[""+o]===r[parseInt(n.toString(),10)][""+o]&&"add"===e.action&&(r[parseInt(n.toString(),10)].level=this.internalProperties.level,r[parseInt(n.toString(),10)].taskData=this.internalProperties.taskData,r[parseInt(n.toString(),10)].uniqueID=this.internalProperties.uniqueID,(0,t.isNullOrUndefined)(this.internalProperties.parentItem)||(r[parseInt(n.toString(),10)].parentItem=this.internalProperties.parentItem,r[parseInt(n.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),r[parseInt(n.toString(),10)].childRecords=this.internalProperties.childRecords),(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID+".index",n,this.parent);var a=this.parent.dataSource.adaptor;(it(this.parent)||a instanceof tt.RemoteSaveAdaptor)&&(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent),r[parseInt(n.toString(),10)].level||this.parent.parentData.push(r[parseInt(n.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(!(0,t.isNullOrUndefined)(o)){var a=(0,t.getValue)("uniqueIDCollection."+o.uniqueID+".index",this.parent);if(o.index=a,!(0,t.isNullOrUndefined)(o.parentItem)){var s=(0,t.getValue)("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent);o.parentItem.index=s}}}var d=-1,l=this.parent.treeColumnIndex;if(this.parent.getFrozenColumns()>0)for(var p=i[0].querySelectorAll(".e-rowcell"),h=0;h<p.length;h++)if(p[parseInt(h.toString(),10)].classList.contains("e-gridrowindex0level0")){l=h;break}for(var c=0;c<this.parent.getRows().length;c++){i[parseInt(c.toString(),10)].classList.contains("e-detailrow")||d++;var u=r[parseInt(d.toString(),10)];if(!(0,t.isNullOrUndefined)(u)){a=u.index;var g=u.level,f=i[parseInt(c.toString(),10)];(0,t.isNullOrUndefined)(u.parentItem)||(a=(0,t.getValue)("uniqueIDCollection."+u.parentItem.uniqueID+".index",this.parent));var y=f.cells[parseInt(l.toString(),10)];if(!(0,t.isNullOrUndefined)(y)){for(h=0;h<y.classList.length;h++){var m=y.classList[parseInt(h.toString(),10)],S=m.match(/e-gridrowindex/i),v=m.match(/e-griddetailrowindex/i);null!=S&&(0,t.removeClass)([y],m),null!=v&&(0,t.removeClass)([y],m)}i[parseInt(c.toString(),10)].classList.contains("e-detailrow")?(0,t.addClass)([y],"e-griddetailrowindex"+a+"level"+g):(0,t.addClass)([y],"e-gridrowindex"+a+"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("data-rowindex"):0,a=n.length?+n[n.length-1].getAttribute("data-rowindex"):0,s=this.selectedIndex>=o&&this.selectedIndex<=a,d=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode){if("Above"===this.parent.editSettings.newRowPosition)e="before";else if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(this.selectedIndex>-1||d)&&s){if(e="after",!(0,t.isNullOrUndefined)(r[parseInt(i.toString(),10)])&&r[parseInt(i.toString(),10)].expanded)if("Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)){if(i+=dt(r[parseInt(i.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition)i+=this.batchEditModule.getBatchChildCount()}else this.parent.enableVirtualization||(i+=dt(r[parseInt(i.toString(),10)]).length)}if((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]),(0,t.setValue)("batchIndex",i+1,this.batchEditModule);var c="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(c,0,p)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var u=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].remove();(0,t.setValue)("errorRules",[],this.parent.grid.editModule.formObj)}d&&(this.prevAriaRowIndex="-1"),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length)&&h.focus(),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}}if("Batch"===this.parent.editSettings.mode&&!(0,t.isNullOrUndefined)(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var f=this.parent.getBatchChanges().addedRecords,y=void 0;if(f.length)for(g=0;g<f.length;g++)(0,t.isNullOrUndefined)(f[parseInt(g.toString(),10)].uniqueID)&&(y=f[parseInt(g.toString(),10)]);var m={action:"add",data:y,index:i,seletedRow:0};this.beginAddEdit(m),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(m.data)}},e.prototype.beginEdit=function(e){if("refresh"===e.requestType&&this.isOnBatch)e.cancel=!0;else if("Cell"!==this.parent.editSettings.mode||"beginEdit"!==e.requestType){if(this.doubleClickTarget&&(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((0,t.isNullOrUndefined)(e.data[0].uniqueID))for(var r=this.parent.getPrimaryKeyFieldNames(),n=function(t){o.parent.flatData.filter((function(n){n[""+r[0]]===e.data[parseInt(t.toString(),10)][r[0]]&&(i[parseInt(t.toString(),10)]=n)}))},o=this,a=0;a<i.length;a++)n(a);for(a=0;a<i.length;a++){this.deleteUniqueID(i[parseInt(a.toString(),10)].uniqueID);for(var s=dt(i[parseInt(a.toString(),10)]),d=0;d<s.length;d++)this.deleteUniqueID(s[parseInt(d.toString(),10)].uniqueID);e.data=e.data.concat(s)}}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 l='.e-row[data-rowindex="'+this.selectedIndex+'"]',p=void 0;this.selectedIndex>-1&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),p=this.parent.getContent().querySelector(l),this.addRowIndex=p?p.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(l='.e-row[data-rowindex="'+this.prevAriaRowIndex+'"]',p=this.parent.getContent().querySelector(l),this.addRowIndex=p?p.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;(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])):this.addRowRecord=this.parent.getSelectedRecords()[0]}this.isAddedRowByMethod&&0!==e.index&&(this.addRowRecord=this.parent.flatData[e.index],this.addRowIndex=e.index),"Child"!==this.parent.editSettings.newRowPosition||(0,t.isNullOrUndefined)(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0]),(0,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)}else e.cancel=!0},e.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},e.prototype.beginAddEdit=function(e){var i=e.data;if("add"===e.action){var r=this.parent.grid.getPrimaryKeyFieldNames()[0],n=null;i.taskData=(0,t.isNullOrUndefined)(i.taskData)?(0,t.extend)({},e.data):i.taskData;var o=void 0;o=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!(0,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 a=this.addRowIndex;i.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+i.uniqueID,i,this.parent);var s=0,d=void 0,p=void 0,h=void 0,c=void 0,u=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex,g=this.parent.getRows(),f=g.length?o.indexOf(o[0]):0,y=g.length?+g[g.length-1].getAttribute("data-rowindex"):0,m=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=f&&this.selectedIndex<=y;if(o.length&&(d=o[this.addRowIndex][this.parent.idMapping],c=o[this.addRowIndex][this.parent.parentIdMapping],o[this.addRowIndex].parentItem&&(p=o[this.addRowIndex].parentItem.uniqueID),h=o[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&o.length){if(s=o[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition)n="before",a=o[this.addRowIndex].index;else if("Below"===this.parent.editSettings.newRowPosition){n="after";var S=dt(o[this.addRowIndex]).length,v=o[this.addRowIndex].index;a=S>0?v+S:v}else if("Child"===this.parent.editSettings.newRowPosition){n="after",(this.selectedIndex>-1||u)&&m&&(i.parentItem=(0,t.extend)({},o[this.addRowIndex]),i.parentUniqueID=i.parentItem.uniqueID,delete i.parentItem.childRecords,delete i.parentItem[this.parent.childMapping]);var w=dt(o[this.addRowIndex]).length,I=o[this.addRowIndex].index;this.selectedIndex>=0&&(i.level=s+1),a=w>0?I+w:I,this.isSelfReference&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=d:i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=null,(0,t.isNullOrUndefined)(i.parentItem)||_t(r,i.parentItem,"add",this.parent,this.isSelfReference,i))}if("Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((this.selectedIndex>-1||u)&&s&&m&&(i.parentUniqueID=p,i.parentItem=(0,t.extend)({},h),delete i.parentItem.childRecords,delete i.parentItem[this.parent.childMapping]),i.level=s,this.isSelfReference&&(i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=c,(0,t.isNullOrUndefined)(i.parentItem)||_t(r,i.parentItem,"add",this.parent,this.isSelfReference,i))),null!=n&&(this.selectedIndex>-1||u)&&m&&(e.index="before"===n?a:a+1),"Bottom"===this.parent.editSettings.newRowPosition){s=0;var R=this.parent.grid.dataSource instanceof tt.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;e.index=R.length}}(0,t.isNullOrUndefined)(i.level)&&(i.level=s),i.hasChildRecords=!1,i.childRecords=[],i.index=0}if("add"===e.action&&(this.internalProperties={level:i.level,parentItem:i.parentItem,uniqueID:i.uniqueID,taskData:i.taskData,parentUniqueID:(0,t.isNullOrUndefined)(i.parentItem)?void 0:i.parentItem.uniqueID,childRecords:i.childRecords}),"delete"===e.requestType)for(var x=e.data,C=0;C<x.length;C++)if(x[parseInt(C.toString(),10)].parentItem){h=ct(this.parent,x[parseInt(C.toString(),10)].parentItem.uniqueID);if(!(0,t.isNullOrUndefined)(h)&&h.hasChildRecords){var b=h.childRecords.indexOf(x[parseInt(C.toString(),10)]);h.childRecords.splice(b,1)}}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),this.isSelfReference||(0,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),(0,t.isNullOrUndefined)(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0);var s={addedRecords:n,changedRecords:[],deletedRecords:[]};this.parent.notify(ge,{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){(0,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}(),fi=function(){function e(e){l.Grid.Inject(l.CommandColumn),this.parent=e}return e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){},e}(),yi=function(){function e(e){l.Grid.Inject(l.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")})),i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)].getElementsByClassName("e-detailrowcollapse"),n=this.parent.grid.getRowObjectFromUID(e[parseInt(i.toString(),10)].getAttribute("data-Uid")),o=(0,l.getObject)("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(),10)]);((0,t.isNullOrUndefined)(o)||!(0,t.isNullOrUndefined)(o)&&st(this.parent,n.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(r[0])}},e.prototype.childRowExpand=function(e){var i=e.row.getElementsByClassName("e-detailrowcollapse");(0,t.isNullOrUndefined)(i[0])||this.parent.grid.detailRowModule.expand(i[0])},e.prototype.rowExpandCollapse=function(e){if(!it(this.parent))for(var t=0;t<e.detailrows.length;t++)e.detailrows[parseInt(t.toString(),10)].style.display=e.action},e.prototype.detaildataBound=function(e){var i=e.data,r=e.detailElement.parentElement.previousSibling,n="e-gridrowindex"+((0,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);(0,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"),i=(parseInt(t,10)-1).toString();e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",i)}for(var r=this.parent.grid.contentModule.getRows(),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].cells[0].visible=!1;(0,l.getObject)("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},e.prototype.destroy=function(){this.removeEventListener()},e}(),mi=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])},e(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)}}(),Si=function(e){function i(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 mi(i,e),i.prototype.getModelGenerator=function(){return new ri(this.parent)},i.prototype.getRowByIndex=function(e){return this.parent.enableVirtualization&&this.parent.isFrozenGrid()?this.getRowCollection(e,!0):this.parent.getDataRows().filter((function(t){return parseInt(t.getAttribute("data-rowindex"),10)===e}))[0]},i.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},i.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute(Ye),10),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]),a},i.prototype.addEventListener=function(){this.parent.on(ve,this.virtualOtherAction,this),this.parent.on(Re,this.indexModifier,this)},i.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},i.prototype.indexModifier=function(e){var t=this.parent.getContent().querySelector(".e-content");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-this.parent.pageSettings.pageSize){var i=~~(t.scrollTop/this.parent.getRowHeight()),r=i+this.parent.getRows().length;r>e.count&&(r=i+(e.count-i)),this.startIndex=r-this.parent.getRows().length,this.endIndex=r}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=this.parent.pageSettings.pageSize-1),this.endIndex-this.startIndex!==this.parent.pageSettings.pageSize&&this.totalRecords>this.parent.pageSettings.pageSize&&this.endIndex===this.totalRecords?(e.startIndex=this.endIndex-this.parent.pageSettings.pageSize,e.endIndex=this.endIndex):(e.startIndex=this.startIndex,e.endIndex=this.endIndex)},i.prototype.eventListener=function(t){var i=this;this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&rt(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),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(U,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))},i.prototype.cellFocus=function(t){e.prototype.virtualCellFocus.call(this,t)},i.prototype.onDataReady=function(i){if(e.prototype.onDataReady.call(this,i),!(this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&rt(this.parent))){if(!(0,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%",n=this.parent.getRowHeight()*i.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize;(0,t.getValue)("virtualEle",this).setVirtualHeight(n,r)}this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()||(0,t.getValue)("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*i.count,"100%")}(!(0,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)}},i.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&rt(this.parent)||((0,t.getValue)("observer",this).options.debounceEvent=!1,this.observers=new vi((0,t.getValue)("observer",this).element,(0,t.getValue)("observer",this).options),this.contents=this.getPanel().firstChild)},i.prototype.getTranslateY=function(t,i,r,n){return this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||rt(this.parent)?this.isRemoteExpand?(this.isRemoteExpand=!1,this.preTranslate):(this.preTranslate=e.prototype.getTranslateY.call(this,t,i,r,n),e.prototype.getTranslateY.call(this,t,i,r,n)):e.prototype.getTranslateY.call(this,t,i,r,n)},i.prototype.dataBoundEvent=function(){var i="initialRowTop";if(this.parent.getRows().length&&!(0,t.isNullOrUndefined)(this.parent.getRowByIndex(0))&&!this[""+i]){var r=this.parent.getRowByIndex(0).getBoundingClientRect().top,n=this.parent.element.getBoundingClientRect().top;this[""+i]=r>0?this.parent.getRowByIndex(0).getBoundingClientRect().top-n:this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height}e.prototype.dataBound.call(this)},i.prototype.rowSelectedEvent=function(t){e.prototype.rowSelected.call(this,t)},i.prototype.toSelectVirtualRow=function(i){if(!this.parent.isEdit){var r="containerRect";(0,t.isNullOrUndefined)(this.observer[""+r])&&(this.observer[""+r]=this.observers[""+r]),((0,t.isNullOrUndefined)(this.parent.clipboardModule.treeGridParent.editModule)||0!==i.selectedIndex||(0,t.isNullOrUndefined)(this.parent.clipboardModule.treeGridParent.editModule.addRowIndex))&&e.prototype.selectVirtualRow.call(this,i)}},i.prototype.refreshCell=function(e){e.cells=this.generateCells()},i.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},i.prototype.generateCell=function(e,i,r,n,o,a){var s={visible:e.visible,isDataCell:!(0,t.isNullOrUndefined)(e.field||e.template),isTemplate:!(0,t.isNullOrUndefined)(e.template),rowID:i,column:e,cellType:(0,t.isNullOrUndefined)(r)?l.CellType.Data:r,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&(0,t.getValue)(e.field,a)};return(s.isDataCell||"checkbox"===s.column.type||s.commands)&&(s.index=o),new l.Cell(s)},i.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[data-rowindex="'+e.index+'"]',i=this.parent.getContent().querySelector(t).rowIndex,r=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)];e.data=r},i.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("data-rowindex"):0,o=r.length?+r[r.length-1].getAttribute("data-rowindex"):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)},i.prototype.restoreEditState=function(){e.prototype.restoreEdit.call(this)},i.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||e.prototype.resetIsedit.call(this)},i.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},i.prototype.cancelEdit=function(t){e.prototype.editCancel.call(this,t)},i.prototype.toSelectRowOnContextOpen=function(t){e.prototype.selectRowOnContextOpen.call(this,t)},i.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))},i.prototype.getData=function(t){e.prototype.getVirtualData.call(this,t)},i.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)},i.prototype.onEnteredAction=function(){var e=this;return function(i,r,n,o,a,s){if(!e.parent.directVirtualRender){var d="preventEvent";!t.Browser.isIE||a||!s||e[""+d]||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.parent.enableVirtualMaskRow&&!e[""+d]&&setTimeout((function(){e.parent.showMaskRow(r.axis),e.parent.notify("showGanttShimmer",{requestType:"showShimmer"})}),0);var l=e.content.getBoundingClientRect().height,p=e.prevInfo.offsets?e.prevInfo.offsets.top:null,h="X"===r.axis,c=e.getColumnOffset(h?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(h){var u=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,g=e.vgenerator.cOffsets[u-1];c=c>g?g:c}var f=e.getTranslateY(o.top,l,h&&p===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;f=Math.round(e.translateY)>f&&!y?Math.round(e.translateY):f,e.virtualEle.adjustTable(c,f)}else e.virtualEle.adjustTable(c,e.translateY);e.parent.enableColumnVirtualization&&e.header.virtualEle.adjustTable(c,0)}}}},i.prototype.scrollListeners=function(e){this.scrollAfterEdit();var i=e.sentinel,r=this.parent.getRowHeight(),n=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2),o=this.parent.getContent().querySelector(".e-content"),a=n*r,s=e.offset.top-this.translateY<0,d=Math.ceil(e.offset.top-this.translateY)+r>=a,l="selectedRowIndex",p=this.parent.currentViewData,h="index";if(s&&"right"!==e.direction&&"left"!==e.direction){var c=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),u=~~(o.scrollTop/r)+Math.ceil(c/r)-this.parent.pageSettings.pageSize;if(u=u>0?u:0,(0,t.isNullOrUndefined)(this[""+l])||-1===this[""+l]||u===this[""+l]||(u=this[""+l]),this.startIndex=u,this.endIndex=u+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords){var g=this.totalRecords-1,f=this.endIndex%g;this.endIndex=g,this.startIndex=this.startIndex-f<0?0:this.startIndex-f}p.length&&p[0][""+h]>=this.parent.pageSettings.pageSize/2&&p[0][""+h]-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule.isRowSelected&&(this.startIndex=p[0][""+h]-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize);var y=Math.ceil(e.offset.top/r);y%=this.parent.pageSettings.pageSize;var m=0;if(!(0,t.isNullOrUndefined)(this.parent.getRows()[parseInt(y.toString(),10)])&&!(0,t.isNullOrUndefined)(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(y.toString(),10)]))m=+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(y.toString(),10)].querySelector("td").getAttribute("index");0===m?this.translateY=e.offset.top-n*r>0?e.offset.top-n*this.parent.getRowHeight()+r:0:this.parent.getFrozenColumns()>0?(e.offset.top=e.offset.top+80,this.translateY=e.offset.top-n*r>0?e.offset.top-n*r+10:0):this.translateY=e.offset.top-n*r>0?e.offset.top-n*r+10:0}else if(d&&"right"!==e.direction&&"left"!==e.direction){var S=~~(o.scrollTop/r),v=!(this[""+l]+this.parent.pageSettings.pageSize<this.totalRecords);(0,t.isNullOrUndefined)(this[""+l])||-1===this[""+l]||S===this[""+l]||v||(S=this[""+l]);var w=S+this.parent.pageSettings.pageSize;w>this.totalRecords&&(w=S+(this.totalRecords-S)),this.startIndex=!v||(0,t.isNullOrUndefined)(this[""+l])?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),p.length&&this.startIndex>p[0][""+h]&&this.startIndex-p[0][""+h]<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule.isRowSelected&&(this.startIndex=p[0][""+h]+this.parent.pageSettings.pageSize/2),e.offset.top>r*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,o.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.translateY=this.totalRecords*r-(this.endIndex-this.startIndex)*r:this.parent.allowRowDragAndDrop?this.translateY=e.offset.top-2*r:this.parent.getFrozenColumns()>0?this.translateY=e.offset.top-(2*r+this.parent.pageSettings.pageSize):this.translateY=e.offset.top}if(d&&e.offset.top<r*this.totalRecords||s||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&(d||s)||rt(this.parent)){var I=this.currentInfo=(0,t.getValue)("getInfoFromView",this).apply(this,[e.direction,i,e.offset]);this.previousInfo=I,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),d&&this.endIndex===this.totalRecords&&I.loadNext&&(I.loadNext=!1),this.requestType="virtualscroll","right"!==e.direction&&"left"!==e.direction&&(I.event="refresh-virtual-block"===I.event?"model-changed":I.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(i.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"}))},i.prototype.appendContent=function(i,r,n){if(this.parent.dataSource instanceof tt.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||rt(this.parent)||this.parent.isFrozenGrid())(0,t.getValue)("isExpandCollapse",n)&&(this.isRemoteExpand=!0),e.prototype.appendContent.call(this,i,r,n),-1!==(0,t.getValue)("requestTypes",this).indexOf("isFrozen")&&((0,t.getValue)("requestTypes",this).splice((0,t.getValue)("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType);else{var o=n.virtualInfo.sentinelInfo&&"Y"===n.virtualInfo.sentinelInfo.axis&&(0,t.getValue)("currentInfo",this).page&&(0,t.getValue)("currentInfo",this).page!==n.virtualInfo.page?(0,t.getValue)("currentInfo",this):n.virtualInfo,a=o.columnIndexes[0]-1,s=this.getColumnOffset(a),d=void 0;if(this.parent.enableColumnVirtualization){this.header.virtualEle.adjustTable(s,0);var l=o.columnIndexes;d=this.getColumnOffset(l[l.length-1])-this.getColumnOffset(l[0]-1)+"",this.header.virtualEle.setWrapperWidth(d)}this.virtualEle.setWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name),(i=this.parent.createElement("tbody")).appendChild(r);this.getTable().querySelector("tbody").replaceWith(i),this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,(0,t.getValue)("virtualEle",this).adjustTable(s,this.translateY)),(0,t.setValue)("prevInfo",this.previousInfo?this.previousInfo:o,this),"virtualscroll"===n.requestType&&"X"===n.virtualInfo.sentinelInfo.axis&&this.parent.notify(qe,{});e.prototype.focusCell.call(this,n);var p="isAdd";this[""+p]&&!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[""+p]=!1,this.parent.isEdit=!1)),this.restoreEditState(),e.prototype.restoreAdd.call(this),e.prototype.ensureSelectedRowPosition.call(this)}},i.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(ve,this.virtualOtherAction),this.parent.off(Re,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))},i}(l.VirtualContentRenderer),vi=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 mi(i,e),i.prototype.observes=function(i,r,n){if(e.prototype.containerRect=(0,t.getValue)("options",this).container.getBoundingClientRect(),t.EventHandler.add((0,t.getValue)("options",this).container,"scroll",this.virtualScrollHandlers(i,r,n),this),(0,t.getValue)("options",this).movableContainer){e.prototype.movableContainerRect=(0,t.getValue)("options",this).movableContainer.getBoundingClientRect(),t.EventHandler.add((0,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 n=this,o="chrome"===t.Browser.info.name?200:100,a="options",s="movableEle",d="fromWheel",l=(0,t.debounce)(e,o),p=(0,t.debounce)(e,50);return this[""+a].prevTop=this[""+a].prevLeft=0,function(t){var o=n[""+a].movableContainer?n[""+a].container.scrollTop:t.target.scrollTop,h=n[""+a].movableContainer?n[""+a].scrollbar.scrollLeft:t.target.scrollLeft,c=n[""+a].prevTop<o?"down":"up";c=n[""+a].prevLeft===h?c:n[""+a].prevLeft<h?"right":"left",n[""+a].prevTop=o,n[""+a].prevLeft=h;var u=n.sentinelInfo[""+c],g=0;if(n.newPos=o,null!=n.lastPos&&(g=n.newPos-n.lastPos),n.lastPos=n.newPos,n.timer&&clearTimeout(n.timer),n.timer=setTimeout(n.clear,0),(g>100||g<-100)&&t&&t.preventDefault&&(t.returnValue=!1,t.preventDefault()),-1!==n[""+a].axes.indexOf(u.axis)){n.containerRect=n[""+a].container.getBoundingClientRect();var f=n.check(c);if(u.entered&&("X"===u.axis||r.enableVirtualMaskRow)&&(!n[""+s]||"right"!==c&&"left"!==c?i(n.element,u,c,{top:o,left:h},n[""+d],f):i(n[""+s],u,c,{top:o,left:h},n[""+d],f)),f){var y=p;"X"===u.axis?y({direction:c,sentinel:u,offset:{top:o,left:h},focusElement:document.activeElement}):r.dataSource instanceof tt.DataManager&&void 0!==r.dataSource.dataSource.url&&!r.dataSource.dataSource.offline&&""!==r.dataSource.dataSource.url||rt(r)||r.enableVirtualMaskRow?(y=r.enableVirtualMaskRow?l:y)({direction:c,sentinel:u,offset:{top:o,left:h},focusElement:document.activeElement}):e({direction:c,sentinel:u,offset:{top:o,left:h},focusElement:document.activeElement})}n[""+d]=!1}}},i}(l.InterSectionObserver),wi=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])},e(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)}}(),Ii=function(){function e(e){this.prevstartIndex=-1,this.prevendIndex=-1,this.parent=e,l.Grid.Inject(Ri),this.addEventListener()}return e.prototype.returnVisualData=function(e){e.data=this.visualData},e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(K,this.collapseExpandVirtualchilds,this),this.parent.on(W,this.virtualPageAction,this),this.parent.on(we,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(K,this.collapseExpandVirtualchilds),this.parent.off(W,this.virtualPageAction),this.parent.off(we,this.destroy))},e.prototype.collapseExpandVirtualchilds=function(e){this.parent.grid.notify(ve,{isExpandCollapse:!0}),this.expandCollapseRec=e.record,e.record.expanded="collapse"!==e.action;var i={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};(this.parent.enableVirtualization&&"Cell"===this.parent.selectionSettings.mode||"Row"===this.parent.selectionSettings.mode&&!this.parent.selectionSettings.persistSelection)&&this.parent.grid.clearSelection();var r=(0,t.getValue)("isCollapseAll",this.parent)?"collapseAll":"refresh";(0,t.getValue)("grid.renderModule",this.parent).dataManagerSuccess(i,{requestType:r})},e.prototype.virtualPageAction=function(e){var i=this,r=new tt.DataManager(e.result),n=new tt.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),o=r.executeLocal((new tt.Query).where(n)),a=o.filter((function(e){return st(i.parent,e,o)}));this.visualData=a,e.count=a.length,this.parent.grid.notify(Ie,{data:a});var s={startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType};this.parent.grid.notify(Re,s);var d=s.startIndex,p=s.endIndex;if(e.count=a.length,-1===d&&-1===p){var h=new tt.Query,c=this.parent.grid.pageSettings.pageSize,u=c*(this.parent.grid.pageSettings.currentPage-1);h=h.skip(u).take(c),r.dataSource.json=a,e.result=r.executeLocal(h)}else{var g=e.actionArgs.requestType;("filtering"===g||"collapseAll"===g||"searching"===g||"refresh"===g&&this.parent.enableCollapseAll&&p>a.length&&(0,t.isNullOrUndefined)(this.expandCollapseRec))&&(d=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(ve,{setTop:!0})),("save"===g&&e.actionArgs.index>=s.count-this.parent.grid.pageSettings.pageSize||"refresh"===g&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&((s.endIndex+this.parent.pageSettings.pageSize>=s.count&&this.parent.root&&s.count-s.endIndex==this.visualData.length-this.parent.root.previousFlatData.length||!this.parent.isGantt||!this.parent.isAddedFromGantt)&&(d=s.startIndex+(s.count-s.endIndex),p=s.count),this.parent.isAddedFromGantt=!1);var f=this.parent.grid.contentModule.virtualEle.wrapper,y=(0,l.getTransformValues)(f).height;if(!(0,t.isNullOrUndefined)(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&d!==this.prevstartIndex)&&d<this.parent.getRows().length&&p<=d+this.parent.getRows().length&&0===y&&(d=0),!(0,t.isNullOrUndefined)(this.expandCollapseRec)){var m=this.parent.getRows(),S=a.indexOf(this.expandCollapseRec);a.slice(S,S+m.length).length<m.length&&S>=0&&0!==d?(d=S=(S=a.length-m.length)>0?S:0,p=a.length):(0,t.getValue)("isCollapseAll",this.parent)&&(d=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(ve,{setTop:!0}))}!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||(0,t.isNullOrUndefined)(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?d=0:this.parent.isExpandAll||(d=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,d=d<0?0:d,0===p&&a.length>0?e.result=a:e.result=a.slice(d,p),this.prevstartIndex=d,this.prevendIndex=p}this.parent.notify("updateAction",e)},e.prototype.destroy=function(){this.removeEventListener()},e}(),Ri=function(e){function i(i,r){var n=e.call(this,i,r)||this;return(0,t.getValue)("parent",n).off("initial-load",(0,t.getValue)("instantiateRenderer",n),n),(0,t.getValue)("parent",n).on("initial-load",n.instantiateRenderers,n),n}return wi(i,e),i.prototype.getModuleName=function(){return"treeVirtualScroll"},i.prototype.instantiateRenderers=function(){var e=(0,t.getValue)("parent",this);(0,t.getValue)("parent",this).log(["limitation","virtual_height"],"virtualization");var i=(0,t.getValue)("locator",this).getService("rendererFactory");e.enableColumnVirtualization&&(0,t.getValue)("addRenderer",i).apply(i,[l.RenderType.Header,new l.VirtualHeaderRenderer((0,t.getValue)("parent",this),(0,t.getValue)("locator",this))]),(0,t.getValue)("addRenderer",i).apply(i,[l.RenderType.Content,new Si((0,t.getValue)("parent",this),(0,t.getValue)("locator",this))]),this.ensurePageSize()},i.prototype.ensurePageSize=function(){var e=(0,t.getValue)("parent",this),i=e.getRowHeight();(0,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)},i}(l.VirtualScroll),xi=function(){function e(e){l.Grid.Inject(l.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;!(0,t.isNullOrUndefined)(n)&&d.parentElement.firstElementChild.clientHeight>0&&(d.style.height=d.parentElement.firstElementChild.clientHeight+"px"),d.style.display=e.action,a&&r.length&&(r[parseInt(s.toString(),10)].style.display=e.action);var p="none"===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){(0,l.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((0,l.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&&(0,t.addClass)([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getModuleName=function(){return"freeze"},e}(),Ci=function(){function e(e){l.Grid.Inject(l.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}(),bi=function(){function e(e){this.parent=e,l.Grid.Inject(l.InfiniteScroll),this.addEventListener()}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(W,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(W,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(),i=this.parent.grid.infiniteScrollModule.serviceLocator,r=new l.RowRenderer(i,null,this.parent.grid),n=this.parent.getRows(),o=e.index===n.length-1?"after":"before",a=this.parent.grid.getColumns(),s=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),d=[],p=0;p<s.length;p++)d.push(r.render(s[parseInt(p.toString(),10)],a));t.splice.apply(t,[e.index+1,0].concat(s));for(p=0;p<d.length;p++)"after"===o?n[e.index+p][""+o](d[parseInt(p.toString(),10)]):n[e.index+p+1][""+o](d[parseInt(p.toString(),10)]),n.splice(e.index+1+p,0,d[parseInt(p.toString(),10)]);(0,l.resetRowIndex)(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},e.prototype.contentready=function(){if(this.parent.infiniteScrollSettings.enableCache&&!(0,t.isNullOrUndefined)(this.parent.editModule)){var e="updateIndex";this.parent.editModule[""+e](this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns()&&this.parent.editModule[""+e](this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())}},e.prototype.infinitePageAction=function(e){var i=new tt.DataManager(e.result),r=new tt.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),n=i.executeLocal((new tt.Query).where(r)),o=(0,t.getValue)("actionArgs",e.actionArgs),a=(0,t.getValue)("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var s=!!a.some((function(e){return e===o.requestType}))||!!this.parent.initialRender;if(this.visualData=n,e.count=n.length,(0,t.getValue)("isPrinting",e.actionArgs))e.result=n;else{var d=new tt.Query,l=this.parent.infiniteScrollSettings.enableCache;l&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var p=s?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,h=this.parent.grid.pageSettings.currentPage;if((0,t.isNullOrUndefined)(o))d=d.page(h,p);else{var c=(0,t.getValue)("lastIndex",this.parent.grid.infiniteScrollModule),u=(0,t.getValue)("firstIndex",this.parent.grid.infiniteScrollModule);if(l||"delete"!==o.requestType)d=l&&"delete"===o.requestType||"save"===o.requestType&&"add"===o.action?(d=d.skip(u)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):d.page(h,p);else{var g=c-o.data.length+1,f=o.data.length;d=d.skip(g).take(f)}}i.dataSource.json=n,l||(0,t.isNullOrUndefined)(o)||"save"!==o.requestType||"add"!==o.action?e.result=i.executeLocal(d):e.result=[o.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=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),(0,t.remove)(e[parseInt(l.toString(),10)]),e.splice(l,1)}}))},d=0;d<r.length;d++)s(d)},e.prototype.createRows=function(e){var i,r,n=e.args.e,o=e.row,a=this.parent.grid.infiniteScrollModule.serviceLocator,s=new l.RowRenderer(a,null,this.parent.grid),d=this.parent.getCurrentViewRecords(),p=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows();i=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&&(i=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"):i);for(var h="addRowIndex",c=this.parent.editModule[""+h],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!==(0,t.getValue)("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(r="after",c+=dt(d[parseInt(c.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&(c-=1),p[parseInt(c.toString(),10)][""+r](g)):"Above"===this.parent.editSettings.newRowPosition&&(r="before",p[this.parent.editModule[""+h]][""+r](g)):"Bottom"===this.parent.editSettings.newRowPosition?i.appendChild(g):i.insertBefore(g,i.firstElementChild):"delete"===n.requestType&&i.appendChild(g)}e.cancel=!0},e.prototype.destroy=function(){this.removeEventListener()},e}()})(),d})()));
|