@syncfusion/ej2-grids 33.2.8 → 33.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ej2-grids.min.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: ej2-grids.min.js
|
|
3
|
+
* version : 33.2.10
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
+
* Use of this code is subject to the terms of our license.
|
|
6
|
+
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
+
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
+
* applicable laws.
|
|
9
|
+
*/
|
|
1
10
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionPopups"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionCalendars"),require("SyncfusionNavigations"),require("SyncfusionExcelExport"),require("SyncfusionPdfExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionPopups","SyncfusionButtons","SyncfusionInputs","SyncfusionDropdowns","SyncfusionCalendars","SyncfusionNavigations","SyncfusionExcelExport","SyncfusionPdfExport"],t):"object"==typeof exports?exports.SyncfusionGrids=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionPopups"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionCalendars"),require("SyncfusionNavigations"),require("SyncfusionExcelExport"),require("SyncfusionPdfExport")):e.SyncfusionGrids=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionPopups,e.SyncfusionButtons,e.SyncfusionInputs,e.SyncfusionDropdowns,e.SyncfusionCalendars,e.SyncfusionNavigations,e.SyncfusionExcelExport,e.SyncfusionPdfExport)}(self,(e,t,i,n,r,s,o,a,l,h)=>(()=>{"use strict";var d={766:t=>{t.exports=e},741:e=>{e.exports=n},570:e=>{e.exports=o},74:e=>{e.exports=t},778:e=>{e.exports=s},437:e=>{e.exports=l},323:e=>{e.exports=r},215:e=>{e.exports=a},461:e=>{e.exports=h},197:e=>{e.exports=i}},p={};function c(e){var t=p[e];if(void 0!==t)return t.exports;var i=p[e]={exports:{}};return d[e](i,i.exports,c),i.exports}c.d=(e,t)=>{for(var i in t)c.o(t,i)&&!c.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{c.r(u),c.d(u,{Aggregate:()=>Ld,AutoCompleteEditCell:()=>Pp,BatchEdit:()=>rp,BatchEditRender:()=>Gd,BooleanEditCell:()=>Xd,BooleanFilterUI:()=>md,Cell:()=>es,CellRenderer:()=>$s,CellRendererFactory:()=>Do,CellType:()=>t,CheckBoxFilter:()=>Sd,CheckBoxFilterBase:()=>Xh,Clipboard:()=>Jo,Column:()=>p,ColumnChooser:()=>gp,ColumnMenu:()=>Tp,ComboboxEditCell:()=>Bp,CommandColumn:()=>Ip,CommandColumnModel:()=>g,CommandColumnRenderer:()=>bp,ContentRender:()=>Ys,ContextMenu:()=>Rp,Data:()=>Zr,DateFilterUI:()=>yd,DatePickerEditCell:()=>lp,DefaultEditCell:()=>ep,DetailRow:()=>Ed,DialogEdit:()=>op,DialogEditRender:()=>_d,DropDownEditCell:()=>Jd,Edit:()=>cp,EditCellBase:()=>Wd,EditRender:()=>Kd,EditSettings:()=>wa,ExcelExport:()=>vp,ExcelFilter:()=>wd,ExcelFilterBase:()=>ed,ExportHelper:()=>mp,ExportValueFormatter:()=>yp,ExternalMessage:()=>ld,Filter:()=>bd,FilterCellRenderer:()=>cd,FilterSettings:()=>ga,FlMenuOptrUI:()=>ud,ForeignKey:()=>Op,Freeze:()=>Dp,Global:()=>rl,Grid:()=>Ia,GridColumn:()=>f,Group:()=>Td,GroupCaptionCellRenderer:()=>po,GroupCaptionEmptyCellRenderer:()=>co,GroupLazyLoadRenderer:()=>Fp,GroupModelGenerator:()=>Xs,GroupSettings:()=>Ca,HeaderCellRenderer:()=>ro,HeaderRender:()=>Zs,IndentCellRenderer:()=>lo,InfiniteScroll:()=>kp,InfiniteScrollSettings:()=>ua,InlineEdit:()=>np,InlineEditRender:()=>Vd,InterSectionObserver:()=>Nd,LazyLoadGroup:()=>Mp,LoadingIndicator:()=>ba,Logger:()=>na,MaskedTextBoxCellEdit:()=>_p,MultiSelectEditCell:()=>qp,NormalEdit:()=>tp,NumberFilterUI:()=>fd,NumericContainer:()=>id,NumericEditCell:()=>Zd,Page:()=>hd,Pager:()=>od,PagerDropDown:()=>ad,PagerMessage:()=>nd,PdfExport:()=>Cp,Predicate:()=>ca,Print:()=>Ra,Render:()=>Ro,RenderType:()=>i,Reorder:()=>Rd,Resize:()=>xd,ResizeSettings:()=>Sa,ResponsiveDialogAction:()=>r,ResponsiveDialogRenderer:()=>To,ResponsiveToolbarAction:()=>s,Row:()=>$r,RowDD:()=>Dd,RowDropSettings:()=>ya,RowModelGenerator:()=>Vs,RowRenderer:()=>js,Scroll:()=>Ko,Search:()=>Go,SearchSettings:()=>ma,Selection:()=>Vo,SelectionSettings:()=>fa,ServiceLocator:()=>Eo,Sort:()=>td,SortDescriptor:()=>da,SortSettings:()=>pa,StackedColumn:()=>m,StackedHeaderCellRenderer:()=>oo,StringFilterUI:()=>gd,TextWrapSettings:()=>va,TimePickerEditCell:()=>Hp,ToggleEditCell:()=>Vp,Toolbar:()=>Od,ToolbarItem:()=>n,ValueFormatter:()=>l,VirtualContentRenderer:()=>qd,VirtualElementHandler:()=>Hd,VirtualHeaderRenderer:()=>Ud,VirtualRowModelGenerator:()=>Bd,VirtualScroll:()=>jd,accessPredicate:()=>hi,actionBegin:()=>R,actionComplete:()=>D,actionFailure:()=>T,addBegin:()=>Ht,addBiggerDialog:()=>bh,addComplete:()=>jt,addDeleteAction:()=>Yt,addFixedColumnBorder:()=>uh,addRemoveActiveClasses:()=>vl,addRemoveEventListener:()=>Rh,addStickyColumnPosition:()=>yh,addedRecords:()=>Ss,addedRow:()=>ms,afterContentRender:()=>wr,afterFilterColumnMenuClose:()=>Fr,appendChildren:()=>$a,appendInfiniteContent:()=>xn,applyBiggerTheme:()=>Vl,applyStickyLeftRightPosition:()=>gh,ariaColIndex:()=>xs,ariaRowIndex:()=>Rs,autoCol:()=>Nt,batchAdd:()=>ee,batchCancel:()=>te,batchCnfrmDlgCancel:()=>Pr,batchDelete:()=>ie,batchEditFormRendered:()=>Ki,batchForm:()=>Vi,beforeAutoFill:()=>xe,beforeBatchAdd:()=>ne,beforeBatchCancel:()=>_i,beforeBatchDelete:()=>re,beforeBatchSave:()=>se,beforeCellFocused:()=>mt,beforeCheckboxRenderer:()=>qn,beforeCheckboxRendererQuery:()=>xr,beforeCheckboxfilterRenderer:()=>Mr,beforeCopy:()=>be,beforeCustomFilterOpen:()=>Qi,beforeDataBound:()=>fe,beforeDetailTemplateDetach:()=>Xr,beforeExcelExport:()=>$t,beforeFltrcMenuOpen:()=>tn,beforeFragAppend:()=>ki,beforeOpen:()=>Fs,beforeOpenAdaptiveDialog:()=>ye,beforeOpenColumnChooser:()=>me,beforePaste:()=>Ie,beforePdfExport:()=>si,beforePrint:()=>Q,beforeRefreshOnDataChange:()=>Wn,beforeSetPartialRecords:()=>Jr,beforeStartEdit:()=>Gi,beginEdit:()=>oe,bulkSave:()=>Pt,cBoxFltrBegin:()=>Zi,cBoxFltrComplete:()=>$i,calculateAggregate:()=>tl,cancelBegin:()=>Li,capitalizeFirstLetter:()=>Hh,captionActionComplete:()=>Or,cellDeselected:()=>N,cellDeselecting:()=>P,cellEdit:()=>ae,cellFocused:()=>yt,cellSave:()=>le,cellSaved:()=>he,cellSelected:()=>L,cellSelecting:()=>M,cellSelectionBegin:()=>ut,cellSelectionComplete:()=>gt,change:()=>Os,changedRecords:()=>vs,checkBoxChange:()=>we,checkDepth:()=>Ul,checkIsVirtual:()=>jh,checkScrollReset:()=>Yn,clearReactVueTemplates:()=>Ah,click:()=>St,closeBatch:()=>vr,closeEdit:()=>Sr,closeFilterDialog:()=>kn,closeInline:()=>yr,colGroup:()=>Ts,colGroupRefresh:()=>He,columnChooserCancelBtnClick:()=>An,columnChooserClose:()=>Kr,columnChooserOpened:()=>ji,columnChooserSearch:()=>_r,columnChooserUpdate:()=>Wr,columnDataStateChange:()=>Di,columnDeselected:()=>U,columnDeselecting:()=>q,columnDrag:()=>j,columnDragStart:()=>H,columnDragStop:()=>Et,columnDrop:()=>V,columnMenuClick:()=>fi,columnMenuClose:()=>yi,columnMenuOpen:()=>mi,columnPositionChanged:()=>xt,columnSelected:()=>z,columnSelecting:()=>B,columnSelectionBegin:()=>pt,columnSelectionComplete:()=>ct,columnVisibilityChanged:()=>wt,columnWidthChanged:()=>It,columnsPrepared:()=>Ji,commandClick:()=>Oe,commandColumnDestroy:()=>Lr,compareChanges:()=>rh,componentRendered:()=>sn,content:()=>ps,contentReady:()=>Ne,contextMenuClick:()=>di,contextMenuClose:()=>gi,contextMenuOpen:()=>ui,create:()=>As,createCboxWithWrap:()=>Rl,createEditElement:()=>Dh,createVirtualValidationForm:()=>Rr,created:()=>v,crudAction:()=>Xt,customFilterClose:()=>lr,customFilterOpen:()=>Xi,dataBound:()=>E,dataReady:()=>Pe,dataSourceChanged:()=>Ei,dataSourceModified:()=>kt,dataStateChange:()=>Ti,dblclick:()=>Mt,deleteBegin:()=>Gt,deleteComplete:()=>_t,deletedRecords:()=>Cs,destroy:()=>Ct,destroyAutoFillElements:()=>ft,destroyChildGrid:()=>Tr,destroyEditForm:()=>Qr,destroyForm:()=>Jt,destroyed:()=>S,detachDetailTemplate:()=>Yr,detailCollapse:()=>Z,detailDataBound:()=>Y,detailExpand:()=>J,detailIndentCellInfo:()=>ln,detailLists:()=>ra,detailStateChange:()=>an,dialogDestroy:()=>Qt,distinctStringValues:()=>Sl,doesImplementInterface:()=>Da,doubleTap:()=>Zt,downArrow:()=>Ms,editBegin:()=>qt,editComplete:()=>Ut,editNextValCell:()=>Pi,editReset:()=>mn,editedRow:()=>fs,endAdd:()=>de,endDelete:()=>pe,endEdit:()=>ce,ensureFirstRow:()=>Xl,ensureLastRow:()=>Ql,enter:()=>Bs,enterKeyHandler:()=>cr,eventPromise:()=>Zl,excelAggregateQueryCellInfo:()=>Pn,excelExportComplete:()=>ei,excelHeaderQueryCellInfo:()=>ii,excelQueryCellInfo:()=>ti,expandChildGrid:()=>Bi,exportDataBound:()=>Ui,exportDetailDataBound:()=>ni,exportDetailTemplate:()=>ri,exportGroupCaption:()=>ke,exportRowDataBound:()=>qi,extend:()=>Ua,extendObjWithFn:()=>Bl,filterAfterOpen:()=>De,filterBeforeOpen:()=>Te,filterBegin:()=>We,filterCboxValue:()=>rn,filterChoiceRequest:()=>Re,filterCmenuSelect:()=>ar,filterComplete:()=>Qe,filterDialogClose:()=>nr,filterDialogCreated:()=>Si,filterMenuClose:()=>Ci,filterOpen:()=>vi,filterSearchBegin:()=>Ee,findCellIndex:()=>Uh,fltrPrevent:()=>en,focus:()=>ks,foreignKeyData:()=>Ri,freezeRefresh:()=>ci,freezeRender:()=>pi,frozenContent:()=>hs,frozenDirection:()=>ch,frozenHeader:()=>ds,frozenHeight:()=>Ai,frozenLeft:()=>Is,frozenRight:()=>bs,generateExpandPredicates:()=>Bh,generateQuery:()=>Ii,getActualPropFromColl:()=>Qa,getActualProperties:()=>Ga,getActualRowHeight:()=>ll,getAggregateQuery:()=>On,getCellByColAndRowIndex:()=>Sh,getCellFromRow:()=>mh,getCellsByTableName:()=>vh,getCloneProperties:()=>xa,getCollapsedRowsCount:()=>La,getColumnByForeignKeyValue:()=>Ol,getColumnModelByFieldName:()=>Eh,getColumnModelByUid:()=>Th,getColumnWidth:()=>Wl,getComplexFieldID:()=>dl,getCustomDateFormat:()=>Ll,getDatePredicate:()=>Al,getEditedDataIndex:()=>Jl,getElementIndex:()=>Ka,getExpandedState:()=>Pl,getFilterBarOperator:()=>Fn,getFilterMenuPostion:()=>Cl,getForeignData:()=>El,getForeignKeyData:()=>bi,getGroupKeysAndFields:()=>qh,getListHeight:()=>Lh,getNumberFormat:()=>wh,getObject:()=>Ml,getParentIns:()=>Nh,getParsedFieldID:()=>pl,getPosition:()=>Ya,getPredicates:()=>zh,getPrintGridModel:()=>Nl,getPrototypesOfObj:()=>zl,getRowHeight:()=>al,getRowIndexFromElement:()=>Ph,getScrollBarWidth:()=>ol,getScrollWidth:()=>Gl,getSerachFilteredData:()=>Gh,getStateEventArgument:()=>$l,getTransformValues:()=>jl,getUid:()=>Za,getUpdateUsingRaf:()=>Oa,getVirtualData:()=>vn,getVisiblePage:()=>Vh,getZIndexCalcualtion:()=>wl,gridChkBox:()=>gs,gridContent:()=>rs,gridFooter:()=>ss,gridHeader:()=>ns,groupAggregates:()=>st,groupBegin:()=>tt,groupCaptionRow:()=>ys,groupCaptionRowLeftRightPos:()=>Kl,groupCollapse:()=>zn,groupComplete:()=>it,groupReorderRowObject:()=>nh,headerCellInfo:()=>x,headerContent:()=>os,headerDrop:()=>Ot,headerRefreshed:()=>je,headerValueAccessor:()=>Ea,hierarchyPrint:()=>Ni,immutableBatchCancel:()=>Qn,inArray:()=>Wa,inBoundModelChanged:()=>qe,infiniteAppendElements:()=>Mh,infiniteCrudCancel:()=>ir,infiniteEditHandler:()=>Tn,infinitePageQuery:()=>bn,infiniteRemoveElements:()=>Fh,infiniteScrollComplete:()=>Vr,infiniteScrollHandler:()=>wn,infiniteShowHide:()=>In,initForeignKeyColumn:()=>wi,initialCollapse:()=>En,initialEnd:()=>Le,initialFrozenColumnIndex:()=>Hs,initialLoad:()=>Me,isActionPrevent:()=>fl,isAngularMatContainer:()=>lh,isCellHaveWidth:()=>gl,isChildColumn:()=>dh,isComplexField:()=>hl,isEditable:()=>ul,isEnableSeamlessScrolling:()=>Kh,isExportColumns:()=>ka,isGroupAdaptive:()=>Fl,isMatDialogContainer:()=>ah,isRowEnteredInGrid:()=>Yl,isRowPinned:()=>b,ispercentageWidth:()=>eh,iterateArrayOrObject:()=>Na,iterateExtend:()=>Ba,keyPressed:()=>vt,lastRowCellBorderUpdated:()=>Gr,lazyLoadGroupCollapse:()=>Fe,lazyLoadGroupExpand:()=>Ae,lazyLoadScrollHandler:()=>Bn,leftRight:()=>ws,load:()=>C,measureColumnDepth:()=>ql,menuClass:()=>xp,modelChanged:()=>Ue,movableContent:()=>as,movableHeader:()=>ls,nextCellIndex:()=>er,onEmpty:()=>ze,onResize:()=>Se,open:()=>Es,padZero:()=>kl,pageBegin:()=>Ve,pageComplete:()=>Ge,pageDown:()=>Ns,pageUp:()=>Ps,pagerRefresh:()=>mr,parents:()=>el,parentsUntil:()=>_a,partialRefresh:()=>Wi,pdfAggregateQueryCellInfo:()=>Ln,pdfExportComplete:()=>oi,pdfHeaderQueryCellInfo:()=>li,pdfQueryCellInfo:()=>ai,performComplexDataOperation:()=>Ih,prepareColumns:()=>ja,preventBatch:()=>Wt,preventFrozenScrollRefresh:()=>$n,printComplete:()=>X,printGridInit:()=>zi,pushuid:()=>ph,queryCellInfo:()=>I,recordAdded:()=>Mi,recordClick:()=>ge,recordDoubleClick:()=>ue,recursive:()=>Pa,refreshAggregateCell:()=>at,refreshAggregateComplete:()=>Kt,refreshAggregates:()=>lt,refreshComplete:()=>At,refreshCustomFilterClearBtn:()=>sr,refreshCustomFilterOkBtn:()=>rr,refreshExpandandCollapse:()=>dr,refreshFilteredColsUid:()=>Hl,refreshFooterRenderer:()=>ot,refreshForeignData:()=>Tl,refreshFrozenColumns:()=>Hn,refreshFrozenHeight:()=>Jn,refreshFrozenPosition:()=>Br,refreshHandlers:()=>Un,refreshInfiniteCurrentViewData:()=>tr,refreshInfiniteEditrowindex:()=>Ar,refreshInfiniteModeBlocks:()=>Sn,refreshInfinitePersistSelection:()=>kr,refreshResizePosition:()=>zr,refreshSplitFrozenColumn:()=>qr,refreshVirtualBlock:()=>Ft,refreshVirtualCache:()=>fn,refreshVirtualEditFormCells:()=>br,refreshVirtualFrozenHeight:()=>Vn,refreshVirtualFrozenRows:()=>Xn,refreshVirtualLazyLoadCache:()=>Nr,refreshVirtualMaxPage:()=>ur,registerEventHandlers:()=>Oh,removeAddCboxClasses:()=>Dl,removeElement:()=>Xa,removeEventHandlers:()=>kh,removeInfiniteRows:()=>Rn,renderResponsiveChangeAction:()=>Ur,renderResponsiveCmenu:()=>or,renderResponsiveColumnChooserDiv:()=>Hr,reorderBegin:()=>Je,reorderComplete:()=>Ze,resetCachedRowIndex:()=>ih,resetColandRowSpanStickyPosition:()=>fh,resetColspanGroupCaption:()=>_l,resetColumns:()=>Mn,resetDialogAppend:()=>hh,resetInfiniteBlocks:()=>Cn,resetRowIndex:()=>th,resetVirtualFocus:()=>Cr,resizeClassList:()=>Id,resizeStart:()=>ve,resizeStop:()=>Ce,restoreFocus:()=>on,row:()=>us,rowCell:()=>is,rowDataBound:()=>w,rowDeselected:()=>F,rowDeselecting:()=>A,rowDrag:()=>K,rowDragAndDrop:()=>Rt,rowDragAndDropBegin:()=>$e,rowDragAndDropComplete:()=>et,rowDragStart:()=>_,rowDragStartHelper:()=>G,rowDrop:()=>W,rowModeChange:()=>pr,rowPositionChanged:()=>Hi,rowSelected:()=>k,rowSelecting:()=>O,rowSelectionBegin:()=>ht,rowSelectionComplete:()=>dt,rowsAdded:()=>Dt,rowsRemoved:()=>Tt,rtlUpdated:()=>Oi,saveComplete:()=>Vt,scroll:()=>bt,scrollToEdit:()=>Ir,searchBegin:()=>Xe,searchComplete:()=>Ye,selectRowOnContextOpen:()=>fr,selectVirtualRow:()=>Yi,setChecked:()=>xl,setColumnIndex:()=>Ha,setComplexFieldID:()=>cl,setCssInGridPopUp:()=>Va,setDisplayValue:()=>xh,setEnableSeamlessScrolling:()=>Wh,setFormatter:()=>yl,setFreezeSelection:()=>Gn,setFullScreenDialog:()=>hr,setGroupCache:()=>Nn,setHeightToFrozenElement:()=>Zn,setInfiniteCache:()=>Dn,setInfiniteColFrozenHeight:()=>Kn,setInfiniteFrozenHeight:()=>_n,setReorderDestinationElement:()=>jn,setRowElements:()=>sh,setStyleAndAttributes:()=>qa,setValidationRuels:()=>Ch,setVirtualPageQuery:()=>gr,shiftEnter:()=>zs,shiftTab:()=>Us,showAddNewRowFocus:()=>jr,showEmptyGrid:()=>xi,sliceElements:()=>oh,sortBegin:()=>_e,sortComplete:()=>Ke,stickyScrollComplete:()=>Er,summaryIterator:()=>Pd,tab:()=>qs,table:()=>cs,tbody:()=>Ds,templateCompiler:()=>za,textWrapRefresh:()=>Fi,toggleFilterUI:()=>bl,toogleCheckbox:()=>Il,toolbarClick:()=>$,toolbarRefresh:()=>Lt,tooltipDestroy:()=>Bt,uiUpdate:()=>Be,ungroupBegin:()=>nt,ungroupComplete:()=>rt,upArrow:()=>Ls,updateColumnTypeForExportColumns:()=>Aa,updateData:()=>zt,updatecloneRow:()=>Fa,valCustomPlacement:()=>nn,validateVirtualForm:()=>Dr,valueAccessor:()=>Ta,virtaulCellFocus:()=>dn,virtaulKeyHandler:()=>hn,virtualScrollAddActionBegin:()=>yn,virtualScrollEdit:()=>gn,virtualScrollEditActionBegin:()=>pn,virtualScrollEditCancel:()=>un,virtualScrollEditSuccess:()=>cn,wrap:()=>ml});var e,t,i,n,r,s,o=c(766),a=c(74),l=function(){function e(e){this.intl=new o.Internationalization,(0,o.isNullOrUndefined)(e)||(this.intl.culture=e)}return e.prototype.getFormatFunction=function(e){return(0,o.isNullOrUndefined)(e)||"dateTime"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"time"!==e.type?this.intl.getNumberFormat(e):this.intl.getDateFormat(e)},e.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},e.prototype.fromView=function(e,t,i){return"date"!==i&&"datetime"!==i&&"number"!==i||(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(e)?e:t(e)},e.prototype.toView=function(e,t){var i=e;return(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(e)||(i=t(e)),i},e.prototype.setCulture=function(e){(0,o.isNullOrUndefined)(e)||(0,o.setCulture)(e)},e}(),h=(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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}),d=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},p=function(){function e(e,t){var i=this;this.disableHtmlEncode=!0,this.enableRowSpan=!0,this.enableColumnSpan=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return i.editTemplateFn},this.getFilterTemplate=function(){return i.filterTemplateFn},this.templateOptions={enableAriaLabel:!0},(0,o.merge)(this,e),this.parent=t,"none"===this.type?this.type=null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),(0,o.isNullOrUndefined)(this.uid)&&(this.uid=Za("grid-column"));var n=new l;if(e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(n.getFormatFunction((0,o.extend)({},e.format))),this.setParser(n.getParserFunction(e.format))),this.toJSON=function(){for(var e={},t=["filter","dataSource","headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],n=Object.keys(i),r=0;r<n.length;r++)if("columns"===n[parseInt(r.toString(),10)]){e[n[parseInt(r.toString(),10)]]=[];for(var s=0;s<i[n[parseInt(r.toString(),10)]].length;s++)e[n[parseInt(r.toString(),10)]].push(i[n[parseInt(r.toString(),10)]][parseInt(s.toString(),10)].toJSON())}else t.indexOf(n[parseInt(r.toString(),10)])<0&&(e[n[parseInt(r.toString(),10)]]=i[n[parseInt(r.toString(),10)]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.enableColumnSpan=!1,this.enableRowSpan=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=za(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=za(this.headerTemplate)),!(0,o.isNullOrUndefined)(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=za(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=za(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=za(this.filterTemplate)),this.isForeignColumn()&&((0,o.isNullOrUndefined)(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params&&this.edit.params.dataSource&&(this.edit.params.ddEditedData=!0),this.edit.params=(0,o.extend)({dataSource:this.dataSource,query:new a.Query,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer){var r=this.sortComparer;this.sortComparer=function(e,t,n,s){if("string"==typeof r&&(r=Ml(r,window)),"Descending"===i.sortDirection){var o=e;e=t,t=o;var a=n;n=s,s=a}return r(e,t,n,s)}}!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=Ml(i.foreignKeyValue,El(i,{},e)[0]),t=Ml(i.foreignKeyValue,El(i,{},t)[0]),"Descending"===i.sortDirection?a.DataUtil.fnDescending(e,t):a.DataUtil.fnAscending(e,t)})}return e.prototype.getSortDirection=function(){return this.sortDirection},e.prototype.setSortDirection=function(e){this.sortDirection=e},e.prototype.getFreezeTableName=function(){return this.freezeTable},e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=function(i){if("columns"===t[parseInt(i.toString(),10)])for(var r=e[t[parseInt(i.toString(),10)]],s=function(e){n.columns.find(function(t){return t.field===r[parseInt(e.toString(),10)].field}).setProperties(r[parseInt(e.toString(),10)])},o=0;o<r.length;o++)s(o);else n[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]];n.parent&&n.parent.isReact&&("template"===t[parseInt(i.toString(),10)]?(n.templateFn=za(e[t[parseInt(i.toString(),10)]]),n.parent.refreshReactColumnTemplateByUid(n.uid,!0)):"headerTemplate"===t[parseInt(i.toString(),10)]?(n.headerTemplateFn=za(e[t[parseInt(i.toString(),10)]]),n.parent.refreshReactHeaderTemplateByUid(n.uid)):"editTemplate"===t[parseInt(i.toString(),10)]?n.editTemplateFn=za(e[t[parseInt(i.toString(),10)]]):"filterTemplate"===t[parseInt(i.toString(),10)]?n.filterTemplateFn=za(e[t[parseInt(i.toString(),10)]]):"commandsTemplate"===t[parseInt(i.toString(),10)]&&(n.templateFn=za(e[t[parseInt(i.toString(),10)]])))},n=this,r=0;r<t.length;r++)i(r)},e.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},e.prototype.getFormatter=function(){return this.formatFn},e.prototype.setFormatter=function(e){this.formatFn=e},e.prototype.getParser=function(){return this.parserFn},e.prototype.setParser=function(e){this.parserFn=e},e.prototype.getColumnTemplate=function(){return this.templateFn},e.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},e.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},e.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},e}(),g=function(){function e(){}return d([(0,o.Property)()],e.prototype,"title",void 0),d([(0,o.Property)()],e.prototype,"type",void 0),d([(0,o.Property)()],e.prototype,"buttonOption",void 0),e}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),d([(0,o.Property)(null)],t.prototype,"columns",void 0),t}(p),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t}(f),y=c(197),v="create",S="destroy",C="load",w="rowDataBound",b="isRowPinned",I="queryCellInfo",x="headerCellInfo",R="actionBegin",D="actionComplete",T="actionFailure",E="dataBound",O="rowSelecting",k="rowSelected",A="rowDeselecting",F="rowDeselected",M="cellSelecting",L="cellSelected",P="cellDeselecting",N="cellDeselected",B="columnSelecting",z="columnSelected",q="columnDeselecting",U="columnDeselected",H="columnDragStart",j="columnDrag",V="columnDrop",G="rowDragStartHelper",_="rowDragStart",K="rowDrag",W="rowDrop",Q="beforePrint",X="printComplete",Y="detailDataBound",J="detailExpand",Z="detailCollapse",$="toolbarClick",ee="batchAdd",te="batchCancel",ie="batchDelete",ne="beforeBatchAdd",re="beforeBatchDelete",se="beforeBatchSave",oe="beginEdit",ae="cellEdit",le="cellSave",he="cellSaved",de="endAdd",pe="endDelete",ce="endEdit",ue="recordDoubleClick",ge="recordClick",fe="beforeDataBound",me="beforeOpenColumnChooser",ye="beforeOpenAdaptiveDialog",ve="resizeStart",Se="resizing",Ce="resizeStop",we="checkBoxChange",be="beforeCopy",Ie="beforePaste",xe="beforeAutoFill",Re="filterchoicerequest",De="filterAfterOpen",Te="filterBeforeOpen",Ee="filterSearchBegin",Oe="commandClick",ke="exportGroupCaption",Ae="lazyLoadGroupExpand",Fe="lazyLoadGroupCollapse",Me="initial-load",Le="initial-end",Pe="data-ready",Ne="content-ready",Be="ui-update",ze="on-empty",qe="inbound-model-changed",Ue="model-changed",He="colgroup-refresh",je="header-refreshed",Ve="paging-begin",Ge="paging-complete",_e="sorting-begin",Ke="sorting-complete",We="filtering-begin",Qe="filtering-complete",Xe="searching-begin",Ye="searching-complete",Je="reorder-begin",Ze="reorder-complete",$e="rowdraganddrop-begin",et="rowdraganddrop-complete",tt="grouping-begin",it="grouping-complete",nt="ungrouping-begin",rt="ungrouping-complete",st="group-aggregates",ot="refresh-footer-rendered",at="refresh-aggregate-cell",lt="refresh-aggregates",ht="rowselecting",dt="rowselected",pt="columnselecting",ct="columnselected",ut="cellselecting",gt="cellselected",ft="destroy-autofill-elements",mt="beforecellfocused",yt="cellfocused",vt="key-pressed",St="click",Ct="destroy",wt="column-visible-changed",bt="scroll",It="column-width-changed",xt="column-position-changed",Rt="row-drag-and-drop",Dt="rows-added",Tt="rows-removed",Et="column-drag-stop",Ot="header-drop",kt="datasource-modified",At="refresh-complete",Ft="refresh-virtual-block",Mt="dblclick",Lt="toolbar-refresh",Pt="bulk-save",Nt="auto-col",Bt="tooltip-destroy",zt="update-data",qt="edit-begin",Ut="edit-complete",Ht="add-begin",jt="add-complete",Vt="save-complete",Gt="delete-begin",_t="delete-complete",Kt="refresh-aggregate-on-save-complete",Wt="prevent-batch",Qt="dialog-destroy",Xt="crud-Action",Yt="add-delete-Action",Jt="destroy-form",Zt="double-tap",$t="beforeExcelExport",ei="excelExportComplete",ti="excelQueryCellInfo",ii="excelHeaderQueryCellInfo",ni="exportDetailDataBound",ri="exportDetailTemplate",si="beforePdfExport",oi="pdfExportComplete",ai="pdfQueryCellInfo",li="pdfHeaderQueryCellInfo",hi="access-predicate",di="contextMenuClick",pi="freezerender",ci="freezerefresh",ui="contextMenuOpen",gi="contextMenuClose",fi="columnMenuClick",mi="columnMenuOpen",yi="columnMenuClose",vi="filterOpen",Si="filterDialogCreated",Ci="filter-menu-close",wi="initForeignKeyColumn",bi="getForeignKeyData",Ii="generateQuery",xi="showEmptyGrid",Ri="foreignKeyData",Di="columnDataStateChange",Ti="dataStateChange",Ei="dataSourceChanged",Oi="rtl-updated",ki="beforeFragAppend",Ai="frozenHeight",Fi="textWrapRefresh",Mi="recordAdded",Li="cancel-Begin",Pi="editNextValCell",Ni="hierarchyprint",Bi="expandchildgrid",zi="printGrid-Init",qi="export-RowDataBound",Ui="export-DataBound",Hi="row-position-changed",ji="columnChooserOpened",Vi="batchedit-form",Gi="edit-form",_i="before-batch-cancel",Ki="batcheditform-rendered",Wi="partial-refresh",Qi="beforeCustomFilterOpen",Xi="customFilterOpen",Yi="select-virtual-Row",Ji="columns-prepared",Zi="cbox-filter-begin",$i="cbox-filter-complete",en="filter-Prevent",tn="before-filter-cmenu-open",nn="validation-custom-placement",rn="filter-cbox-value",sn="component-rendered",on="restore-Focus",an="detail-state-change",ln="detail-indentcell-info",hn="virtaul-key-handler",dn="virtaul-cell-focus",pn="virtual-scroll-edit-action-begin",cn="virtual-scroll-edit-success",un="virtual-scroll-edit-cancel",gn="virtual-scroll-edit",fn="refresh-virtual-cache",mn="edit-reset",yn="virtual-scroll-add-action-begin",vn="get-virtual-data",Sn="refresh-infinite-mode-blocks",Cn="reset-infinite-blocks",wn="infinite-scroll-handler",bn="infinite-page-query",In="infinite-show-hide",xn="append-infinite-content",Rn="remove-infinite-rows",Dn="set-infinite-cache",Tn="infinite-edit-handler",En="initial-collapse",On="get-aggregate-query",kn="close-filter-dialog",An="columnChooserCancelBtnClick",Fn="get-filterbar-operator",Mn="reset-columns",Ln="pdfAggregateQueryCellInfo",Pn="excelAggregateQueryCellInfo",Nn="group-cache",Bn="lazy-load-scroll-handler",zn="group-collapse",qn="beforeCheckboxRenderer",Un="refreshResizeHandlers",Hn="refresh-frozen-columns",jn="set-reorder-destination-element",Vn="refresh-virtual-frozen-height",Gn="set-freeze-selection",_n="set-infinite-frozen-height",Kn="set-infinite-col-frozen-height",Wn="before-refresh-on-data-change",Qn="immutable-batch-cancel",Xn="refresh-virtual-frozenrows",Yn="check-scroll-reset",Jn="refresh-frozen-height",Zn="set-height-to-frozen-element",$n="prevent-frozen-scroll-refresh",er="next-cell-index",tr="refresh-infinite-current-view-data",ir="infinite-crud-cancel",nr="filter-dialog-close",rr="refresh-cutsom-filter-ok-button",sr="refresh-cutsom-filter-clear-button",or="render-responsive-cmenu",ar="filter-cmenu-select",lr="custom-filter-close",hr="set-fullscreen-dialog",dr="refresh-Expand-and-Collapse",pr="row-mode-change",cr="enter-key-handler",ur="refresh-virtual-max-page",gr="set-virtual-page-query",fr="select-row-on-context-open",mr="pager-refresh",yr="closeinline",vr="closebatch",Sr="close-edit",Cr="reset-virtual-focus",wr="after-content-renderer",br="refresh-virtual-editform-cells",Ir="scroll-to-edit",xr="before-checkbox-renderer-query",Rr="create-virtual-validation-form",Dr="validate-virtual-form",Tr="destroy-child-grid",Er="sticky-scroll-complete",Or="infinite-group-collapse",kr="refresh-infinite-persist-selection",Ar="refresh-infinite-editrowindex",Fr="after-filter-column-menu-close",Mr="beforeCheckboxfilterRenderer",Lr="commandColumnDestroy",Pr="cancelcnfrmDlg",Nr="refresh-Virtual-LazyLoad-Cache",Br="refresh-Frozen-Position",zr="refresh-Resize-Position",qr="refresh-Split-Frozen-Column",Ur="render-Responsive-Change-Action",Hr="render-Responsive-Column-Chooser-Div",jr="show-Add-New-Row-Focus",Vr="infinitescroll-complete",Gr="last-rowcell-border-updated",_r="columnChooserSearch",Kr="columnChooserClose",Wr="columnChooserUpdate",Qr="destroy-edit-form",Xr="beforeDetailTemplateDetach",Yr="detach-detail-template",Jr="beforeSetPartialRecords";!function(e){e[e.Data=0]="Data",e[e.Header=1]="Header",e[e.Summary=2]="Summary",e[e.GroupSummary=3]="GroupSummary",e[e.CaptionSummary=4]="CaptionSummary",e[e.Filter=5]="Filter",e[e.Indent=6]="Indent",e[e.GroupCaption=7]="GroupCaption",e[e.GroupCaptionEmpty=8]="GroupCaptionEmpty",e[e.Expand=9]="Expand",e[e.HeaderIndent=10]="HeaderIndent",e[e.StackedHeader=11]="StackedHeader",e[e.DetailHeader=12]="DetailHeader",e[e.DetailExpand=13]="DetailExpand",e[e.CommandColumn=14]="CommandColumn",e[e.DetailFooterIntent=15]="DetailFooterIntent",e[e.RowDragIcon=16]="RowDragIcon",e[e.RowDragHIcon=17]="RowDragHIcon"}(t||(t={})),function(e){e[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary"}(i||(i={})),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.Print=5]="Print",e[e.Search=6]="Search",e[e.ColumnChooser=7]="ColumnChooser",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.WordExport=11]="WordExport"}(n||(n={})),function(e){e[e.isEdit=0]="isEdit",e[e.isAdd=1]="isAdd",e[e.isSort=2]="isSort",e[e.isFilter=3]="isFilter",e[e.isColMenu=4]="isColMenu",e[e.isColumnChooser=5]="isColumnChooser"}(r||(r={})),function(e){e[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch"}(s||(s={}));var Zr=function(){function e(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Dt,this.addRows,this),this.parent.on(Hi,this.reorderRows,this),this.parent.on(Tt,this.removeRows,this),this.parent.on(kt,this.initDataManager,this),this.parent.on(Ct,this.destroy,this),this.parent.on(zt,this.crudActions,this),this.parent.on(Yt,this.getData,this),this.parent.on(Nt,this.refreshFilteredCols,this),this.parent.on(Ji,this.refreshFilteredCols,this))}return e.prototype.reorderRows=function(e){this.parent.isRemote()?this.parent.getCurrentViewRecords().splice(e.toIndex,0,this.parent.getCurrentViewRecords().splice(e.fromIndex,1)[0]):this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},e.prototype.getModuleName=function(){return"data"},e.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof a.DataManager?e.dataSource:(0,o.isNullOrUndefined)(e.dataSource)?new a.DataManager:new a.DataManager(e.dataSource),!e.isAngular||e.query instanceof a.Query?(this.isQueryInvokedFromData=!0,e.query instanceof a.Query||(e.query=new a.Query)):e.setProperties({query:new a.Query},!0)},e.prototype.generateQuery=function(e,t){var i=this.parent,n=(0,o.isNullOrUndefined)(i.getQuery())?new a.Query:i.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)n.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var r=[],s=this.parent.columns,l=0;l<s.length;l++)r.push(s[parseInt(l.toString(),10)].field);n.select(r)}return this.filterQuery(n),this.searchQuery(n),this.aggregateQuery(n),this.sortQuery(n),Fl(this.parent)?this.virtualGroupPageQuery(n):this.pageQuery(n,e),!(0,o.isNullOrUndefined)(t)&&t||this.groupQuery(n),n},e.prototype.pinnedDataQuery=function(e){return this.filterQuery(e),this.searchQuery(e),this.sortQuery(e),e},e.prototype.aggregateQuery=function(e){for(var t=this.parent.aggregates,i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)],r=0;r<n.columns.length;r++)for(var s=n.columns[parseInt(r.toString(),10)],o=s.type instanceof Array?s.type:[s.type],a=0;a<o.length;a++)e.aggregate(o[parseInt(a.toString(),10)].toLowerCase(),s.field);return e},e.prototype.virtualGroupPageQuery=function(e){if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[parseInt(t.toString(),10)].fn&&e.queries.splice(t,1);return e},e.prototype.pageQuery=function(e,t){var i=this.parent;if(t)return e;var n={query:e,skipPage:!1};if(i.notify(gr,n),n.skipPage)return e;if((i.allowPaging||i.enableVirtualization||i.enableInfiniteScrolling)&&!0!==t){if(i.pageSettings.currentPage=Math.max(1,i.pageSettings.currentPage),i.pageSettings.pageCount<=0&&(i.pageSettings.pageCount=8),i.pageSettings.pageSize<=0&&(i.pageSettings.pageSize=12),e.queries.length)for(var r=0;r<e.queries.length;r++)"onPage"===e.queries[parseInt(r.toString(),10)].fn&&e.queries.splice(r,1);!(0,o.isNullOrUndefined)(i.infiniteScrollModule)&&i.enableInfiniteScrolling?this.parent.notify(bn,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof a.RemoteSaveAdaptor?i.pageSettings.pageSize:null)}return e},e.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length){this.parent.groupSettings.enableLazyLoading&&e.lazyLoad.push({key:"isLazyLoad",value:this.parent.groupSettings.enableLazyLoading});for(var i=t.groupSettings.columns,n=0,r=i.length;n<r;n++){var s=this.getColumnByField(i[parseInt(n.toString(),10)]);s||this.parent.log("initial_action",{moduleName:"group",columnName:i[parseInt(n.toString(),10)]});var o=s.enableGroupByFormat,a=s.format;o?e.group(i[parseInt(n.toString(),10)],this.formatGroupColumn.bind(this),a):e.group(i[parseInt(n.toString(),10)],null)}}return e},e.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var i=t.sortSettings.columns,n=[],r=i.length-1;r>-1;r--){if(!(a=this.getColumnByField(i[parseInt(r.toString(),10)].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[parseInt(r.toString(),10)].field}),e;a.setSortDirection(i[parseInt(r.toString(),10)].direction);var s=i[parseInt(r.toString(),10)].direction;a.sortComparer&&(s=a.sortComparer.bind(a)),-1===t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)?a.isForeignColumn()||a.sortComparer?e.sortByForeignKey(a.field,s,void 0,i[parseInt(r.toString(),10)].direction.toLowerCase(),a.foreignKeyValue):e.sortBy(a.field,s):n.push({direction:s,field:a.field})}r=0;for(var o=n.length;r<o;r++)if("string"==typeof n[parseInt(r.toString(),10)].direction)e.sortBy(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction);else{var a=this.getColumnByField(n[parseInt(r.toString(),10)].field);e.sortByForeignKey(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction,void 0,a.getSortDirection().toLowerCase(),a.foreignKeyValue)}}return e},e.prototype.searchQuery=function(e,t,i){var n=this.parent.searchSettings,r=!(0,o.isNullOrUndefined)(n.fields)&&n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[],l=!1;if(!(0,o.isNullOrUndefined)(this.parent.searchSettings.key)&&this.parent.searchSettings.key.length){l=this.parent.getForeignKeyColumns().some(function(e){return r.indexOf(e.field)>-1});var h=i?t.dataSource.adaptor:this.dataManager.adaptor;if(l||h.getModuleName&&"ODataV4Adaptor"===h.getModuleName()){r=i?[t.foreignKeyValue]:r;for(var d=0;d<r.length;d++){var p=i?t:this.getColumnByField(r[parseInt(d.toString(),10)]);p.isForeignColumn()&&!i?s=this.fGeneratePredicate(p,s):s.push(new a.Predicate(r[parseInt(d.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}var c=a.Predicate.or(s);c.key=n.key,e.where(c)}else e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent)}return e},e.prototype.filterQuery=function(e,t,i){var n,r=this.parent,s=[],l=[],h=this.parent.getForeignKeyColumns();if(r.allowFiltering&&r.filterSettings.columns.length){for(var d=t||r.filterSettings.columns,p={},c=0,u=r.getColumns();c<u.length;c++){p[(T=u[c]).field]=T.filter.type?T.filter.type:r.filterSettings.type}for(var g=[],f=[],m=0,y=d;m<y.length;m++){var v=(T=y[m]).isForeignKey?r.getColumnByUid(T.uid):r.getColumnByField(T.field);(0,o.isNullOrUndefined)(T.type)&&v&&("date"===v.type||"datetime"===v.type||"dateonly"===v.type)&&(T.type=T.isForeignKey?r.getColumnByUid(T.uid).type:r.getColumnByField(T.field).type),T.isForeignKey?g.push(T):f.push(T)}if(f.length){for(var S=0,C=f.length;S<C;S++)f[parseInt(S.toString(),10)].uid=f[parseInt(S.toString(),10)].uid||this.parent.grabColumnByFieldFromAllCols(f[parseInt(S.toString(),10)].field,f[parseInt(S.toString(),10)].isForeignKey).uid;for(var w=Xh.getPredicate(f),b=0,I=Object.keys(w);b<I.length;b++){var x=I[b];s.push(w[""+x])}}if(g.length)for(var R=0,D=g;R<D.length;R++){var T;(T=D[R]).uid=T.uid||this.parent.grabColumnByFieldFromAllCols(T.field,T.isForeignKey).uid;var E=this.parent.grabColumnByUidFromAllCols(T.uid);if(E||this.parent.log("initial_action",{moduleName:"filter",columnName:T.field}),E.isForeignColumn()&&Ol(T.field,h)&&!i)l.push(T),E.columnData.length||(n=!0),s=this.fGeneratePredicate(E,s);else{w=Xh.getPredicate(d);for(var O=0,k=Object.keys(w);O<k.length;O++){x=k[O];s.push(w[""+x])}}}s.length&&!n?e.where(a.Predicate.and(s)):this.parent.notify(xi,{})}return e},e.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(Ii,{predicate:i,column:e}),i.predicate.predicates.length&&t.push(i.predicate)),t},e.prototype.getData=function(e,t){var i=this;void 0===e&&(e={requestType:""});var n=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,t,n).promise;var r=void 0;switch(e.requestType){case"delete":if(t=t||this.generateQuery(),1===Object.keys(e.data).length)r=this.dataManager.remove(n,e.data[0],t.fromTable,t);else{var s={addedRecords:[],deletedRecords:[],changedRecords:[]};s.deletedRecords=e.data,r=this.dataManager.saveChanges(s,n,t.fromTable,t.requiresCount())}break;case"save":t=t||this.generateQuery(),e.index=(0,o.isNullOrUndefined)(e.index)?0:e.index,r=this.dataManager.insert(e.data,t.fromTable,t,e.index)}return e.promise=r,!r||Array.isArray(r)||r.hasOwnProperty("deletedRecords")?this.insert(t,e):r.then(function(){return i.insert(t,e)})},e.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(Mi,t)),this.executeQuery(e)},e.prototype.executeQuery=function(e){var t=this;if(this.dataManager.ready){var i=new a.Deferred;return this.dataManager.ready.then(function(){t.dataManager.executeQuery(e).then(function(e){i.resolve(e)})}).catch(function(e){i.reject(e)}),i.promise}return this.dataManager.executeQuery(e)},e.prototype.formatGroupColumn=function(e,t){var i=this.serviceLocator,n=this.getColumnByField(t),r=e;return n.type||(n.type=r.getDay?r.getHours()>0||r.getMinutes()>0||r.getSeconds()>0||r.getMilliseconds()>0?"datetime":"date":typeof e),(0,o.isNullOrUndefined)(n.getFormatter())&&yl(i,n),l.prototype.toView(e,n.getFormatter())},e.prototype.crudActions=function(e){var t=this.generateQuery(),i=null,n="promise",r=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());if(this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,t,r),"save"===e.requestType)i=this.dataManager.update(r,e.data,t.fromTable,t,e.previousData);e[""+n]=i||e[""+n],this.parent.notify(Xt,e)},e.prototype.saveChanges=function(e,t,i,n){if(void 0===n&&(n=this.generateQuery()),n.requiresCount(),"result"in this.parent.dataSource){var r=new a.Deferred,s={requestType:"batchsave",changes:e,key:t,query:n,endEdit:r.resolve};return this.setState({isPending:!0,resolver:r.resolve}),this.parent.trigger(Ei,s),r.promise}return this.dataManager.saveChanges(e,t,n.fromTable,n,i)},e.prototype.getKey=function(e){if(e&&e.length)return e[0]},e.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},e.prototype.clearCache=function(){this.isRemote()&&this.parent.dataSource.clearCache()},e.prototype.addRows=function(e){for(var t=e.records.length;t>0;t--)this.parent.dataSource instanceof a.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1]):this.parent.getDataModule().isRemote()||(0,o.isNullOrUndefined)(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[t-1])},e.prototype.removeRows=function(e){var t=this.dataManager.dataSource.json;this.parent.dataSource instanceof a.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=t.filter(function(t){return-1===e.records.indexOf(t)}):this.parent.getDataModule().isRemote()||(0,o.isNullOrUndefined)(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=t.filter(function(t){return-1===e.records.indexOf(t)}))},e.prototype.getColumnByField=function(e){var t;return this.parent.columnModel.some(function(i){return t=i,i.field===e})&&t},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Dt,this.addRows),this.parent.off(Tt,this.removeRows),this.parent.off(kt,this.initDataManager),this.parent.off(Ct,this.destroy),this.parent.off(zt,this.crudActions),this.parent.off(Yt,this.getData),this.parent.off(Nt,this.refreshFilteredCols),this.parent.off(Ji,this.refreshFilteredCols))},e.prototype.getState=function(){return this.dataState},e.prototype.setState=function(e){return this.dataState=e},e.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},e.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},e.prototype.getStateEventArgument=function(e){var t=new a.UrlAdaptor,i=new a.DataManager({url:"",adaptor:new a.UrlAdaptor}),n=t.processQuery(i,e),r=JSON.parse(n.data);return(0,o.extend)(r,n.pvtData)},e.prototype.eventPromise=function(e,t,i){var n=this,r=e,s=this.getStateEventArgument(t),o=new a.Deferred,l=new a.Deferred;if((void 0!==e.requestType||this.parent.groupSettings.disablePageWiseAggregates&&t.queries.some(function(e){return"onGroup"===e.fn}))&&!1!==this.dataState.isDataChanged)if(s.action=e,"save"===e.requestType||"delete"===e.requestType||"batchsave"===e.requestType){var h=e;h.key=i;h.promise=l.promise,h.state=s,this.setState({isPending:!0,resolver:l.resolve}),r.endEdit=l.resolve,r.cancelEdit=l.reject,this.parent.trigger(Ei,h),l.promise.then(function(){n.setState({isPending:!0,resolver:o.resolve,group:s.group,aggregates:s.aggregates}),"save"===h.requestType&&n.parent.notify(Mi,h),n.parent.trigger(Ti,s)}).catch(function(){})}else this.setState({isPending:!0,resolver:o.resolve,group:s.group,aggregates:s.aggregates}),this.parent.trigger(Ti,s);else this.setState({}),o.resolve(this.parent.dataSource);return o},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],t=0,i=this.parent.getColumns();t<i.length;t++){var n=i[t];n.allowSearching&&!(0,o.isNullOrUndefined)(n.field)&&e.push(n.field)}return e},e.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&Hl(this.parent,this.parent.filterSettings.columns)},e}(),$r=function(){function e(e,t){(0,o.merge)(this,e),this.parent=t}return e.prototype.clone=function(){var t=new e({});return(0,o.merge)(t,this),t.cells=this.cells.map(function(e){return e.clone()}),t},e.prototype.setRowValue=function(e){if(this.parent){var t=this.data[this.parent.getPrimaryKeyFieldNames()[0]];this.parent.setRowData(t,e)}},e.prototype.setCellValue=function(e,t){if(this.parent&&!(this.data[""+e].toString()===t.toString())){var i=this.parent.getPrimaryKeyFieldNames()[0],n=this.data[""+i];this.parent.setCellValue(n,e,t),this.makechanges(i,this.data)}},e.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)},e}(),es=function(){function e(e){this.isSpanned=!1,this.isRowSpanned=!1,(0,o.merge)(this,e)}return e.prototype.clone=function(){var t=new e({});return(0,o.merge)(t,this),t},e}(),ts=function(){function e(e,t){this.serviceLocator=e,this.parent=t}return e.prototype.render=function(e,i,n,r){var s,a=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(i.cells[parseInt(n.toString(),10)].cellType||t.Data),l=i.cells[parseInt(n.toString(),10)].cellSpan?i.cells[parseInt(n.toString(),10)].cellSpan:e.colSpan?e.colSpan+n<=i.cells.length?e.colSpan:i.cells.length-n:1,h=e.rowSpan,d=0;if(i.index>this.parent.pinnedTopRecords.length){var p=i.index-this.parent.pinnedTopRecords.length,c=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),u=this.parent.groupSettings.columns.length>0&&!c[parseInt(p.toString(),10)-1].isDataRow?c[parseInt(p.toString(),10)].cells:c[parseInt(p.toString(),10)-1].cells,g=i.cells[parseInt(n.toString(),10)];s=u.filter(function(e){return e.column.uid===g.column.uid})[0]}for(var f=s&&s.colSpanRange>1&&s.rowSpanRange>1?s.colSpanRange:l,m=n+1;m<n+f&&m<i.cells.length;m++)!1===i.cells[parseInt(m.toString(),10)].visible?d++:i.cells[parseInt(m.toString(),10)].isSpanned=!0;if(d>0){for(m=n+l;m<n+l+d&&m<i.cells.length;m++)i.cells[parseInt(m.toString(),10)].isSpanned=!0;n+l+d>=i.cells.length&&(l-=n+l+d-i.cells.length)}if(i.cells[parseInt(n.toString(),10)].cellSpan){i.data[e.column.field]=i.cells[parseInt(n.toString(),10)].spanText;p=i.index-this.parent.pinnedTopRecords.length;r=a.render(i.cells[parseInt(n.toString(),10)],i.data,{index:(0,o.isNullOrUndefined)(p)?"":p.toString()})}return l>1&&(0,o.attributes)(r,{colSpan:l.toString(),"aria-colSpan":l.toString()}),h>1&&((0,o.attributes)(r,{rowspan:h.toString(),"aria-rowspan":h.toString()}),i.cells[parseInt(n.toString(),10)].isRowSpanned=!0,i.cells[parseInt(n.toString(),10)].rowSpanRange=Number(h),l>1&&(i.cells[parseInt(n.toString(),10)].colSpanRange=Number(l))),i.index>this.parent.pinnedTopRecords.length&&s.rowSpanRange>1&&(i.cells[parseInt(n.toString(),10)].isSpanned=!0,i.cells[parseInt(n.toString(),10)].rowSpanRange=Number(s.rowSpanRange-1),i.cells[parseInt(n.toString(),10)].colSpanRange=s.rowSpanRange>0?s.colSpanRange:1),!this.parent.enableColumnVirtualization||i.cells[parseInt(n.toString(),10)].cellSpan||this.containsKey(e.column.field,e.data[e.column.field])||this.backupMergeCells(e.column.field,e.data[e.column.field],e.colSpan),r},e.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},e.prototype.generteKey=function(e,t){return e+"__"+t.toString()},e.prototype.splitKey=function(e){return e.split("__")},e.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},e.prototype.getMergeCells=function(){return this.parent.mergeCells},e.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},e.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,n=Object.keys(t);i<n.length;i++){var r=n[i],s=t[""+r],o=this.splitKey(r),a=this.getIndexFromAllColumns(o[0]),l=this.parent.getColumnIndexesInView(),h=s-(l[0]-a);if(a<l[0]&&h>1)for(var d=0,p=e;d<p.length;d++){var c=p[d];if(c.data[o[0]].toString()===o[1].toString()){c.cells[0].cellSpan=h,c.cells[0].spanText=o[1];break}}}return e},e.prototype.getIndexFromAllColumns=function(e){return Na(this.parent.getVisibleColumns(),function(t,i){if(t.field===e)return i})[0]},e}(),is="e-rowcell",ns="e-gridheader",rs="e-gridcontent",ss="e-gridfooter",os="e-headercontent",as="e-movablecontent",ls="e-movableheader",hs="e-frozencontent",ds="e-frozenheader",ps="e-content",cs="e-table",us="e-row",gs="e-gridchkbox",fs="e-editedrow",ms="e-addedrow",ys="e-groupcaptionrow",vs="changedRecords",Ss="addedRecords",Cs="deletedRecords",ws="Left-Right",bs="frozen-right",Is="frozen-left",xs="aria-colindex",Rs="aria-rowindex",Ds="tbody",Ts="colgroup",Es="open",Os="change",ks="focus",As="created",Fs="beforeOpen",Ms="downArrow",Ls="upArrow",Ps="PageUp",Ns="PageDown",Bs="enter",zs="shiftEnter",qs="tab",Us="shiftTab",Hs="initialFrozenColumnIndex",js=function(){function e(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}return e.prototype.render=function(e,t,i,n,r){return this.refreshRow(e,t,i,n,r)},e.prototype.refresh=function(e,t,i,n,r){var s=this;i&&(e.data=Bl({},e.changes),this.refreshMergeCells(e));var o=this.parent.element.querySelector("[data-uid="+e.uid+"]"),a=this.refreshRow(e,t,n,r,null,i);o.classList.contains("e-grid-pin-row")&&a.classList.add("e-grid-pin-row"),i&&uh(a);var l=[].slice.call(a.cells),h=[].slice.call(o.querySelectorAll(".e-templatecell"));if(this.parent.isReact&&h.length)for(var d=function(e){if(e.template)return setTimeout(function(){s.parent.refreshReactColumnTemplateByUid(e.uid,!0)},0),"break"},p=0,c=t;p<c.length;p++){if("break"===d(c[p]))break}[].slice.call(a.attributes).map(function(e){o.setAttribute(e.name,e.value)}),o.innerHTML="";for(var u=0,g=l;u<g.length;u++){var f=g[u];o.appendChild(f)}},e.prototype.refreshRow=function(e,i,n,r,s,a){var l=(0,o.isNullOrUndefined)(s)?this.element.cloneNode():s,h={data:e.data},d={data:e.data},p=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],c=!1,u=this.parent.isFrozenGrid(),g=!0;p&&(c=Ml(p.field,h.data));var f=this.parent.getSelectedRowIndexes();if(e.isDataRow){var m=this.parent.getPrimaryKeyFieldNames()[0];e.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!(0,o.isNullOrUndefined)(this.parent.selectionModule.selectedRowState[e.data[""+m]]):f.indexOf(e.index)>-1||c}var y=this.parent.currentViewData;e.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.allowPaging&&this.parent.selectionModule&&this.parent.selectionModule.isPartialSelection)&&(e.isSelected=!0,-1===f.indexOf(e.index)&&f.push(e.index)),this.buildAttributeFromRow(l,e),(0,o.attributes)(l,(0,o.extend)({},n,{})),qa(l,e.attributes);for(var v=this.serviceLocator.getService("cellRendererFactory"),S=function(i,n){var r=e.cells[parseInt(i.toString(),10)];r.isSelected=e.isSelected,r.isColumnSelected=r.column.isSelected;var s=v.getCellRenderer(e.cells[parseInt(i.toString(),10)].cellType||t.Data),h={"data-index":(0,o.isNullOrUndefined)(e.index)?"":e.index.toString()};e.isExpand&&e.cells[parseInt(i.toString(),10)].cellType===t.DetailExpand&&(h.class=C.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand");var p=!C.parent.enableRtl&&g&&("Vertical"===C.parent.gridLines||"Both"===C.parent.gridLines),c=s.render(e.cells[parseInt(i.toString(),10)],e.data,h,e.isExpand,a);if(e.cells[parseInt(i.toString(),10)].cellType!==t.Filter){if(e.cells[parseInt(i.toString(),10)].cellType===t.Data||e.cells[parseInt(i.toString(),10)].cellType===t.CommandColumn){r.visible&&p&&(C.parent.groupSettings&&C.parent.groupSettings.columns.length?c.classList.add("e-grid-group-first-cell"):C.parent.renderModule&&C.parent.renderModule.isFirstColumnHidden&&!(C.parent.allowRowDragAndDrop||C.parent.childGrid||C.parent.detailTemplate)&&c.classList.add("e-first-visible-cell"),g=!1);var f=C.parent.parentDetails&&C.parent.parentDetails.parentInstObj&&C.parent.parentDetails.parentInstObj.isReact,m=C.parent.printGridParent&&C.parent.printGridParent.isReact;if((C.parent.isReact&&C.parent.requireTemplateRef||f&&C.parent.parentDetails.parentInstObj.requireTemplateRef||m&&C.parent.printGridParent.requireTemplateRef)&&r.isTemplate){var S=C;S.parent.renderTemplates(function(){if("string"!=typeof r.column.template){var t=c.getAttribute("aria-label");c.setAttribute("aria-label",c.innerText+t)}S.parent.trigger(I,(0,o.extend)(d,{cell:c,column:r.column,colSpan:1,rowSpan:1,foreignKeyData:e.cells[parseInt(i.toString(),10)].foreignKeyData,requestType:S.parent.requestTypeAction}))})}else C.parent.trigger(I,(0,o.extend)(d,{cell:c,column:r.column,colSpan:1,rowSpan:1,foreignKeyData:e.cells[parseInt(i.toString(),10)].foreignKeyData,requestType:C.parent.requestTypeAction}));if(!(C.parent.enableVirtualization||C.parent.enableColumnVirtualization||C.parent.enableInfiniteScrolling||C.parent.allowGrouping&&C.parent.groupSettings.columns.length&&C.parent.groupSettings.enableLazyLoading||e.index<C.parent.pinnedTopRecords.length)){var w="field",b=["date","datetime","dateonly"];if(e.isDataRow&&C.parent.enableColumnSpan&&r.column.enableColumnSpan&&!r.isSpanned&&r.visible&&!r.isTemplate&&""!==e.data[r.column[""+w]]&&!r.isForeignKey){var x=1,R=s.getValue(r.column[""+w],e.data,r.column);-1!==b.indexOf(r.column.type)&&!(0,o.isNullOrUndefined)(R)&&R instanceof Date&&(R=R.getTime());for(var D=i;D<e.cells.length-1;D++){var T=e.cells[parseInt(D.toString(),10)+1],E=s.getValue(T.column[""+w],e.data,T.column);if(-1!==b.indexOf(T.column.type)&&!(0,o.isNullOrUndefined)(E)&&E instanceof Date&&(E=E.getTime()),R!==E||!T.visible||!T.column.enableColumnSpan||T.isForeignKey)break;x++}d.colSpan=x}if(e.isDataRow&&C.parent.enableRowSpan&&r.column.enableRowSpan&&!r.isSpanned&&!r.isTemplate&&r.visible&&""!==e.data[r.column[""+w]]&&!r.isForeignKey){var O=e.index-C.parent.pinnedTopRecords.length,k=C.parent.groupSettings.columns.length?e.groupDataIndex:O;e.isDataRow&&C.parent.groupSettings.columns.length&&!(0,o.isNullOrUndefined)(e.parentUid)&&(y=C.parent.getRowObjectFromUID(e.parentUid).data.items);var A=1;R=s.getValue(r.column[""+w],e.data,r.column);-1!==b.indexOf(r.column.type)&&!(0,o.isNullOrUndefined)(R)&&R instanceof Date&&(R=R.getTime());for(D=k+1;D<y.length;D++){var F=s.getValue(r.column[""+w],y[parseInt(D.toString(),10)],r.column);if(-1!==b.indexOf(r.column.type)&&!(0,o.isNullOrUndefined)(F)&&F instanceof Date&&(F=F.getTime()),R!==F)break;A++}d.rowSpan=A}}var M=!1;if(e.index>C.parent.pinnedTopRecords.length&&(C.isSpan||C.parent.isSpan&&a)){O=e.index-C.parent.pinnedTopRecords.length;var L=C.parent.getRowsObject().filter(function(e){return e.isDataRow}),P=C.parent.groupSettings.columns.length>0&&!L[O-1].isDataRow?L[parseInt(O.toString(),10)].cells:L[parseInt(O.toString(),10)-1].cells,N=P.filter(function(t){return t.column.uid===e.cells[parseInt(i.toString(),10)].column.uid})[0];M=N.isRowSpanned?N.isRowSpanned:N.rowSpanRange>1}if((d.rowSpan>1||d.colSpan>1)&&e.index>=C.parent.pinnedTopRecords.length){O=e.index-C.parent.pinnedTopRecords.length;if(C.resetrowSpanvalue(C.parent.frozenRows>O?C.parent.frozenRows:y.length,d,O),!1===d.column.visible)d.colSpan=1;else if(u){var B=C.parent.getColumns(),z=C.parent.getFrozenRightColumnsCount(),q=C.parent.getFrozenLeftCount(),U=B.length-z,H=d.column.index;if(q>H&&q<H+d.colSpan){var j=H+d.colSpan-q;d.colSpan=d.colSpan-j}else if(U<=H&&B.length<H+d.colSpan){j=H+d.colSpan-B.length;d.colSpan=d.colSpan-j}else if("Fixed"===d.column.freeze){j=1;var V=H;for(D=V+1;D<V+d.colSpan&&"Fixed"===B[parseInt(D.toString(),10)].freeze;D++)j++;d.colSpan=j}else if(U>H&&U<H+d.colSpan){j=H+d.colSpan-U;d.colSpan=d.colSpan-j}}}if((d.colSpan>1||e.cells[parseInt(i.toString(),10)].cellSpan>1||d.rowSpan>1||M)&&e.index>=C.parent.pinnedTopRecords.length){C.parent.isSpan=!0,C.isSpan=!0;var G=new ts(C.serviceLocator,C.parent);c=G.render(d,e,i,c),u&&fh(C.parent,d.column,c,d.colSpan)}}if((r.cellType===t.Header||r.cellType===t.StackedHeader)&&p&&(r.visible||r.cellType===t.StackedHeader)){var _=C.parent.getVisibleColumns(),K=(w="field","type");(r.column[""+K]&&"checkbox"===r.column[""+K]||r.cellType===t.Header&&r.column[""+w]&&_.length&&_[0].field===r.column[""+w]||r.cellType===t.StackedHeader)&&(C.parent.groupSettings&&C.parent.groupSettings.columns.length?c.classList.add("e-grid-group-first-cell"):C.parent.renderModule&&C.parent.renderModule.isFirstColumnHidden&&!(C.parent.allowRowDragAndDrop||C.parent.childGrid||C.parent.detailTemplate)&&c.classList.add("e-first-visible-cell")),g=!1}if(r.cellType===t.Header&&(e.cells[parseInt(i.toString(),10)].colSpan>1||e.cells[parseInt(i.toString(),10)].rowSpan>1)){G=new ts(C.serviceLocator,C.parent);c=G.render(e.cells[parseInt(i.toString(),10)],e,i,c)}if(C.isSpan){L=C.parent.getRowsObject();var W=C.parent.enableRtl;O=e.index-C.parent.pinnedTopRecords.length;if(L[e.index-1]&&L[O-1].isDataRow){N=(P=L[O-1].cells)[i-1];var Q=P[parseInt(i.toString(),10)],X=P[i+1],Y=P[parseInt(i.toString(),10)].column.freeze;N&&(N.isRowSpanned||N.rowSpanRange>1)&&N.visible&&(W||Q.isRowSpanned&&!(N.rowSpanRange>Q.rowSpanRange)||c.classList.add("e-rowcell-firstchild"),u&&("Fixed"===N.column.freeze&&"Fixed"===Y?c.classList.add(W?"e-removefreezerightborder":"e-removefreezeleftborder"):W||1!==i||"Left"!==Y||c.classList.add("e-addfreezefirstchildborder"))),X&&(X.isRowSpanned||X.rowSpanRange>1)&&X.visible&&(W&&(!Q.isRowSpanned||X.rowSpanRange>Q.rowSpanRange)&&c.classList.add("e-rowcell-lastchild"),u&&"Fixed"===X.column.freeze&&"Fixed"===Y&&d.colSpan<2&&c.classList.add(W?"e-removefreezeleftborder":"e-removefreezerightborder"))}}d.rowSpan>1&&y.length-(e.index-C.parent.pinnedTopRecords.length)===d.rowSpan&&c.classList.add("e-row-span-lastrowcell"),e.cells[parseInt(i.toString(),10)].isSpanned||l.appendChild(c)}else r.visible&&p&&(C.parent.groupSettings&&C.parent.groupSettings.columns.length?c.classList.add("e-grid-group-first-cell"):C.parent.renderModule&&C.parent.renderModule.isFirstColumnHidden&&!(C.parent.allowRowDragAndDrop||C.parent.childGrid||C.parent.detailTemplate)&&c.classList.add("e-first-visible-cell"),g=!1)},C=this,b=0,x=e.cells.length;b<x;b++)S(b);var R=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(l.classList.contains("e-groupcaptionrow")){var D=[].slice.call(l.querySelectorAll(".e-leftfreeze,.e-unfreeze,.e-rightfreeze,.e-fixedfreeze,.e-freezerightborder,.e-freezeleftborder"));if(D.length&&(0,o.removeClass)(D,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),l.querySelector(".e-summarycell"))Kl(l,this.parent);else{for(var T=0;T<l.childNodes.length;T++){if((k=l.childNodes[parseInt(T.toString(),10)]).classList.add("e-leftfreeze"),gh(k,30*T,this.parent.enableRtl,"Left"),k.classList.contains("e-groupcaption")){var E=parseInt(k.getAttribute("colspan"),10),O=_l(this.parent,T);k.setAttribute("colspan",O.toString()),R=E-O}}if(R){var k=this.parent.createElement("TD",{className:"e-groupcaption",attrs:{colspan:R.toString(),id:this.parent.element.id+"captioncell",tabindex:"-1"}});l.appendChild(k)}}}if((l.querySelectorAll(".e-leftfreeze").length||l.classList.contains("e-columnheader"))&&(l.querySelectorAll(".e-indentcell").length||l.querySelectorAll(".e-grouptopleftcell").length))for(k=l.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),b=0;b<k.length;b++)k[parseInt(b.toString(),10)].classList.add("e-leftfreeze"),gh(k[parseInt(b.toString(),10)],30*b,this.parent.enableRtl,"Left")}var A={row:l,rowHeight:this.parent.rowHeight};if(e.isDataRow){var F=(0,o.extend)(h,A);F.isSelectable=!0;var M=this.parent.getPrimaryKeyFieldNames()[0],L=e.data[""+M];this.parent.renderModule&&Object.keys(this.parent.renderModule.nonselectableDataKey).length&&!1===this.parent.renderModule.nonselectableDataKey[""+L]&&(F.isSelectable=!1);var P=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,N=F.row.querySelectorAll(".e-templatecell");if((this.parent.isReact&&this.parent.requireTemplateRef||P&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&N.length){var B=this;B.parent.renderTemplates(function(){B.parent.trigger(w,F),F.isSelectable||(e.isSelectable=F.isSelectable,B.disableRowSelection(B,e,A,F))})}else this.parent.trigger(w,F);e.isSelectable=F.isSelectable;var z=this.parent.isRowDragable();if(this.parent.allowPaging&&this.parent.selectionSettings.persistSelection){var q=e.data?e.data[""+M]:null,U=F.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords;U.some(function(e){return e[""+M]===q})||U.push(e.data)}if(F.isSelectable||this.disableRowSelection(this,e,A,F),this.parent.childGrid||z||this.parent.detailTemplate)(k=l.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&k.classList.add("e-detailrowvisible")}if(!this.parent.enableVirtualization||e.isAggregateRow&&!e.parentUid||(h.rowHeight=this.parent.rowHeight),h.rowHeight?l.style.height=h.rowHeight+"px":this.parent.rowHeight&&(l.querySelector(".e-headercell")||l.querySelector(".e-groupcaption"))&&(l.style.height=this.parent.rowHeight+"px"),e.cssClass&&l.classList.add(e.cssClass),e.lazyLoadCssClass&&l.classList.add(e.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||l.classList.add("e-verticalwrap"),!this.parent.enableColumnVirtualization&&this.parent.aggregates.length&&this.parent.element.scrollHeight>this.parent.height)for(b=0;b<this.parent.aggregates.length;b++){if(this.parent.aggregates[parseInt(b.toString(),10)].properties.columns[0].footerTemplate){var H=[].slice.call(l.getElementsByClassName("e-summarycell"));if(H.length){var j=H[H.length-1];(0,o.addClass)([j],["e-lastsummarycell"]);var V=H[0];(0,o.addClass)([V],["e-firstsummarycell"])}}}return l},e.prototype.resetrowSpanvalue=function(e,t,i){if(e>i&&e<i+t.rowSpan){var n=i+t.rowSpan-e;t.rowSpan=t.rowSpan-n}},e.prototype.disableRowSelection=function(e,t,i,n){var r=this.parent.getSelectedRowIndexes();this.parent.selectionModule.isPartialSelection=!0,t.isSelected=!1;var s=r.indexOf(t.index);s>-1&&r.splice(s,1);for(var a=i.row.querySelectorAll(".e-rowcell.e-gridchkbox"),l=n.row.querySelector(".e-rowdragdrop"),h=e.parent.groupSettings.columns.length+(l||e.parent.isDetail()?1:0),d=0;d<a.length;d++)a[parseInt(d.toString(),10)].firstElementChild.classList.add("e-checkbox-disabled"),a[parseInt(d.toString(),10)].querySelector(".e-frame").classList.remove("e-check");if(t.cells.length)for(d=h;d<t.cells.length;d++){var p=n.row.querySelector('.e-rowcell[aria-colindex="'+(t.cells[parseInt(d.toString(),10)].index+1)+'"]');p&&(0,o.removeClass)([p],["e-selectionbackground","e-active"])}l&&(0,o.removeClass)([l],["e-selectionbackground","e-active"])},e.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++){i[t].isSpanned=!1}return e},e.prototype.buildAttributeFromRow=function(e,t){var i={},n="data-uid",r="aria-selected",s=[];t.isDataRow&&s.push(us),t.isAltRow&&s.push("e-altrow"),t.isCaptionRow&&s.push("e-groupcaptionrow"),t.isAggregateRow&&t.parentUid&&s.push("e-groupfooterrow"),(0,o.isNullOrUndefined)(t.index)||(i[Rs]=t.index+1),t.rowSpan&&(i.rowSpan=t.rowSpan),t.uid&&(i[n]=t.uid),t.isSelected&&(i[r]=!0),!1===t.visible&&s.push("e-hide"),i.class=s,qa(e,i)},e}(),Vs=function(){function e(e){this.parent=e}return e.prototype.generateRows=function(e,t){var i=[],n=this.parent.enableVirtualization&&t?t.startIndex:0;n=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):n,this.parent.enableImmutableMode&&t&&t.startIndex&&(n=t.startIndex),!this.parent.enableVirtualization&&this.parent.pinnedTopRowModels.length&&t&&"infiniteScroll"!==t.requestType&&(n=this.parent.pinnedTopRowModels.length);for(var r=0,s=Object.keys(e).length;r<s;r++,n++)i[parseInt(r.toString(),10)]=this.generateRow(e[parseInt(r.toString(),10)],n);return i},e.prototype.generatePinnedTopRows=function(e){for(var i=[],n=0,r=0,s=Object.keys(e).length;r<s;r++,n++){i[parseInt(r.toString(),10)]=this.generateRow(e[parseInt(r.toString(),10)],n);for(var o=0;o<this.parent.groupSettings.columns.length;o++)this.parent.enableColumnVirtualization||i[parseInt(r.toString(),10)].cells.unshift(this.generateCell({},null,t.HeaderIndent))}return i},e.prototype.ensurePinnedColumns=function(){var e=[];return(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},null,t.HeaderIndent)),this.parent.isRowDragable()&&e.push(this.generateCell({},null,t.HeaderIndent)),e},e.prototype.ensureColumns=function(){var e=[];if(this.parent.detailTemplate||this.parent.childGrid){var i={};this.parent.notify(ln,i),e.push(this.generateCell(i,null,t.DetailExpand))}return this.parent.isRowDragable()&&e.push(this.generateCell({},null,t.RowDragIcon)),e},e.prototype.generateRow=function(e,t,i,n,r,s,a,l){var h={foreignKeyData:{}};h.uid=Za("grid-row"),h.data=e,h.index=t,h.indent=n,h.tIndex=s,h.isDataRow=!0,h.parentGid=r,h.parentUid=a,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(h.groupDataIndex=l),this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?h.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(t.toString(),10)]&&(h.isExpand=this.parent.expandedRows[parseInt(t.toString(),10)].isExpand)),h.cssClass=i,h.isAltRow=!!this.parent.enableAltRow&&t%2!=0,h.isAltRow=!!this.parent.enableAltRow&&t%2!=0;var d=this.parent.getPrimaryKeyFieldNames()[0];h.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!(0,o.isNullOrUndefined)(this.parent.selectionModule.selectedRowState[e[""+d]]):this.parent.getSelectedRowIndexes().indexOf(t)>-1,this.refreshForeignKeyRow(h);var p=this.ensureColumns();this.parent.pinnedTopRecords.length&&t<this.parent.pinnedTopRecords.length&&(p=this.ensurePinnedColumns());var c=new $r(h,this.parent);return c.cells="Right"===this.parent.getFrozenMode()?this.generateCells(h).concat(p):p.concat(this.generateCells(h)),c},e.prototype.refreshForeignKeyRow=function(e){for(var t=this.parent.getForeignKeyColumns(),i=0;i<t.length;i++)(0,o.setValue)(t[parseInt(i.toString(),10)].field,El(t[parseInt(i.toString(),10)],e.data),e.foreignKeyData)},e.prototype.generateCells=function(e){for(var i=this.parent.getColumns(),n=[],r=0;r<i.length;r++)n.push(this.generateCell(i[parseInt(r.toString(),10)],e.uid,(0,o.isNullOrUndefined)(i[parseInt(r.toString(),10)].commands)?void 0:t.CommandColumn,null,r,e.foreignKeyData));return n},e.prototype.generateCell=function(e,i,n,r,s,a){var l={visible:e.visible,isDataCell:!(0,o.isNullOrUndefined)(e.field||e.template),isTemplate:!(0,o.isNullOrUndefined)(e.template),rowID:i,column:e,cellType:(0,o.isNullOrUndefined)(n)?t.Data:n,colSpan:r,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&(0,o.getValue)(e.field,a)};return(l.isDataCell||"checkbox"===l.column.type||l.commands)&&(l.index=s),new es(l)},e.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[parseInt(t.toString(),10)]),e[parseInt(t.toString(),10)].cells=this.generateCells(e[parseInt(t.toString(),10)]);return e},e.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?(0,o.isNullOrUndefined)(e.startIndex)?e.index:e.startIndex:0},e}(),Gs=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_s=function(){function e(e){this.parent=e}return e.prototype.getData=function(){for(var e=this,t=[],i=this.parent.aggregates.slice(),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].columns.filter(function(t){return!(t.footerTemplate||t.groupFooterTemplate||t.groupCaptionTemplate)||e.columnSelector(t)});r.length&&t.push({columns:r})}return t},e.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},e.prototype.getColumns=function(e){var t=[];if(!this.parent.detailTemplate&&(0,o.isNullOrUndefined)(this.parent.childGrid)||t.push(new p({})),this.parent.allowGrouping)for(var i=0;i<this.parent.groupSettings.columns.length;i++)t.push(new p({}));return this.parent.isRowDragable()&&!e&&t.push(new p({})),t.push.apply(t,this.parent.getColumns()),t},e.prototype.generateRows=function(e,t,i,n,r){if(0===e.length&&(void 0===t||!t.count&&!t.loadSummaryOnEmpty))return[];for(var s=this.buildSummaryData(e,t),o=[],a=this.getData(),l=0;l<a.length;l++)o.push(this.getGeneratedRow(a[parseInt(l.toString(),10)],s[parseInt(l.toString(),10)],t?t.level:void 0,i,n,t?t.parentUid:void 0,r));return o},e.prototype.getGeneratedRow=function(e,i,n,r,s,a,l){var h=[],d=this.getIndentByLevel(),p=!(0,o.isNullOrUndefined)(this.parent.childGrid),c=this.parent.getIndentCount();this.parent.groupSettings.columns.length&&this.parent.allowRowDragAndDrop?d.push("e-indentcelltop"):this.parent.isRowDragable()&&!r&&(d=["e-indentcelltop"]);for(var u=l||this.getColumns(r),g=0;g<u.length;g++)h.push(this.getGeneratedCell(u[parseInt(g.toString(),10)],e,g>=c?this.getCellType():0===g&&(this.parent.childGrid||this.parent.detailTemplate)?t.DetailFooterIntent:t.Indent,d[parseInt(g.toString(),10)],p));var f=new $r({data:i,attributes:{class:"e-summaryrow"}});return f.cells=h,f.uid=Za("grid-row"),f.parentUid=a,f.isAggregateRow=!0,f.visible=h.some(function(e){return e.isDataCell&&e.visible}),f},e.prototype.getGeneratedCell=function(e,t,i,n,r){var s=t.columns.filter(function(t){return t.columnName===e.field})[0],a={"data-mappinguid":e.uid,"data-index":e.index};if(e.textAlign){var l={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"};l[e.textAlign.toLowerCase()]&&(a.class=l[e.textAlign.toLowerCase()])}n&&(a.class=n),(0,o.isNullOrUndefined)(n)&&r&&(a.class="e-detailindentcelltop");var h={visible:e.visible,isDataCell:!(0,o.isNullOrUndefined)(s),isTemplate:s&&!(0,o.isNullOrUndefined)(s.footerTemplate||s.groupFooterTemplate||s.groupCaptionTemplate),column:s||{},attributes:a,cellType:i};return h.column.headerText=e.headerText,new es(h)},e.prototype.buildSummaryData=function(e,t){for(var i=[],n=this.getData(),r={},s=0;s<n.length;s++){r={};for(var o=n[parseInt(s.toString(),10)].columns,a=0;a<o.length;a++)r=this.setTemplate(o[parseInt(a.toString(),10)],t&&t.aggregates?t:e,r);i.push(r)}return i},e.prototype.getIndentByLevel=function(){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},e.prototype.setTemplate=function(e,t,i){var n=e.type,r={},s=e.getFormatter()||function(e){return e},a=t;n instanceof Array||(n=[e.type]);for(var l=0;l<n.length;l++){var h=e.field+" - "+n[parseInt(l.toString(),10)].toLowerCase(),d=e.columnName,p=!!(this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&a.items),c=("Custom"!==n[parseInt(l.toString(),10)]||p)&&a.aggregates&&h in a.aggregates?a.aggregates[""+h]:tl(n[parseInt(l.toString(),10)],a.aggregates?a:t,e,this.parent);i[""+d]=i[""+d]||{},i[""+d][""+h]=c,i[""+d][n[parseInt(l.toString(),10)]]=(0,o.isNullOrUndefined)(c)?" ":s(c),a.field&&(i[""+d].field=a.field,i[""+d].key=a.key)}return r.format=e.getFormatter(),e.setTemplate(r),i},e.prototype.getCellType=function(){return t.Summary},e}(),Ks=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gs(i,e),i.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},i.prototype.getIndentByLevel=function(e){return void 0===e&&(e=this.parent.groupSettings.columns.length),this.parent.allowRowDragAndDrop&&this.parent.groupSettings.columns.length&&(e-=1),this.parent.groupSettings.columns.map(function(t,i){return i<=e-1?"":"e-indentcelltop"})},i.prototype.getCellType=function(){return t.GroupSummary},i}(_s),Ws=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gs(i,e),i.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},i.prototype.getData=function(){return[e.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},{columns:[]})]},i.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},i.prototype.getCellType=function(){return t.CaptionSummary},i}(_s),Qs=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xs=function(e){function i(t){var i=e.call(this,t)||this;return i.rows=[],i.index=0,i.infiniteChildCount=0,i.renderInfiniteAgg=!0,i.parent=t,i.summaryModelGen=new Ks(t),i.captionModelGen=new Ws(t),i}return Qs(i,e),i.prototype.generateRows=function(t,i){if(0===this.parent.groupSettings.columns.length)return e.prototype.generateRows.call(this,t,i);this.isInfiniteScroll="infiniteScroll"===i.requestType,this.rows=[],this.index=this.parent.enableVirtualization||this.isInfiniteScroll?i.startIndex:this.parent.pinnedTopRowModels.length;for(var n=0,r=t.length;n<r;n++)this.infiniteChildCount=0,this.renderInfiniteAgg=!0,this.getGroupedRecords(0,t[parseInt(n.toString(),10)],t.level,n,void 0,this.rows.length);return this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.rows},i.prototype.getGroupedRecords=function(e,t,i,n,r,s,a){var l,h=i;if((0,o.isNullOrUndefined)(t.items))if((0,o.isNullOrUndefined)(t.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(t,e,n,this.rows.length,a));else for(var d=0,p=t.length;d<p;d++)this.getGroupedRecords(e,t[parseInt(d.toString(),10)],t.level,n,e,this.rows.length,a);else{var c=void 0,u=this.generateCaptionRow(t,e,n,r,s,a);if(this.isInfiniteScroll&&(c=this.getPreCaption(e,u.data.key)),c?u.uid=c.uid:this.rows=this.rows.concat(u),t.items&&t.items.length&&this.getGroupedRecords(e+1,t.items,t.items.level,n,e+1,this.rows.length,u.uid),this.parent.aggregates.length&&this.isRenderAggregate(u)){var g=this.rows.length;(l=this.rows).push.apply(l,this.summaryModelGen.generateRows(t,{level:h,parentUid:u.uid}));for(var f=g-1;f>=0;f--)if(this.rows[parseInt(f.toString(),10)].isCaptionRow)this.rows[parseInt(f.toString(),10)].aggregatesCount=this.rows.length-g;else if(!this.rows[parseInt(f.toString(),10)].isCaptionRow&&!this.rows[parseInt(f.toString(),10)].isDataRow)break}c&&this.setInfiniteRowVisibility(c)}},i.prototype.isRenderAggregate=function(e){return this.parent.enableInfiniteScrolling?!!this.renderInfiniteAgg&&(this.getPreCaption(e.indent,e.data.key),this.renderInfiniteAgg=e.data.count===this.infiniteChildCount,this.renderInfiniteAgg):!this.parent.enableInfiniteScrolling},i.prototype.getPreCaption=function(e,t){var i,n=this.parent.getRowsObject().concat(this.rows);this.infiniteChildCount=0;for(var r=n.length;r--;){if(n[parseInt(r.toString(),10)].isCaptionRow&&n[parseInt(r.toString(),10)].indent===e){var s=n[parseInt(r.toString(),10)].data.key;(s&&t&&s.toString()===t.toString()&&s instanceof Date||s===t)&&(i=n[parseInt(r.toString(),10)])}if(n[parseInt(r.toString(),10)].indent===e||n[parseInt(r.toString(),10)].indent<e)break;n[parseInt(r.toString(),10)].indent===e+1&&this.infiniteChildCount++}return i},i.prototype.getCaptionRowCells=function(e,i,n){var r=[],s=[],a=this.parent.getColumnByField(e),l=this.parent.getColumnIndexesInView();this.parent.enableColumnVirtualization&&(a=this.parent.columns.filter(function(t){return t.field===e})[0]);var h=this.parent.groupSettings.columns.length,d=this.parent;if(!this.parent.enableColumnVirtualization||-1!==l.indexOf(i)){for(var p=0;p<i;p++)r.push(this.generateIndentCell());r.push(this.generateCell({},null,t.Expand))}if(i=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+h+(d.detailTemplate||d.childGrid?1:0)-i+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()){var c=this.captionModelGen.generateRows(n)[0];(0,o.extend)(n,c.data);var u=0;c.cells.some(function(e,t){return u=t,e.visible&&e.isDataCell}),s=c.cells.slice(u).filter(function(e){return e.visible}),c.visible&&s[0].column.field===this.parent.getVisibleColumns()[0].field&&(s=s.slice(1)),1===this.parent.getVisibleColumns().length&&(s=[]),i-=s.length}for(var g=this.parent.enableColumnVirtualization?this.parent.getColumns():[a],f=!0,m=0;m<g.length;m++){var y=f&&-1!==l.indexOf(i);y&&(f=!1);var v=!this.parent.enableColumnVirtualization||y?t.GroupCaption:t.GroupCaptionEmpty;i=this.parent.enableColumnVirtualization&&v===t.GroupCaption?i+h:i,d.isRowDragable()&&i++,r.push(this.generateCell(a,null,v,i))}return r.push.apply(r,s),r},i.prototype.generateCaptionRow=function(e,t,i,n,r,s){var a={},l="records",h=this.parent.getColumnByField(e.field);a.data=(0,o.extend)({},e),h&&(a.data.field=e.field),a.isDataRow=!1,a.isExpand=!this.parent.groupSettings.enableLazyLoading&&!this.parent.isCollapseStateEnabled(),a.parentGid=i,a.childGid=n,a.tIndex=r,a.isCaptionRow=!0,a.parentUid=s,a.gSummary=(0,o.isNullOrUndefined)(e.items[""+l])?e.items.length:e.items[""+l].length,a.uid=Za("grid-row");var d=new $r(a);return d.indent=t,this.getForeignKeyData(d),d.cells=this.getCaptionRowCells(e.field,t,d.data),d},i.prototype.getForeignKeyData=function(e){var t=e.data,i=this.parent.getColumnByField(t.field);if(i&&i.isForeignColumn&&i.isForeignColumn()){var n=(0,o.isNullOrUndefined)(t.key)?"":i.valueAccessor(i.foreignKeyValue,El(i,{},t.key)[0],i);(0,o.setValue)("foreignKey",n,e.data)}},i.prototype.generateDataRows=function(e,t,i,n,r){for(var s=[],o=this.parent.getColumnIndexesInView(),a=0,l=e.length;a<l;a++,n++){s[parseInt(a.toString(),10)]=this.generateRow(e[parseInt(a.toString(),10)],this.index,a?void 0:"e-firstchildrow",t,i,n,r,a);for(var h=0;h<t;h++)this.parent.enableColumnVirtualization&&-1===o.indexOf(t)||s[parseInt(a.toString(),10)].cells.unshift(this.generateIndentCell());this.index++}return s},i.prototype.generateIndentCell=function(){return this.generateCell({},null,t.Indent)},i.prototype.refreshRows=function(e){for(var t=this.parent.getColumnIndexesInView(),i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].isDataRow){e[parseInt(i.toString(),10)].cells=this.generateCells(e[parseInt(i.toString(),10)]);for(var n=0;n<e[parseInt(i.toString(),10)].indent;n++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e[parseInt(i.toString(),10)].indent)||e[parseInt(i.toString(),10)].cells.unshift(this.generateIndentCell())}else{var r=this.generateCaptionRow(e[parseInt(i.toString(),10)].data,e[parseInt(i.toString(),10)].indent);e[parseInt(i.toString(),10)].cells=r.cells}return e},i.prototype.setInfiniteRowVisibility=function(e){if(!e.isExpand||!1===e.visible)for(var t=0,i=this.rows;t<i.length;t++){var n=i[t];n.parentUid===e.uid&&(n.visible=!1,n.isCaptionRow&&this.setInfiniteRowVisibility(n))}},i.prototype.ensureRowVisibility=function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[parseInt(e.toString(),10)];if(t.isCaptionRow)for(var i=e+1;i<this.rows.length;i++){var n=this.rows[parseInt(i.toString(),10)];t.uid===n.parentUid&&(this.rows[parseInt(i.toString(),10)].visible=t.isExpand)}}},i}(Vs),Ys=function(){function e(e,t){var i=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.currentInfo={},this.prevCurrentView=[],this.isLoaded=!0,this.drop=function(e){i.parent.notify(V,{target:e.target,droppedElement:e.droppedElement}),(0,o.remove)(e.droppedElement)},this.infiniteCache={},this.visibleRows=[],this.visibleFrozenRows=[],this.rightFreezeRows=[],this.isAddRows=!1,this.isInfiniteFreeze=!1,this.useGroupCache=!1,this.tempFreezeRows=[],this.rafCallback=function(e){var t=e;return function(){if(i.ariaService.setBusy(i.getPanel().querySelector("."+ps),!1),!i.parent.isDestroyed){var n=i.rows.slice(0);if(i.parent.enableInfiniteScrolling){if(i.parent.groupSettings.enableLazyLoading)for(var r=0;r<i.visibleRows.length;r++)i.setRowsInLazyGroup(i.visibleRows[parseInt(r.toString(),10)],r);n=i.parent.getRowsObject();var s=t.prevPage;if(i.parent.infiniteScrollSettings.enableCache&&s){var o=i.parent.infiniteScrollSettings.maxBlocks;n=[];for(var a=parseInt(i.rowElements[0].getAttribute("aria-rowindex"),10),l=(r=0,Math.ceil(a/i.parent.pageSettings.pageSize));r<o;r++,l++)i.infiniteCache[parseInt(l.toString(),10)]&&(n=n.concat(i.infiniteCache[parseInt(l.toString(),10)]))}}if(i.parent.notify(Ne,{rows:n,args:t}),i.parent.editSettings.showAddNewRow&&i.parent.addNewRowFocus&&(i.parent.notify(jr,{}),i.parent.addNewRowFocus=!1),i.parent.autoFit&&i.parent.preventAdjustColumns(),i.parent.isInitialLoad||i.parent.focusModule.setFirstFocusableTabIndex(),i.isLoaded){i.parent.isManualRefresh=!1,i.parent.enableInfiniteScrolling&&i.parent.groupSettings.enableLazyLoading&&"sorting"===e.requestType&&(i.parent.infiniteScrollModule.groupCaptionAction=void 0);var h=i.parent.parentDetails&&i.parent.parentDetails.parentInstObj&&i.parent.parentDetails.parentInstObj.isReact;if((i.parent.isReact||h)&&i.parent.element.querySelectorAll(".e-templatecell").length){var d=i;d.parent.renderTemplates(function(){d.parent.trigger(E,{},function(){d.parent.allowTextWrap&&d.parent.notify(pi,{case:"textwrap"})})})}else i.parent.trigger(E,{},function(){i.parent.allowTextWrap&&i.parent.notify(pi,{case:"textwrap"})});i.parent.allowTextWrap&&"auto"===i.parent.height&&(i.parent.getContentTable().scrollHeight>i.parent.getContent().clientHeight?i.parent.scrollModule.setPadding():i.parent.scrollModule.removePadding())}if(t){var p=(t.requestType||"").toLowerCase()+"-complete";i.parent.notify(p,t),"batchsave"===e.requestType&&(e.cancel=!1,i.parent.trigger(D,e))}i.isLoaded&&i.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=t,this.widthService=t.getService("widthService"),this.ariaService=this.serviceLocator.getService("ariaService"),this.parent.enableDeepCompare=this.parent.getDataModule().isRemote(),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.groupSettings.enableLazyLoading||this.parent.on(wt,this.setVisible,this),this.parent.on(He,this.colGroupRefresh,this),this.parent.on(Be,this.enableAfterRender,this),this.parent.on(Sn,this.refreshContentRows,this),this.parent.on(mt,this.beforeCellFocused,this),this.parent.on(Ct,this.droppableDestroy,this))}return e.prototype.beforeCellFocused=function(e){!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action?this.pressedKey=void 0:this.pressedKey=e.keyArgs.action},e.prototype.renderPanel=function(){var e=this.parent,t=this.parent.element.querySelector("."+rs);if(t)return this.ariaService.setOptions(this.parent.element.querySelector("."+ps),{busy:!1}),void this.setPanel(t);t=this.parent.createElement("div",{className:rs});var i=this.parent.createElement("div",{className:ps});this.ariaService.setOptions(i,{busy:!1}),this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(this.renderHorizontalScrollbar(t),i.classList.add("e-virtual-content")),t.appendChild(i),this.setPanel(t),e.element.appendChild(t)},e.prototype.renderHorizontalScrollbar=function(e){var t=this.parent.createElement("div",{className:"e-movablescrollbar"}),i=this.parent.createElement("div",{className:"e-movablechild"}),n=ol().toString();this.setScrollbarHeight(i,n),this.setScrollbarHeight(t,n),t.appendChild(i),e.appendChild(t)},e.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},e.prototype.renderTable=function(){var e=this.getPanel(),t=e.querySelector(".e-virtualtable"),i=e.querySelector(".e-virtualtrack");!this.parent.enableVirtualization||(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(i)||((0,o.remove)(t),(0,o.remove)(i));var n=e.querySelector(".e-virtual-vertical-scrollbar"),r=e.querySelector(".e-virtual-horizontal-scrollbar");this.parent.enableVirtualization&&!(0,o.isNullOrUndefined)(n)&&(0,o.remove)(n),this.parent.enableColumnVirtualization&&!(0,o.isNullOrUndefined)(r)&&(0,o.remove)(r),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector("."+cs)),"Multiple"===this.parent.selectionSettings.type&&this.ariaService.setOptions(this.parent.element,{multiselectable:!0}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdr")},e.prototype.createContentTable=function(e){var t=this.getPanel().firstElementChild;this.getTable()&&(0,o.remove)(this.getTable());var i=t.querySelector("."+cs)?t.querySelector("."+cs):this.parent.createElement("table",{className:cs,attrs:{role:"presentation",id:this.parent.element.id+e}});return i.style.cssText="border-collapse: separate; border-spacing: .25px;",this.setColGroup(this.parent.getHeaderTable().querySelector(Ts).cloneNode(!0)),i.appendChild(this.getColGroup()),i.appendChild(this.parent.createElement(Ds,{attrs:{role:"rowgroup"}})),t.appendChild(i),t},e.prototype.refreshContentRows=function(e){var t=this;void 0===e&&(e={});var i=this.parent;if(0!==i.currentViewData.length){i.editSettings&&i.editModule&&"Batch"===i.editSettings.mode&&i.editModule.formObj&&!1===i.editSettings.showConfirmDialog&&i.editModule.destroyForm();var n=this.currentMovableRows||i.currentViewData,r=i.isReact&&!(0,o.isNullOrUndefined)(i.rowTemplate),s=this.parent.printGridParent&&this.parent.printGridParent.isReact,l=r||s?i.createElement(Ds,{attrs:{role:"rowgroup"}}):document.createDocumentFragment();this.initialPageRecords||(this.initialPageRecords=(0,o.extend)([],n));var h,d,p=r?i.createElement(Ds,{attrs:{role:"rowgroup"}}):document.createDocumentFragment();(i.isReact||s)&&i.rowTemplate&&(h=l,d=p);var c,u,g,f=i.getColumns(),m=new js(this.serviceLocator,null,this.parent),y=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType,v=this.isInfiniteColumnvirtualization()&&"virtualscroll"!==e.requestType,S=!(!i.enableInfiniteScrolling||!i.childGrid&&!i.detailTemplate),C=S&&("add"===e.action&&"save"===e.requestType||"delete"===e.requestType);C&&(e.startIndex=0,i.notify(Yr,{})),y&&(i.childGrid||i.detailTemplate)&&!i.infiniteScrollSettings.enableCache||(S&&(this.parent.infiniteScrollModule.infiniteDetailDestroy=!0),i.notify(Tr,y&&(i.childGrid||i.detailTemplate)&&i.infiniteScrollSettings.enableCache?e:{})),this.rowElements=[],this.rows=[],this.tempFreezeRows=[];var b,I=!(!this.parent.frozenRows||!this.parent.groupSettings.columns.length);if(Fl(i)&&["sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save"].some(function(t){return e.requestType===t})&&this.emptyVcRows(),b=this.checkCache(b,e),i.isRowPinned){var x=new a.Query,R=this.parent.getDataModule(),D=R.pinnedData.executeLocal(R.pinnedDataQuery(x));i.pinnedTopRowModels=this.generator.generatePinnedTopRows(D)}this.isAddRows||this.useGroupCache||(b=this.generator.generateRows(n,e)),this.setGroupCache(b,e),this.parent.notify(Dn,{isInfiniteScroll:y,modelData:b,args:e});var T=this.parent.registeredTemplate;if(this.parent.isAngular&&("infiniteScroll"!==e.requestType||this.parent.infiniteScrollSettings.enableCache)&&T&&T.detailTemplate&&!e.isFrozen&&this.parent.destroyTemplate(["detailTemplate"]),("infiniteScroll"!==e.requestType||this.parent.infiniteScrollSettings.enableCache)&&T&&T.template&&!e.isFrozen){for(var E=[],O=0;O<T.template.length;O++)for(var k=0;k<T.template[parseInt(O.toString(),10)].rootNodes.length;k++)(0,o.isNullOrUndefined)(T.template[parseInt(O.toString(),10)].rootNodes[parseInt(k.toString(),10)].parentNode)&&E.push(T.template[parseInt(O.toString(),10)]);this.parent.destroyTemplate(["template"],E)}if((this.parent.isReact||this.parent.isVue)&&("infiniteScroll"!==e.requestType||this.parent.infiniteScrollSettings.enableCache)&&!e.isFrozen){var A=[this.parent.isVue?"template":"columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"];"infiniteScroll"===e.requestType&&this.parent.infiniteScrollSettings.enableCache&&(A=[this.parent.isVue?"template":"columnTemplate","commandsTemplate"]),Ah(this.parent,A)}for(O=0;O<i.pinnedTopRowModels.length;O++){var F=m.render(i.pinnedTopRowModels[parseInt(O.toString(),10)],f);uh(F),F.classList.add("e-grid-pin-row");var M=[].slice.call(F.getElementsByClassName("e-grouptopleftcell"));M.length&&M[M.length-1].classList.add("e-lastgrouptopleftcell"),p.appendChild(F)}if(this.parent.enableColumnVirtualization)new ts(this.serviceLocator,this.parent).updateVirtualCells(b);this.tbody=this.getTable().querySelector(Ds);var L=0,P=!0;if(Fl(i)&&i.vcRows.length){var N=(0,o.isNullOrUndefined)(e.virtualInfo.offsets)?(0,o.isNullOrUndefined)(e.scrollTop)?0:e.scrollTop.top:e.virtualInfo.offsets.top;if(0!==N){for(var B=i.vGroupOffsets,z=i.pageSettings.pageSize/2,q=Object.keys(B).map(function(e){return B[""+e]}),U=0;U<q.length;U++)if(N<q[parseInt(U.toString(),10)]){if((0,o.isNullOrUndefined)(e.virtualInfo)||"up"!==e.virtualInfo.direction){L=U*z,(this.parent.contentModule.isEndBlock(U)||this.parent.contentModule.isEndBlock(U+1))&&(e.virtualInfo.blockIndexes=[U,U+1]);break}L=U>0?(U-1)*z:U*z;break}Math.round(N+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!e.rowObject&&(P=!1)}}var H=i.frozenRows&&this.parent.enableVirtualization&&"reorder"===e.requestType;if(i.frozenRows&&"virtualscroll"===e.requestType&&"X"===e.virtualInfo.sentinelInfo.axis||H){var j=e.virtualInfo.blockIndexes,V=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],H&&(e.virtualInfo.page=1);var G=H?this.initialPageRecords:n,_=this.vgenerator.generateRows(G,e);_.splice(this.parent.frozenRows);for(O=0;O<this.parent.frozenRows;O++)uh(c=m.render(_[parseInt(O.toString(),10)],f)),p.appendChild(c);e.virtualInfo.blockIndexes=j,e.virtualInfo.page=V,H&&1===e.virtualInfo.page&&b.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(p,b,m,e,n,f),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&((this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]=[]),(this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&"delete"===e.requestType||C)&&(this.visibleRows=[]),"paging"===e.requestType&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.currentViewData=[]);for(var K=function(t,r){if(W.rows.push(b[parseInt(t.toString(),10)]),W.parent.groupSettings.enableLazyLoading&&!W.useGroupCache&&W.parent.groupSettings.columns.length&&((W.parent.enableVirtualization?W.parent.lazyLoadRender:W.parent.contentModule).refRowsObj[W.parent.pageSettings.currentPage].push(b[parseInt(t.toString(),10)]),W.setRowsInLazyGroup(b[parseInt(t.toString(),10)],t),(0,o.isNullOrUndefined)(b[parseInt(t.toString(),10)].indent)))return"continue";if("paging"===e.requestType&&W.parent.groupSettings.enableLazyLoading&&W.parent.groupSettings.columns.length&&(b[parseInt(t.toString(),10)].isDataRow?W.parent.currentViewData[b[parseInt(t.toString(),10)].index]=b[parseInt(t.toString(),10)].data:b[parseInt(t.toString(),10)].isCaptionRow&&!b.some(function(e){return e.isDataRow})&&W.parent.currentViewData.push(b[parseInt(t.toString(),10)].data)),W.setInfiniteVisibleRows(e,b[parseInt(t.toString(),10)]),Fl(i)&&e.virtualInfo&&e.virtualInfo.blockIndexes&&W.rowElements.length>=e.virtualInfo.blockIndexes.length*W.parent.contentModule.getBlockSize()&&P)return W.parent.currentViewData.records=W.rows.map(function(e){return e.data}),"break";if(i.rowTemplate){var a=i.element.id+"rowTemplate",u=void 0;if(i.isReact||s){var v=i.frozenRows&&t<i.frozenRows,S=(0,o.extend)({index:t},n[parseInt(t.toString(),10)]);if(i.getRowTemplate()(S,i,"rowTemplate",a,null,null,v?p:l),i.requireTemplateRef){var C=W;return C.parent.renderTemplates(function(){i.frozenRows&&t<i.frozenRows?c=d.childNodes[parseInt(t.toString(),10)]:g=h.childNodes[parseInt(t.toString(),10)];var e={data:b[parseInt(t.toString(),10)].data,row:g||c};C.parent.trigger(w,e),(b[parseInt(t.toString(),10)].isDataRow||C.parent.enableVirtualization&&C.parent.groupSettings.enableLazyLoading)&&C.rowElements.push(e.row),C.ariaService.setOptions(C.parent.element,{colcount:i.getColumns().length.toString()}),t===b.length-1&&(h=null,d=null)}),"continue"}}else u=i.getRowTemplate()((0,o.extend)({index:t},n[parseInt(t.toString(),10)]),i,"rowTemplate",a,void 0,void 0,void 0,W.parent.root);if(i.isReact||"TBODY"!==u[0].tagName)i.frozenRows&&t<i.frozenRows?c=i.isReact?p.lastElementChild:$a(p,u):(i.isReact||(c=$a(l,u)),g=i.isReact?l.lastElementChild:c.lastElementChild);else{for(var x=0;x<u.length;x++){var R="tr"===u[parseInt(x.toString(),10)].nodeName.toLowerCase();(R||u[parseInt(x.toString(),10)].querySelectorAll&&u[parseInt(x.toString(),10)].querySelectorAll("tr").length)&&(c=R?u[parseInt(x.toString(),10)]:u[parseInt(x.toString(),10)].querySelector("tr"))}i.frozenRows&&t<i.frozenRows?p.appendChild(c):l.appendChild(c)}var D={data:b[parseInt(t.toString(),10)].data,row:g||c};W.parent.trigger(w,D)}else{uh(c=m.render(b[parseInt(t.toString(),10)],f));var T=W.ensureFrozenHeaderRender(e);if(i.frozenRows&&(t<i.frozenRows||I)&&!y&&"virtualscroll"!==e.requestType&&T&&W.ensureVirtualFrozenHeaderRender(e))p.appendChild(c);else{var E=i.getPrimaryKeyFieldNames()[0],O=b[parseInt(t.toString(),10)].data;(0,o.isNullOrUndefined)(E)||(0,o.isNullOrUndefined)(O)||!i.pinnedTopRowKeys[O[""+E]]||c.classList.add("e-grid-pin-row"),l.appendChild(c)}parseInt(c.getAttribute("aria-rowindex"),10)-1+1===i.frozenRows&&(I=!1),b[parseInt(t.toString(),10)].isExpand&&i.notify(Bi,c.cells[i.groupSettings.columns.length])}(b[parseInt(t.toString(),10)].isDataRow||W.parent.enableVirtualization&&W.parent.groupSettings.enableLazyLoading)&&(!(0,o.isNullOrUndefined)(i.rowTemplate)&&(i.isAngular||i.isVue3||i.isVue)?W.rowElements.push(g||c):W.rowElements.push(c)),W.ariaService.setOptions(W.parent.element,{colcount:i.getColumns().length.toString()})},W=this,Q=(O=L,b.length);O<Q;O++){if("break"===K(O))break}var X=i.parentDetails&&i.parentDetails.parentInstObj&&i.parentDetails.parentInstObj.isReact;if(!i.isReact&&!X||i.requireTemplateRef||i.renderTemplates(),this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&(this.parent.contentModule.refRowsObj[this.parent.pageSettings.currentPage]=this.parent.contentModule.groupCache[this.parent.pageSettings.currentPage]),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&this.parent.notify(dr,{rows:(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]}),i.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),(i.frozenRows||i.isRowPinned)&&"virtualscroll"!==e.requestType&&!y&&this.ensureVirtualFrozenHeaderRender(e)||"virtualscroll"===e.requestType&&e.virtualInfo.sentinelInfo&&"X"===e.virtualInfo.sentinelInfo.axis||("virtualscroll"===e.requestType||y||"delete"===e.requestType)&&i.isRowPinned){if(u=i.getHeaderTable().querySelector(Ds),r){var Y=u.parentElement;(0,o.remove)(u),Y.appendChild(p)}else u.innerHTML="",u.appendChild(p);i.isInitialLoad||i.scrollModule.setHeight()}e.rows=this.rows.slice(0),Oa(function(){if(t.parent.notify(ki,e),t.parent.enableVirtualization||t.parent.enableColumnVirtualization&&!v||y||(i.isReact||(t.tbody.innerHTML=""),(0,o.isNullOrUndefined)(t.tbody.parentElement)?(0,o.remove)(i.getContentTable().querySelector(Ds)):(0,o.remove)(t.tbody),t.tbody=t.parent.createElement(Ds,{attrs:{role:"rowgroup"}})),i.rowTemplate&&(0,o.updateBlazorTemplate)(i.element.id+"rowTemplate","RowTemplate",i),!(0,o.isNullOrUndefined)(t.parent.infiniteScrollModule)&&(t.parent.enableInfiniteScrolling&&!t.isInfiniteColumnvirtualization()||v)){if(t.isAddRows=!1,t.parent.notify(Rn,{args:e}),t.parent.notify(xn,{tbody:t.tbody,frag:l,args:e,rows:t.rows,rowElements:t.rowElements,visibleRows:t.visibleRows,tableName:void 0}),t.isInfiniteColumnvirtualization()&&t.parent.isFrozenGrid()){var n=jl(t.parent.getContent().querySelector(".e-virtualtable"));t.parent.contentModule.resetStickyLeftPos(n.width),t.widthService.refreshFrozenScrollbar()}}else t.useGroupCache=!1,t.appendContent(t.tbody,l,e);if(t.parent.editSettings.showAddNewRow&&(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)){var r=t.parent.element.querySelector(".e-addrow-removed");r&&(0,o.remove)(r)}var s=!t.parent.element.querySelector("."+ms);t.parent.editSettings.showAddNewRow&&"Normal"===t.parent.editSettings.mode&&(s&&((t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&(t.parent.isAddNewRow=!0),t.parent.isEdit=!1,t.parent.addRecord()),(s||(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(t){return e.requestType===t}))&&t.parent.notify(jr,{})),t.parent.getContent()&&(t.parent.frozenRightCount||t.parent.frozenLeftCount)&&Gl(t.parent)>0&&t.parent.scrollModule.updateFrozenShadow(),l=null},this.rafCallback((0,o.extend)({},e)))}},e.prototype.isInfiniteColumnvirtualization=function(){return this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling},e.prototype.enableCacheOnInfiniteColumnVirtual=function(){return this.isInfiniteColumnvirtualization()&&this.parent.infiniteScrollSettings.enableCache},e.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},e.prototype.appendContent=function(e,t,i,n){if(this.parent.isReact&&!(0,o.isNullOrUndefined)(this.parent.rowTemplate)?this.getTable().appendChild(t):(e.appendChild(t),this.getTable().appendChild(e)),"Vertical"===this.parent.rowRenderingMode&&this.parent.allowTextWrap&&("Header"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))for(var r=e.querySelectorAll("td"),s=0;s<r.length;s++){var a=parseFloat(document.defaultView.getComputedStyle(r[parseInt(s.toString(),10)],"::before").getPropertyValue("height"));a>r[parseInt(s.toString(),10)].offsetHeight&&(r[parseInt(s.toString(),10)].style.height=a+"px",r[parseInt(s.toString(),10)].style.boxSizing="content-box")}this.parent.getVisibleFrozenLeftCount()&&this.parent.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar()},e.prototype.setRowsInLazyGroup=function(e,t){this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).maintainRows(e,t)},e.prototype.setGroupCache=function(e,t){!this.useGroupCache&&this.parent.groupSettings.enableLazyLoading&&this.parent.notify(Nn,{args:t,data:e})},e.prototype.ensureFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&("reorder"===e.requestType||"refresh"===e.requestType)||this.parent.infiniteScrollSettings.enableCache&&this.parent.frozenRows&&"delete"===this.parent.infiniteScrollModule.requestType&&1!==this.parent.pageSettings.currentPage)},e.prototype.ensureVirtualFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&"delete"===e.requestType)},e.prototype.checkCache=function(e,t){if(this.parent.infiniteScrollSettings.enableCache&&"infiniteScroll"===t.requestType){if(this.isAddRows=!(0,o.isNullOrUndefined)(this.infiniteCache[this.parent.pageSettings.currentPage]),this.isAddRows){var i=this.infiniteCache[this.parent.pageSettings.currentPage];e=1===this.parent.pageSettings.currentPage?i.slice(this.parent.frozenRows):i}return e}return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&("paging"===t.requestType||"columnstate"===t.requestType||"reorder"===t.requestType||"virtualscroll"===t.requestType)&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getGroupCache()[this.parent.pageSettings.currentPage]?(this.parent.enableVirtualization||(this.useGroupCache=!0),this.parent.enableVirtualization?this.parent.getRowsObject():this.parent.contentModule.initialGroupRows("reorder"===t.requestType)):null},e.prototype.setInfiniteVisibleRows=function(e,t){!this.parent.enableInfiniteScrolling||this.parent.infiniteScrollSettings.enableCache||this.isInfiniteColumnvirtualization()&&"virtualscroll"===e.requestType||this.visibleRows.push(t)},e.prototype.getCurrentBlockInfiniteRecords=function(){var e=[];if(this.parent.infiniteScrollSettings.enableCache){if(!Object.keys(this.infiniteCache).length)return[];var t=this.parent.getRows(),i=parseInt(t[this.parent.frozenRows].getAttribute(Rs),10)-1,n=Math.ceil((i+1)/this.parent.pageSettings.pageSize);i=parseInt(t[t.length-1].getAttribute(Rs),10)-1;for(var r=Math.ceil((i+(t.length?1:0))/this.parent.pageSettings.pageSize),s=n;s<=r;s++)e=e.length?e.concat(this.infiniteCache[parseInt(s.toString(),10)]):this.infiniteCache[parseInt(s.toString(),10)];this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(e=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(e))}return e},e.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},e.prototype.virtualFrozenHdrRefresh=function(e,t,i,n,r,s){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===n.requestType||"refresh"===n.requestType)){for(var o=void 0,a=this.getReorderedRows(n),l=0;l<a.length;l++)o=i.render(a[parseInt(l.toString(),10)],s),e.appendChild(o);1===n.virtualInfo.page&&t.splice(0,this.parent.frozenRows)}},e.prototype.getInfiniteRows=function(){var e=[];if(this.parent.enableInfiniteScrolling)if(this.parent.infiniteScrollSettings.enableCache)for(var t=Object.keys(this.infiniteCache),i=0;i<t.length;i++)e=e.concat(this.infiniteCache[t[parseInt(i.toString(),10)]]);else e=this.visibleRows;return e},e.prototype.getInfiniteMovableRows=function(){var e=this.getCurrentBlockInfiniteRecords();return this.parent.enableInfiniteScrolling?e.length?e:this.visibleRows:[]},e.prototype.getPanel=function(){return this.contentPanel},e.prototype.setPanel=function(e){this.contentPanel=e},e.prototype.getTable=function(){return this.contentTable},e.prototype.setTable=function(e){this.contentTable=e},e.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.rows},e.prototype.getRowElements=function(){return this.rowElements},e.prototype.setRowElements=function(e){this.rowElements=e},e.prototype.getColGroup=function(){return this.colgroup},e.prototype.setColGroup=function(e){return(0,o.isNullOrUndefined)(e)||(e.id="content-"+e.id),this.colgroup=e},e.prototype.setVisible=function(e){var t,i=this.parent;this.getRows().some(function(e){return e.isDataRow&&(t=e),e.isDataRow});var n=!0;!i.groupSettings.columns.length&&t&&(n=!1);for(var r=i.getDataRows(),s=this.infiniteRowVisibility(),a=s||this.rows.filter(function(e){return!e.isDetailRow}),l=0,h=e.length;l<h;l++){var d=e[parseInt(l.toString(),10)],p=this.parent.getNormalizedColumnIndex(d.uid),c=this.parent.getColumnIndexByUid(d.uid),u=!0===d.visible?"":"none";-1!==p&&t&&p<t.cells.length&&(0,o.setStyleAttribute)(this.getColGroup().childNodes[parseInt(p.toString(),10)],{display:u}),n||this.setDisplayNone(r,c,u,a),!this.parent.invokedFromMedia&&d.hideAtMedia&&this.parent.updateMediaColumns(d),this.parent.invokedFromMedia=!1}"Both"!==i.gridLines&&"Vertical"!==i.gridLines||(n=!0),n?this.refreshContentRows({requestType:"refresh"}):(this.parent.notify(Wi,{rows:a,args:{}}),this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.notify(jr,{}))},e.prototype.setDisplayNone=function(e,t,i,n){xh(e,t,i,n,this.parent,this.parent.isRowDragable()),this.parent.notify(In,{visible:i,index:t,isFreeze:this.isInfiniteFreeze})},e.prototype.infiniteRowVisibility=function(e){var t;return this.parent.enableInfiniteScrolling&&(this.isInfiniteFreeze=e,t=this.parent.infiniteScrollSettings.enableCache?this.getCurrentBlockInfiniteRecords():e?this.visibleFrozenRows:this.visibleRows),t},e.prototype.colGroupRefresh=function(){if(this.getColGroup()){var e=this.getHeaderColGroup();this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)}},e.prototype.getHeaderColGroup=function(){return this.parent.element.querySelector("."+ns).querySelector(Ts+":not(.e-masked-colgroup)").cloneNode(!0)},e.prototype.initializeContentDrop=function(){var e=this.parent;this.droppable=new o.Droppable(e.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy()},e.prototype.canSkip=function(e,t,i){return(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(e.visible)||t.cells[parseInt(i.toString(),10)].visible===e.visible},e.prototype.getModelGenerator=function(){return this.generator=this.parent.allowGrouping?new Xs(this.parent):new Vs(this.parent)},e.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(Ds).innerHTML="")},e.prototype.setSelection=function(e,t,i){this.parent.notify(Gn,{uid:e,set:t,clearAll:i});for(var n=this.getRows().filter(function(t){return i||e===t.uid}),r=0;r<n.length;r++){n[parseInt(r.toString(),10)].isSelected=t;for(var s=n[parseInt(r.toString(),10)].cells,o=0;o<s.length;o++)s[parseInt(o.toString(),10)].isSelected=t}},e.prototype.getRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),(0,o.isNullOrUndefined)(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)]},e.prototype.getInfiniteRowIndex=function(e){if(this.parent.infiniteScrollSettings.enableCache&&!(0,o.isNullOrUndefined)(e)){var t=this.parent.frozenRows,i=t>e?0:t,n=parseInt(this.parent.getRows()[parseInt(i.toString(),10)].getAttribute(Rs),10)-1;e=t>e?e:e-n+t}return e},e.prototype.getVirtualRowIndex=function(e){return e},e.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},e.prototype.setRowObjects=function(e){this.rows=e},e.prototype.immutableModeRendering=function(e){var t=this;void 0===e&&(e={});var i=this.parent;i.loadingIndicator&&"Shimmer"===i.loadingIndicator.indicatorType?i.removeMaskRow():i.hideSpinner();var n=i.getPrimaryKeyFieldNames()[0],r={},s={},a=[],l={},h=i.getRowsObject().slice(),d=this.getBatchEditedRecords(n,h),p={},c=0!==Object.keys(d).length;if(i.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else{if(0===i.currentViewData.length)return;var u={},g=i.createElement(Ds,{attrs:{role:"rowgroup"}}),f=i.currentViewData,m=[].slice.call(this.getTable().querySelector(Ds).children);if(this.prevCurrentView.length){var y=this.prevCurrentView.length,v=f.length;if(y===v)for(var S=0;S<v;S++)"Batch"===this.parent.editSettings.mode&&m[parseInt(S.toString(),10)].classList.contains("e-insertedrow")?(m.splice(S,1),--S):(s[f[parseInt(S.toString(),10)][""+n]]=r[this.prevCurrentView[parseInt(S.toString(),10)][""+n]]=S,p[parseInt(S.toString(),10)]=f[parseInt(S.toString(),10)][""+n],u[h[parseInt(S.toString(),10)].uid]=m[parseInt(S.toString(),10)],l[parseInt(S.toString(),10)]=this.prevCurrentView[parseInt(S.toString(),10)][""+n]);else{for(S=0;S<v;S++)s[f[parseInt(S.toString(),10)][""+n]]=S,p[parseInt(S.toString(),10)]=f[parseInt(S.toString(),10)][""+n];for(S=0;S<y;S++)"Batch"===this.parent.editSettings.mode&&m[parseInt(S.toString(),10)].classList.contains("e-insertedrow")?(m.splice(S,1),--S):(u[h[parseInt(S.toString(),10)].uid]=m[parseInt(S.toString(),10)],r[this.prevCurrentView[parseInt(S.toString(),10)][""+n]]=S,l[parseInt(S.toString(),10)]=this.prevCurrentView[parseInt(S.toString(),10)][""+n])}}for(S=0;S<f.length;S++){var C=r[f[parseInt(S.toString(),10)][""+n]];if((0,o.isNullOrUndefined)(C)){var w=new js(this.serviceLocator,null,i),b={startIndex:S},I=this.generator.generateRows([f[parseInt(S.toString(),10)]],b);a.push(I[0]);R=w.render(I[0],i.getColumns());g.appendChild(R),this.refreshImmutableContent(S,R,a[parseInt(S.toString(),10)])}else{var x=!1;this.parent.enableDeepCompare&&(x=this.objectEqualityChecker(this.prevCurrentView[parseInt(C.toString(),10)],f[parseInt(S.toString(),10)]));var R=u[h[parseInt(C.toString(),10)].uid];if(a.push(h[parseInt(C.toString(),10)]),this.rowElements[parseInt(C.toString(),10)]&&this.rowElements[parseInt(C.toString(),10)].getAttribute("data-uid")===a[parseInt(S.toString(),10)].uid&&(c&&(0,o.isNullOrUndefined)(d[p[parseInt(S.toString(),10)]])||!c&&(x||this.prevCurrentView[parseInt(C.toString(),10)]===f[parseInt(S.toString(),10)]))){C!==S&&this.refreshImmutableContent(S,R,a[parseInt(S.toString(),10)]),g.appendChild(R);continue}(c&&!(0,o.isNullOrUndefined)(d[p[parseInt(S.toString(),10)]])||!this.parent.enableDeepCompare&&f[parseInt(S.toString(),10)]!==this.prevCurrentView[parseInt(C.toString(),10)]||this.parent.enableDeepCompare&&!x)&&h[parseInt(C.toString(),10)].setRowValue(f[parseInt(S.toString(),10)]),g.appendChild(R),this.refreshImmutableContent(S,R,a[parseInt(S.toString(),10)])}}if(this.rows=a,this.rowElements=[].slice.call(g.children),(0,o.remove)(this.getTable().querySelector(Ds)),this.getTable().appendChild(g),this.parent.trigger(E,{},function(){t.parent.allowTextWrap&&t.parent.notify(pi,{case:"textwrap"})}),e){var D=(e.requestType||"").toLowerCase()+"-complete";this.parent.notify(D,e)}}},e.prototype.objectEqualityChecker=function(e,t){for(var i=Object.keys(e),n=!0,r=0;r<i.length;r++){if(e[i[parseInt(r.toString(),10)]]!==t[i[parseInt(r.toString(),10)]])if(!(e[i[parseInt(r.toString(),10)]]instanceof Date&&t[i[parseInt(r.toString(),10)]]instanceof Date)||e[i[parseInt(r.toString(),10)]].getTime()!==t[i[parseInt(r.toString(),10)]].getTime()){n=!1;break}}return n},e.prototype.getBatchEditedRecords=function(e,t){var i={},n=this.parent.getBatchChanges(),r=[],s=[];Object.keys(n).length&&(r=n.changedRecords,s=n.addedRecords);var o={cancel:!1};this.parent.notify(Qn,{rows:t,args:o}),s.length&&("Bottom"===this.parent.editSettings.newRowPosition?t.splice(t.length-1,s.length):o.cancel||t.splice(0,s.length));for(var a=0;a<r.length;a++)i[r[parseInt(a.toString(),10)][""+e]]=a;return i},e.prototype.refreshImmutableContent=function(e,t,i){i.isAltRow=!!this.parent.enableAltRow&&e%2!=0,i.isAltRow?t.classList.add("e-altrow"):t.classList.remove("e-altrow"),i.index=e,i.edit=void 0,i.isDirty=!1,t.setAttribute(Rs,(e+1).toString()),this.updateCellIndex(t,e)},e.prototype.updateCellIndex=function(e,t){for(var i=0;i<e.cells.length;i++)e.cells[parseInt(i.toString(),10)].setAttribute("data-index",t.toString())},e}(),Js=c(741),Zs=function(){function e(e,t){var i=this;this.frzIdx=0,this.notfrzIdx=0,this.isFirstCol=!1,this.isReplaceDragEle=!0,this.helper=function(e){var t=i.parent,n=i.draggable.currentStateTarget,r=_a(n,"e-headercell");if(!t.allowReordering&&!t.allowGrouping||!(0,o.isNullOrUndefined)(r)&&r.getElementsByClassName("e-checkselectall").length>0)return!1;var s=i.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),a=n.classList.contains("e-headercell")?n:r;if(!a||!t.allowReordering&&a.classList.contains("e-stackedheadercell"))return!1;var l,h=a.offsetHeight,d=a.querySelector(".e-headercelldiv")||a.querySelector(".e-stackedheadercelldiv");if(d){if((l=t.getColumnByUid(d.getAttribute("data-mappinguid")))||!a.querySelector(".e-stackedheadercelldiv")||d.innerHTML.includes("<")||(l=t.getStackedHeaderColumnByHeaderText(d.innerText.trim(),t.columns)),i.column=l,!i.column||i.column.lockColumn)return!1;s.setAttribute("data-mappinguid",i.column.uid)}if(l&&!(0,o.isNullOrUndefined)(l.headerTemplate)){if((0,o.isNullOrUndefined)(l.headerTemplate))s.innerHTML=l.headerTemplate;else{var p=t.getColumnIndexByField(l.field),c=l.getHeaderTemplate()((0,o.extend)({index:p},l),t,"headerTemplate",null,null,null,null,t.root),u=t.isReact&&"string"!=typeof l.headerTemplate,g=t.parentDetails&&t.parentDetails.parentInstObj&&t.parentDetails.parentInstObj.isReact;(u||g)&&t.renderTemplates(),$a(s,c)}(0,o.isNullOrUndefined)(s.firstChild)||1!==s.firstChild.nodeType||(s.firstChild.style.pointerEvents="none")}else s.innerHTML=d?l.headerText:a.firstElementChild.innerHTML;return s.style.width=a.offsetWidth+"px",s.style.height=a.offsetHeight+"px",s.style.lineHeight=(h-6).toString()+"px",t.element.appendChild(s),s},this.dragStart=function(e){var t=i.parent;t.element.querySelector(".e-gridpopup").style.display="none",t.notify(H,{target:i.draggable.currentStateTarget,column:i.column,event:e.event})},this.drag=function(e){var t=i.parent,n=e.target;if(n){var r=(0,o.closest)(n,".e-grid"),s=i.parent.element.querySelector(".e-cloneproperties");if(!(r&&r.getAttribute("id")===t.element.getAttribute("id")||((0,o.classList)(s,["e-notallowedcur"],["e-defaultcur"]),t.allowReordering&&(t.element.querySelector(".e-reorderuparrow").style.display="none",t.element.querySelector(".e-reorderdownarrow").style.display="none"),t.groupSettings.allowReordering)))return;t.notify(j,{target:e.target,column:i.column,event:e.event})}},this.dragStop=function(e){var t,n=i.parent;n.element.querySelector(".e-gridpopup").style.display="none",(!_a(e.target,"e-headercell")&&!_a(e.target,"e-groupdroparea")||!n.allowReordering&&_a(e.target,"e-headercell")||!e.helper.getAttribute("data-mappinguid")&&_a(e.target,"e-groupdroparea"))&&((0,o.remove)(e.helper),t=!0),n.notify(Et,{target:e.target,event:e.event,column:i.column,cancel:t})},this.drop=function(e){var t=i.parent,n=e.droppedElement.getAttribute("data-mappinguid"),r=(0,o.closest)(e.target,".e-grid");(0,o.remove)(e.droppedElement),r&&r.getAttribute("id")!==t.element.getAttribute("id")||!t.allowReordering&&!t.allowGrouping||t.notify(Ot,{target:e.target,uid:n,droppedElement:e.droppedElement})},this.parent=e,this.serviceLocator=t,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.on(wt,this.setVisible,this),this.parent.on(xt,this.colPosRefresh,this),this.parent.on(Le,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(Be,this.updateCustomResponsiveToolbar,this))}return e.prototype.renderPanel=function(){var e=this.parent.element.querySelector("."+ns),t=null!=e;e=t?e:this.parent.createElement("div",{className:"e-gridheader"});var i=t?e.querySelector("."+os):this.parent.createElement("div",{className:os});this.toggleStackClass(e),e.appendChild(i),this.setPanel(e),t||this.parent.element.appendChild(e)},e.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector("."+cs)),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(je,{rows:this.rows})},e.prototype.getPanel=function(){return this.headerPanel},e.prototype.setPanel=function(e){this.headerPanel=e},e.prototype.getTable=function(){return this.headerTable},e.prototype.setTable=function(e){this.headerTable=e},e.prototype.getColGroup=function(){return this.colgroup},e.prototype.setColGroup=function(e){return this.colgroup=e},e.prototype.getRows=function(){return this.getTable().tHead.rows},e.prototype.createHeaderTable=function(){var e=this.createTable(),t=this.getPanel().querySelector("."+os);return t.appendChild(e),t},e.prototype.createHeader=function(e,t){void 0===e&&(e=null);var i=this.parent;this.getTable()&&(0,o.remove)(this.getTable());var n=this.parent.createElement("table",{className:cs,attrs:{role:"presentation"}});n.style.cssText="border-collapse: separate; border-spacing: .25px;";var r=this.createHeaderContent(t),s=r.thead,a=this.parent.createElement(Ds,{className:this.parent.frozenRows||this.parent.isRowPinned||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"":"e-hide",attrs:{role:"rowgroup"}});this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"});for(var l,h=this.parent.createElement(Ts),d=this.parent.createElement("tr",{attrs:{role:"row"},className:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"e-hide":""}),p=this.rows=r.rows,c=0,u=p.length;c<u;c++)for(var g=0,f=p[parseInt(c.toString(),10)].cells.length;g<f;g++)l=this.parent.createElement("td"),d.appendChild(l);return(i.allowFiltering||i.allowSorting||i.allowGrouping)&&n.classList.add("e-sortfilter"),this.updateColGroup(h),a.appendChild(d),n.appendChild(this.caption),n.appendChild(this.setColGroup(h)),n.appendChild(s),n.appendChild(a),n},e.prototype.createTable=function(e){return void 0===e&&(e=null),this.createHeader(e)},e.prototype.createHeaderContent=function(e){var i=this.parent,n=i.getColumns(),r=this.parent.createElement("thead",{attrs:{role:"rowgroup"}}),s=this.parent.createElement("tr",{className:"e-columnheader",attrs:{role:"row"}}),o=new js(this.serviceLocator,t.Header,i);o.element=s;var a,l=[];this.colDepth=ql(i.columns);for(var h=0,d=this.colDepth;h<d;h++)l[parseInt(h.toString(),10)]=this.generateRow(h),l[parseInt(h.toString(),10)].cells=[];if(l=this.ensureColumns(l),l=this.getHeaderCells(l,e),i.isRowDragable()&&"Right"===this.parent.getFrozenMode())for(h=0,d=l.length;h<d;h++)l[parseInt(h.toString(),10)].cells.push(this.generateCell({},t.RowDragHIcon));n.filter(function(e){return e.headerTemplate}).length&&(this.parent.isReact||this.parent.isVue)&&Ah(this.parent,["headerTemplate"]),n&&n.length&&!n[0].visible?this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!0):this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!1);for(h=0,d=this.colDepth;h<d;h++)a=o.render(l[parseInt(h.toString(),10)],n),this.parent.rowHeight&&a.querySelector(".e-headercell")&&(a.style.height=this.parent.rowHeight+"px"),uh(a),r.appendChild(a);var p=Array.from(r.querySelectorAll(".e-headercell:not(.e-hide)"));if(this.parent.allowResizing&&p.length>0)if(r.querySelector(".e-lastcell")&&r.querySelector(".e-lastcell").classList.contains("e-hide"))p[p.length-1].classList.add("e-last-visible-cell");else if(r.querySelector(".e-laststackcell")&&r.querySelector(".e-laststackcell").classList.contains("e-hide")){p[p.length-1].classList.add("e-last-visible-stack-cell")}return{thead:r,rows:l}},e.prototype.updateColGroup=function(e){var t,i=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(e.id=this.parent.element.id+Ts,this.parent.allowGrouping)for(var r=0,s=this.parent.groupSettings.columns.length;r<s;r++)this.parent.enableColumnVirtualization&&-1===n.indexOf(r)||(t=this.parent.createElement("col",{className:"e-group-intent"}),e.appendChild(t));(this.parent.detailTemplate||this.parent.childGrid)&&(t=this.parent.createElement("col",{className:"e-detail-intent"}),e.appendChild(t)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(t=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(t));for(r=0,s=i.length;r<s;r++)t=this.parent.createElement("col"),!1===i[parseInt(r.toString(),10)].visible&&(0,o.setStyleAttribute)(t,{display:"none"}),e.appendChild(t);return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&(t=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(t)),e},e.prototype.ensureColumns=function(e){for(var i=this.parent,n=this.parent.getColumnIndexesInView(),r=0,s=e.length;r<s;r++){var o=0===r?this.colDepth:0;if(i.allowGrouping)for(var a=0,l=i.groupSettings.columns.length;a<l;a++)if(!this.parent.enableColumnVirtualization||-1!==n.indexOf(a)){var h=this.generateCell({},t.HeaderIndent);this.colDepth>1&&(h.rowSpan=o),e[parseInt(r.toString(),10)].cells.push(h)}if(i.detailTemplate||i.childGrid){var d={};this.parent.notify(ln,d);h=this.generateCell(d,t.DetailHeader);this.colDepth>1&&(h.rowSpan=o),e[parseInt(r.toString(),10)].cells.push(h)}if(i.isRowDragable()&&"Right"!==this.parent.getFrozenMode()){h=this.generateCell({},t.RowDragHIcon);this.colDepth>1&&(h.rowSpan=o),e[parseInt(r.toString(),10)].cells.push(h)}}return e},e.prototype.getHeaderCells=function(e,t){var i=this.parent.getHeaderTable()&&this.parent.getHeaderTable().querySelector("thead"),n=this.parent.enableColumnVirtualization?this.parent.getColumns(this.parent.enablePersistence):this.parent.columns;if(this.frzIdx=0,this.notfrzIdx=0,this.parent.lockcolPositionCount)for(var r=0;r<((0,o.isNullOrUndefined)(n)?0:n.length);r++)this.lockColsRendered=!1,e=this.appendCells(n[parseInt(r.toString(),10)],e,0,0===r,!1,r===n.length-1,i,t,!1);r=0;for(var s=(0,o.isNullOrUndefined)(n)?0:n.length;r<s;r++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(n[parseInt(r.toString(),10)],e,0,0===r,!1,r===s-1,i,t,!1);return e},e.prototype.appendCells=function(e,i,n,r,s,o,a,l,h){var d=o?h?"e-laststackcell":"e-lastcell":"",p=!this.parent.lockcolPositionCount||e.lockColumn&&!this.lockColsRendered||!e.lockColumn&&this.lockColsRendered;if(e.columns){this.isFirstCol=!1;var c=this.getCellCnt(e,0);if(c){var u=this.getStackedLockColsCount(e,0);(0===this.parent.lockcolPositionCount||!this.lockColsRendered&&0!==u||this.lockColsRendered&&c-u!==0)&&i[parseInt(n.toString(),10)].cells.push(new es({cellType:t.StackedHeader,column:e,colSpan:this.getColSpan(c,u),className:r?"":s?"e-firstcell":""}))}if(this.parent.lockcolPositionCount&&!this.lockColsRendered)for(var g=0;g<e.columns.length;g++)i=this.appendCells(e.columns[parseInt(g.toString(),10)],i,n+1,r,0===g,g===e.columns.length-1&&o,a,l,!1);if(this.lockColsRendered){g=0;for(var f=e.columns.length;g<f;g++){r=r&&0===g;var m=this.isFirstCol=e.columns[parseInt(g.toString(),10)].visible&&!r,y=g===f-1&&o;i=this.appendCells(e.columns[parseInt(g.toString(),10)],i,n+1,r,m&&!y,y,a,l,!0)}}}else p&&i[parseInt(n.toString(),10)].cells.push(this.generateCell(e,t.Header,this.colDepth-n,(r?"":s?"e-firstcell":"")+d,n,this.parent.getColumnIndexByUid(e.uid))),this.parent.lockcolPositionCount?this.frzIdx+this.notfrzIdx<this.parent.frozenColumns&&(e.lockColumn&&!this.lockColsRendered||!e.lockColumn&&this.lockColsRendered)?this.frzIdx++:this.notfrzIdx++:this.frzIdx++;return i},e.prototype.getStackedLockColsCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getStackedLockColsCount(e.columns[parseInt(i.toString(),10)],t);else e.lockColumn&&t++;return t},e.prototype.getColSpan=function(e,t){return e=this.lockColsRendered?e-t:t},e.prototype.generateRow=function(e){return new $r({})},e.prototype.generateCell=function(e,t,i,n,r,s){var a={visible:e.visible,isDataCell:!1,isTemplate:!(0,o.isNullOrUndefined)(e.headerTemplate),rowID:"",column:e,cellType:t,rowSpan:i,className:n,index:r,colIndex:s};return(!a.rowSpan||a.rowSpan<2)&&delete a.rowSpan,new es(a)},e.prototype.setVisible=function(e){for(var t,i,n=this.parent,r=0,s=e.length;r<s;r++){var a=e[parseInt(r.toString(),10)];i=n.getNormalizedColumnIndex(a.uid),t=a.visible?"":"none",(0,o.setStyleAttribute)(this.getColGroup().children[parseInt(i.toString(),10)],{display:t}),n.editSettings.showAddNewRow&&n.element.querySelector(".e-addedrow")&&(0,o.setStyleAttribute)(n.element.querySelector(".e-addedrow").querySelector("colgroup").childNodes[parseInt(i.toString(),10)],{display:t})}this.refreshUI(),this.parent.editSettings.showAddNewRow&&(this.parent.isAddNewRow=!0)},e.prototype.colPosRefresh=function(){this.refreshUI()},e.prototype.refreshUI=function(){var e=this.getPanel();this.toggleStackClass(e);var t=this.getTable();if(t){this.droppableDestroy(),this.parent.reorderModule&&(this.parent.reorderModule.element=null,this.parent.reorderModule.destElement=null),(0,o.remove)(t),this.parent.editSettings.showAddNewRow&&!this.parent.isAddNewRow&&t.querySelector(".e-addedrow")&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(t.querySelector(".e-addedrow").classList.add("e-addrow-removed"),this.parent.isAddNewRow=!0),t.removeChild(t.childNodes[1]),t.removeChild(t.childNodes[1]);var i=this.parent.createElement(Ts),n=this.createHeaderContent(void 0);this.rows=n.rows,t.insertBefore(n.thead,t.childNodes[1]),this.updateColGroup(i),t.insertBefore(this.setColGroup(i),t.childNodes[1]),this.appendContent(t),this.parent.notify(He,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),this.initializeHeaderDrag(),this.initializeHeaderDrop();for(var r=[].slice.call(e.querySelectorAll("tr.e-columnheader")),s=0,a=r;s<a.length;s++){var l=a[s],h=[].slice.call(l.getElementsByClassName("e-grouptopleftcell"));h.length&&h[h.length-1].classList.add("e-lastgrouptopleftcell")}this.parent.notify(je,{rows:this.rows}),this.parent.enableColumnVirtualization&&_a(t,ls)&&this.parent.notify(je,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&ml(r,!0)}var d=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)");(0,o.isNullOrUndefined)(d)||(d.tabIndex=0)},e.prototype.toggleStackClass=function(e){var t=this.parent.columns;!(0,o.isNullOrUndefined)(t)&&t.some(function(e){return!(0,o.isNullOrUndefined)(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},e.prototype.appendContent=function(e){this.getPanel().querySelector("."+os).appendChild(e)},e.prototype.getCellCnt=function(e,t){if(e.columns)for(var i=0,n=e.columns.length;i<n;i++)t=this.getCellCnt(e.columns[parseInt(i.toString(),10)],t);else e.visible&&t++;return t},e.prototype.initializeHeaderDrag=function(){var e=this.parent;(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)&&(this.draggable=new o.Draggable(e.getHeaderContent(),{dragTarget:".e-headercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,abort:".e-rhandler",isReplaceDragEle:this.isReplaceDragEle}),this.parent.on(Ct,this.droppableDestroy,this))},e.prototype.initializeHeaderDrop=function(){var e=this.parent;this.droppable=new o.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop}),this.parent.on(Ct,this.droppableDestroy,this)},e.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy(),this.draggable&&!this.draggable.isDestroyed&&this.draggable.destroy()},e.prototype.renderCustomToolbar=function(){var e=this,t=this.parent;if("Vertical"===t.rowRenderingMode&&!t.toolbar&&(t.allowSorting||t.allowFiltering&&"FilterBar"!==t.filterSettings.type)){for(var i=t.createElement("div",{className:"e-res-toolbar e-toolbar"}),n=t.createElement("div",{className:"e-toolbar-items"}),r=t.createElement("div",{className:"e-toolbar-left"}),s=this.parent.allowFiltering&&this.parent.allowSorting?2:1,o=0;o<s;o++){var a=t.createElement("div",{className:"e-toolbar-item e-gridresponsiveicons e-icons e-tbtn-align"}),l=1===s?this.parent.allowSorting?"sort":"filter":1===o?"sort":"filter",h=t.createElement("button",{className:"e-tbar-btn e-control e-btn e-lib e-icon-btn"}),d=t.createElement("span",{className:"e-btn-icon e-res"+l+"-icon e-icons"});h.appendChild(d),new Js.Button({cssClass:this.parent.cssClass?this.parent.cssClass:""}).appendTo(h),h.onclick=function(t){t.target.classList.contains("e-ressort-btn")||t.target.classList.contains("e-ressort-icon")||t.target.querySelector(".e-ressort-icon")?e.parent.showResponsiveCustomSort():e.parent.showResponsiveCustomFilter()},a.appendChild(h),r.appendChild(a)}n.appendChild(r),i.appendChild(n),t.element.insertBefore(i,this.parent.element.querySelector("."+ns))}else t.enableAdaptiveUI&&!t.toolbar&&t.getContent().classList.add("e-responsive-header")},e.prototype.updateCustomResponsiveToolbar=function(e){var t=this.parent.element.querySelector(".e-responsive-toolbar");"toolbar"===e.module&&(t?(0,o.remove)(t):this.renderCustomToolbar())},e}(),$s=function(){function e(e,t){this.localizer=t.getService("localization"),this.formatter=t.getService("valueFormatter"),this.parent=e,this.element=this.parent.createElement("TD",{className:is,attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox","aria-label":this.localizer.getConstant("SelectRow")}})}return e.prototype.getGui=function(){return""},e.prototype.format=function(e,t,i){if(!(0,o.isNullOrUndefined)(e.format)){if("number"===e.type&&isNaN(parseInt(t,10))&&(t=null),"dateonly"===e.type&&"string"==typeof t&&t){var n=t.split(/[^0-9.]/);t=new Date(parseInt(n[0],10),parseInt(n[1],10)-1,parseInt(n[2],10))}t=this.formatter.toView(t,e.getFormatter())}return(0,o.isNullOrUndefined)(t)?"":t.toString()},e.prototype.evaluate=function(e,t,i,n,r,s){var a,l;if(t.column.template){var h=this.parent.isReact&&"string"!=typeof t.column.template&&!(t.column.template.prototype&&t.column.template.prototype.CSPTemplate),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,p=this.parent.printGridParent&&this.parent.printGridParent.isReact,c=["data-index"],u=Bl({},i,((a={})[Ri]=r,a.column=t.column,a)),g=this.parent.element.id+t.column.uid,f="isStringTemplate";if(h||d||p){var m={index:n[c[0]]};t.column.getColumnTemplate()((0,o.extend)(m,u),this.parent,"columnTemplate",g,this.parent[""+f],null,e)}else l=t.column.getColumnTemplate()((0,o.extend)({index:n[c[0]]},u),this.parent,"template",g,this.parent[""+f],void 0,void 0,this.parent.root);return h||d||p||$a(e,l),this.parent.notify("template-result",{template:l}),l=null,t.column.templateOptions.enableAriaLabel&&e.setAttribute("aria-label",e.innerText+this.localizer.getConstant("TemplateCell")+this.localizer.getConstant("ColumnHeader")+t.column.headerText),!1}return!0},e.prototype.invokeFormatter=function(e,t,i){(0,o.isNullOrUndefined)(e.formatter)||(t=Da(e.formatter,"getValue")?(new(0,e.formatter)).getValue(e,i):"function"==typeof e.formatter?e.formatter(e,i):e.formatter.getValue(e,i));return t},e.prototype.render=function(e,t,i,n,r){return this.refreshCell(e,t,i,r)},e.prototype.refreshTD=function(e,t,i,n){var r="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell");if(this.parent.isReact){var s=e.cellIndex,a=e.parentElement;(0,o.remove)(e);var l=this.refreshCell(t,i,n,r);this.cloneAttributes(l,e),a.cells.length!==s-1?a.insertBefore(l,a.cells[parseInt(s.toString(),10)]):a.appendChild(l)}else{var h=this.refreshCell(t,i,n,r);e.innerHTML="";var d=h.getAttribute("aria-label");d&&e.setAttribute("aria-label",d);for(var p=0,c=[].slice.call(h.childNodes);p<c.length;p++){var u=c[p];e.appendChild(u)}}},e.prototype.cloneAttributes=function(e,t){for(var i,n=t.attributes,r=n.length;r--;)i=n[parseInt(r.toString(),10)],e.setAttribute(i.name,i.value)},e.prototype.refreshCell=function(e,t,i,n){var r,s,a=this.element.cloneNode(),l=e.column;e.isForeignKey&&(s=e.foreignKeyData&&e.foreignKeyData[0]?e.foreignKeyData[0]:((r={})[l.foreignKeyValue]=l.format?null:"",r));var h=this.getGui(),d=e.isForeignKey?this.getValue(l.foreignKeyValue,s,l):this.getValue(l.field,t,l);if("date"!==l.type&&"datetime"!==l.type||(0,o.isNullOrUndefined)(d)||(d=new Date(d)),"dateonly"===l.type&&!(0,o.isNullOrUndefined)(d)&&"string"==typeof d){var p=d.split(/[^0-9.]/);d=new Date(parseInt(p[0],10),parseInt(p[1],10)-1,parseInt(p[2],10))}if(h=(d=this.format(l,d,t)).toString(),"boolean"===l.type&&!l.displayAsCheckBox){var c="true"!==d&&"false"!==d?null:"true"===d?"True":"False";h=c?this.localizer.getConstant(c):h}var u=this.invokeFormatter(l,d,t);if(h=(0,o.isNullOrUndefined)(l.formatter)?h:(0,o.isNullOrUndefined)(u)?"":u.toString(),this.evaluate(a,e,t,i,s,n)&&"checkbox"!==l.type)this.appendHtml(a,this.parent.sanitize(h),l.getDomSetter?l.getDomSetter():"innerHTML");else if("checkbox"===l.type){a.classList.add(gs),d=!!this.parent.selectionSettings.persistSelection&&"true"===d;var g=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:d,label:" "});this.parent.cssClass&&(0,o.addClass)([g],[this.parent.cssClass]),this.rowChkBox.id="checkbox-"+e.rowID,g.insertBefore(this.rowChkBox.cloneNode(),g.firstChild),a.appendChild(g)}if("Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(a,e,i),"boolean"===l.type&&l.displayAsCheckBox){var f=isNaN(parseInt(d.toString(),10))?"true"===d:parseInt(d.toString(),10)>0;g=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:f,label:" "});a.innerHTML="",a.classList.add("e-gridchkbox-cell"),g.classList.add("e-checkbox-disabled"),this.parent.cssClass&&(0,o.addClass)([g],[this.parent.cssClass]),a.appendChild(g)}if(a.classList.contains("e-summarycell")&&!t.key){var m=a.getAttribute("data-mappinguid");l=this.parent.getColumnByUid(m),a.setAttribute("aria-label",h+this.localizer.getConstant("ColumnHeader")+e.column.headerText)}return this.parent.isFrozenGrid()&&(!t||t&&!t.key)&&yh(this.parent,l,a),a},e.prototype.appendHtml=function(e,t,i){return void 0===i&&(i="innerHTML"),e[""+i]=t,e},e.prototype.setAttributes=function(e,t,i){var n=t.column;if(this.buildAttributeFromCell(e,t,"checkbox"===n.type),qa(e,i),qa(e,t.attributes),n.customAttributes&&qa(e,n.customAttributes),"Vertical"===this.parent.rowRenderingMode&&qa(e,{"data-cell":n.headerText}),n.textAlign){var r={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"};r[n.textAlign.toLowerCase()]&&e.classList.add(r[n.textAlign.toLowerCase()])}"Clip"===n.clipMode||!n.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):"EllipsisWithTooltip"!==n.clipMode&&(n.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode||this.parent.allowTextWrap&&("Content"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))||"checkbox"!==n.type&&e.classList.add("e-ellipsistooltip")},e.prototype.buildAttributeFromCell=function(e,i,n){var r={},s=[];i.colSpan&&(r.colSpan=i.colSpan),i.rowSpan&&(r.rowSpan=i.rowSpan),i.isTemplate&&s.push("e-templatecell"),i.isSelected&&(s.push.apply(s,["e-selectionbackground","e-active"]),n&&e.querySelector(".e-frame").classList.add("e-check")),i.isColumnSelected&&s.push.apply(s,["e-columnselection"]),i.cellType===t.Header?r[xs]=i.colIndex+1:(0,o.isNullOrUndefined)(i.index)||(r[xs]=i.index+1),i.visible||s.push("e-hide"),r.class=s,qa(e,r)},e.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)},e}(),eo=function(){function e(){}return e.prototype.setOptions=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)to(e,io[i[parseInt(n.toString(),10)]],t[i[parseInt(n.toString(),10)]])},e.prototype.setExpand=function(e,t){to(e,io.expand,t)},e.prototype.setSort=function(e,t){to(e,io.sort,t,"boolean"==typeof t)},e.prototype.setBusy=function(e,t){to(e,io.busy,t),to(e,io.invalid,null,!0)},e.prototype.setGrabbed=function(e,t,i){to(e,io.grabbed,t,i)},e.prototype.setDropTarget=function(e,t){to(e,io.dropeffect,"copy",!t)},e}();function to(e,t,i,n){n&&e?e.removeAttribute(t):e&&e.setAttribute(t,i)}var io={expand:"aria-expanded",role:"role",datarole:"data-role",selected:"aria-selected",multiselectable:"aria-multiselectable",sort:"aria-sort",busy:"aria-busy",invalid:"aria-invalid",grabbed:"aria-grabbed",dropeffect:"aria-dropeffect",haspopup:"aria-haspopup",level:"aria-level",colcount:"aria-colcount",rowcount:"aria-rowcount"},no=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ro=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell",attrs:{tabindex:"-1",role:"columnheader"}}),t.ariaService=new eo,t.hTxtEle=t.parent.createElement("span",{className:"e-headertext"}),t.sortEle=t.parent.createElement("div",{className:"e-sortfilterdiv e-icons",attrs:{"aria-hidden":"true"}}),t.gui=t.parent.createElement("div"),t.chkAllBox=t.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox","aria-label":t.localizer.getConstant("SelectAllCheckbox")}}),t}return no(t,e),t.prototype.getGui=function(){return this.gui.cloneNode()},t.prototype.render=function(e,t,i){var n=this.element.cloneNode(),r=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,n,r)},t.prototype.refresh=function(e,t){this.clean(t);var i=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,t,i)},t.prototype.clean=function(e){e.innerHTML=""},t.prototype.prepareHeader=function(e,t,i){var n,r,s=e.column,a={},l="",h=this.getGui(),d=this.parent.createElement("div",{className:"e-headercell-container"});if((0,o.attributes)(h,{"data-mappinguid":s.uid,class:"e-headercelldiv"}),(0,o.isNullOrUndefined)(s.headerValueAccessor)||(n=this.getValue(s.headerText,s)),this.parent.rowHeight&&this.parent.allowSorting&&s.allowSorting&&!(0,o.isNullOrUndefined)(s.field)&&t.classList.add("e-sort-icon"),"checkbox"!==s.type){var p=s.headerText;(0,o.isNullOrUndefined)(n)||(p=n);var c=this.hTxtEle.cloneNode();c[s.getDomSetter()]=this.parent.sanitize(p),h.appendChild(c)}else{s.editType="booleanedit";var u=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "});this.chkAllBox.id="checkbox-"+s.uid,u.insertBefore(this.chkAllBox.cloneNode(),u.firstChild),this.parent.cssClass&&(0,o.addClass)([u],[this.parent.cssClass]),h.appendChild(u),h.classList.add("e-headerchkcelldiv"),d.classList.add("e-header-checkbox")}if(this.buildAttributeFromCell(t,e),d.appendChild(h),d.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&s.allowFiltering&&!(0,o.isNullOrUndefined)(s.field)&&(!this.parent.showColumnMenu||!s.showColumnMenu)){(0,o.attributes)(i,{"data-mappinguid":"e-flmenu-"+s.uid}),l=l.length?l+". "+this.localizer.getConstant("FilterDescription"):this.localizer.getConstant("FilterDescription"),t.classList.add("e-fltr-icon");var g=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==g.length)for(var f=this.parent.getForeignKeyColumns(),m=0;m<this.parent.columns.length;m++)for(var y=0;y<this.parent.filterSettings.columns.length;y++)if(this.parent.filterSettings.columns[parseInt(y.toString(),10)].field===s.field||f.length&&s.foreignKeyValue===this.parent.filterSettings.columns[parseInt(y.toString(),10)].field){i.classList.add("e-filtered"),g.push(s.field);break}d.appendChild(i.cloneNode())}this.appendHtml(t,d),e.className&&t.classList.add(e.className),s.customAttributes&&qa(t,s.customAttributes),this.parent.allowSorting&&s.allowSorting&&(a.sort="none",l=l.length?l+". "+this.localizer.getConstant("SortDescription"):this.localizer.getConstant("SortDescription")),(this.parent.allowGrouping&&s.allowGrouping||this.parent.allowReordering&&s.allowReordering)&&(a.grabbed=!1,l=l.length?l+". "+this.localizer.getConstant("GroupDescription"):this.localizer.getConstant("GroupDescription")),this.parent.showColumnMenu&&"checkbox"!==s.type&&!s.template&&(l=l.length?l+". "+this.localizer.getConstant("ColumnMenuDescription"):this.localizer.getConstant("ColumnMenuDescription")),t=this.extendPrepareHeader(s,t);var v=this.parent,S=v.getColumnIndexByField(s.field);if(!(0,o.isNullOrUndefined)(s.headerTemplate)){var C=v.element.id+s.uid+"headerTemplate",w="isStringTemplate",b=s,I=this.parent.isReact&&"string"!=typeof s.headerTemplate&&!(s.headerTemplate.prototype&&s.headerTemplate.prototype.CSPTemplate),R=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,D=this.parent.printGridParent&&this.parent.printGridParent.isReact,T=this.parent.createElement("div",{className:"e-headertext"}),E=t.querySelector(".e-headercelldiv");if(I||R||D){var O={index:S};t.querySelector(".e-headertext")&&t.querySelector(".e-headertext").remove(),E.appendChild(T),s.getHeaderTemplate()((0,o.extend)(O,b),v,"headerTemplate",C,this.parent[""+w],null,E.querySelector(".e-headertext")),this.parent.renderTemplates()}else r=s.getHeaderTemplate()((0,o.extend)({index:S},b),v,"headerTemplate",C,this.parent[""+w],void 0,void 0,this.parent.root),E.innerHTML="",!(0,o.isNullOrUndefined)(r)&&r[0]&&r[0].classList&&r[0].classList.contains("e-headertext")?$a(E,r):($a(T,r),E.appendChild(T))}if(this.ariaService.setOptions(t,a),!(0,o.isNullOrUndefined)(s.headerTextAlign)||!(0,o.isNullOrUndefined)(s.textAlign)){var k=s.headerTextAlign||s.textAlign;"right"===k.toLowerCase()||"left"===k.toLowerCase()?t.classList.add("right"===k.toLowerCase()?"e-rightalign":"e-leftalign"):"center"===k.toLowerCase()?t.classList.add("e-centeralign"):"justify"===k.toLowerCase()&&t.classList.add("e-justifyalign")}if("Clip"===s.clipMode||!s.clipMode&&"Clip"===this.parent.clipMode?t.classList.add("e-gridclip"):"EllipsisWithTooltip"!==s.clipMode&&(s.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode)||v.allowTextWrap&&("Header"===v.textWrapSettings.wrapMode||"Both"===v.textWrapSettings.wrapMode)||"checkbox"!==s.type&&t.classList.add("e-ellipsistooltip"),l){var A=this.parent.createElement("span",{id:"headerTitle-"+s.uid,innerHTML:l});A.style.display="none",d.appendChild(A),t.setAttribute("aria-describedby",A.id)}t.setAttribute("aria-rowspan",((0,o.isNullOrUndefined)(e.rowSpan)?1:e.rowSpan).toString()),t.setAttribute("aria-colspan","1");var F=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;if((this.parent.isReact&&this.parent.requireTemplateRef||F&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&!(0,o.isNullOrUndefined)(s.headerTemplate)){var M=this;M.parent.renderTemplates(function(){var i=t.querySelectorAll(".e-headertext");if(i)for(var n=1;n<i.length;n++)i[parseInt(n.toString(),10)].classList.remove("e-headertext");M.parent.trigger(x,{cell:e,node:t})})}else this.parent.trigger(x,{cell:e,node:t});return this.parent.isFrozenGrid()&&yh(this.parent,s,t),t},t.prototype.getValue=function(e,t){return t.headerValueAccessor(e,t)},t.prototype.extendPrepareHeader=function(e,t){if(this.parent.showColumnMenu&&e.showColumnMenu&&!(0,o.isNullOrUndefined)(e.field)){var i=this.parent.createElement("div",{className:"e-icons e-columnmenu",attrs:{"aria-hidden":"true"}}),n=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==n.length)for(var r=0;r<this.parent.columns.length;r++)for(var s=0;s<this.parent.filterSettings.columns.length;s++)if(this.parent.filterSettings.columns[parseInt(s.toString(),10)].field===e.field){i.classList.add("e-filtered"),n.push(e.field);break}t.classList.add("e-fltr-icon"),t.querySelector(".e-headercell-container").appendChild(i)}if(this.parent.allowResizing){var a=this.parent.createElement("div");a.className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",t.appendChild(a)}return t},t.prototype.appendHtml=function(e,t){return e.appendChild(t),e},t}($s),so=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{tabindex:"-1",role:"columnheader"}}),t}return so(t,e),t.prototype.render=function(e,t,i){var n=this.element.cloneNode(),r=this.parent.createElement("div",{className:"e-headercell-container e-stacked-header"}),s=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"data-mappinguid":e.column.uid}}),a=e.column;if(r.appendChild(s),n.appendChild(r),(0,o.isNullOrUndefined)(a.headerTemplate)?this.appendHtml(s,this.parent.sanitize(a.headerText),a.getDomSetter()):$a(s,a.getHeaderTemplate()(a,this.parent,"headerTemplate",null,null,null,null,this.parent.root)),e.column.toolTip&&n.setAttribute("title",e.column.toolTip),"Clip"===a.clipMode||!a.clipMode&&"Clip"===this.parent.clipMode?n.classList.add("e-gridclip"):("EllipsisWithTooltip"===a.clipMode||!a.clipMode&&"EllipsisWithTooltip"===this.parent.clipMode)&&n.classList.add("e-ellipsistooltip"),!(0,o.isNullOrUndefined)(e.column.textAlign)){var l={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"};l[e.column.textAlign.toLowerCase()]&&n.classList.add(l[e.column.textAlign.toLowerCase()])}if(e.column.customAttributes&&qa(n,e.column.customAttributes),n.setAttribute("colspan",e.colSpan.toString()),n.setAttribute("aria-colspan",e.colSpan.toString()),n.setAttribute("aria-rowspan","1"),this.parent.allowResizing){var h=this.parent.createElement("div");h.className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",n.appendChild(h)}if(e.className&&n.classList.add(e.className),this.parent.trigger(x,{cell:e,node:n}),"Left"===ch(a))if(n.classList.add("e-leftfreeze"),"Left"===a.border&&n.classList.add("e-freezeleftborder"),0===a.index)gh(n,30*this.parent.getIndentCount(),this.parent.enableRtl,"Left");else{for(var d=this.parent.getColumns(),p=30*this.parent.getIndentCount(),c=0;c<d.length&&!(a.index<d[parseInt(c.toString(),10)].index);c++)d[parseInt(c.toString(),10)].visible&&(p+=parseFloat(d[parseInt(c.toString(),10)].width.toString()));gh(n,p,this.parent.enableRtl,"Left")}else if("Right"===ch(a)){n.classList.add("e-rightfreeze");for(d=this.parent.getColumns(),p="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,c=d.length-1;c>=0&&!(dh(a,d[parseInt(c.toString(),10)].uid)||a.index>d[parseInt(c.toString(),10)].index);c--)d[parseInt(c.toString(),10)].visible&&(p+=parseFloat(d[parseInt(c.toString(),10)].width.toString()));gh(n,p,this.parent.enableRtl,"Right"),"Right"===a.border&&n.classList.add("e-freezerightborder")}else if("Fixed"===ch(a)){n.classList.add("e-fixedfreeze");d=this.parent.getColumns(),p=0;this.parent.getVisibleFrozenLeftCount()?p=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(p=30*this.parent.groupSettings.columns.length);for(c=0;c<d.length;c++)a.index>d[parseInt(c.toString(),10)].index&&("Left"===d[parseInt(c.toString(),10)].freeze||d[parseInt(c.toString(),10)].isFrozen||"Fixed"===d[parseInt(c.toString(),10)].freeze)&&d[parseInt(c.toString(),10)].visible&&(p+=parseFloat(d[parseInt(c.toString(),10)].width.toString()));gh(n,p-1,this.parent.enableRtl,"Left"),p="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0;for(c=d.length-1;c>=0;c--)if(a.index<d[parseInt(c.toString(),10)].index){if(dh(a,d[parseInt(c.toString(),10)].uid)||a.index>d[parseInt(c.toString(),10)].index)break;"Right"!==d[parseInt(c.toString(),10)].freeze&&"Fixed"!==d[parseInt(c.toString(),10)].freeze||d[parseInt(c.toString(),10)].visible&&(p+=parseFloat(d[parseInt(c.toString(),10)].width.toString()))}gh(n,p-1,this.parent.enableRtl,"Right")}else n.classList.add("e-unfreeze");return n},t}($s),ao=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-indentcell"}),t}return ao(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return qa(i,e.attributes),i},t}($s),ho=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),po=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.cellUid=0,t.element=t.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:t.parent.element.id+"captioncell",tabindex:"-1"}}),t}return ho(i,e),i.prototype.render=function(e,i){this.element.id=this.parent.element.id+"captioncell"+this.cellUid++;var n,r,s,a=this.element.cloneNode(),l=this.parent,h=e.column,d=h.getDomSetter?h.getDomSetter():"innerHTML";i.headerText=e.column.headerText,e.isForeignKey&&(r=this.format(e.column,e.column.valueAccessor("foreignKey",i,e.column)));for(var p=e.isForeignKey?r:e.column.enableGroupByFormat?i.key:this.format(e.column,e.column.valueAccessor("key",i,e.column)),c=0;c<l.aggregates.length;c++)for(var u=function(e){if(l.getVisibleColumns()[0].field===l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)].field&&l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate){var n=l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate;if("string"==typeof n&&n.includes("$"))s=l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate.split("$")[0]+i[l.getVisibleColumns()[0].field][l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)].type]+l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate.split("}")[1];else{var r=l.aggregates[parseInt(c.toString(),10)].columns[parseInt(e.toString(),10)],h=r.getTemplate(t.CaptionSummary);if(!(0,o.isNullOrUndefined)(h)){var d=h.fn(i[r.columnName],g.parent,h.property,""),p=g.parent.printGridParent&&g.parent.printGridParent.isReact;(g.parent.isReact||p)&&"string"!=typeof r.groupCaptionTemplate?g.parent.renderTemplates(function(){d&&d.length&&((0,o.isNullOrUndefined)(l.groupSettings.captionTemplate)?a.innerText+=" "+d[0].textContent:a.appendChild(d[0]))}):d&&d.length&&(s=(0,o.isNullOrUndefined)(l.groupSettings.captionTemplate)?d[0].textContent:d)}}return"break"}},g=this,f=0;f<l.aggregates[parseInt(c.toString(),10)].columns.length;f++){if("break"===u(f))break}if((0,o.isNullOrUndefined)(l.groupSettings.captionTemplate))l.groupSettings.enableLazyLoading?a[""+d]=this.parent.sanitize(e.column.headerText)+": "+this.parent.sanitize(p)+(s?" "+s:""):a[""+d]=this.parent.sanitize(e.column.headerText)+": "+this.parent.sanitize(p)+" - "+i.count+" "+(i.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"))+(s?" "+s:"");else{var m=this.parent.isReact&&"string"!=typeof l.groupSettings.captionTemplate&&!(l.groupSettings.captionTemplate.prototype&&l.groupSettings.captionTemplate.prototype.CSPTemplate),y=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,v=this.parent.printGridParent&&this.parent.printGridParent.isReact;if(m||y||v){var S=l.element.id+"captionTemplate";i.groupKey=i.key,za(l.groupSettings.captionTemplate)(i,this.parent,"captionTemplate",S,null,null,a),this.parent.renderTemplates()}else n=this.parent.isVue||l.parentDetails&&l.parentDetails.parentInstObj&&l.parentDetails.parentInstObj.isVue?za(l.groupSettings.captionTemplate)(i,this.parent,"captionTemplate",null,null,null,null,l.root):za(l.groupSettings.captionTemplate)(i);m||y||v||($a(a,n),s&&s.length&&s[0].textContent&&a.appendChild(s[0]))}return a.setAttribute("colspan",e.colSpan.toString()),a.setAttribute("aria-label",a.innerHTML+this.localizer.getConstant("GroupCaption")),a.setAttribute("title",a.textContent),a},i}($s),co=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-groupcaption"}),t}return ho(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML=" ",i.setAttribute("colspan",e.colSpan.toString()),i},t}($s),uo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),go=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return uo(i,e),i.prototype.render=function(e,i,n,r){var s=this.element.cloneNode();return s.setAttribute("data-mappingname",i.field),s.setAttribute("data-mappingvalue",i.key),s.setAttribute("aria-expanded",r?"true":"false"),s.setAttribute("tabindex","-1"),this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?(e.cellType=t.Indent,s.className=r?"e-recordplusexpand e-disablepointer":"e-recordpluscollapse e-disablepointer"):(s.className=r?"e-recordplusexpand":"e-recordpluscollapse",s.appendChild(this.parent.createElement("a",{className:r?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow",attrs:{href:"#",title:r?this.localizer.getConstant("Expanded"):this.localizer.getConstant("Collapsed")}}))),s},i}(lo),fo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-grouptopleftcell"}),t}return fo(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-headercelldiv e-emptycell",innerHTML:""})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan&&(i.style.display="none")),i},t}($s),yo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-detailheadercell"}),t}return yo(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan&&(i.style.display="none")),i},t}($s),So=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Co=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",tabindex:"-1"}}),t}return So(t,e),t.prototype.render=function(e,t,i){var n=this.element.cloneNode();return i&&!(0,o.isNullOrUndefined)(i.class)?(n.className="",n.className=i.class,n.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow",attrs:{href:"#",title:this.localizer.getConstant("Expanded")}}))):n.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonalright e-icon-grightarrow",attrs:{href:"#",title:this.localizer.getConstant("Collapsed")}})),e.isSelected&&n.classList.add("e-selectionbackground","e-active"),n},t}($s),wo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-rowdragdrop e-rowdragdropcell",attrs:{tabindex:"-1",role:"gridcell"}}),t}return wo(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();(i.appendChild(this.parent.createElement("div",{className:"e-icons e-rowcelldrag e-dtdiagonalright e-icon-rowdragicon",attrs:{"aria-hidden":"true"}})),e.isSelected&&(i.classList.add("e-selectionbackground"),i.classList.add("e-active")),this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),gh(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left"));return i},t}($s),Io=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-rowdragheader"}),t}return Io(t,e),t.prototype.render=function(e,t){var i=this.element.cloneNode();(i.appendChild((0,o.createElement)("div",{className:"e-emptycell"})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan&&(i.style.display="none")),this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),gh(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left"));return i},t}($s),Ro=function(){function e(e,t){this.emptyGrid=!1,this.counter=0,this.selectableDataKey={},this.nonselectableDataKey={},this.isFirstColumnHidden=!1,this.parent=e,this.locator=t,this.data=new Zr(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}return e.prototype.render=function(){var e=this.parent;this.headerRenderer=this.renderer.getRenderer(i.Header),this.contentRenderer=this.renderer.getRenderer(i.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),e.getColumns().length&&(this.isLayoutRendered=!0,this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.emptyRow(!1)),this.parent.scrollModule.setWidth(),this.parent.scrollModule.setHeight(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),this.refreshDataManager()},e.prototype.refresh=function(e){var t=this;void 0===e&&(e={requestType:"refresh"});var i=this.parent;i.notify(e.requestType+"-begin",e),i.trigger(R,e,function(n){if(void 0===n&&(n={requestType:"refresh"}),n.cancel){if(i.notify(Li,n),"clearFilter"===n.action&&"Menu"===t.parent.filterSettings.type){t.parent.filterSettings.columns[t.parent.filterModule.filterObjIndex]=t.parent.filterModule.prevFilterObject;var r=t.parent.showColumnMenu&&t.parent.filterModule.column.showColumnMenu?".e-columnmenu":".e-icon-filter",s=t.parent.element.querySelector('[data-mappinguid="'+t.parent.filterModule.column.uid+'"]').parentElement.querySelector(r);(0,o.isNullOrUndefined)(t.parent.filterModule.prevFilterObject)||s.classList.add("e-filtered")}if("clear-filter"!==n.action||"CheckBox"!==t.parent.filterSettings.type&&"Excel"!==t.parent.filterSettings.type||(t.parent.filterSettings.columns=t.parent.filterModule.checkboxPrevFilterObject),"grouping"===n.requestType){var a=i.groupSettings.columns.indexOf(n.columnName);if(-1!==a){i.setProperties({groupSettings:{Columns:i.groupSettings.columns.splice(a,1)}},!0),i.setProperties({sortSettings:{Columns:i.sortSettings.columns.splice(a,1)}},!0);var l=i.getColumnByField(n.columnName),h=i.getColumnHeaderByField(l.field);l.visible=!(0,o.isNullOrUndefined)(h)&&!h.classList.contains("e-hide")}}}else{e&&e.pageSize&&e.previousPageSize&&e.pageSize!==e.previousPageSize&&t.parent.getDataModule().clearCache(),t.parent.notify(Qr,n),"virtualscroll"===n.requestType&&(t.parent.getDataModule().isRemote()||"result"in t.parent.dataSource)&&n.virtualInfo&&"down"===n.virtualInfo.direction&&(t.parent.contentModule.prevInfo=n.virtualInfo),t.parent.groupModule&&n.preventFocusOnGroup&&(t.parent.groupModule.preventFocusOnGroup=n.preventFocusOnGroup);if(!i.allowSelection||-1===["filter","clearFilter","clear-filter","add"].indexOf(n.action)&&-1===["searching","sorting","grouping","ungrouping","delete"].indexOf(n.requestType)||(i.selectionModule.rmtHdrChkbxClicked=!1,i.selectionModule.isPartialSelection&&(i.selectionModule.isHdrSelectAllClicked=!1)),i.allowPaging&&i.pageSettings.pageSizes&&i.pagerModule.pagerObj.isAllPage&&"add"===n.action&&"save"===n.requestType&&i.pagerModule.pagerObj.checkAll&&i.setProperties({pageSettings:{pageSize:i.pageSettings.pageSize+1}},!0),"delete"===n.requestType&&i.allowPaging){var d=n.data.length,p=i.pageSettings.totalRecordsCount-d;(!(i.getCurrentViewRecords().length-d)&&p&&(i.pageSettings.currentPage-1)*i.pageSettings.pageSize===p||p&&p<=d)&&(i.prevPageMoving=!0,i.setProperties({pageSettings:{totalRecordsCount:p,currentPage:Math.ceil(p/i.pageSettings.pageSize)}},!0),i.pagerModule.pagerObj.totalRecordsCount=p)}"reorder"===n.requestType&&t.parent.dataSource&&"result"in t.parent.dataSource||("paging"===n.requestType||"columnstate"===n.requestType||"reorder"===n.requestType)&&t.parent.groupSettings.enableLazyLoading&&t.parent.groupSettings.columns.length&&(t.parent.enableVirtualization?t.parent.lazyLoadRender:t.parent.contentModule).getGroupCache()[t.parent.pageSettings.currentPage]?t.contentRenderer.refreshContentRows(n):t.refreshDataManager(n)}})},e.prototype.resetTemplates=function(){var e=this.parent,t=e.getColumns();if(e.detailTemplate){var i=e.element.id+"detailTemplate";o.blazorTemplates[""+i]=[],(0,o.resetBlazorTemplate)(i,"DetailTemplate")}e.groupSettings.captionTemplate&&(0,o.resetBlazorTemplate)(e.element.id+"captionTemplate","CaptionTemplate"),e.rowTemplate&&(0,o.resetBlazorTemplate)(e.element.id+"rowTemplate","RowTemplate"),e.toolbarTemplate&&(0,o.resetBlazorTemplate)(e.element.id+"toolbarTemplate","ToolbarTemplate"),e.pageSettings.template&&(0,o.resetBlazorTemplate)(e.element.id+"_template","pageSettings");for(var n=0;n<t.length;n++)t[parseInt(n.toString(),10)].template&&(o.blazorTemplates[e.element.id+t[parseInt(n.toString(),10)].uid]=[],(0,o.resetBlazorTemplate)(e.element.id+t[parseInt(n.toString(),10)].uid,"Template")),t[parseInt(n.toString(),10)].headerTemplate&&(0,o.resetBlazorTemplate)(e.element.id+t[parseInt(n.toString(),10)].uid+"headerTemplate","HeaderTemplate"),t[parseInt(n.toString(),10)].filterTemplate&&(0,o.resetBlazorTemplate)(e.element.id+t[parseInt(n.toString(),10)].uid+"filterTemplate","FilterTemplate");for(var r="guid",s=0;s<e.aggregates.length;s++)for(var a=0;a<e.aggregates[parseInt(s.toString(),10)].columns.length;a++){if(e.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)].footerTemplate){var l=e.element.id+e.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)][""+r]+"footerTemplate";(0,o.resetBlazorTemplate)(l,"FooterTemplate")}if(e.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)].groupFooterTemplate){l=e.element.id+e.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)][""+r]+"groupFooterTemplate";(0,o.resetBlazorTemplate)(l,"GroupFooterTemplate")}if(e.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)].groupCaptionTemplate){l=e.element.id+e.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)][""+r]+"groupCaptionTemplate";(0,o.resetBlazorTemplate)(l,"GroupCaptionTemplate")}}},e.prototype.refreshComplete=function(e){this.parent.trigger(D,e)},e.prototype.refreshDataManager=function(e){var t=this;void 0===e&&(e={});var i=this.parent,n=this.parent.getColumns();n&&n.length&&!n[0].visible?this.isFirstColumnHidden=!0:this.isFirstColumnHidden=!1;var r,s="Shimmer"===i.loadingIndicator.indicatorType&&"virtualscroll"!==e.requestType&&"infiniteScroll"!==e.requestType||("virtualscroll"===e.requestType||"infiniteScroll"===e.requestType)&&i.enableVirtualMaskRow;"virtualscroll"===e.requestType||e.isCaptionCollapse||s||this.parent.showSpinner(),s&&i.showMaskRow("virtualscroll"===e.requestType?e.virtualInfo.sentinelInfo.axis:"infiniteScroll"===e.requestType?e.direction:void 0),this.parent.notify(Cn,e),this.emptyGrid=!1;var o=this.isNeedForeignAction();if(this.ariaService.setBusy(this.parent.getContent().querySelector("."+ps),!0),o){var l=new a.Deferred;r=this.getFData(l,e)}r?r=r.then(function(i){var n=t.data.generateQuery().requiresCount();if(t.emptyGrid){var r=new a.Deferred;return r.resolve({result:[],count:0}),r.promise}return t.data.getData(e,n)}):(i.allowPaging&&!i.getDataModule().dataManager.dataSource.offline&&i.pageSettings&&i.pageSettings.pageSizes&&i.pagerModule&&i.pagerModule.pagerObj&&i.pagerModule.pagerObj.isAllPage&&(i.pagerModule.pagerObj.isAllPage=void 0),r=this.data.getData(e,this.data.generateQuery().requiresCount()));var h=this.parent.getForeignKeyColumns(),d=h.length;if("ExcludeHidden"===this.parent.columnQueryMode&&d&&(d=h.filter(function(e){return!1!==e.visible}).length),d&&(!o||this.parent.searchSettings.key.length)){var p=new a.Deferred;r=r.then(function(i){return t.parent.notify(bi,{dataManager:r,result:i,promise:p,action:e}),p.promise})}this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&(r=r.then(function(e){return t.validateGroupRecords(e)})),r.then(function(i){return t.dataManagerSuccess(i,e)}).catch(function(i){return t.dataManagerFailure(i,e)})},e.prototype.getFData=function(e,t){return this.parent.notify(bi,{isComplex:!0,promise:e,action:t}),e.promise},e.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||!(0,o.isNullOrUndefined)(e.searchSettings.key)&&e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},e.prototype.foreignKey=function(e){var t=this;return e.some(function(e){return!(!t.parent.filterSettings.columns.some(function(t){return e.uid===t.uid})&&!t.parent.searchSettings.key.length)})},e.prototype.sendBulkRequest=function(e){var t=this;e.requestType="batchsave";var i=this.parent;if(i.allowPaging&&i.pageSettings.pageSizes&&i.pagerModule.pagerObj.isAllPage&&i.pagerModule.pagerObj.checkAll){var n=e.changes.addedRecords.length;n&&i.setProperties({pageSettings:{pageSize:i.pageSettings.pageSize+n}},!0)}i.allowPaging&&(e.changes.addedRecords.length||e.changes.deletedRecords.length||e.changes.changedRecords.length)&&i.pageSettings&&i.pageSettings.pageSizes&&i.pagerModule&&i.pagerModule.pagerObj&&!i.getDataModule().dataManager.dataSource.offline&&i.pagerModule.pagerObj.isAllPage&&(i.pagerModule.pagerObj.isAllPage=void 0);var r=this.data.saveChanges(e.changes,this.parent.getPrimaryKeyFieldNames()[0],e.original),s=this.data.generateQuery().requiresCount();this.data.dataManager.dataSource.offline?this.refreshDataManager({requestType:"batchsave"}):r.then(function(i){t.data.getData(e,s).then(function(i){return t.dmSuccess(i,e)}).catch(function(i){return t.dmFailure(i,e)})}).catch(function(i){return t.dmFailure(i,e)})},e.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},e.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},e.prototype.renderEmptyRow=function(){this.emptyRow(!0)},e.prototype.emptyRow=function(e){var t=this.parent,i=this.contentRenderer.getTable().querySelector(Ds);(0,o.isNullOrUndefined)(i)||(0,o.remove)(i),i=this.parent.createElement(Ds,{attrs:{role:"rowgroup"}});var n=t.allowRowDragAndDrop&&(0,o.isNullOrUndefined)(t.rowDropSettings.targetID)?1:0;(t.detailTemplate||t.childGrid)&&++n;var r,s=t.editSettings.showAddNewRow&&"Bottom"===t.editSettings.newRowPosition?"e-emptyrow e-show-added-row":"e-emptyrow",a=this.parent.createElement("tr",{className:s,attrs:{role:"row"}});if(t.emptyRecordTemplate){var l=t.element.id+"emptyRecordTemplate";r=this.parent.createElement("td",{attrs:{colspan:(t.getVisibleColumns().length+n+t.groupSettings.columns.length).toString()}}),t.isVue||t.parentDetails&&t.parentDetails.parentInstObj&&t.parentDetails.parentInstObj.isVue?r.appendChild(t.getEmptyRecordTemplate()(t.dataSource,t,"emptyRecordTemplate",l,void 0,void 0,void 0,this.parent.root)[1]):r.appendChild(t.getEmptyRecordTemplate()(t.dataSource,t,"emptyRecordTemplate",l,void 0,void 0,void 0,this.parent.root)[0]),t.isReact&&this.parent.renderTemplates()}else r=this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(t.getVisibleColumns().length+n+((0,o.isNullOrUndefined)(t.groupSettings.columns)?0:t.groupSettings.columns.length)).toString()}});t.isFrozenGrid()&&(r.classList.add("e-leftfreeze"),r.style.left="0px"),(t.frozenRows||t.pinnedTopRowModels.length)&&t.element.querySelector(".e-frozenrow-border")&&this.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty"),a.appendChild(r),i.appendChild(a),this.contentRenderer.renderEmpty(i),e&&(!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.trigger(E,{}),this.parent.notify(ze,{rows:[new $r({isDataRow:!0,cells:[new es({isDataCell:!0,visible:!0})]})]}),t.editSettings.showAddNewRow&&(t.addRecord(),this.parent.notify(jr,{})))},e.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},e.prototype.updateColumnType=function(e){for(var t,i=this.parent.enableColumnVirtualization?this.parent.columns:this.parent.getColumns(),n="customFormat",r="equalTo",s=e&&e.items?e.items[0]:e,a=this.locator.getService("valueFormatter"),h=0,d=i.length;h<d;h++){t=Ml(i[parseInt(h.toString(),10)].field||"",s),(0,o.isNullOrUndefined)(i[parseInt(h.toString(),10)][""+n])||(i[parseInt(h.toString(),10)].format=i[parseInt(h.toString(),10)][""+n]),(0,o.isNullOrUndefined)(i[parseInt(h.toString(),10)].validationRules)||(0,o.isNullOrUndefined)(i[parseInt(h.toString(),10)].validationRules[""+r])||(i[parseInt(h.toString(),10)].validationRules[""+r][0]=this.parent.element.id+i[parseInt(h.toString(),10)].validationRules[""+r][0]),i[parseInt(h.toString(),10)].isForeignColumn()&&i[parseInt(h.toString(),10)].columnData&&(t=Ml(i[parseInt(h.toString(),10)].foreignKeyValue||"",i[parseInt(h.toString(),10)].columnData[0])),(0,o.isNullOrUndefined)(t)?i[parseInt(h.toString(),10)].type=i[parseInt(h.toString(),10)].type||null:(this.isColTypeDef=!0,i[parseInt(h.toString(),10)].type||(i[parseInt(h.toString(),10)].type=t.getDay?t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0||t.getMilliseconds()>0?"datetime":"date":typeof t));var p=new l;i[parseInt(h.toString(),10)].format&&(i[parseInt(h.toString(),10)].format.skeleton||i[parseInt(h.toString(),10)].format.format&&"string"==typeof i[parseInt(h.toString(),10)].format.format)&&(!i[parseInt(h.toString(),10)].format.skeleton&&!i[parseInt(h.toString(),10)].format.format||!(0,o.isNullOrUndefined)(i[parseInt(h.toString(),10)].format.type)||"date"!==i[parseInt(h.toString(),10)].type&&"datetime"!==i[parseInt(h.toString(),10)].type||(i[parseInt(h.toString(),10)].format.type="date"===i[parseInt(h.toString(),10)].type?"date":"dateTime"),i[parseInt(h.toString(),10)].setFormatter(p.getFormatFunction((0,o.extend)({},i[parseInt(h.toString(),10)].format))),i[parseInt(h.toString(),10)].setParser(p.getParserFunction(i[parseInt(h.toString(),10)].format))),"string"==typeof i[parseInt(h.toString(),10)].format?yl(this.locator,i[parseInt(h.toString(),10)]):i[parseInt(h.toString(),10)].format||"number"!==i[parseInt(h.toString(),10)].type||i[parseInt(h.toString(),10)].setParser(a.getParserFunction({format:"n2"})),"dateonly"!==i[parseInt(h.toString(),10)].type||i[parseInt(h.toString(),10)].format||(i[parseInt(h.toString(),10)].format="yMd",yl(this.locator,i[parseInt(h.toString(),10)]))}},e.prototype.dataManagerSuccess=function(e,t){var n=this,r=this.parent;this.contentRenderer=this.renderer.getRenderer(i.Content),this.headerRenderer=this.renderer.getRenderer(i.Header),e.actionArgs=t;var s=!(!r.childGrid&&!r.detailTemplate),l=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&!r.groupSettings.enableLazyLoading&&("delete"===t.requestType&&!s||"save"===t.requestType&&"add"===this.parent.infiniteScrollModule.requestType&&!(r.sortSettings.columns.length||r.filterSettings.columns.length||this.parent.groupSettings.columns.length||r.searchSettings.key||s));r.trigger(fe,e,function(i){if(!i.cancel){i.result=(0,o.isNullOrUndefined)(i.result)?[]:i.result;var s=Object.keys(i.result).length;if(!n.parent.isDestroyed)if(r.getColumns().length||s||r.columns.length&&r.columns[0]instanceof p){if(r.isRowSelectable){var h={e:i,isResetPartialRecords:!1};if(r.notify(Jr,h),!r.isInitialLoad||n.parent.isRemote()||"add"===t.action&&"save"===t.requestType||"batchsave"===t.requestType||h.isResetPartialRecords){var d=r.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(r.dataSource)&&r.dataSource.result?i.result:r.getDataModule().dataManager.executeLocal(r.getDataModule().generateQuery(!0));r.isTreeGrid&&!n.parent.isRemote()?n.resetPartialRecords():n.setPartialRecord(d)}}if(r.isRowPinned&&(!r.isInitialLoad||r.getDataModule().isRemote()&&t.requestType&&-1!==["virtualscroll","infiniteScroll","grouping","paging","sorting","filtering"].indexOf(t.requestType))){d=r.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(r.dataSource)&&r.dataSource.result?i.result:r.dataSource;for(var c=n.parent.getPrimaryKeyFieldNames()[0],u=0;u<d.length;u++){var g=d[parseInt(u.toString(),10)];!r.pinnedTopRowKeys[g[""+c]]&&r.isRowPinned(g)&&(r.pinnedTopRecords.push(g),r.pinnedTopRowKeys[d[parseInt(u.toString(),10)][""+c]]=!0)}r.getDataModule().pinnedData=new a.DataManager(r.pinnedTopRecords)}if(!n.parent.isReact||(0,o.isNullOrUndefined)(t)||"infiniteScroll"===t.requestType&&!n.parent.infiniteScrollSettings.enableCache||t.isFrozen)n.extendDataManagerSuccess(e,t,s,i,l);else{var f=["columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"];"infiniteScroll"===t.requestType&&n.parent.infiniteScrollSettings.enableCache&&(f=["columnTemplate","commandsTemplate"]),Ah(n.parent,f,function(){n.extendDataManagerSuccess(e,t,s,i,l)})}}else r.hideSpinner()}})},e.prototype.resetPartialRecords=function(){if(this.parent.isRowSelectable)if(this.parent.isRemote())this.selectableDataKey={},this.nonselectableDataKey={},this.parent.partialSelectedIndexes=[],this.parent.partialSelectedRecords=[],this.parent.disableSelectedRecords=[];else{var e=Gh(this.parent);this.setPartialRecord(e)}},e.prototype.setPartialRecord=function(e){var t=this.parent.getPrimaryKeyFieldNames()[0],i=this.parent.allowGrouping&&!(0,o.isNullOrUndefined)(e.records)?e.records:e;if(this.parent.isRemote())for(var n=0;n<i.length;n++){var r=(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize,s=this.parent.allowPaging?parseInt(n.toString(),10):r+parseInt(n.toString(),10),a=i[parseInt(n.toString(),10)][""+t];this.parent.isRowSelectable(i[parseInt(n.toString(),10)],this.parent.columns)?this.selectableDataKey.hasOwnProperty(a)||(this.parent.partialSelectedRecords.push(i[parseInt(n.toString(),10)]),this.parent.partialSelectedIndexes.push(s),this.selectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!0):(this.parent.selectionModule.isPartialSelection=!0,this.nonselectableDataKey.hasOwnProperty(a)||(this.parent.disableSelectedRecords.push(i[parseInt(n.toString(),10)]),this.nonselectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!1))}else{var l=[],h=[],d=[];this.selectableDataKey={},this.nonselectableDataKey={};for(n=0;n<i.length;n++)this.parent.isRowSelectable(i[parseInt(n.toString(),10)],this.parent.columns)?(l.push(i[parseInt(n.toString(),10)]),d.push(parseInt(n.toString(),10)),this.selectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!0):(this.parent.selectionModule.isPartialSelection=!0,h.push(i[parseInt(n.toString(),10)]),this.nonselectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!1);this.parent.partialSelectedRecords=l,this.parent.disableSelectedRecords=h,this.parent.partialSelectedIndexes=d}},e.prototype.extendDataManagerSuccess=function(e,t,i,n,r){var s=this.parent;if(!this.isInfiniteEnd(t)||i){if(this.parent.isEdit=!1,s.editSettings.showAddNewRow&&"delete"===t.requestType&&(s.editModule.destroyWidgets(),s.editModule.destroyForm()),this.parent.notify(mn,{}),this.parent.notify(Bt,{}),t&&("infiniteScroll"!==t.requestType&&"delete"!==t.requestType&&"add"!==t.action||!s.enableInfiniteScrolling)&&this.parent.notify(Lr,{type:"refreshCommandColumn"}),this.contentRenderer.prevCurrentView=!(0,o.isNullOrUndefined)(this.parent.currentViewData)&&this.parent.currentViewData.slice(),s.currentViewData=n.result,s.notify(tr,{args:t,data:n.result}),n.count&&!s.allowPaging&&(s.enableVirtualization||s.enableInfiniteScrolling)&&(s.totalDataRecordsCount=n.count),n.actual&&!(0,o.isNullOrUndefined)(n.actual.lazyLoadRecordsCount)&&this.parent.groupSettings.enableLazyLoading&&(s.totalDataRecordsCount=n.actual.lazyLoadRecordsCount),!i&&n.count&&s.allowPaging&&t&&"delete"!==t.requestType)return!this.parent.groupSettings.enableLazyLoading||"grouping"!==t.requestType&&"ungrouping"!==t.requestType||this.parent.notify(it,t),s.prevPageMoving=!0,s.pageSettings.totalRecordsCount=n.count,"paging"!==t.requestType&&(s.pageSettings.currentPage=Math.ceil(n.count/s.pageSettings.pageSize)),void s.dataBind();if((s.getColumns().length||!i)&&this.isLayoutRendered||Fl(s)||(s.removeMaskRow(),this.updatesOnInitialRender(n)),!this.isColTypeDef&&s.getCurrentViewRecords()&&(this.data.dataManager.dataSource.offline&&s.dataSource&&s.dataSource.length?this.updateColumnType(s.dataSource[0]):this.updateColumnType(s.getCurrentViewRecords()[0])),this.parent.isInitialLoad||!this.parent.groupSettings.disablePageWiseAggregates||this.parent.groupSettings.columns.length||(n.result=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.currentViewData),!this.parent.isReact&&!this.parent.isVue||(0,o.isNullOrUndefined)(t)||"infiniteScroll"===t.requestType||t.isFrozen||Ah(this.parent,["footerTemplate"]),this.parent.isAngular&&this.parent.allowGrouping&&this.parent.groupSettings.captionTemplate&&((0,o.isNullOrUndefined)(t)||"infiniteScroll"!==t.requestType)&&this.parent.destroyTemplate(["groupSettings_captionTemplate"]),this.parent.notify(Pe,(0,o.extend)({count:n.count,result:n.result,aggregates:n.aggregates,loadSummaryOnEmpty:!1},t)),(s.groupSettings.columns.length||t&&"ungrouping"===t.requestType)&&t&&"filtering"!==t.requestType&&this.headerRenderer.refreshUI(),i){if(Fl(s)){t.scrollTop={top:this.contentRenderer.content.scrollTop}}r?this.parent.notify(Tn,{e:t,result:e.result,count:e.count,agg:e.aggregates}):this.parent.enableImmutableMode?this.contentRenderer.immutableModeRendering(t):this.contentRenderer.refreshContentRows(t)}else{if(t&&t.isCaptionCollapse)return;if(!s.getColumns().length)return s.element.innerHTML="",void alert(this.l10n.getConstant("EmptyDataSourceError"));if(this.contentRenderer.setRowElements([]),this.contentRenderer.setRowObjects([]),this.ariaService.setBusy(this.parent.getContent().querySelector("."+ps),!1),s.removeMaskRow(),this.renderEmptyRow(),s.enableColumnVirtualization&&!i&&this.parent.notify(Ne,{rows:s.getRowsObject(),args:{}}),t){var a=(t.requestType||"").toLowerCase()+"-complete";this.parent.notify(a,t),"batchsave"===t.requestType&&(t.cancel=!1,t.rows=[],t.isFrozen=!t.isFrozen,this.parent.trigger(D,t))}this.parent.autoFit&&this.parent.preventAdjustColumns(),this.parent.hideSpinner()}this.parent.notify(Lt,{}),this.setRowCount(this.parent.getCurrentViewRecords().length),"query"in e&&(this.parent.getDataModule().isQueryInvokedFromData=!1)}else this.parent.notify(Tn,{e:t,result:e.result,count:e.count,agg:e.aggregates})},e.prototype.dataManagerFailure=function(e,t){(0,o.isNullOrUndefined)(this.parent.contentModule)||(this.ariaService.setOptions(this.parent.getContent().querySelector("."+ps),{busy:!1,invalid:!0}),this.setRowCount(1)),this.parent.trigger(T,e&&e.error?e:{error:e}),this.parent.hideSpinner(),this.parent.removeMaskRow(),"save"!==t.requestType&&"delete"!==t.requestType&&"bulk-save"!==t.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.log("actionfailure",{error:e}))},e.prototype.setRowCount=function(e){this.ariaService.setOptions(this.parent.element,{rowcount:e?e.toString():"1"})},e.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},e.prototype.updatesOnInitialRender=function(e){this.isLayoutRendered=!0;var t=!1;this.parent.columns.length<1&&(this.buildColumns(e.result[0]),t=!0),ja(this.parent.columns,null,this.parent),t&&this.parent.notify(qr,{}),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(Nt,{})},e.prototype.iterateComplexColumns=function(e,t,i){for(var n=Object.keys(e),r=0;r<n.length;r++){("object"!=typeof e[n[parseInt(r.toString(),10)]]||!e[n[parseInt(r.toString(),10)]]||e[n[parseInt(r.toString(),10)]]instanceof Date?[]:Object.keys(e[n[parseInt(r.toString(),10)]])).length?this.iterateComplexColumns(e[n[parseInt(r.toString(),10)]],t+(n[parseInt(r.toString(),10)]+"."),i):(i[this.counter]=t+n[parseInt(r.toString(),10)],this.counter++)}},e.prototype.buildColumns=function(e){var t=[],i={};this.iterateComplexColumns(e,"",i);for(var n=Object.keys(i).filter(function(e){return"BlazId"!==i[""+e]}).map(function(e){return i[""+e]}),r=0,s=n.length;r<s;r++)t[parseInt(r.toString(),10)]={field:n[parseInt(r.toString(),10)]},this.parent.enableColumnVirtualization&&(t[parseInt(r.toString(),10)].width=(0,o.isNullOrUndefined)(t[parseInt(r.toString(),10)].width)?200:t[parseInt(r.toString(),10)].width);this.parent.setProperties({columns:t},!0)},e.prototype.instantiateRenderer=function(){this.renderer.addRenderer(i.Header,new Zs(this.parent,this.locator)),this.renderer.addRenderer(i.Content,new Ys(this.parent,this.locator));var e=this.locator.getService("cellRendererFactory");e.addCellRenderer(t.Header,new ro(this.parent,this.locator)),e.addCellRenderer(t.Data,new $s(this.parent,this.locator)),e.addCellRenderer(t.StackedHeader,new oo(this.parent,this.locator)),e.addCellRenderer(t.Indent,new lo(this.parent,this.locator)),e.addCellRenderer(t.GroupCaption,new po(this.parent,this.locator)),e.addCellRenderer(t.GroupCaptionEmpty,new co(this.parent,this.locator)),e.addCellRenderer(t.Expand,new go(this.parent,this.locator)),e.addCellRenderer(t.HeaderIndent,new mo(this.parent,this.locator)),e.addCellRenderer(t.StackedHeader,new oo(this.parent,this.locator)),e.addCellRenderer(t.DetailHeader,new vo(this.parent,this.locator)),e.addCellRenderer(t.RowDragHIcon,new xo(this.parent,this.locator)),e.addCellRenderer(t.DetailExpand,new Co(this.parent,this.locator)),e.addCellRenderer(t.DetailFooterIntent,new lo(this.parent,this.locator)),e.addCellRenderer(t.RowDragIcon,new bo(this.parent,this.locator))},e.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(Me,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(Ue,this.refresh,this),this.parent.on(At,this.refreshComplete,this),this.parent.on(Pt,this.sendBulkRequest,this),this.parent.on(xi,function(){e.emptyGrid=!0},this),this.parent.on(Nt,this.dynamicColumnChange,this))},e.prototype.validateGroupRecords=function(e){var t=this,i=e.result.length-1;if(i<0)return Promise.resolve(e);var n=e.result[0],r=e.result[parseInt(i.toString(),10)],s=[],o=function(e){for(var o=0===i?[n]:[n,r],l=0;l<o.length;l++)s.push(new a.Predicate("field","==",o[parseInt(l.toString(),10)].field).and(t.getPredicate("key","equal",o[parseInt(l.toString(),10)].key)));e.where(a.Predicate.or(s))},l=new a.Query;o(l);var h=new a.DataManager(e.result).executeLocal(l),d=this.data.generateQuery(!0),p=[];if(this.data.isRemote()){for(var c=0===i?[n]:[n,r],u=0;u<c.length;u++)p.push(this.getPredicate(c[parseInt(u.toString(),10)].field,"equal",c[parseInt(u.toString(),10)].key));d.where(a.Predicate.or(p))}else o(d);var g=new a.Deferred;return this.data.getData({},d).then(function(i){t.updateGroupInfo(h,i.result),g.resolve(e)}).catch(function(e){return g.reject(e)}),g.promise},e.prototype.getPredicate=function(e,t,i){return i instanceof Date?Al({field:e,operator:t,value:i}):new a.Predicate(e,t,i)},e.prototype.updateGroupInfo=function(e,t){for(var i=new a.DataManager(t),n=e,r=0;r<n.length;r++){var s=i.executeLocal((new a.Query).where(new a.Predicate("field","==",n[parseInt(r.toString(),10)].field).and(this.getPredicate("key","equal",n[parseInt(r.toString(),10)].key))))[0];if(!(0,o.isNullOrUndefined)(s)){n[parseInt(r.toString(),10)].count=s.count;var l=n[parseInt(r.toString(),10)].items,h=s.items;l.GroupGuid&&(n[parseInt(r.toString(),10)].items=this.updateGroupInfo(n[parseInt(r.toString(),10)].items,s.items));for(var d=this.parent.aggregates,p=0;p<d.length;p++)for(var c=d[parseInt(p.toString(),10)],u=0;u<c.columns.length;u++)for(var g=c.columns[parseInt(u.toString(),10)],f=g.type instanceof Array?g.type:[g.type],m=0;m<f.length;m++){var y=g.field+" - "+f[parseInt(m.toString(),10)].toLowerCase(),v=l.level?h.records:s.items,S=this.parent;if("Custom"===f[parseInt(m.toString(),10)]){var C=l.level?h:s,w=g.customAggregate;"string"==typeof w&&(w=(0,o.getValue)(w,window)),n[parseInt(r.toString(),10)].aggregates[""+y]=w?w.call(S,C,c.columns[parseInt(u.toString(),10)]):""}else n[parseInt(r.toString(),10)].aggregates[""+y]=a.DataUtil.aggregates[f[parseInt(m.toString(),10)].toLowerCase()](v,c.columns[parseInt(u.toString(),10)].field)}}}return e},e}(),Do=function(){function e(){this.cellRenderMap={}}return e.prototype.addCellRenderer=function(e,i){e="string"==typeof e?e:(0,o.getEnumValue)(t,e),(0,o.isNullOrUndefined)(this.cellRenderMap[""+e])&&(this.cellRenderMap[""+e]=i)},e.prototype.getCellRenderer=function(e){if(e="string"==typeof e?e:(0,o.getEnumValue)(t,e),(0,o.isNullOrUndefined)(this.cellRenderMap[""+e]))throw"The cellRenderer "+e+" is not found";return this.cellRenderMap[""+e]},e}(),To=function(){function e(e,t){this.sortedCols=[],this.sortPredicate=[],this.isCustomDialog=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.evtHandlers=[{event:nr,handler:this.closeCustomDialog},{event:rr,handler:this.refreshCustomFilterOkBtn},{event:or,handler:this.renderResponsiveContextMenu},{event:ar,handler:this.renderCustomFilterDiv},{event:lr,handler:this.customExFilterClose},{event:sr,handler:this.refreshCustomFilterClearBtn}],Rh(this.parent,this.evtHandlers,!0,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(D,this.onActionCompleteFn)},e.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},e.prototype.renderCustomFilterDiv=function(){if(!(0,o.isNullOrUndefined)(this.customResponsiveDlg)){var e=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),t=e.querySelector(".e-dlg-custom-header"),i=e.querySelector(".e-dlg-closeicon-btn");this.isCustomDlgRender=!0,this.parent.filterModule.filterModule.closeDialog(),this.saveBtn.element.style.display="",this.refreshCustomFilterOkBtn({disabled:!1}),this.backBtn.element.style.display="none",i.style.display="",t.innerHTML=this.parent.localeObj.getConstant("CustomFilter");var n=this.customResponsiveDlg.element.querySelector(".e-dlg-content");this.customExcelFilterParent=this.parent.createElement("div",{className:"e-xl-customfilterdiv e-default-filter"}),n.appendChild(this.customExcelFilterParent)}},e.prototype.renderResponsiveContextMenu=function(e){if(this.action===r.isFilter&&!(0,o.isNullOrUndefined)(this.customResponsiveDlg)){var t=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),i=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content"),n=i.querySelector(".e-dlg-closeicon-btn"),s=i.querySelector(".e-dlg-custom-header");if(e.isOpen){t.firstChild.style.display="none",t.appendChild(e.target),n.style.display="none",this.saveBtn.element.style.display="none",this.filterClearBtn.element.style.display="none",s.innerHTML=e.header;var a=this.parent.createElement("button"),l=this.parent.createElement("span",{className:"e-btn-icon e-resfilterback e-icons"});a.appendChild(l),this.backBtn=new Js.Button({cssClass:this.parent.cssClass?"e-res-back-btn "+this.parent.cssClass:"e-res-back-btn"}),this.backBtn.appendTo(a),s.parentElement.insertBefore(a,s)}else this.backBtn&&!this.isCustomDlgRender&&(t.firstChild.style.display="",(0,o.remove)(this.backBtn.element),n.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),s.innerHTML=this.getHeaderTitle({action:r.isFilter},e.col))}},e.prototype.refreshCustomFilterClearBtn=function(e){this.filterClearBtn&&(this.isFiltered=e.isFiltered,this.filterClearBtn.element.style.display=e.isFiltered?"":"none")},e.prototype.refreshCustomFilterOkBtn=function(e){this.saveBtn&&(this.saveBtn.disabled=e.disabled),this.parent.columnChooserModule&&this.parent.columnChooserModule.responsiveDialogRenderer&&this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn&&(this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn.disabled=e.disabled)},e.prototype.columnMenuResponsiveContent=function(e,t,i){var n=this.parent.createElement("div",{className:"e-responsivecoldiv e-responsive"+e.toLowerCase()+"div"+(i?" e-disabled":"")}),r=this.parent.createElement("span",{className:"e-icons e-res"+e.toLowerCase()+"-icon e-btn-icon"}),s=this.parent.createElement("span",{innerHTML:t,className:"e-rescolumn-menu e-res-header-text"});n.appendChild(r),n.appendChild(s),this.customColumnDiv.appendChild(n)},e.prototype.renderResponsiveContent=function(e,t){var i=this,n=this.parent,s=this.action===r.isColumnChooser;if(e||s)return this.filterParent=this.parent.createElement("div",{className:(s?"e-maincolumnchooserdiv ":"")+"e-mainfilterdiv e-default-filter",id:(s?"columchooser":e.uid)+"-main-filter"}),this.filterParent;if(this.customColumnDiv=n.createElement("div",{className:"columndiv columnmenudiv"}),this.customColumnDiv.style.width="100%",this.parent.showColumnMenu&&"Horizontal"===this.parent.rowRenderingMode&&this.action===r.isColMenu){if(this.columnMenuResponsiveContent("AutoFitAll",n.localeObj.getConstant("AutoFitAll")),this.columnMenuResponsiveContent("AutoFit",n.localeObj.getConstant("AutoFit")),t.allowGrouping&&n.allowGrouping&&(this.columnMenuResponsiveContent("Group",n.localeObj.getConstant("Group"),n.groupSettings.columns.indexOf(t.field)>=0),this.columnMenuResponsiveContent("UnGroup",n.localeObj.getConstant("Ungroup"),n.groupSettings.columns.indexOf(t.field)<0)),t.allowSorting&&n.allowSorting){for(var a="None",l=this.parent.sortSettings.columns,h=0;h<l.length;h++)if(l[parseInt(h.toString(),10)].field===t.field){a=l[parseInt(h.toString(),10)].direction;break}this.columnMenuResponsiveContent("ascending",n.localeObj.getConstant("SortAscending"),"Ascending"===a),this.columnMenuResponsiveContent("descending",n.localeObj.getConstant("SortDescending"),"Descending"===a)}n.showColumnChooser&&this.columnMenuResponsiveContent("Column",n.localeObj.getConstant("Columnchooser")),t.allowFiltering&&n.allowFiltering&&this.columnMenuResponsiveContent("Filter",n.localeObj.getConstant("FilterMenu"))}else{var d=n.getColumns(),p=n.createElement("div",{className:"e-ressortbutton-parent"}),c=[],u=this.action===r.isSort,g=this.action===r.isFilter;if(g)for(h=0;h<n.filterSettings.columns.length;h++)c.push(n.filterSettings.columns[parseInt(h.toString(),10)].field);for(h=0;h<d.length;h++)if(!(!d[parseInt(h.toString(),10)].visible||!d[parseInt(h.toString(),10)].allowSorting&&u||!d[parseInt(h.toString(),10)].allowFiltering&&g)){var f=n.createElement("div",{className:"e-responsivecoldiv"});f.setAttribute("data-mappingname",d[parseInt(h.toString(),10)].field),f.setAttribute("data-mappinguid",d[parseInt(h.toString(),10)].uid);var m=n.createElement("span",{innerHTML:d[parseInt(h.toString(),10)].headerText,className:"e-res-header-text"});if(f.appendChild(m),this.customColumnDiv.appendChild(f),u){var y=this.getSortedFieldsAndDirections("field").indexOf(d[parseInt(h.toString(),10)].field),v=n.createElement("button",{id:n.element.id+d[parseInt(h.toString(),10)].field+"sortbutton"}),S=p.cloneNode();S.appendChild(v),f.appendChild(S),new Js.Button({cssClass:this.parent.cssClass?"e-ressortbutton "+this.parent.cssClass:"e-ressortbutton"}).appendTo(v);var C=void 0;(0,o.isNullOrUndefined)(this.parent.sortSettings.columns[parseInt(y.toString(),10)])||(C="Ascending"===this.parent.sortSettings.columns[parseInt(y.toString(),10)].direction?this.parent.localeObj.getConstant("AscendingText"):this.parent.localeObj.getConstant("DescendingText")),v.innerHTML=y>-1?C:this.parent.localeObj.getConstant("NoneText"),v.onclick=function(e){i.sortButtonClickHandler(e.target)}}if(g&&c.indexOf(d[parseInt(h.toString(),10)].field)>-1){var w=n.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),b=n.createElement("span",{className:"e-icons e-res-icon e-filterset"});b.setAttribute("data-coltype",d[parseInt(h.toString(),10)].type),w.appendChild(b),f.appendChild(w)}}}return o.EventHandler.add(this.customColumnDiv,o.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},e.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i<this.parent.sortSettings.columns.length;i++)t.push(this.parent.sortSettings.columns[parseInt(i.toString(),10)][""+e]);return t},e.prototype.sortButtonClickHandler=function(e){if(e){var t=_a(e,"e-responsivecoldiv").getAttribute("data-mappingname");this.parent.allowMultiSorting||(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1,this.resetSortButtons(e));var i=e.textContent,n=i===this.parent.localeObj.getConstant("NoneText")?this.parent.localeObj.getConstant("AscendingText"):i===this.parent.localeObj.getConstant("AscendingText")?this.parent.localeObj.getConstant("DescendingText"):this.parent.localeObj.getConstant("NoneText"),r=n===this.parent.localeObj.getConstant("AscendingText")?"Ascending":n===this.parent.localeObj.getConstant("DescendingText")?"Descending":"None";e.innerHTML=n,this.setSortedCols(t,r)}},e.prototype.resetSortButtons=function(e){for(var t=[].slice.call(this.customColumnDiv.getElementsByClassName("e-ressortbutton")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)]!==e&&(t[parseInt(i.toString(),10)].innerHTML=this.parent.localeObj.getConstant("NoneText"))},e.prototype.setSortedCols=function(e,t){var i=this.getCurrentSortedFields().indexOf(e);this.parent.allowMultiSorting&&i>-1&&(this.sortedCols.splice(i,1),this.sortPredicate.splice(i,1)),this.isSortApplied=!0,"None"!==t&&(this.sortedCols.push(e),this.sortPredicate.push({field:e,direction:t}))},e.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;t<this.sortedCols.length;t++)e.push(this.sortedCols[parseInt(t.toString(),10)]);return e},e.prototype.customFilterColumnClickHandler=function(e){var t=this.parent,i=e.target;if(_a(i,"columnmenudiv")&&this.action===r.isColMenu&&!_a(i,"e-disabled")){var n=this.menuCol?this.menuCol:this.filteredCol;_a(i,"e-responsiveautofitalldiv")?(t.autoFitColumns([]),this.closeCustomFilter()):_a(i,"e-responsiveautofitdiv")?(t.autoFitColumns(n.field),this.closeCustomFilter()):_a(i,"e-responsivegroupdiv")?(t.groupColumn(n.field),this.closeCustomFilter()):_a(i,"e-responsiveungroupdiv")?(t.ungroupColumn(n.field),this.closeCustomFilter()):_a(i,"e-responsiveascendingdiv")?(t.sortColumn(n.field,"Ascending"),this.closeCustomFilter()):_a(i,"e-responsivedescendingdiv")?(t.sortColumn(n.field,"Descending"),this.closeCustomFilter()):_a(i,"e-responsivecolumndiv")?(t.notify(Ur,{action:5}),t.showResponsiveCustomColumnChooser()):_a(i,"e-responsivefilterdiv")&&(t.notify(Ur,{action:3}),this.isRowResponsive=!0,this.isCustomDialog=!1,t.filterModule&&t.filterModule.responsiveDialogRenderer.showResponsiveDialog(n)),e.preventDefault()}if(this.action===r.isFilter&&"FilterBar"!==t.filterSettings.type)if(i.classList.contains("e-responsivecoldiv")||i.parentElement.classList.contains("e-responsivecoldiv")){if((l=i.getAttribute("data-mappingname"))||(l=i.parentElement.getAttribute("data-mappingname")),l){var s=t.getColumnByField(l);this.isRowResponsive=!0,this.showResponsiveDialog(s)}}else if(i.classList.contains("e-filterset")||i.parentElement.classList.contains("e-filtersetdiv")){var a=_a(i,"e-responsivecoldiv");if(a){var l=a.getAttribute("data-mappingname");("Menu"===(s=t.getColumnByField(l)).filter.type||!s.filter.type&&"Menu"===t.filterSettings.type)&&(this.isDialogClose=!0),(0,o.isNullOrUndefined)(this.parent.filterModule.filterModule)?this.parent.filterModule.clearFiltering([l]):this.parent.filterModule.filterModule.clearCustomFilter(s),this.removeCustomDlgFilterEle(i)}}},e.prototype.showResponsiveDialog=function(e,t){if(this.isCustomDialog&&this.action===r.isFilter&&!this.isRowResponsive||t&&this.action===r.isColMenu)this.menuCol=t,this.renderCustomFilterDialog(null,t);else{if(this.filteredCol=e,this.renderResponsiveDialog(e),this.parent.enableAdaptiveUI&&e&&(this.parent.filterModule.setFilterModel(e),this.parent.filterModule.filterModule.openDialog(this.parent.filterModule.createOptions(e,void 0))),this.action===r.isColumnChooser&&this.parent.notify(Hr,{action:"open"}),this.action===r.isSort){var i={cancel:!1,dialogObj:this.customResponsiveDlg,requestType:"beforeOpenAptiveSortDialog"};if(this.parent.trigger(ye,i),i.cancel)return}if(this.customResponsiveDlg.show(!0),this.customResponsiveDlg.element.style.maxHeight="100%",this.setTopToChildDialog(this.customResponsiveDlg.element),this.parent.enableAdaptiveUI&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)&&this.parent.filterSettings.enableInfiniteScrolling&&"Shimmer"===this.parent.filterSettings.loadingIndicator)("CheckBox"===this.parent.filterSettings.type?this.parent.filterModule.filterModule.checkBoxBase:this.parent.filterModule.filterModule.excelFilterBase).showMask()}},e.prototype.setTopToChildDialog=function(e){var t=e.querySelector(".e-dialog");if(t){var i=e.querySelector(".e-dlg-header-content").getBoundingClientRect().height;t.style.top=i+"px"}},e.prototype.renderCustomFilterDialog=function(e,t){var i=this.parent,n=this.action===r.isColMenu;if(this.action!==r.isFilter||"FilterBar"!==i.filterSettings.type){var s=n?"e-customcolumnmenudiv ":"",o=this.parent.createElement("div",{id:i.element.id+(n?"customcolumnmenu":"customfilter"),className:this.parent.cssClass?s+"e-customfilterdiv e-responsive-dialog "+this.parent.cssClass:s+"e-customfilterdiv e-responsive-dialog"});this.parent.element.appendChild(o),this.customFilterDlg=this.getDialogOptions(e,!0,null,t);var a={cancel:!1,dialogObj:this.customFilterDlg,requestType:"beforeOpenAptiveFilterDialog"};this.parent.trigger(ye,a),a.cancel||(this.customFilterDlg.appendTo(o),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")}},e.prototype.getDialogOptions=function(e,t,i,n){var s=new y.Dialog({isModal:!0,showCloseIcon:!("columnchooser"===i&&this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization),closeOnEscape:!1,locale:this.parent.locale,target:this.parent.adaptiveDlgTarget?this.parent.adaptiveDlgTarget:document.body,visible:!1,enableRtl:this.parent.enableRtl,content:this.renderResponsiveContent(e,n),open:this.dialogOpen.bind(this),created:this.dialogCreated.bind(this),close:this.beforeDialogClose.bind(this),width:"100%",height:"100%",animationSettings:{effect:"None"},cssClass:this.parent.cssClass?this.parent.cssClass:""});if(s.isStringTemplate=!0,t){s.header=this.renderResponsiveHeader(e,void 0,!0);var o=this.action===r.isColMenu?"e-customcolumnmenu ":"";s.cssClass=o+"e-customfilter"}else s.header=this.renderResponsiveHeader(e),s.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===r.isFilter?"e-res"+i+" e-row-responsive-filter":"e-res"+i;return s},e.prototype.renderResponsiveDialog=function(e){var t=this.parent;if(this.action!==r.isFilter||"FilterBar"!==t.filterSettings.type){var i=this.action===r.isFilter?"filter":"sort";i=this.action===r.isColumnChooser?"columnchooser":i;var n=this.parent.createElement("div",{id:t.element.id+"responsive"+i,className:this.parent.cssClass?"e-res"+i+"div e-responsive-dialog "+this.parent.cssClass:"e-res"+i+"div e-responsive-dialog"});this.parent.element.appendChild(n),this.customResponsiveDlg=this.getDialogOptions(e,!1,i),ah(t,this.customResponsiveDlg),this.customResponsiveDlg.appendTo(n)}},e.prototype.dialogCreated=function(){bh(this.parent)},e.prototype.dialogOpen=function(){if(this.action===r.isSort&&this.parent.allowMultiSorting)for(var e=0;e<this.parent.sortSettings.columns.length;e++){this.sortedCols.push(this.parent.sortSettings.columns[parseInt(e.toString(),10)].field);var t=this.parent.sortSettings.columns[parseInt(e.toString(),10)].field,i=this.parent.sortSettings.columns[parseInt(e.toString(),10)].direction;this.sortPredicate.push({field:t,direction:i})}},e.prototype.beforeDialogClose=function(e){if(this.isDialogClose=e.element&&!e.element.querySelector(".e-xl-customfilterdiv")&&e.element.classList.contains("e-resfilterdiv"),this.action===r.isFilter)e.element.classList.contains("e-resfilterdiv")?this.parent.filterModule.filterModule.closeResponsiveDialog(this.isCustomDlgRender):e.element.classList.contains("e-customfilterdiv")&&this.closeCustomFilter(),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&(this.parent.notify(Ur,{action:4}),(t=document.querySelector(".e-resfilter"))&&(0,o.remove)(t));else if(this.action===r.isSort)this.closeCustomDialog();else if(this.action===r.isColMenu){this.closeCustomFilter(),(t=document.querySelector(".e-rescolummenu"))&&(0,o.remove)(t)}else if(this.action===r.isColumnChooser){var t;this.parent.notify(Hr,{action:"clear"}),(t=document.querySelector(".e-rescolumnchooser"))&&(0,o.remove)(t),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&this.parent.notify(Ur,{action:4}),this.isCustomDialog=!1,this.isDialogClose=!1}this.parent.off(cr,this.keyHandler)},e.prototype.sortColumn=function(){if(this.isSortApplied){this.sortPredicate.length&&this.parent.setProperties({sortSettings:{columns:[]}},!0);for(var e=0;e<this.sortPredicate.length;e++)this.parent.sortColumn(this.sortPredicate[parseInt(e.toString(),10)].field,this.sortPredicate[parseInt(e.toString(),10)].direction,this.parent.allowMultiSorting);this.sortPredicate.length||this.parent.clearSorting(),this.closeCustomDialog()}else this.closeCustomDialog()},e.prototype.getHeaderTitle=function(e,t){var i,n=this.parent;return this.action===r.isEdit?i=n.localeObj.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.action===r.isAdd?i=n.localeObj.getConstant("AddFormTitle"):this.action===r.isFilter?i=t?t.headerText||t.field:n.localeObj.getConstant("FilterTitle"):this.action===r.isSort?i=n.localeObj.getConstant("Sort"):this.action===r.isColMenu?i=n.localeObj.getConstant("ColumnMenu"):this.action===r.isColumnChooser&&(i=n.localeObj.getConstant("ChooseColumns")),i},e.prototype.getDialogName=function(e){var t;return e===r.isAdd||e===r.isEdit?t="dialogEdit_wrapper_title":e===r.isFilter?t="responsive_filter_dialog_wrapper":e===r.isColumnChooser&&(t="responsive_column_chooser_dialog_wrapper"),t},e.prototype.getButtonText=function(e){var t;return e===r.isAdd||e===r.isEdit?t="Save":e!==r.isFilter&&this.action!==r.isSort&&e!==r.isColumnChooser&&this.action!==r.isColumnChooser||(t="OKButton"),t},e.prototype.renderResponsiveHeader=function(e,t,i){var n=this,s=this.parent;s.on(cr,this.keyHandler,this);var o=s.element.id+this.getDialogName(this.action);if(this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization&&this.getHeaderTitle(t,e)===s.localeObj.getConstant("ChooseColumns"))return this.parent.columnChooserModule.renderHeader();var a=s.createElement("div",{className:"e-res-custom-element"}),l=s.createElement("div",{className:"e-dlg-custom-header",id:o});l.innerHTML=this.getHeaderTitle(t,e),a.appendChild(l);var h=s.createElement("button");i||(this.saveBtn=new Js.Button({cssClass:this.parent.cssClass?"e-primary e-flat e-res-apply-btn "+this.parent.cssClass:"e-primary e-flat e-res-apply-btn"}),h.innerHTML=s.localeObj.getConstant(this.getButtonText(this.action)),this.saveBtn.appendTo(h),h.onclick=function(e){n.dialogHdrBtnClickHandler()});var d=this.action===r.isSort,p=this.action===r.isFilter;if(p||d){var c=d?"sort":"filter",u=s.createElement("button");if(this.filterClearBtn=new Js.Button({cssClass:this.parent.cssClass?"e-primary e-flat e-res-"+c+"-clear-btn "+this.parent.cssClass:"e-primary e-flat e-res-"+c+"-clear-btn"}),p){var g=s.createElement("span",{className:"e-btn-icon e-icon-filter-clear e-icons"});u.appendChild(g)}else u.innerHTML=s.localeObj.getConstant("Clear");a.appendChild(u),this.filterClearBtn.appendTo(u),u.onclick=function(e){_a(e.target,"e-customfilter")?(n.parent.filterModule.clearFiltering(),n.removeCustomDlgFilterEle()):p?n.filterClear():(n.resetSortButtons(),n.sortedCols=[],n.sortPredicate=[],n.isSortApplied=!0)},a.appendChild(u)}return i||a.appendChild(h),a},e.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},e.prototype.removeCustomFilterElement=function(){var e=document.getElementById(this.parent.element.id+"customcolumnmenu");if(e){(0,o.remove)(e);var t=document.querySelector(".e-customfilter");t&&(0,o.remove)(t)}var i=document.querySelector(".e-rescolumnchooser");i&&(0,o.remove)(i)},e.prototype.hideResponsiveColumnChooser=function(){var e=document.querySelector(".e-rescolumnchooser");e&&((0,o.remove)(e),this.isCustomDialog=!1,this.isDialogClose=!1)},e.prototype.dialogHdrBtnClickHandler=function(){this.action===r.isEdit||this.action===r.isAdd?this.parent.endEdit():this.action===r.isFilter?(this.parent.filterModule.filterModule.applyCustomFilter({col:this.filteredCol,isCustomFilter:this.isCustomDlgRender}),this.removeCustomFilterElement()):this.action===r.isSort?(this.sortColumn(),this.removeCustomFilterElement()):this.action===r.isColumnChooser&&(this.parent.notify(Hr,{action:"confirm"}),this.removeCustomFilterElement(),this.isCustomDialog=!1,this.isDialogClose=!1)},e.prototype.closeCustomDialog=function(){if(this.isCustomDlgRender){var e=this.customResponsiveDlg.element.querySelector(".e-mainfilterdiv");(0,o.remove)(e)}else this.isRowResponsive=!1,this.isCustomDlgRender=!1,this.destroyCustomFilterDialog()},e.prototype.destroyCustomFilterDialog=function(){if(this.customResponsiveDlg){var e=document.getElementById(this.customResponsiveDlg.element.id);this.customResponsiveDlg&&!this.customResponsiveDlg.isDestroyed&&e&&(this.customResponsiveDlg.destroy(),(0,o.remove)(e)),this.closeCustomFilter(),this.action===r.isSort&&(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1)}},e.prototype.closeCustomFilter=function(){if(!this.isDialogClose&&this.customFilterDlg){var e=document.getElementById(this.customFilterDlg.element.id);this.customFilterDlg&&!this.customFilterDlg.isDestroyed&&e&&(this.customFilterDlg.destroy(),(0,o.remove)(e))}this.isCustomDialog=!1,this.isDialogClose=!1},e.prototype.removeCustomDlgFilterEle=function(e){if(e)e.parentElement.classList.contains("e-filtersetdiv")?(0,o.remove)(e.parentElement):(0,o.remove)(e);else for(var t=this.customColumnDiv.children,i=0;i<t.length;i++)(e=t[parseInt(i.toString(),10)].querySelector(".e-filtersetdiv"))&&((0,o.remove)(e),i--)},e.prototype.keyHandler=function(e){13===e.keyCode&&(this.action===r.isFilter&&e.target.classList.contains("e-searchinput")||this.action===r.isEdit||this.action===r.isAdd)&&this.dialogHdrBtnClickHandler()},e.prototype.editComplate=function(e){"save"!==e.requestType&&"cancel"!==e.requestType||this.parent.off(cr,this.keyHandler)},e.prototype.removeEventListener=function(){this.customColumnDiv&&o.EventHandler.remove(this.customColumnDiv,o.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler),Rh(this.parent,this.evtHandlers,!0,this),this.parent.removeEventListener(D,this.onActionCompleteFn)},e}(),Eo=function(){function e(){this.services={}}return e.prototype.register=function(e,t){(0,o.isNullOrUndefined)(this.services[""+e])&&(this.services[""+e]=t)},e.prototype.getService=function(e){if((0,o.isNullOrUndefined)(this.services[""+e]))throw"The service "+e+" is not registered";return this.services[""+e]},e.prototype.registerAdaptiveService=function(e,t,i){t?(e.responsiveDialogRenderer=new To(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)},e}(),Oo=function(){function e(){this.rendererMap={}}return e.prototype.addRenderer=function(e,t){var n=(0,o.getEnumValue)(i,e);(0,o.isNullOrUndefined)(this.rendererMap[""+n])&&(this.rendererMap[""+n]=t)},e.prototype.getRenderer=function(e){var t=(0,o.getEnumValue)(i,e);if((0,o.isNullOrUndefined)(this.rendererMap[""+t]))throw"The renderer "+t+" is not found";return this.rendererMap[""+t]},e}(),ko=function(){function e(e){this.parent=e}return e.prototype.setWidthToColumns=function(){var e,t=0,i=this.parent.getColumnIndexesInView(),n=!0;if(this.parent.allowGrouping)for(var r=this.parent.groupSettings.columns.length;t<r;t++)this.parent.enableColumnVirtualization&&-1===i.indexOf(t)?n=!1:this.setColumnWidth(new p({width:"30px"}),t);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new p({width:"30px"}),t),t++),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(this.setColumnWidth(new p({width:"30px"}),t),t++);for(var s=this.parent.getColumns(),a=0;a<s.length;a++)this.setColumnWidth(s[parseInt(a.toString(),10)],n&&this.parent.enableColumnVirtualization?void 0:a+t);if(this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&this.setColumnWidth(new p({width:"30px"}),this.parent.groupSettings.columns.length+s.length),"auto"!==(e=this.getTableWidth(this.parent.getColumns()))){"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(e);var l=s.filter(function(e){return!(0,o.isNullOrUndefined)(e.maxWidth)}),h=this.parent.getHeaderTable(),d=this.parent.getContentTable();this.parent.allowResizing&&this.parent.element.getBoundingClientRect().width>e&&l.length===s.length&&h&&d&&(0,o.addClass)([h,d],["e-tableborder"])}},e.prototype.setMinwidthBycalculation=function(e){var t=this,i=0,n=this.parent.getColumns().filter(function(e){return t.parent.allowResizing?((0,o.isNullOrUndefined)(e.width)||"auto"===e.width)&&(0,o.isNullOrUndefined)(e.maxWidth):(0,o.isNullOrUndefined)(e.width)||"auto"===e.width});if(n.length){i=(0,o.isNullOrUndefined)(this.parent.width)||"auto"===this.parent.width||"string"!=typeof this.parent.width||-1!==this.parent.width.indexOf("%")?this.parent.element.getBoundingClientRect().width-e:parseInt(this.parent.width,10)-e;for(var r=0,s=0,a=n;s<a.length;s++){var l=a[s];r+=(0,o.isNullOrUndefined)(l.minWidth)?0:"string"==typeof l.minWidth?parseInt(l.minWidth,10):l.minWidth}for(var h=0;h<n.length;h++){0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&h!==n.length-1&&this.setUndefinedColumnWidth(n);var d=this.parent.getColumnIndexByField(n[parseInt(h.toString(),10)].field)+this.parent.getIndentCount();0!==e&&i<r?this.setWidth(n[parseInt(h.toString(),10)].minWidth,d):0!==e&&i>r&&this.setWidth("",d,!0)}}},e.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[parseInt(t.toString(),10)].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[parseInt(t.toString(),10)].field)))},e.prototype.setColumnWidth=function(e,t,i){if(!(this.parent.getColumns().length<1)){var n=(0,o.isNullOrUndefined)(t)?this.parent.getNormalizedColumnIndex(e.uid):t,r=this.getWidth(e),s=this.getTableWidth(this.parent.getColumns());if(null!==r){if(this.setWidth(r,n),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&"auto"!==s&&this.setMinwidthBycalculation(s),this.parent.allowResizing&&("resize"===i||this.parent.getFrozenColumns())){var a=this.parent.getContentTable();this.setWidthToTable(this.parent.getFrozenColumns()&&-1===a.style.width.indexOf("px")&&s<a.clientWidth)}this.parent.notify(It,{index:n,width:r,column:e,module:i})}}},e.prototype.setWidth=function(e,t,i){!(this.parent.groupSettings.columns.length>t&&eh(this.parent))||this.parent.resizeModule&&this.parent.resizeModule.resizeProcess||(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var n=this.parent.getHeaderTable(),r=this.parent.getContentTable(),s=(0,o.formatUnit)(e),a=n.querySelector(Ts).children[parseInt(t.toString(),10)];a&&!i?a.style.width=s:a&&i&&(a.style.width="");var l=r.querySelector(Ts).children[parseInt(t.toString(),10)];if(l&&!i?l.style.width=s:l&&i&&(l.style.width=""),!this.parent.enableColumnVirtualization&&this.parent.isEdit){for(var h=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),d=[],p=0;p<h.length;p++)if(_a(h[parseInt(p.toString(),10)],"e-grid").id===this.parent.element.id)for(var c=0;c<h[parseInt(p.toString(),10)].querySelector("colgroup").children.length;c++)d.push(h[parseInt(p.toString(),10)].querySelector("colgroup").children[parseInt(c.toString(),10)]);h.length&&d.length&&d[parseInt(t.toString(),10)]&&(d[parseInt(t.toString(),10)].style.width=s)}this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.refreshFrozenScrollbar()},e.prototype.refreshFrozenScrollbar=function(){var e={cancel:!1};if(this.parent.notify($n,e),!e.cancel){var t=ol(),i=this.parent.element.querySelector(".e-movablescrollbar"),n=this.parent.getContent().firstElementChild.getBoundingClientRect().width;if(this.parent.enableColumnVirtualization){var r=this.parent.getContent().querySelector(".e-virtualtrack");r&&(n=r.scrollWidth)}"auto"!==this.parent.height&&(n+=t),i.firstElementChild.style.width=n+"px"}},e.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},e.prototype.getHeightFromDirection=function(e,t){for(var i=e[t+"ElementSibling"],n=0,r=[ns,ss,"e-groupdroparea","e-gridpager","e-toolbar","e-temp-toolbar"];i;)r.some(function(e){return i.classList.contains(e)})&&(n+=i.offsetHeight),i=i[t+"ElementSibling"];return n},e.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return(0,o.isNullOrUndefined)(e.width)&&(0,o.isNullOrUndefined)(e.minWidth)}).length;return this.parent.getColumns().length===e},e.prototype.getWidth=function(e){if(this.parent.allowResizing&&(0,o.isNullOrUndefined)(e.width)&&((0,o.isNullOrUndefined)(e.minWidth)&&(0,o.isNullOrUndefined)(e.maxWidth)&&!this.isWidthUndefined()?e.width=200:e.maxWidth&&(e.width=e.maxWidth)),!e.width)return null;var t=parseInt(e.width.toString(),10);return e.minWidth&&t<parseInt(e.minWidth.toString(),10)?e.minWidth:e.maxWidth&&t>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width},e.prototype.getTableWidth=function(e,t){for(var i=0,n=!1,r=0,s=e;r<s.length;r++){var o=s[r];if(!1!==o.visible){var a=this.getWidth(o);"auto"!==o.width&&o.width||(this.parent.allowResizing&&!t?o.maxWidth||(n=!0):a=0),null!==a&&(i+=parseInt(a.toString(),10))}}return i=n?"auto":i},e.prototype.setWidthToTable=function(e){var t=(0,o.formatUnit)(this.getTableWidth(this.parent.getColumns()));(this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new p({width:"30px"})),t=this.isAutoResize()||"auto"===t||e?"100%":t,this.parent.getHeaderTable().style.width=t,this.parent.getContentTable().style.width=t;var i=this.parent.element.querySelector(".e-table.e-inline-edit");i&&(i.style.width=t)},e.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode},e}(),Ao=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fo=function(){function e(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.isInfiniteScroll=!1,this.virtualSelectionInfo={},this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.firstHeaderCellClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.groupedFrozenRow=0,this.parent=e,this.rowModelGen=new Vs(this.parent),this.addEventListener()}return e.prototype.focusCheck=function(e){var t=e.target;this.focusByClick=!0,this.firstHeaderCellClick=!0,this.skipFocus=t.classList.contains("e-grid")},e.prototype.focusIn=function(e){if(!this.parent.enableHeaderFocus&&!this.focusByClick&&((0,o.closest)(e.target,".e-filterbarcell")||(0,o.closest)(e.target,".e-checkselectall"))){var t=this.parent.element.querySelector(".e-rowcell:not(.e-hide)");t&&t.focus()}},e.prototype.onFocus=function(e){if(!(this.parent.isDestroyed||o.Browser.isDevice||this.parent.enableVirtualization||this.parent.element.querySelector(".e-masked-table")||!this.parent.isInitialLoad&&e&&e.target===this.parent.element&&this.parent.element.querySelector(".e-spin-show"))){this.setActive(this.parent.enableHeaderFocus&&0===this.parent.frozenRows),this.parent.enableHeaderFocus&&!this.parent.getCurrentViewRecords().length&&("Batch"!==this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&!this.parent.editModule.getBatchChanges()[Ss].length)&&this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new $r({isDataRow:!0})]}),this.getContent().selector,!1);var t=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator(),this.active);this.getContent().matrix.select(t[0],t[1]),!this.skipFocus||e&&e.target===this.parent.element||(this.focus(e),this.skipFocus=!1)}},e.prototype.passiveFocus=function(e){if(!this.parent.isDestroyed){var t=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)"),i=this.parent.getContentTable().querySelector("tr:last-child"),n=i&&Array.from(i.querySelectorAll(".e-rowcell:not(.e-hide)")),r=n&&n[n.length-1],s=(0,o.closest)(e.target,".e-templatecell");if(e.target===t&&e.relatedTarget&&!_a(e.relatedTarget,"e-grid")&&!this.firstHeaderCellClick){var a=[0,0];0===this.active.matrix.matrix[a[0]][a[1]]&&(a=Uh(this.active.matrix.matrix,a,!0)),this.active.matrix.current=a,this.currentInfo.element=e.target,this.currentInfo.elementToFocus=e.target,this.currentInfo.element.querySelector(".e-checkselectall")?(this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)):(0,o.addClass)([this.currentInfo.element],["e-focused","e-focus"])}(e.target===r||s&&s===r)&&e.relatedTarget&&!_a(e.relatedTarget,"e-grid")&&!this.firstHeaderCellClick&&(this.setActive(!0),this.setLastContentCellActive(),this.currentInfo.element=r,this.currentInfo.elementToFocus=r,s&&s.focus(),(0,o.addClass)([this.currentInfo.element],["e-focused","e-focus"])),this.firstHeaderCellClick=!1,e.target&&e.target.classList.contains("e-detailcell")&&!(0,o.isNullOrUndefined)(this.currentInfo.element)&&(this.currentInfo.skipAction=!1,(0,o.addClass)([this.currentInfo.element],["e-focused","e-focus"]))}},e.prototype.onBlur=function(e){this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden");var t=this.parent.getContentTable().querySelector("tr:last-child"),i=t&&t.lastElementChild===e.target,n=!(!e||this.parent.isEdit||"tab"!==this.focusKey||!(0,o.closest)(e.target,".e-gridpager")&&!i||!(0,o.isNullOrUndefined)(e.relatedTarget)||!(0,o.closest)(e.target,".e-grid")||(0,o.closest)(document.activeElement,".e-grid"));this.focusKey="";var r=!(!_a(e.target,"e-gantt")||!e.target.classList.contains("e-rowcell")||(0,o.isNullOrUndefined)(e.target.nextElementSibling)||!e.target.nextElementSibling.classList.contains("e-rowcell"));(!this.parent.isEdit&&(!e||e.relatedTarget&&!(0,o.closest)(e.relatedTarget,".e-grid")&&!(0,o.closest)(e.relatedTarget,".e-grid-popup")||this.parent.element.classList.contains("e-childgrid")&&!this.parent.element.matches(":focus-within"))||!r&&(0,o.isNullOrUndefined)(e.relatedTarget)&&parseInt(e.target.getAttribute("aria-colindex"),10)-1==0&&0===parseInt(e.target.getAttribute("data-index"),10)||!r&&(0,o.isNullOrUndefined)(e.relatedTarget)&&!(0,o.closest)(document.activeElement,".e-grid")&&!(0,o.isNullOrUndefined)(e.sourceCapabilities)||n)&&(this.removeFocus(),this.skipFocus=!0,this.currentInfo.skipAction=!1,this.setLastContentCellTabIndex(),this.setFirstFocusableTabIndex(),this.firstHeaderCellClick=!1)},e.prototype.setFirstFocusableTabIndex=function(){var e=this.parent;if(e.element.tabIndex=-1,e.allowGrouping&&e.groupSettings.showDropArea){var t=e.groupModule,i=t.getFocusableGroupedItems();i.length>0?(t.element.tabIndex=-1,i[0].tabIndex=0):t.element.tabIndex=0}else{if(e.toolbar||e.toolbarTemplate){var n=e.toolbarModule.element,r=this.parent.toolbarModule.getFocusableToolbarItems();if(r.length>0&&r[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input"))return n.tabIndex=-1,void(r[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").tabIndex=0);if(e.toolbarTemplate)return void(n.tabIndex=0)}if(e.getColumns().length)if(this.parent.enableHeaderFocus){if(e.getHeaderContent().querySelector(".e-headercell:not(.e-hide)").tabIndex=0,this.setActive(!1),!(0,o.isNullOrUndefined)(this.active)&&((0,o.isNullOrUndefined)(this.active.target)||!this.active.target.classList.contains("e-columnmenu"))){var s=[0,0];0===this.active.matrix.matrix[s[0]][s[1]]&&(s=Uh(this.active.matrix.matrix,s,!0)),this.active.matrix.current=s}}else{var a=e.element.querySelector(".e-rowcell:not(.e-hide)");a&&(a.tabIndex=0),e.frozenRows>0||e.pinnedTopRowModels.length>0?(this.setActive(!1),this.active.matrix.current=e.element.querySelector(".e-filterbarcell")?[2,0]:[1,0]):(this.setActive(!0),this.active.matrix.current=[0,0])}else;}},e.prototype.setLastContentCellTabIndex=function(){var e=this.parent.getContentTable();if(e.rows[e.rows.length-1]){var t=e.rows[e.rows.length-1].lastElementChild;(0,o.isNullOrUndefined)(t)||(t.tabIndex=0)}},e.prototype.onClick=function(e,t,i){if(!_a(e.target,"e-filterbarcell")||!_a(e.target,"e-multiselect")&&!e.target.classList.contains("e-input-group-icon")){var n=!(0,o.isNullOrUndefined)((0,o.closest)(e.target,"."+rs)),r=!(0,o.isNullOrUndefined)((0,o.closest)(e.target,"."+ns));if(!(!(n=n&&r?!n:n)&&(0,o.isNullOrUndefined)((0,o.closest)(e.target,"."+ns))||e.target.classList.contains(ps)||e.target.classList.contains(os)||!(0,o.isNullOrUndefined)((0,o.closest)(e.target,".e-unboundcell"))&&!t)){this.setActive(n);var s={cancel:!1,byKey:!1,byClick:!(0,o.isNullOrUndefined)(e.target),clickArgs:e};if(this.parent.notify(mt,s),!(s.cancel||(0,o.closest)(e.target,".e-inline-edit")&&!this.parent.editSettings.showAddNewRow&&this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow"))&&(this.setActive(n),this.getContent())){if(!1===this.getContent().onClick(e,t))return;this.focus(),this.currentInfo.element.classList.contains("e-rowcell")&&e.type&&"click"===e.type&&!i&&(0,o.addClass)([this.currentInfo.element],["e-focused","e-focus"]),i&&e&&e.target&&(0,o.addClass)([e.target],["e-focused","e-focus"])}}}},e.prototype.handleFilterNavigation=function(e,t,i){e.target===document.querySelector(t)&&"Tab"===e.key&&e.shiftKey?(e.preventDefault(),document.querySelector(i).focus()):e.target!==document.querySelector(i)||"Tab"!==e.key||e.shiftKey||document.activeElement!==document.querySelector(i)||(e.preventDefault(),document.querySelector(t).focus())},e.prototype.onKeyPress=function(e){if(this.focusKey=e.action,this.content&&this.content.target&&(this.content.target=null),this.parent.allowPaging){var t=this.parent.pagerModule.pagerObj.element,i=this.parent.pagerModule.pagerObj.getFocusablePagerElements(t,[]);if(this.parent.childGrid&&!_a(e.target,"e-gridpager")&&this.allowToPaging(e)&&i.length&&(i[0].tabIndex=0),this.parent.pagerModule.pagerObj.checkPagerHasFocus()){if("shiftTab"===e.action&&i.length&&i[0]===e.target){this.setActive(!0);var n=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1];return 0===this.active.matrix.matrix[n[0]][n[1]]&&(n=Uh(this.active.matrix.matrix,n,!1)),this.active.matrix.current="Batch"===this.parent.editSettings.mode?this.isValidBatchEditCell(n)?n:this.findBatchEditCell(n,!1):n,e.preventDefault(),void this.focus(e)}if("tab"!==e.action||!this.parent.element.classList.contains("e-childgrid")||(this.parent.pageSettings.pageSizes||!i.length||i[i.length-1]!==e.target)&&this.parent.pagerModule.pagerObj.getDropDownPage()!==e.target)return void this.parent.pagerModule.pagerObj.changePagerFocus(e);var r=_a(this.parent.element,"e-detailcell");(0,o.removeClass)([this.parent.element],["e-focus"]),(0,o.removeClass)([r],["e-focused"]),r.tabIndex=-1}if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&(38===e.keyCode||e.shiftKey&&9===e.keyCode))return e.preventDefault(),void this.focus(e);if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&9===e.keyCode)return e.preventDefault(),void this.parent.pagerModule.pagerObj.setPagerFocus();if(this.parent.pagerModule.pagerObj.checkFirstPagerFocus()){var s=this.getContent().matrix.rows,a=this.getContent().matrix.columns;this.getContent().matrix.current=[s,a]}}if("Excel"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-excelfilter .e-menu-item:not(.e-disabled)",".e-excelfilter .e-footer-content button:nth-child(2)"),"CheckBox"===this.parent.filterSettings.type){var l=this.parent.getColumnByUid(this.focusedColumnUid),h=l&&l.filter&&l.filter.hideSearchbox?".e-chk-hidden":".e-searchinput.e-input";this.handleFilterNavigation(e,h,".e-checkboxfilter .e-footer-content button:nth-child(2)")}if("Menu"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-flmenu .e-input-group.e-popup-flmenu",".e-flmenu .e-footer-content button:nth-child(2)"),this.parent.showColumnChooser&&this.handleFilterNavigation(e,".e-ccdlg .e-ccsearch.e-cc.e-input",".e-ccdlg .e-footer-content button:nth-child(2)"),"shiftTab"===e.action&&e.target&&_a(e.target,"e-gridcontent")&&e.target.closest(".e-unboundcell")){var d=(p=[].slice.call(this.parent.getContentTable().rows))[p.length-1].lastElementChild;e.target.closest(".e-unboundcell")===d&&this.commandColumnFocusElement(e.target.closest(".e-unboundcell"),!0)===e.target&&(this.currentInfo.skipAction=!0,this.setActive(!0),this.setLastContentCellActive())}if(!this.skipOn(e)){if(e.target&&_a(e.target,"e-gridcontent")){var p;d=(p=[].slice.call(this.parent.getContentTable().rows))[p.length-1].lastElementChild;e.target===d&&(this.setActive(!0),this.setLastContentCellActive())}if("shiftTab"===e.action&&e.target&&(e.target===this.parent.element||_a(e.target,"e-toolbar")||_a(e.target,"e-groupdroparea"))){if(e.target===this.parent.element)return void(this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e));if(_a(e.target,"e-groupdroparea"))return void(this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()));if(_a(e.target,"e-toolbar")){if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea){var c=(g=this.parent.groupModule).getFocusableGroupedItems();e.preventDefault(),c.length>0?c[c.length-1].focus():g.element.focus()}else this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus());return}}var u=!1;if("tab"===e.action&&e.target&&(e.target===this.parent.element||_a(e.target,"e-toolbar")||_a(e.target,"e-groupdroparea"))){if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea&&(e.target===this.parent.element||e.target.classList.contains("e-groupdroparea"))){var g;if((c=(g=this.parent.groupModule).getFocusableGroupedItems()).length>0)return e.preventDefault(),void c[0].focus();if(!e.target.classList.contains("e-groupdroparea"))return e.preventDefault(),void g.element.focus()}if((this.parent.toolbar||this.parent.toolbarTemplate)&&(e.target===this.parent.element||_a(e.target,"e-groupdroparea")||e.target.classList.contains("e-toolbar"))){var f=this.parent.toolbarModule.element,m=this.parent.toolbarModule.getFocusableToolbarItems();if(m.length>0)return e.preventDefault(),void m[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").focus();if(!e.target.classList.contains("e-toolbar")&&this.parent.toolbarTemplate)return e.preventDefault(),void f.focus()}(e.target===this.parent.element||_a(e.target,"e-toolbar")||_a(e.target,"e-groupdroparea"))&&(u=!0)}u&&(this.parent.allowGrouping&&!(0,o.isNullOrUndefined)(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length?this.setActive(!0):this.setActive(!1),this.active.matrix.current=[0,-1]),this.activeKey=e.action;var y={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(mt,y),!y.cancel){var v=this.getContent().matrix.current,S=this.active&&this.active.matrix.current?[this.active.matrix.current[0],this.active.matrix.current[1]]:void 0;this.currentInfo.outline=!0;var C=this.getContent().jump(e.action,v);this.swap=C,C.swap&&("Batch"!==this.parent.editSettings.mode||(0,o.closest)(e.target,".e-headercell")||"tab"!==e.action&&"shiftTab"!==e.action)&&(this.setActive(!C.toHeader),this.getContent().matrix.current=this.getContent().getNextCurrent(v,C,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent());var w=(!this.content||!this.content.lastIdxCell)&&this.getContent().onKeyPress(e);if(e.target&&!this.parent.enableHeaderFocus)if("tab"===e.action&&(e.target.classList.contains("e-grid")||(0,o.closest)(e.target,".e-groupdroparea")||(0,o.closest)(e.target,".e-toolbar-item")||(0,o.closest)(e.target,".e-headercell")||(0,o.closest)(e.target,".e-filterbarcell")))this.parent.frozenRows>0||this.parent.pinnedTopRowModels.length>0?(this.setActive(!1),this.active.matrix.current=this.parent.element.querySelector(".e-filterbarcell")?[2,0]:[1,0]):(this.setActive(!0),this.active.matrix.current=[0,0]);else{if(("leftArrow"===e.action||"rightArrow"===e.action)&&((0,o.closest)(e.target,".e-headercell")||(0,o.closest)(e.target,".e-filterbarcell")))return void(this.active.matrix.current=v);if("upArrow"===e.action&&0===parseInt(e.target.getAttribute("data-index"),10))return void(this.parent.frozenRows>0||this.parent.pinnedTopRowModels.length>0?this.active.matrix.current=v:this.setActive(!0))}if(e.target&&_a(e.target,"e-gridheader")){if((this.parent.enableHeaderFocus||this.parent.frozenRows>0||this.parent.pinnedTopRowModels.length>0)&&!(0,o.isNullOrUndefined)(this.active)&&"tab"===e.action&&v.toString()===this.active.matrix.current.toString()){var b=Uh(this.active.matrix.matrix,this.active.matrix.current,!0);n=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1];0===this.active.matrix.matrix[n[0]][n[1]]&&(n=Uh(this.active.matrix.matrix,n,!1));var I=(0,o.getValue)(b[0]+".cells."+b[1],this.active.matrix.getRowsFromIndex(b[0],this.active));if(I&&0===I.getBoundingClientRect().width&&this.active.matrix.matrix.length-1===b[0]&&(n=this.active.matrix.nextVisibleCellFocus(b[0],b[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current.toString()===n.toString()&&this.content.matrix.matrix.length){w=!0,this.setActive(!0);var x=[0,0];if(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").setAttribute("aria-hidden","true"),0===this.active.matrix.matrix[x[0]][x[1]]&&(x=Uh(this.active.matrix.matrix,[0,0],!0)),(O=(0,o.getValue)(x[0]+".cells."+x[1],this.active.matrix.getRowsFromIndex(x[0],this.active)))&&0===O.getBoundingClientRect().width&&(x=this.active.matrix.nextVisibleCellFocus(x[0],x[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current="Batch"===this.parent.editSettings.mode?this.isValidBatchEditCell(x)?x:this.findBatchEditCell(x,!0):x,this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization&&1!==this.parent.contentModule.prevInfo.blockIndexes[0]){e.preventDefault(),this.removeFocus();var R=this.parent.contentModule;return R.firstCellFocus=!0,void(R.content.scrollTop=0)}}else this.active.matrix.current.toString()!==b.toString()&&(this.active.matrix.current=b)}if(!(0,o.isNullOrUndefined)(this.active)&&"shiftTab"===e.action&&(v.toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&((0,o.closest)(e.target,".e-headercell")||(0,o.closest)(e.target,".e-filterbarcell")))){var D=Uh(this.active.matrix.matrix,this.active.matrix.current,!1),T=(0,o.getValue)(D[0]+".cells."+D[1],this.active.matrix.getRowsFromIndex(D[0],this.active));if(T&&0===T.getBoundingClientRect().width&&0===D[0]&&(D=this.active.matrix.nextVisibleCellFocus(D[0],D[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),D.toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&!T.classList.contains("e-rowcell"))return void this.focusOutFromHeader(e);if(this.active.matrix.current.toString()!==D.toString()&&!w){w=!0;var E=(0,o.getValue)(D[0]+".cells."+D[1],this.active.matrix.getRowsFromIndex(D[0],this.active));E&&0===E.getBoundingClientRect().width&&0===D[0]&&(D=this.active.matrix.nextVisibleCellFocus(D[0],D[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current=D}}}if(e.target&&_a(e.target,"e-gridcontent")&&(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden"),"Batch"!==this.parent.editSettings.mode||"tab"!==e.action&&"shiftTab"!==e.action||(this.active.matrix.current=this.findBatchEditCell(S,"tab"===e.action),"tab"===e.action&&S.toString()===this.active.matrix.current.toString()&&(this.parent.editModule.editModule.addBatchRow=!0)),"shiftTab"===e.action&&v.toString()===this.active.matrix.current.toString())){if(!this.parent.enableHeaderFocus&&!this.parent.frozenRows&&!this.parent.pinnedTopRowModels.length||this.parent.allowGrouping&&!(0,o.isNullOrUndefined)(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length)return void this.focusOutFromHeader(e);var O;x=[0,0];0===this.active.matrix.matrix[x[0]][x[1]]&&(x=Uh(this.active.matrix.matrix,[0,0],!0)),(O=(0,o.getValue)(x[0]+".cells."+x[1],this.active.matrix.getRowsFromIndex(x[0],this.active)))&&0===O.getBoundingClientRect().width&&(x=this.active.matrix.nextVisibleCellFocus(x[0],x[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),w||x.toString()!==this.active.matrix.current.toString()&&("Batch"!==this.parent.editSettings.mode||S.toString()!==this.active.matrix.current.toString())||(w=!0,this.setActive(!1),this.setLastContentCellActive())}if(!1!==w){if(this.header.action=e.action,this.header.currentTarget=null,this.header.focusType="key",e.target&&_a(e.target,"e-fltrtemp")&&("tab"===e.action||"shiftTab"===e.action)){var k=e.target,A=[].slice.call((0,o.closest)(k,"th").querySelectorAll(".e-fltrtemp-focus"));if(A.length){var F=A.indexOf(k);("tab"===e.action&&F<A.length-1||"shiftTab"===e.action&&F>0)&&(this.setActive(!1),this.active.matrix.current=v,this.active.currentTarget=k)}}u&&_a(this.active.getTable(),"e-gridheader")&&e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(this.parent.searchModule.headerFocus=!0),e.preventDefault(),this.focus(e)}else{if(this.clearIndicator(),"shiftTab"===e.action&&v.toString()===[0,0].toString()&&(this.parent.element.tabIndex=-1),this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.allowToPaging(e)&&v.toString()!==[0,0].toString()){if(e.preventDefault(),40===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerContainerFocus();if(9===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerFocus()}this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e)}}}},e.prototype.isValidBatchEditCell=function(e){var t=this.active.getTable().rows[e[0]].cells[e[1]],i=(0,o.closest)(t,"tr"),n=parseInt(t.getAttribute("aria-colindex"),10)-1,r=this.parent.getColumns()[parseInt(n.toString(),10)];return!(1!==this.active.matrix.matrix[e[0]][e[1]]||i.classList.contains("e-row")&&(!i.classList.contains("e-insertedrow")&&r.isPrimaryKey||!r.allowEditing))},e.prototype.findBatchEditCell=function(e,t,i){for(var n=e,r=e,s=!1;!s;){var a=r;r=Uh(this.active.matrix.matrix,r,t);var l=(0,o.getValue)(r[0]+".cells."+r[1],this.active.getTable().rows);l&&0===l.getBoundingClientRect().width&&(r=this.active.matrix.nextVisibleCellFocus(r[0],r[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),a.toString()===r.toString()||i&&a[0]!==r[0]?s=!0:this.isValidBatchEditCell(r)&&(n=r,s=!0)}return n},e.prototype.setLastContentCellActive=function(){var e=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1];0===this.active.matrix.matrix[e[0]][e[1]]&&(e=Uh(this.active.matrix.matrix,e,!1));var t=(0,o.getValue)(e[0]+".cells."+e[1],this.active.matrix.getRowsFromIndex(e[0],this.active));t&&0===t.getBoundingClientRect().width&&(e=this.active.matrix.nextVisibleCellFocus(e[0],e[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),this.active.matrix.current=e},e.prototype.focusOutFromChildGrid=function(e){var t=_a(this.parent.element,"e-table"),i=_a(t,"e-grid").ej2_instances[0],n=_a(this.parent.element,"e-detailcell"),r=_a(this.parent.element,"e-detailrow").getAttribute("data-uid"),s=[].slice.call(i.getContentTable().rows),a=s.map(function(e){return e.getAttribute("data-uid")}).indexOf(r);if(!("tab"===e.action&&a>=s.length-1)){var l;if((0,o.removeClass)([this.parent.element],["e-focus"]),(0,o.removeClass)([n],["e-focused"]),n.tabIndex=-1,e.preventDefault(),i.focusModule.removeFocus(),"shiftTab"===e.action){for(var h=s[a-1].cells,d=h.length-1;d>=0;d--)if(!(l=h[parseInt(d.toString(),10)]).classList.contains("e-hide")){i.focusModule.active.matrix.current=[a-1,d];break}}else l=s[a+1].cells[0],i.focusModule.active.matrix.current=[a+1,0];i.focusModule.currentInfo.element=l,i.focusModule.currentInfo.elementToFocus=l,(0,o.addClass)([l],["e-focused","e-focus"]),l.tabIndex=0,l.focus()}},e.prototype.focusOutFromHeader=function(e){if(this.removeFocus(),this.parent.toolbar||this.parent.toolbarTemplate){var t=this.parent.toolbarModule.element,i=this.parent.toolbarModule.getFocusableToolbarItems();if(i.length>0)return e.preventDefault(),void i[i.length-1].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").focus();if(this.parent.toolbarTemplate)return e.preventDefault(),void t.focus()}if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea){var n=this.parent.groupModule,r=n.getFocusableGroupedItems();return e.preventDefault(),void(r.length>0?r[r.length-1].focus():n.element.focus())}this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus())},e.prototype.allowToPaging=function(e){return"Batch"!==this.parent.editSettings.mode||!this.parent.editSettings.allowAdding||40===e.keyCode},e.prototype.skipOn=function(e){var t=e.target;if(!t)return!1;if(!this.parent.isEdit&&t&&t.closest(".e-unboundcell")&&this.currentInfo.skipAction&&("shiftTab"===e.action&&this.commandColumnFocusElement(t.closest(".e-unboundcell"),!1)===t||"tab"===e.action&&this.commandColumnFocusElement(t.closest(".e-unboundcell"),!0)===t))return this.currentInfo.skipAction=!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(["pageUp","pageDown","altDownArrow"].indexOf(e.action)>-1)return this.clearIndicator(),!0;if(this.parent.allowGrouping){var i=this.parent.groupModule.getFocusableGroupedItems();if(_a(e.target,"e-groupheadercell")&&!(e.target===i[0]&&"shiftTab"===e.action||e.target===i[i.length-1]&&"tab"===e.action))return!0}if(this.parent.toolbar||this.parent.toolbarTemplate){var n=this.parent.toolbarModule.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)");if(_a(e.target,"e-toolbar-item")&&!(n.length>0&&(_a(e.target,"e-toolbar-item")===n[0]&&"shiftTab"===e.action||_a(e.target,"e-toolbar-item")===n[n.length-1]&&"tab"===e.action)))return!0}var r=(0,o.closest)(t,"th")&&!(0,o.closest)(t,"th").tabIndex;!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||(l=(0,o.closest)(e.target,".e-filterbarcell")).querySelector("input").focus();var s=this.parent.editSettings.showAddNewRow&&null!==(0,o.closest)(document.activeElement,".e-addedrow");if((r&&null!==(0,o.closest)(document.activeElement,".e-filterbarcell")||s)&&this.removeFocus(),this.parent.isEdit&&("tab"===e.action||"shiftTab"===e.action)&&"Normal"===this.parent.editSettings.mode&&!this.parent.editSettings.showAddNewRow&&!(0,o.isNullOrUndefined)(_a(t,"e-addedrow"))){var a=this.parent.editModule.formObj.element.querySelectorAll('input:not([type="hidden"],.e-numeric-hidden,.e-disabled), select:not([aria-hidden="true"]), button:not(.e-hide), textarea:not(.e-hide,.e-disabled,[disabled])'),l=t.classList.contains("e-ddl")?t.querySelector("input"):t,h="tab"===e.action&&l===a[a.length-1],d="shiftTab"===e.action&&l===a[0];if(h||d){e.preventDefault();var p=a[h?0:a.length-1];(p=p.parentElement.classList.contains("e-ddl")?p.parentElement:p).focus()}}return"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&(!(0,o.isNullOrUndefined)(this.parent.element.querySelector(".e-editedrow"))||!(0,o.isNullOrUndefined)(_a(t,"e-addedrow"))&&!(0,o.isNullOrUndefined)((0,o.closest)(e.target,"input"))&&!(0,o.isNullOrUndefined)(document.querySelector(".e-popup-open"))||!(0,o.isNullOrUndefined)(_a(t,"e-addedrow"))&&t&&!t.querySelector(".e-cancel-icon")&&!(0,o.isNullOrUndefined)(_a(t,"e-unboundcell"))))||["insert","f2"].indexOf(e.action)>-1)||null!==(0,o.closest)(document.activeElement,".e-filterbarcell")&&this.parent.enableHeaderFocus&&"ctrlPlusA"===e.action||(null!==(0,o.closest)(document.activeElement,".e-filterbarcell")||s)&&"tab"!==e.action&&"shiftTab"!==e.action||null!==(0,o.closest)(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)>-1||null===(0,o.closest)(t,"."+rs)&&null===(0,o.closest)(t,"."+ns)&&!(e.target===this.parent.element||_a(e.target,"e-toolbar")||_a(e.target,"e-groupdroparea"))||"space"===e.action&&!t.classList.contains(gs)&&null===(0,o.closest)(t,"."+gs)&&null===(0,o.closest)(t,".e-headerchkcelldiv")||null!==(0,o.closest)(t,".e-filter-popup")},e.prototype.focusVirtualElement=function(e){var t=this;if(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling){var i={virtualData:{},isAdd:!1,isCancel:!1};this.parent.notify(vn,i);var n=this.actions.some(function(e){return e===t.activeKey}),r=!!this.parent.contentModule&&this.parent.contentModule.selectedRowIndex>-1;i.isAdd||Object.keys(i.virtualData).length||n||i.isCancel||r?(this.parent.notify(Cr,{isCancel:!1}),i.isCancel=!1,(this.parent.enableVirtualization&&!this.parent.selectVirtualRowOnAdd&&(!e||e&&"ctrlHome"!==e.action&&"ctrlEnd"!==e.action)||!this.parent.enableVirtualization)&&(this.parent.contentModule.selectedRowIndex=-1),this.parent.selectVirtualRowOnAdd=!1,n&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll||this.isInfiniteScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()}this.isVirtualScroll=this.isInfiniteScroll=!1},e.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},e.prototype.getContent=function(){return this.active||this.content},e.prototype.setActive=function(e){this.active=e?this.content:this.header},e.prototype.setFocusedElement=function(e,t){var i=this;this.currentInfo.elementToFocus=e,setTimeout(function(){if(!(0,o.isNullOrUndefined)(i.currentInfo.elementToFocus)){var e=(0,o.isNullOrUndefined)(i.parent.element.querySelector(".e-flmenu"))?document.querySelector(".e-grid-popup .e-flmenu"):i.parent.element.querySelector(".e-flmenu");(i.parent.enableVirtualization||i.parent.enableInfiniteScrolling)&&(0,o.isNullOrUndefined)(e)?i.focusVirtualElement(t):((0,o.isNullOrUndefined)(e)||_a(document.activeElement,"e-flmenu-valuediv")!==e.querySelector(".e-flmenu-valuediv"))&&i.currentInfo.elementToFocus.focus()}},0)},e.prototype.focus=function(e){this.parent.notify(dn,e),this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},e.prototype.removeFocus=function(e){if(this.currentInfo.element){if(this.parent.isReact&&!this.parent.isEdit&&this.currentInfo.element.classList.contains("e-rowcell")&&!this.currentInfo.element.parentElement&&(!this.parent.allowGrouping||(0,o.isNullOrUndefined)(this.parent.groupSettings.columns)||!this.parent.groupSettings.columns.length)&&this.parent.getRowByIndex(this.prevIndexes.rowIndex)){var t=this.parent.getCellFromIndex(this.prevIndexes.rowIndex,this.prevIndexes.cellIndex);this.currentInfo.element=t||this.currentInfo.element}var i=this.currentInfo.elementToFocus;i&&i.matches(".e-focus.e-checkbox")&&(i.closest(".e-headerchkcelldiv")||i.closest(".e-gridchkbox"))&&(0,o.removeClass)([i],["e-checkbox"]),(0,o.removeClass)([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1}},e.prototype.addOutline=function(){var e=this.getContent().getFocusInfo();e.element&&((0,o.addClass)([e.element],["e-focused"]),(0,o.addClass)([e.elementToFocus],["e-focus"]))},e.prototype.focusHeader=function(){this.setActive(!1),this.resetFocus()},e.prototype.focusContent=function(){this.setActive(!0),this.resetFocus()},e.prototype.resetFocus=function(){var e=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.focus()},e.prototype.addFocus=function(e,t){if(this.currentInfo=e,this.currentInfo.outline=e.outline&&(!(0,o.isNullOrUndefined)(t)||this.isVirtualScroll),this.isInfiniteScroll&&(this.currentInfo.outline=!0),e.element){var i=e.elementToFocus.classList.contains("e-focus");if(!i){this.currentInfo.outline&&(0,o.addClass)([e.element],["e-focused"]),(0,o.addClass)([e.elementToFocus],["e-focus"]),e.elementToFocus&&e.elementToFocus.classList.contains("e-focus")&&e.elementToFocus.parentElement&&!e.elementToFocus.parentElement.classList.contains("e-checkbox-disabled")&&(e.elementToFocus.classList.contains("e-checkselect")||e.elementToFocus.classList.contains("e-checkselectall"))&&e.elementToFocus.classList.add("e-checkbox"),e.element.tabIndex=0,i||this.setFocusedElement(e.elementToFocus,t),this.parent.notify(yt,{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!(0,o.isNullOrUndefined)(t),byClick:(0,o.isNullOrUndefined)(t),keyArgs:t,isJump:this.swap.swap,container:this.getContent().getInfo(t),outline:!(0,o.isNullOrUndefined)(t),swapInfo:this.swap});var n=this.getContent().matrix.current,r=n[0],s=n[1];this.prevIndexes={rowIndex:r,cellIndex:s},this.focusedColumnUid=this.parent.getColumnByIndex(s).uid,this.focusByClick=!1}}},e.prototype.refreshMatrix=function(e){var t=this;return function(i){e&&!t.content&&(t.content=new Lo(t.parent)),e||t.header||(t.header=new Po(t.parent)),e&&t.parent.pinnedTopRowModels.length&&(i.rows=t.parent.pinnedTopRowModels.concat(i.rows));var n=e?t.content:t.header,r=t.parent.frozenRows||t.parent.pinnedTopRowModels.length,s=0;if(r&&"Batch"===t.parent.editSettings.mode&&(s=t.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length+t.parent.getHeaderContent().querySelectorAll(".e-hiddenrow").length),!(0,o.isNullOrUndefined)(t.parent.groupSettings.columns)&&t.parent.groupSettings.columns.length&&r&&!t.parent.pinnedTopRecords.length&&e){r=0;for(var a=0;a<i.rows.length&&(r++,i.rows[parseInt(a.toString(),10)].index+1!==t.parent.frozenRows);a++);t.groupedFrozenRow=r}var l=e?i.rows.slice(r+s):i.rows,h=e?i.rows.slice(0,r+s):i.rows;t.parent.isCollapseStateEnabled()&&e&&(l=l.filter(function(e){return!1!==e.visible}));var d=!(0,o.isNullOrUndefined)(t.parent.rowTemplate);if(r&&("Batch"===t.parent.editSettings.mode&&e&&("batchDelete"===i.name||"batchAdd"===i.name||"batchCancel"===i.name||i.args&&"batchsave"===i.args.requestType)||i.args&&("delete"===i.args.requestType||"save"===i.args.requestType))||i.args&&("pin-row"===i.args.requestType||"unpin-row"===i.args.requestType)){var p=t.header.matrix.matrix,c=t.parent.headerModule.rows.length;p.splice(c,p.length-c)}var u=n.matrix.generate(h,n.selector,d);n.matrix.generate(l,n.selector,d);var g=t.parent.enableVirtualization||t.parent.enableInfiniteScrolling;if(t.parent.editSettings.showAddNewRow&&e&&t.header&&t.header.matrix&&(!g||g&&t.parent.isAddNewRow)){var f=t.header.matrix.matrix,m=t.parent.allowFiltering&&"FilterBar"===t.parent.filterSettings.type?2:1;n.matrix.rows=t.parent.frozenRows&&"Top"===t.parent.editSettings.newRowPosition?n.matrix.rows:++n.matrix.rows,"Top"===t.parent.editSettings.newRowPosition?(t.parent.frozenRows||g?u:n.matrix.matrix).unshift(t.refreshAddNewRowMatrix(f[f.length-m])):n.matrix.matrix.push(t.refreshAddNewRowMatrix(f[f.length-m])),t.parent.isAddNewRow=!1}if((!t.parent.isFrozenGrid()||!i.args||"sorting"!==i.args.requestType&&"batchsave"!==i.args.requestType&&"paging"!==i.args.requestType||r&&"Batch"===t.parent.editSettings.mode&&e&&("batchDelete"===i.name||"batchAdd"===i.name||"batchCancel"===i.name||"batchsave"===i.args.requestType))&&n.generateRows(h,{matrix:u,handlerInstance:t.header}),!o.Browser.isDevice&&i&&i.args&&(t.focusByClick||"paging"!==i.args.requestType||t.parent.pagerModule.pagerObj.checkPagerHasFocus()||(t.skipFocus=!1,t.parent.element.focus()),"grouping"===i.args.requestType&&(t.skipFocus=!0)),i&&i.args&&"virtualscroll"===i.args.requestType){if(t.currentInfo.uid){var y,v=i.rows.some(function(e,i){return y=i,e.uid===t.currentInfo.uid});if(v){t.content.matrix.current[0]=y,t.content.matrix.current[1]=t.parent.getColumnIndexByUid(t.focusedColumnUid)||0;var S=t.parent.getVisibleFrozenLeftCount(),C=t.parent.getVisibleFrozenRightCount();!t.parent.enableColumnVirtualization||S&&C||!t.parent.isFrozenGrid()||"right"!==i.args.virtualInfo.direction||(t.content.matrix.current[1]=t.content.matrix.current[1]-(S+(C?C+1:0)));var w=!(!t.parent.allowGrouping||!t.parent.groupSettings.columns.length);if(w&&(t.content.matrix.current[1]=t.prevIndexes.cellIndex,t.virtualSelectionInfo.isPending&&(t.content.matrix.current[0]="downArrow"===t.virtualSelectionInfo.direction?t.content.matrix.current[0]+1:t.content.matrix.current[0]-1)),D=t.getContent().getFocusInfo().elementToFocus){var b=D.getBoundingClientRect(),I=t.parent.element.getBoundingClientRect(),x=0,R=0;!t.parent.enableColumnVirtualization||S&&C||!t.parent.isFrozenGrid()||"right"!==i.args.virtualInfo.direction||(S?x=t.parent.leftrightColumnWidth("left"):R=t.parent.leftrightColumnWidth("right")),(b.top>=0&&b.left>=0&&b.right-x-R<=Math.min(I.right,window.innerWidth||document.documentElement.clientWidth)+R&&b.bottom<=Math.min(I.bottom,window.innerHeight||document.documentElement.clientHeight)||w)&&(t.isVirtualScroll=!0,t.focus(w&&t.virtualSelectionInfo.isPending?t.virtualSelectionInfo.event:void 0))}}}else if(i.args.focusElement&&i.args.focusElement.classList.contains("e-filtertext")){var D;(D=t.parent.element.querySelector("#"+i.args.focusElement.id))&&D.focus()}t.virtualSelectionInfo={}}i&&i.args&&"infiniteScroll"===i.args.requestType&&(t.isInfiniteScroll=!0)}},e.prototype.refreshAddNewRowMatrix=function(e){for(var t=this.parent.getColumns(),i=this.parent.getIndentCount(),n=i;n<e.length-1;n++)t[n-i]&&t[n-i].visible&&t[n-i].allowEditing?e[parseInt(n.toString(),10)]=1:e[parseInt(n.toString(),10)]=0;return e},e.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(o.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),o.EventHandler.add(this.parent.element,"touchstart",this.focusCheck,this),o.EventHandler.add(this.parent.element,"focus",this.onFocus,this),o.EventHandler.add(this.parent.element,"focusin",this.focusIn,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(t){return e.passiveFocus(t)},!0),o.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.evtHandlers=[{event:vt,handler:this.onKeyPress},{event:St,handler:this.onClick},{event:Ne,handler:this.refMatrix},{event:Wi,handler:this.refMatrix},{event:dr,handler:this.refMatrix},{event:jr,handler:this.showAddNewRowFocus},{event:je,handler:this.refreshMatrix()},{event:Sr,handler:this.restoreFocus},{event:on,handler:this.restoreFocus},{event:"start-edit",handler:this.clearIndicator},{event:"start-add",handler:this.clearIndicator},{event:"sorting-complete",handler:this.restoreFocus},{event:"filtering-complete",handler:this.filterfocus},{event:"custom-filter-close",handler:this.filterfocus},{event:"grouping-complete",handler:this.restoreFocusWithAction},{event:"ungrouping-complete",handler:this.restoreFocusWithAction},{event:ee,handler:this.refMatrix},{event:te,handler:this.refMatrix},{event:ie,handler:this.refMatrix},{event:Y,handler:this.refMatrix},{event:ze,handler:this.refMatrix},{event:yt,handler:this.internalCellFocus}],Rh(this.parent,this.evtHandlers,!0,this))},e.prototype.showAddNewRowFocus=function(){if(this.parent.editSettings.showAddNewRow){var e="Top"===this.parent.editSettings.newRowPosition?0:this.content.matrix.matrix.length-1,t=this.parent.getIndentCount();if("Top"===this.parent.editSettings.newRowPosition&&(this.parent.frozenRows||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){var i=this.header.matrix.matrix.length-(this.groupedFrozenRow?this.groupedFrozenRow:this.parent.frozenRows);t=this.findNextCellFocus(this.header.matrix.matrix[i-1],t),this.header.matrix.current=[i-1,t],this.active=this.header}else t=this.findNextCellFocus(this.content.matrix.matrix[parseInt(e.toString(),10)],t),this.content.matrix.current=[e,t],this.active=this.content;var n=this.parent.element.querySelector(".e-addedrow");n&&n.querySelectorAll("tr")&&n.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input")&&n.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input").select()}},e.prototype.findNextCellFocus=function(e,t){for(var i=t;i<e.length;i++)if(1===e[parseInt(i.toString(),10)])return i;return t},e.prototype.filterfocus=function(){"FilterBar"!==this.parent.filterSettings.type&&(this.removeFocus(),this.restoreFocus())},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(o.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),o.EventHandler.remove(this.parent.element,"touchstart",this.focusCheck),o.EventHandler.remove(this.parent.element,"focus",this.onFocus),o.EventHandler.remove(this.parent.element,"focusin",this.focusIn),o.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),Rh(this.parent,this.evtHandlers,!1))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.restoreFocus=function(e){if(!e||"sorting"!==e.requestType||!(0,o.isNullOrUndefined)(e.target)){var t=this.parent.groupModule;if(this.parent.allowGrouping&&t&&(t.groupSortFocus||t.groupTextFocus))return t.groupSortFocus=!1,void(t.groupTextFocus=!1);this.firstHeaderCellClick=!0,this.addFocus(this.getContent().getFocusInfo());var i=this.getContent().getFocusInfo();if(e&&["add","save","delete","cancel","batchsave","batchDelete","batchCancel"].indexOf(e.requestType)>-1&&i&&i.elementToFocus){var n=i.elementToFocus.matches(".e-rowcell.e-focus")?i.elementToFocus:i.elementToFocus.matches(".e-checkselect.e-focus")?i.elementToFocus.closest(".e-rowcell"):null;n&&(0,o.addClass)([n],["e-focused","e-focus"])}}},e.prototype.restoreFocusWithAction=function(e){if(!(this.parent.enableInfiniteScrolling||this.parent.groupModule&&this.parent.groupModule.preventFocusOnGroup)){var t=this.getContent().matrix,i=t.current;switch(e.requestType){case"grouping":case"ungrouping":i[1]=!i.length||this.parent.groupSettings.showGroupedColumn||(0,o.isNullOrUndefined)(t.matrix[i[0]])?"grouping"===e.requestType?i[1]+1:i[1]-1:t.matrix[i[0]].indexOf(1)}this.getContent().matrix.current=i,this.prevIndexes={rowIndex:i[0],cellIndex:i[1]};var n=this.parent.groupModule;if(this.parent.allowGrouping&&n&&n.groupCancelFocus){var r=n.getFocusableGroupedItems();return r.length?r[0].parentElement.getAttribute("data-mappingname")===e.columnName?r[3].focus():r[0].focus():n.element.focus(),void(n.groupCancelFocus=!1)}this.addFocus(this.getContent().getFocusInfo())}},e.prototype.clearIndicator=function(){this.currentInfo.element&&this.currentInfo.elementToFocus&&(0,o.removeClass)([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focus","e-focused"])},e.prototype.getPrevIndexes=function(){var e=this.forget;return this.forget=!1,e||!Object.keys(this.prevIndexes).length?{rowIndex:null,cellIndex:null}:this.prevIndexes},e.prototype.forgetPrevious=function(){this.forget=!0},e.prototype.setActiveByKey=function(e,t){if(0!==this.parent.frozenRows){var i,n={home:function(){return{toHeader:!i.isContent,toFrozen:!0}},end:function(){return{toHeader:!i.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:!1}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}};if(e in n){i=t.getInfo();var r=n[""+e]();this.setActive(!r.toHeader),this.getContent().matrix.current=t.matrix.current}}},e.prototype.internalCellFocus=function(e){var t;e.byKey&&e.container.isContent&&("enter"===e.keyArgs.action&&e.parent.classList.contains("e-detailcell")||("tab"===e.keyArgs.action||"shiftTab"===e.keyArgs.action)&&e.parent.classList.contains("e-unboundcell"))&&(this.clearIndicator(),t=e.parent&&e.parent.closest(".e-unboundcell")&&"shiftTab"===e.keyArgs.action?this.commandColumnFocusElement(e.parent,!0):this.getContent().getFocusable(this.getFocusedElement()),this.setFocusedElement(t),this.currentInfo.skipAction=!0)},e.prototype.commandColumnFocusElement=function(e,t){var i=e.querySelectorAll("button:not(.e-hide)");return t?i[i.length-1]:i[0]},e}(),Mo=function(){function e(){this.matrix=[],this.current=[]}return e.prototype.set=function(e,t,i){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.columns)),this.matrix[parseInt(e.toString(),10)]=this.matrix[parseInt(e.toString(),10)]||[],this.matrix[parseInt(e.toString(),10)][parseInt(t.toString(),10)]=i?1:0},e.prototype.get=function(e,t,i,n,r,s){var a=t;if(e+i[0]<0)return[e,t];e=Math.max(0,Math.min(e+i[0],this.rows));var l=!0;if((0,o.isNullOrUndefined)(this.matrix[parseInt(e.toString(),10)]))return null;if(t=Math.max(0,Math.min(t+i[1],this.matrix[parseInt(e.toString(),10)].length-1)),a+i[1]>this.matrix[parseInt(e.toString(),10)].length-1&&r(e,t,n))return[e,-1!==["downArrow","upArrow"].indexOf(n)?this.matrix[parseInt(e.toString(),10)].lastIndexOf(1):a];var h=this.first(this.matrix[parseInt(e.toString(),10)],t,i,!0,n);t=null===h?a:h;var d,p=(0,o.getValue)(e+"."+t,this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(i[0]=-1),s){var c=this.getRowsFromIndex(e,s);d=(0,o.getValue)(e+".cells."+t,c)}if(d&&0===d.getBoundingClientRect().width){var u=this.nextVisibleCellFocus(e,t,n,i,s,a);e=u[0],t=u[1]}if(null===h){for(var g=0;g<this.rows;g++)if(this.matrix[parseInt(g.toString(),10)].some(function(e){return 1===e})){l=!1;break}if(l)return[e=this.current.length?this.current[0]:0,t]}return this.inValid(p)||!r(e,t,n)?this.get(e,a,i,n,r):[e,t]},e.prototype.getRowsFromIndex=function(e,t){var i=t.getTable().rows[parseInt(e.toString(),10)];return i.classList.contains("e-addedrow")&&i.querySelector("table")?i.querySelector("table").rows:t.getTable().rows},e.prototype.nextVisibleCellFocus=function(e,t,i,n,r,s){var a=this.getRowsFromIndex(e,r),l=(0,o.getValue)(e+".cells."+t,a),h=r.matrix.matrix,d=h.length-1,p="tab"===i,c="shiftTab"===i;if("enter"===i||"shiftEnter"===i||"downArrow"===i||"upArrow"===i)return[e,t];for(;l&&0===l.getBoundingClientRect().width;){if(p&&e===d&&t===h[parseInt(e.toString(),10)].lastIndexOf(1)||c&&0===e&&t===h[parseInt(e.toString(),10)].indexOf(1))return[e,t=s];p?t===h[parseInt(e.toString(),10)].lastIndexOf(1)?(e++,t=h[parseInt(e.toString(),10)].indexOf(1),t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i),a=this.getRowsFromIndex(e,r)):(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):c?t===h[parseInt(e.toString(),10)].indexOf(1)?(e--,t=h[parseInt(e.toString(),10)].lastIndexOf(1),t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i),a=this.getRowsFromIndex(e,r)):(t--,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):"rightArrow"===i||"shiftRight"===i?t===h[parseInt(e.toString(),10)].lastIndexOf(1)?t=s:(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):"leftArrow"===i||"shiftLeft"===i?t===h[parseInt(e.toString(),10)].indexOf(1)?t=s:(t--,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):null===i&&(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)),l=(0,o.getValue)(e+".cells."+t,a)}return[e,t]},e.prototype.first=function(e,t,i,n,r){return(t<0||t===e.length)&&this.inValid(e[parseInt(t.toString(),10)])&&"upArrow"!==r&&"downArrow"!==r||!e.some(function(e){return 1===e})?null:this.inValid(e[parseInt(t.toString(),10)])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown","enter","shiftEnter"].indexOf(r)?n?0:++t:t+i[1],i,!1,r):t},e.prototype.select=function(e,t){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.matrix[parseInt(e.toString(),10)].length-1)),this.current=[e,t]},e.prototype.generate=function(e,t,i){this.rows=e.length-1,this.matrix=[];for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)].cells.filter(function(e){return!0!==e.isSpanned});this.columns=Math.max(r.length-1,0|this.columns);for(var s=0,o=0;o<r.length;o++)r[parseInt(o.toString(),10)].column&&r[parseInt(o.toString(),10)].column.columns?s=this.columnsCount(r[parseInt(o.toString(),10)].column.columns,s):s++,this.set(n,o,!1!==e[parseInt(n.toString(),10)].visible&&t(e[parseInt(n.toString(),10)],r[parseInt(o.toString(),10)],i));this.columns=Math.max(s-1,0|this.columns)}return this.matrix},e.prototype.columnsCount=function(e,t){for(var i=e,n=t,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].columns?n=this.columnsCount(i[parseInt(r.toString(),10)].columns,n):n++;return n},e.prototype.inValid=function(e){return 0===e||void 0===e},e}(),Lo=function(){function e(e){var t=this;this.matrix=new Mo,this.lastIdxCell=!1,this.parent=e,this.keyActions={rightArrow:[0,1],tab:[0,1],leftArrow:[0,-1],shiftTab:[0,-1],upArrow:[-1,0],downArrow:[1,0],shiftUp:[-1,0],shiftDown:[1,0],shiftRight:[0,1],shiftLeft:[0,-1],enter:[1,0],shiftEnter:[-1,0]},this.indexesByKey=function(e){return{home:[t.matrix.current[0],-1,0,1],end:[t.matrix.current[0],t.matrix.columns+1,0,-1],ctrlHome:[0,-1,0,1],ctrlEnd:[t.matrix.rows,t.matrix.columns+1,0,-1]}[""+e]||null}}return e.prototype.getTable=function(){return this.parent.getContentTable()},e.prototype.onKeyPress=function(e){if(/(Mac)/i.test(navigator.platform)&&e.metaKey)if("home"===e.action)e.action="ctrlHome";else if("end"===e.action)e.action="ctrlEnd";else if(-1!==["downArrow","upArrow","leftArrow","rightArrow"].indexOf(e.action))return;var t=this.keyActions[e.action],i=this.getCurrentFromAction(e.action,t,e.action in this.keyActions,e);if(i){if((["tab","shiftTab"].indexOf(e.action)>-1&&this.matrix.current||[]).toString()===i.toString()||this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.matrix.current[0]===this.matrix.rows&&("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.allowAdding&&40===e.keyCode||40===e.keyCode)){if(i.toString()===[this.matrix.rows,this.matrix.columns].toString()||i.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===i.toString()||this.parent.allowGrouping&&this.parent.infiniteScrollSettings.enableCache&&i.toString()===[0,1].toString())return!1;i=this.editNextRow(i[0],i[1],e.action)}this.matrix.select(i[0],i[1])}},e.prototype.editNextRow=function(e,t,i){var n=this.parent,r=n.editSettings.allowNextRowEdit&&(n.isEdit||n.isLastCellPrimaryKey),s=n.getColumnIndexByField(n.getVisibleColumns()[0].field),o=this.getTable().rows[parseInt(e.toString(),10)],a=n.editSettings.showAddNewRow&&o.classList.contains("e-addedrow")?o.querySelectorAll("td:not(.e-editcell)")[parseInt(t.toString(),10)]:o.cells[parseInt(t.toString(),10)];"tab"===i&&r&&(e++,t=s+(this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-indentcell").length+this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-detailrowcollapse").length));return"shiftTab"===i&&r&&(e--,t=n.getColumnIndexByField(n.getVisibleColumns()[n.getVisibleColumns().length-1].field)),!a||a.classList.contains(is)||a.classList.contains("e-headercell")||a.classList.contains("e-groupcaption")||a.classList.contains("e-filterbarcell")?[e,t]:this.editNextRow(e,t,i)},e.prototype.getCurrentFromAction=function(e,t,i,n){if(void 0===t&&(t=[0,0]),!i&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(n))return this.matrix.current;var r=this.indexesByKey(e)||this.matrix.current.concat(t),s=r[0],a=r[1],l=r[2],h=r[3];if(this.parent.allowGrouping&&!(0,o.isNullOrUndefined)(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&"enter"===e)for(var d=s;d<this.matrix.matrix.length;d++){var p=this.getTable().rows[d+1];if(p&&p.cells[parseInt(a.toString(),10)]&&p.cells[parseInt(a.toString(),10)].classList.contains("e-rowcell"))return[d+1,a];if(d===this.matrix.matrix.length-1)return[s,a]}if("ctrlEnd"===e||"end"===e){var c=[this.matrix.matrix.length-1,this.matrix.matrix[this.matrix.matrix.length-1].length-1];"end"===e&&(c=[s,this.matrix.matrix[parseInt(s.toString(),10)].length-1]),0===this.matrix.matrix[c[0]][c[1]]&&(c=Uh(this.matrix.matrix,c,!1)),s=c[0],a=c[1]+1}return this.matrix.get(s,a,[l,h],e,this.validator(),this)},e.prototype.checkRowCellFocus=function(e){return!e.classList.contains(is)||e.classList.contains("e-focused")},e.prototype.onClick=function(e,t){var i=e.target;if(this.target=i,i=(i=i.classList.contains(is)?i:(0,o.closest)(i,"td"))||((0,o.closest)(e.target,"td.e-detailrowcollapse")||(0,o.closest)(e.target,"td.e-detailrowexpand")),!(i=(i=(0,o.closest)(e.target,"td.e-detailcell")&&(0,o.isNullOrUndefined)((0,o.closest)((0,o.closest)(e.target,".e-grid"),"td.e-detailcell"))?null:i)&&(0,o.closest)(i,"table").classList.contains(cs)?i:null))return!1;var n=i.parentElement.rowIndex;this.parent.editSettings.showAddNewRow&&_a(i,"e-addedrow")&&(n=_a(i,"e-addedrow").rowIndex);var r=[n,i.cellIndex],s=r[0],a=r[1],l=this.matrix.current,h=l[0],d=l[1],p=(0,o.getValue)(s+"."+a,this.matrix.matrix);if(this.matrix.inValid(p)||!t&&h===s&&d===a&&this.checkRowCellFocus(i)&&!i.querySelector(".e-focus.e-checkbox")||!_a(e.target,is)&&!_a(e.target,"e-groupcaption")&&!_a(e.target,"e-recordpluscollapse")&&!_a(e.target,"e-recordplusexpand")&&!_a(e.target,"e-detailrowcollapse")&&!_a(e.target,"e-detailrowexpand")&&!_a(e.target,"e-templatecell"))return!1;this.matrix.select(s,a)},e.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,i=t[0],n=void 0===i?0:i,r=t[1],s=void 0===r?0:r;this.matrix.current=[n,s];var a=this.getTable().rows[parseInt(n.toString(),10)];return e.element=(0,o.isNullOrUndefined)(a)?null:this.parent.editSettings.showAddNewRow&&a.classList.contains("e-addedrow")?a.querySelectorAll("td:not(.e-editcell)")[parseInt(s.toString(),10)]:a.cells[parseInt(s.toString(),10)],e.element?(e.elementToFocus=e.element.classList.contains("e-unboundcell")&&!(this.parent.editSettings.showAddNewRow&&e.element.classList.contains("e-unboundcell")&&_a(e.element,"e-addedrow"))||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.elementToFocus=e.element.classList.contains("e-detailcell")&&e.element.querySelector(".e-childgrid")?e.element.querySelector(".e-childgrid"):e.elementToFocus,"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&"input"===e.elementToFocus.tagName.toLowerCase()&&e.elementToFocus.classList.contains("e-dropdownlist")&&(e.elementToFocus=e.elementToFocus.parentElement),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid"),e):e},e.prototype.getFocusable=function(e){var t='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',i=!(0,o.isNullOrUndefined)((0,o.closest)(e,".e-templatecell"));this.parent.isEdit&&(t='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea'+(this.parent.editSettings.showAddNewRow&&_a(e,"e-addedrow")?", button:not(.e-hide)":""));var n=[].slice.call(e.querySelectorAll(t));if(e.classList.contains("e-fltrtemp")){var r=[].slice.call(e.querySelectorAll(".e-fltrtemp-focus"));if("click"===this.focusType&&this.target&&this.target.classList.contains("e-fltrtemp-focus"))return this.target;if("key"===this.focusType&&r.length&&("tab"===this.action||"shiftTab"===this.action)){var s=r.indexOf(this.currentTarget);return-1===s?r["tab"===this.action?0:r.length-1]:r["tab"===this.action?s+1:s-1]}}return n.length?!(i&&n.length>1)||"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&this.target?n[0]:this.target?this.target:e:e},e.prototype.selector=function(e,i,n){var r=[t.Expand,t.GroupCaption,t.CaptionSummary,t.GroupSummary];return(e.isDataRow&&i.visible&&(i.isDataCell||i.isTemplate)||e.isDataRow&&i.cellType===t.DetailExpand&&(0,o.isNullOrUndefined)(i.visible)||!e.isDataRow&&r.indexOf(i.cellType)>-1&&!!(i.cellType!==t.GroupSummary&&i.cellType!==t.CaptionSummary||i.isDataCell&&i.visible)||i.column&&i.visible&&"checkbox"===i.column.type||i.cellType===t.CommandColumn||e.isDataRow&&n)&&!("delete"===e.edit&&e.isDirty)},e.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,n=this.matrix.rows;i<=n;i++){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].indexOf(1))return e;e+=1}return this.lastIdxCell=!0,t},e.prototype.previousRowFocusValidate=function(e){for(var t=e,i=e;i>=0;i--){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},e.prototype.jump=function(e,t){this.lastIdxCell=!1;var i=0!==this.parent.frozenRows&&"shiftEnter"===e,n=("upArrow"===e||i)&&0===t[0];this.matrix.matrix[t[0]]&&"tab"===e&&this.matrix.matrix.length&&t[1]===this.matrix.matrix[t[0]].lastIndexOf(1)&&this.matrix.matrix.length-1!==t[0]&&(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1),"shiftTab"===e&&0!==t[0]&&this.matrix.matrix[t[0]].indexOf(1)===t[1]&&(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[t[0]].length);var r=!1,s=_a(document.activeElement,"e-addedrow")&&this.parent.editSettings.showAddNewRow?_a(document.activeElement,"e-addedrow"):document.activeElement.parentElement;(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&!(0,o.isNullOrUndefined)(s)&&s.classList.contains(us)&&(r=parseInt(s.getAttribute(Rs),10)-1>0);return{swap:!r&&(("upArrow"===e||i)&&0===t[0]),toHeader:n}},e.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var r=[];return"rightArrow"!==n&&"tab"!==n||(r[0]=e[0],r[1]=-1),"downArrow"!==n&&"enter"!==n||(r[0]=-1,r[1]=e[1]),r},e.prototype.generateRows=function(e,t){var i,n=t.matrix,r=t.handlerInstance,s=r.matrix.matrix.length,o=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?s+1:s;r.matrix.matrix=r.matrix.matrix.slice(0,o),r.matrix.rows=o,(i=r.matrix.matrix).push.apply(i,n),r.matrix.rows+=n.length},e.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,n=i[0],r=i[1],s=t.element.classList.contains(is),o=s||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),a=[Math.min(parseInt(t.element.parentElement.getAttribute(Rs),10)-1,n),Math.min(parseInt(t.element.getAttribute(xs),10)-1,r)],l=a[0],h=a[1];return this.parent.allowGrouping&&this.parent.groupSettings.enableLazyLoading&&s&&(l=this.parent.getDataRows().indexOf(t.element.parentElement)),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&(l=n,h=r),this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&e&&"downArrow"===e.action&&l++,{isContent:!0,isDataCell:s,indexes:[l,h],isSelectable:o}},e.prototype.validator=function(){var e=this.getTable();return function(t,i,n){if(!(0,o.isNullOrUndefined)(e.rows[parseInt(t.toString(),10)])){var r=void 0;i=e.querySelector(".e-emptyrow")?0:i;var s=0!==(r=e.rows[parseInt(t.toString(),10)].cells[0].classList.contains("e-editcell")?e.rows[parseInt(t.toString(),10)].cells[0].querySelectorAll("td")[parseInt(i.toString(),10)]:e.rows[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]).getBoundingClientRect().width;if("enter"===n||"shiftEnter"===n)return s&&r.classList.contains(is);if(("shiftUp"===n||"shiftDown"===n)&&r.classList.contains(is))return s;if("shiftUp"!==n&&"shiftDown"!==n)return s}return!1}},e.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],n=void 0===i?-1:i,r=t[1],s=void 0===r?-1:r;if(n<0||s<0)return!0;var a=(0,o.getValue)(n+".cells."+s,this.getTable().rows);return!a||("enter"!==e.action&&"shiftEnter"!==e.action||(a.classList.contains(is)&&!a.classList.contains("e-unboundcell")||a.classList.contains("e-editedbatchcell")&&!a.classList.contains("e-detailcell")))},e.prototype.getGridSeletion=function(){return this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection},e}(),Po=function(e){function i(t){return e.call(this,t)||this}return Ao(i,e),i.prototype.getTable=function(){return this.parent.getHeaderTable()},i.prototype.onClick=function(e){this.focusType="click";var t=e.target;if(this.target=t,!(t=t.classList.contains("e-headercell")?t:(0,o.closest)(t,"th"))&&(0!==this.parent.frozenRows||0!==this.parent.pinnedTopRecords.length||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&(t=e.target.classList.contains(is)?e.target:(0,o.closest)(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(t){var i=t.parentElement.rowIndex;this.parent.editSettings.showAddNewRow&&_a(t,"e-addedrow")&&(i=_a(t,"e-addedrow").rowIndex);var n=[i,t.cellIndex],r=n[0],s=n[1],a=(0,o.getValue)(r+"."+s,this.matrix.matrix);if(this.matrix.inValid(a))return!1;this.matrix.select(i,t.cellIndex)}},i.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,i=t[0],n=void 0===i?0:i,r=t[1],s=void 0===r?0:r,a=this.getTable().rows[parseInt(n.toString(),10)];return e.element=(0,o.isNullOrUndefined)(a)?null:this.parent.editSettings.showAddNewRow&&a.classList.contains("e-addedrow")?a.querySelectorAll("td:not(.e-editcell)")[parseInt(s.toString(),10)]:a.cells[parseInt(s.toString(),10)],(0,o.isNullOrUndefined)(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},i.prototype.selector=function(e,i){return i.visible&&(void 0!==i.column.field||i.isTemplate||!(0,o.isNullOrUndefined)(i.column.template)||!(0,o.isNullOrUndefined)(i.column.commands)||"checkbox"===i.column.type)||i.cellType===t.StackedHeader},i.prototype.jump=function(e,t){var i,n,r=0!==this.parent.frozenRows&&"enter"===e;return this.parent.enableHeaderFocus&&"tab"===e&&(n=this.matrix.matrix.length-1===t[0],(i=t[1]===this.matrix.matrix[t[0]].lastIndexOf(1))&&(this.matrix.current[0]=n?0:this.matrix.current[0]+1,this.matrix.current[1]=-1)),{swap:("downArrow"===e||r)&&t[0]===this.matrix.matrix.length-1||"tab"===e&&n&&i}},i.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var r=[];return("rightArrow"===n||"shiftRight"===n&&this.getGridSeletion()||"tab"===n)&&(r[0]=e[0],r[1]=-1),"upArrow"!==n&&"shiftEnter"!==n||(r[0]=this.matrix.matrix.length,r[1]=e[1]),r},i.prototype.generateRows=function(e){var t=this.matrix.matrix.length;if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type){this.matrix.rows=++this.matrix.rows;for(var i=e[0].cells,n=0,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].column&&i[parseInt(r.toString(),10)].column.columns?n=this.checkFilterColumn(i[parseInt(r.toString(),10)].column.columns,t,n):(this.matrix.set(t,n,i[parseInt(r.toString(),10)].visible&&!1!==i[parseInt(r.toString(),10)].column.allowFiltering),n++)}},i.prototype.checkFilterColumn=function(e,t,i){for(var n=e,r=i,s=0;s<n.length;s++)n[parseInt(s.toString(),10)].columns?r=this.checkFilterColumn(n[parseInt(s.toString(),10)].columns,t,r):(this.matrix.set(t,r,n[parseInt(s.toString(),10)].visible&&!1!==n[parseInt(s.toString(),10)].allowFiltering),r++);return r},i.prototype.getInfo=function(t){return(0,o.extend)(e.prototype.getInfo.call(this,t),{isContent:!1,isHeader:!0})},i.prototype.validator=function(){return function(){return!0}},i.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],n=t[1];if(i<0||n<0)return!0;var r=(0,o.getValue)(i+".cells."+n,this.getTable().rows);return!r||("enter"!==e.action&&"altDownArrow"!==e.action||!r.classList.contains("e-headercell"))},i.prototype.getHeaderType=function(){return"HeaderFocus"},i}(Lo),No=function(){function e(e,t){this.searchBox=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization")}return e.prototype.searchFocus=function(e){if(e.target.parentElement.classList.add("e-input-focus"),e.target.classList.contains("e-input")&&e.target.classList.contains("e-search")&&e.target.value){var t=e.target.parentElement.querySelector(".e-sicon");t.classList.add("e-clear-icon"),t.setAttribute("title",this.l10n.getConstant("Clear")),t.style.cursor="pointer"}},e.prototype.searchBlur=function(e){var t=e.relatedTarget?e.relatedTarget:null;if(t&&t.classList.contains("e-sicon")?t.classList.contains("e-clear-icon")&&e.target.parentElement.classList.remove("e-input-focus"):e.target.parentElement.classList.remove("e-input-focus"),e.target.classList.contains("e-search")&&(t&&!t.classList.contains("e-sicon e-clear-icon")&&!t.classList.contains("e-sicon")||(0,o.isNullOrUndefined)(t))){var i=e.target.parentElement.querySelector(".e-sicon");i.classList.remove("e-clear-icon"),i.removeAttribute("title"),i.style.cursor="default"}},e.prototype.wireEvent=function(){this.searchBox&&(o.EventHandler.add(this.searchBox,"focus",this.searchFocus,this),o.EventHandler.add(this.searchBox,"blur",this.searchBlur,this))},e.prototype.unWireEvent=function(){this.searchBox&&(o.EventHandler.remove(this.searchBox,"focus",this.searchFocus),o.EventHandler.remove(this.searchBox,"blur",this.searchBlur))},e}(),Bo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zo=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},qo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Bo(t,e),zo([(0,o.Property)(12)],t.prototype,"pageSize",void 0),zo([(0,o.Property)(8)],t.prototype,"pageCount",void 0),zo([(0,o.Property)(1)],t.prototype,"currentPage",void 0),zo([(0,o.Property)()],t.prototype,"totalRecordsCount",void 0),zo([(0,o.Property)(!1)],t.prototype,"enableQueryString",void 0),zo([(0,o.Property)(!1)],t.prototype,"pageSizes",void 0),zo([(0,o.Property)(null)],t.prototype,"template",void 0),t}(o.ChildProperty),Uo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ho=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},jo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Uo(t,e),Ho([(0,o.Property)("startsWith")],t.prototype,"operator",void 0),Ho([(0,o.Property)(!1)],t.prototype,"ignoreAccent",void 0),Ho([(0,o.Property)(null)],t.prototype,"headerTemplate",void 0),Ho([(0,o.Property)(null)],t.prototype,"template",void 0),Ho([(0,o.Property)(null)],t.prototype,"footerTemplate",void 0),Ho([(0,o.Property)(!0)],t.prototype,"enableSearching",void 0),Ho([(0,o.Property)(null)],t.prototype,"renderCustomColumnChooser",void 0),t}(o.ChildProperty),Vo=function(){function e(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=!1,this.enableSelectMultiTouch=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.unSelectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.virtualSelectedData=[],this.partialSelectedData=[],this.deSelectedData=[],this.partialSelectableRecordsCount=0,this.disableSelectableRecordsCount=0,this.persistSelectedRecordsCount=0,this.partialSelectedRecordsCount=0,this.isHdrSelectAllClicked=!1,this.needColumnSelection=!1,this.isCancelDeSelect=!1,this.isPreventCellSelect=!1,this.disableUI=!1,this.isPersisted=!1,this.cmdKeyPressed=!1,this.cellselected=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.initialRowSelection=!1,this.isPrevRowSelection=!1,this.isKeyAction=!1,this.isRowDragSelected=!1,this.isPartialSelection=!1,this.rmtHdrChkbxClicked=!1,this.isCheckboxReset=!1,this.isRowDeselect=!1,this.autoFillRLselection=!0,this.isFocusLastCell=!1,this.bottom="0 0 2px 0",this.top="2px 0 0 0",this.right_bottom="0 2px 2px 0",this.bottom_left="0 0 2px 2px",this.top_right="2px 2px 0 0",this.top_left="2px 0 0 2px",this.top_bottom="2px 0 2px 0",this.top_right_bottom="2px 2px 2px 0",this.top_bottom_left="2px 0 2px 2px",this.top_right_left="2px 2px 0 2px",this.right_bottom_left="0 2px 2px 2px",this.all_border="2px",this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.addEventListener(),this.wireEvents()}return e.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),this.render()},e.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},e.prototype.fDataUpdate=function(e){if(!(this.isMultiSelection||(0,o.isNullOrUndefined)(e.cellIndex)&&(0,o.isNullOrUndefined)(e.rowIndex))){var t=this.getRowObj((0,o.isNullOrUndefined)(e.rowIndex)?(0,o.isNullOrUndefined)(e.cellIndex)?this.currentIndex:e.cellIndex.rowIndex:e.rowIndex);e.foreignKeyData=t.foreignKeyData}return e},e.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e)),this.isMultiSelection=!1},e.prototype.getModuleName=function(){return"selection"},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.hidePopUp(),this.clearSelection(),this.parent.partialSelectedRecords=[],this.parent.partialSelectedIndexes=[],this.parent.disableSelectedRecords=[],this.parent.renderModule.selectableDataKey={},this.parent.renderModule.nonselectableDataKey={},this.destroyAutoFillElements(),this.removeEventListener(),this.unWireEvents(),o.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),o.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler))},e.prototype.isEditing=function(){return("Normal"===this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate())&&this.parent.isEdit&&!this.parent.editSettings.showAddNewRow&&!this.parent.isPersistSelection},e.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){var t=Ba(this.parent.getCurrentViewRecords());t="Bottom"===e.editSettings.newRowPosition?t.concat(this.parent.editModule.getBatchChanges()[Ss]):this.parent.editModule.getBatchChanges()[Ss].concat(t);for(var i=this.parent.editModule.getBatchChanges()[Cs],n=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)for(var s=0;s<t.length;s++)if(i[parseInt(r.toString(),10)][""+n]===t[parseInt(s.toString(),10)][""+n]){t.splice(s,1);break}return t}return this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&!this.parent.isPersistSelection?e.getCurrentViewRecords().filter(function(e){return void 0===e.key}):e.getCurrentViewRecords()},e.prototype.selectRow=function(e,t){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)this.addRowsToSelection([e]);else{var i=this.parent,n=i.getRowByIndex(e),r=n&&i.getRowObjectFromUID(n.getAttribute("data-uid"));if(!(this.isPartialSelection&&r&&r.isDataRow)||r.isSelectable){if(this.parent.pinnedTopRecords.length&&n&&n.classList.contains("e-grid-pin-row"))return this.parent.isCheckBoxSelection?void(-1===this.selectedRowIndexes.indexOf(e)&&this.addRowsToSelection([e])):void(-1===this.selectedRowIndexes.indexOf(e)?this.selectRows([e]):this.clearRowSelection());var s,o=!1;if(i.enableVirtualization&&e>-1){var a={selectedIndex:e,isAvailable:!0};if(this.parent.notify(Yi,a),!n||!i.getRowObjectFromUID(n.getAttribute("data-uid"))){if(a.isAvailable&&!i.selectionSettings.persistSelection)this.parent.getSelectedRecords().length>0&&this.clearRowSelection();return}s=i.getRowObjectFromUID(n.getAttribute("data-uid")).data}else s=this.getRowObj(e).data;if(this.isRowType()&&n&&!this.isEditing()){var l,h=n.hasAttribute("aria-selected");if(this.activeTarget(),t&&this.selectedRowIndexes.length){var d="ResetOnRowClick"===this.selectionSettings.checkboxMode,p=!this.parent.isCheckBoxSelection&&"Multiple"===this.selectionSettings.type;t=!((d||p)&&(1!==this.selectedRowIndexes.length||!d&&!p))&&((!this.isKeyAction||!this.parent.isCheckBoxSelection)&&-1!==this.selectedRowIndexes.indexOf(e))}else t=!1;this.isKeyAction=!1;var c="cancel";if(t){if("ResetOnRowClick"!==this.selectionSettings.checkboxMode&&this.selectionSettings.persistSelection){if(this.rowDeselect(A,[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget),this.isCancelDeSelect)return;this.parent.isCheckBoxSelection||(this.selectedRowIndexes=[],this.selectedRecords=[],this.isRowSelected=!1,this.selectRowIndex(-1)),this.rowDeselect(F,[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget,void 0,void 0,void 0)}this.rowSelectingCallBack(l,t,e,s,o,h,c)(l)}else l={data:s,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:n,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger(O,this.fDataUpdate(l),this.rowSelectingCallBack(l,t,e,s,o,h,c))}}}},e.prototype.rowSelectingCallBack=function(e,t,i,n,r,s,a){var l=this;return function(e){(0,o.isNullOrUndefined)(e)||!0!==e[""+a]?(l.index=i,l.toggle=t,l.data=n,l.removed=r,s&&l.selectionSettings.persistSelection&&"ResetOnRowClick"!==l.selectionSettings.checkboxMode?(l.clearSelectedRow(i),l.selectRowCallBack()):!s&&l.selectionSettings.persistSelection&&l.parent.isCheckBoxSelection&&"ResetOnRowClick"!==l.selectionSettings.checkboxMode&&l.selectRowCallBack(),"ResetOnRowClick"===l.selectionSettings.checkboxMode&&(l.isCheckboxReset=!0,l.clearSelection()),(!l.selectionSettings.persistSelection||"ResetOnRowClick"===l.selectionSettings.checkboxMode||!l.parent.isCheckBoxSelection&&l.selectionSettings.persistSelection)&&(l.selectRowCheck=!0,l.clearRow())):l.disableInteracted()}},e.prototype.selectRowCallBack=function(){var e,t=this.parent,i=this.index,n=this.toggle,r=this.data,s=this.removed,o=t.getRowByIndex(i);n||s||(this.selectedRowIndexes.indexOf(i)<=-1&&this.updateRowSelection(o,i),this.selectRowIndex(i)),n||(e={data:r,rowIndex:i,row:o,previousRow:t.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked,rowIndexes:i},this.onActionComplete(e,k)),this.isInteracted=!1,this.updateRowProps(i)},e.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},e.prototype.selectedDataUpdate=function(e,t,i,n,r){for(var s=0,o=n.length;s<o;s++){var a=this.parent.getDataRows()[n[parseInt(s.toString(),10)]];this.parent.enableVirtualization&&(a=this.parent.getRowByIndex(n[parseInt(s.toString(),10)]));var l=this.getRowObj(a);l&&l.isDataRow&&l.isSelectable?(e.push(l.data),i.push(a),t.push(l.foreignKeyData)):this.isPartialSelection&&r&&r.splice(r.indexOf(n[parseInt(s.toString(),10)]),1)}},e.prototype.selectRows=function(e){var t=this,i=this.parent,n=e.slice(),r=this.isSingleSel()?e[e.length-1]:e[0];this.isMultiSelection=!0;var s=[],a=[],l=[];if(this.isRowType()&&!this.isEditing()){if(this.parent.pinnedTopRecords.length)e=this.selectPinnedRowIndexes(e).concat(e),n=e.slice();this.selectedDataUpdate(l,a,s,e,n),this.activeTarget();var h={cancel:!1,rowIndexes:n,row:s,rowIndex:r,target:this.actualTarget,prevRow:i.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:l,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:a};this.parent.trigger(O,this.fDataUpdate(h),function(e){if((0,o.isNullOrUndefined)(e)||!0!==e.cancel){t.selectionSettings.persistSelection&&i.allowRowDragAndDrop&&t.isDragged||t.clearRow(),t.selectRowIndex(n.slice(-1)[0]);var l=function(e,n){t.updateRowSelection(i.getRowByIndex(e),e,n),t.updateRowProps(r)};if(t.isSingleSel())l(r);else for(var h=0,d=n;h<d.length;h++){l(d[h],!!i.enableVirtualization)}if(t.checkVirtualCheckBox()&&!t.parent.isPersistSelection)if(n.length===t.totalRecordsCount)t.virtualSelectedData=t.virtualCheckBoxData().slice(),t.selectedRowIndexes=Object.keys(t.virtualSelectedData).map(function(e){return parseInt(e,10)}),t.setCheckAllState();else{var p=n.filter(function(e){return-1===t.selectedRowIndexes.indexOf(e)});if(p.length>0){for(var c=t.virtualCheckBoxData().slice(),u=0;u<p.length;u++){var g=c[p[u]];(0,o.isNullOrUndefined)(g)||(t.virtualSelectedData.push(g),t.selectedRowIndexes.push(p[u]))}t.setCheckAllState()}}e={rowIndexes:n,row:s,rowIndex:r,target:t.actualTarget,prevRow:i.getRows()[t.prevRowIndex],previousRowIndex:t.prevRowIndex,data:t.getSelectedRecords(),isInteracted:t.isInteracted,isHeaderCheckboxClicked:t.isHeaderCheckboxClicked,foreignKeyData:a},t.isRowSelected&&t.onActionComplete(e,k),t.isInteracted=!1}else t.disableInteracted()})}},e.prototype.addRowsToSelection=function(e){var t=this.parent,i=this.target;this.isMultiSelection=!0;var n=[],r=[],s=[],a=t.getSelectedRowIndexes().concat(e),l=this.isSingleSel()?t.getRowByIndex(e[e.length-1]):t.getRowByIndex(e[0]),h=(0,o.isNullOrUndefined)(l.querySelector(".e-checkselect"))&&(0,o.isNullOrUndefined)(l.querySelector(".e-edit-checkselect"));if(this.isRowType()&&!this.isEditing()||!h){var d;if(this.parent.pinnedTopRecords.length&&!(0,o.isNullOrUndefined)(l)&&l.classList.contains("e-grid-pin-row"))e=this.selectPinnedRowIndexes(e).concat(e);var p=this.parent.getColumns().filter(function(e){return"checkbox"===e.type});this.isMultiCtrlRequest&&!p.length&&this.selectedDataUpdate(s,r,n,a);for(var c=0,u=e;c<u.length;c++){var g=u[c],f=this.getRowObj(g),m=this.parent.getPrimaryKeyFieldNames()[0],y=this.isLazyLoadPersistSelection()?!(0,o.isNullOrUndefined)(this.parent.selectionModule.selectedRowState[f.data[""+m]]):this.selectedRowIndexes.indexOf(g)>-1;if(!(this.isPartialSelection&&f&&f.isDataRow)||f.isSelectable){if(this.parent.pinnedTopRecords.length&&!(0,o.isNullOrUndefined)(l)&&l.classList.contains("e-grid-pin-row")){var v=this.parent.getRowByIndex(g);l=(0,o.isNullOrUndefined)(v)?l:v}if(this.selectRowIndex(g),y&&(p.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect(A,[g],[f.data],[l],[f.foreignKeyData],i),this.isCancelDeSelect)return;this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData.splice(this.virtualSelectedData.indexOf(f.data),1):!this.parent.isRemote()&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection&&this.partialSelectedData.splice(this.partialSelectedData.indexOf(f.data),1),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(g),1),this.selectedRecords.splice(this.selectedRecords.indexOf(l),1),this.selectRowIndex(this.selectedRowIndexes.length?this.selectedRowIndexes[this.selectedRowIndexes.length-1]:-1),l.removeAttribute("aria-selected"),this.addRemoveClassesForRow(l,!1,null,"e-selectionbackground","e-active"),this.rowDeselect(F,[g],[f.data],[l],[f.foreignKeyData],i,void 0,void 0,void 0),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.isHdrSelectAllClicked=!1}else{if(this.activeTarget(),d={cancel:!1,data:s.length?s:f.data,rowIndex:g,row:n.length?n:l,target:this.actualTarget,prevRow:t.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:r.length?r:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:a},this.parent.trigger(O,this.fDataUpdate(d)),!(0,o.isNullOrUndefined)(d)&&!0===d.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(l,g)}if(y||(d={data:s.length?s:f.data,rowIndex:g,row:n.length?n:l,target:this.actualTarget,prevRow:t.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:r.length?r:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:a},this.onActionComplete(d,k)),this.isInteracted=!1,this.updateRowProps(g),this.isSingleSel())break}}}},e.prototype.selectPinnedRowIndexes=function(e){var t=[],i=this.parent.pinnedRowIndexes,n=this.parent.contentRowIndexes;return e.map(function(r){i[parseInt(r.toString(),10)]&&null!==i[parseInt(r.toString(),10)].contentIndex&&-1===e.indexOf(i[parseInt(r.toString(),10)].contentIndex)&&t.push(i[parseInt(r.toString(),10)].contentIndex),n[parseInt(r.toString(),10)]&&null!==n[parseInt(r.toString(),10)].pinnedIndex&&-1===e.indexOf(n[parseInt(r.toString(),10)].pinnedIndex)&&t.push(n[parseInt(r.toString(),10)].pinnedIndex)}),t},e.prototype.setPinnedSelectionIndexes=function(){this.parent.pinnedRowIndexes={},this.parent.contentRowIndexes={};for(var e=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),t=this.parent.pinnedTopRowModels,i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)].index,s=t[parseInt(n.toString(),10)].data[""+i],o=this.parent.getRowIndexByPrimaryKey(s);this.parent.pinnedRowIndexes[parseInt(r.toString(),10)]={pinnedIndex:r,contentIndex:-1===o?null:o}}for(var a=0;a<e.length;a++){o=e[parseInt(a.toString(),10)].index,s=e[parseInt(a.toString(),10)].data[""+i];var l=this.parent.getPinnedRowObjectByKey(s);r=null===l?null:l.index;this.parent.contentRowIndexes[parseInt(o.toString(),10)]={pinnedIndex:r,contentIndex:o}}},e.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],n=e<=t?{i:e,max:t}:{i:t,max:e},r=n.i,s=n.max;r<=s;r++)i.push(r);return e>t&&i.reverse(),i},e.prototype.clearRow=function(){this.clearRowCheck=!0,this.clearRowSelection()},e.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},e.prototype.clearSelectedRow=function(e){if(this.toggle){var t=this.parent.getRowByIndex(e);this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.removed=!0,this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1)}},e.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},e.prototype.getPkValue=function(e,t){return e&&hl(e)?Ml(e,t):t[""+e]},e.prototype.updatePersistCollection=function(e,t){var i=this;if((this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0)&&!(0,o.isNullOrUndefined)(e)){this.parent.isPersistSelection||this.ensureCheckboxFieldSelection();var n=this.getRowObj(e),r=n.data?this.getPkValue(this.primaryKey,n.data):null;if(null===r)return;n.isSelected=t,t&&!this.isPartialSelection||this.isPartialSelection&&n.isSelectable&&n.isSelected?(this.selectedRowState[""+r]=t,delete this.unSelectedRowState[""+r],this.persistSelectedData.some(function(e){return i.getPkValue(i.primaryKey,e)===r})||(this.persistSelectedData.push(n.data),this.persistSelectedRecordsCount+=1)):this.parent.isPersistSelection||(0,o.isNullOrUndefined)(this.contentRenderer.requestType)?this.updatePersistDelete(r):(this.persistSelectedData=[],this.selectedRowState={})}},e.prototype.updatePersistDelete=function(e,t){var i,n=this;delete this.selectedRowState[""+e],this.rmtHdrChkbxClicked&&(this.unSelectedRowState[""+e]=!0),this.persistSelectedData.some(function(t,r){return i=r,n.getPkValue(n.primaryKey,t)===e})&&(this.persistSelectedData.splice(i,1),this.persistSelectedRecordsCount-=1,t&&(this.parent.partialSelectedRecords.splice(i,1),this.parent.partialSelectedIndexes.splice(i,1),this.selectedRowIndexes.splice(i,1)))},e.prototype.updateCheckBoxes=function(e,t,i){if(!(0,o.isNullOrUndefined)(e)){var n=(0,o.isNullOrUndefined)(e.querySelector(".e-checkselect"))?e.querySelector(".e-edit-checkselect"):e.querySelector(".e-checkselect");(0,o.isNullOrUndefined)(n)||(Dl(n.nextElementSibling,t),xl(n,t),((0,o.isNullOrUndefined)(this.checkedTarget)||!(0,o.isNullOrUndefined)(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(i))}},e.prototype.updateRowSelection=function(e,t,i){if(e&&(-1===this.selectedRowIndexes.indexOf(t)&&(this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data):!this.parent.isRemote()&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection&&this.partialSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data),this.selectedRowIndexes.push(t),this.selectedRecords.push(e)),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),!this.preventFocus||this.parent.isFocusFirstCell||this.isFocusLastCell)){var n=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop)");if(this.parent.contextMenuModule&&2===this.mouseButton&&(n=this.parent.contextMenuModule.cell),this.parent.isFocusFirstCell||this.isFocusLastCell){this.parent.isFocusFirstCell=!1;var r=this.isFocusLastCell?"last-child":"first-child";n=e.querySelector(".e-selectionbackground.e-rowcell:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop, .e-gridchkbox):"+r),this.isFocusLastCell=!1}if(!n||i||this.parent.isCheckBoxSelection&&this.isLazyLoadGroup()&&this.parent.enableInfiniteScrolling)return;this.focus.onClick({target:n},!0,!(this.parent.contextMenuModule&&2===this.mouseButton))}},e.prototype.clearSelection=function(){if(this.checkSelectAllClicked=!0,this.selectionSettings.persistSelection&&this.persistSelectedData.length&&(this.deSelectedData=this.persistSelectedData.slice()),!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!(0,o.isNullOrUndefined)(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall")){var e=this.parent.element.querySelector(".e-gridpopup").querySelector("span");e.classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),(this.parent.isPersistSelection||this.parent.isRemote())&&(this.persistSelectedData=[],this.selectedRowState={},this.persistSelectedRecordsCount=0),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0,this.enableSelectMultiTouch=!1,"ResetOnRowClick"===this.selectionSettings.checkboxMode&&this.target&&_a(this.target,"e-rowcell")||(this.isInteracted=!1),this.checkSelectAllClicked=!1,this.isHdrSelectAllClicked=!1,this.rmtHdrChkbxClicked=!1}},e.prototype.clearRowSelection=function(){var e=this;if(this.isRowSelected){var t=this.parent.getDataRows(),i=[],n=[],r=[],s=[],o=this.target;this.isRowDeselect=!0;for(var a=0,l=this.selectedRowIndexes.length;a<l;a++){var h=void 0;h=this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache?this.parent.getRowByIndex(this.selectedRowIndexes[parseInt(a.toString(),10)]):"Batch"===this.parent.editSettings.mode?this.parent.getRows()[this.selectedRowIndexes[parseInt(a.toString(),10)]]:this.parent.getDataRows()[this.selectedRowIndexes[parseInt(a.toString(),10)]];var d=this.getRowObj(h);d&&(i.push(d.data),n.push(h),r.push(this.selectedRowIndexes[parseInt(a.toString(),10)]),s.push(d.foreignKeyData))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect(A,r,i,n,s,o,null,function(){if(e.isCancelDeSelect&&(e.isRowClicked||e.checkSelectAllClicked||e.isInteracted&&!e.parent.isPersistSelection)){if(e.parent.isPersistSelection)if("Intermediate"===e.getCheckAllStatus(e.parent.element.querySelector(".e-checkselectall"))||e.parent.isPersistSelection)for(var a=0;a<e.selectedRecords.length;a++)e.updatePersistCollection(e.selectedRecords[parseInt(a.toString(),10)],!0);else e.parent.checkAllRows="Check",e.updatePersistSelectedData(!0);e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1))}else{for(var l=[].slice.call(t.filter(function(e){return e.hasAttribute("aria-selected")})),h=0;h<l.length;h++)e.disableUI||(l[parseInt(h.toString(),10)].removeAttribute("aria-selected"),e.addRemoveClassesForRow(l[parseInt(h.toString(),10)],!1,!0,"e-selectionbackground","e-active")),e.isPrevRowSelection||e.updatePersistCollection(l[parseInt(h.toString(),10)],!1),e.updateCheckBoxes(l[parseInt(h.toString(),10)]);!(e.parent.enableVirtualization||e.parent.enableInfiniteScrolling&&e.parent.infiniteScrollSettings.enableCache)||!e.selectedRecords.length||l.length||e.parent.selectionSettings.persistSelection||e.disableUI||e.parent.isCheckBoxSelection||e.addRemoveClassesForRow(null,!1,!0),e.virtualSelectedData=[],e.selectedRowIndexes=[],e.partialSelectedData=[],e.selectedRecords=[],e.partialSelectedRecordsCount=0,e.isRowSelected=!1,e.selectRowIndex(-1),e.isPrevRowSelection=!1,e.rowDeselect(F,r,i,n,s,o,null,void 0,null),e.clearRowCheck&&(e.clearRowCallBack(),e.clearRowCheck=!1,e.selectRowCheck&&(e.selectRowCallBack(),e.selectRowCheck=!1))}},null),this.isRowDeselect=!1}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck&&(this.selectRowCallBack(),this.selectRowCheck=!1))},e.prototype.rowDeselect=function(e,t,i,n,r,s,a,l,h){var d=this;if(this.selectionSettings.persistSelection&&(this.isRowClicked||!this.isRowDeselect||this.checkSelectAllClicked||this.focus.activeKey&&this.focus.currentInfo.element.classList.contains("e-gridchkbox")&&"space"===this.focus.activeKey)||!this.selectionSettings.persistSelection){var p=1===t.length&&1===this.deSelectedData.length,c={rowIndex:t[0],data:this.selectionSettings.persistSelection&&"Uncheck"===this.parent.checkAllRows&&!p&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode?this.deSelectedData:i,foreignKeyData:r,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked};"rowDeselected"===e&&delete c.cancel;var u="row",g="rowIndexes",f="data",m="foreignKeyData";c[""+u]=n,c.target=this.actualTarget,this.actualTarget&&!(0,o.isNullOrUndefined)((0,o.closest)(this.actualTarget,"thead"))||t.length>1?(c.rowIndex=t[0],c[""+g]=t):1===t.length&&(c[""+f]=c[""+f][0],c[""+u]=c[""+u][0],c[""+m]=c[""+m][0],this.isAddRowsToSelection&&(c[""+g]=t)),this.parent.trigger(e,c,function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isRowClicked||d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,t[0])),void 0!==l&&l()})}else this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==l&&l()},e.prototype.getRowObj=function(e){return void 0===e&&(e=this.currentIndex),(0,o.isNullOrUndefined)(e)?{}:("number"==typeof e&&(e=this.parent.getRowByIndex(e)),e&&this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{})},e.prototype.selectCell=function(e,t){if(!(!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache))){var i,n=this.parent.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex));this.currentIndex=e.rowIndex;var r=this.getCurrentBatchRecordChanges()[this.currentIndex];if(this.isCellType()&&n&&!this.isEditing()){var s=n.classList.contains("e-cellselectionbackground");if(t=t?!(0,o.isUndefined)(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&s:t)this.successCallBack(i,t,e,n,r)(i);else{(i={data:r,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1}).currentCell=n;i.previousRowCellIndex=this.prevECIdxs,this.parent.trigger(M,this.fDataUpdate(i),this.successCallBack(i,t,e,n,r)),this.cellselected=!0}}}},e.prototype.successCallBack=function(e,t,i,n,r){var s=this;return function(e){var a="currentCell";if(((0,o.isNullOrUndefined)(e)||!0!==e.cancel)&&(t||(e[""+a]=e[""+a]?e[""+a]:n),s.clearCell(),t||s.updateCellSelection(n,i.rowIndex,i.cellIndex),!t)){var l={data:r,cellIndex:i,currentCell:n,selectedRowCellIndex:s.selectedRowCellIndexes,previousRowCell:s.prevECIdxs?s.getCellIndex(s.prevECIdxs.rowIndex,s.prevECIdxs.cellIndex):void 0};l.previousRowCellIndex=s.prevECIdxs,s.updateCellProps(i,i),s.onActionComplete(l,L)}}},e.prototype.getCellIndex=function(e,t){return this.parent.getCellFromIndex(e,t)},e.prototype.selectCellsByRange=function(e,t){var i=this;if(this.isCellType()){var n,r,s,a=this.parent,l=this.parent.isSpan?mh(this.parent,e.rowIndex,e.cellIndex):a.getCellFromIndex(e.rowIndex,e.cellIndex),h=e,d=t=t||e;this.currentIndex=e.rowIndex;var p=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var c={data:p,cellIndex:e,currentCell:l,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};c.previousRowCellIndex=this.prevECIdxs,this.parent.trigger(M,this.fDataUpdate(c),function(c){if((0,o.isNullOrUndefined)(c)||!0!==c.cancel){if(i.clearCell(),e.rowIndex>t.rowIndex){var u=e;e=t,t=u}for(var g=e.rowIndex;g<=t.rowIndex;g++){i.selectionSettings.cellSelectionMode.indexOf("Box")<0?(n=g===e.rowIndex?e.cellIndex:0,r=g===t.rowIndex?t.cellIndex:i.getLastColIndex(g)):(n=e.cellIndex,r=t.cellIndex),s=[];for(var f=n<r?n:r,m=n>r?n:r;f<=m;f++)(l=i.parent.isSpan?mh(a,g,f):a.getCellFromIndex(g,f))&&(s.push(f),i.updateCellSelection(l),i.addAttribute(l));i.selectedRowCellIndexes.push({rowIndex:g,cellIndexes:s})}var y={data:p,cellIndex:d,currentCell:a.getCellFromIndex(d.rowIndex,d.cellIndex),selectedRowCellIndex:i.selectedRowCellIndexes,previousRowCell:i.prevECIdxs?i.getCellIndex(i.prevECIdxs.rowIndex,i.prevECIdxs.cellIndex):void 0};y.previousRowCellIndex=i.prevECIdxs,i.isDragged||(i.onActionComplete(y,L),i.cellselected=!0),i.updateCellProps(h,d)}})}}},e.prototype.selectCells=function(e){if(this.isCellType()){var t=this.parent,i=t.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0]);this.currentIndex=e[0].rowIndex;var n=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var r={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};r.previousRowCellIndex=this.prevECIdxs,this.onActionBegin(r,M);for(var s=0,o=e.length;s<o;s++)for(var a=0,l=e[parseInt(s.toString(),10)].cellIndexes.length;a<l;a++)(i=t.getCellFromIndex(e[parseInt(s.toString(),10)].rowIndex,e[parseInt(s.toString(),10)].cellIndexes[parseInt(a.toString(),10)]))&&(this.updateCellSelection(i),this.addAttribute(i),this.addRowCellIndex({rowIndex:e[parseInt(s.toString(),10)].rowIndex,cellIndex:e[parseInt(s.toString(),10)].cellIndexes[parseInt(a.toString(),10)]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});var h={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};h.previousRowCellIndex=this.prevECIdxs,this.onActionComplete(h,L)}}},e.prototype.addCellsToSelection=function(e){if(!(!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache))){var t,i,n=this.parent;this.currentIndex=e[0].rowIndex;var r=this.getCurrentBatchRecordChanges()[this.currentIndex];if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var s;this.hideAutoFill(),s=n.getRowsObject()[e[0].rowIndex],n.groupSettings.columns.length>0&&(s=n.getRowObjectFromUID(this.target.parentElement.getAttribute("data-uid")));for(var a=[],l=0,h=e;l<h.length;l++){for(var d=h[l],p=0,c=this.selectedRowCellIndexes.length;p<c;p++)if(this.selectedRowCellIndexes[parseInt(p.toString(),10)].rowIndex===d.rowIndex){i=p;break}t=n.getCellFromIndex(d.rowIndex,this.getColIndex(d.rowIndex,d.cellIndex));var u=d.cellIndex;n.groupSettings.columns.length>0?a.push(s.cells[u+n.groupSettings.columns.length].foreignKeyData):a.push(s.cells[parseInt(u.toString(),10)].foreignKeyData);var g={cancel:!1,data:r,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:t,isCtrlPressed:this.isMultiCtrlRequest,previousRowCell:this.prevECIdxs?n.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0},f="previousRowCellIndex";g[""+f]=this.prevECIdxs;var m=i>-1;if(m){var y=this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes;y.indexOf(d.cellIndex)>-1||"Both"===this.selectionSettings.mode&&t.classList.contains("e-gridchkbox")&&!t.getAttribute("aria-selected")?(this.cellDeselect(P,[{rowIndex:d.rowIndex,cellIndexes:[d.cellIndex]}],r,[t],a),y.splice(y.indexOf(d.cellIndex),1),0===y.length&&this.selectedRowCellIndexes.splice(i,1),t.classList.remove("e-cellselectionbackground"),t.removeAttribute("aria-selected"),this.cellDeselect(N,[{rowIndex:d.rowIndex,cellIndexes:[d.cellIndex]}],r,[t],a)):(m=!1,this.onActionBegin(g,M),this.addRowCellIndex({rowIndex:d.rowIndex,cellIndex:d.cellIndex}),this.updateCellSelection(t),this.addAttribute(t))}else{if(this.onActionBegin(g,M),!(0,o.isNullOrUndefined)(g)&&!0===g.cancel)return;this.updateCellSelection(t,d.rowIndex,d.cellIndex)}if(!m){var v={data:r,cellIndex:e[0],currentCell:t,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes};v[""+f]=this.prevECIdxs,this.onActionComplete(v,L),this.cellselected=!0}this.updateCellProps(d,d)}}}},e.prototype.getColIndex=function(e,t){var i=this.parent.getColumnByIndex(t),n=vh(this.parent,i,e);if(n)for(var r=0;r<n.length;r++){if(parseInt(n[parseInt(r.toString(),10)].getAttribute(xs),10)-1===t)return r}return-1},e.prototype.getLastColIndex=function(e){var t=this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll("td.e-rowcell");return parseInt(t[t.length-1].getAttribute(xs),10)-1},e.prototype.clearCell=function(){this.clearCellSelection()},e.prototype.cellDeselect=function(e,t,i,n,r){if(n&&n.length>0)for(var s=0,a=n;s<a.length;s++){var l=a[s];l&&l.classList.contains(gs)&&this.updateCheckBoxes((0,o.closest)(l,"tr"))}var h={cells:n,data:i,cellIndexes:t,foreignKeyData:r,cancel:!1};this.parent.trigger(e,h),this.isPreventCellSelect=h.cancel},e.prototype.updateCellSelection=function(e,t,i){(0,o.isNullOrUndefined)(t)||this.addRowCellIndex({rowIndex:t,cellIndex:i}),e.classList.add("e-cellselectionbackground"),e.classList.contains(gs)&&this.updateCheckBoxes((0,o.closest)(e,"tr"),!0),this.addAttribute(e)},e.prototype.addAttribute=function(e){this.target=e,(0,o.isNullOrUndefined)(e)||(e.setAttribute("aria-selected","true"),this.preventFocus||this.focus.onClick({target:e},!0,!0))},e.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},e.prototype.addRowCellIndex=function(e){for(var t,i,n=0,r=this.selectedRowCellIndexes.length;n<r;n++)if(this.selectedRowCellIndexes[parseInt(n.toString(),10)].rowIndex===e.rowIndex){t=!0,i=n;break}t?this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},e.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),i=this.selectedRowCellIndexes,n=[],r=[],s=[],o=this.getCurrentBatchRecordChanges();this.hideAutoFill();for(var a=0,l=i.length;a<l;a++){n.push(o[i[parseInt(a.toString(),10)].rowIndex]);for(var h=this.getRowObj(i[parseInt(a.toString(),10)].rowIndex),d=0,p=i[parseInt(a.toString(),10)].cellIndexes.length;d<p;d++)h.cells&&s.push(h.cells[i[parseInt(a.toString(),10)].cellIndexes[parseInt(d.toString(),10)]].foreignKeyData),r.push(e.getCellFromIndex(i[parseInt(a.toString(),10)].rowIndex,i[parseInt(a.toString(),10)].cellIndexes[parseInt(d.toString(),10)]))}if(this.cellDeselect(P,i,n,r,s),!0===this.isPreventCellSelect)return;for(a=0,l=t.length;a<l;a++)t[parseInt(a.toString(),10)].classList.remove("e-cellselectionbackground"),t[parseInt(a.toString(),10)].removeAttribute("aria-selected");this.bdrElement&&this.showHideBorders("none"),this.selectedRowCellIndexes=[],this.isCellSelected=!1,!this.isDragged&&this.cellselected&&this.cellDeselect(N,i,n,r,s)}},e.prototype.getSelectedCellsElement=function(){for(var e=this.parent.getDataRows(),t=[],i=0,n=e.length;i<n;i++)t=t.concat([].slice.call(e[parseInt(i.toString(),10)].getElementsByClassName("e-cellselectionbackground")));return t},e.prototype.mouseMoveHandler=function(e){e.preventDefault(),this.stopTimer();var t,i=this.parent.element.getBoundingClientRect(),n=this.x,r=this.y,s=Ya(e),a=s.x-i.left,l=s.y-i.top,h=(0,o.closest)(e.target,"tr");if(this.isDragged=!0,this.isCellDrag||(h||(h=(0,o.closest)(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr")),n>a&&(t=a,a=n,n=t),r>l&&(t=l,l=r,r=t),this.element.style.left=n+"px",this.element.style.top=r+"px",this.element.style.width=a-n+"px",this.element.style.height=l-r+"px"),h&&!e.ctrlKey&&!e.shiftKey){var d=parseInt(h.getAttribute(Rs),10)-1;if(this.isCellDrag){var p=_a(e.target,is);p&&(this.startAFCell=this.startCell,this.endAFCell=_a(e.target,is),d>-1&&this.selectLikeExcel(e,d,parseInt(p.getAttribute(xs),10)-1))}else this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,d),this.isRowDragSelected=!0}e.ctrlKey||e.shiftKey||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.enableColumnVirtualization||this.parent.groupSettings.columns.length||!this.isCellDrag||this.updateScrollPosition(e,s,this.parent.getContent())},e.prototype.updateScrollPosition=function(e,t,i){var n=this,r=i.getBoundingClientRect();r.left>=t.x-20-(this.parent.enableRtl&&"auto"!==this.parent.height?ol():0)?this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"right":"left",e)},200):r.left+i.clientWidth-20-(this.parent.enableRtl||"auto"===this.parent.height?0:ol())<t.x&&(this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"left":"right",e)},200)),r.top>=t.y-.5*this.parent.getRowHeight()?this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"up",e)},200):r.top+i.clientHeight-.5*this.parent.getRowHeight()-(i.firstElementChild.scrollWidth>i.firstElementChild.offsetWidth?ol():0)<=t.y&&(this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"down",e)},200))},e.prototype.stopTimer=function(){this.timer1&&(window.clearInterval(this.timer1),this.timer1=null),this.timer2&&(window.clearInterval(this.timer2),this.timer2=null),this.preventFocus=!1},e.prototype.setScrollPosition=function(e,t,i){var n=-1,r=-1;switch((this.endAFCell||this.prevECIdxs)&&(n=this.endAFCell?parseInt(this.endAFCell.getAttribute("data-index"),10):this.prevECIdxs.rowIndex,r=this.endAFCell?parseInt(this.endAFCell.getAttribute("aria-colindex"),10)-1:this.prevECIdxs.cellIndex),t){case"up":if(i&&(0,o.closest)(i.target,".e-headercontent"))return;this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(1===this.selectedRowCellIndexes.length&&this.startAFCell!==this.startCell||this.selectedRowCellIndexes.length>1&&this.startAFCell.getBoundingClientRect().top>0)&&(n=parseInt(this.startAFCell.getAttribute("data-index"),10)),n-=1,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(n+=(this.parent.frozenRows||this.parent.pinnedTopRecords.length)+1),n<1?e.scrollTop=0:e.scrollTop-=this.parent.getRowByIndex(n).offsetHeight;break;case"down":this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(n=parseInt(this.startAFCell.getAttribute("data-index"),10)),n<this.parent.getRows().length-1?(n+=1,this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(n,this.selectedRowCellIndexes[0].cellIndexes[0])),e.scrollTop+=this.parent.getRowByIndex(n).offsetHeight):e.scrollTop=e.scrollHeight;break;case"left":if(r>0&&n>-1){this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(this.selectedRowCellIndexes[0].cellIndexes.length>0&&this.startAFCell!==this.startCell||this.selectedRowCellIndexes[0].cellIndexes.length>1&&(!this.parent.enableRtl&&this.startAFCell.getBoundingClientRect().left>0||this.parent.enableRtl&&this.startAFCell.getBoundingClientRect().left<this.parent.element.offsetWidth))&&(r=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1);var s=this.findNextCell(e,t,r,n);r=s?parseInt(s.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&s?r<1?e.scrollLeft=e.scrollWidth:e.scrollLeft+=s.offsetWidth:s&&(r<1?e.scrollLeft=0:e.scrollLeft-=s.offsetWidth)}break;case"right":this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(r=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1);var a=this.parent.getCellFromIndex(n,r),l=this.findNextCell(e,t,r,n);l&&this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(this.selectedRowCellIndexes[0].rowIndex,parseInt(l.getAttribute("aria-colindex"),10)-1)),r=l?parseInt(l.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&l?r<this.parent.columns.length-1?e.scrollLeft-=a.offsetWidth:e.scrollLeft=-e.scrollWidth:l&&(r<this.parent.columns.length-1?e.scrollLeft+=a.offsetWidth:e.scrollLeft=e.scrollWidth),this.isAutoFillSel&&(r===this.parent.columns.length-1||-1===r)&&this.startAFCell&&this.endAFCell&&(this.positionAFBorders(),e.scrollLeft=this.parent.enableRtl?-e.scrollWidth:e.scrollWidth)}if(n>-1&&n<this.parent.getRows().length&&r>-1){var h={target:this.parent.getCellFromIndex(n,r)};if(this.isAutoFillSel&&h.target.classList.contains("e-cellselectionbackground")&&("down"===t&&parseInt(h.target.getAttribute("data-index"),10)===this.parent.getRows().length-1||"right"===t&&parseInt(h.target.getAttribute("aria-colindex"),10)-1==this.parent.columns.length-1))return;this.endAFCell=h.target,this.preventFocus=!0,this.selectLikeExcel(h,n,r)}},e.prototype.findNextCell=function(e,t,i,n){var r=this.parent.getCellFromIndex(n,"left"===t?i-1:i+1);if(r&&r.classList.contains("e-hide")){var s=r.closest("tr").querySelectorAll(".e-rowcell:not(.e-hide)"),o=Array.from(s).indexOf(r.nextElementSibling);return o>0&&o<s.length-1?r=s[o+("left"===t?-1:1)]:(e.scrollLeft=0,null)}return r},e.prototype.selectLikeExcel=function(e,t,i){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i}),this.drawBorders())},e.prototype.setFrozenBorders=function(e,t,i){var n=t.style.borderWidth.toString().split(" "),r=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"][""+i])).filter(function(e){return""===e.style.display}),s=[].slice.call(e.querySelectorAll(".e-cellselectionbackground.e-fixedfreeze")).filter(function(e){return""===e.style.display}),o=this.parent.enableRtl;if(r.length)for(var a=r[0].getAttribute("data-index"),l=r[0].getAttribute("aria-colindex"),h=r[r.length-1].getAttribute("data-index"),d=r[r.length-1].getAttribute("aria-colindex"),p=0;p<r.length;p++)r[parseInt(p.toString(),10)].getAttribute("data-index")===a&&(1===n.length||3===n.length&&2===parseInt(n[0],10)||4===n.length&&2===parseInt(n[0],10))&&r[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),r[parseInt(p.toString(),10)].getAttribute("aria-colindex")===l&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&(!o&&2===parseInt(n[3],10)||o&&2===parseInt(n[1],10)))&&r[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-right-border":"e-xlsel-left-border"),r[parseInt(p.toString(),10)].getAttribute("data-index")===h&&(1===n.length||3===n.length&&2===parseInt(n[2],10)||4===n.length&&2===parseInt(n[2],10))&&r[parseInt(p.toString(),10)].classList.add("e-xlsel-bottom-border"),r[parseInt(p.toString(),10)].getAttribute("aria-colindex")===d&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&!o&&2===parseInt(n[1],10)||o&&2===parseInt(n[3],10))&&r[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-left-border":"e-xlsel-right-border");if(s.length)for(a=s[0].getAttribute("data-index"),l=(parseInt(s[0].getAttribute("aria-colindex"),10)-1).toString(),h=s[s.length-1].getAttribute("data-index"),d=(parseInt(s[s.length-1].getAttribute("aria-colindex"),10)-1).toString(),p=0;p<s.length;p++){var c=s[parseInt(p.toString(),10)].getAttribute("data-index"),u=(parseInt(s[parseInt(p.toString(),10)].getAttribute("aria-colindex"),10)-1).toString();c!==a||(this.parent.getHeaderContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!_a(e,"e-content"))&&_a(e,"e-content")||s[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),c!==h||(this.parent.getContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!_a(e,"e-headercontent"))&&_a(e,"e-headercontent")||s[parseInt(p.toString(),10)].classList.add("e-xlsel-bottom-border");var g=s[parseInt(p.toString(),10)].parentElement.children[parseInt(u,10)-1];u!==l||g&&(!g||g.classList.contains("e-cellselectionbackground"))||s[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-right-border":"e-xlsel-left-border");var f=s[parseInt(p.toString(),10)].parentElement.children[parseInt(u,10)+1];u!==d||f&&(!f||f.classList.contains("e-cellselectionbackground"))||s[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-left-border":"e-xlsel-right-border")}},e.prototype.refreshFrozenBorders=function(){this.bdrElement&&(this.setFrozenBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&this.parent.getFrozenMode()===ws&&this.setFrozenBorders(this.parent.getContentTable(),this.frcBdrElement,"5"),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.setFrozenBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&this.parent.getFrozenMode()===ws&&this.setFrozenBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6")))},e.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.parent.element.classList.add("e-enabledboxbdr"),this.bdrElement||this.createBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders())):this.showHideBorders("none")},e.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},e.prototype.isLastRow=function(e){var t=[].slice.call((0,o.closest)(e,Ds).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[t.length-1]},e.prototype.isFirstRow=function(e){var t=[].slice.call((0,o.closest)(e,Ds).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[0]},e.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},e.prototype.setBorders=function(e,t,i){var n=[].slice.call(e.getElementsByClassName("e-cellselectionbackground")).filter(function(e){return""===e.style.display});if(n.length&&this.parent.isFrozenGrid()){n=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"][""+i]+":not(.e-hide)")).filter(function(e){return""===e.style.display})}if(n.length){var r=this.parent.isFrozenGrid(),s=n[0],a=n[n.length-1],l=s.getBoundingClientRect(),h=a.getBoundingClientRect();if(!(0,o.isNullOrUndefined)(s.offsetParent)){var d=s.offsetParent.getBoundingClientRect();(s.offsetParent.classList.contains("e-content")||s.offsetParent.classList.contains("e-headercontent"))&&(d=s.offsetParent.querySelector("table").getBoundingClientRect());var p=r||!this.isLastRow(a)||"1"!==i&&"2"!==i&&"5"!==i?0:2,c=r&&("2"===i||"4"===i)&&this.isFirstCell(s)?1:0,u=("Right"!==this.parent.getFrozenMode()||"1"!==i&&"3"!==i)&&(this.parent.getFrozenMode()!==ws||"5"!==i&&"6"!==i)||!this.isFirstCell(s)?0:1;this.parent.enableRtl?(t.style.right=d.right-l.right-c+"px",t.style.width=l.right-h.left+c+1+"px"):(t.style.left=l.left-d.left-c-u+"px",t.style.width=h.right-l.left+c-u+1+"px"),t.style.top=l.top-d.top-0+"px",t.style.height=h.top-l.top>0?h.top-d.top+h.height+(r?0:1)-(l.top-d.top)-p+0+"px":h.height+0-p+(r?0:1)+"px",this.selectDirection+=i}}else t.style.display="none"},e.prototype.positionBorders=function(){this.updateStartEndCells(),this.startCell&&this.bdrElement&&this.selectedRowCellIndexes.length&&(this.selectDirection="",this.showHideBorders(""),this.setBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.getContentTable(),this.mcBdrElement,"2"),this.parent.getFrozenMode()===ws&&this.setBorders(this.parent.getContentTable(),this.frcBdrElement,"5")),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.getHeaderTable(),this.mhBdrElement,"4"),this.parent.getFrozenMode()===ws&&this.setBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6"))),this.applyBorders(this.selectDirection))},e.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=this.bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=this.top,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right;break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 3:this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mcBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mhBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom);break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.top_right_left)),e.includes("2")&&(this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.mhBdrElement.style.borderWidth=this.top_right_left)),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.bdrElement.style.borderWidth=this.right_bottom_left),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.mcBdrElement.style.borderWidth=this.right_bottom_left),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.frhBdrElement.style.borderWidth=this.top_right_left)),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=this.right_bottom_left);break;default:this.bdrElement.style.borderWidth=this.all_border,this.mcBdrElement.style.borderWidth=this.all_border,this.frcBdrElement.style.borderWidth=this.all_border,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.all_border,this.mhBdrElement.style.borderWidth=this.all_border,this.frhBdrElement.style.borderWidth=this.all_border)}},e.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if(this.parent.getFrozenMode()===ws)this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.fhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left):(this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left,this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom,this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left)):(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left,this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom)));break;default:this.bdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=this.all_border),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mhBdrElement.style.borderWidth=this.all_border))}},e.prototype.createBorders=function(){if(!this.bdrElement){var e=(0,o.createElement)("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr"});if(e.style.cssText="width: 2px; border-width: 0;",this.bdrElement=this.parent.getContentTable().parentElement.appendChild(e),this.parent.isFrozenGrid()){var t=(0,o.createElement)("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr"});if(t.style.cssText="height: 2px; border-width: 0;",this.mcBdrElement=this.parent.getContentTable().parentElement.appendChild(t),this.parent.getFrozenMode()===ws){var i=(0,o.createElement)("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr"});i.style.cssText="height: 2px; border-width: 0;",this.frcBdrElement=this.parent.getContentTable().parentElement.appendChild(i)}}if(this.parent.frozenRows||this.parent.pinnedTopRecords.length){var n=(0,o.createElement)("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr"});n.style.height="2px",this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(n)}if((this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&this.parent.isFrozenGrid()){var r=(0,o.createElement)("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr"});if(r.style.height="2px",this.mhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(r),this.parent.getFrozenMode()===ws){var s=(0,o.createElement)("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr"});s.style.height="2px",this.frhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(s)}}}},e.prototype.showHideBorders=function(e,t){if(this.bdrElement){if(this.bdrElement.style.display=e,this.parent.isFrozenGrid()){var i=this.parent.getContentTable();(0,o.removeClass)(i.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),(0,o.removeClass)(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),(0,o.removeClass)(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),(0,o.removeClass)(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),t||(this.mcBdrElement.style.display=e),this.parent.getFrozenMode()===ws&&(this.frcBdrElement.style.display=e)}if(this.parent.frozenRows||this.parent.pinnedTopRecords.length){i=this.parent.getHeaderTable();(0,o.removeClass)(i.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),(0,o.removeClass)(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),(0,o.removeClass)(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),(0,o.removeClass)(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),this.fhBdrElement.style.display=e}(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&this.parent.isFrozenGrid()&&(t||(this.mhBdrElement.style.display=e),this.parent.getFrozenMode()===ws&&(this.frhBdrElement.style.display=e))}},e.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},e.prototype.positionAFBorders=function(){if(this.startCell&&this.bdrAFLeft){var e=this.startAFCell.getBoundingClientRect(),t=this.endAFCell.getBoundingClientRect(),i=t.top-e.top>0?1:0,n=t.top-e.top>=0&&(_a(this.startAFCell,as)||_a(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,r=(_a(this.startAFCell,as)||_a(this.startAFCell,ls))&&this.isFirstCell(this.startAFCell)?1:0,s=this.isLastRow(this.endAFCell)&&(_a(this.endAFCell,as)||_a(this.endAFCell,"e-frozencontent"))?2:0,o=this.startAFCell.offsetParent.getBoundingClientRect(),a=this.parent.element.getBoundingClientRect(),l=this.startAFCell.offsetParent.parentElement.scrollTop,h=this.startAFCell.offsetParent.parentElement.scrollLeft,d=l-this.startAFCell.offsetTop,p=h-this.startAFCell.offsetLeft,c=this.parent.element.clientHeight-ol();this.parent.allowPaging&&(c-=this.parent.element.querySelector(".e-pager").offsetHeight),this.parent.aggregates.length&&(c-=this.parent.getFooterContent().offsetHeight);var u=this.parent.element.clientWidth-("auto"!==this.parent.height?ol():0);d=d>0?Math.floor(d)-1:0,p=p>0?p:0;var g=e.left-a.left;if(this.parent.enableRtl){var f=_a(this.startAFCell,as)||_a(this.startAFCell,ls)?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-a.left:0;this.bdrAFLeft.style.right=a.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=u<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px";var m=a.right-e.right-r+f-1;this.bdrAFRight.style.right=m>0?m+"px":"0px",this.bdrAFTop.style.left=t.left-a.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-r+1+"px",parseInt(this.bdrAFTop.style.left,10)<0&&(this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)+"px","auto"!==this.parent.height&&ol()?(this.bdrAFTop.style.left=ol()+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-ol()+"px"):this.bdrAFTop.style.left="0px")}else if(this.bdrAFLeft.style.left=g-r+p-1+"px",this.bdrAFRight.style.left=t.left-a.left-2+t.width+"px",this.bdrAFRight.style.width=u<=parseInt(this.bdrAFRight.style.left,10)?"0px":"2px",this.bdrAFTop.style.left=g+p-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)-r+1+"px",u<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)){var y=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-u;this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-y+"px"}if(this.bdrAFLeft.style.top=e.top-a.top-n+d+"px",this.bdrAFLeft.style.height=t.top-e.top>0?t.top-o.top+t.height+1-(e.top-o.top)+n-s-d+"px":t.height+n-s-d+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFBottom.style.left=this.bdrAFTop.style.left,this.bdrAFBottom.style.top=parseFloat(this.bdrAFLeft.style.top)+parseFloat(this.bdrAFLeft.style.height)-i-1+"px",this.bdrAFBottom.style.width=c<=parseFloat(this.bdrAFBottom.style.top)?"0px":this.bdrAFTop.style.width,c<=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)){var v=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-c;this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-v+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px"}}},e.prototype.createAFBorders=function(){if(!this.bdrAFLeft){var e=(0,o.createElement)("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft"});e.style.width="2px",this.bdrAFLeft=this.parent.element.appendChild(e);var t=(0,o.createElement)("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright"});t.style.width="2px",this.bdrAFRight=this.parent.element.appendChild(t);var i=(0,o.createElement)("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom"});i.style.height="2px",this.bdrAFBottom=this.parent.element.appendChild(i);var n=(0,o.createElement)("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop"});n.style.height="2px",this.bdrAFTop=this.parent.element.appendChild(n)}},e.prototype.destroyAutoFillElements=function(){this.bdrAFLeft&&(this.bdrAFLeft.remove(),this.bdrAFRight.remove(),this.bdrAFBottom.remove(),this.bdrAFTop.remove(),this.bdrAFLeft=this.bdrAFRight=this.bdrAFBottom=this.bdrAFTop=null),this.autofill&&(this.autofill.remove(),this.autofill=null)},e.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},e.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},e.prototype.updateValue=function(e,t,i){var n=this.createBeforeAutoFill(e,t,i);if(!n.cancel){var r=this.parent.getColumnByIndex(t);this.parent.editModule&&i&&("number"===r.type?this.parent.editModule.updateCell(e,r.field,parseFloat(n.value)):this.parent.editModule.updateCell(e,r.field,n.value))}},e.prototype.createBeforeAutoFill=function(e,t,i){var n={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger(xe,n),n},e.prototype.getAutoFillCells=function(e,t){return[].slice.call(this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll(".e-cellselectionbackground"))},e.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(_a(this.startAFCell,us).getAttribute(Rs),10)-1,n=parseInt(this.startAFCell.getAttribute(xs),10)-1,r=parseInt(_a(this.endAFCell,us).getAttribute(Rs),10)-1,s=parseInt(this.endAFCell.getAttribute(xs),10)-1,o=this.selectedRowCellIndexes.length-1,a=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!_a(e.target,is):this.startAFCell=this.parent.getCellFromIndex(i,n),this.endAFCell=this.parent.getCellFromIndex(i+o,n+a),this.drawAFBorders();break;case this.autoFillRLselection&&n+a<s&&s-n-a+1>r-i-o&&s-n-a+1>i-r:if(this.endAFCell=this.parent.getCellFromIndex(i+o,s),r=parseInt(_a(this.endAFCell,us).getAttribute(Rs),10)-1,s=parseInt(this.endAFCell.getAttribute(xs),10)-1,t){for(var l=parseInt(this.endCell.getAttribute(xs),10)-1,h=i;h<=r;h++)for(var d=this.getAutoFillCells(h,n),p=0,c=l+1;c<=s;c++)p>a&&(p=0),this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:r,cellIndex:s})}else this.drawAFBorders();break;case this.autoFillRLselection&&n>s&&n-s+1>r-i-o&&n-s+1>i-r:if(this.startAFCell=this.parent.getCellFromIndex(i,s),this.endAFCell=this.endCell,t){for(h=i;h<=i+o;h++){(d=this.getAutoFillCells(h,n)).reverse();for(p=0,c=this.startCellIndex-1;c>=s;c--)p>a&&(p=0),this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:i,cellIndex:s},{rowIndex:i+o,cellIndex:this.startCellIndex+a})}else this.drawAFBorders();break;case i>r:if(this.startAFCell=this.parent.getCellFromIndex(r,n),this.endAFCell=this.endCell,t){var u=g=parseInt(this.endCell.parentElement.getAttribute(Rs),10)-1;for(h=i-1;h>=r;h--){u===this.startIndex-1&&(u=g);d=this.getAutoFillCells(u,n),p=0;u--;for(c=this.startCellIndex;c<=this.startCellIndex+a;c++)this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:r,cellIndex:n+a},{rowIndex:i+o,cellIndex:n})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(r,n+a),t){var g=parseInt(this.endCell.parentElement.getAttribute(Rs),10)-1;for(u=this.startIndex,h=g+1;h<=r;h++){u===g+1&&(u=this.startIndex);d=this.getAutoFillCells(u,n);u++;p=0;for(var f=this.startCellIndex;f<=this.startCellIndex+a;f++)this.updateValue(h,f,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:g-o,cellIndex:n},{rowIndex:r,cellIndex:n+a})}else this.drawAFBorders()}},e.prototype.mouseUpHandler=function(e){this.stopTimer(),document.body.classList.remove("e-disableuserselect"),this.element&&!(0,o.isNullOrUndefined)(this.element.parentElement)&&(0,o.remove)(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=_a(e.target,is):this.mUPTarget=null;var t=(0,o.closest)(e.target,".e-rowcell");if(this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode&&t&&t.classList.contains(is)){var i=parseInt(t.parentElement.getAttribute(Rs),10)-1,n=parseInt(t.getAttribute(xs),10)-1;this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:i,cellIndex:n})}if(this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel){this.preventFocus=!0;var r=_a(e.target,is);this.endAFCell=r||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,(0,o.isNullOrUndefined)(this.endAFCell)||(0,o.isNullOrUndefined)(this.startAFCell)||(this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),this.parent.aggregates.length>0&&this.parent.notify(ot,{})),this.isAutoFillSel=!1,this.preventFocus=!1}o.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&o.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),o.EventHandler.remove(document,"mouseup",this.mouseUpHandler)},e.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},e.prototype.updateAutoFillPosition=function(){if(this.parent.enableAutoFill&&!this.parent.isEdit&&this.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length){var e=parseInt(this.target.getAttribute(xs),10)-1,t=parseInt(this.target.getAttribute("data-index"),10),i=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,n=this.getAutoFillCells(i,e).filter(function(e){return""===e.style.display}),r=this.parent.getColumnByIndex(e),s=(r.getFreezeTableName(),t<(this.parent.frozenRows||this.parent.pinnedTopRecords.length)),a=this.parent.getFrozenMode()===ws&&r.getFreezeTableName()===bs;(0,o.select)("#"+this.parent.element.id+"_autofill",_a(this.target,cs))||((0,o.select)("#"+this.parent.element.id+"_autofill",this.parent.element)&&(0,o.select)("#"+this.parent.element.id+"_autofill",this.parent.element).remove(),this.autofill=(0,o.createElement)("div",{className:"e-autofill",id:this.parent.element.id+"_autofill"}),this.autofill.style.display="none",(this.target.classList.contains("e-leftfreeze")||this.target.classList.contains("e-rightfreeze")||this.target.classList.contains("e-fixedfreeze"))&&this.autofill.classList.add("e-freeze-autofill"),s?this.parent.getHeaderTable().parentElement.appendChild(this.autofill):this.parent.getContentTable().parentElement.appendChild(this.autofill),a&&(s?this.parent.getHeaderTable().parentElement.appendChild(this.autofill):this.parent.getContentTable().parentElement.appendChild(this.autofill)));var l=n[n.length-1];if(l&&l.offsetParent){var h=l.getBoundingClientRect(),d=l.offsetParent.getBoundingClientRect();(l.offsetParent.classList.contains("e-content")||l.offsetParent.classList.contains("e-headercontent"))&&(d=l.offsetParent.querySelector("table").getBoundingClientRect());var p=this.isLastCell(l)?4:0,c=this.isLastRow(l)?3:0;this.parent.enableRtl?this.autofill.style.right=d.right-h.right+h.width-4-p+"px":this.autofill.style.left=h.left-d.left+h.width-4-p+"px",this.autofill.style.top=h.top-d.top+h.height-5-c+"px"}this.autofill.style.display=""}else this.hideAutoFill()},e.prototype.mouseDownHandler=function(e){this.mouseButton=e.button;var t,i=e.target,n=this.parent,r=_a(i,"e-grid");if(!(r&&r.id!==n.element.id||_a(i,os)&&!this.parent.frozenRows||_a(i,"e-editedbatchcell")||_a(i,fs))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),_a(i,is)&&!e.shiftKey&&!e.ctrlKey){if(n.selectionSettings.cellSelectionMode.indexOf("Box")>-1&&!this.isRowType()&&!this.isSingleSel())this.isCellDrag=!0,t=!0;else if(n.allowRowDragAndDrop&&!n.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(this.isRowDragSelected=!1,!this.isRowType()||this.isSingleSel()||(0,o.closest)(i,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);t=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}t&&this.enableDrag(e,!0)}this.updateStartEndCells(),(i.classList.contains("e-autofill")||i.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},e.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(Rs),10)-1,this.startCellIndex=parseInt(_a(this.startCell,is).getAttribute(xs),10)-1)},e.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(Rs),10)-1,this.startCellIndex=parseInt(_a(this.startCell,is).getAttribute(xs),10)-1)},e.prototype.enableDrag=function(e,t){var i=this.parent;if(t){var n=(0,o.closest)(e.target,"tr");this.startDIndex=parseInt(n.getAttribute(Rs),10)-1,this.startDCellIndex=parseInt(_a(e.target,is).getAttribute(xs),10)-1}document.body.classList.add("e-disableuserselect");var r=i.element.getBoundingClientRect(),s=Ya(e);this.x=s.x-r.left,this.y=s.y-r.top,o.EventHandler.add(i.getContent(),"mousemove",this.mouseMoveHandler,this),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&o.EventHandler.add(i.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),o.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},e.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;if("virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection(),("virtualscroll"===e.requestType||t)&&this.parent.isPersistSelection&&!this.isPartialSelection&&this.isHdrSelectAllClicked){var i=this.parent.getRowsObject().filter(function(e){return e.isSelectable}),n=[];this.selectedRowState={},this.persistSelectedData=[];for(var r=0;r<i.length;r++){n.push(i[parseInt(r.toString(),10)].index);var s=this.getPkValue(this.primaryKey,i[parseInt(r.toString(),10)].data);this.selectedRowState[""+s]=!0,this.persistSelectedData.push(i[parseInt(r.toString(),10)].data)}}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Be,handler:this.enableAfterRender},{event:Le,handler:this.initializeSelection},{event:dt,handler:this.onActionComplete},{event:gt,handler:this.onActionComplete},{event:qe,handler:this.onPropertyChanged},{event:yt,handler:this.onCellFocused},{event:ki,handler:this.clearSelAfterRefresh},{event:xt,handler:this.columnPositionChanged},{event:Ne,handler:this.initialEnd},{event:Tt,handler:this.rowsRemoved},{event:je,handler:this.refreshHeader},{event:ft,handler:this.destroyAutoFillElements},{event:Ct,handler:this.destroy}],Rh(this.parent,this.evtHandlers,!0,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(R,this.actionBeginFunction),this.parent.addEventListener(D,this.actionCompleteFunction),this.addEventListener_checkbox())},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(o.EventHandler.remove(document,"mouseup",this.mouseUpHandler),o.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),o.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler),Rh(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(R,this.actionBeginFunction),this.parent.removeEventListener(D,this.actionCompleteFunction),this.removeEventListener_checkbox(),this.parent.off(ft,this.destroyAutoFillElements))},e.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS?(o.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),o.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this)):this.parent.allowKeyboard||o.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this)},e.prototype.unWireEvents=function(){this.isMacOS?(o.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),o.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler)):this.parent.allowKeyboard||o.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler)},e.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},e.prototype.refreshHeader=function(){this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.setCheckAllState()},e.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++){var i=this.getPkValue(this.primaryKey,e.records[parseInt(t.toString(),10)]);delete this.selectedRowState[""+i],--this.totalRecordsCount}this.setCheckAllState()},e.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},e.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.initPerisistSelection())},e.prototype.render=function(e){o.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),o.EventHandler.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){var t=this.parent;(0,o.isNullOrUndefined)(e.properties.type)||("Single"===this.selectionSettings.type?(t.element.removeAttribute("aria-multiselectable"),this.selectedRowCellIndexes.length>1&&(this.clearCellSelection(),this.prevCIdxs=void 0),this.selectedRowIndexes.length>1&&(this.clearRowSelection(),this.prevRowIndex=void 0),this.selectedColumnsIndexes.length>1&&(this.clearColumnSelection(),this.prevColIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()):"Multiple"===this.selectionSettings.type&&t.element.setAttribute("aria-multiselectable","true")),(0,o.isNullOrUndefined)(e.properties.mode)&&(0,o.isNullOrUndefined)(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevColIndex=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.parent.isCheckBoxSelection||this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(t.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders()}},e.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},e.prototype.initialEnd=function(){this.selectedRowIndexes.length||(this.parent.off(Ne,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},e.prototype.checkBoxSelectionChanged=function(){var e=this.parent;e.off(Ne,this.checkBoxSelectionChanged);var t=(e.enableColumnVirtualization?e.columns:e.getColumns()).filter(function(e){return"checkbox"===e.type});t.length>0&&(e.isCheckBoxSelection=!0,this.chkField=t[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,(0,o.isNullOrUndefined)(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},e.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):this.parent.getPrimaryKeyFieldNames().length>0?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},e.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],!e.enableVirtualization&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)&&this.dataSuccess(!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result||this.parent.getDataModule().isRemote()?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json)},e.prototype.dataSuccess=function(e){for(var t=0;t<e.length;t++){var i=this.getPkValue(this.primaryKey,e[parseInt(t.toString(),10)]),n=e[parseInt(t.toString(),10)][this.chkField];(0,o.isNullOrUndefined)(this.selectedRowState[""+i])&&n&&"boolean"==typeof n&&(this.selectedRowState[""+i]=n,this.parent.isPersistSelection&&this.persistSelectedData.push(e[parseInt(t.toString(),10)]))}},e.prototype.setRowSelection=function(e){if(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)if(e){var t=Object.keys(this.selectedRowState),i=Object.keys(this.unSelectedRowState);if(!this.isCheckboxReset)for(var n=0,r=this.parent.groupSettings.columns.length&&!this.parent.groupSettings.enableLazyLoading&&this.parent.isPersistSelection?this.parent.currentViewData.records:this.parent.currentViewData;n<r.length;n++){u=r[n];if(!(0,o.isNullOrUndefined)(u)&&!(0,o.isNullOrUndefined)(u[this.primaryKey])){var s=u[this.primaryKey].toString();-1===t.indexOf(s)&&-1===i.indexOf(s)&&(this.selectedRowState[u[this.primaryKey]]=!0)}}}else this.selectedRowState={},this.unSelectedRowState={},this.rmtHdrChkbxClicked=!1;else if(e)if(this.isPartialSelection&&!this.isHdrSelectAllClicked&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))for(var a=0,l=this.parent.getRowsObject().filter(function(e){return e.isSelectable});a<l.length;a++){var h=l[a];this.selectedRowState[this.getPkValue(this.primaryKey,h.data)]=!0}else{var d=this.isPartialSelection?this.parent.partialSelectedRecords:this.getData();if(this.parent.groupSettings.columns.length)for(var p=0,c=this.isPartialSelection?d:d.records;p<c.length;p++){var u=c[p];this.selectedRowState[this.getPkValue(this.primaryKey,u)]=!0}else for(var g=0,f=d;g<f.length;g++){var u=f[g];this.selectedRowState[this.getPkValue(this.primaryKey,u)]=!0}}else this.selectedRowState={}},e.prototype.getData=function(){return Gh(this.parent)},e.prototype.getAvailableSelectedData=function(e){var t=new a.DataManager(e).executeLocal(this.parent.getDataModule().generateQuery(!0));return this.parent.groupSettings.columns.length&&t&&t.records&&(t=t.records.slice()),t},e.prototype.refreshPersistSelection=function(){var e=this.parent.pinnedTopRecords.length||this.isLazyLoadGroup()?this.parent.getAllDataRows(!0):this.parent.getRows();if(this.isLazyLoadGroup()&&(e=e.filter(function(e){return!e.classList.contains("e-groupcaptionrow")})),this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),!(0,o.isNullOrUndefined)(e)&&e.length>0&&(this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.chkField)){for(var t=[],i=0;i<e.length;i++){var n=this.getRowObj(e[parseInt(i.toString(),10)]),r=n&&n.data?this.getPkValue(this.primaryKey,n.data):null;if(null===r)return;if(!this.isPartialSelection||n.isSelectable||this.selectedRowState.hasOwnProperty(r)){var s=void 0,a=e[parseInt(i.toString(),10)].querySelector(".e-checkselect");this.selectedRowState[""+r]||"Check"===this.parent.checkAllRows&&this.selectedRowState[""+r]&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(r)<0||"Uncheck"===this.parent.checkAllRows&&this.chkAllCollec.indexOf(r)>0&&!this.parent.selectedRowIndex||"Intermediate"===this.parent.checkAllRows&&!(0,o.isNullOrUndefined)(this.chkField)&&n.data[this.chkField]?(t.push(parseInt(e[parseInt(i.toString(),10)].getAttribute(Rs),10)-1),s=!0):(s=!1,this.checkedTarget!==a&&this.parent.isCheckBoxSelection&&a&&Dl(a.nextElementSibling,s)),this.updatePersistCollection(e[parseInt(i.toString(),10)],s)}}this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.isSingleSel()&&t.length>0?this.selectRow(t[0],!0):this.selectRows(t)}else this.parent.isCheckBoxSelection&&this.isLazyLoadPersistSelection()&&(this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.selectedRecords=[],this.parent.allowPaging?this.selectedRowIndexes=[]:this.selectedRowIndexes=Object.keys(this.persistSelectedData).map(function(e){return parseInt(e,10)}));(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&this.getCurrentBatchRecordChanges().length>0&&this.setCheckAllState()},e.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var t=this.parent.element.querySelector(".e-edit-checkselect");if(!(0,o.isNullOrUndefined)(t)){var i=(0,o.closest)(t,"."+fs);if(i){"Dialog"===this.parent.editSettings.mode&&(i=this.parent.element.querySelector(".e-dlgeditrow"));var n=this.getRowObj(i);if(!n)return;this.selectedRowState[this.getPkValue(this.primaryKey,n.data)]=n.isSelected=t.checked}else this.isCheckedOnAdd=t.checked,this.isCheckedOnAdd&&"add"===e.action&&(this.selectedRowState[this.getPkValue(this.primaryKey,e.data)]=!0)}}this.parent.isPersistSelection&&this.isPartialSelection&&"paging"===e.requestType&&(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.selectedRowIndexes=[])},e.prototype.actionComplete=function(e){if("save"===e.requestType&&this.parent.isPersistSelection&&("add"===e.action&&(this.isHdrSelectAllClicked=!1),this.isPartialSelection&&(this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),(!(0,o.isNullOrUndefined)(this.getCheckAllBox())&&this.getCheckAllBox().nextElementSibling.classList.contains("e-check")||!(0,o.isNullOrUndefined)(e.row.querySelector(".e-checkselect"))&&e.row.querySelector(".e-checkselect").parentElement.classList.contains("e-checkbox-disabled"))&&(this.updatePersistCollection(e.row,!0),this.setCheckAllState()))),"delete"===e.requestType&&this.parent.isPersistSelection){for(var t=e.data.slice(),i=0;i<t.length;i++){var n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);(0,o.isNullOrUndefined)(n)||this.updatePersistDelete(n,this.isPartialSelection)}this.isHdrSelectAllClicked=!1,this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}if("paging"===e.requestType){if(this.parent.isPersistSelection&&this.isPartialSelection&&this.isHdrSelectAllClicked){var r=this.parent.getRowsObject(),s=[];for(i=0;i<r.length;i++)r[parseInt(i.toString(),10)].isSelectable&&s.push(r[parseInt(i.toString(),10)].index);s.length&&this.selectRows(s)}this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0}},e.prototype.onDataBound=function(){if(this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.parent.pinnedTopRecords.length&&this.setPinnedSelectionIndexes(),!this.parent.enableVirtualization&&this.parent.isPersistSelection&&this.selectedRecords.length&&(this.isPrevRowSelection=!0),((this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&this.rmtHdrChkbxClicked||this.isPartialSelection&&this.parent.isPersistSelection&&this.isHdrSelectAllClicked)&&("Intermediate"===this.parent.checkAllRows?this.setRowSelection(!0):"Uncheck"===this.parent.checkAllRows&&this.setRowSelection(!1)),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.parent.enableVirtualization&&this.setCheckAllState(),(this.parent.isPersistSelection||this.contentRenderer&&(0,o.isNullOrUndefined)(this.contentRenderer.requestType)&&this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&this.refreshPersistSelection(),this.initialRowSelection=!!(this.isRowType()&&this.parent.element.querySelectorAll(".e-selectionbackground")&&this.parent.getSelectedRows().length),this.parent.isCheckBoxSelection&&!this.initialRowSelection&&!this.isLazyLoadPersistSelection()){for(var e=this.parent.getRowsObject(),t=[],i=0;i<e.length;i++)e[parseInt(i.toString(),10)].isSelected&&t.push(i);t.length&&this.selectRows(t),this.initialRowSelection=!0}},e.prototype.updatePersistSelectedData=function(e){var t=this;if(this.parent.isPersistSelection||this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){var i=[];if("Check"===this.parent.checkAllRows&&(this.parent.searchSettings.key.length>0||this.parent.filterSettings.columns.length>0)&&this.persistSelectedData.length&&!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection){var n=this.getAvailableSelectedData(this.persistSelectedData),r=new Set(n.map(function(e){return e[t.primaryKey]}));i=this.persistSelectedData.filter(function(e){return!r.has(e[t.primaryKey])})}var s=this.isLazyLoadPersistSelection()?this.parent.getDataRows():this.parent.getRows();this.isLazyLoadPersistSelection()&&(s=s.filter(function(e){return!e.classList.contains("e-groupcaptionrow")}));for(var a=0;a<s.length;a++)this.updatePersistCollection(s[parseInt(a.toString(),10)],e);if("Uncheck"===this.parent.checkAllRows)this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result?this.persistSelectedData:[];else if("Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result||this.isPartialSelection?this.isPartialSelection?this.parent.partialSelectedRecords.slice():this.persistSelectedData:this.parent.groupSettings.columns.length?this.getData().records.slice():this.getData().slice(),i.length>0))for(a=0;a<i.length;a++)this.persistSelectedData.push(i[parseInt(a.toString(),10)]);this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData)}},e.prototype.checkSelectAllAction=function(e){var t=this.getRenderer(),i=this.parent.element.querySelector(".e-gridform");if(this.checkedTarget=this.getCheckAllBox(),this.isLazyLoadPersistSelection()&&!this.parent.isRemote()&&(this.isRowSelected=this.selectedRowIndexes.length&&!0),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),this.selectRowsByRange(t.getVirtualRowIndex(0),t.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1+this.parent.pinnedTopRowModels.length)),this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?(this.virtualSelectedData=this.virtualCheckBoxData().slice(),this.selectedRowIndexes=Object.keys(this.virtualSelectedData).map(function(e){return parseInt(e,10)})):!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.isLazyLoadPersistSelection()&&this.parent.partialSelectedRecords.length>0?this.parent.isPersistSelection?(this.persistSelectedData=this.parent.partialSelectedRecords.slice(),this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData)):(this.partialSelectedData=this.parent.partialSelectedRecords.slice(),this.partialSelectedRecordsCount=this.partialSelectedData.length&&this.getAvailableDataCount(this.partialSelectedData)):this.isLazyLoadPersistSelection()&&!this.parent.isRemote()?(this.persistSelectedData=this.isPartialSelection?this.parent.partialSelectedRecords.slice():this.getData().records.slice(),this.parent.allowPaging||(this.selectedRowIndexes=this.isPartialSelection?this.parent.partialSelectedIndexes.slice():Object.keys(this.persistSelectedData).map(function(e){return parseInt(e,10)}))):this.parent.isPersistSelection&&this.parent.isRemote()&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading&&(this.persistSelectedData=(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getAllPagesData(),this.persistSelectedRecordsCount=this.persistSelectedData.length)):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],!(0,o.isNullOrUndefined)(i)){var n=i.querySelector(".e-edit-checkselect");(0,o.isNullOrUndefined)(n)||Dl(n.nextElementSibling,e)}},e.prototype.checkSelectAll=function(e){var t=this,i=this.getCheckAllStatus(e),n="Check"===i;if(this.isHeaderCheckboxClicked=!0,(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&("Uncheck"===i||this.isCheckboxReset||"Intermediate"===i&&(this.parent.isPersistSelection||this.parent.isRemote()))?this.rmtHdrChkbxClicked=!0:this.rmtHdrChkbxClicked=!1,this.rmtHdrChkbxClicked&&this.isCheckboxReset&&(this.unSelectedRowState={}),this.isCheckboxReset=!1,"Intermediate"===i&&(this.chkField||this.parent.isPersistSelection||(n=this.getCurrentBatchRecordChanges().some(function(e){return t.getPkValue(t.primaryKey,e)in t.selectedRowState})),this.parent.isPersistSelection||this.parent.isRemote()))if(this.parent.allowPaging&&this.isPartialSelection)for(var r=this.parent.getRowsObject(),s=0;s<r.length;s++){if(r[s].isDataRow&&r[s].isSelectable&&!r[s].isSelected){n=!1;break}n=!0}else if(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result){var a=this.parent.renderModule&&this.parent.renderModule.selectableDataKey,l=this.getCurrentBatchRecordChanges();this.isLazyLoadPersistSelection()&&(l=l.filter(function(e){return!e.key})).length&&(l=Object.keys(l).map(function(e){return l[parseInt(e,10)]}));for(s=0;s<l.length;s++){var h=this.getPkValue(this.primaryKey,l[parseInt(s.toString(),10)]);if(!this.isPartialSelection&&!(0,o.isNullOrUndefined)(h)||this.isPartialSelection&&a[""+h]){if(!Object.keys(this.selectedRowState).includes(h.toString())){n=!1;break}n=!0}}}this.parent.isPersistSelection&&this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),this.checkSelectAllAction(!n),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.target=null,this.getCurrentBatchRecordChanges().length>0&&(this.setCheckAllState(),this.updateSelectedRowIndexes()),this.triggerChkChangeEvent(e,!n)},e.prototype.getCheckAllStatus=function(e){var t;(0,o.isNullOrUndefined)(e)?(0,o.isNullOrUndefined)(this.getCheckAllBox())||(t=this.getCheckAllBox().nextElementSibling.classList):t=e.nextElementSibling.classList;var i="None";return t instanceof DOMTokenList&&(t.contains("e-check")?i="Check":t.contains("e-uncheck")?i="Uncheck":t.contains("e-stop")&&(i="Intermediate")),i},e.prototype.checkSelect=function(e){var t=(0,o.closest)(this.checkedTarget,"."+is),i=this.parent;this.isMultiCtrlRequest=!0;var n=0;if(this.isHeaderCheckboxClicked=!1,Fl(i)){var r=t.parentElement.getAttribute("data-uid");n=this.parent.enableVirtualization&&this.parent.groupSettings.columns.length?parseInt(t.parentElement.getAttribute(Rs),10)-1:i.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(r)}else n=parseInt(t.parentElement.getAttribute(Rs),10)-1;this.parent.isPersistSelection&&this.parent.element.getElementsByClassName(ms).length>0&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.editSettings.showAddNewRow&&++n,this.rowCellSelectionHandler(n,parseInt(t.getAttribute(xs),10)-1),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.parent.isPersistSelection?this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData):this.partialSelectedRecordsCount=this.partialSelectedData.length&&this.getAvailableDataCount(this.partialSelectedData),this.moveIntoUncheckCollection((0,o.closest)(t,"."+us)),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},e.prototype.moveIntoUncheckCollection=function(e){if("Check"===this.parent.checkAllRows||"Uncheck"===this.parent.checkAllRows){var t=this.getRowObj(e),i=t&&t.data?this.getPkValue(this.primaryKey,t.data):null;if(!i)return;this.chkAllCollec.indexOf(i)<0?this.chkAllCollec.push(i):this.chkAllCollec.splice(this.chkAllCollec.indexOf(i),1)}},e.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger(we,{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},e.prototype.updateSelectedRowIndexes=function(){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection&&!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.selectionSettings.persistSelection&&!this.isHdrSelectAllClicked&&"Uncheck"!==this.parent.checkAllRows)for(var e=0,t=n=this.parent.getRowsObject().filter(function(e){return e.isSelectable});e<t.length;e++){var i=t[e];this.selectedRowIndexes.push(i.index)}var n;if(this.parent.isCheckBoxSelection&&this.parent.enableVirtualization&&!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.parent.isPersistSelection&&"Check"===this.parent.checkAllRows&&(n=this.parent.getRowsObject().filter(function(e){return e.isSelectable})).length!==this.selectedRowIndexes.length)for(var r=0,s=n;r<s.length;r++){i=s[r];this.selectedRowIndexes.indexOf(i.index)<=-1&&this.selectedRowIndexes.push(i.index)}},e.prototype.updateSelectedRowIndex=function(e){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result))if("Check"===this.parent.checkAllRows&&(0,o.isNullOrUndefined)(e))if(this.selectedRowIndexes=[],this.isPartialSelection)this.selectedRowIndexes=this.parent.partialSelectedIndexes.slice();else{var t=this.parent.groupSettings.columns.length?this.getData().records.length:this.getData().length;this.parent.pinnedTopRowModels.length&&(t+=this.parent.pinnedTopRowModels.length);for(var i=0;i<t;i++)this.selectedRowIndexes.push(i)}else if("Uncheck"===this.parent.checkAllRows)this.selectedRowIndexes=[];else{var n=this.parent.getRowByIndex(e);if(e&&n&&"false"===n.getAttribute("aria-selected")){var r=this.selectedRowIndexes.indexOf(e);this.selectedRowIndexes.splice(r,1)}}},e.prototype.isAllSelected=function(e){if(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)return this.getAvailableSelectedData(this.persistSelectedData).length===(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.isLazyLoadGroup()?this.parent.totalDataRecordsCount:this.totalRecordsCount);if(this.isPartialSelection){if(this.parent.allowPaging&&!this.selectionSettings.persistSelection&&this.parent.pageSettings.pageSize<this.parent.pageSettings.totalRecordsCount){for(var t=this.parent.partialSelectedRecords,i=0;i<t.length;i++){var n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);if(!this.selectedRowState[""+n])return!1}return!0}return this.isSelectAllRowCount(e)}t=this.getData();this.parent.groupSettings.columns.length&&t.records&&(t=t.records);for(i=0;i<t.length;i++){n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);if(!this.selectedRowState[""+n])return!1}return!0},e.prototype.someDataSelected=function(){if((this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.searchSettings.key.length||this.parent.filterSettings.columns.length))for(var e=this.getAvailableSelectedData(this.persistSelectedData),t=0;t<e.length;t++){var i=this.getPkValue(this.primaryKey,e[parseInt(t.toString(),10)]);if(this.selectedRowState[""+i])return!1}var n=this.isPartialSelection?this.getAvailableSelectedData(this.parent.partialSelectedRecords):this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result?[]:this.isLazyLoadPersistSelection()?this.parent.getCurrentViewRecords():this.getData();for(t=0;t<n.length;t++){i=this.getPkValue(this.primaryKey,n[parseInt(t.toString(),10)]);if(this.selectedRowState[""+i])return!1}return!0},e.prototype.setCheckAllState=function(e,t){if(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode){var i=!1,n=!1,r=Object.keys(this.selectedRowState).length;this.parent.element.classList.contains("e-treelistgrid")&&this.parent.isPersistSelection&&!this.parent.enableVirtualization&&!this.parent.getDataModule().isRemote()&&Array.isArray(this.parent.dataSource)&&r===this.parent.dataSource.length&&r>this.totalRecordsCount&&(r=this.totalRecordsCount),this.parent.isPersistSelection||this.parent.isRemote()&&!this.parent.allowPaging||(r=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),!this.parent.isPersistSelection||(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&this.isPartialSelection||!this.parent.searchSettings.key.length&&!this.parent.filterSettings.columns.length||(n=!0,i=this.isAllSelected(r));var s=this.getCheckAllBox();if(s){var a=s.nextElementSibling;(0,o.removeClass)([a],["e-check","e-stop","e-uncheck"]),xl(s,!1),s.indeterminate=!1;var l=this.parent.getDataModule().isRemote()?[]:this.gridCurrentRecord;if(this.parent.groupSettings.columns.length&&l.records&&(l=l.records),this.totalRecordsCount=this.checkVirtualCheckBox()||this.isLazyLoadPersistSelection()?l.length:this.totalRecordsCount,i&&n&&(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result||l.length)||!n&&(r===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&(!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)||this.parent.allowPaging)||this.parent.isRemote()&&this.isLazyLoadPersistSelection()&&r===this.parent.totalDataRecordsCount||!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&this.isPartialSelection&&(this.isSelectAllRowCount(r)||this.isHdrSelectAllClicked&&!this.parent.isPersistSelection)||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.allowPaging&&(!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&l.length&&r===l.length||(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection&&(r===this.parent.totalDataRecordsCount||(this.isSelectAllRowCount(r)||r===this.totalRecordsCount)&&!this.parent.isPersistSelection&&!this.parent.isRemote())||this.isPartialSelection&&(r>0&&this.isHdrSelectAllClicked||this.isSelectAllRowCount(r)))||r===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&!this.parent.allowPaging&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling)?((0,o.addClass)([a],["e-check"]),xl(s,!0),t&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):(!this.selectedRowIndexes.length&&(!this.parent.enableVirtualization||!this.persistSelectedData.length&&!n||n&&this.someDataSelected())||0===r&&0===this.getCurrentBatchRecordChanges().length)&&!this.parent.allowPaging||this.parent.allowPaging&&!this.isLazyLoadPersistSelection()&&(0===r||r&&n&&this.someDataSelected())||this.isLazyLoadPersistSelection()&&0===this.persistSelectedRecordsCount?((0,o.addClass)([a],["e-uncheck"]),t&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck"):((0,o.addClass)([a],["e-stop"]),this.parent.checkAllRows="Intermediate",s.indeterminate=!0),this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===r&&0===this.getCurrentBatchRecordChanges().length||this.parent.isRemote()&&"Uncheck"===this.parent.checkAllRows&&this.isLazyLoadPersistSelection()&&0===(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getAllPagesData().length?(0,o.addClass)([a.parentElement],["e-checkbox-disabled"]):(0,o.removeClass)([a.parentElement],["e-checkbox-disabled"]),this.isPartialSelection){var h=this.parent.getRowsObject().filter(function(e){return e.isSelectable}).length;this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===h&&this.disableSelectableRecordsCount===this.totalRecordsCount&&a.parentElement.querySelector(".e-frame").classList.contains("e-uncheck")?(0,o.addClass)([a.parentElement],["e-checkbox-disabled"]):(0,o.removeClass)([a.parentElement],["e-checkbox-disabled"])}!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result||this.updateSelectedRowIndex(e)}}},e.prototype.checkVirtualCheckBox=function(){return this.parent.enableVirtualization&&!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&!this.isPartialSelection},e.prototype.isLazyLoadGroup=function(){return this.parent.groupSettings&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading},e.prototype.isLazyLoadPersistSelection=function(){return this.parent.isPersistSelection&&this.isLazyLoadGroup()},e.prototype.virtualCheckBoxData=function(){var e=this.getData();return this.parent.groupSettings.columns.length&&e.records&&(e=e.records),e},e.prototype.isSelectAllRowCount=function(e){var t=0,i=this.parent.getRowsObject();if(!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))return(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.totalDataRecordsCount:this.getData()&&this.getData().length)===i.length&&((t=i.filter(function(e){return e.isSelectable}).length)&&e===t);if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection){var n=this.parent.isPersistSelection||this.parent.isRemote()?this.persistSelectedRecordsCount:this.partialSelectedRecordsCount;return(t=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===(this.parent.isRemote()?this.parent.totalDataRecordsCount:this.parent.allowGrouping&&"records"in this.getData()?this.getData().records.length:this.getData()&&this.getData().length)&&0!==n&&n===this.partialSelectableRecordsCount}if((this.parent.allowPaging||this.isPartialSelection)&&this.parent.selectionSettings.persistSelection){n=this.persistSelectedRecordsCount;return(t=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===this.totalRecordsCount&&0!==n&&n===this.partialSelectableRecordsCount}return(t=i.filter(function(e){return e.isSelectable}).length)&&e===t},e.prototype.keyDownHandler=function(e){("opera"===o.Browser.info.name&&17===e.keyCode||"mozilla"===o.Browser.info.name&&224===e.keyCode||("safari"===o.Browser.info.name||"chrome"===o.Browser.info.name)&&(91===e.keyCode||93===e.keyCode))&&(this.cmdKeyPressed=!0);var t=_a(e.target,"e-headercell"),i=_a(e.target,is);(t?t.children[0].classList.contains("e-headerchkcelldiv"):!!i&&i.classList.contains("e-gridchkbox"))&&!this.parent.allowKeyboard&&32===e.keyCode&&e.preventDefault()},e.prototype.keyUpHandler=function(e){("opera"===o.Browser.info.name&&17===e.keyCode||"mozilla"===o.Browser.info.name&&224===e.keyCode||("safari"===o.Browser.info.name||"chrome"===o.Browser.info.name)&&(91===e.keyCode||93===e.keyCode))&&(this.cmdKeyPressed=!1)},e.prototype.clickHandler=function(e){var t=e.target;this.actualTarget=t,this.isAutoFillSel||e.ctrlKey||e.shiftKey||(this.startAFCell=this.endAFCell=null),this.selectionSettings.persistSelection&&(this.deSelectedData=this.persistSelectedData.slice()),(_a(t,us)||_a(t,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&t.classList.contains("e-headercell"))&&(this.isInteracted=!0),this.cmdKeyPressed=e.metaKey,this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.parent.allowKeyboard?this.isMultiShiftRequest=e.shiftKey:(this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1),this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.popUpClickHandler(e);var i,n=!1;this.preventFocus=!0;var r=_a(t,"e-checkbox-wrapper");if(this.checkSelectAllClicked=!!(r&&r.getElementsByClassName("e-checkselectall")||this.selectionSettings.persistSelection&&_a(t,us)),this.selectionSettings.persistSelection&&this.isPartialSelection&&_a(t,"e-headerchkcelldiv")&&!t.querySelector(".e-checkbox-disabled")&&!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.isHdrSelectAllClicked=!0),r&&r.querySelectorAll(".e-checkselect,.e-checkselectall").length>0&&(i=r.querySelector('input[type="checkbox"]'),n=!0),this.drawBorders(),this.updateAutoFillPosition(),t=_a(t,is),this.parent.isReact&&t&&!t.parentElement&&t.classList.contains("e-rowcell")&&(t=this.parent.getCellFromIndex(parseInt(t.getAttribute("data-index"),10),parseInt(t.getAttribute("aria-colindex"),10)-1)),this.isRowDragSelected&&(0,o.isNullOrUndefined)(t)&&this.parent.allowRowDragAndDrop&&this.checkSelectAllClicked&&(this.isRowDragSelected=!1),(t&&t.parentElement.classList.contains(us)&&!this.parent.selectionSettings.checkboxOnly||n)&&!this.isRowDragSelected){if(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=t,(0,o.isNullOrUndefined)(i)){var s=0;s=parseInt(t.parentElement.getAttribute(Rs),10)-1,this.parent.isPersistSelection&&!this.parent.editSettings.showAddNewRow&&this.parent.element.getElementsByClassName(ms).length>0&&++s,this.mUPTarget&&this.mUPTarget.isEqualNode(t)||this.rowCellSelectionHandler(s,parseInt(t.getAttribute(xs),10)-1),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection((0,o.closest)(t,"."+us)),this.setCheckAllState())}else this.checkedTarget=i,i.classList.contains("e-checkselectall")?this.checkSelectAll(i):this.checkSelect(i);this.parent.isCheckBoxSelection||!o.Browser.isDevice||this.isSingleSel()||this.showPopup(e)}else if(e.target.classList.contains("e-headercell")&&!e.target.classList.contains("e-stackedheadercell")){var a=e.target.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");this.headerSelectionHandler(this.parent.getColumnIndexByUid(a))}this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.isMultiShiftRequest=!1,(0,o.isNullOrUndefined)((0,o.closest)(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},e.prototype.popUpClickHandler=function(e){var t=e.target;(0,o.closest)(t,".e-headercell")||e.target.classList.contains(is)||(0,o.closest)(t,".e-gridpopup")?t.classList.contains("e-rowselect")&&(t.classList.contains("e-spanclicked")?(t.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(t.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},e.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||Va(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(this.selectedRecords.length>1||this.selectedRowCellIndexes.length>1)?" e-spanclicked":""))},e.prototype.rowCellSelectionHandler=function(e,t){if(!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel())this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:t},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders();else if(this.isMultiShiftRequest){var i=(0,o.closest)(this.target,"."+is).classList.contains(gs);this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!i||this.parent.getColumns().some(function(e){return"checkbox"===e.type})&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&i?this.selectRowsByRange((0,o.isUndefined)(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange((0,o.isUndefined)(this.prevCIdxs)?{rowIndex:e,cellIndex:t}:this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.updateAutoFillPosition(),this.drawBorders()}else{if(this.addRowsToSelection([e]),"Both"===this.selectionSettings.mode){var n=this.parent.getColumns().find(function(e){return"checkbox"===e.type}),r=n&&n.index!==t;r&&!this.isMultiCtrlRequestCell?this.selectCell({rowIndex:e,cellIndex:t},this.selectionSettings.enableToggle):n&&!r||this.addCellsToSelection([{rowIndex:e,cellIndex:t}])}else this.addCellsToSelection([{rowIndex:e,cellIndex:t}]);this.showHideBorders("none")}this.isDragged=!1},e.prototype.onCellFocused=function(e){if((this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&e.container.isHeader&&e.byKey)if("upArrow"===e.keyArgs.action)this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName;else if("downArrow"===e.keyArgs.action){var t=Number(e.element.parentElement.getAttribute(Rs))-1;e.isJump=0===t}else"ctrlHome"===e.keyArgs.action&&(e.isJump=!0);var i=(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action)&&!(e.element.classList.contains("e-detailrowexpand")||e.element.classList.contains("e-detailrowcollapse")),n=e.container.isHeader&&"TD"!==e.element.tagName&&!(0,o.closest)(e.element,"."+is)&&!(e.byKey&&"space"===e.keyArgs.action);if(e.byKey&&!i){var r=e.container.isContent?e.container.indexes:e.indexes,s=r[0],a=r[1],l=this.focus.getPrevIndexes();if((e.element.parentElement.querySelector(".e-rowcelldrag")||e.element.parentElement.querySelector(".e-dtdiagonalright")||e.element.parentElement.querySelector(".e-dtdiagonaldown"))&&(l.cellIndex=l.cellIndex-1),this.parent.frozenRows||this.parent.pinnedTopRecords.length)if(e.container.isHeader&&("TD"===e.element.tagName||(0,o.closest)(e.element,"."+is))){var h=this.parent.getHeaderTable().querySelector("thead").childElementCount;this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&"upArrow"===e.keyArgs.action&&h++,s-=h,l.rowIndex=(0,o.isNullOrUndefined)(l.rowIndex)?null:l.rowIndex-h}else s+=this.parent.frozenRows||this.parent.pinnedTopRecords.length,l.rowIndex=0!==l.rowIndex&&(0,o.isNullOrUndefined)(l.rowIndex)?null:l.rowIndex+(this.parent.frozenRows||this.parent.pinnedTopRecords.length);if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&(s=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1),!(n||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&s===l.rowIndex&&a===l.cellIndex)||this.selectionSettings.allowColumnSelection){this.parent.enableVirtualization&&(s=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1,!this.parent.enableColumnVirtualization&&!this.parent.groupSettings.columns.length&&this.parent.totalDataRecordsCount>=1&&("ctrlHome"===e.keyArgs.action?(s=0,this.parent.isFocusFirstCell=!0):"ctrlEnd"===e.keyArgs.action&&(s=this.parent.totalDataRecordsCount-1,this.isFocusLastCell=!0))),!this.parent.editSettings.showAddNewRow||"Top"!==this.parent.editSettings.newRowPosition||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||"downArrow"!==e.keyArgs.action||s--,this.preventFocus=!0;var d=this.getKeyColIndex(e);if(this.needColumnSelection&&(a=d),this.parent.element.classList.contains("e-gridcell-read")&&("tab"===e.keyArgs.action||"shiftTab"===e.keyArgs.action||"rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)){var p=this.target.getAttribute("aria-label");p=this.target.innerHTML+" column header "+this.parent.getColumnByIndex(a).field,this.target.setAttribute("aria-label",p)}switch(e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.isKeyAction=!0,this.applyDownUpKey(s,a);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(s,a);break;case"shiftDown":case"shiftUp":this.shiftDownKey(s,a);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(s,a);break;case"home":case"end":a="end"===e.keyArgs.action?this.getLastColIndex(s):0,this.applyHomeEndKey(s,a);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(s,a);break;case"escape":this.clearSelection(),this.parent.clipboardModule&&window.navigator.clipboard.writeText("");break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(s)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),this.updateAutoFillPosition()}}else i&&!(this.parent.isCheckBoxSelection||this.selectionSettings.persistSelection&&(e.parent.classList.contains("e-recordplusexpand")||e.parent.classList.contains("e-recordpluscollapse")||e.parent.classList.contains("e-groupcaption")))&&this.clearSelection()},e.prototype.getKeyColIndex=function(e){var t,i=null,n=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&_a(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,n){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return i;t=n.getAttribute("data-mappinguid");var r=this.getstackedColumns(this.parent.getColumnByUid(t).columns),s=this.parent.getColumnIndexByUid(r[r.length-1].uid),a=this.parent.getColumnIndexByUid(r[0].uid);i=this.prevColIndex>=s?a:s}else(0,o.isNullOrUndefined)(e.element.querySelector(".e-headercelldiv"))||(i=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")));return i},e.prototype.ctrlPlusA=function(){if(this.isRowType()&&!this.isSingleSel()){var e=this.parent.getRowsObject();this.selectRowsByRange(e[0].index,e[e.length-1].index)}this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},e.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},e.prototype.applyDownUpKey=function(e,t){var i=this.parent;!this.parent.isCheckBoxSelection||"Check"!==this.parent.checkAllRows||this.selectionSettings.persistSelection||this.selectionSettings.checkboxOnly||(this.checkSelectAllAction(!1),this.checkedTarget=null),!this.isRowType()||this.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||(this.parent.frozenRows||this.parent.pinnedTopRecords.length,this.selectRow(e,!0),this.applyUpDown(i.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0),this.selectionSettings.allowColumnSelection&&this.needColumnSelection&&this.selectColumn(t)},e.prototype.applyUpDown=function(e){if(!(e<0)){this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]);var t=parseInt(this.target.getAttribute(xs),10)-1,i=this.contentRenderer.getRowByIndex(e);if(i&&(this.target=i.getElementsByClassName(is)[parseInt(t.toString(),10)]),this.addAttribute(this.target),this.parent.element.classList.contains("e-gridcell-read")){var n=this.target.getAttribute("aria-label");n=this.target.innerHTML,this.target.setAttribute("aria-label",n)}}},e.prototype.applyRightLeftKey=function(e,t){this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},e.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},e.prototype.shiftDownKey=function(e,t){this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&((0,o.isUndefined)(this.prevRowIndex)?this.isPartialSelection?this.selectRow(e,!0):this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},e.prototype.applyShiftLeftRightKey=function(e,t){this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},e.prototype.getstackedColumns=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.getstackedColumns(e[parseInt(i.toString(),10)].columns):t.push(e[parseInt(i.toString(),10)]);return t},e.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},e.prototype.addRemoveClassesForRow=function(e,t,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];if(e){var s=[].slice.call(e.getElementsByClassName(is)),o=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),a=e.querySelector(".e-rowdragdrop");o&&s.push(o),a&&s.push(a),vl.apply(void 0,[s,t].concat(n))}this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,i)},e.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},e.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},e.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},e.prototype.getRenderer=function(){return(0,o.isNullOrUndefined)(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(i.Content)),this.contentRenderer},e.prototype.getSelectedRecords=function(){var e=[];return e=!this.selectionSettings.persistSelection&&this.selectedRecords.length?this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data}):this.persistSelectedData,this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?e=this.virtualSelectedData:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection?e=this.partialSelectedData:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.isRemote()&&this.isPartialSelection&&!this.parent.isPersistSelection&&(e=this.persistSelectedData),e},e.prototype.selectColumn=function(e){var t=this.parent;if(!(0,o.isNullOrUndefined)(t.getColumns()[parseInt(e.toString(),10)])){var i=t.getColumnByIndex(e),n=t.getColumnHeaderByUid(i.uid),r=n.classList.contains("e-columnselection");if(t.selectionSettings.allowColumnSelection){var s=this.selectedColumnsIndexes.length>1&&this.selectedColumnsIndexes.indexOf(e)>-1;if(this.clearColDependency(),!this.selectionSettings.enableToggle||s||!r){var a={columnIndex:e,headerCell:n,column:i,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(a,B),a.cancel)return void this.disableInteracted();!s&&r&&t.selectionSettings.enableToggle&&e===this.prevColIndex||this.updateColSelection(n,e);var l={columnIndex:e,headerCell:n,column:i,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(l,z)}this.updateColProps(e)}}},e.prototype.selectColumnsByRange=function(e,t){var i=this.parent;if(!(0,o.isNullOrUndefined)(i.getColumns()[parseInt(e.toString(),10)])){var n=[];if("Single"===i.selectionSettings.type||(0,o.isNullOrUndefined)(t))n[0]=e;else for(var r=e<t,s=e;r?s<=t:s>=t;r?s++:s--)n.push(s);this.selectColumns(n)}},e.prototype.selectColumns=function(e){var t=this.parent,i=this.getselectedCols();if("Single"===t.selectionSettings.type&&(e=[e[0]]),t.selectionSettings.allowColumnSelection){this.clearColDependency();var n={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(n,B),n.cancel)this.disableInteracted();else{for(var r=0,s=e.length;r<s;r++)this.updateColSelection(t.getColumnHeaderByUid(t.getColumnByIndex(e[parseInt(r.toString(),10)]).uid),e[parseInt(r.toString(),10)]);i=this.getselectedCols();var o={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(o,z),this.updateColProps(e[0])}}},e.prototype.selectColumnWithExisting=function(e){var t=this.parent;if(!(0,o.isNullOrUndefined)(t.getColumns()[parseInt(e.toString(),10)])){var i=t.getColumnHeaderByUid(t.getColumnByIndex(e).uid),n=this.getselectedCols();if("Single"===t.selectionSettings.type&&this.clearColDependency(),t.selectionSettings.allowColumnSelection){if(this.selectedColumnsIndexes.indexOf(e)>-1)this.clearColumnSelection(e);else{var r={columnIndex:e,headerCell:n,columnIndexes:this.selectedColumnsIndexes,column:t.getColumnByIndex(e),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(r,B),r.cancel)return void this.disableInteracted();this.updateColSelection(i,e);var s={columnIndex:e,headerCell:n=this.getselectedCols(),column:t.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(s,z)}this.updateColProps(e)}}},e.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var t=this.parent;if(!(0,o.isNullOrUndefined)(e)&&-1===this.selectedColumnsIndexes.indexOf(e))return;var i=(0,o.isNullOrUndefined)(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,n=t.getColumnByIndex(i),r=t.getColumnHeaderByUid(n.uid),s={columnIndex:i,headerCell:r,columnIndexes:this.selectedColumnsIndexes,column:n,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(s,q))return void this.disableInteracted();for(var a=(0,o.isNullOrUndefined)(e)?[].slice.call(t.getHeaderContent().getElementsByClassName("e-columnselection")):[r],l=this.getSelectedColumnCells(e),h=0,d=a.length;h<d;h++)vl([a[parseInt(h.toString(),10)]],!1,"e-columnselection");for(h=0,d=l.length;h<d;h++)vl([l[parseInt(h.toString(),10)]],!1,"e-columnselection");(0,o.isNullOrUndefined)(e)?(this.columnDeselect(s,U),this.selectedColumnsIndexes=[],this.isColumnSelected=!1,this.parent.getColumns().filter(function(e){return e.isSelected=!1})):(this.selectedColumnsIndexes.splice(this.selectedColumnsIndexes.indexOf(e),1),this.parent.getColumns()[parseInt(e.toString(),10)].isSelected=!1)}},e.prototype.getselectedCols=function(){var e,t=this.parent;if(this.selectedColumnsIndexes.length>1){e=[];for(var i=0;i<this.selectedColumnsIndexes.length;i++)e.push(t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[parseInt(i.toString(),10)]).uid))}else e=t.getColumnHeaderByUid(t.getColumnByIndex(this.selectedColumnsIndexes[0]).uid);return e},e.prototype.getSelectedColumnCells=function(e){for(var t=this.parent,i=!(0,o.isNullOrUndefined)(this.parent.rowTemplate)?t.getRows():t.getDataRows(),n=[],r=(0,o.isNullOrUndefined)(e)?".e-columnselection":'[aria-colindex="'+(e+1)+'"]',s=0,a=i.length;s<a;s++)n=n.concat([].slice.call(i[parseInt(s.toString(),10)].querySelectorAll(r)));return n},e.prototype.columnDeselect=function(e,t){return"columnDeselected"===t&&delete e.cancel,this.onActionComplete(e,t),e.cancel},e.prototype.updateColProps=function(e){this.prevColIndex=e,this.isColumnSelected=this.selectedColumnsIndexes.length&&!0},e.prototype.clearColDependency=function(){this.clearColumnSelection(),this.selectedColumnsIndexes=[]},e.prototype.updateColSelection=function(e,t){if(!(0,o.isNullOrUndefined)(this.parent.getColumns()[parseInt(t.toString(),10)])){var i=!(0,o.isNullOrUndefined)(this.parent.rowTemplate)?this.parent.getRows():this.parent.getDataRows();this.selectedColumnsIndexes.push(t),this.parent.getColumns()[parseInt(t.toString(),10)].isSelected=!0,t+=this.parent.getIndentCount(),vl([e],!0,"e-columnselection");for(var n=0,r=i.length;n<r;n++)if(i[parseInt(n.toString(),10)].classList.contains(us))if(!i[parseInt(n.toString(),10)].classList.contains(fs)&&!i[parseInt(n.toString(),10)].classList.contains(ms)||"Normal"!==this.parent.editSettings.mode||(0,o.isNullOrUndefined)(i[parseInt(n.toString(),10)].querySelector("tr").childNodes[parseInt(t.toString(),10)]))if(this.parent.isSpan&&this.parent.isFrozenGrid())for(var s=i[parseInt(n.toString(),10)].querySelectorAll(".e-rowcell"),a=0;a<s.length;a++)s[parseInt(a.toString(),10)].getAttribute("aria-colindex")===e.getAttribute("aria-colindex")&&vl([s[parseInt(a.toString(),10)]],!0,"e-columnselection");else(0,o.isNullOrUndefined)(i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)])||vl([i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection");else vl([i[parseInt(n.toString(),10)].querySelector("tr").childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection")}},e.prototype.headerSelectionHandler=function(e){!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?this.selectColumn(e):this.isMultiShiftRequest?this.selectColumnsByRange((0,o.isUndefined)(this.prevColIndex)?e:this.prevColIndex,e):this.selectColumnWithExisting(e)},e.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(Pe,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(E,this.onDataBoundFunction),this.parent.on(kr,this.onDataBoundFunction),this.parent.on(Ne,this.checkBoxSelectionChanged,this),this.parent.on(Wn,this.initPerisistSelection,this),this.parent.on(ze,this.setCheckAllForEmptyGrid,this),this.parent.on(St,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener(Ce,this.resizeEndFn)},e.prototype.removeEventListener_checkbox=function(){this.parent.off(Pe,this.dataReady),this.parent.removeEventListener(E,this.onDataBoundFunction),this.parent.off(kr,this.onDataBoundFunction),this.parent.off(ze,this.setCheckAllForEmptyGrid),this.parent.off(St,this.clickHandler),this.parent.removeEventListener(Ce,this.resizeEndFn),this.parent.off(Wn,this.initPerisistSelection)},e.prototype.setCheckAllForEmptyGrid=function(){var e=this.getCheckAllBox();if(e){this.parent.isCheckBoxSelection=!0;var t=e.nextElementSibling;(0,o.removeClass)([t],["e-check","e-stop","e-uncheck"]),(0,o.addClass)([t.parentElement],["e-checkbox-disabled"]),e.classList.contains("e-checkbox")&&e.classList.remove("e-checkbox")}},e.prototype.dataReady=function(e){this.isHeaderCheckboxClicked=!1;var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||this.parent.isPersistSelection&&(!this.parent.isPersistSelection||"Single"!==this.selectionSettings.type)||t||(this.disableUI=!(this.parent.enableImmutableMode||"save"===e.requestType&&"add"===e.action),this.clearSelection(),this.setCheckAllState(),this.disableUI=!1)},e.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},e.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,(0,o.isNullOrUndefined)(this.parent.selectedRowIndex)||-1===this.parent.selectedRowIndex||!this.parent.enablePersistence?this.parent.selectedRowIndex=e:this.parent.selectedRowIndex=-1},e.prototype.disableInteracted=function(){this.isInteracted=!1},e.prototype.activeTarget=function(){this.actualTarget=this.isInteracted?this.actualTarget:null},e.prototype.getAvailableDataCount=function(e){return this.parent.isTreeGrid&&!this.parent.isRemote()?e.length:this.getAvailableSelectedData(e).length},e}(),Go=function(){function e(e){this.headerFocus=!1,this.parent=e,this.addEventListener()}return e.prototype.hasNonNumericCharacters=function(e){for(var t=!1,i=0,n=e;i<n.length;i++){var r=n[i];if((r<"0"||r>"9")&&"."!==r)return!0;if("."===r){if(t)return!0;t=!0}}return!1},e.prototype.search=function(e){var t=this.parent;if(e=(0,o.isNullOrUndefined)(e)?"":e,fl(t))t.notify(Wt,{instance:this,handler:this.search,arg1:e});else if(e!==t.searchSettings.key){if(this.headerFocus=!1,""===e||this.hasNonNumericCharacters(e))t.searchSettings.key=e.toString();else{var i=e.split(".");"."===e||-1===e.indexOf(".")||i[0].startsWith("0")&&i[0].length>1?t.searchSettings.key=e.toString():t.searchSettings.key=parseFloat(e).toString()}this.parent.renderModule.resetPartialRecords(),t.dataBind()}else this.refreshSearch?t.refresh():this.headerFocus=!1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(Ye,this.onSearchComplete,this),this.parent.on(Ct,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(D,this.actionCompleteFunc),this.parent.on(Li,this.cancelBeginEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(qe,this.onPropertyChanged),this.parent.off(Ye,this.onSearchComplete),this.parent.off(Ct,this.destroy),this.parent.removeEventListener(D,this.actionCompleteFunc),this.parent.off(Li,this.cancelBeginEvent))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&((0,o.isNullOrUndefined)(e.properties.key)?this.parent.notify(Ue,{requestType:"searching",type:R}):this.parent.notify(Ue,{requestType:"searching",type:R,searchString:this.parent.searchSettings.key}))},e.prototype.onSearchComplete=function(e){this.parent.trigger(D,(0,o.extend)(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:D}))},e.prototype.onActionComplete=function(e){this.refreshSearch&&"refresh"===e.requestType&&this.headerFocus&&(this.headerFocus=!1,this.parent.focusModule.focus(),(0,o.addClass)([this.parent.focusModule.currentInfo.element],["e-focused"])),this.refreshSearch="searching"!==e.requestType},e.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},e.prototype.getModuleName=function(){return"search"},e}(),_o=function(){function e(e){this.colName=[],this.isShowHide=!1,this.parent=e,this.addEventListener(),this.widthService=new ko(e)}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:te,handler:this.batchChanges},{event:Pr,handler:this.resetColumnState}],Rh(this.parent,this.evtHandlers,!0,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||Rh(this.parent,this.evtHandlers,!1)},e.prototype.batchChanges=function(){this.isShowHide&&(this.isShowHide=!1,this.setVisible(this.colName,this.changedCol),this.changedCol=this.colName=[])},e.prototype.show=function(e,t){var i=this.getToggleFields(e),n=this.getColumns(i,t);if(this.parent.notify(Bt,{module:"edit"}),this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length){var r=n.filter(function(e){return!e.visible});r.forEach(function(e){return e.visible=!0}),r.length>0&&this.setVisible(r)}else{for(var s=0;s<n.length;s++)n[parseInt(s.toString(),10)].visible=!0;this.setVisible(n)}},e.prototype.hide=function(e,t){var i=this.getToggleFields(e),n=this.getColumns(i,t);if(this.parent.notify(Bt,{module:"edit"}),this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length){var r=n.filter(function(e){return e.visible});r.forEach(function(e){return e.visible=!1}),r.length>0&&this.setVisible(r)}else{for(var s=0;s<n.length;s++)n[parseInt(s.toString(),10)].visible=!1;this.setVisible(n)}},e.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},e.prototype.getColumns=function(e,t){var i=this;return Na(e,function(e){return Na(i.parent.columnModel,function(i){if(i[""+t]===e)return i})[0]})},e.prototype.batchActionPrevent=function(e,t){return void 0===t&&(t=[]),!fl(this.parent)||(this.colName=e,this.changedCol=t,this.parent.closeEdit(),!1)},e.prototype.resetColumnState=function(){if(this.isShowHide)for(var e=0;e<this.colName.length;e++)this.colName[parseInt(e.toString(),10)].visible=!this.colName[parseInt(e.toString(),10)].visible},e.prototype.setVisible=function(e,t){var i=this;if(void 0===t&&(t=[]),this.isShowHide=!0,this.batchActionPrevent(e,t)){var n={requestType:"columnstate",cancel:!1,columns:t=t.length>0?t:e};if(this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&this.parent.groupModule.groupSettings.columns.length>0&&(this.parent.contentModule.visibleRows=[]),this.parent.trigger(R,n,function(r){var s=i.parent.getColumns();if(e=(0,o.isNullOrUndefined)(e)?s:e,r.cancel)return i.parent.notify(Mn,{showHideArgs:r}),void(e.length>0&&(e[0].visible=!0));i.parent.notify(Qr,n),Fl(i.parent)&&i.parent.contentModule.emptyVcRows();var a=i.parent.element.querySelector(".e-addedrow");i.parent.editSettings.showAddNewRow&&a&&((0,o.remove)(a),(i.parent.enableVirtualization||i.parent.enableInfiniteScrolling)&&(i.parent.isAddNewRow=!0),i.parent.addNewRowFocus=!0,i.parent.isEdit=!1),i.parent.allowSelection&&i.parent.getSelectedRecords().length&&!i.parent.selectionSettings.persistSelection&&i.parent.clearSelection(),i.parent.enableColumnVirtualization||(i.parent.isFrozenGrid()||i.parent.enableColumnSpan)&&e.length?i.parent.notify(Br,{isModeChg:!0}):i.parent.notify(wt,e);var l={requestType:"columnstate",columns:t};i.parent.trigger(D,l);var h=!i.parent.element.querySelector(".e-addedrow");i.parent.editSettings.showAddNewRow&&h&&(i.parent.isEdit=!1,i.parent.addRecord(),i.parent.enableVirtualization||i.parent.enableInfiniteScrolling||i.parent.notify(jr,{})),"All"!==i.parent.columnQueryMode&&i.parent.refresh()}),!this.parent.groupSettings.columns.length)if(this.parent.autoFit)this.parent.preventAdjustColumns();else if(this.parent.allowResizing&&"Normal"===this.parent.resizeSettings.mode){var r=-1===this.parent.getHeaderTable().style.width.indexOf("px");this.widthService.setWidthToTable(r)}}},e}(),Ko=function(){function e(e){this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new ko(e),this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(e){if(this.parent.element.style.width=(0,o.formatUnit)(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element){var t=this.parent.toolbarModule.toolbar.element,i=t.querySelector(".e-toolbar-left"),n=t.querySelector(".e-toolbar-center"),r=t.querySelector(".e-toolbar-right"),s=t.querySelector(".e-toolbar-items"),a=i?i.clientWidth:0,l=n?n.clientWidth:0,h=r?r.clientWidth:0,d=s?s.clientWidth:0,p=t?t.clientWidth:0;(!this.parent.enableAdaptiveUI||a>p||l>p||h>p||d>p)&&this.parent.toolbarModule.toolbar.refreshOverflow()}},e.prototype.setHeight=function(){var t=0,i=this.parent.getContent().querySelector("."+ps),n=this.parent.height;if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){"auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-e.getScrollBarWidth());var r=this.parent.getContent().querySelector(".e-movablescrollbar");this.parent.height.toString().indexOf("%")>0&&!(0,o.isNullOrUndefined)(r)&&(n="calc("+n+" - "+r.scrollHeight+"px)")}if(!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height&&"100%"!==this.parent.height){var s=this.parent.getHeaderContent().querySelector(Ds+":not(.e-masked-tbody)");if(t=s?s.offsetHeight:0,s&&t)t-=s.getElementsByClassName(ms).length*this.parent.getRowHeight();else!this.parent.isInitialLoad&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&this.parent.getHeaderContent().querySelector(".e-masked-table")&&(n=parseInt(n,10)-this.parent.frozenRows*this.parent.getRowHeight());i.style.height=(0,o.formatUnit)(parseInt(n,10)-t)}else i.style.height=(0,o.formatUnit)(n);this.ensureOverflow(i),this.parent.isFrozenGrid()&&this.refresh()},e.prototype.setPadding=function(){var t=this.parent.getHeaderContent(),i=e.getScrollBarWidth()-this.getThreshold(),n=this.getCssProperties();t.querySelector("."+os).style[n.border]=i>0?"1px":"0px",t.style[n.padding]=i>0?i+"px":"0px"},e.prototype.removePadding=function(e){var t=this.getCssProperties(e),i=this.parent.getHeaderContent().querySelector("."+os);i.style[t.border]="",i.parentElement.style[t.padding]="";var n=this.parent.getFooterContent();n&&n.classList.contains("e-footerpadding")&&n.classList.remove("e-footerpadding")},e.prototype.refresh=function(){if("100%"===this.parent.height){var e=this.parent.getContent();this.parent.element.style.height="100%";var t=this.widthService.getSiblingsHeight(e);e.style.height="calc(100% - "+t+"px)"}},e.prototype.getThreshold=function(){return"mozilla"===o.Browser.info.name?.5:1-window.devicePixelRatio+1},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ze,this.wireEvents,this),this.parent.on(Ne,this.wireEvents,this),this.parent.on(Be,this.onPropertyChanged,this),this.parent.on(Fi,this.wireEvents,this),this.parent.on(je,this.setScrollLeft,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ze,this.wireEvents),this.parent.off(Ne,this.wireEvents),this.parent.off(Be,this.onPropertyChanged),this.parent.off(Fi,this.wireEvents),this.parent.off(je,this.setScrollLeft),this.unwireEvents())},e.prototype.unwireEvents=function(){this.parent.frozenRows&&this.header&&(o.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),o.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll));var e=this.parent.getContent()?this.parent.getContent().querySelector(".e-movablescrollbar"):null;this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&(e&&o.EventHandler.remove(e,"scroll",this.onCustomScrollbarScroll),this.content&&(o.EventHandler.remove(this.content,"scroll",this.onCustomScrollbarScroll),o.EventHandler.remove(this.content,"touchstart pointerdown",this.setPageXY),/macintosh|ipad/.test(o.Browser.userAgent.toLowerCase())&&o.Browser.isDevice||o.EventHandler.remove(this.content,"touchmove pointermove",this.onTouchScroll)),this.header&&(o.EventHandler.remove(this.header,"scroll",this.onCustomScrollbarScroll),o.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),o.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll))),this.content&&o.EventHandler.remove(this.content,"scroll",this.contentScrollHandler),this.header&&o.EventHandler.remove(this.header,"scroll",this.headerScrollHandler),this.contentScrollHandler=null,this.headerScrollHandler=null,this.parent.aggregates.length&&this.parent.getFooterContent()&&o.EventHandler.remove(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll)},e.prototype.setScrollLeft=function(){this.parent.getHeaderContent().querySelector("."+os).scrollLeft=this.previousValues.left},e.prototype.updateFrozenShadow=function(e){var t=this.parent.getContent().firstElementChild;if(!(0,o.isNullOrUndefined)(t)||!(0,o.isNullOrUndefined)(t)){var i=e||t,n=(this.parent.enableRtl?Math.abs(i.scrollLeft):i.scrollLeft)<=1;this.parent.getVisibleFrozenLeftCount()&&!n?(0,o.addClass)([this.parent.element],"e-left-shadow"):(0,o.removeClass)([this.parent.element],"e-left-shadow");var r=this.parent.enableRtl?Math.abs(i.scrollLeft):i.scrollLeft,s=Math.round(r+i.clientWidth)>=i.scrollWidth-1;this.parent.getVisibleFrozenRightCount()?s?(0,o.removeClass)([this.parent.element],"e-right-shadow"):(0,o.addClass)([this.parent.element],"e-right-shadow"):(0,o.removeClass)([this.parent.element],"e-right-shadow")}},e.prototype.onContentScroll=function(e){var t=this,i=e,n=i.classList.contains(os);return function(e){if(null!==t.content.querySelector(Ds)&&!t.parent.isPreventScrollEvent){var r=e.target;if(t.parent.frozenRows&&(t.content.scrollTop>0&&t.parent.frozenRows?(0,o.addClass)([t.parent.element],"e-top-shadow"):(0,o.removeClass)([t.parent.element],"e-top-shadow")),t.parent.element.querySelectorAll(".e-leftfreeze,.e-fixedfreeze,.e-rightfreeze").length){var s=t.parent.getContent().querySelectorAll('.e-freezeerror:not([style*="display: none"])'),a=t.parent.getContent().querySelectorAll('.e-fixederror:not([style*="display: none"])');t.updateFrozenShadow(r);var l=[].slice.call(t.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)"));if((1===l.length&&s.length||t.parent.element.querySelector('.e-freeze-autofill:not([style*="display: none"])')||a.length)&&r.scrollLeft!==t.previousValues.left)return void(r.scrollLeft=t.previousValues.left);if(1!==l.length&&(s.length||a.length)&&r.scrollTop!==t.previousValues.top)return void(r.scrollTop=t.previousValues.top)}var h=r.scrollLeft;if((0,o.isNullOrUndefined)(t.parent.infiniteScrollModule)||!t.parent.enableInfiniteScrolling||t.parent.isEdit&&(!t.parent.editSettings.showAddNewRow||t.parent.element.querySelector(".e-editedrow"))||t.parent.notify(wn,{target:e.target,isLeft:t.previousValues.left!==h}),t.parent.groupSettings.columns.length&&t.parent.groupSettings.enableLazyLoading){var d=t.previousValues.top<t.parent.getContent().firstElementChild.scrollTop;t.parent.notify(Bn,{scrollDown:d})}t.parent.notify(gn,{});var p=r.classList.contains("e-summarycontent");t.previousValues.left!==h?(t.parent.notify(kn,e),i.scrollLeft=h,p&&(t.header.scrollLeft=h),t.previousValues.left=h,t.parent.notify(bt,{left:h})):t.previousValues.top=n?r.scrollTop:t.previousValues.top}}},e.prototype.onCustomScrollbarScroll=function(e,t){var i=this,n=e,r=t;return function(e){if(null!==i.content.querySelector(Ds)){var t=e.target.scrollLeft;i.previousValues.left!==t&&(n.scrollLeft=t,r.scrollLeft=t,i.previousValues.left=t,i.parent.notify(bt,{left:t}),i.parent.isDestroyed)}}},e.prototype.onTouchScroll=function(e){var t=this,i=e;return function(e){if("mouse"!==e.pointerType){var n=t.parent.isFrozenGrid(),r=t.getPointXY(e),s=i.scrollLeft+(t.pageXY.x-r.x),o=t.parent.getHeaderContent().querySelector("."+os),a=t.parent.getContent().querySelector("."+ps);if(!(t.previousValues.left===s||s<0||o.scrollWidth-o.clientWidth<s)){if(e.preventDefault(),o.scrollLeft=s,a.scrollLeft=s,n&&t.parent.enableColumnVirtualization)t.parent.getContent().querySelector(".e-movablescrollbar").scrollLeft=s;t.pageXY.x=r.x,t.previousValues.left=s}}}},e.prototype.setPageXY=function(){var e=this;return function(t){"mouse"!==t.pointerType&&(e.pageXY=e.getPointXY(t))}},e.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},e.prototype.getScrollbleParent=function(e){if(null===e)return null;var t=(0,o.isNullOrUndefined)(e.tagName)?e.scrollingElement:e,i=document.defaultView.getComputedStyle(t,null).overflowY;return t.scrollHeight>t.clientHeight&&"hidden"!==i&&"visible"!==i||"HTML"===e.tagName||"BODY"===e.tagName?e:this.getScrollbleParent(e.parentNode)},e.prototype.addStickyListener=function(e){this.parentElement=this.getScrollbleParent(this.parent.element.parentElement),e&&this.parentElement?(this.eventElement="HTML"===this.parentElement.tagName||"BODY"===this.parentElement.tagName?document:this.parentElement,this.stickyScrollHandler=this.makeStickyHeader(),o.EventHandler.add(this.eventElement,"scroll",this.stickyScrollHandler,this)):this.eventElement&&(o.EventHandler.remove(this.eventElement,"scroll",this.stickyScrollHandler),this.stickyScrollHandler=null,this.eventElement=null)},e.prototype.resizeFrozenRowBorder=function(){var t;this.parent.element.querySelector(".e-frozenrow-border")?t=this.parent.element.querySelector(".e-frozenrow-border"):(t=this.parent.createElement("div",{className:"e-frozenrow-border"}),this.parent.element.insertBefore(t,this.parent.element.querySelector(".e-gridcontent")));var i="auto"!==this.parent.height?e.getScrollBarWidth():0;t.style.width=this.parent.element.offsetWidth-i-.5+"px"},e.prototype.wireEvents=function(){var e=this;if(this.oneTimeReady){var t=this.parent.isFrozenGrid();this.content=this.parent.getContent().querySelector("."+ps),this.header=this.parent.getHeaderContent().querySelector("."+os);var i=this.parent.getContent().querySelector(".e-movablescrollbar");(this.parent.frozenRows||this.parent.isRowPinned)&&this.header&&this.content&&(o.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),o.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this)),t&&i&&this.parent.enableColumnVirtualization&&(o.EventHandler.add(i,"scroll",this.onCustomScrollbarScroll(this.content,this.header),this),o.EventHandler.add(this.content,"scroll",this.onCustomScrollbarScroll(i,this.header),this),o.EventHandler.add(this.header,"scroll",this.onCustomScrollbarScroll(i,this.content),this),o.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),o.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this),o.EventHandler.add(this.content,"touchstart pointerdown",this.setPageXY(),this),/macintosh|ipad/.test(o.Browser.userAgent.toLowerCase())&&o.Browser.isDevice||o.EventHandler.add(this.content,"touchmove pointermove",this.onTouchScroll(this.header),this)),this.contentScrollHandler=this.onContentScroll(this.header),this.headerScrollHandler=this.onContentScroll(this.content),o.EventHandler.add(this.content,"scroll",this.contentScrollHandler,this),o.EventHandler.add(this.header,"scroll",this.headerScrollHandler,this),this.parent.aggregates.length&&o.EventHandler.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.parent.enableStickyHeader&&this.addStickyListener(!0),this.refresh(),this.oneTimeReady=!1}var n,r,s,a=this.parent.getContentTable();Oa(function(){n=e.header.scrollLeft,r=a.scrollHeight,s=e.parent.getContent().clientHeight},function(){var t={cancel:!1};e.parent.notify(Yn,t),r<s&&"auto"!==e.parent.height&&(e.setLastRowCell(),e.parent.notify(Gr,t)),(e.parent.frozenRows||e.parent.pinnedTopRowModels.length)&&e.resizeFrozenRowBorder(),e.parent.element.querySelector(".e-frozenrow-border")&&((e.parent.pinnedTopRowModels.length||e.parent.frozenRows)&&e.parent.currentViewData.length?e.parent.element.querySelector(".e-frozenrow-border").classList.remove("e-frozenrow-empty"):e.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty")),e.parent.enableVirtualization||e.parent.enableInfiniteScrolling||t.cancel||(e.header.scrollLeft=e.previousValues.left,e.content.scrollLeft=e.previousValues.left,e.content.scrollTop=e.previousValues.top),e.parent.enableColumnVirtualization||(e.content.scrollLeft=n,e.parent.isFrozenGrid()&&(e.previousValues.left=n))}),this.parent.isPreventScrollEvent=!1},e.prototype.setLastRowCell=function(){var e=this.parent.getContentTable();(0,o.removeClass)(e.querySelectorAll("td"),"e-lastrowcell"),e.querySelector("tr:nth-last-child(2)")&&this.parent.editSettings.showAddNewRow&&"Bottom"===this.parent.editSettings.newRowPosition&&(0,o.addClass)(e.querySelector("tr:nth-last-child(2)").querySelectorAll("td"),"e-lastrowcell"),(0,o.addClass)(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.parent.isSpan&&(0,o.addClass)(e.querySelectorAll(".e-row-span-lastrowcell"),"e-lastrowcell")},e.prototype.getCssProperties=function(e){var t={},i=(0,o.isNullOrUndefined)(e)?this.parent.enableRtl:e;return t.border=i?"borderLeftWidth":"borderRightWidth",t.padding=i?"paddingLeft":"paddingRight",t},e.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight();this.setWidth(!(0,o.isNullOrUndefined)(e.properties.width))}},e.prototype.makeStickyHeader=function(){var e=this;return function(){if(e.parent.enableStickyHeader&&e.parent.element&&e.parent.getContent()){var t=e.parent.getContent().getClientRects()[0];if(t){var i=window.devicePixelRatio,n=e.parent.getHeaderContent(),r=e.parent.element.querySelector(".e-toolbar"),s=e.parent.element.querySelector(".e-groupdroparea"),a=n.offsetHeight+(r?r.offsetHeight:0)+(s?s.offsetHeight:0),l=e.parentElement.getClientRects()[0].top,h=t.top-(l<0?0:l),d=t.left,p=document.body.querySelector("#"+e.parent.element.id+"_columnmenu");if(1!==i&&(h=Math.ceil(h)),h<a&&t.bottom>0){n.classList.add("e-sticky");var c=0;s&&e.parent.groupSettings.showDropArea&&(e.setSticky(s,c,t.width,d,!0),c+=s.getClientRects()[0].height),r&&(e.setSticky(r,c,t.width,d,!0),c+=r.getClientRects()[0].height),e.setSticky(n,c,t.width,d,!0),(0,o.isNullOrUndefined)(p)||(p.style.position="fixed",p.style.top=a+"px")}else if(n.classList.contains("e-sticky")){e.setSticky(n,null,null,null,!1),r&&e.setSticky(r,null,null,null,!1),s&&e.setSticky(s,null,null,null,!1);var u=e.parent.element.querySelector(".e-ccdlg");if(u&&u.classList.remove("e-sticky"),!(0,o.isNullOrUndefined)(p)){p.style.position="absolute";var g=t.top-l;p.style.top=g+"px"}}e.parent.notify(Er,{})}}}},e.prototype.setSticky=function(e,t,i,n,r){r?e.classList.add("e-sticky"):e.classList.remove("e-sticky"),e.style.width=null!=i?i+"px":"",e.style.top=null!=t?t+"px":"",e.style.left=null!==n?parseInt(e.style.left,10)!==n?n+"px":e.style.left:""},e.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+ns)||e.querySelector("."+rs))){this.removeEventListener();var t=this.parent.getContent().querySelector("."+ps);o.EventHandler.remove(t,"scroll",this.onContentScroll),this.parent.enableStickyHeader&&this.addStickyListener(!1),this.removePadding(),(0,o.removeClass)([this.parent.getHeaderContent().querySelector("."+os)],os),(0,o.removeClass)([t],ps),t.style.height="",this.parent.element.style.width=""}},e.getScrollBarWidth=function(){return ol()},e}(),Wo=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qo=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},Xo=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.templateFn={},t}return Wo(i,e),i.prototype.setFormatter=function(e){this.formatFn=e},i.prototype.getFormatter=function(){return this.formatFn},i.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[(0,o.getEnumValue)(t,t.Summary)]={fn:(0,o.compile)(this.footerTemplate,e),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[(0,o.getEnumValue)(t,t.GroupSummary)]={fn:(0,o.compile)(this.groupFooterTemplate,e),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[(0,o.getEnumValue)(t,t.CaptionSummary)]={fn:(0,o.compile)(this.groupCaptionTemplate,e),property:"groupCaptionTemplate"})},i.prototype.getTemplate=function(e){return this.templateFn[(0,o.getEnumValue)(t,e)]},i.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},Qo([(0,o.Property)()],i.prototype,"type",void 0),Qo([(0,o.Property)()],i.prototype,"field",void 0),Qo([(0,o.Property)()],i.prototype,"columnName",void 0),Qo([(0,o.Property)()],i.prototype,"format",void 0),Qo([(0,o.Property)()],i.prototype,"footerTemplate",void 0),Qo([(0,o.Property)()],i.prototype,"groupFooterTemplate",void 0),Qo([(0,o.Property)()],i.prototype,"groupCaptionTemplate",void 0),Qo([(0,o.Property)()],i.prototype,"customAggregate",void 0),i}(o.ChildProperty),Yo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wo(t,e),Qo([(0,o.Collection)([],Xo)],t.prototype,"columns",void 0),t}(o.ChildProperty),Jo=function(){function e(e,t){this.copyContent="",this.isSelect=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ne,this.initialEnd,this),this.parent.on(vt,this.keyDownHandler,this),this.parent.on(St,this.clickHandler,this),this.parent.on(ze,this.initialEnd,this),o.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(vt,this.keyDownHandler),this.parent.off(Ne,this.initialEnd),this.parent.off(St,this.clickHandler),this.parent.off(ze,this.initialEnd),o.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},e.prototype.clickHandler=function(e){var t=e.target;t=_a(t,"e-rowcell")},e.prototype.pasteHandler=function(e){var t=this,i=this.parent,n=/(Mac)/i.test(navigator.platform),r=this.parent.getSelectedRowCellIndexes();if(!i.isEdit&&67===e.keyCode&&n&&e.metaKey&&this.copy(),r.length&&86===e.keyCode&&(!n&&e.ctrlKey||n&&e.metaKey)&&!i.isEdit){var s=(0,o.closest)(document.activeElement,"."+is);if(!this.clipBoardTextArea||!s||!i.editSettings.allowEditing||"Batch"!==i.editSettings.mode||"Cell"!==i.selectionSettings.mode||"Flow"===i.selectionSettings.cellSelectionMode)return;this.activeElement=document.activeElement;var a=window.scrollX,l=window.scrollY;this.clipBoardTextArea.focus(),setTimeout(function(){t.activeElement.focus(),window.scrollTo(a,l),t.paste(t.clipBoardTextArea.value,r[0].rowIndex,r[0].cellIndexes[0])},n?100:10)}},e.prototype.paste=function(e,t,i){for(var n,r,s,a=this.parent,l=i,h=t,d=e.split("\n"),p=0;p<d.length;p++){if(s=d[parseInt(p.toString(),10)].split("\t"),l=i,p===d.length-1&&""===d[parseInt(p.toString(),10)]||(0,o.isUndefined)(a.getRowByIndex(h))){l++;break}for(var c=0;c<s.length;c++){if(!a.getCellFromIndex(h,l)){l++;break}if(r=(n=a.getColumnByIndex(l)).getParser()?n.getParser()(s[parseInt(c.toString(),10)]):s[parseInt(c.toString(),10)],n.allowEditing&&!n.isPrimaryKey){var u={column:n,data:r,rowIndex:h};this.parent.trigger(Ie,u),h=u.rowIndex,u.cancel||a.editModule&&("number"===n.type?this.parent.editModule.updateCell(h,n.field,parseFloat(u.data)):a.editModule.updateCell(h,n.field,u.data))}l++}h++}a.selectionModule.selectCellsByRange({rowIndex:t,cellIndex:i},{rowIndex:h-1,cellIndex:l-1});var g=this.parent.getCellFromIndex(h-1,l-1);g&&(0,o.classList)(g,["e-focus","e-focused"],[]),this.clipBoardTextArea.value=""},e.prototype.initialEnd=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.off(Ne,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{id:this.parent.element.id+"_clipboard",tabindex:"-1","aria-label":this.l10n.getConstant("ClipBoard")}}),this.clipBoardTextArea.style.opacity="0",this.parent.element.appendChild(this.clipBoardTextArea)},e.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},e.prototype.setCopyData=function(e){if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";var t=this.parent.getDataRows();if(this.parent.selectionSettings&&this.parent.selectionSettings.allowColumnSelection&&this.parent.selectionModule&&this.parent.selectionModule.selectedColumnsIndexes.length){if(e){for(var i=this.parent.selectionModule.selectedColumnsIndexes,n=[],r=0;r<i.length;r++){var s=i[parseInt(r.toString(),10)],a=this.parent.getColumnHeaderByIndex(s);a&&!a.classList.contains("e-hide")&&n.push(a)}this.getCopyData(n,!1,"\t",e),this.copyContent+="\n"}for(var l=0;l<t.length;l++){var h=[];l>0&&(this.copyContent+="\n"),h.push.apply(h,[].slice.call(t[parseInt(l.toString(),10)].querySelectorAll(".e-columnselection:not(.e-hide)"))),this.getCopyData(h,!1,"\t",e)}}else if("Cell"!==this.parent.selectionSettings.mode){var d=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){var p=[];for(r=0;r<this.parent.getVisibleColumns().length;r++)p[parseInt(r.toString(),10)]=this.parent.getVisibleColumns()[parseInt(r.toString(),10)].headerText;this.getCopyData(p,!1,"\t",e),this.copyContent+="\n"}if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&d.length>t.length){d=[];for(r=0;r<t.length;r++){var c=t[parseInt(r.toString(),10)];"true"===c.getAttribute("aria-selected")&&d.push(parseInt(c.getAttribute("data-rowindex"),10))}}for(r=0;r<d.length;r++){r>0&&(this.copyContent+="\n");var u=[],g=d[parseInt(r.toString(),10)];!Fl(this.parent)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache||this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading)&&(g=t.map(function(e){return e.getAttribute("data-rowindex")}).indexOf(d[parseInt(r.toString(),10)].toString()));var f=t[parseInt(g.toString(),10)];(0,o.isNullOrUndefined)(f)||(u.push.apply(u,[].slice.call(f.querySelectorAll(".e-rowcell:not(.e-hide)"))),this.getCopyData(u,!1,"\t",e))}}else if(this.parent.selectionModule&&this.parent.selectionModule.selectedRowCellIndexes.length){var m=this.checkBoxSelection();if(m.status){if(e){var y=[];for(r=0;r<m.colIndexes.length;r++){var v=this.parent.getColumnHeaderByIndex(m.colIndexes[parseInt(r.toString(),10)]);v.classList.contains("e-hide")||y.push(v)}this.getCopyData(y,!1,"\t",e),this.copyContent+="\n"}for(r=0;r<m.rowIndexes.length;r++){r>0&&(this.copyContent+="\n");var S=[].slice.call(t[m.rowIndexes[parseInt(r.toString(),10)]].querySelectorAll(".e-cellselectionbackground:not(.e-hide)"));this.getCopyData(S,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground")),!0,"\n",e)}var C={data:this.copyContent,cancel:!1};if(this.parent.trigger(be,C),C.cancel)return;this.clipBoardTextArea.value=this.copyContent=C.data,o.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0}},e.prototype.getCopyData=function(e,t,i,n){for(var r="string"!=typeof e[0],s=0;s<e.length;s++){if(n&&t){var o=parseInt(e[parseInt(s.toString(),10)].getAttribute(xs),10)-1;this.copyContent+=this.parent.getColumns()[parseInt(o.toString(),10)].headerText+"\n"}r?e[parseInt(s.toString(),10)].classList.contains("e-hide")||(this.copyContent+=e[parseInt(s.toString(),10)].innerText):this.copyContent+=e[parseInt(s.toString(),10)],s<e.length-1&&(this.copyContent+=i)}},e.prototype.copy=function(e){document.queryCommandSupported("copy")&&this.clipBoardTextArea&&(this.setCopyData(e),document.execCommand("copy"),this.clipBoardTextArea.blur()),this.isSelect&&(window.getSelection().removeAllRanges(),this.isSelect=!1)},e.prototype.getModuleName=function(){return"clipboard"},e.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&((0,o.remove)(this.clipBoardTextArea),this.clipBoardTextArea=null)},e.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){var i=e.getSelectedRowCellIndexes(),n=void 0,r=[],s=void 0;for(s=0;s<i.length&&(i[parseInt(s.toString(),10)].cellIndexes.length&&r.push(i[parseInt(s.toString(),10)].rowIndex),!i[parseInt(s.toString(),10)].cellIndexes.length||(n||(n=JSON.stringify(i[parseInt(s.toString(),10)].cellIndexes.sort())),n===JSON.stringify(i[parseInt(s.toString(),10)].cellIndexes.sort())));s++);r.sort(function(e,t){return e-t}),s===i.length&&(t={status:!0,rowIndexes:r,colIndexes:i[0].cellIndexes})}return t},e}(),Zo="https://ej2.syncfusion.com/documentation/grid",$o="https://ej2.syncfusion.com/documentation/",ea="[EJ2Grid.Warning]",ta="[EJ2Grid.Error]",ia="[EJ2Grid.Info]",na=function(){function e(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}return e.prototype.getModuleName=function(){return"logger"},e.prototype.log=function(e,t){e instanceof Array||(e=[e]);for(var i=e,n=0;n<i.length;n++){var r=ra[i[parseInt(n.toString(),10)]],s=r.check(t,this.parent);s.success&&console[r.logType](r.generateMessage(t,this.parent,s.options))}},e.prototype.patchadaptor=function(){var e=this.parent.getDataModule().dataManager.adaptor,t=e.beforeSend;t&&(e.beforeSend=function(i,n,r){t.call(e,i,n,r)})},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},e}(),ra={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var i=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),n=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===i.indexOf(e)});return{success:n.filter(function(e){return"resize"!==e}).length>0,options:n}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),ea+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+Zo+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(){return{success:"undefined"==typeof Promise}},generateMessage:function(){return ta+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+$o+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:t.enableColumnVirtualization?0===t.getPrimaryKeyFieldNames().length:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return ea+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+Zo+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return ea+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+Zo+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(){return{success:!0}},generateMessage:function(e,t){var i="",n=sa(e,t),r=oa(e,t);return i=""!==r?r:""!==n?n:e.error,ea+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,t){var i=a.DataUtil.getObject("locale."+t.locale+".grid",o.L10n);return{success:"en-US"!==t.locale&&(0,o.isNullOrUndefined)(i)}},generateMessage:function(e,t){return ea+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+Zo+"/globalization-and-localization.html?#localization \n for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,t){var i;switch(e){case"freeze":i={success:!(0,o.isUndefined)(t.detailTemplate)||!(0,o.isUndefined)(t.childGrid),options:{name:"freeze"}};break;case"virtualization":i={success:!(0,o.isUndefined)(t.detailTemplate)||!(0,o.isUndefined)(t.childGrid),options:{name:"virtualization"}};break;default:i={success:!1}}return i},generateMessage:function(e,t,i){var n,r=i.name;switch(r){case"freeze":n="Frozen rows and columns do not support the following features:\n* Details Template\n* Hierarchy Grid\n";break;case"virtualization":n="Virtualization does not support the following features.\n* Details Template.\n* Hierarchy Grid.\n";break;default:n=""}return ea+": "+r.toUpperCase()+" LIMITATIONS\n"+n}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof a.DataManager||!(0,o.isNullOrUndefined)(t.dataSource)&&t.dataSource.length)}},generateMessage:function(){return ea+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+Zo+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,t){return{success:(0,o.isNullOrUndefined)(t.height)||"auto"===t.height}},generateMessage:function(){return ta+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+Zo+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(){return ta+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+Zo+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(){return ea+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+Zo+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(){return ia+": RESIZING COLUMN REACHED MIN OR MAX \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e){var t;switch(e.moduleName){case"reorder":t=(0,o.isNullOrUndefined)(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn.headerText:e.column.headerText)+" column";break;case"group":t="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":t="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":t="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return ia+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return ia+": EXPORTING INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return ia+": EXPORTING COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(){return{success:!0}},generateMessage:function(){return ta+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+Zo+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e){var t;switch(e.moduleName){case"group":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return ta+": INITIAL ACTION FAILURE \n "+i.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.currentViewData.length&&t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t){return ta+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e){return{success:(0,o.isNullOrUndefined)(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return ta+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+$o+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e){return{success:e.dataState.dataSource&&!(e.dataState.dataSource instanceof a.DataManager||"result"in e.dataState.dataSource||e.dataState.dataSource instanceof Array)&&!(0,o.isNullOrUndefined)(e.dataState.dataStateChange)}},generateMessage:function(){return ea+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},sa=function(e){var t=e.error;return t.indexOf&&0!==t.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+$o+"/common/internationalization#supported-format-string\nDate format: "+$o+"/common/internationalization#manipulating-datetime\nMessage: "+t},oa=function(e){var t=a.DataUtil.getObject("error.error",e);if((0,o.isNullOrUndefined)(t))return"";var i="";try{i=JSON.parse(t.responseText)}catch(e){i=""}return"XMLHTTPREQUEST FAILED\nUrl: "+t.responseURL+"\nStatus: "+t.status+" - "+t.statusText+"\n"+(""!==i?"Message: "+i:"")},aa=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),la=function(){return la=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},la.apply(this,arguments)},ha=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},da=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)()],t.prototype,"field",void 0),ha([(0,o.Property)()],t.prototype,"direction",void 0),ha([(0,o.Property)(!1)],t.prototype,"isFromGroup",void 0),t}(o.ChildProperty),pa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Collection)([],da)],t.prototype,"columns",void 0),ha([(0,o.Property)(!0)],t.prototype,"allowUnsort",void 0),t}(o.ChildProperty),ca=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)()],t.prototype,"field",void 0),ha([(0,o.Property)()],t.prototype,"operator",void 0),ha([(0,o.Property)()],t.prototype,"value",void 0),ha([(0,o.Property)()],t.prototype,"matchCase",void 0),ha([(0,o.Property)(!1)],t.prototype,"ignoreAccent",void 0),ha([(0,o.Property)()],t.prototype,"predicate",void 0),ha([(0,o.Property)({})],t.prototype,"actualFilterValue",void 0),ha([(0,o.Property)({})],t.prototype,"actualOperator",void 0),ha([(0,o.Property)()],t.prototype,"type",void 0),ha([(0,o.Property)()],t.prototype,"ejpredicate",void 0),ha([(0,o.Property)()],t.prototype,"uid",void 0),ha([(0,o.Property)()],t.prototype,"isForeignKey",void 0),ha([(0,o.Property)()],t.prototype,"condition",void 0),t}(o.ChildProperty),ua=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)(!1)],t.prototype,"enableCache",void 0),ha([(0,o.Property)(3)],t.prototype,"maxBlocks",void 0),ha([(0,o.Property)(3)],t.prototype,"initialBlocks",void 0),t}(o.ChildProperty),ga=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Collection)([],ca)],t.prototype,"columns",void 0),ha([(0,o.Property)("FilterBar")],t.prototype,"type",void 0),ha([(0,o.Property)("OnEnter")],t.prototype,"mode",void 0),ha([(0,o.Property)(!0)],t.prototype,"showFilterBarStatus",void 0),ha([(0,o.Property)(1500)],t.prototype,"immediateModeDelay",void 0),ha([(0,o.Property)()],t.prototype,"operators",void 0),ha([(0,o.Property)(!1)],t.prototype,"ignoreAccent",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableInfiniteScrolling",void 0),ha([(0,o.Property)(50)],t.prototype,"itemsCount",void 0),ha([(0,o.Property)("Shimmer")],t.prototype,"loadingIndicator",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableCaseSensitivity",void 0),ha([(0,o.Property)(!1)],t.prototype,"showFilterBarOperator",void 0),t}(o.ChildProperty),fa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)("Row")],t.prototype,"mode",void 0),ha([(0,o.Property)("Flow")],t.prototype,"cellSelectionMode",void 0),ha([(0,o.Property)("Single")],t.prototype,"type",void 0),ha([(0,o.Property)(!1)],t.prototype,"checkboxOnly",void 0),ha([(0,o.Property)(!1)],t.prototype,"persistSelection",void 0),ha([(0,o.Property)("Default")],t.prototype,"checkboxMode",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableSimpleMultiRowSelection",void 0),ha([(0,o.Property)(!0)],t.prototype,"enableToggle",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowColumnSelection",void 0),t}(o.ChildProperty),ma=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)([])],t.prototype,"fields",void 0),ha([(0,o.Property)("")],t.prototype,"key",void 0),ha([(0,o.Property)("contains")],t.prototype,"operator",void 0),ha([(0,o.Property)(!0)],t.prototype,"ignoreCase",void 0),ha([(0,o.Property)(!1)],t.prototype,"ignoreAccent",void 0),t}(o.ChildProperty),ya=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)()],t.prototype,"targetID",void 0),t}(o.ChildProperty),va=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)("Both")],t.prototype,"wrapMode",void 0),t}(o.ChildProperty),Sa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)("Normal")],t.prototype,"mode",void 0),t}(o.ChildProperty),Ca=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)(!0)],t.prototype,"showDropArea",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowReordering",void 0),ha([(0,o.Property)(!1)],t.prototype,"showToggleButton",void 0),ha([(0,o.Property)(!1)],t.prototype,"showGroupedColumn",void 0),ha([(0,o.Property)(!0)],t.prototype,"showUngroupButton",void 0),ha([(0,o.Property)(!1)],t.prototype,"disablePageWiseAggregates",void 0),ha([(0,o.Property)([])],t.prototype,"columns",void 0),ha([(0,o.Property)()],t.prototype,"captionTemplate",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableLazyLoading",void 0),t}(o.ChildProperty),wa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)(!1)],t.prototype,"allowAdding",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowEditing",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowDeleting",void 0),ha([(0,o.Property)("Normal")],t.prototype,"mode",void 0),ha([(0,o.Property)(!0)],t.prototype,"allowEditOnDblClick",void 0),ha([(0,o.Property)(!0)],t.prototype,"showConfirmDialog",void 0),ha([(0,o.Property)(!1)],t.prototype,"showDeleteConfirmDialog",void 0),ha([(0,o.Property)()],t.prototype,"template",void 0),ha([(0,o.Property)()],t.prototype,"headerTemplate",void 0),ha([(0,o.Property)()],t.prototype,"footerTemplate",void 0),ha([(0,o.Property)("Top")],t.prototype,"newRowPosition",void 0),ha([(0,o.Property)({})],t.prototype,"dialog",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowNextRowEdit",void 0),ha([(0,o.Property)(!1)],t.prototype,"showAddNewRow",void 0),t}(o.ChildProperty),ba=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),ha([(0,o.Property)("Spinner")],t.prototype,"indicatorType",void 0),t}(o.ChildProperty),Ia=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isPreventScrollEvent=!1,r.inViewIndexes=[],r.keyA=!1,r.frozenRightCount=0,r.freezeColumnRefresh=!0,r.rightcount=0,r.frozenLeftCount=0,r.leftcount=0,r.tablesCount=1,r.movableCount=0,r.movablecount=0,r.fixedcount=0,r.fixedCount=0,r.visibleFrozenLeft=0,r.visibleFrozenFixed=0,r.isPreparedFrozenColumns=!1,r.visibleFrozenRight=0,r.visibleMovable=0,r.frozenLeftColumns=[],r.frozenRightColumns=[],r.movableColumns=[],r.fixedColumns=[],r.stackedLeft=[],r.stackedRight=[],r.stackedFixed=[],r.stackedMovable=[],r.stackedarrayLeft=[],r.stackedarrayRight=[],r.stackedarrayFixed=[],r.stackedarrayMovable=[],r.media={},r.autoFitColumnsResize=!1,r.tableIndex=0,r.componentRefresh=o.Component.prototype.refresh,r.isChangeDataSourceCall=!1,r.mergedColumns=!1,r.isVirtualAdaptive=!1,r.requireTemplateRef=!0,r.vRows=[],r.vcRows=[],r.vGroupOffsets={},r.rowUid=0,r.translateX=0,r.isManualRefresh=!1,r.isAutoFitColumns=!1,r.enableDeepCompare=!1,r.totalDataRecordsCount=0,r.disableSelectedRecords=[],r.partialSelectedRecords=[],r.partialSelectedIndexes=[],r.pinnedTopRowModels=[],r.pinnedTopRecords=[],r.pinnedTopRowKeys={},r.pinnedRowIndexes={},r.contentRowIndexes={},r.isSpan=!1,r.islazyloadRequest=!1,r.isAddNewRow=!1,r.addNewRowFocus=!0,r.selectVirtualRowOnAdd=!1,r.lockcolPositionCount=0,r.prevPageMoving=!1,r.pageTemplateChange=!1,r.isAutoGen=!1,r.isAutoGenerateColumns=!1,r.pageRequireRefresh=!0,r.mediaBindInstance={},r.commandDelIndex=void 0,r.preventAutoFit=!1,r.enableSeamlessScrolling=!1,r.asyncTimeOut=50,r.isExportGrid=!1,r.isWidgetsDestroyed=!1,r.enableLogger=!1,r.needsID=!0,n.Inject(Vo),(0,o.setValue)("mergePersistData",r.mergePersistGridData,r),r}var n;return aa(t,e),n=t,t.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","selectedRowIndex","scrollPosition"],t={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},i=0;i<e.length;i++)for(var n=this[e[parseInt(i.toString(),10)]],r=0,s=t[e[parseInt(i.toString(),10)]];r<s.length;r++){delete n[""+s[r]]}var a=this.pageSettings.template,l=Object.assign({template:void 0},this.pageSettings);this.enableVirtualization&&this.enablePersistence&&this.contentModule&&this.contentModule.getPageFromTop&&!(0,o.isNullOrUndefined)(this.scrollPosition)&&!(0,o.isNullOrUndefined)(this.scrollPosition.top)&&(l.properties.currentPage=this.contentModule.getPageFromTop(this.scrollPosition.top,{block:1})),this.setProperties({pageSettings:l},!0);var h=this.groupSettings.captionTemplate,d=h&&this.isAngular;d&&delete this.groupSettings.properties.captionTemplate,this.pageTemplateChange=!(0,o.isNullOrUndefined)(this.pagerTemplate);var p=this.addOnPersist(e);return l.template=a,this.setProperties({pageSettings:l},!0),d&&(this.groupSettings.captionTemplate=h),p},t.prototype.requiredModules=function(){this.setFrozenCount(),this.enableInfiniteAggrgate();var e=[];return this.isDestroyed||(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator],name:"Filter"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator],name:"ExcelExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator],name:"Sort"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator],name:"Selection"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator],name:"Group"}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator],name:"Aggregate"}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator],name:"DetailRow"}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator],name:"Toolbar"}),(this.enableVirtualization||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator],name:"VirtualScroll"}),(this.getFrozenColumns()||this.frozenRows||this.frozenRightCount||this.frozenLeftCount)&&e.push({member:"freeze",args:[this,this.serviceLocator],name:"Freeze"}),!(0,o.isNullOrUndefined)(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator],name:"CommandColumn"}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator],name:"Edit"}),this.extendRequiredModules(e)),e},t.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator],name:"InfiniteScroll"}),this.groupSettings.enableLazyLoading&&e.push({member:"lazyLoadGroup",args:[this,this.serviceLocator],name:"LazyLoadGroup"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator],name:"ContextMenu"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator],name:"ColumnChooser"}),!(0,o.isNullOrUndefined)(this.columns)&&this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator],name:"ForeignKey"}),this.enableLogger&&e.push({member:"logger",args:[this],name:"Logger"})},t.prototype.resizeCheck=function(){var e=!!this.getColumns().filter(function(e){return!0===e.autoFit}).length;(0,o.isNullOrUndefined)(this.columnModel)||!this.columnModel.length||this.columnModel[0]instanceof p||(this.columnModel=[]);var t=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),i=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||this.autoFitColumnsResize||e||t||i},t.prototype.preRender=function(){this.serviceLocator=new Eo,this.initProperties(),this.initializeServices()},t.prototype.initProperties=function(){this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.allowServerDataBinding=!1,this.ignoreCollectionWatch=!0,this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.componentRefresh=o.Component.prototype.refresh,this.freezeColumnRefresh=!0,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.defaultChartLocale={Chart:"Chart",BarChart:"Bar Chart",Bar:"Bar",StackingBar:"Stacked Bar",StackingBar100:"100% Stacked Bar",Pie:"Pie Chart",ColumnChart:"Column Chart",Column:"Column",StackingColumn:"Stacked Column",StackingColumn100:"100% Stacked Column",LineChart:"Line Chart",Line:"Line",StackingLine:"Stacked Line",StackingLine100:"100% Stacked Line",AreaChart:"Area Chart",Area:"Area",StackingArea:"Stacked Area",StackingArea100:"100% Stacked Area",Scatter:"Scatter Chart"},this.defaultLocale=la({EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",UnGroupButton:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",ColumnMenu:"Column Menu",SearchColumns:"search columns",Matchs:"No matches found",FilterButton:"Filter",FilterTitle:"Filter",FilterIcon:"Filter",ClearButton:"Clear",StartsWith:"Starts With",NotStartsWith:"Does Not Start With",Like:"Like",EndsWith:"Ends With",NotEndsWith:"Does Not End With",Contains:"Contains",NotContains:"Does Not Contain",IsNull:"Null",NotNull:"Not Null",IsEmpty:"Empty",IsNotEmpty:"Not Empty",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",In:"In",NotIn:"Not In",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",GroupButton:"Group button",UnGroupAria:"ungroup button",GroupSeperator:"Separator for the grouped columns",UnGroupIcon:"ungroup the grouped column ",GroupedSortIcon:"sort the grouped column ",GroupedDrag:"Drag the grouped column",GroupCaption:" is groupcaption cell",CheckBoxLabel:"checkbox",SelectAllCheckbox:"Select all checkbox",SelectRow:"Select row",autoFitAll:"Autofit all columns",autoFit:"Autofit this column",AutoFitAll:"Autofit all columns",AutoFit:"Autofit this column",Export:"Export",FirstPage:"First Page",LastPage:"Last Page",PreviousPage:"Previous Page",NextPage:"Next Page",SortAscending:"Sort Ascending",SortDescending:"Sort Descending",EditRecord:"Edit Record",DeleteRecord:"Delete Record",FilterMenu:"Filter",SelectAll:"Select All",AddCurrentSelection:"Add current selection to filter",Blanks:"Blanks",FilterTrue:"True",FilterFalse:"False",NoResult:"No matches found",ClearFilter:"Clear Filter",Clear:"Clear",NumberFilter:"Number Filters",TextFilter:"Text Filters",DateFilter:"Date Filters",DateTimeFilter:"DateTime Filters",MatchCase:"Match Case",Between:"Between",CustomFilter:"Custom Filter",CustomFilterPlaceHolder:"Enter the value",CustomFilterDatePlaceHolder:"Choose a date",AND:"AND",OR:"OR",ShowRowsWhere:"Show rows where:",ToolbarMenuDialogARIA:"Toolbar menu dialog",FilterMenuDialogARIA:"Filter menu",ExcelFilterDialogARIA:"Excel filter",CheckBoxFilterDialogARIA:"Checkbox filter",DialogEditARIA:"Edit dialog",ColumnMenuDialogARIA:"Column menu dialog",CustomFilterDialogARIA:"Customer filter dialog",SortAtoZ:"Sort A to Z",SortZtoA:"Sort Z to A",SortByOldest:"Sort by Oldest",SortByNewest:"Sort by Newest",SortSmallestToLargest:"Sort Smallest to Largest",SortLargestToSmallest:"Sort Largest to Smallest",Sort:"Sort",SortIcon:"Sort",FilterDescription:"Press Alt Down to open filter Menu",SortDescription:"Press Enter to sort",ColumnMenuDescription:"Press Alt Down to open Column Menu",GroupDescription:"Press Ctrl space to group",ColumnHeader:" column header ",TemplateCell:" is template cell",CommandColumnAria:"is Command column column header ",DialogEdit:"Dialog edit",ClipBoard:"clipboard",AscendingText:"Ascending",DescendingText:"Descending",NoneText:"None",Expanded:"Expanded",Collapsed:"Collapsed",PinRow:"Pin Row",UnpinRow:"Unpin Row"},this.defaultChartLocale),this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftRight:"shift+rightarrow",shiftLeft:"shift+leftarrow",home:"home",end:"end",escape:"escape",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",pageUp:"pageup",pageDown:"pagedown",ctrlAltPageUp:"ctrl+alt+pageup",ctrlAltPageDown:"ctrl+alt+pagedown",altPageUp:"alt+pageup",altPageDown:"alt+pagedown",altDownArrow:"alt+downarrow",altUpArrow:"alt+uparrow",ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlPlusA:"ctrl+A",ctrlPlusP:"ctrl+P",insert:"insert",delete:"delete",f2:"f2",enter:"enter",ctrlEnter:"ctrl+enter",shiftEnter:"shift+enter",tab:"tab",shiftTab:"shift+tab",space:"space",ctrlPlusC:"ctrl+C",ctrlShiftPlusH:"ctrl+shift+H",ctrlSpace:"ctrl+space",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow"}},t.prototype.render=function(){if(this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),(0,y.createSpinner)({target:this.element,cssClass:this.cssClass?this.cssClass:null},this.createElement),this.renderModule=new Ro(this,this.serviceLocator),this.searchModule=new Go(this),this.scrollModule=new Ko(this),this.notify(Me,{}),this.pageSettings.enableQueryString){var e=new URL(window.location.href).searchParams.get("page");if(!(0,o.isNullOrUndefined)(e)&&window.location.href.indexOf("?page=")>0){var t=parseInt(e,10);this.setProperties({pageSettings:{currentPage:t}},!0),this.pageSettings.currentPage=t}}if(!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||!(0,o.isNullOrUndefined)(this.dataSource)&&this.dataSource.result||(this.isVirtualAdaptive=!0),this.aggregateModule&&this.aggregates.length)for(var i=0;i<this.aggregates.length;i++)for(var n=0;n<this.aggregates[parseInt(i.toString(),10)].columns.length;n++){var r=this.aggregates[parseInt(i.toString(),10)].columns[parseInt(n.toString(),10)];r.types&&(r.type=r.types)}if(this.isReact){var s={requireTemplateRef:this.requireTemplateRef};this.enableVirtualization||this.enableColumnVirtualization?(s.enableSeamlessScrolling=this.enableSeamlessScrolling,this.trigger(C,s),this.enableSeamlessScrolling=s.enableSeamlessScrolling,Wh(this.enableSeamlessScrolling)):this.trigger(C,s),s.requireTemplateRef||(this.requireTemplateRef=s.requireTemplateRef)}else if(this.enableVirtualization||this.enableColumnVirtualization){s={enableSeamlessScrolling:this.enableSeamlessScrolling};this.trigger(C,s),this.enableSeamlessScrolling=s.enableSeamlessScrolling,Wh(this.enableSeamlessScrolling)}else this.trigger(C);"string"==typeof this.isRowSelectable&&(this.isRowSelectable=(0,o.getValue)(this.isRowSelectable,window)),"string"==typeof this.isRowPinned&&(this.isRowPinned=(0,o.getValue)(this.isRowPinned,window)),this.isRowPinned&&this.allowSelection&&(this.selectionSettings.persistSelection=!0,this.selectionSettings.type="Multiple"),ja(this.columns,this.enableColumnVirtualization,this),this.enableColumnVirtualization&&this.isChangeDataSourceCall&&this.columnModel&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.isPreparedFrozenColumns=!0,this.enablePersistence&&this.notify(Ji,{}),this.getMediaColumns(),Ha(this.columns),this.isFrozenGrid()&&!this.mergedColumns&&this.setInitialFrozenColumnIndex(this.columns),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),"Spinner"===this.loadingIndicator.indicatorType&&this.showSpinner(),this.notify(Le,{}),"Shimmer"===this.loadingIndicator.indicatorType&&this.refreshMaskRow(),this.refreshing&&this.trigger("created")},t.prototype.setInitialFrozenColumnIndex=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i[""+Hs]=i.index,i.columns&&this.setInitialFrozenColumnIndex(i.columns)}},t.prototype.showSpinner=function(){this.isExportGrid||(0,y.showSpinner)(this.element)},t.prototype.hideSpinner=function(){this.isExportGrid||(0,y.hideSpinner)(this.element)},t.prototype.showMaskRow=function(e,t){if(!(0,o.isNullOrUndefined)(this.headerModule)&&!(0,o.isNullOrUndefined)(this.contentModule)){var i=this.getHeaderContent().firstChild,n=this.getContent().firstChild,r=this.getFooterContent();if(t){var s=t.querySelector(".e-checkboxlist");if(!(0,o.isNullOrUndefined)(s)){var a=Math.floor(s.getBoundingClientRect().height/this.getRowHeight()),l='<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>";s.innerHTML="";for(var h=0;h<a;h++){s.innerHTML+=l,s.querySelector(".e-ftrchk.e-mask-ftrchk").style.width="100%",s.querySelector(".e-checkbox-wrapper").style.width="100%";var d=[].slice.call(s.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)"));d[0].classList.add("e-mask-checkbox-filter-intent"),d[1].classList.add("e-mask-checkbox-filter-span-intent")}}}else{if((!this.enableRtl&&!this.getHeaderContent().style.paddingRight||this.enableRtl&&!this.getHeaderContent().style.paddingLeft)&&(n.style.overflowY="hidden"),!this.isInitialLoad&&!this.getColumns().length){var p=n.getBoundingClientRect().height,c=0===p?this.allowPaging?this.pageSettings.pageSize*this.getRowHeight():window.innerHeight:p,u=Math.ceil(c/this.getRowHeight());return"Vertical"!==this.rowRenderingMode&&(this.headerMaskTable=this.createEmptyMaskTable(i,1)),void(this.contentMaskTable=this.createEmptyMaskTable(n,u))}if(this.maskRowContentScroll=!(!this.enableVirtualization&&!this.enableColumnVirtualization||!e),!this.contentMaskTable){var g=n;(this.enableVirtualization||this.enableColumnVirtualization)&&(g=g.querySelector(".e-virtualtable")),(0,o.isNullOrUndefined)(g.querySelector("tbody"))||(this.contentMaskTable=this.createMaskTable(g,this.getContentMaskColumns(),e))}if(!this.headerMaskTable&&(this.isFrozenGrid()&&!this.isRowPinned&&!this.pinnedTopRowModels.length||this.enableColumnVirtualization&&"X"===e)){g=i;this.enableColumnVirtualization&&"X"===e&&(g=g.querySelector(".e-virtualtable")),this.headerMaskTable=this.createMaskTable(g,this.getContentMaskColumns(),e)}if(r&&r.querySelector(".e-summaryrow")){var f=r.firstChild;if(!this.footerContentMaskTable){var m=f;this.footerContentMaskTable=this.createMaskTable(m)}}this.enableVirtualization&&e||o.EventHandler.add(n,"scroll",this.translateMaskRow,this)}}},t.prototype.getContentMaskColumns=function(){return this.getColumns()},t.prototype.createEmptyMaskTable=function(e,t){var i=this.createElement("table",{className:"e-table e-masked-table"}),n=this.createElement("tbody",{className:"e-masked-tbody"}),r=this.createElement("tr",{className:"e-masked-row e-row"});r.style.height=this.getRowHeight()+"px";var s=this.createElement("td",{className:"e-masked-cell e-rowcell"});s.innerHTML=this.getShimmerTemplate(),r.appendChild(s);for(var o=0;o<t;o++)n.appendChild(r.cloneNode(!0));return i.appendChild(n),e.appendChild(i),i},t.prototype.createFrozenMaskRow=function(e,t){for(var i=0;i<e.length;i++)i<this.frozenLeftCount?(this.frozenLeftCount-1===i&&e[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),e[parseInt(i.toString(),10)].classList.add("e-leftfreeze"),e[parseInt(i.toString(),10)].setAttribute("aria-colindex",(i+1).toString()),e[parseInt(i.toString(),10)].style.left=t[parseInt(i.toString(),10)].valueX-this.translateX+"px"):e.length-this.frozenRightCount<=i&&t[parseInt(i.toString(),10)]&&(e.length-this.frozenRightCount===i&&e[parseInt(i.toString(),10)].classList.add("e-freezerightborder"),e[parseInt(i.toString(),10)].classList.add("e-rightfreeze"),e[parseInt(i.toString(),10)].setAttribute("aria-colindex",(i+1).toString()),e[parseInt(i.toString(),10)].style.right=this.translateX+t[parseInt(i.toString(),10)].valueX+"px")},t.prototype.createMaskTable=function(e,t,i){var n=e,r=!!(0,o.closest)(n,".e-gridheader"),s=!!(0,o.closest)(n,".e-gridcontent"),a=!!(0,o.closest)(n,".e-gridfooter"),l=this.getContent().firstChild,h=l.scrollHeight,d=n.querySelector("table"),p=d.cloneNode();p.removeAttribute("role"),p.removeAttribute("id"),(0,o.updateCSSText)(p,"position: absolute; z-index: 5; width: "+d.getBoundingClientRect().width+"px;"),!r||this.enableColumnVirtualization&&"X"===i||(p.style.transform="translate(0px,"+d.querySelector("thead").getBoundingClientRect().height+"px)"),p.setAttribute("class","e-table e-masked-table");var c=d.querySelector("colgroup").cloneNode(!0);if(c.removeAttribute("id"),c.setAttribute("class","e-masked-colgroup"),p.appendChild(c),r&&this.enableColumnVirtualization&&"X"===i){var u=this.createMaskRow(c,t);if(this.isFrozenGrid()){var g=[].slice.call(u.querySelectorAll(".e-rowcell"));this.createFrozenMaskRow(g,t)}var f=d.querySelector("thead"),m=[].slice.call(f.querySelectorAll("tr")),y=f.cloneNode();y.removeAttribute("role"),y.setAttribute("class","e-masked-thead");for(var v=m.length,S=0;S<v;S++)y.appendChild(u.cloneNode(!0)),y.childNodes[parseInt(S.toString(),10)].style.height=m[parseInt(S.toString(),10)].getBoundingClientRect().height+"px";p.appendChild(y)}var C=d.querySelector("tbody").cloneNode();C.removeAttribute("role"),C.setAttribute("class","e-masked-tbody");var w=d.querySelector("tbody");if(s||r){var b=l;v=Math.ceil(b.getBoundingClientRect().height/this.getRowHeight());if(this.allowPaging&&this.pageSettings.pageSize!==this.currentViewData.length&&this.pagerModule.pagerObj.totalPages!==this.pageSettings.currentPage){(I=(u=this.createMaskRow(c,t)).cloneNode(!0)).classList.add("e-altrow");for(S=0;S<this.pageSettings.pageSize-this.currentViewData.length;S++)C.appendChild(S%2==1?I.cloneNode(!0):u.cloneNode(!0))}if(w.querySelector(".e-emptyrow")||!w.childNodes.length||s&&this.childGrid){var I;(I=(u=this.createMaskRow(c,t)).cloneNode(!0)).classList.add("e-altrow");for(S=0;S<v;S++){C.appendChild((S+1)%2==0?I.cloneNode(!0):u.cloneNode(!0))}}else{var x='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"])';this.isTreeGrid&&(x='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"]):not(.e-childrow-hidden)');m=[].slice.call(w.querySelectorAll(x));var R=w.querySelector(".e-addedrow, .e-editedrow"),D=void 0;if(R){if(D=m.indexOf(R),this.isFrozenGrid()&&this.enableColumnVirtualization){var T=[].slice.call(m[D+1].querySelectorAll(".e-rowcell"));for(S=0;S<T.length;S++)S<this.frozenLeftCount?(T[parseInt(S.toString(),10)].classList.add("e-leftfreeze"),T[parseInt(S.toString(),10)].setAttribute("aria-colindex",(S+1).toString()),T[parseInt(S.toString(),10)].style.left=t[parseInt(S.toString(),10)].valueX-this.translateX+"px"):T.length-this.frozenRightCount<=S&&t[parseInt(S.toString(),10)]&&(T[parseInt(S.toString(),10)].classList.add("e-rightfreeze"),T[parseInt(S.toString(),10)].setAttribute("aria-colindex",(S+1).toString()),T[parseInt(S.toString(),10)].style.right=this.translateX+t[parseInt(S.toString(),10)].valueX+"px")}R.classList.contains("e-addedrow")?m.splice(D,2):m.splice(D,1)}v=(this.enableVirtualization||this.enableColumnVirtualization)&&i?m.length:v<=m.length?v:m.length;for(S=0;S<v;S++){var E=this.applyMaskRow(m[parseInt(S.toString(),10)].cloneNode(!0),m[parseInt(S.toString(),10)].getBoundingClientRect().height);if(this.enableColumnVirtualization&&"X"===i&&this.isFrozenGrid()){g=[].slice.call(E.querySelectorAll(".e-masked-cell"));this.createFrozenMaskRow(g,t)}C.appendChild(E)}if(this.addMaskRows(C,v/2,m[0],s,i),R&&R.classList.contains("e-editedrow")&&D<v){var O=C.childNodes[parseInt(D.toString(),10)];O.style.height=this.getRowHeight()+"px",O.classList.add("e-row"),R.classList.contains("e-altrow")&&O.classList.add("e-altrow")}}}if(p.appendChild(C),a){var k=d.querySelector("tfoot"),A=k.cloneNode();A.setAttribute("class","e-masked-tfoot");for(m=[].slice.call(k.querySelectorAll("tr")),S=0;S<m.length;S++)A.appendChild(this.applyMaskRow(m[parseInt(S.toString(),10)].cloneNode(!0),m[parseInt(S.toString(),10)].getBoundingClientRect().height));p.appendChild(A)}if(r&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+os).style.position="relative"),n.insertBefore(p,n.firstChild),s&&(!this.enableVirtualization||!i)){var F=h-p.getBoundingClientRect().height;F=F<0?0:F;var M=l.scrollTop<=F?l.scrollTop:F;this.enableVirtualization&&(M-=jl((0,o.closest)(n,".e-virtualtable")).height),p.style.transform="translate(0px,"+M+"px)"}return p},t.prototype.addMaskRows=function(e,t,i,n,r){if(this.isTreeGrid&&this.enableVirtualization&&n&&"Y"===r)for(var s=0;s<t;s++){var o=i.cloneNode(!0),a=i.getBoundingClientRect().height,l=this.applyMaskRow(o,a);e.appendChild(l)}},t.prototype.applyMaskRow=function(e,t){var i=e;i.removeAttribute("role"),i.removeAttribute("aria-rowindex"),i.removeAttribute("data-uid"),i.classList.add("e-masked-row"),i.style.height=t+"px";for(var n=[].slice.call(i.childNodes),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)],a=s.firstChild&&s.firstChild.classList&&s.firstChild.classList.contains("e-checkbox-wrapper");s.removeAttribute("role"),s.removeAttribute("tabindex"),s.removeAttribute("aria-label"),this.enableColumnVirtualization&&s.classList.contains("e-fixedfreeze")&&((0,o.removeClass)([s],["e-fixedfreeze","e-freezeleftborder","e-freezerightborder"]),(0,o.addClass)([s],["e-unfreeze"])),s.removeAttribute("aria-colindex"),s.removeAttribute("data-index"),s.removeAttribute("data-mappingname"),s.removeAttribute("data-mappingvalue"),s.removeAttribute("data-mappinguid"),s.removeAttribute("aria-expanded"),s.classList.add("e-masked-cell"),s.innerHTML=this.getShimmerTemplate(),s.classList.contains("e-recordplusexpand")||s.classList.contains("e-recordpluscollapse")?s.firstChild.classList.add("e-mask-group-intent"):s.classList.contains("e-gridchkbox")||a?s.firstChild.classList.add("e-mask-checkbox-intent"):s.classList.contains("e-rowdragdrop")?s.firstChild.classList.add("e-mask-drag-intent"):s.classList.contains("e-indentcell")&&(s.innerHTML="")}return i},t.prototype.createMaskRow=function(e,t){var i=e,n=t,r=this.createElement("tr",{className:"e-masked-row e-row"});"Vertical"!==this.rowRenderingMode&&(r.style.height=this.getRowHeight()+"px");for(var s=this.createElement("td",{className:"e-masked-cell e-rowcell"}),o=0,a=0;o<i.childNodes.length;o++){var l=i.childNodes[parseInt(o.toString(),10)],h=s.cloneNode();h.innerHTML=this.getShimmerTemplate(),l.classList.contains("e-group-intent")||l.classList.contains("e-detail-intent")||l.classList.contains("e-drag-intent")?l.classList.contains("e-group-intent")?h.firstChild.classList.add("e-mask-group-intent"):l.classList.contains("e-detail-intent")?h.firstChild.classList.add("e-mask-detail-intent"):l.classList.contains("e-drag-intent")&&h.firstChild.classList.add("e-mask-drag-intent"):("Vertical"===this.rowRenderingMode&&n[parseInt(a.toString(),10)]&&h.setAttribute("data-cell",n[parseInt(a.toString(),10)].headerText?n[parseInt(a.toString(),10)].headerText:n[parseInt(a.toString(),10)].field),"none"===l.style.display?h.classList.add("e-hide"):(h.style.textAlign=n[parseInt(a.toString(),10)]&&n[parseInt(a.toString(),10)].textAlign?n[parseInt(a.toString(),10)].textAlign.toLowerCase():this.enableRtl?"right":"left",n[parseInt(a.toString(),10)]&&("checkbox"===n[parseInt(a.toString(),10)].type||n[parseInt(a.toString(),10)].displayAsCheckBox)&&h.firstChild.classList.add("e-mask-checkbox-intent")),a++),r.appendChild(h)}return r},t.prototype.getShimmerTemplate=function(){return this.maskRowContentScroll?'<span class="e-mask e-skeleton e-skeleton-text"></span>':'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},t.prototype.addShimmerEffect=function(){this.maskRowContentScroll=!1;for(var e=[].slice.call(this.element.querySelectorAll(".e-mask:not(.e-shimmer-wave)")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].classList.add("e-shimmer-wave")},t.prototype.translateMaskRow=function(e){for(var t=e.target,i=t.querySelectorAll(".e-masked-table"),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)];if(r){var s=t.scrollHeight-r.getBoundingClientRect().height;s=s<0?0:s;var a=t.scrollTop<=s?t.scrollTop:s;this.enableVirtualization&&(a-=jl((0,o.closest)(r,".e-virtualtable")).height),r.style.transform="translate(0px,"+a+"px)"}}},t.prototype.removeMaskRow=function(){if(!(0,o.isNullOrUndefined)(this.contentModule)){var e=this.getContent().firstChild;o.EventHandler.remove(e,"scroll",this.translateMaskRow)}this.headerMaskTable&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+os).style.position="");for(var t=[this.headerMaskTable,this.contentMaskTable,this.footerContentMaskTable],i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n&&(0,o.remove)(n)}this.headerMaskTable=null,this.contentMaskTable=null,this.footerContentMaskTable=null},t.prototype.refreshMaskRow=function(){var e=this.getContent().firstChild;if((this.isInitialLoad||this.getColumns().length)&&this.contentMaskTable&&e.querySelector(".e-masked-table")){var t=e;this.enableVirtualization&&(t=t.querySelector(".e-virtualtable")),this.refreshMaskRowColgroupWidth(t)}},t.prototype.refreshMaskRowColgroupWidth=function(e){var t=e.querySelector("table:not(.e-masked-table)"),i=t.querySelector(Ts).cloneNode(!0),n=e.querySelector(".e-masked-table");i.removeAttribute("id"),i.setAttribute("class","e-masked-colgroup");for(var r=0;r<i.childNodes.length;r++)i.childNodes[parseInt(r.toString(),10)].removeAttribute("class");(0,o.remove)(n.querySelector(".e-masked-colgroup")),n.insertBefore(i,n.firstChild),n.style.width=t.getBoundingClientRect().width+"px"},t.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().getElementsByClassName("e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},t.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!(0,o.isNullOrUndefined)(e))for(var t=0;t<e.length;t++)(0,o.isNullOrUndefined)(e[parseInt(t.toString(),10)].hideAtMedia)||!(0,o.isNullOrUndefined)(e[parseInt(t.toString(),10)].visible)&&!e[parseInt(t.toString(),10)].visible||this.pushMediaColumn(e[parseInt(t.toString(),10)],t)}this.updateFrozenColumnsWidth()},t.prototype.pushMediaColumn=function(e,t){this.mediaCol.push(e),this.media[e.uid]=window.matchMedia(e.hideAtMedia),this.mediaQueryUpdate(t,this.media[e.uid]),this.mediaBindInstance[parseInt(t.toString(),10)]=this.mediaQueryUpdate.bind(this,t),this.media[e.uid].addListener(this.mediaBindInstance[parseInt(t.toString(),10)])},t.prototype.updateMediaColumns=function(e){if(!this.enableColumnVirtualization){for(var t=this.getColumnIndexByUid(e.uid),i=0;i<this.mediaCol.length;i++)if(e.uid===this.mediaCol[parseInt(i.toString(),10)].uid)return void this.mediaCol.splice(i,1);this.pushMediaColumn(e,t)}},t.prototype.mediaQueryUpdate=function(e,t){var i=this.getColumns()[parseInt(e.toString(),10)];this.mediaCol.some(function(e){return e.uid===i.uid})&&(i.visible=t.matches,this.isInitialLoad&&(this.invokedFromMedia=!0,i.visible?this.showHider.show(i.headerText,"headerText"):this.showHider.hide(i.headerText,"headerText")))},t.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector("."+ss);this.aggregates.length&&this.element.scrollHeight>parseInt(this.height.toString(),10)&&e&&(0,o.addClass)([e],["e-footerpadding"]);var t=(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return"checkbox"===e.type});(0===t.length||t.length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode)&&(this.isCheckBoxSelection=!1),"Vertical"===this.rowRenderingMode&&this.enableHover&&(this.setProperties({enableAdaptiveUI:!0,enableHover:!1},!0),(0,o.removeClass)([this.element],"e-gridhover")),this.enableAdaptiveUI&&this.scrollModule&&this.scrollModule.refresh(),this.isFrozenGrid()&&this.isAutoGenerateColumns&&(this.widthService.setWidthToColumns(),this.isAutoGenerateColumns=!1)},t.prototype.removeMediaListener=function(){for(var e=0;e<this.mediaCol.length;e++)this.media[this.mediaCol[parseInt(e.toString(),10)].uid].removeListener(this.mediaBindInstance[this.mediaCol[parseInt(e.toString(),10)].index])},t.prototype.eventInitializer=function(){},t.prototype.destroy=function(){var t=this.element;if(t){var i=!(!t.querySelector("."+ns)||!t.querySelector("."+rs));i&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(Ct,{}),this.destroyDependentModules(),this.isReact&&this.destroyTemplate(["template"]),this.isVue&&this.destroyTemplate(),i&&e.prototype.destroy.call(this),this.toolTipObj.destroy(),this.isReact&&!o.Browser.isIE&&(this.element.innerHTML="");for(var n=["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","showHider","scrollModule","printModule","clipboardModule","focusModule","editModule"],r=0;r<n.length;r++)this[n[parseInt(r.toString(),10)]]&&(this[n[parseInt(r.toString(),10)]]=null);this.element.innerHTML="",(0,o.classList)(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"])}},t.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy(),this.clipboardModule.destroy(),this.printModule.destroy())},t.prototype.getModuleName=function(){return"grid"},t.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):(this.element.classList.remove("e-afenabled"),this.notify(ft,{}))},t.prototype.setCSSClass=function(e){this.cssClass&&(0,o.addClass)([this.element],this.cssClass.split(" ")),e&&(0,o.removeClass)([this.element],e.split(" "))},t.prototype.onPropertyChanged=function(e,t){var i,n=!1,r=!1,s=!1,a=null,l=null;if(!this.isDestroyed){this.log("module_missing"),this.isEllipsisTooltip()&&this.toolTipObj.close();var h=Object.keys(e);h.indexOf("columns")>-1&&(this.enableColumnVirtualization&&(this.columnModel=[]),this.updateColumnObject(),r=!0);for(var d=0,p=h;d<p.length;d++){var c=p[d];switch(c){case"allowPaging":this.notify(Be,{module:"pager",enable:this.allowPaging}),n=!0,"100%"===this.height&&this.scrollModule.refresh(),this.getDataModule().clearCache();break;case"pageSettings":if(this.pageTemplateChange){this.pageTemplateChange=!1,this.notify(qe,{module:"pager",properties:e.pageSettings});break}if(this.pagerModule&&this.pagerModule.isCancel)return void(this.pagerModule.isCancel=!1);this.notify(qe,{module:"pager",properties:e.pageSettings}),((0,o.isNullOrUndefined)(e.pageSettings.currentPage)&&(0,o.isNullOrUndefined)(e.pageSettings.pageSize)&&(0,o.isNullOrUndefined)(e.pageSettings.totalRecordsCount)||!(0,o.isNullOrUndefined)(t.pageSettings)&&e.pageSettings.currentPage!==t.pageSettings.currentPage&&!this.enableColumnVirtualization&&!this.enableVirtualization&&this.pageRequireRefresh&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(n=!0),this.pageRequireRefresh||(this.pageRequireRefresh=!0),this.pagerModule&&this.pagerModule.isCancel&&(this.pagerModule.isCancel=!1);break;case"allowSorting":this.notify(Be,{module:"sort",enable:this.allowSorting}),n=!0,i=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(Be,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type||this.editSettings.showAddNewRow&&"FilterBar"===this.filterSettings.type?this.refreshHeader():"100%"===this.height&&this.scrollModule.refresh();break;case"height":case"width":this.notify(Be,{module:"scroll",properties:{width:e.width,height:e.height}}),this.allowPaging&&this.pagerModule.refresh();break;case"allowReordering":this.headerModule.refreshUI(),i=!0;break;case"allowRowDragAndDrop":this.notify(Be,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(Be,{module:"selection",enable:this.allowSelection}),this.renderModule.refresh();break;case"cssClass":this.setCSSClass(t.cssClass);break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=za(this.rowTemplate),n=!0;break;case"emptyRecordTemplate":this.emptyRecordTemplateFn=za(this.emptyRecordTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=za(this.detailTemplate),n=!0;break;case"allowGrouping":this.notify(Be,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),n=!0,i=!0,"100%"===this.height&&this.scrollModule.refresh();break;case"enableInfiniteScrolling":case"childGrid":if(n=!0,l=(a=this.parentDetails?document.querySelector("#"+this.parentDetails.parentID):null)?a.ej2_instances[0]:null,this.childGrid&&l&&(0,o.isNullOrUndefined)(l.childGrid.childGrid)){var u=Object.assign({},l.childGrid,{childGrid:e.childGrid});for(l.setProperties({childGrid:u},!0);!(0,o.isNullOrUndefined)(l.parentDetails);){var g=document.querySelector("#"+l.parentDetails.parentID),f=g?g.ej2_instances[0]:null;if(f){var m=Object.assign({},f.childGrid);m.childGrid=l.childGrid,f.setProperties({childGrid:m},!0)}l=f}}this.headerModule.refreshUI();break;case"toolbar":this.notify(Be,{module:"toolbar"}),"100%"===this.height&&this.scrollModule.refresh();break;case"groupSettings":this.notify(qe,{module:"group",properties:e.groupSettings,oldProperties:t.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(Be,{module:"aggregate",properties:e}),"100%"===this.height&&this.scrollModule.refresh();break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"enableColumnVirtualization":case"currencyCode":case"locale":"frozenColumns"===c&&null===e.frozenColumns&&this.resetFrozenColumns(),this.isFrozenGrid()&&this.log("frozen_rows_columns"),s=!0,r=!0,this.addNewRowFocus=!0;break;case"query":this.getDataModule().isQueryInvokedFromData||(n=!0),this.getDataModule().isQueryInvokedFromData=!1;break;case"autoFit":this.autoFit?this.preventAdjustColumns():this.restoreAdjustColumns();break;default:this.extendedPropertyChange(c,e,r)}}i&&this.updateDefaultCursor(),r?s||this.getFrozenColumns()||this.frozenRows||this.frozenLeftColumns.length||this.frozenRightColumns.length?this.freezeRefresh():this.refresh():n&&(this.notify(Ue,{requestType:"refresh"}),n=!1,this.maintainSelection(e.selectedRowIndex))}},t.prototype.extendedPropertyChange=function(e,t,i){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=t.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!t.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=t.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=t.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&!this.enableAdaptiveUI&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=t.enableRtl,this.columnMenuModule.getColumnMenu().ej2_instances[0].dataBind()),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&this.refreshHeader(),this.notify(Oi,{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.resizeModule&&this.resizeModule.render(),this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":this.rowHeight?(0,o.addClass)([this.element],"e-grid-min-height"):(0,o.removeClass)([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(Be,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(Be,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(Be,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.toolbarModule&&this.toolbarModule.refreshToolbarItems(),this.notify(Be,{module:"columnChooser",enable:this.showColumnChooser});break;case"columnChooserSettings":this.notify(qe,{module:"columnChooser"});break;case"filterSettings":this.updateStackedFilter(),this.notify(qe,{module:"filter",properties:t.filterSettings});break;case"searchSettings":this.notify(qe,{module:"search",properties:t.searchSettings});break;case"sortSettings":this.notify(qe,{module:"sort"});break;case"selectionSettings":this.notify(qe,{module:"selection",properties:t.selectionSettings});break;case"editSettings":this.notify(qe,{module:"edit",properties:t.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(pi,{case:"textwrap",isModeChg:"textWrapSettings"===e}),this.refreshHeader(),"100%"===this.height&&this.scrollModule.refresh();break;case"dataSource":var n=this.getDataModule().getState();if(this.allowPaging&&this.pageSettings.pageSizes&&!this.getDataModule().isRemote()&&(!n||!n.isPending)&&this.pagerModule.pagerObj.isAllPage){var r=this.dataSource instanceof a.DataManager?this.dataSource.dataSource.json.length:"result"in this.dataSource?this.dataSource.count:this.dataSource.length;!!(Array.isArray(this.pageSettings.pageSizes)&&this.pageSettings.pageSizes.indexOf("All")>-1)||this.pageSettings.pageSizes||this.pageSettings.pageSize===r?(this.setProperties({pageSettings:{pageSize:r}},!0),this.pagerModule.pagerObj.setProperties({pageSize:r},!0)):this.pagerModule.pagerObj.isAllPage=!1}if(!this.allowSelection||!this.isPersistSelection||n&&n.isPending||this.clearSelection(),this.partialSelectedRecords=[],this.partialSelectedIndexes=[],this.disableSelectedRecords=[],this.renderModule.selectableDataKey={},this.renderModule.nonselectableDataKey={},!(0,o.isNullOrUndefined)(this.dataSource)&&this.dataSource.result&&(this.isVirtualAdaptive=!1),Object.getPrototypeOf(t).deepWatch)for(var s=this.getPrimaryKeyFieldNames()[0],l=0,h=Object.keys(t.dataSource);l<h.length;l++)this.setRowData((0,o.getValue)(s,this.dataSource[h[parseInt(l.toString(),10)]]),this.dataSource[h[parseInt(l.toString(),10)]]);else if(n.isPending){var d=(0,o.isNullOrUndefined)(this.dataSource)?[]:this.dataSource.result;if((p=n.group||[]).length&&!this.groupSettings.enableLazyLoading&&(!d.length||!d[0].field))for(l=0;l<p.length;l++)d=a.DataUtil.group(d,p[parseInt(l.toString(),10)],n.aggregates||[]);this.dataSource={result:d,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),n.resolver(this.dataSource)}else{if(!(0,o.isNullOrUndefined)(this.dataSource)&&this.dataSource.result&&this.dataSource.count&&this.groupSettings.columns.length){var p;d=this.dataSource.result;if((p=this.groupSettings.columns).length&&(!d.length||!d[0].field))for(l=0;l<p.length;l++)d=a.DataUtil.group(d,p[parseInt(l.toString(),10)]);this.dataSource={result:d,count:this.dataSource.count}}if(this.getDataModule().setState({isDataChanged:!1}),this.notify(kt,{}),!i){if(this.isRowSelectable&&!this.isRemote()){var c=this.getDataModule().dataManager.executeLocal(this.getDataModule().generateQuery(!0));this.renderModule.setPartialRecord(c)}this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify(Wn,{})}}this.scrollRefresh();break;case"enableHover":(t.enableHover?o.addClass:o.removeClass)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(t.selectedRowIndex),this.isSelectedRowIndexUpdating=!1;break;case"resizeSettings":this.widthService.setWidthToTable();break;case"enableAdaptiveUI":this.notify(hr,{});break;case"rowRenderingMode":this.enableVerticalRendering(),this.notify(pr,{}),this.refresh();break;case"enableStickyHeader":this.scrollModule.addStickyListener(t.enableStickyHeader);break;case"allowPdfExport":case"allowExcelExport":this.toolbarModule&&this.toolbarModule.refreshToolbarItems();break;case"enableRowSpan":case"enableColumnSpan":this.refreshColumns()}},t.prototype.maintainSelection=function(e){var t=this;if(-1!==e){var i=function(){t.selectRow(e),t.off(Ne,i)};this.on(Ne,i,this)}},t.prototype.setProperties=function(t,i){var n=this.groupSettings.columns,r="frozenColumns";null!==t[""+r]&&0!==t[""+r]||!i||this.resetFrozenColumns(),e.prototype.setProperties.call(this,t,i);var s="groupSettings";if(t.filterSettings&&this.filterModule&&i&&this.filterModule.refreshFilter(),t[""+s]&&t[""+s].columns&&this.groupModule&&i){if(!this.groupSettings.showGroupedColumn&&(0,o.isNullOrUndefined)(t.columns))for(var a=0;a<n.length;a++){this.getColumnByField(n[parseInt(a.toString(),10)]).visible=!0}for(a=0;a<this.sortSettings.columns.length;a++){-1!==n.indexOf(this.sortSettings.columns[parseInt(a.toString(),10)].field)&&this.sortSettings.columns[parseInt(a.toString(),10)].isFromGroup&&(this.sortSettings.columns.splice(a,1),a--)}for(a=0;a<t[""+s].columns.length;a++){this.groupModule.groupAddSortingQuery(t[""+s].columns[parseInt(a.toString(),10)]),this.getColumnByField(t[""+s].columns[parseInt(a.toString(),10)]).visible=this.groupSettings.showGroupedColumn}}},t.prototype.getTablesCount=function(){return this.tablesCount},t.prototype.isRemote=function(){return this.getDataModule().isRemote()||!(0,o.isNullOrUndefined)(this.dataSource)&&!(0,o.isNullOrUndefined)(this.dataSource.result)},t.prototype.updateDefaultCursor=function(){for(var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().getElementsByClassName("e-stackedheadercell")),i=this.getColumns(),n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=i[parseInt(n.toString(),10)];this.allowGrouping&&s.allowGrouping||this.allowReordering&&s.allowReordering||this.allowSorting&&s.allowSorting?r.classList.add("e-mousepointer"):r.classList.add("e-defaultcursor")}for(var o=0;o<t.length;o++)this.allowReordering&&t[parseInt(o.toString(),10)].classList.add("e-mousepointer")},t.prototype.updateColumnModel=function(e,t){for(var i=0,n=(0,o.isNullOrUndefined)(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.updateColumnModel(e[parseInt(i.toString(),10)].columns,!0):this.columnModel.push(e[parseInt(i.toString(),10)]);!(0,o.isNullOrUndefined)(t)&&t||this.updateLockableColumns()},t.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},t.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.frozenLeftColumns.length||0!==this.frozenRightColumns.length||0!==this.fixedColumns.length},t.prototype.getFrozenMode=function(){return this.frozenName},t.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,n=this.getFrozenColumns(),r=0;r<e.length;r++)e[parseInt(r.toString(),10)].lockColumn&&(r<n?(e.splice(t,0,e.splice(r,1)[0]),t++):(e.splice(n+i,0,e.splice(r,1)[0]),i++))},t.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.checkLockColumns(e[parseInt(t.toString(),10)].columns):e[parseInt(t.toString(),10)].lockColumn&&this.lockcolPositionCount++},t.prototype.leftrightColumnWidth=function(e){var t="left"===e?this.getFrozenLeftColumns():"right"===e?this.getFrozenRightColumns():[],i=0;return t.filter(function(e){e.visible&&(i+=parseInt(e.width.toString(),10))}),i},t.prototype.getColumns=function(e){var t=this,i=this.inViewIndexes.map(function(e){return e-t.groupSettings.columns.length}).filter(function(e){return e>-1}),n=i.length;(!this.enableColumnVirtualization||(0,o.isNullOrUndefined)(this.columnModel)||0===this.columnModel.length||e)&&(this.columnModel=[],this.updateColumnModel(this.columns));var r=0===n?this.columnModel:this.getVisibleColumns().slice(i[0],i[n-1]+1),s=[],a=[],l=[],h=this.enableColumnVirtualization&&this.isPreparedFrozenColumns&&0===n;h&&(this.frozenRightColumns=[],this.frozenLeftColumns=[]);for(var d=0;d<r.length;d++)"Left"===r[parseInt(d.toString(),10)].freeze||r[parseInt(d.toString(),10)].isFrozen?(s.push(r[parseInt(d.toString(),10)]),h&&this.frozenLeftColumns.push(r[parseInt(d.toString(),10)])):"Right"===r[parseInt(d.toString(),10)].freeze?(a.push(r[parseInt(d.toString(),10)]),h&&this.frozenRightColumns.push(r[parseInt(d.toString(),10)])):l.push(r[parseInt(d.toString(),10)]);return this.enableColumnVirtualization&&this.isFrozenGrid()&&(this.frozenLeftColumns.length&&(s=this.frozenLeftColumns),this.frozenRightColumns.length&&(a=this.frozenRightColumns)),s.concat(l).concat(a)},t.prototype.getPersistColumns=function(){var e=JSON.parse(this.addOnPersist(["columns"])).columns;return e?JSON.stringify(e):""},t.prototype.setColumns=function(e){!(0,o.isNullOrUndefined)(e)&&e instanceof Array&&e.length&&this.setProperties({columns:e},!1)},t.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n.field===e||n.headerText===e){this.stackedColumn=n;break}n.columns&&this.getStackedHeaderColumnByHeaderText(e,n.columns)}return this.stackedColumn},t.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},t.prototype.getQuery=function(){return this.query},t.prototype.getLocaleConstants=function(){return this.defaultLocale},t.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},t.prototype.getVisibleColumns=function(){return this.getCurrentVisibleColumns()},t.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},t.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},t.prototype.getContentTable=function(){return this.contentModule.getTable()},t.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},t.prototype.getContent=function(){return this.contentModule.getPanel()},t.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},t.prototype.getHeaderTable=function(){return this.headerModule.getTable()},t.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},t.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName(ss)[0],this.footerElement},t.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName(ss)[0],this.footerElement.firstChild.firstChild},t.prototype.getPager=function(){return this.gridPager},t.prototype.setGridPager=function(e){this.gridPager=e},t.prototype.getRowByIndex=function(e){return this.enableVirtualization&&this.groupSettings.enableLazyLoading?this.lazyLoadRender.getRowByIndex(e):this.contentModule.getRowByIndex(e)},t.prototype.getMovableRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},t.prototype.getFrozenRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},t.prototype.getRows=function(){return this.contentModule.getRowElements()},t.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},t.prototype.getRowInfo=function(e){var t=e,i={target:e};if(!(0,o.isNullOrUndefined)(e)&&(0,o.isNullOrUndefined)(_a(t,"e-detailrowcollapse")&&(0,o.isNullOrUndefined)(_a(t,"e-recordplusexpand")))){var n=(0,o.closest)(t,"."+is);if(!n){var r=(0,o.closest)(t,"."+us);if(!(0,o.isNullOrUndefined)(r)&&!r.classList.contains("e-addedrow")){var s=this.getRowObjectFromUID(r.getAttribute("data-uid")),a=parseInt(r.getAttribute(Rs),10)-1;i={row:r,rowData:s.data,rowIndex:a}}return i}var l=parseInt(n.getAttribute(xs),10)-1,h=(0,o.closest)(n,"."+us);if(!(0,o.isNullOrUndefined)(n)&&!isNaN(l)&&!(0,o.isNullOrUndefined)(h)){a=parseInt(h.getAttribute(Rs),10)-1;var d=this.contentModule.getRows(),p=l+this.getIndentCount(),c=d.filter(function(e){return e.uid===h.getAttribute("data-uid")});this.pinnedTopRowModels.length&&!(0,o.isNullOrUndefined)(e)&&_a(t,"e-headercontent")&&(c=this.pinnedTopRowModels.filter(function(e){return e.uid===h.getAttribute("data-uid")}));var u={},g=void 0;Object.keys(c).length&&(u=c[0].data,g=c[0].cells[parseInt(p.toString(),10)].column),i={cell:n,cellIndex:l,row:h,rowIndex:a,rowData:u,column:g,target:e}}}return i},t.prototype.getMovableRows=function(){return this.contentModule.getRowElements()},t.prototype.getFrozenRightRows=function(){return this.contentModule.getRowElements()},t.prototype.getDataRows=function(){return this.getAllDataRows()},t.prototype.getAllDataRows=function(e){if((0,o.isNullOrUndefined)(this.getContentTable().querySelector(Ds)))return[];var t=this.getContentTable().querySelector(Ds),i=[].slice.call(t.children);if(this.editSettings.showAddNewRow&&(i[0].classList.contains("e-addedrow")?i.shift():i[i.length-1].classList.contains("e-addedrow")&&i.pop()),this.frozenRows||this.pinnedTopRowModels.length){var n=this.getHeaderTable().querySelector(Ds),r=[].slice.call(n.children);i=this.addMovableRows(r,i),this.editSettings.showAddNewRow&&r[0].classList.contains("e-addedrow")&&r.shift()}return this.generateDataRows(i,e)},t.prototype.addMovableRows=function(e,t){for(var i=0,n=t.length;i<n;i++)e.push(t[parseInt(i.toString(),10)]);return e},t.prototype.generateDataRows=function(e,t){for(var i=[],n=0,r=e.length;n<r;n++)!e[parseInt(n.toString(),10)].classList.contains(us)||e[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")&&!t||(this.isCollapseStateEnabled()?i[parseInt(e[parseInt(n.toString(),10)].getAttribute("aria-rowindex"),10)-1]=e[parseInt(n.toString(),10)]:i.push(e[parseInt(n.toString(),10)]));return i},t.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},t.prototype.getAllMovableDataRows=function(e){return this.getAllDataRows(e)},t.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},t.prototype.getAllFrozenDataRows=function(e){return this.getAllDataRows(e)},t.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},t.prototype.getAllFrozenRightDataRows=function(e){return this.getAllDataRows(e)},t.prototype.setCellValue=function(e,t,i){var n="data",r="index",s=this.getPrimaryKeyFieldNames()[0],a=new $s(this,this.serviceLocator),l=this.getColumnIndexByField(t),h=this.getColumnByField(t),d=this.contentModule.getRows().filter(function(t){return(0,o.getValue)(s,t.data)===e})[0],p=d?this.element.querySelector("[data-uid="+d.uid+"]"):null;if(!(0,o.isNullOrUndefined)(p)){"string"==typeof i&&(i=this.sanitize(i)),(0,o.setValue)(t,i,d[""+n]);var c=this.enableVirtualization?p.children[parseInt(l.toString(),10)]:this.getCellFromIndex(d[""+r],l);if(!(0,o.isNullOrUndefined)(c)){this.groupSettings.columns.length&&(l+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&l++,this.isRowDragable()&&l++;var u=d.cells[l-0];a.refreshTD(c,u,d[""+n],{index:d[""+r]}),this.isReact&&(c=this.enableVirtualization?p.children[parseInt(l.toString(),10)]:this.getCellFromIndex(d[""+r],l)),this.aggregates.length>0&&(this.notify(ot,{}),this.groupSettings.columns.length>0&&this.notify(st,{})),(0,o.isNullOrUndefined)(d)||(0,o.isNullOrUndefined)(d.changes)||(d.changes[""+t]=i),this.trigger(I,{cell:c,column:h,data:d[""+n]}),this.isReact&&"0"===c.getAttribute("tabindex")&&c.classList.contains("e-focused")&&c.focus()}}},t.prototype.setCellValueAsync=function(e,t,i,n){var r=this;return new Promise(function(s,a){try{r.setCellValue(e,t,i),!(0,o.isNullOrUndefined)(n)&&n>0?setTimeout(function(){s()},n):s()}catch(e){a(e)}})},t.prototype.refreshReactColumnTemplateByUid=function(e,t){var i=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){var e=!(!i.childGrid||!i.element.querySelectorAll(".e-childgrid").length),n=e?i.getContentTable().querySelectorAll(".e-row"):i.getDataRows();i.refreshReactTemplateTD(n,e),t&&i.renderTemplates()})},t.prototype.refreshReactTemplateTD=function(e,t,i){for(var n="cells",r=this.getIndentCount(),s=0,a=!1,l=0;l<e.length;l++){var h=this.getRowObjectFromUID(e[parseInt(l.toString(),10)].getAttribute("data-uid"));if(t&&!h&&_a(e[parseInt(l.toString(),10)],"e-childgrid")){var d=_a(e[parseInt(l.toString(),10)],"e-childgrid").ej2_instances[0];h=d.getRowObjectFromUID(e[parseInt(l.toString(),10)].getAttribute("data-uid")),s=d.getIndentCount(),a=!0}if(h&&h.isDataRow&&!(0,o.isNullOrUndefined)(h.index)&&!e[parseInt(l.toString(),10)].classList.contains("e-editedrow"))for(var p=0;p<h[""+n].length;p++){var c=h[""+n][parseInt(p.toString(),10)];if(c.isTemplate){var u=new $s(this,this.serviceLocator),g=t?e[parseInt(l.toString(),10)].children[c.index+(a?s:r)]:this.getCellFromIndex(l,i?c.index:p-r);u.refreshTD(g,c,h.data,{index:h.index})}}a=!1}},t.prototype.refreshGroupCaptionFooterTemplate=function(){for(var e=!(!this.childGrid||!this.element.querySelectorAll(".e-childgrid").length),t=this.getContentTable().querySelectorAll(".e-groupcaptionrow, .e-groupfooterrow"),i=0;i<t.length;i++){var n=this,r=this.getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid"));if(e&&!r&&_a(t[parseInt(i.toString(),10)],"e-childgrid")&&(r=(n=_a(t[parseInt(i.toString(),10)],"e-childgrid").ej2_instances[0]).getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid"))),r){var s={cells:r.cells.filter(function(e){return e.isDataCell}),data:r.data,dataUid:r.uid};n.notify(at,s)}}},t.prototype.refreshReactHeaderTemplateByUid=function(e){if(this.isReact)for(var t=this.headerModule.rows,i=this.getNormalizedColumnIndex(e),n=function(n){var s=t[parseInt(n.toString(),10)].cells[parseInt(i.toString(),10)];if(s&&s.column.uid===e){var a=new ro(r,r.serviceLocator),l=_a(r.element.querySelectorAll("[data-mappinguid="+e+"]")[0],"e-templatecell");a.refresh(s,l);var h=r.sortSettings.columns,d=h.findIndex(function(e){return e.field===s.column.field});if(-1!==d){var p=r.getColumnHeaderByField(s.column.field);r.ariaService.setSort(p,h[parseInt(d.toString(),10)].direction.toLowerCase()),h.length>1&&p.querySelector(".e-headercelldiv").insertBefore(r.createElement("span",{className:"e-sortnumber",innerHTML:(d+1).toString()}),p.querySelector(".e-headertext"));var c=p.querySelector(".e-sortfilterdiv");"Ascending"===h[parseInt(d.toString(),10)].direction?(0,o.classList)(c,["e-ascending","e-icon-ascending"],[]):(0,o.classList)(c,["e-descending","e-icon-descending"],[])}}},r=this,s=0;s<t.length;s++)n(s)},t.prototype.setRowData=function(e,t){var i=this.contentModule.getRows(),n=this.getPrimaryKeyFieldNames()[0];this.groupSettings.columns.length>0&&this.aggregates.length>0&&(i=i.filter(function(e){return e.isDataRow}));var r=i.filter(function(t){return(0,o.getValue)(n,t.data)===e})[0],s=r?[].slice.call(this.element.querySelectorAll("[data-uid="+r.uid+"]")):void 0;if(!(0,o.isNullOrUndefined)(r)&&s.length){if(r.changes=t,this.frozenRows){var a=this.getRowsObject()[r.index];this.setFrozenRowData(a,t)}else{var l=this.getRowElementByUID(r.uid),h=!(!l||!l.querySelector(".e-lastrowcell"));this.setFrozenRowData(r,t),h&&this.scrollModule.setLastRowCell()}this.aggregates.length>0&&(this.notify(ot,{}),this.groupSettings.columns.length>0&&this.notify(st,{}))}},t.prototype.setRowDataAsync=function(e,t,i){var n=this;return new Promise(function(r,s){try{n.setRowData(e,t),!(0,o.isNullOrUndefined)(i)&&i>0?setTimeout(function(){r()},i):r()}catch(e){s(e)}})},t.prototype.setFrozenRowData=function(e,t){var i=new js(this.serviceLocator,null,this);e.changes=t,Tl(e,this.getForeignKeyColumns(),e.changes),i.refresh(e,this.getColumns(),!0)},t.prototype.getCellFromIndex=function(e,t){return Sh(this,this.getColumnByIndex(t),e,t)},t.prototype.getMovableCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},t.prototype.getFrozenRightCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},t.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().getElementsByClassName("e-headercell")[parseInt(e.toString(),10)]},t.prototype.getMovableColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},t.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},t.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},t.prototype.getRowObjectFromUID=function(e){var t=this.contentModule.getRows(),i=this.rowObject(t,e);if((0,o.isNullOrUndefined)(i)&&this.pinnedTopRowModels.length){var n=this.pinnedTopRowModels;if(i=this.rowObject(n,e),!(0,o.isNullOrUndefined)(i))return i}return(0,o.isNullOrUndefined)(i)&&this.enableVirtualization&&this.groupSettings.columns.length>0?i=this.rowObject(this.vRows,e):i},t.prototype.rowObject=function(e,t){if(e)for(var i=0,n=e;i<n.length;i++){var r=n[i];if(r.uid===t)return r}return null},t.prototype.getRowsObject=function(){return this.contentModule.getRows()},t.prototype.getMovableRowsObject=function(){return this.contentModule.getRows()},t.prototype.getFrozenRightRowsObject=function(){return this.contentModule.getRows()},t.prototype.getColumnHeaderByField=function(e){var t=this.getColumnByField(e);return t?this.getColumnHeaderByUid(t.uid):void 0},t.prototype.getColumnHeaderByUid=function(e){var t=this.getHeaderContent().querySelector("[data-mappinguid="+e+"]");return t?(0,o.closest)(t,"th"):void 0},t.prototype.getColumnByIndex=function(e){var t;return this.getColumns().some(function(i,n){return t=i,n===e}),t},t.prototype.getColumnByField=function(e){return Na(this.getColumns(),function(t){if(t.field===e)return t})[0]},t.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].field===e)return i;return-1},t.prototype.getColumnByUid=function(e,t){return Na((t?this.columns:this.getColumns()).concat(this.getStackedColumns(this.columns)),function(t){if(t.uid===e)return t})[0]},t.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var r=n[i];r.columns&&(t.push(r),this.getStackedColumns(r.columns,t))}return t},t.prototype.getColumnIndexByUid=function(e){var t=Na(this.getColumns(),function(t,i){if(t.uid===e)return i})[0];return(0,o.isNullOrUndefined)(t)?-1:t},t.prototype.getUidByColumnField=function(e){return Na(this.getColumns(),function(t){if(t.field===e)return t.uid})[0]},t.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},t.prototype.getIndentCount=function(){var e=0;return this.allowGrouping&&(e+=this.groupSettings.columns.length),this.isDetail()&&e++,this.isRowDragable()&&(0,o.isNullOrUndefined)(this.rowDropSettings.targetID)&&e++,e},t.prototype.getColumnFieldNames=function(){for(var e,t=[],i=0,n=this.getColumns().length;i<n;i++)(e=this.getColumns()[parseInt(i.toString(),10)]).visible&&t.push(e.field);return t},t.prototype.getRowTemplate=function(){return this.rowTemplateFn},t.prototype.getEmptyRecordTemplate=function(){return this.emptyRecordTemplateFn},t.prototype.getDetailTemplate=function(){return this.detailTemplateFn},t.prototype.getEditTemplate=function(){return this.editTemplateFn},t.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},t.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},t.prototype.getColumnChooserTemplate=function(){return this.columnChooserTemplateFn},t.prototype.getColumnChooserHeaderTemplate=function(){return this.columnChooserHeaderTemplateFn},t.prototype.getColumnChooserFooterTemplate=function(){return this.columnChooserFooterTemplateFn},t.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[parseInt(t.toString(),10)].isPrimaryKey&&e.push(this.columnModel[parseInt(t.toString(),10)].field);return e},t.prototype.refresh=function(){this.isDestroyed||(this.isManualRefresh=!0,this.allowGrouping&&this.groupModule&&this.groupSettings.showDropArea&&this.groupModule.refreshDropArea(),this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh())},t.prototype.refreshHeader=function(){this.headerModule.refreshUI()},t.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},t.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},t.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},t.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},t.prototype.getSelectedColumnsUid=function(){var e=this,t=[];return this.selectionModule&&this.selectionModule.selectedColumnsIndexes.filter(function(i){return t.push(e.getColumns()[parseInt(i.toString(),10)].uid)}),t},t.prototype.getDataModule=function(){return this.renderModule.data},t.prototype.showColumns=function(e,t){t=t||"headerText",this.showHider.show(e,t)},t.prototype.hideColumns=function(e,t){t=t||"headerText",this.showHider.hide(e,t)},t.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},t.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount||this.rightcount},t.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount||this.leftcount},t.prototype.getMovableColumnsCount=function(){return this.movableCount||this.movablecount},t.prototype.updateFrozenColumnsWidth=function(){if(this.isFrozenGrid()&&!this.enableColumnVirtualization)for(var e=this.getColumns(),t=!0,i=0,n=0,r=0,s=e.some(function(e){return("Left"===e.freeze||"Right"===e.freeze||"Fixed"===e.freeze||e.isFrozen)&&"auto"===e.width}),a=function(a){var h=e[parseInt(a.toString(),10)];if((0,o.isNullOrUndefined)(h.width)&&("Left"===h.freeze||"Right"===h.freeze||"Fixed"===h.freeze||h.isFrozen)&&(h.width=Math.max(200,h.minWidth?parseFloat(h.minWidth.toString()):0),!(0,o.isNullOrUndefined)(h.maxWidth)&&parseFloat(h.maxWidth.toString())<h.width&&(h.width=h.maxWidth)),"auto"===h.width&&s){var d=0;if(t){e.filter(function(e){if(e.visible&&("auto"===e.width&&i++,"auto"!==e.width)){var t=(0,o.isNullOrUndefined)(e.width)?Math.max(200,e.minWidth?parseFloat(e.minWidth.toString()):0):parseFloat(e.width.toString());d+=t}});var p=l.isPercentageWidthGrid()||"auto"===l.width?l.element.getBoundingClientRect().width:parseFloat(l.width.toString());(n="auto"===l.height?p-d:p-d-ol())<0&&(n=0),r=parseFloat((n/i).toString()),e.filter(function(e){e.visible&&e.minWidth&&parseFloat(e.minWidth.toString())>r&&(n-=parseFloat(e.minWidth.toString()),i--)}),t=!1}h.minWidth&&parseFloat(h.minWidth.toString())>r?h.width=parseFloat(h.minWidth.toString()):h.width=n/i}},l=this,h=0;h<e.length;h++)a(h)},t.prototype.refreshSplitFrozenColumn=function(){this.splitFrozenCount(this.columns),this.updateFrozenColumnsWidth(),this.isAutoGenerateColumns=!0},t.prototype.setFrozenCount=function(){this.frozenLeftCount=this.frozenRightCount=this.movableCount=0,this.visibleFrozenLeft=this.visibleFrozenRight=this.visibleMovable=0,this.frozenLeftColumns=[],this.frozenRightColumns=[],this.movableColumns=[],this.fixedColumns=[],this.splitFrozenCount(this.columns),this.leftcount=this.frozenLeftCount,this.rightcount=this.frozenRightCount,this.movablecount=this.movableCount,this.frozenLeftCount&&!this.frozenRightCount?this.frozenName="Left":this.frozenRightCount&&!this.frozenLeftCount?this.frozenName="Right":this.frozenLeftCount&&this.frozenRightCount?this.frozenName="Left-Right":this.frozenColumns||this.frozenRows?this.frozenName="Left":this.frozenName=void 0},t.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},t.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},t.prototype.getVisibleMovableCount=function(){return this.visibleMovable},t.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},t.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},t.prototype.getMovableColumns=function(){return this.movableColumns},t.prototype.splitStackedColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.splitStackedColumns(e[parseInt(t.toString(),10)].columns):"Left"===e[parseInt(t.toString(),10)].freeze||e[parseInt(t.toString(),10)].isFrozen?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenLeft++,this.leftcount++):"Right"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenRight++,this.rightcount++):"Fixed"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenFixed++,this.fixedcount++):(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleMovable++,this.movablecount++)},t.prototype.pushStackedColumns=function(e,t,i,n,r){i[parseInt(t.toString(),10)]={headerText:n.headerText},n.textAlign&&(i[parseInt(t.toString(),10)].textAlign=n.textAlign),n.customAttributes&&(i[parseInt(t.toString(),10)].customAttributes=n.customAttributes);for(var s=0;s<e.length;s++)if(e[parseInt(s.toString(),10)].columns)t+=1,this.pushStackedColumns(e[parseInt(s.toString(),10)].columns,t,i,e[parseInt(s.toString(),10)],r),t-=1;else{var o;o=i.slice().slice(0,t+1),"Left"===e[parseInt(s.toString(),10)].freeze||e[parseInt(s.toString(),10)].isFrozen?(this.stackedLeft.push(o),this.stackedarrayLeft.push(e[parseInt(s.toString(),10)])):"Right"===e[parseInt(s.toString(),10)].freeze?(this.stackedRight.push(o),this.stackedarrayRight.push(e[parseInt(s.toString(),10)])):"Fixed"===e[parseInt(s.toString(),10)].freeze?(this.stackedFixed.push(o),this.stackedarrayFixed.push(e[parseInt(s.toString(),10)])):(this.stackedMovable.push(o),this.stackedarrayMovable.push(e[parseInt(s.toString(),10)]))}},t.prototype.pushallcol=function(e,t,i,n,r){if(i.headerText===t.headerText)if(r)i.columns.push(n);else{var s={headerText:e.headerText,columns:[]};e.textAlign&&(s.textAlign=e.textAlign),e.customAttributes&&(s.customAttributes=e.customAttributes),i.columns.push(s)}else if(i.columns&&i.columns.length)for(var o=0;o<i.columns.length;o++)this.pushallcol(e,t,i.columns[parseInt(o.toString(),10)],n,r)},t.prototype.resetStackedColumns=function(e,t,i){for(var n={},r=[],s=1;s<=e.length;s++)for(var o=e[s-1],a=0;a<o.length;a++)if(n.columns||1!==s?-1===r.indexOf(o[parseInt(a.toString(),10)])&&(this.pushallcol(o[parseInt(a.toString(),10)],o[a-1],n),r.push(o[parseInt(a.toString(),10)])):(n={headerText:o[parseInt(a.toString(),10)].headerText,textAlign:o[parseInt(a.toString(),10)].textAlign,customAttributes:o[parseInt(a.toString(),10)].customAttributes,columns:[]},r.push(o[parseInt(a.toString(),10)])),a===o.length-1){this.pushallcol(null,o[parseInt(a.toString(),10)],n,t[s-1],!0);for(var l=0;l!==e.length-1&&s!==e.length;){var h=o.map(function(e){return e.headerText}).join(", ");h===e[parseInt(s.toString(),10)].map(function(e){return e.headerText}).join(", ")&&(s++,this.pushallcol(null,o[parseInt(a.toString(),10)],n,t[s-1],!0)),l++}}"Left"===i?this.frozenLeftColumns.push(n):"Right"===i?this.frozenRightColumns.push(n):this.movableColumns.push(n)},t.prototype.resetFrozenColumns=function(){var e=this.columnModel;if(e&&e.length)for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&"Left"===e[parseInt(t.toString(),10)].freeze&&(e[parseInt(t.toString(),10)].freeze=void 0)},t.prototype.splitFrozenCount=function(e){if(this.frozenColumns||this.changedProperties&&0===this.changedProperties.frozenColumns){var t=!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.isPreparedFrozenColumns?this.enableColumnVirtualization&&this.columnModel&&this.columnModel.length?this.columnModel:this.getColumns():this.columns;if(!this.changedProperties||this.changedProperties&&!this.changedProperties.frozenColumns)for(var i=0;i<t.length;i++)this.frozenColumns>i?t[parseInt(i.toString(),10)].freeze="Left":"Right"===t[parseInt(i.toString(),10)].freeze||"Fixed"===t[parseInt(i.toString(),10)].freeze?t[parseInt(i.toString(),10)].freeze=t[parseInt(i.toString(),10)].freeze:t[parseInt(i.toString(),10)].freeze=void 0}for(i=0;i<((0,o.isNullOrUndefined)(e)?0:e.length);i++)if(e[parseInt(i.toString(),10)].columns){this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0;this.splitStackedColumns(e[parseInt(i.toString(),10)].columns),!this.leftcount||this.rightcount||this.movablecount||this.fixedcount?!this.rightcount||this.leftcount||this.movablecount||this.fixedcount?!this.movablecount||this.leftcount||this.rightcount||this.fixedcount?!this.fixedcount||this.leftcount||this.rightcount||this.movablecount?(this.frozenLeftCount+=this.leftcount,this.frozenRightCount+=this.rightcount,this.movableCount+=this.movablecount,this.fixedCount+=this.fixedcount,this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0,this.stackedLeft=[],this.stackedRight=[],this.stackedFixed=[],this.stackedMovable=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayFixed=[],this.stackedarrayMovable=[],this.pushStackedColumns(e[parseInt(i.toString(),10)].columns,0,[],e[parseInt(i.toString(),10)],{headerText:e[parseInt(i.toString(),10)].headerText,textAlign:e[parseInt(i.toString(),10)].textAlign,customAttributes:e[parseInt(i.toString(),10)].customAttributes,columns:[]}),this.stackedarrayLeft.length&&this.resetStackedColumns(this.stackedLeft,this.stackedarrayLeft,"Left"),this.stackedarrayRight.length&&this.resetStackedColumns(this.stackedRight,this.stackedarrayRight,"Right"),this.stackedarrayFixed.length&&this.resetStackedColumns(this.stackedFixed,this.stackedarrayFixed,"Fixed"),this.stackedarrayMovable.length&&this.resetStackedColumns(this.stackedMovable,this.stackedarrayMovable,"Movable"),this.stackedLeft=[],this.stackedRight=[],this.stackedMovable=[],this.stackedFixed=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayMovable=[],this.stackedarrayFixed=[]):(this.fixedCount+=this.fixedcount,this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.frozenRightCount+=this.rightcount,this.frozenRightColumns.push(e[parseInt(i.toString(),10)])):(this.frozenLeftCount+=this.leftcount,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]))}else"Right"===e[parseInt(i.toString(),10)].freeze?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenRight++,this.frozenRightColumns.push(e[parseInt(i.toString(),10)]),this.frozenRightCount++):"Left"===e[parseInt(i.toString(),10)].freeze||e[parseInt(i.toString(),10)].isFrozen?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenLeft++,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]),this.frozenLeftCount++):"Fixed"===e[parseInt(i.toString(),10)].freeze?(this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.fixedCount++,this.movableColumns.push(e[parseInt(i.toString(),10)]),this.movableCount++):(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleMovable++,this.movableColumns.push(e[parseInt(i.toString(),10)]),this.movableCount++);if(this.frozenLeftColumns.length){t=this.frozenLeftColumns[this.frozenLeftColumns.length-1];this.removeBorder(this.frozenLeftColumns),this.frozenLeftBorderColumns(t instanceof p?this.lastVisibleLeftCol(this.frozenLeftColumns):t)}if(this.frozenRightColumns.length){t=this.frozenRightColumns[0];this.removeBorder(this.frozenRightColumns),this.frozenRightBorderColumns(t instanceof p?this.firstVisibleRightCol(this.frozenRightColumns):t)}if((this.frozenLeftColumns.length||this.frozenRightColumns.length)&&this.freezeColumnRefresh){t=this.frozenLeftColumns.concat(this.movableColumns).concat(this.frozenRightColumns);this.setProperties({columns:t},!0),this.freezeColumnRefresh=!1}},t.prototype.removeBorder=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length?("Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0),this.removeBorder(e[parseInt(t.toString(),10)].columns)):"Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0)},t.prototype.isVisibleColumns=function(e,t){if(e.columns&&e.columns.length)for(var i=0;i<e.columns.length;i++)this.isVisibleColumns(e.columns[parseInt(i.toString(),10)],t),e.columns[parseInt(i.toString(),10)].visible&&(0,o.isNullOrUndefined)(e.columns[parseInt(i.toString(),10)].columns)&&(!(0,o.isNullOrUndefined)(e.columns[parseInt(i.toString(),10)].freeze)||e.columns[parseInt(i.toString(),10)].isFrozen)&&t.push("true");else!e.visible||(0,o.isNullOrUndefined)(e.freeze)&&!e.isFrozen||t.push("true")},t.prototype.lastVisibleLeftCol=function(e){for(var t,i=e.length-1;i>=0;i--){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},t.prototype.firstVisibleRightCol=function(e){for(var t,i=0;i<e.length;i++){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},t.prototype.frozenLeftBorderColumns=function(e){if(!(0,o.isNullOrUndefined)(e))if(e.columns&&e.columns.length){e.border="Left";var t=e.columns[e.columns.length-1];this.frozenLeftBorderColumns(t instanceof p&&t.columns?this.lastVisibleLeftCol(e.columns):t)}else e.border="Left"},t.prototype.frozenRightBorderColumns=function(e){if(!(0,o.isNullOrUndefined)(e))if(e.columns&&e.columns.length){e.border="Right";var t=e.columns[0];this.frozenRightBorderColumns(t instanceof p&&t.columns?this.firstVisibleRightCol(e.columns):t)}else e.border="Right"},t.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},t.prototype.pinRows=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=!1,n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)];this.pinnedTopRowKeys[r[""+t]]||(this.pinnedTopRecords.push(r),this.pinnedTopRowKeys[r[""+t]]=!0,i=!0)}i&&this.notify(Ue,{requestType:"pin-row"})},t.prototype.unpinRows=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=!1,n=function(n){var s=e[parseInt(n.toString(),10)],o=s[""+t],a=r.pinnedTopRecords.findIndex(function(e){return e[""+t]===o});r.pinnedTopRowKeys[s[""+t]]&&(r.pinnedTopRecords.splice(a,1),r.pinnedTopRowKeys[s[""+t]]=!1,i=!0)},r=this,s=0;s<e.length;s++)n(s);i&&this.notify(Ue,{requestType:"unpin-row"})},t.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},t.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columnModel,i=0;i<this.frozenColumns;i++)t[parseInt(i.toString(),10)].visible&&e++;if(this.frozenLeftCount||this.leftcount||this.frozenRightCount||this.rightcount)for(i=0;i<t.length;i++)!t[parseInt(i.toString(),10)].visible||"Left"!==t[parseInt(i.toString(),10)].freeze&&"Right"!==t[parseInt(i.toString(),10)].freeze||e++;return e},t.prototype.getVisibleFrozenCount=function(e,t){if(!(this.frozenLeftCount||this.leftcount||this.frozenRightCount&&this.rightcount))for(var i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?t=this.getVisibleFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&e[parseInt(i.toString(),10)].visible&&t++;return t},t.prototype.getFrozenCount=function(e,t,i){for(var n=0,r=(0,o.isNullOrUndefined)(e)?0:e.length;n<r;n++)e[parseInt(n.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(n.toString(),10)].columns,t,i):(e[parseInt(n.toString(),10)].isFrozen&&i>this.frozenColumns-1&&t++,i++);return t},t.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},t.prototype.goToPageAsync=function(e){var t=this;return this.pagerModule?this.executeAsyncOperation("paging",function(){return t.pagerModule.goToPage(e)}):Promise.resolve()},t.prototype.updateExternalMessage=function(e){this.pagerModule&&!this.pagerTemplate&&this.pagerModule.updateExternalMessage(e)},t.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},t.prototype.executeAsyncOperation=function(e,t){var i=this;return new Promise(function(n,r){var s=function(t){t.requestType===e&&(i.removeEventListener(D,s),i.off(T,a),i.off(Li,o),n())},o=function(t){t.requestType===e&&(i.removeEventListener(D,s),i.off(T,a),i.off(Li,o),n())},a=function(){i.removeEventListener(D,s),i.off(T,a),i.off(Li,o),r()};i.on(Li,o),i.addEventListener(D,s),i.addEventListener(T,a),t()})},t.prototype.sortColumnAsync=function(e,t,i){var n=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return n.sortModule.sortColumn(e,t,i)}):Promise.resolve()},t.prototype.changeDataSource=function(e,t,i){if(this.isChangeDataSourceCall=!0,this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping&&this.setProperties({groupSettings:{columns:[]}},!0),t&&t.length&&this.setProperties({columns:t},!0),e&&((0,o.isNullOrUndefined)(t)&&this.setProperties({columns:[]},!0),this.setProperties({dataSource:e},!0)),i){for(var n=0,r=["dataSource","columns"];n<r.length;n++){delete i[""+r[n]]}this.setProperties(i,!0)}this.freezeRefresh(),this.isChangeDataSourceCall=!1},t.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},t.prototype.clearSortingAsync=function(){var e=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return e.sortModule.clearSorting()}):Promise.resolve()},t.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},t.prototype.clearGridActions=function(){this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping?this.setProperties({groupSettings:{columns:[]}},!1):this.freezeRefresh()},t.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.filterModule&&this.filterModule.filterByColumn(e,t,i,n,r,s,o,a)},t.prototype.filterByColumnAsync=function(e,t,i,n,r,s,o,a){var l=this;return this.filterModule?this.executeAsyncOperation("filtering",function(){return l.filterModule.filterByColumn(e,t,i,n,r,s,o,a)}):Promise.resolve()},t.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},t.prototype.clearFilteringAsync=function(e){var t=this;return this.filterModule?this.executeAsyncOperation("refresh",function(){return t.filterModule.clearFiltering(e)}):Promise.resolve()},t.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},t.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},t.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},t.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},t.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},t.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},t.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},t.prototype.searchAsync=function(e){var t=this;return this.searchModule?this.executeAsyncOperation("searching",function(){return t.searchModule.search(e)}):Promise.resolve()},t.prototype.print=function(){this.printModule&&this.printModule.print()},t.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},t.prototype.deleteRecordAsync=function(e,t){var i=this;return new Promise(function(n,r){var s=function(e){"delete"===e.requestType&&(i.removeEventListener(D,s),i.off(Li,a),n())},a=function(e){"delete"===e.requestType&&(i.removeEventListener(D,s),i.off(Li,a),n())},l=function(e){"delete"===e.requestType&&(i.removeEventListener(D,s),i.off(T,l),i.off(Li,a)),r()};if(i.editModule){i.on(Li,a),i.addEventListener(T,l),i.addEventListener(D,s);var h=i.getSelectedRecords();i.editModule.deleteRecord(e,t),((0,o.isNullOrUndefined)(e)||(0,o.isNullOrUndefined)(t))&&0===h.length&&(i.removeEventListener(D,s),i.off(T,l),i.off(Li,a),n())}else n()})},t.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},t.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},t.prototype.endEditAsync=function(){var e=this;return new Promise(function(t,i){var n=function(i){"save"===i.requestType&&(e.removeEventListener(D,n),e.off(Li,r),e.off(T,s),t())},r=function(i){"edit"===i.action&&(e.removeEventListener(D,n),e.off(Li,r),e.off(T,s),t())},s=function(){e.removeEventListener(D,n),e.off(T,s),e.off(Li,r),i()};e.editModule?(e.on(Li,r),e.addEventListener(T,s),e.addEventListener(D,n),e.editModule.endEdit()):t()})},t.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},t.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},t.prototype.addRecordAsync=function(e,t){var i=this;return new Promise(function(n,r){var s=function(e){"add"===e.action&&"save"===e.requestType&&(i.removeEventListener(D,s),i.off(Li,o),n())},o=function(e){"add"===e.action&&(i.removeEventListener(D,s),i.off(Li,o),n())},a=function(){i.removeEventListener(D,s),i.off(T,a),i.off(Li,o),r()};i.editModule?(i.on(Li,o),i.addEventListener(T,a),i.addEventListener(D,s),i.editModule.addRecord(e,t),e||(i.removeEventListener(D,s),i.off(T,a),i.off(Li,o),n())):n()})},t.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},t.prototype.deleteRowAsync=function(e){var t=this;return this.editModule?this.executeAsyncOperation("delete",function(){return t.editModule.deleteRow(e)}):Promise.resolve()},t.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},t.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},t.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},t.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},t.prototype.updateRowAsync=function(e,t){var i=this;return new Promise(function(n,r){var s=function(e){"save"===e.requestType&&(i.removeEventListener(D,s),i.off(Li,o),i.off(T,a),n())},o=function(e){"edit"===e.action&&(i.removeEventListener(D,s),i.off(Li,o),i.off(T,a),n())},a=function(){i.removeEventListener(D,s),i.off(T,a),i.off(Li,o),r()};i.editModule?(i.on(Li,o),i.addEventListener(T,a),i.addEventListener(D,s),i.editModule.updateRow(e,t)):n()})},t.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},t.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},t.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},t.prototype.recalcIndentWidth=function(){var e=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell.e-indentRefreshed")&&this.getContentTable()){var t=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,i=[].slice.call(this.getHeaderTable().querySelector(Ts).childNodes),n=[].slice.call(this.getContentTable().querySelector(Ts).childNodes),r=t/30,s="Right"===this.getFrozenMode()?this.groupSettings.columns.length+this.getColumns().length:0,o=this.element.offsetWidth,a=function(t,r){if(eh(e)){var s=(r/o*100).toFixed(1)+"%";i[parseInt(t.toString(),10)].style.width=s,n[parseInt(t.toString(),10)].style.width=s}else i[parseInt(t.toString(),10)].style.width=r+"px",n[parseInt(t.toString(),10)].style.width=r+"px";e.notify(It,{index:t,width:r})};for(r>=1&&(t=30/r),t<1&&(t=1),(this.enableColumnVirtualization||this.isAutoGen||this.columns.length===this.groupSettings.columns.length)&&(t=30);s<this.groupSettings.columns.length;)a(s,t),s++;this.isDetail()&&(a(s,t),s++),this.isRowDragable()&&a(s,t),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").classList.add("e-indentRefreshed")}},t.prototype.resetIndentWidth=function(){if(!this.isDestroyed){if(eh(this)&&(this.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.widthService.setWidthToColumns(),this.recalcIndentWidth(),this.autoFit&&this.preventAdjustColumns()),("auto"===this.width||"string"==typeof this.width&&-1!==this.width.indexOf("%"))&&this.getColumns().filter(function(e){return(!e.width||"auto"===e.width)&&e.minWidth}).length>0){var e=this.widthService.getTableWidth(this.getColumns(),!0);this.widthService.setMinwidthBycalculation(e)}if(this.isFrozenGrid()&&this.enableColumnVirtualization&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!==this.textWrapSettings.wrapMode&&this.notify(Un,{}),(this.frozenRows||this.pinnedTopRowModels.length)&&this.scrollModule&&this.scrollModule.resizeFrozenRowBorder(),this.enableStickyHeader)this.scrollModule.makeStickyHeader()();this.enableAutoFill&&"Multiple"===this.selectionSettings.type&&"Cell"===this.selectionSettings.mode&&this.selectionModule.selectedRowCellIndexes.length&&(this.selectionModule.updateAutoFillPosition(),this.selectionModule.drawBorders())}},t.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},t.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},t.prototype.reorderColumnByModel=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByModel(e,t)},t.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},t.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},t.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},t.prototype.refreshDataSource=function(e){this.notify("refreshdataSource",e)},t.prototype.disableRowDD=function(e){var t=this.getHeaderTable(),i=this.getContentTable(),n=t.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),r=this.getRows(),s=e?"none":"";(0,o.setStyleAttribute)(t.querySelector(Ts).childNodes[0],{display:s}),(0,o.setStyleAttribute)(i.querySelector(Ts).childNodes[0],{display:s});for(var a=0;a<this.getRows().length;a++){var l=r[parseInt(a.toString(),10)].firstElementChild;e?(0,o.addClass)([l],"e-hide"):(0,o.removeClass)([l],["e-hide"])}for(var h=0;h<t.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;h++){l=n[parseInt(h.toString(),10)];e?(0,o.addClass)([l],"e-hide"):(0,o.removeClass)([l],["e-hide"])}},t.prototype.autoFitColumns=function(e,t,i){var n=this.getInjectedModules().find(function(e){return"function"!=typeof e||(0,o.isNullOrUndefined)(e.prototype)?"Resize"===e.name:"resize"===e.prototype.getModuleName()});!this.resizeModule&&n&&(this.autoFitColumnsResize=!0,this.injectModules()),this.resizeModule&&this.resizeModule.autoFitColumns(e,t,i)},t.prototype.preventAdjustColumns=function(){if(!(this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode)){for(var e=this.getColumns(),t=this.getHeaderTable(),i=0,n=0;n<e.length;n++)if(e[parseInt(n.toString(),10)].visible){if(this.groupSettings.columns.length&&this.groupSettings.columns.indexOf(e[parseInt(n.toString(),10)].field)>-1)if("none"===[].slice.call(t.querySelector("colgroup").querySelectorAll(":not(.e-group-intent):not(.e-detail-intent):not(.e-drag-intent)"))[parseInt(n.toString(),10)].style.display)continue;if(!e[parseInt(n.toString(),10)].width){i=0;break}i+=parseFloat(e[parseInt(n.toString(),10)].width.toString())}if(i){var r=this.isPercentageWidthGrid(),s=this.widthUnit(r),a=this.getContentTable();if(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable()){var l=this.defaultIndentWidth(r),h=l.toString()+s,d=[].slice.call(t.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),p=[].slice.call(a.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent"));for(n=0;n<d.length;n++)d[parseInt(n.toString(),10)].style.setProperty("width",h),p[parseInt(n.toString(),10)].style.setProperty("width",h),i+=l}(r&&i<100||!r&&i<a.parentElement.clientWidth)&&((0,o.isNullOrUndefined)(a.querySelector(".e-emptyrow"))?(0,o.addClass)([t,a],["e-tableborder"]):((0,o.addClass)([t],["e-tableborder"]),(0,o.removeClass)([a],["e-tableborder"])));var c=i.toString()+s;t.style.setProperty("width",c),a.style.setProperty("width",c)}else this.restoreAdjustColumns()}},t.prototype.restoreAdjustColumns=function(){if(!(this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode)){var e=this.getHeaderTable(),t=this.getContentTable();if((0,o.removeClass)([e,t],["e-tableborder"]),e.style.removeProperty("width"),t.style.removeProperty("width"),this.groupSettings.columns.length||this.isDetail()||this.isRowDragable()){var i=this.isPercentageWidthGrid(),n=this.defaultIndentWidth(i).toString()+this.widthUnit(i);[].slice.call(e.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")).forEach(function(e){e.style.setProperty("width",n)}),e.querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.recalcIndentWidth()}}},t.prototype.widthUnit=function(e){return e?"%":"px"},t.prototype.defaultIndentWidth=function(e){return e?parseFloat((30/this.element.offsetWidth*100).toFixed(1)):30},t.prototype.isPercentageWidthGrid=function(){var e=this.getColumns().find(function(e){return!(0,o.isNullOrUndefined)(e.width)});return!!e&&e.width.toString().indexOf("%")>-1},t.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},t.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new ko(this)),this.serviceLocator.register("cellRendererFactory",new Do),this.serviceLocator.register("rendererFactory",new Oo),this.serviceLocator.register("localization",this.localeObj=new o.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new l(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new _o(this)),this.serviceLocator.register("ariaService",this.ariaService=new eo),this.serviceLocator.register("focus",this.focusModule=new Fo(this))},t.prototype.processModel=function(){var e,t,i=this.groupSettings.columns,n=this.sortSettings.columns;if(this.allowGrouping)for(var r=function(r,o){e=!1,t=0;for(var a=n.length;t<a;t++)if(n[parseInt(t.toString(),10)].field===i[parseInt(r.toString(),10)]){e=!0;break}if(e?s.allowSorting?s.sortedColumns.push(n[parseInt(t.toString(),10)].field):n[parseInt(t.toString(),10)].direction="Ascending":n.push({field:i[parseInt(r.toString(),10)],direction:"Ascending",isFromGroup:!0}),!s.groupSettings.showGroupedColumn){var l=s.enableColumnVirtualization?s.columns.filter(function(e){return e.field===i[parseInt(r.toString(),10)]})[0]:s.getColumnByField(i[parseInt(r.toString(),10)]);l?l.visible=!1:s.log("initial_action",{moduleName:"group",columnName:i[parseInt(r.toString(),10)]})}},s=this,a=0,l=i.length;a<l;a++)r(a);if(!i.length)for(a=0;a<n.length;a++)this.sortedColumns.push(n[parseInt(a.toString(),10)].field);if(this.rowTemplateFn=za(this.rowTemplate),this.emptyRecordTemplateFn=za(this.emptyRecordTemplate),this.detailTemplateFn=za(this.detailTemplate),this.editTemplateFn=za(this.editSettings.template),this.editHeaderTemplateFn=za(this.editSettings.headerTemplate),this.editFooterTemplateFn=za(this.editSettings.footerTemplate),this.columnChooserTemplateFn=za(this.columnChooserSettings.template),this.columnChooserHeaderTemplateFn=za(this.columnChooserSettings.headerTemplate),this.columnChooserFooterTemplateFn=za(this.columnChooserSettings.footerTemplate),!(0,o.isNullOrUndefined)(this.parentDetails)){var h=(0,o.isNullOrUndefined)(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue;this.query.where(this.queryString,"equal",h,!0)}this.initForeignColumn()},t.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify(wi,this.getForeignKeyColumns())},t.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},t.prototype.gridRender=function(){var e;this.updateRTL(),"Vertical"===this.rowRenderingMode&&this.element.classList.add("e-row-responsive"),this.enableHover&&this.element.classList.add("e-gridhover"),(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||o.Browser.isSafari())&&this.element.classList.add("e-mac-safari"),o.Browser.isDevice&&(this.element.classList.add("e-device"),"Desktop"===this.adaptiveUIMode&&"Vertical"!==this.rowRenderingMode&&(this.enableAdaptiveUI=!1)),"Mobile"!==this.adaptiveUIMode||o.Browser.isDevice||"Vertical"===this.rowRenderingMode||(this.enableAdaptiveUI=!1),this.rowHeight&&this.element.classList.add("e-grid-min-height"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?(e=this.element.classList).add.apply(e,this.cssClass.split(" ")):this.element.classList.add(this.cssClass)),this.allowRowDragAndDrop&&this.rowDropSettings.targetID&&"mozilla"===o.Browser.info.name&&this.element.classList.add("e-disableuserselect"),this.editSettings.showAddNewRow&&(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.editSettings.newRowPosition="Top"),(0,o.classList)(this.element,["e-responsive","e-default"],[]);var t=this.serviceLocator.getService("rendererFactory");this.headerModule=t.getRenderer(i.Header),this.contentModule=t.getRenderer(i.Content),this.printModule=new Ra(this,this.scrollModule),this.clipboardModule=new Jo(this,this.serviceLocator),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},t.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},t.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},t.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup"});e.style.display="none";var t=this.createElement("div",{className:ps,attrs:{tabIndex:"-1"}});(0,o.append)([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),(0,o.append)([t,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},t.prototype.updateGridLines=function(){switch((0,o.classList)(this.element,[],["e-verticallines","e-horizontallines","e-hidelines","e-bothlines"]),this.gridLines){case"Horizontal":this.element.classList.add("e-horizontallines");break;case"Vertical":this.element.classList.add("e-verticallines");break;case"None":this.element.classList.add("e-hidelines");break;case"Both":this.element.classList.add("e-bothlines")}this.updateResizeLines()},t.prototype.updateResizeLines=function(){this.allowResizing&&"Vertical"!==this.gridLines&&"Both"!==this.gridLines?this.element.classList.add("e-resize-lines"):this.element.classList.remove("e-resize-lines")},t.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.getElementsByClassName("e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":ml(this.element,!1),ml(this.getContent(),!1),ml(e,!0);break;case"Content":ml(this.getContent(),!0),ml(this.element,!1),ml(e,!1);break;default:ml(this.element,!0),ml(this.getContent(),!1),ml(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(Un,{})}},t.prototype.removeTextWrap=function(){ml(this.element,!1),ml([].slice.call(this.element.getElementsByClassName("e-columnheader")),!1),ml(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(Un,{})},t.prototype.createTooltip=function(){this.toolTipObj=new y.Tooltip({opensOn:"custom",content:"",cssClass:this.cssClass?this.cssClass:null},this.element)},t.prototype.freezeRefresh=function(){(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.pageSettings.currentPage=1),this.componentRefresh()},t.prototype.getTooltipStatus=function(e){var t=this.getHeaderTable(),i=this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode?"e-gridcontent":"e-gridheader",n=this.createTable(t,i,"header"),r=this.createTable(t,i,"content"),s=e.classList.contains("e-headercell")?n:r,o=e.classList.contains("e-headercell")?"th":"tr";s.querySelector(o).className=e.className;var a=s.querySelector(o);a.innerHTML="",Array.from(e.childNodes).forEach(function(e){a.appendChild(e.cloneNode(!0))});var l=s.querySelector(o).getBoundingClientRect().width;return document.body.removeChild(n),document.body.removeChild(r),!!(l>e.getBoundingClientRect().width&&!e.classList.contains("e-editedbatchcell")||this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode&&l>.55*e.getBoundingClientRect().width-("auto"!==this.height?16:0))},t.prototype.mouseMoveHandler=function(e){if(this.isEllipsisTooltip()){var t=_a(e.target,"e-ellipsistooltip");"mouseout"!==e.type||this.prevElement===t&&t===_a(e.relatedTarget,"e-ellipsistooltip")||(this.toolTipObj.close(),this.toolTipObj.clear(),this.prevElement=null);var i=e.target.tagName;if(t&&"mouseout"!==e.type&&(!o.Browser.isDevice||-1===["A","BUTTON","INPUT"].indexOf(i))&&this.getTooltipStatus(t)){var n=this.getColumns()[parseInt(t.getAttribute(xs),10)-1],r=n&&n.disableHtmlEncode?"innerText":"innerHTML",s=this.createElement("div");if(t.getElementsByClassName("e-headertext").length){var a=t.getElementsByClassName("e-headertext")[0];s[""+r]=this.sanitize(a.innerText),this.toolTipObj.content=s}else s[""+r]=this.sanitize(t.innerText),this.toolTipObj.content=s;this.enableHtmlSanitizer&&(this.toolTipObj.enableHtmlSanitizer=!0),n&&n.disableHtmlEncode&&(this.toolTipObj.enableHtmlParse=!1),t!==this.prevElement&&this.toolTipObj.open(t),this.prevElement=t}}},t.prototype.isEllipsisTooltip=function(){var e=this.getColumns();if("EllipsisWithTooltip"===this.clipMode)return!0;for(var t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[parseInt(t.toString(),10)].clipMode)return!0;return!1},t.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},t.prototype.createTable=function(e,t,i){var n=this.createElement("div");n.className=this.element.className,n.style.cssText="display: inline-block;visibility:hidden;position:absolute";var r=this.createElement("div");r.className=t;var s=this.createElement("table");s.className=e.className,s.style.cssText="table-layout: auto;width: auto";var o="header"===i?"th":"td",a=this.createElement("tr",{attrs:{role:"row"}}),l=this.createElement(o);return a.appendChild(l),s.appendChild(a),r.appendChild(s),n.appendChild(r),document.body.appendChild(n),n},t.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},t.prototype.wireEvents=function(){o.EventHandler.add(this.element,"click",this.mouseClickHandler,this),o.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),o.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),o.EventHandler.add(this.element,"dblclick",this.dblClickHandler,this),o.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),o.EventHandler.add(window,"resize",this.resetIndentWidth,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new o.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),o.EventHandler.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),o.EventHandler.add(this.element,"mouseover",this.mouseMoveHandler,this),o.EventHandler.add(this.element,"mouseout",this.mouseMoveHandler,this),o.EventHandler.add(this.getContent(),"touchstart",this.tapEvent,this),o.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},t.prototype.unwireEvents=function(){o.EventHandler.remove(this.element,"click",this.mouseClickHandler),o.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),o.EventHandler.remove(this.element,"focusout",this.focusOutHandler),o.EventHandler.remove(this.element,"dblclick",this.dblClickHandler),o.EventHandler.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),o.EventHandler.remove(this.element,"mouseover",this.mouseMoveHandler),o.EventHandler.remove(this.element,"mouseout",this.mouseMoveHandler),o.EventHandler.remove(this.element,"keydown",this.keyPressHandler),o.EventHandler.remove(this.getContent(),"touchstart",this.tapEvent),o.EventHandler.remove(document.body,"keydown",this.keyDownHandler),o.EventHandler.remove(window,"resize",this.resetIndentWidth)},t.prototype.addListener=function(){this.isDestroyed||(this.on(Pe,this.dataReady,this),this.on(Ne,this.recalcIndentWidth,this),this.on(je,this.recalcIndentWidth,this),this.on(Br,this.refreshFrozenPosition,this),this.on(qr,this.refreshSplitFrozenColumn,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(E,this.dataBoundFunction),this.on(vt,this.onKeyPressed,this))},t.prototype.removeListener=function(){this.isDestroyed||(this.off(Pe,this.dataReady),this.off(Ne,this.recalcIndentWidth),this.off(je,this.recalcIndentWidth),this.on(Br,this.refreshFrozenPosition,this),this.on(qr,this.refreshSplitFrozenColumn,this),this.removeEventListener(E,this.dataBoundFunction),this.off(vt,this.onKeyPressed))},t.prototype.getCurrentViewRecords=function(){return Fl(this)?(0,o.isNullOrUndefined)(this.currentViewData.records)?this.currentViewData:this.currentViewData.records:this.groupSettings.enableLazyLoading?this.currentViewData:this.allowGrouping&&this.groupSettings.columns.length&&this.currentViewData.length&&this.currentViewData.records?this.currentViewData.records:this.currentViewData},t.prototype.mouseClickHandler=function(e){if(!(this.isChildGrid(e)||_a(e.target,"e-gridpopup")&&e.touches||this.element.getElementsByClassName("e-cloneproperties").length||this.checkEdit(e))&&(!(!this.allowRowDragAndDrop&&(_a(e.target,rs)||"TD"===e.target.tagName)||_a(e.target,"e-headercell")&&_a(e.target,"e-headercell").querySelector(".e-checkselectall")||!this.allowGrouping&&!this.allowReordering&&_a(e.target,"e-gridheader"))||!e.touches)&&(_a(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!_a(e.target,"e-filterbarcell")&&e.target&&-1===["A","BUTTON","INPUT"].indexOf(e.target.tagName)&&e.preventDefault(),!this.allowRowDragAndDrop||!_a(e.target,"e-rowcell")||_a(e.target,"e-rowdragdrop")||!e.touches)){var t=this.getRowInfo(e.target);t.event=e;t.cancel=!1;var i=!1,n=(0,o.closest)(e.target,"tr");if(n&&n.getAttribute("data-uid")){var r=this.getRowObjectFromUID(n.getAttribute("data-uid"));i=!!r&&r.isDataRow}i&&this.trigger(ge,t),this.notify(St,e)}},t.prototype.checkEdit=function(e){var t=_a(e.target,us),i="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains(fs)||t.classList.contains(ms)&&!this.editSettings.showAddNewRow);return!_a(e.target,"e-unboundcelldiv")&&(i||_a(e.target,is)&&_a(e.target,is).classList.contains("e-editedbatchcell"))},t.prototype.dblClickHandler=function(e){var t=_a(e.target,"e-grid");if(!(0,o.isNullOrUndefined)(t)&&t.id===this.element.id&&!(0,o.closest)(e.target,".e-unboundcelldiv")){var i=!1,n=(0,o.closest)(e.target,"tr");if(n&&n.getAttribute("data-uid")){var r=this.getRowObjectFromUID(n.getAttribute("data-uid"));i=!!r&&r.isDataRow}var s=this.getRowInfo(e.target);s.target=e.target,s.event=e,i&&this.trigger(ue,s),this.notify(Mt,e)}},t.prototype.focusOutHandler=function(e){if(!this.isChildGrid(e)){_a(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None");var t=this.element.querySelector(".e-cancel:not(.e-hide)");t&&!t.parentElement.classList.contains("e-tbar-btn")&&t.classList.add("e-hide");var i=e.relatedTarget,n=i?i.getAttribute("aria-owns"):null;i&&(_a(i,"e-grid")||(!(0,o.isNullOrUndefined)(n)&&n)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||o.Browser.isDevice||("Batch"!==this.editSettings.mode||(_a(i,"e-ddl")||_a(i,"e-ddt"))&&(_a(i,"e-multi-select-list-wrapper")||_a(i,"e-input-filter"))&&_a(i,"e-input-group")||!_a(i,"e-uploader")&&(i&&(0,o.isNullOrUndefined)(_a(i,"e-input-group"))||_a(e.target,"edit-custom-template"))||(this.editModule.saveCell(),this.notify(Pi,{})),"Normal"!==this.editSettings.mode||this.isWidgetsDestroyed||this.editModule.editFormValidate()),this.editSettings.showAddNewRow&&(this.editModule.isShowAddedRowValidate=!1),this.keyPress=!1}},t.prototype.isChildGrid=function(e){var t=_a(e.target,"e-grid");return!!(t&&t.id!==this.element.id||_a(e.target,"e-unboundcelldiv")&&(0,o.isNullOrUndefined)(t))},t.prototype.mergePersistGridData=function(e){var t=this.getLocalData();if(!(0,o.isNullOrUndefined)(t)&&""!==t||!(0,o.isNullOrUndefined)(e)){var i=(0,o.isNullOrUndefined)(e)?JSON.parse(t):e,n=Object.keys(i);this.isProtectedOnChange=!0;for(var r=0,s=n;r<s.length;r++){var a=s[r];"object"!=typeof this[""+a]||(0,o.isNullOrUndefined)(this[""+a])?this[""+a]=i[""+a]:Array.isArray(this[""+a])&&"columns"===a?(this.setFrozenCount(),Ha(this[""+a]),this.mergeColumns(i[""+a],this[""+a]),this.mergedColumns=!0,this[""+a]=i[""+a]):(0,o.extend)(this[""+a],i[""+a])}this.isProtectedOnChange=!1}},t.prototype.mergeColumns=function(e,t){for(var i=e,n=this.isFrozenGrid(),r=function(e){var r=t.filter(function(t){return n?t.index===i[parseInt(e.toString(),10)][""+Hs]:t.index===i[parseInt(e.toString(),10)].index})[0];(0,o.isNullOrUndefined)(r)||(n&&((r=(0,o.extend)({},r,{},!0)).freeze=i[parseInt(e.toString(),10)].freeze),r.columns&&r.columns.length?(s.mergeColumns(i[parseInt(e.toString(),10)].columns,r.columns),i[parseInt(e.toString(),10)]=(0,o.extend)(r,i[parseInt(e.toString(),10)],{},!0)):i[parseInt(e.toString(),10)]=(0,o.extend)(r,i[parseInt(e.toString(),10)],{},!0))},s=this,a=0;a<i.length;a++)r(a)},t.prototype.isDetail=function(){return!(0,o.isNullOrUndefined)(this.detailTemplate)||!(0,o.isNullOrUndefined)(this.childGrid)},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.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},t.prototype.keyPressHandler=function(e){var t=(0,o.extend)(e,{cancel:!1});this.trigger("keyPressed",t),(!0===t.cancel||this.isEdit&&e&&_a(e.target,"e-gridform")&&_a(e.target,"e-ddl")&&"open"===e.action&&!0===e.altKey&&"ArrowDown"===e.code)&&e.stopImmediatePropagation()},t.prototype.keyDownHandler=function(e){if(e.altKey){if(74===e.keyCode&&(this.keyA?(this.notify(zn,{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule&&this.focusModule.currentInfo&&this.focusModule.currentInfo.element&&((0,o.removeClass)([this.focusModule.currentInfo.element,this.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.focusModule.currentInfo.element.tabIndex=-1),this.element.classList.contains("e-childgrid")||this.element.focus())),87===e.keyCode){var t=this.focusModule;if(t){if(!this.currentViewData.length)return;0!==this.element.getBoundingClientRect().width&&t.focusContent(),t.addOutline()}}65===e.keyCode&&(this.keyA=!0),72===e.keyCode&&this.keyA&&(this.notify(zn,{target:e.target,collapse:!0}),this.keyA=!1)}13===e.keyCode&&this.notify(cr,e)},t.prototype.keyActionHandler=function(e){this.isChildGrid(e)||this.editModule&&(this.editModule.alertDObj&&this.editModule.alertDObj.visible||this.editModule.dialogObj&&this.editModule.dialogObj.visible)||this.isEdit&&(!this.editSettings.showAddNewRow||this.editSettings.showAddNewRow&&this.element.querySelector(fs))&&"escape"!==e.action&&"enter"!==e.action&&"shiftEnter"!==e.action&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=!0,this.allowKeyboard?("ctrlPlusP"===e.action&&(e.preventDefault(),this.print()),this.notify(vt,e)):"enter"===e.action&&this.editModule&&"Batch"===this.editSettings.mode&&this.isEdit&&_a(e.target,"e-editedbatchcell")&&e.preventDefault())},t.prototype.setInjectedModules=function(e){this.injectedModules=e},t.prototype.updateColumnObject=function(){ja(this.columns,this.enableColumnVirtualization,this),Ha(this.columns),this.initForeignColumn(),this.notify(Nt,{})},t.prototype.refreshFrozenPosition=function(e){e&&e.isModeChg?(this.refreshColumns(),this.notify(zr,{})):this.refreshColumns()},t.prototype.getForeignKeyColumns=function(){return(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return e instanceof p&&e.isForeignColumn()})},t.prototype.getRowHeight=function(e){return this.rowHeight?this.rowHeight:al(this.element,e)},t.prototype.refreshColumns=function(){if(this.freezeColumnRefresh=!0,this.setFrozenCount(),this.updateFrozenColumnsWidth(),this.isFrozenGrid()&&(this.isPreventScrollEvent=!0),this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh(),this.isFrozenGrid()&&this.enableColumnVirtualization){var e=this.getContent().querySelector(".e-movablescrollbar").scrollLeft;this.getHeaderContent().querySelector("."+os).scrollLeft=e,this.getContent().querySelector("."+ps).scrollLeft=e}},t.prototype.excelExport=function(e,t,i,n){if(this.exportGrids&&this.exportGrids.length){var r=this.exportGrids.slice();return this.exportMultipleExcelGrids(r,e,t,i,n)}return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!1,n):null},t.prototype.csvExport=function(e,t,i,n){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!0,n):null},t.prototype.pdfExport=function(e,t,i,n){if(this.exportGrids&&this.exportGrids.length){var r=this.exportGrids.slice();return this.exportMultiplePdfGrids(r,e,t,i,n)}return this.pdfExportModule?this.pdfExportModule.Map(this,e,t,i,n):null},t.prototype.exportMultiplePdfGrids=function(e,t,i,n,r){var s=this;if(0!==e.length){var o=e.shift(),a=document.getElementById(o).ej2_instances[0];return(a.pdfExportModule?a.pdfExportModule.Map(a,t,i,n,r):Promise.resolve()).then(function(n){return i=1!==e.length,s.exportMultiplePdfGrids(e,t,i,n,r)})}return null},t.prototype.exportMultipleExcelGrids=function(e,t,i,n,r){var s=this;if(0!==e.length){var o=e.shift(),a=document.getElementById(o).ej2_instances[0];return(a.excelExportModule?a.excelExportModule.Map(a,t,i,n,!1,r):null).then(function(n){return i=1!==e.length,s.exportMultipleExcelGrids(e,t,i,n,r)})}return null},t.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},t.prototype.groupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("grouping",function(){return t.groupModule.groupColumn(e)}):Promise.resolve()},t.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},t.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},t.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},t.prototype.clearGroupingAsync=function(){var e=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return e.groupModule.clearGrouping()}):Promise.resolve()},t.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},t.prototype.ungroupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return t.groupModule.ungroupColumn(e)}):Promise.resolve()},t.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},t.prototype.scrollRefresh=function(){var e=this,t=function(){e.scrollModule.refresh(),e.off(Ne,t)};this.on(Ne,t,this)},t.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},t.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},t.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},t.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},t.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},t.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},t.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},t.prototype.ensureModuleInjected=function(e){return this.getInjectedModules().indexOf(e)>=0},t.prototype.destroyTemplate=function(e,t,i){this.clearTemplate(e,t,i)},t.prototype.log=function(e,t){this.getInjectedModules().find(function(e){return"Logger"===e.name})||(n.Inject(na),this.enableLogger=!0,this.injectModules()),this.loggerModule&&this.loggerModule.log(e,t)},t.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},t.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},t.prototype.hideScroll=function(){var e=this.getContent().querySelector("."+ps);e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto")},t.prototype.getRowIndexByPrimaryKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[""+t]:e;for(var i=this.getRowsObject(),n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var r=i[parseInt(n.toString(),10)].data[""+t];if(t.split(".").length>1&&(r=Ih(t,i[parseInt(n.toString(),10)].data)),r===e)return i[parseInt(n.toString(),10)].index}return-1},t.prototype.getPinnedRowObjectByKey=function(e){var t=this.getPrimaryKeyFieldNames()[0];e="object"==typeof e?e[""+t]:e;for(var i=this.pinnedTopRowModels,n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var r=i[parseInt(n.toString(),10)].data[""+t];if(t.split(".").length>1&&(r=Ih(t,i[parseInt(n.toString(),10)].data)),r===e)return i[parseInt(n.toString(),10)]}return null},t.prototype.grabColumnByFieldFromAllCols=function(e,t){var i;this.columnModel=[],this.updateColumnModel(this.columns);for(var n=this.columnModel,r=0;r<n.length;r++)if(!t&&e===n[parseInt(r.toString(),10)].field||t&&n[parseInt(r.toString(),10)].isForeignColumn()&&e===n[parseInt(r.toString(),10)].foreignKeyValue){i=n[parseInt(r.toString(),10)];break}return i},t.prototype.grabColumnByUidFromAllCols=function(e){var t;this.columnModel=[],this.updateColumnModel(this.columns);for(var i=this.columnModel,n=0;n<i.length;n++)e===i[parseInt(n.toString(),10)].uid&&(t=i[parseInt(n.toString(),10)]);return t},t.prototype.getFilteredRecords=function(){if(this.allowFiltering&&this.filterSettings.columns.length||this.searchSettings.key.length){var e=this.renderModule.data.generateQuery(!0);return this.dataSource&&this.renderModule.data.isRemote()&&this.dataSource instanceof a.DataManager?this.renderModule.data.getData(this.dataSource,e):this.dataSource instanceof a.DataManager?this.dataSource.executeLocal(e):new a.DataManager(this.dataSource,e).executeLocal(e)}return[]},t.prototype.getUserAgent=function(){var e=o.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad|macintosh/.test(e)},t.prototype.tapEvent=function(e){this.getUserAgent()&&(rl.timer?(clearTimeout(rl.timer),rl.timer=null,this.dblClickHandler(e),this.notify(Zt,e)):rl.timer=setTimeout(function(){rl.timer=null},300))},t.prototype.getRowUid=function(e){return""+e+this.rowUid++},t.prototype.getRowElementByUID=function(e){for(var t,i=[].slice.call(this.getContent().querySelector(Ds).children),n=0,r=this.frozenRows||this.pinnedTopRowModels.length?[].slice.call(this.getHeaderContent().querySelector(Ds).children).concat(i):i;n<r.length;n++){var s=r[n];if(s.getAttribute("data-uid")===e){t=s;break}}return t},t.prototype.getHiddenColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var n=i[t];!1===n.visible&&e.push(n)}return e},t.prototype.calculatePageSizeByParentHeight=function(e){if(this.allowPaging&&(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap)){var t=0;if("string"==typeof e&&-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),e>this.getNoncontentHeight()+this.getRowHeight()){t=(e-this.getNoncontentHeight())/this.getRowHeight()}if(t>0)return Math.floor(t)}return 0},t.prototype.getNoncontentHeight=function(){var e=0;if(this.getHeaderContent()&&!(0,o.isNullOrUndefined)(this.getHeaderContent().clientHeight)&&(e+=this.getHeaderContent().clientHeight),this.toolbar&&!(0,o.isNullOrUndefined)(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!(0,o.isNullOrUndefined)(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!(0,o.isNullOrUndefined)(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),this.aggregates.length>0&&!(0,o.isNullOrUndefined)(this.element.querySelector(".e-summaryrow").clientHeight))for(var t=0;t<this.element.getElementsByClassName("e-summaryrow").length;t++)e+=this.element.getElementsByClassName("e-summaryrow")[parseInt(t.toString(),10)].clientHeight;return e},t.prototype.getSummaryValues=function(e,t){return a.DataUtil.aggregates[e.type.toLowerCase()](t,e.field)},t.prototype.serverExcelExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},t.prototype.serverPdfExport=function(e,t){this.isExcel=!1,this.exportGrid(e,t)},t.prototype.serverCsvExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},t.prototype.exportGrid=function(e,t){var i=this,n=this.getDataModule().generateQuery(!0),r=(new a.UrlAdaptor).processQuery(new a.DataManager({url:""}),n),s=JSON.parse(r.data),o=JSON.parse(this.addOnPersist(["allowGrouping","allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","groupSettings","columns","locale","searchSettings"]));o.filterSettings.columns=s.where,o.searchSettings.fields=s.search&&s.search[0].fields||[],o.sortSettings.columns=s.sorted,o.columns=this.setHeaderText(o.columns,["field","headerText","type","format","visible","foreignKeyValue","foreignKeyField","template","index","width","textAlign","headerTextAlign","columns"]);var l=this.createElement("form",{id:"ExportForm"});l.style.display="none";var h=this.createElement("input",{id:"gridInput",attrs:{name:"gridModel"}});h.value=JSON.stringify(o),l.method="POST",l.action=e,l.appendChild(h),t&&t.headers&&Array.isArray(t.headers)&&t.headers.forEach(function(e){Object.keys(e).forEach(function(t){var n="string"==typeof e[""+t]?e[""+t]:JSON.stringify(e[""+t]),r=i.createElement("input",{attrs:{name:t,value:n,type:"hidden"}});l.appendChild(r)})}),document.body.appendChild(l),l.submit(),l.remove()},t.prototype.setHeaderText=function(e,t){for(var i=0;i<e.length;i++){var n=this.getColumnByUid(e[parseInt(i.toString(),10)].uid);e[parseInt(i.toString(),10)].headerText=n.headerText,(0,o.isNullOrUndefined)(n.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=wh(this.getFormat(e[parseInt(i.toString(),10)].format),e[parseInt(i.toString(),10)].type,!1,o.defaultCurrencyCode),"datetime"!==n.type&&"date"!==n.type&&"time"!==n.type||(e[parseInt(i.toString(),10)].format=e[parseInt(i.toString(),10)].format.toString().replace("AM/PM","tt"))),e[parseInt(i.toString(),10)].columns&&this.setHeaderText(e[parseInt(i.toString(),10)].columns,t);for(var r=Object.keys(e[parseInt(i.toString(),10)]),s=0;s<r.length;s++)t.indexOf(r[parseInt(s.toString(),10)])<0&&delete e[parseInt(i.toString(),10)][r[parseInt(s.toString(),10)]]}return e},t.prototype.getFormat=function(e){return"object"==typeof e?(0,o.isNullOrUndefined)(e.format)?e.skeleton:e.format:e},t.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},t.prototype.updateRowValue=function(e,t){var i={requestType:"save",data:t};this.showSpinner(),this.notify(zt,i),this.refresh()},t.prototype.setForeignKeyData=function(){this.dataBind();var e=this.getDataModule().getForeignKeyDataState();e.isPending?(this.getDataModule().setForeignKeyDataState({}),e.resolver()):(this.getDataModule().setForeignKeyDataState({isDataChanged:!1}),(this.contentModule||this.headerModule)&&this.renderModule.render())},t.prototype.resetFilterDlgPosition=function(e){var t=this.getColumnHeaderByField(e);if(t){var i=t.querySelector(".e-filtermenudiv"),n=this.element.querySelector(".e-filter-popup");if(i){var r=this.element.getBoundingClientRect(),s=i.getBoundingClientRect();n&&(n.offsetWidth+s.right>r.right?n.style.left=(s.right-n.offsetWidth-r.left).toString()+"px":n.style.left=(s.right-r.left).toString()+"px")}}},t.prototype.renderTemplates=function(e){var t=this.parentDetails&&this.parentDetails.parentInstObj&&this.parentDetails.parentInstObj.isReact,i=this.printGridParent&&this.printGridParent.isReact;if((t||i)&&this.portals){var n=i?this.printGridParent:this.parentDetails.parentInstObj;n.portals=n.portals.concat(this.portals),n.renderTemplates(e),this.portals=void 0}else{this.notify("reactTemplateRender",this.portals),this.renderReactTemplates(e)}},t.prototype.batchUpdate=function(e){this.processRowChanges(e)},t.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},t.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=[Ss,vs,Cs],n=this.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)e[i[parseInt(r.toString(),10)]]&&rh(this,e,i[parseInt(r.toString(),10)],n);else this.dataToBeUpdated=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),setTimeout(function(){t.processRowChanges(t.dataToBeUpdated),t.dataToBeUpdated=null},this.asyncTimeOut)},t.prototype.processRowChanges=function(e){var t=this,i=this.getPrimaryKeyFieldNames()[0];e=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e);var n=this.getDataModule().saveChanges(e,i,{},this.getDataModule().generateQuery().requiresCount());this.getDataModule().isRemote()?n.then(function(){t.setNewData()}):this.setNewData()},t.prototype.setNewData=function(){var e=this,t=JSON.parse(JSON.stringify(this.getCurrentViewRecords()));this.getDataModule().getData({},this.getDataModule().generateQuery().requiresCount()).then(function(i){e.bulkRefresh(i.result,t,i.count)})},t.prototype.deleteRowElement=function(e){var t=this.getRowElementByUID(e.uid);(0,o.remove)(t)},t.prototype.bulkRefresh=function(e,t,i){for(var n,r=this,s=this.getRowsObject(),o=this.getPrimaryKeyFieldNames()[0],a=function(t){e.filter(function(e){return e[""+o]===s[parseInt(t.toString(),10)].data[""+o]}).length||(l.deleteRowElement(s[parseInt(t.toString(),10)]),s.splice(t,1),t--),n=t},l=this,h=0;h<s.length;h++)a(h),h=n;var d=function(i){var n;t.filter(function(t){t[""+o]===e[parseInt(i.toString(),10)][""+o]&&(t!==e[parseInt(i.toString(),10)]&&r.setRowData(e[parseInt(i.toString(),10)][""+o],e[parseInt(i.toString(),10)]),n=!0)}),n||p.renderRowElement(e[parseInt(i.toString(),10)],i)},p=this;for(h=0;h<e.length;h++)d(h);this.currentViewData=e;var c=[].slice.call(this.getContentTable().getElementsByClassName(us));th(this,this.getRowsObject(),c),sh(this),this.allowPaging&&this.notify(qe,{module:"pager",properties:{totalRecordsCount:i}})},t.prototype.renderRowElement=function(e,t){var i=new js(this.serviceLocator,null,this),n=new Vs(this).generateRows([e]),r=i.render(n[0],this.getColumns());this.addRowObject(n[0],t);var s=this.getContentTable().querySelector(Ds);if(s.querySelector(".e-emptyrow")){var o=s.querySelector(".e-emptyrow");o.parentNode.removeChild(o),this.frozenRows&&this.element.querySelector(".e-frozenrow-empty")&&this.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}s=this.frozenRows&&t<this.frozenRows?this.getHeaderContent().querySelector(Ds):this.getContent().querySelector(Ds),(s=this.getContent().querySelector(Ds)).appendChild(r)},t.prototype.addRowObject=function(e,t){this.getRowsObject().splice(t,1,e)},t.prototype.updateVisibleExpandCollapseRows=function(){for(var e=this.getRowsObject(),t=0,i=e.length;t<i;t++)(e[parseInt(t.toString(),10)].isDataRow||e[parseInt(t.toString(),10)].isAggregateRow)&&this.getRowElementByUID(e[parseInt(t.toString(),10)].uid)&&"none"===this.getRowElementByUID(e[parseInt(t.toString(),10)].uid).style.display?e[parseInt(t.toString(),10)].visible=!1:e[parseInt(t.toString(),10)].visible=!0},t.prototype.sanitize=function(e){return this.enableHtmlSanitizer?o.SanitizeHtmlHelper.sanitize(e):e},t.prototype.getHeight=function(e){return e=Number.isInteger(e)||-1===e.indexOf("%")?Number.isInteger(e)||"auto"===this.height?this.height:parseInt(e,10):parseInt(e,10)/100*this.element.clientHeight},t.prototype.getFrozenRightContent=function(){return this.contentModule.getPanel()},t.prototype.getFrozenRightHeader=function(){return this.headerModule.getPanel()},t.prototype.getMovableHeaderTbody=function(){return this.getHeaderContent().querySelector(Ds)},t.prototype.getMovableContentTbody=function(){return this.getContent().querySelector(Ds)},t.prototype.getFrozenHeaderTbody=function(){return this.getHeaderContent().querySelector(Ds)},t.prototype.getFrozenLeftContentTbody=function(){return this.getContent().querySelector(Ds)},t.prototype.getFrozenRightHeaderTbody=function(){return this.getHeaderContent().querySelector(Ds)},t.prototype.getFrozenRightContentTbody=function(){return this.getContent().querySelector(Ds)},t.prototype.showResponsiveCustomFilter=function(e){this.filterModule&&this.filterModule.showCustomFilter(e||"Vertical"===this.rowRenderingMode)},t.prototype.showResponsiveCustomSort=function(e){this.sortModule&&this.sortModule.showCustomSort(e||"Vertical"===this.rowRenderingMode)},t.prototype.showResponsiveCustomColumnChooser=function(e){this.columnChooserModule&&this.columnChooserModule.showCustomColumnChooser(e||"Vertical"===this.rowRenderingMode)},t.prototype.showAdaptiveFilterDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomFilter(!0)},t.prototype.showAdaptiveSortDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomSort(!0)},t.prototype.getCurrentVisibleColumns=function(e){for(var t=[],i=0,n=e?this.getColumns():this.columnModel;i<n.length;i++){var r=n[i];r.visible&&t.push(r)}return t},t.prototype.enableInfiniteAggrgate=function(){this.enableInfiniteScrolling&&this.groupSettings.columns.length&&!this.groupSettings.disablePageWiseAggregates&&!this.groupSettings.enableLazyLoading&&this.setProperties({groupSettings:{disablePageWiseAggregates:!0}},!0)},ha([(0,o.Property)([])],t.prototype,"currentViewData",void 0),ha([(0,o.Property)()],t.prototype,"parentDetails",void 0),ha([(0,o.Property)()],t.prototype,"showHider",void 0),ha([(0,o.Property)([])],t.prototype,"columns",void 0),ha([(0,o.Property)(!0)],t.prototype,"enableAltRow",void 0),ha([(0,o.Property)(!0)],t.prototype,"enableHover",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableAutoFill",void 0),ha([(0,o.Property)(!0)],t.prototype,"allowKeyboard",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableStickyHeader",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableHtmlSanitizer",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowTextWrap",void 0),ha([(0,o.Complex)({},va)],t.prototype,"textWrapSettings",void 0),ha([(0,o.Complex)({},Sa)],t.prototype,"resizeSettings",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowPaging",void 0),ha([(0,o.Complex)({},qo)],t.prototype,"pageSettings",void 0),ha([(0,o.Complex)({},ba)],t.prototype,"loadingIndicator",void 0),ha([(0,o.Property)(!0)],t.prototype,"enableVirtualMaskRow",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableVirtualization",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableColumnVirtualization",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableInfiniteScrolling",void 0),ha([(0,o.Complex)({},ma)],t.prototype,"searchSettings",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowSorting",void 0),ha([(0,o.Property)("Ellipsis")],t.prototype,"clipMode",void 0),ha([(0,o.Property)(!0)],t.prototype,"allowMultiSorting",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowExcelExport",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowPdfExport",void 0),ha([(0,o.Complex)({},pa)],t.prototype,"sortSettings",void 0),ha([(0,o.Complex)({},ua)],t.prototype,"infiniteScrollSettings",void 0),ha([(0,o.Property)(!0)],t.prototype,"allowSelection",void 0),ha([(0,o.Property)(-1)],t.prototype,"selectedRowIndex",void 0),ha([(0,o.Complex)({},fa)],t.prototype,"selectionSettings",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowFiltering",void 0),ha([(0,o.Property)("Horizontal")],t.prototype,"rowRenderingMode",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableAdaptiveUI",void 0),ha([(0,o.Property)("Both")],t.prototype,"adaptiveUIMode",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowReordering",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableRowSpan",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableColumnSpan",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowResizing",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowRowDragAndDrop",void 0),ha([(0,o.Complex)({},ya)],t.prototype,"rowDropSettings",void 0),ha([(0,o.Complex)({},ga)],t.prototype,"filterSettings",void 0),ha([(0,o.Property)(!1)],t.prototype,"allowGrouping",void 0),ha([(0,o.Property)(!1)],t.prototype,"enableImmutableMode",void 0),ha([(0,o.Property)(!1)],t.prototype,"showColumnMenu",void 0),ha([(0,o.Property)(!1)],t.prototype,"autoFit",void 0),ha([(0,o.Complex)({},Ca)],t.prototype,"groupSettings",void 0),ha([(0,o.Complex)({},wa)],t.prototype,"editSettings",void 0),ha([(0,o.Collection)([],Yo)],t.prototype,"aggregates",void 0),ha([(0,o.Property)(!1)],t.prototype,"showColumnChooser",void 0),ha([(0,o.Complex)({},jo)],t.prototype,"columnChooserSettings",void 0),ha([(0,o.Property)(!0)],t.prototype,"enableHeaderFocus",void 0),ha([(0,o.Property)("auto")],t.prototype,"height",void 0),ha([(0,o.Property)("auto")],t.prototype,"width",void 0),ha([(0,o.Property)("Default")],t.prototype,"gridLines",void 0),ha([(0,o.Property)()],t.prototype,"rowTemplate",void 0),ha([(0,o.Property)()],t.prototype,"emptyRecordTemplate",void 0),ha([(0,o.Property)()],t.prototype,"detailTemplate",void 0),ha([(0,o.Property)()],t.prototype,"childGrid",void 0),ha([(0,o.Property)()],t.prototype,"queryString",void 0),ha([(0,o.Property)("AllPages")],t.prototype,"printMode",void 0),ha([(0,o.Property)("Expanded")],t.prototype,"hierarchyPrintMode",void 0),ha([(0,o.Property)([])],t.prototype,"dataSource",void 0),ha([(0,o.Property)(null)],t.prototype,"rowHeight",void 0),ha([(0,o.Property)()],t.prototype,"query",void 0),ha([(0,o.Property)("USD")],t.prototype,"currencyCode",void 0),ha([(0,o.Property)()],t.prototype,"exportGrids",void 0),ha([(0,o.Property)()],t.prototype,"toolbar",void 0),ha([(0,o.Property)()],t.prototype,"contextMenuItems",void 0),ha([(0,o.Property)()],t.prototype,"columnMenuItems",void 0),ha([(0,o.Property)()],t.prototype,"toolbarTemplate",void 0),ha([(0,o.Property)()],t.prototype,"pagerTemplate",void 0),ha([(0,o.Property)(0)],t.prototype,"frozenRows",void 0),ha([(0,o.Property)(0)],t.prototype,"frozenColumns",void 0),ha([(0,o.Property)("")],t.prototype,"cssClass",void 0),ha([(0,o.Property)("All")],t.prototype,"columnQueryMode",void 0),ha([(0,o.Property)({})],t.prototype,"currentAction",void 0),ha([(0,o.Property)("")],t.prototype,"ej2StatePersistenceVersion",void 0),ha([(0,o.Property)(null)],t.prototype,"isRowSelectable",void 0),ha([(0,o.Event)()],t.prototype,"isRowPinned",void 0),ha([(0,o.Event)()],t.prototype,"created",void 0),ha([(0,o.Event)()],t.prototype,"destroyed",void 0),ha([(0,o.Event)()],t.prototype,"load",void 0),ha([(0,o.Event)()],t.prototype,"rowDataBound",void 0),ha([(0,o.Event)()],t.prototype,"queryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"headerCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"actionBegin",void 0),ha([(0,o.Event)()],t.prototype,"actionComplete",void 0),ha([(0,o.Event)()],t.prototype,"actionFailure",void 0),ha([(0,o.Event)()],t.prototype,"dataBound",void 0),ha([(0,o.Event)()],t.prototype,"recordDoubleClick",void 0),ha([(0,o.Event)()],t.prototype,"recordClick",void 0),ha([(0,o.Event)()],t.prototype,"rowSelecting",void 0),ha([(0,o.Event)()],t.prototype,"rowSelected",void 0),ha([(0,o.Event)()],t.prototype,"rowDeselecting",void 0),ha([(0,o.Event)()],t.prototype,"rowDeselected",void 0),ha([(0,o.Event)()],t.prototype,"cellSelecting",void 0),ha([(0,o.Event)()],t.prototype,"cellSelected",void 0),ha([(0,o.Event)()],t.prototype,"cellDeselecting",void 0),ha([(0,o.Event)()],t.prototype,"cellDeselected",void 0),ha([(0,o.Event)()],t.prototype,"columnSelecting",void 0),ha([(0,o.Event)()],t.prototype,"columnSelected",void 0),ha([(0,o.Event)()],t.prototype,"columnDeselecting",void 0),ha([(0,o.Event)()],t.prototype,"columnDeselected",void 0),ha([(0,o.Event)()],t.prototype,"columnDragStart",void 0),ha([(0,o.Event)()],t.prototype,"columnDrag",void 0),ha([(0,o.Event)()],t.prototype,"columnDrop",void 0),ha([(0,o.Event)()],t.prototype,"printComplete",void 0),ha([(0,o.Event)()],t.prototype,"beforePrint",void 0),ha([(0,o.Event)()],t.prototype,"pdfQueryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"pdfHeaderQueryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"pdfAggregateQueryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"excelAggregateQueryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"exportDetailDataBound",void 0),ha([(0,o.Event)()],t.prototype,"exportDetailTemplate",void 0),ha([(0,o.Event)()],t.prototype,"excelQueryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"excelHeaderQueryCellInfo",void 0),ha([(0,o.Event)()],t.prototype,"beforeExcelExport",void 0),ha([(0,o.Event)()],t.prototype,"excelExportComplete",void 0),ha([(0,o.Event)()],t.prototype,"beforePdfExport",void 0),ha([(0,o.Event)()],t.prototype,"pdfExportComplete",void 0),ha([(0,o.Event)()],t.prototype,"rowDragStartHelper",void 0),ha([(0,o.Event)()],t.prototype,"detailDataBound",void 0),ha([(0,o.Event)()],t.prototype,"detailExpand",void 0),ha([(0,o.Event)()],t.prototype,"detailCollapse",void 0),ha([(0,o.Event)()],t.prototype,"rowDragStart",void 0),ha([(0,o.Event)()],t.prototype,"rowDrag",void 0),ha([(0,o.Event)()],t.prototype,"rowDrop",void 0),ha([(0,o.Event)()],t.prototype,"toolbarClick",void 0),ha([(0,o.Event)()],t.prototype,"beforeOpenColumnChooser",void 0),ha([(0,o.Event)()],t.prototype,"beforeOpenAdaptiveDialog",void 0),ha([(0,o.Event)()],t.prototype,"batchAdd",void 0),ha([(0,o.Event)()],t.prototype,"batchDelete",void 0),ha([(0,o.Event)()],t.prototype,"batchCancel",void 0),ha([(0,o.Event)()],t.prototype,"beforeBatchAdd",void 0),ha([(0,o.Event)()],t.prototype,"beforeBatchDelete",void 0),ha([(0,o.Event)()],t.prototype,"beforeBatchSave",void 0),ha([(0,o.Event)()],t.prototype,"beginEdit",void 0),ha([(0,o.Event)()],t.prototype,"commandClick",void 0),ha([(0,o.Event)()],t.prototype,"cellEdit",void 0),ha([(0,o.Event)()],t.prototype,"cellSave",void 0),ha([(0,o.Event)()],t.prototype,"cellSaved",void 0),ha([(0,o.Event)()],t.prototype,"resizeStart",void 0),ha([(0,o.Event)()],t.prototype,"resizing",void 0),ha([(0,o.Event)()],t.prototype,"resizeStop",void 0),ha([(0,o.Event)()],t.prototype,"keyPressed",void 0),ha([(0,o.Event)()],t.prototype,"beforeDataBound",void 0),ha([(0,o.Event)()],t.prototype,"contextMenuOpen",void 0),ha([(0,o.Event)()],t.prototype,"contextMenuClick",void 0),ha([(0,o.Event)()],t.prototype,"contextMenuClose",void 0),ha([(0,o.Event)()],t.prototype,"columnMenuOpen",void 0),ha([(0,o.Event)()],t.prototype,"columnMenuClick",void 0),ha([(0,o.Event)()],t.prototype,"columnMenuClose",void 0),ha([(0,o.Event)()],t.prototype,"checkBoxChange",void 0),ha([(0,o.Event)()],t.prototype,"beforeCopy",void 0),ha([(0,o.Event)()],t.prototype,"beforePaste",void 0),ha([(0,o.Event)()],t.prototype,"beforeAutoFill",void 0),ha([(0,o.Event)()],t.prototype,"columnDataStateChange",void 0),ha([(0,o.Event)()],t.prototype,"dataStateChange",void 0),ha([(0,o.Event)()],t.prototype,"dataSourceChanged",void 0),ha([(0,o.Event)()],t.prototype,"exportGroupCaption",void 0),ha([(0,o.Event)()],t.prototype,"lazyLoadGroupExpand",void 0),ha([(0,o.Event)()],t.prototype,"lazyLoadGroupCollapse",void 0),ha([(0,o.Event)()],t.prototype,"beforeDetailTemplateDetach",void 0),ha([(0,o.Event)()],t.prototype,"beforeCustomFilterOpen",void 0),t=n=ha([o.NotifyPropertyChanges],t)}(o.Component);function xa(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound","enableHtmlSanitizer"]}var Ra=function(){function e(e,t){this.isAsyncPrint=!1,this.defered=new a.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on(Ne,this.isContentReady(),this),this.actionBeginFunction=this.actionBegin.bind(this),this.parent.addEventListener(R,this.actionBeginFunction),this.parent.on(ze,this.onEmpty.bind(this)),this.parent.on(Ni,this.hierarchyPrint,this),this.scrollModule=t)}return e.prototype.isContentReady=function(){var e=this;return!this.isPrintGrid()||"None"!==this.parent.hierarchyPrintMode&&this.parent.childGrid?function(){e.defered.promise.then(function(){e.contentReady()}),e.isPrintGrid()&&e.hierarchyPrint()}:this.contentReady},e.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},e.prototype.print=function(){this.renderPrintGrid()},e.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},e.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},e.prototype.renderPrintGrid=function(){var e=this.parent,t=(0,o.createElement)("div",{id:this.parent.element.id+"_print",className:e.element.className+" e-print-grid"});t.classList.remove("e-gridhover"),document.body.appendChild(t);for(var i=new Ia(Nl(e,e.hierarchyPrintMode)),n=0;n<i.columns.length;n++)i.columns[parseInt(n.toString(),10)]=(0,o.extend)({},i.columns[parseInt(n.toString(),10)]),!e.getFrozenColumns()&&e.isFrozenGrid()&&(i.columns[parseInt(n.toString(),10)].freeze=void 0);this.parent.isAngular&&(i.viewContainerRef=this.parent.viewContainerRef),i.load=function(){},i.query=e.getQuery().clone(),window.printGridObj=i,i.isPrinting=!0;var r=i.getInjectedModules(),s=e.getInjectedModules();r&&r.length===s.length||i.setInjectedModules(s),e.notify(zi,{element:t,printgrid:i}),this.parent.log("exporting_begin",this.getModuleName()),i.registeredTemplate=this.parent.registeredTemplate,i.isVue=this.parent.isVue,this.parent.isVue&&(i.vueInstance=this.parent.vueInstance),i.printGridParent=e,i.appendTo(t),e.isVue3||(i.trigger=e.trigger)},e.prototype.contentReady=function(){var e=this;if(this.isPrintGrid()){var t=this.parent;if(this.isAsyncPrint)return void this.printGrid();var i={requestType:"print",element:t.element,selectedRows:t.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:t.hierarchyPrintMode};if(this.isAsyncPrint||t.trigger(Q,i),i.cancel)return void(0,o.detach)(t.element);this.isAsyncPrint||(this.parent.printGridParent&&this.parent.printGridParent.isReact?this.parent.printGridParent.renderTemplates(function(){e.printGrid()}):this.printGrid())}},e.prototype.printGrid=function(){var e=this.parent;if("auto"!==e.height){var t=this.scrollModule.getCssProperties(),i=e.element.querySelector("."+ps),n=e.element.querySelector("."+ns);i.style.height="auto",i.style.overflowY="auto",n.style[t.padding]="",n.firstElementChild.style[t.border]=""}e.allowGrouping&&(e.groupSettings.columns.length?this.removeColGroup(e):e.element.querySelector(".e-groupdroparea").style.display="none");for(var r=0,s=[].slice.call(e.element.getElementsByClassName(ps));r<s.length;r++){(d=s[r]).style.overflowX="hidden"}for(var a=[].slice.call(e.element.getElementsByClassName("e-spin-show")),l=0,h=[].slice.call(a);l<h.length;l++){var d=h[l];(0,o.classList)(d,["e-spin-hide"],["e-spin-show"])}this.printGridElement(e),e.isPrinting=!1,delete window.printGridObj;var p={element:e.element};e.trigger(X,p),e.destroy(),this.parent.log("exporting_complete",this.getModuleName())},e.prototype.printGridElement=function(e){(0,o.classList)(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&(0,o.detach)(e.element),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),(0,o.isNullOrUndefined)(this.printWind)||(this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight),this.printWind=(0,o.print)(e.element,this.printWind))},e.prototype.removeColGroup=function(e){var t=e.groupSettings.columns.length,i=e.element,n="#"+e.element.id;if(t){for(var r=(0,o.selectAll)(".e-groupcaption",i),s=e.groupSettings.enableLazyLoading?(parseInt(r[0].getAttribute("colspan"),10)-(e.groupSettings.columns.length-1)).toString():r[t-1].getAttribute("colspan"),a=0;a<r.length;a++)r[parseInt(a.toString(),10)].setAttribute("colspan",s);var l=(0,o.selectAll)("colgroup"+n+"colgroup",i),h=(0,o.selectAll)(".e-content colgroup",i),d=(0,o.selectAll)(".e-summarycontent colgroup",i);this.hideColGroup(l,t),this.hideColGroup(h,t),this.hideColGroup(d,t)}},e.prototype.hideColGroup=function(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<t;n++)e[parseInt(i.toString(),10)].children[parseInt(n.toString(),10)].style.display="none"},e.prototype.isPrintGrid=function(){return this.parent.element.id.indexOf("_print")>0&&this.parent.isPrinting},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Ne,this.contentReady.bind(this)),this.parent.removeEventListener(R,this.actionBeginFunction),this.parent.off(ze,this.onEmpty.bind(this)),this.parent.off(Ni,this.hierarchyPrint))},e.prototype.getModuleName=function(){return"print"},e.printGridProp=["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound","enableHtmlSanitizer"].concat([Q,X,C]),e}();function Da(e,t){return e.prototype&&t in e.prototype}function Ta(e,t,i){return(0,o.isNullOrUndefined)(e)||""===e?"":a.DataUtil.getObject(e,t)}function Ea(e,t){return(0,o.isNullOrUndefined)(e)||""===e?"":a.DataUtil.getObject(e,t)}function Oa(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function ka(e){return!(0,o.isNullOrUndefined)(e)&&!(0,o.isNullOrUndefined)(e.columns)&&e.columns.length>0}function Aa(e,t){for(var i=e.columns,n=t.columns,r=0;r<i.length;r++)if(n.length-1>=r)if(n[parseInt(r.toString(),10)].columns)for(var s=0;s<n[parseInt(r.toString(),10)].columns.length;s++)i[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)].type=n[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)].type;else i[parseInt(r.toString(),10)].type=n[parseInt(r.toString(),10)].type}function Fa(e){for(var t=[],i=e.vRows,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].isDataRow?t.push(i[parseInt(n.toString(),10)]):i[parseInt(n.toString(),10)].isDataRow||(t.push(i[parseInt(n.toString(),10)]),!i[parseInt(n.toString(),10)].isExpand&&i[parseInt(n.toString(),10)].isCaptionRow&&(n+=La(i[parseInt(n.toString(),10)],e)));e.vcRows=t}var Ma=0;function La(e,t){Ma=0;var i="gSummary",n=t.groupSettings.columns.length,r="records",s="items",a=e[""+i],l=0,h="aggregatesCount";if(a===e.data.count)return t.groupSettings.columns.length&&!(0,o.isNullOrUndefined)(e[""+h])&&e[""+h]?1!==t.groupSettings.columns.length?Ma+=0!==e.indent&&a<2?e[""+i]*(n-e.indent+(n-e.indent)*e[""+h]):e[""+i]*(n-e.indent+(n-e.indent-1)*e[""+h])+e[""+h]:1===t.groupSettings.columns.length&&(Ma+=e[""+i]*(n-e.indent)+e[""+h]):t.groupSettings.columns.length&&(1!==t.groupSettings.columns.length?Ma+=e[""+i]*(t.groupSettings.columns.length-e.indent):Ma+=e[""+i]),Ma;for(var d=0,p=e.data[""+s].length;d<p;d++){var c=e.data[""+s][parseInt(d.toString(),10)];Ma+=c[""+s].length+(n===t.columns.length||(0,o.isNullOrUndefined)(c[""+s][""+r])?0:c[""+s][""+r].length),l+=(0,o.isNullOrUndefined)(c[""+s][""+r])||(0,o.isNullOrUndefined)(e[""+h])?c[""+s].length:c[""+s][""+r].length,c[""+s].GroupGuid&&0!==c[""+s].childLevels&&Pa(c)}return Ma+=e.data[""+s].length,(0,o.isNullOrUndefined)(e[""+h])||e[""+h]&&Ma&&0!==l&&(Ma+=(Ma-l)*e[""+h]+e[""+h]),Ma}function Pa(e){for(var t="items",i=0,n=e[""+t].length;i<n;i++){var r=e[""+t][parseInt(i.toString(),10)];Ma+=r.count,0!==r[""+t].childLevels&&Pa(r)}}function Na(e,t){for(var i=[],n=0,r=e.length;n<r;n++){var s=t(e[parseInt(n.toString(),10)],n);(0,o.isNullOrUndefined)(s)||i.push(s)}return i}function Ba(e){for(var t=[],i=0;i<e.length;i++)t.push((0,o.extend)({},Ga(e[parseInt(i.toString(),10)]),{},!0));return t}function za(e){if(e)try{var t="<"!==e[0];return"function"==typeof e?(0,o.compile)(e):t&&document.querySelectorAll(e).length?(0,o.compile)(document.querySelector(e).innerHTML.trim()):(0,o.compile)(e)}catch(t){return(0,o.compile)(e)}}function qa(e,t){var i={},n=["style","class"];(0,o.extend)(i,t,{}),"style"in i&&((0,o.setStyleAttribute)(e,i[n[0]]),delete i[n[0]]),"class"in i&&((0,o.addClass)([e],i[n[1]]),delete i[n[1]]),(0,o.attributes)(e,i)}function Ua(e,t,i,n){for(var r=(0,o.extend)(e,t,i),s=Object.keys(r),a=0;a<s.length;a++)n&&-1!==n.indexOf(s[parseInt(a.toString(),10)])&&delete r[s[parseInt(a.toString(),10)]];return r}function Ha(e,t){void 0===t&&(t=0);for(var i=0,n=(0,o.isNullOrUndefined)(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?(e[parseInt(i.toString(),10)].index=(0,o.isNullOrUndefined)(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++,t=Ha(e[parseInt(i.toString(),10)].columns,t)):(e[parseInt(i.toString(),10)].index=(0,o.isNullOrUndefined)(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++);return t}function ja(e,t,i){for(var n=0,r=(0,o.isNullOrUndefined)(e)?0:e.length;n<r;n++){var s=void 0;"string"==typeof e[parseInt(n.toString(),10)]?s=new p({field:e[parseInt(n.toString(),10)]},i):e[parseInt(n.toString(),10)]instanceof p&&!e[parseInt(n.toString(),10)].columns?s=e[parseInt(n.toString(),10)]:e[parseInt(n.toString(),10)].columns?(e[parseInt(n.toString(),10)].columns=ja(e[parseInt(n.toString(),10)].columns,null,i),s=new p(e[parseInt(n.toString(),10)],i)):s=new p(e[parseInt(n.toString(),10)],i),s.type&&"checkbox"===s.type.toLowerCase()&&(s.allowReordering=!1),s.headerText=(0,o.isNullOrUndefined)(s.headerText)?s.foreignKeyValue||s.field||"":s.headerText,s.foreignKeyField=s.foreignKeyField||s.field,s.valueAccessor=("string"==typeof s.valueAccessor?(0,o.getValue)(s.valueAccessor,window):s.valueAccessor)||Ta,s.headerValueAccessor="string"==typeof s.headerValueAccessor?(0,o.getValue)(s.headerValueAccessor,window):s.headerValueAccessor,s.width=t&&(0,o.isNullOrUndefined)(s.width)?200:s.width,(0,o.isNullOrUndefined)(s.visible)&&(s.visible=!0),e[parseInt(n.toString(),10)]=s}return e}function Va(e,t,i){var n=e.querySelector("span"),r=e.parentElement.getBoundingClientRect(),s=t.target.getBoundingClientRect();n.className=i,e.style.display="";var a=((0,o.isNullOrUndefined)(t.clientY)?t.changedTouches[0].clientY:t.clientY)>e.offsetHeight+10;e.style.top=s.top-r.top+(a?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=function(e,t,i,n){var r=e.offsetWidth/2,s=Ya(t).x;return s-i.left<r?i.left-n:i.right-s<r?i.right-n-2*r:s-n-r}(e,t,s,r.left)+"px",a?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function Ga(e){return e instanceof o.ChildProperty?(0,o.getValue)("properties",e):e}function _a(e,t,i){for(var n=e;n&&!(i?n.id===t:n.classList.contains(t));)n=n.parentElement;return n}function Ka(e,t){for(var i=-1,n=0,r=t.length;n<r;n++)if(t[parseInt(n.toString(),10)].isEqualNode(e)){i=n;break}return i}function Wa(e,t){for(var i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)]===e)return i;return-1}function Qa(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].hasOwnProperty("properties")?t.push(e[parseInt(i.toString(),10)].properties):t.push(e[parseInt(i.toString(),10)]);return t}function Xa(e,t){for(var i=[].slice.call(e.querySelectorAll(t)),n=0;n<i.length;n++)(0,o.remove)(i[parseInt(n.toString(),10)])}function Ya(e){var t={};return t.x=(0,o.isNullOrUndefined)(e.clientX)?e.changedTouches[0].clientX:e.clientX,t.y=(0,o.isNullOrUndefined)(e.clientY)?e.changedTouches[0].clientY:e.clientY,t}var Ja=0;function Za(e){return e+Ja++}function $a(e,t){for(var i=0,n=t.length;i<n;i++)n===t.length?e.appendChild(t[parseInt(i.toString(),10)]):e.appendChild(t[0]);return e}function el(e,t,i){for(var n=e,r=[];n;)(i?n.id===t:n.classList.contains(t))&&r.push(n),n=n.parentElement;return r}function tl(e,t,i,n){if("Custom"===e){var r=i.customAggregate;return"string"==typeof r&&(r=(0,o.getValue)(r,window)),r?r.call(n,t,i):""}return i.field in t||t instanceof Array?a.DataUtil.aggregates[e.toLowerCase()](t,i.field):null}var il,nl,rl,sl=null;function ol(e){if(null!==sl&&!e)return sl;var t,i=document.createElement("div");return i.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(i),t=i.offsetWidth-i.clientWidth|0,document.body.removeChild(i),sl=t}function al(e,t){if(t&&void 0!==nl)return nl;if(void 0!==il)return il;var i=(0,o.createElement)("table",{className:cs,attrs:{role:"grid"}});i.style.visibility="hidden",i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i);var n=i.querySelector("td").getBoundingClientRect();return e.removeChild(i),nl=n.height,il=Math.ceil(n.height),t?nl:il}function ll(e){var t=(0,o.createElement)("table",{className:cs,attrs:{role:"grid"}});t.style.visibility="hidden",t.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(t);var i=t.querySelector("tr").getBoundingClientRect();return e.removeChild(t),i.height}function hl(e){return e.split(".").length>1}function dl(e){return void 0===e&&(e=""),e.replace(/\./g,"___")}function pl(e){return void 0===e&&(e=""),e.replace(/[^a-zA-Z0-9_.]/g,"\\$&")}function cl(e){return void 0===e&&(e=""),e.replace(/___/g,".")}function ul(e,t,i){var n=_a(i,us),r=!n||n&&!n.classList.contains("e-insertedrow");return"beginEdit"===t&&r?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):("add"!==t||!e.isIdentity)&&!(r&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function gl(e,t){return!(!t||!t.element||0!==t.element.offsetWidth)||0!==e.getBoundingClientRect().width}function fl(e){var t=(0,o.select)("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&((0,o.selectAll)(".e-updatedtd",e.element).length||(0,o.selectAll)(".e-gridform.e-formvalidator",e.element).length)&&e.editSettings.showConfirmDialog&&(!t||t.classList.contains("e-popup-close"))}function ml(e,t){var i="e-wrap";e=e instanceof Array?e:[e];for(var n=0;n<e.length;n++)t?e[parseInt(n.toString(),10)].classList.add(i):e[parseInt(n.toString(),10)].classList.remove(i)}function yl(e,t){var i,n=e.getService("valueFormatter");switch("date"!==t.type&&"datetime"!==t.type&&"dateonly"!==t.type||(i={type:"dateonly"===t.type?"date":t.type,skeleton:t.format},"string"==typeof t.format&&"yMd"!==t.format&&(i.format=t.format)),t.type){case"date":case"dateonly":case"datetime":t.setFormatter(n.getFormatFunction(i)),t.setParser(n.getParserFunction(i));break;case"number":t.setFormatter(n.getFormatFunction({format:t.format})),t.setParser(n.getParserFunction({format:t.format}))}}function vl(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];for(var r=0,s=e.length;r<s;r++){var a=e[parseInt(r.toString(),10)];t?((0,o.classList)(a,i.slice(),[]),a.classList.contains("e-detailrowcollapse")||a.classList.contains("e-detailrowexpand")||a.setAttribute("aria-selected","true")):((0,o.classList)(a,[],i.slice()),a.removeAttribute("aria-selected"))}}function Sl(e){for(var t={},i=[],n=0;n<e.length;n++)e[parseInt(n.toString(),10)]in t||(i.push(e[parseInt(n.toString(),10)].toString()),t[e[parseInt(n.toString(),10)]]=1);return i}function Cl(e,t,i){var n=t.element.style.display;t.element.style.display="block";var r=t.width,s=(0,y.calculateRelativeBasedPosition)(e,t.element);t.element.style.display=n,t.element.style.top=s.top+e.getBoundingClientRect().height-5+"px";var o=s.left-r+e.clientWidth;if(i&&i.enableRtl){var a=i.element?i.element.clientWidth:0,l=e.getBoundingClientRect().right+r-a;t.element.style.left=l>1?o-4+"px":r+o-16+"px",parseInt(t.element.style.left,10)<0&&(t.element.style.left="0px")}else if(t.element.style.left=o<1?r+o-16+"px":o-4+"px",i&&i.element){var h=i.element.offsetWidth-parseInt(t.element.style.left,10);i.element.offsetWidth>=r&&h<r&&(t.element.style.left=i.element.offsetWidth-r+"px")}}function wl(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function bl(e,t,i,n,r,s){if((0,o.isNullOrUndefined)(i.filterTemplate)){var a="";"string"===n?a="strui-"+t:"number"===n?a="numberui-"+t:"boolean"===n?a="bool-ui-"+t:"date"!==n&&"datetime"!==n||(a="dateui-"+t);var l="in"===e||"notin"===e,h=_a(r.element.querySelector("#multiselect"+a),"e-control-wrapper"),d=_a(r.element.querySelector("#"+a),"e-popup-flmenu");h&&(h.style.display=l?"inline-flex":"none"),d&&(d.style.display=l?"none":"inline-flex")}}function Il(e){var t=e.querySelector(".e-frame"),i=t.previousSibling;t.classList.contains("e-check")?(i.checked=!1,(0,o.classList)(t,["e-uncheck"],["e-check"])):(i.checked=!0,(0,o.classList)(t,["e-check"],["e-uncheck"]))}function xl(e,t){e.checked=t}function Rl(e,t,i){var n=(0,o.createElement)("div",{className:i});return n.appendChild(t),n.setAttribute("data-uid",e),n}function Dl(e,t){(0,o.removeClass)([e],["e-check","e-stop","e-uncheck"]),t?e.classList.add("e-check"):e.classList.add("e-uncheck")}function Tl(e,t,i){for(var n=0;n<((0,o.isNullOrUndefined)(t)?0:t.length);n++)(0,o.setValue)(t[parseInt(n.toString(),10)].field,El(t[parseInt(n.toString(),10)],i),e.foreignKeyData);var r=e.cells;for(n=0;n<r.length;n++)r[parseInt(n.toString(),10)].isForeignKey&&(0,o.setValue)("foreignKeyData",(0,o.getValue)(r[parseInt(n.toString(),10)].column.field,e.foreignKeyData),r[parseInt(n.toString(),10)])}function El(e,t,i,n){var r=e.foreignKeyField,s=(0,o.isNullOrUndefined)(i)?Ta(e.field,t):i;s=(0,o.isNullOrUndefined)(s)?"":s;var l=new a.Query,h=n||(e.dataSource instanceof a.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return s.getDay?l.where(Al({field:r,operator:"equal",value:s,matchCase:!1})):l.where(r,"==",s,!1),new a.DataManager(h).executeLocal(l)}function Ol(e,t){var i;return t.some(function(t){return i=t,t.foreignKeyValue===e})&&i}function kl(e){return e<10?"0"+e:String(e)}function Al(e,t){var i,n,r,s=(0,o.extend)({},Ga(e)),l=(0,o.extend)({},Ga(e));if((0,o.isNullOrUndefined)(e.value)||""===e.value)return i=new a.Predicate(s.field,s.operator,s.value,!1);var h=new Date(e.value);if("dateonly"===t){if("string"==typeof s.value){var d=s.value.split(/[^0-9.]/);s.value=new Date(parseInt(d[0],10),parseInt(d[1],10)-1,parseInt(d[2],10))}var p=s.value.getFullYear()+"-"+kl(s.value.getMonth()+1)+"-"+kl(s.value.getDate());i=new a.Predicate(s.field,s.operator,p,!1)}else if(e.operator=e.operator.toLowerCase(),"equal"===e.operator||"notequal"===e.operator){"datetime"===t?(n=new Date(h.setSeconds(h.getSeconds()-1)),r=new Date(h.setSeconds(h.getSeconds()+2)),e.value=new Date(h.setSeconds(r.getSeconds()-1))):(n=new Date(h.setHours(0)-1),r=new Date(h.setHours(24))),s.value=n,l.value=r,"equal"===e.operator?(s.operator="greaterthan",l.operator="lessthan"):"notequal"===e.operator&&(s.operator="lessthanorequal",l.operator="greaterthanorequal");var c=new a.Predicate(s.field,s.operator,s.value,!1),u=new a.Predicate(l.field,l.operator,l.value,!1);i="equal"===e.operator?c.and(u):c.or(u)}else{"date"!==t||"lessthanorequal"!==e.operator&&"greaterthan"!==e.operator||(s.value=new Date(h.setHours(24)-1)),"string"==typeof s.value&&(s.value=new Date(s.value)),i=new a.Predicate(s.field,s.operator,s.value,!1)}return e.setProperties?e.setProperties({ejpredicate:i},!0):e.ejpredicate=i,i}function Fl(e){return e.enableVirtualization&&e.groupSettings.columns.length>0&&e.isVirtualAdaptive&&!e.groupSettings.enableLazyLoading}function Ml(e,t){if(void 0===e&&(e=""),e){for(var i=t,n=e.split("."),r=0;r<n.length&&!(0,o.isNullOrUndefined)(i);r++)if(i=i[n[parseInt(r.toString(),10)]],(0,o.isUndefined)(i)){var s=n[parseInt(r.toString(),10)].charAt(0).toUpperCase()+n[parseInt(r.toString(),10)].slice(1);i=t[""+s]||t[(""+s).charAt(0).toLowerCase()+(""+s).slice(1)]}return i}}function Ll(e,t){var i=new o.Internationalization,n="format",r="type";return"date"===t?"object"==typeof e?i.getDatePattern({type:e[""+r]?e[""+r]:"date",format:e[""+n]},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1):"object"==typeof e?i.getDatePattern({type:e[""+r]?e[""+r]:"dateTime",format:e[""+n]},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1)}function Pl(e,t){for(var i={},n=0,r=e.getRowsObject();n<r.length;n++){var s=r[n];if(s.isExpand&&!s.isDetailRow){var a=e.allowPaging&&"AllPages"===e.printMode?s.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:s.index;(0,o.isNullOrUndefined)(a)||(i[parseInt(a.toString(),10)]={},i[parseInt(a.toString(),10)].isExpand=!0,e.childGrid&&(i[parseInt(a.toString(),10)].gridModel=Nl(s.childGrid,t),i[parseInt(a.toString(),10)].gridModel.query=e.childGrid.query))}}return i}function Nl(e,t){void 0===t&&(t="Expanded");var i={};if(!e)return i;for(var n=0,r=Ra.printGridProp;n<r.length;n++){var s=r[n];i[""+s]="columns"===s?Qa(e[""+s]):"allowPaging"===s?"CurrentPage"===e.printMode:Ga(e[""+s])}return i.enableHover=!1,(e.childGrid||e.detailTemplate)&&"None"!==t&&(i.expandedRows=Pl(e,t)),i}function Bl(e,t,i,n){var r=e||{},s=arguments.length;n&&(s-=1);for(var a=1;a<s;a++)if(arguments[parseInt(a.toString(),10)])for(var l=arguments[parseInt(a.toString(),10)],h=Object.keys(Object.getPrototypeOf(l)).length?Object.keys(l).concat(zl(l)):Object.keys(l),d=0;d<h.length;d++){var p=r[h[parseInt(d.toString(),10)]],c=l[h[parseInt(d.toString(),10)]],u=void 0;n&&((0,o.isObject)(c)||Array.isArray(c))?(0,o.isObject)(c)?(u=p||{},r[h[parseInt(d.toString(),10)]]=(0,o.extend)({},u,c,n)):(u=p||[],r[h[parseInt(d.toString(),10)]]=(0,o.extend)([],u,c,n)):r[h[parseInt(d.toString(),10)]]=c}return r}function zl(e){for(var t=[];Object.getPrototypeOf(e)&&Object.keys(Object.getPrototypeOf(e)).length;)t=t.concat(Object.keys(Object.getPrototypeOf(e))),e=Object.getPrototypeOf(e);return t}function ql(e){for(var t=0,i=0;i<((0,o.isNullOrUndefined)(e)?0:e.length);i++){var n=Ul(e[parseInt(i.toString(),10)],0);t<n&&(t=n)}return t+1}function Ul(e,t){var i=t,n=[];if(e.columns){t++;for(var r=0;r<e.columns.length;r++)n[parseInt(r.toString(),10)]=Ul(e.columns[parseInt(r.toString(),10)],t);for(var s=0;s<n.length;s++)i<n[parseInt(s.toString(),10)]&&(i=n[parseInt(s.toString(),10)]);t=i}return t}function Hl(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].uid=t[parseInt(i.toString(),10)].isForeignKey?Ol(t[parseInt(i.toString(),10)].field,e.getForeignKeyColumns()).uid:e.enableColumnVirtualization?Eh(e,t[parseInt(i.toString(),10)].field).uid:e.getColumnByField(t[parseInt(i.toString(),10)].field).uid}function jl(e){var t=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(t.split(" ")[4]),height:parseFloat(t.split(" ")[5])}}function Vl(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function Gl(e){var t=e.getContent().firstElementChild;return t.scrollWidth>t.offsetWidth?ol():0}function _l(e,t){var i=0,n=e.getColumns(),r=30*t;e.isRowDragable()&&(i++,r+=30),i+=e.groupSettings.columns.length-t,r+=30*(e.groupSettings.columns.length-t);for(var s=("auto"===e.width?e.element.offsetWidth:-1!==e.width.toString().indexOf("%")?e.element.getBoundingClientRect().width:parseInt(e.width.toString(),10))-Gl(e),o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].visible&&(r+=Wl(n[parseInt(o.toString(),10)],e),i++),r>s){i--;break}return i}function Kl(e,t){for(var i=0,n=0,r=t.getVisibleFrozenLeftCount(),s=0;s<e.childNodes.length;s++){var o=e.childNodes[parseInt(s.toString(),10)];if(r===n)break;if((o.classList.contains("e-groupcaption")||o.classList.contains("e-summarycell"))&&(n+=parseInt(o.getAttribute("colspan"),10)),o.classList.add("e-leftfreeze"),o.classList.contains("e-groupcaption")&&1===parseInt(o.getAttribute("colspan"),10)&&o.classList.add("e-freezeleftborder"),gh(o,i,t.enableRtl,"Left"),(o.classList.contains("e-indentcell")||o.classList.contains("e-recordplusexpand")||o.classList.contains("e-recordpluscollapse"))&&(i+=30),o.classList.contains("e-groupcaption")){var a=parseInt(o.getAttribute("colspan"),10);t.isRowDragable()&&(a--,i+=30),a-=t.groupSettings.columns.length-s,i+=30*(t.groupSettings.columns.length-s);for(var l=t.getColumns(),h=0;h<l.length;h++){if(parseInt(o.getAttribute("colspan"),10)>1&&Wl(l[parseInt(h.toString(),10)],t)+i>parseInt(t.width.toString(),10)-Gl(t)){var d=_l(t,s);o.setAttribute("colspan",d.toString());break}if(l[parseInt(h.toString(),10)].visible&&(i+=Wl(l[parseInt(h.toString(),10)],t),a--),0===a)break}}if(o.classList.contains("e-summarycell")){var p=o.getAttribute("data-mappinguid");i+=Wl(t.getColumnByUid(p),t)}}}function Wl(e,t){if((0,o.isNullOrUndefined)(e.width)||"auto"===e.width||-1!==e.width.toString().indexOf("%")){var i=t.getColumnHeaderByField(e.field);return(0,o.isNullOrUndefined)(i)?0:i.getBoundingClientRect().width}return parseInt(e.width.toString(),10)}function Ql(e,t){var i=t.getContent().firstElementChild;return e&&e.getBoundingClientRect().top-i.getBoundingClientRect().top+t.getRowHeight()>i.offsetHeight}function Xl(e,t){return e&&e.getBoundingClientRect().top<t}function Yl(e,t){var i=t.getRowHeight(),n=t.getContent().firstElementChild.scrollTop/i;return e<n+t.getContent().firstElementChild.offsetHeight/i&&e>n}function Jl(e,t){var i,n=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,r){n.includes(".")?Ml(n,e)===Ml(n,t)&&(i=r):e[""+n]===t[""+n]&&(i=r)}),i}function Zl(e,t){var i=$l(t),n=new a.Deferred;return i.dataSource=n.resolve,i.action=e,{state:i,deffered:n}}function $l(e){var t=new a.UrlAdaptor,i=new a.DataManager({url:"",adaptor:new a.UrlAdaptor}),n=t.processQuery(i,e);return JSON.parse(n.data)}function eh(e){for(var t=e.getVisibleColumns(),i=0,n=0,r=0;r<t.length;r++)(0,o.isUndefined)(t[parseInt(r.toString(),10)].width)?n++:-1!==t[parseInt(r.toString(),10)].width.toString().indexOf("%")&&i++;return("auto"===e.width||"string"==typeof e.width&&-1!==e.width.indexOf("%"))&&!e.groupSettings.showGroupedColumn&&e.groupSettings.columns.length&&i&&!n}function th(e,t,i,n,r){for(var s=n||0,o=r||0;o<t.length;o++)if(t[parseInt(o.toString(),10)]&&t[parseInt(o.toString(),10)].isDataRow){t[parseInt(o.toString(),10)].index=s,t[parseInt(o.toString(),10)].isAltRow=!!e.enableAltRow&&s%2!=0,i[parseInt(o.toString(),10)].setAttribute(Rs,(s+1).toString()),t[parseInt(o.toString(),10)].isAltRow?i[parseInt(o.toString(),10)].classList.add("e-altrow"):i[parseInt(o.toString(),10)].classList.remove("e-altrow");for(var a=0;a<i[parseInt(o.toString(),10)].cells.length;a++)i[parseInt(o.toString(),10)].cells[parseInt(a.toString(),10)].setAttribute("data-index",s.toString());s++}t.length||e.renderModule.emptyRow(!0)}function ih(e){for(var t=e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache?e.getRowsObject():e.vRows,i=e.getRows(),n=0,r=0,s=0;n<t.length;n++){var a=t[parseInt(n.toString(),10)];if(a.isDataRow){a.index=r,a.isAltRow=!!e.enableAltRow&&r%2!=0;var l=e.getRowElementByUID(a.uid);if(!(0,o.isNullOrUndefined)(l)){i[parseInt(s.toString(),10)]=l,l.setAttribute(Rs,(r+1).toString()),a.isAltRow?l.classList.add("e-altrow"):l.classList.remove("e-altrow");for(var h=0;h<l.cells.length;h++)l.cells[parseInt(h.toString(),10)].setAttribute("data-index",r.toString());s++}r++}}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(t)}function nh(e,t,i,n){for(var r,s=e.enableVirtualization?e.vRows:e.getRowsObject(),a=[],l=n||e.getRowObjectFromUID(t.target.closest("tr").getAttribute("data-uid")),h=0;h<t.rows.length;h++){var d=e.getRowObjectFromUID(t.rows[parseInt(h.toString(),10)].getAttribute("data-uid"));l===d&&(r=s.indexOf(l)),a.push(s.splice(s.indexOf(d),1)[0])}if((0,o.isNullOrUndefined)(r)?(r=s.indexOf(l),t.fromIndex>t.dropIndex?s.splice.apply(s,[r,0].concat(a)):s.splice.apply(s,[r+1,0].concat(a))):s.splice.apply(s,[r,0].concat(a)),!e.enableVirtualization&&!e.infiniteScrollSettings.enableCache){for(var p={},c=e.getCurrentViewRecords(),u=(h=0,i.length);h<u;h++){var g=parseInt(i[parseInt(h.toString(),10)].getAttribute(Rs),10)-1;p[parseInt(h.toString(),10)]=c[parseInt(g.toString(),10)]}var f=e.getRows();for(h=0,u=i.length;h<u;h++)f[parseInt(h.toString(),10)]=i[parseInt(h.toString(),10)],c[parseInt(h.toString(),10)]=p[parseInt(h.toString(),10)]}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(s)}function rh(e,t,i,n){var r=e.dataToBeUpdated[""+i].concat(t[""+i]).reduce(function(e,t){return e[t[""+n]]=void 0===e[t[""+n]]?t:Object.assign(e[t[""+n]],t),e},{});e.dataToBeUpdated[""+i]=Object.keys(r).map(function(e){return r[""+e]})}function sh(e){e.enableInfiniteScrolling&&(e.childGrid||e.detailTemplate)?e.contentModule.rowElements=[].slice.call(e.getContentTable().rows).filter(function(e){return(e.classList.contains("e-row")||e.classList.contains("e-detailrow"))&&!e.classList.contains("e-addedrow")}):e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-row:not(.e-addedrow):not(.e-cloneproperties .e-row)"))}function oh(e,t,i){for(var n=e.children.length,r=0,s=0;s<n;s++,r++)s>=t&&s<i||(e.removeChild(e.children[parseInt(r.toString(),10)]),r--)}function ah(e,t){lh(e)&&(t.target=e.element.closest("mat-dialog-container"))}function lh(e){return e&&e.isAngular&&e.element&&!(0,o.isNullOrUndefined)(e.element.closest("mat-dialog-container"))}function hh(e,t,i){var n=e.createElement("div",{className:"e-grid-popup",id:e.element.id+"_e-popup"}),r=(0,y.calculatePosition)(e.element,"left","Top");document.getElementById(e.element.id+"_e-popup")&&(n=document.getElementById(e.element.id+"_e-popup")),n.style.top=r.top+"px",n.style.left=r.left+"px",n.style.zIndex=t.zIndex.toString(),n.style.width=(0,o.isNullOrUndefined)(i)?t.element.offsetWidth+"px":i+"px",n.appendChild(t.element);var s=document.querySelector(".sb-demo-section,.e-grid-dialog-fixed");if(s){var a=(0,y.calculateRelativeBasedPosition)(e.element,s);n.style.top=a.top+"px",n.style.left=a.left+"px",s.insertBefore(n,s.firstChild)}else if(lh(e)){var l=e.element.closest("mat-dialog-container");l&&l.insertBefore(n,l.firstChild)}else document.body.insertBefore(n,document.body.firstChild)}function dh(e,t){var i=[];return i.push(e.uid),ph(e,i),i.indexOf(t)>-1}function ph(e,t){for(var i=0;i<e.columns.length;i++)e.columns[parseInt(i.toString(),10)].uid&&t.push(e.columns[parseInt(i.toString(),10)].uid),e.columns[parseInt(i.toString(),10)].columns&&e.columns[parseInt(i.toString(),10)].columns.length&&ph(e.columns[parseInt(i.toString(),10)],t)}function ch(e){return e.columns[0].freeze||e.columns[0].isFrozen?"Left"===e.columns[0].freeze||e.columns[0].isFrozen?"Left":"Right"===e.columns[0].freeze?"Right":"Fixed"===e.columns[0].freeze?"Fixed":"None":e.columns[0].columns&&e.columns[0].columns.length?ch(e.columns[0]):"None"}function uh(e){if(e.querySelector(".e-fixedfreeze"))for(var t=[].slice.call(e.querySelectorAll(".e-filterbarcell:not(.e-hide),.e-summarycell:not(.e-hide),.e-headercell:not(.e-hide),.e-rowcell:not(.e-hide)")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i-1]||t[i-1]&&!t[i-1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i+1]||t[i+1]&&!t[i+1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezerightborder")}function gh(e,t,i,n){"Left"===n&&(i?e.style.right=t+"px":e.style.left=t+"px"),"Right"===n&&(i?e.style.left=t+"px":e.style.right=t+"px")}function fh(e,t,i,n){var r=e.getColumns(),s=t.index;if("Left"===t.freeze&&"Left"!==t.border){for(var o=s+(n-1);!1===r[parseInt(o.toString(),10)].visible;)o++;"Left"===r[parseInt(o.toString(),10)].border&&i.classList.add("e-freezeleftborder")}else if("Right"===t.freeze||"Fixed"===t.freeze){for(var a=0,l=s+1;l<s+n&&l!==r.length;l++)r[parseInt(l.toString(),10)].visible?a+=parseInt(r[parseInt(l.toString(),10)].width.toString(),10):n++;e.enableRtl?i.style.left=parseInt(i.style.left,10)-a+"px":i.style.right=parseInt(i.style.right,10)-a+"px"}}function mh(e,t,i){for(var n=e.getRowByIndex(t),r=0;r<n.cells.length;r++)if(parseInt(n.cells[parseInt(r.toString(),10)].getAttribute("aria-colindex").toString(),10)-1===i)return n.cells[parseInt(r.toString(),10)];return null}function yh(e,t,i){if("Left"===t.freeze||t.isFrozen)if(i.classList.add("e-leftfreeze"),"Left"===t.border&&i.classList.add("e-freezeleftborder"),0===t.index)gh(i,30*e.getIndentCount(),e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=30*e.getIndentCount());else{for(var n=e.getColumns(),r=30*e.getIndentCount(),s=0;s<n.length&&t.uid!==n[parseInt(s.toString(),10)].uid;s++)n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));gh(i,r,e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=r)}else if("Right"===t.freeze){i.classList.add("e-rightfreeze");n=e.getColumns();if("Right"===t.border&&i.classList.add("e-freezerightborder"),t.index===n[n.length-1].index){gh(i,r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,e.enableRtl,"Right"),e.enableColumnVirtualization&&(t.valueX=r)}else{for(r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,s=n.length-1;s>=0&&t.uid!==n[parseInt(s.toString(),10)].uid;s--)n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));gh(i,r,e.enableRtl,"Right"),e.enableColumnVirtualization&&(t.valueX=r)}}else if("Fixed"===t.freeze){i.classList.add("e-fixedfreeze");n=e.getColumns(),r=0;e.getVisibleFrozenLeftCount()?r=30*e.getIndentCount():"Right"===e.getFrozenMode()&&(r=30*e.groupSettings.columns.length);for(s=0;s<n.length&&t.uid!==n[parseInt(s.toString(),10)].uid;s++)("Left"===n[parseInt(s.toString(),10)].freeze||n[parseInt(s.toString(),10)].isFrozen||"Fixed"===n[parseInt(s.toString(),10)].freeze)&&n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));gh(i,r-1,e.enableRtl,"Left"),r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0;for(s=n.length-1;s>=0&&t.uid!==n[parseInt(s.toString(),10)].uid;s--)"Right"!==n[parseInt(s.toString(),10)].freeze&&"Fixed"!==n[parseInt(s.toString(),10)].freeze||n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));gh(i,r-1,e.enableRtl,"Right")}else i.classList.add("e-unfreeze")}function vh(e,t,i){var n={rowIndex:i,elements:null};return e.notify("get-row-cells",n),n.elements?n.elements:[].slice.call(e.getDataRows()[parseInt(i.toString(),10)].getElementsByClassName(is))}function Sh(e,t,i,n){return vh(e,0,i)[parseInt(n.toString(),10)]}function Ch(e,t,i,n,r,s,o){o||e.getFreezeTableName()===Is||!t&&e.getFreezeTableName()===bs||1===s?i[dl(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===bs&&(r[dl(e.field)]=e.validationRules):n[dl(e.field)]=e.validationRules}function wh(e,t,i,n){var r,s=new o.Internationalization;if("number"===t)try{r=s.getNumberPattern({format:e,currency:n,useGrouping:!0},!0)}catch(t){r=e}else if("date"===t||"time"===t||"datetime"===t)try{if(r=s.getDatePattern({skeleton:e,type:t},i),(0,o.isNullOrUndefined)(r))throw"error"}catch(n){try{r=s.getDatePattern({format:e,type:t},i)}catch(t){r=e}}else r=e;if("number"!==t){var a={G:"",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"};r=r.replace(/G|H|c|'| a|yy|y|EEEE|E/g,function(e){return a[""+e]})}return r}function bh(e){if(e.enableAdaptiveUI)for(var t=document.getElementsByClassName("e-responsive-dialog"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.add("e-bigger")}function Ih(e,t){for(var i,n=e.split(".").length,r=e.split("."),s=t,o=0;o<n;o++)s=i=s[r[parseInt(o.toString(),10)]];return i}function xh(e,t,i,n,r,s){for(var a=Object.keys(e),l=t,h=0;h<a.length;h++){var d=e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)];if(r&&!r.isFrozenGrid()&&!r.isRowDragable()){if(d=!(0,o.isNullOrUndefined)(d)&&(parseInt(d.getAttribute("aria-colindex"),10)-1===t||_a(d,"e-addedrow")&&d.parentElement.childNodes[parseInt(t.toString(),10)]===d)?d:e[parseInt(h.toString(),10)].querySelector('td[aria-colindex="'+(t+1)+'"]'),(0,o.isNullOrUndefined)(d))continue;t=r.getContentTable().querySelector(".e-detailrowcollapse, .e-detailrowexpand")?d.cellIndex-1:d.cellIndex}if(e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell").length&&d){if((0,o.setStyleAttribute)(e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)],{display:i}),e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)].classList.contains("e-hide")&&(0,o.removeClass)([e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)]],["e-hide"]),s&&r.isRowDragable()||r&&r.isDetail()){var p=t+1;n[a[parseInt(h.toString(),10)]].cells[parseInt(p.toString(),10)].visible=""===i}else(0,o.isNullOrUndefined)(n[a[parseInt(h.toString(),10)]])||(n[a[parseInt(h.toString(),10)]].cells[parseInt(t.toString(),10)].visible=""===i,!1===n[a[parseInt(h.toString(),10)]].cells[parseInt(t.toString(),10)].visible&&e[a[parseInt(h.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)].classList.add("e-hide"));t=l}}}function Rh(e,t,i,n){for(var r=0,s=t;r<s.length;r++){var o=s[r];i?e.on(o.event,o.handler,n):e.off(o.event,o.handler)}}function Dh(e,t,i,n){var r=dl(t.field);return n=Object.assign(n,{id:e.element.id+r,name:r,"data-mappinguid":t.uid}),e.createElement("input",{className:i,attrs:n})}function Th(e,t){for(var i,n=0,r=e.columnModel;n<r.length;n++){var s=r[n];if(s.uid===t){i=s;break}}return i}function Eh(e,t){var i;e.columnModel||e.getColumns();for(var n=0,r=e.columnModel;n<r.length;n++){var s=r[n];if(s.field===t){i=s;break}}return i}function Oh(e,t,i,n){n.eventHandlers[""+e]={};for(var r=0;r<t.length;r++)n.eventHandlers[""+e][t[parseInt(r.toString(),10)]]=i[t[parseInt(r.toString(),10)]]}function kh(e,t,i){for(var n=0;n<t.length&&!e.isDestroyed;n++)e.removeEventListener(t[parseInt(n.toString(),10)],i.eventHandlers[e.element.id][t[parseInt(n.toString(),10)]])}function Ah(e,t,i){e.destroyTemplate(t,void 0,i),e.isReact&&e.renderTemplates()}function Fh(e){for(var t=0;t<e.length;t++)(0,o.remove)(e[t])}function Mh(e,t){for(var i=0;i<e.length;i++)t.insertBefore(e[i],t.children[i])}function Lh(e,t){var i=t?(0,o.createElement)("li",{className:"e-cclist"}):(0,o.createElement)("div",{className:"e-ftrchk"});i.style.visibility="hidden",t&&(i.style.listStyle="none"),i.innerHTML=t?'<div class="e-ccheck"><div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label">A</span></div></div>':'<div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label e-checkboxfiltertext">A</div></span>',e.appendChild(i);var n=i.getBoundingClientRect();return e.removeChild(i),Math.round(n.height)}function Ph(e){return parseInt(e.getAttribute(Rs),10)-1}function Nh(e){return e.parentDetails&&e.parentDetails.parentInstObj?Nh(e.parentDetails.parentInstObj):e}function Bh(e,t,i){for(var n=[],r=0;r<e.length;r++){var s=i.parent.getColumnByField(e[parseInt(r.toString(),10)]),a="null"===t[parseInt(r.toString(),10)]?null:t[parseInt(r.toString(),10)],l={field:e[parseInt(r.toString(),10)],predicate:"or",uid:s.uid,operator:"equal",type:s.type,matchCase:i.allowCaseSensitive,ignoreAccent:i.parent.filterSettings.ignoreAccent};""===a||(0,o.isNullOrUndefined)(a)?n=n.concat(Xh.generateNullValuePredicates(l)):n.push(Ua({},{value:a},l))}return Xh.getPredicate(n)}function zh(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var r=n[i];t.push(e[""+r])}return t}function qh(e,t){for(var i=[],n=[],r=e;r>=0&&(!t[parseInt(r.toString(),10)].isCaptionRow||-1!==i.indexOf(t[parseInt(r.toString(),10)].data.field)||!(t[parseInt(r.toString(),10)].indent<t[parseInt(e.toString(),10)].indent||r===e)||(i.push(t[parseInt(r.toString(),10)].data.field),n.push(t[parseInt(r.toString(),10)].data.key),0!==t[parseInt(r.toString(),10)].indent));r--);return{fields:i,keys:n}}function Uh(e,t,i){var n=e,r=t,s=!1;if(i)for(var o=r[0];o<n.length;o++)for(var a=n[parseInt(o.toString(),10)],l=0;l<a.length;l++){if(s&&1===n[parseInt(o.toString(),10)][parseInt(l.toString(),10)])return r=[o,l];s||r.toString()!==[o,l].toString()||(s=!0)}else for(o=r[0];o>=0;o--)for(l=(a=n[parseInt(o.toString(),10)]).length-1;l>=0;l--){if(s&&1===n[parseInt(o.toString(),10)][parseInt(l.toString(),10)])return r=[o,l];s||r.toString()!==[o,l].toString()||(s=!0)}return r}function Hh(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jh(e){return!(Fl(e)||e.groupSettings.enableLazyLoading||!e.enableVirtualization&&e.enableColumnVirtualization)}function Vh(e){for(var t=[],i=0;i<e.length;i++){var n=Math.ceil(e[parseInt(i.toString(),10)]/2);-1===t.indexOf(n)&&t.push(n)}return t}function Gh(e){if(e.isTreeGrid){var t=e.getDataModule().dataManager.executeLocal(e.getDataModule().generateQuery(!0));return e.notify("partial-filter-update",{gridFiltered:t}),e.root.filterModule&&e.root.filterModule.filteredResult.length>0?e.root.filterModule.filteredResult:t}return e.getDataModule().dataManager.executeLocal(e.getDataModule().generateQuery(!0))}!function(e){e.timer=null}(rl||(rl={}));var _h=!1;function Kh(){return _h}function Wh(e){_h=e}var Qh=c(323),Xh=function(){function e(e){this.searchInputArgs=null,this.queryFilteredColumn=[],this.existingPredicate={},this.foreignKeyQuery=new a.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.isCheckboxFilterTemplate=!1,this.infiniteRenderMod=!1,this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1,this.infinitePermenantLocalData=[],this.infiniteQueryExecutionPending=!1,this.infiniteSkipCnt=0,this.infiniteOdataCount=0,this.infiniteScrollAppendDiff=0,this.prevInfiniteScrollDirection="",this.infiniteLoadedElem=[],this.infiniteDataCount=0,this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteManualSelectMaintainPred=[],this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new l(this.parent.locale),this.cBoxTrue=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass]))}return e.prototype.destroy=function(){this.closeDialog()},e.prototype.wireEvents=function(){o.EventHandler.add(this.dlg,"click",this.clickHandler,this),o.EventHandler.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=(0,o.debounce)(this.searchBoxKeyUp,200);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&(o.EventHandler.add(e,"keyup",this.searchHandler,this),o.EventHandler.add(e,"input",this.searchHandler,this))},e.prototype.unWireEvents=function(){o.EventHandler.remove(this.dlg,"click",this.clickHandler),o.EventHandler.remove(this.dlg,"keyup",this.keyupHandler);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&(o.EventHandler.remove(e,"keyup",this.searchHandler),o.EventHandler.remove(e,"input",this.searchHandler))},e.prototype.foreignKeyFilter=function(e,t,i){var n=this,r={},s=[],o=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(o.where(i)).then(function(i){n.options.column.columnData=i.result,n.parent.notify(Ii,{predicate:r,column:n.options.column}),e.ejpredicate=r.predicate.predicates;for(var o=r.predicate.predicates,a=0;a<o.length;a++)s.push({field:o[parseInt(a.toString(),10)].field,predicate:"or",matchCase:o[parseInt(a.toString(),10)].ignoreCase,ignoreAccent:o[parseInt(a.toString(),10)].ignoreAccent,operator:o[parseInt(a.toString(),10)].operator,value:o[parseInt(a.toString(),10)].value,type:n.options.type});e.filterCollection=s.length?s:t.filter(function(e){return e.field=n.options.field}),n.options.handler(e)})},e.prototype.searchBoxClick=function(e){var t=e.target;t.classList.contains("e-searchclear")&&(this.sInput.value=t.classList.contains("e-chkcancel-icon")?"":this.sInput.value,this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},e.prototype.searchBoxKeyUp=function(e){(0,o.isNullOrUndefined)(this.sInput)||!(0,o.isNullOrUndefined)(e)&&("ArrowUp"===e.key||"ArrowDown"===e.key||"Tab"===e.key||"Tab"===e.key&&e.shiftKey)||((0,o.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.parent.showMaskRow(void 0,this.dialogObj.element),this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon())},e.prototype.updateSearchIcon=function(){this.sInput.value.length?((0,o.classList)(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]),(0,o.isNullOrUndefined)(document.body.querySelector(".e-chkcancel-icon"))||document.body.querySelector(".e-chkcancel-icon").setAttribute("title",this.localeObj.getConstant("Clear"))):((0,o.classList)(this.sIcon,["e-search-icon"],["e-chkcancel-icon"]),(0,o.isNullOrUndefined)(document.body.querySelector(".e-searchclear.e-search-icon"))||document.body.querySelector(".e-searchclear.e-search-icon").setAttribute("title",this.localeObj.getConstant("Search")))},e.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},e.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof a.DataManager))for(var t=0;t<e.length;t++)if("object"!=typeof e){var i={};i[this.options.field]=e[parseInt(t.toString(),10)],e[parseInt(t.toString(),10)]=i}},e.prototype.updateModel=function(e){this.options=e,this.existingPredicate=e.actualPredicate||{},this.options.dataSource=e.dataSource,this.options.dataManager=e.dataManager?e.dataManager:e.dataSource,this.updateDataSource(),this.options.type=e.type,this.options.format=e.format||"",this.options.ignoreAccent=e.ignoreAccent||!1,this.options.filteredColumns=e.filteredColumns||this.parent.filterSettings.columns,this.options.query=e.query||new a.Query,this.options.allowCaseSensitive=e.allowCaseSensitive||!1,this.options.uid=e.column.uid,this.options.disableHtmlEncode=e.column.disableHtmlEncode||!1,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length,this.infiniteRenderMod=!(!this.parent.filterSettings||!this.parent.filterSettings.enableInfiniteScrolling),this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]},e.prototype.getAndSetChkElem=function(e){return this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",attrs:{"data-uid":this.options.column.uid},className:"e-checkboxfilter e-filter-popup"}),this.sBox=this.parent.createElement("div",{className:"e-searchcontainer"}),e.hideSearchbox||(this.sInput=this.parent.createElement("input",{id:this.id+"_SearchBox",className:"e-searchinput"}),this.sIcon=this.parent.createElement("span",{className:"e-searchclear e-search-icon e-icons e-input-group-icon",attrs:{type:"text",title:this.getLocalizedLabel("Search")}}),this.searchBox=this.parent.createElement("span",{className:"e-searchbox e-fields"}),this.searchBox.appendChild(this.sInput),this.sBox.appendChild(this.searchBox),this.searchInputArgs={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search"),cssClass:this.parent.cssClass}},Qh.Input.createInput(this.searchInputArgs,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)),this.spinner=this.parent.createElement("div",{className:"e-spinner"}),this.cBox=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxList",className:"e-checkboxlist e-fields"}),this.spinner.appendChild(this.cBox),this.sBox.appendChild(this.spinner),this.sBox},e.prototype.showDialog=function(e){var t={requestType:Te,columnName:this.options.field,columnType:this.options.type,cancel:!1};if(t.filterModel=this,this.parent.notify(Zi,t),t.cancel)e.cancel=t.cancel;else{this.dialogObj=new y.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),enableRtl:this.parent.enableRtl,width:!(0,o.isNullOrUndefined)(_a(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this),cssClass:this.parent.cssClass?this.parent.cssClass:""});this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e);var i=this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type?this.getLocalizedLabel("CheckBoxFilterDialogARIA"):this.getLocalizedLabel("ExcelFilterDialogARIA");if(this.dlg.setAttribute("aria-label",i),e.isResponsiveFilter)document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlg);else this.parent.element.appendChild(this.dlg);if(this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=e.isResponsiveFilter?"none":this.options.height+"px",this.dialogObj.show(),this.parent&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||this.options.column&&this.options.column.filter&&"CheckBox"===this.options.column.filter.type)&&this.parent.getContent().firstElementChild.offsetHeight<this.dialogObj.element.offsetHeight&&!_a(this.parent.element,"e-gantt-dialog")&&hh(this.parent,this.dialogObj),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox),this.wireEvents(),this.parent.enableAdaptiveUI){if(this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator)return void this.getAllData();this.infiniteRenderMod&&(this.cBox.style.marginTop=Lh(this.cBox)+"px")}else(0,o.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.infiniteRenderMod||this.parent.showMaskRow(void 0,this.dialogObj.element),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.showMask();this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator||((0,y.createSpinner)({target:this.spinner,cssClass:this.parent.cssClass?this.parent.cssClass:null},this.parent.createElement),(0,y.showSpinner)(this.spinner)),this.getAllData()}},e.prototype.renderResponsiveFilter=function(e){e.isResponsiveFilter&&(this.dialogObj.buttons=[{}],this.dialogObj.position={X:"",Y:""},this.dialogObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dialogObj.width="100%")},e.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":o.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:Cl(this.options.target,this.dialogObj,this.parent),this.options.column.showColumnMenu&&this.parent.notify(Si,e)},e.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},e.prototype.closeDialog=function(){if(this.infiniteRenderMod&&this.infinitePermenantLocalData.length&&!this.options.isRemote&&(this.options.dataSource.dataSource.json=this.infinitePermenantLocalData),this.dialogObj&&!this.dialogObj.isDestroyed){this.isBlanks=!1;var e=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),t=this.parent.registeredTemplate;if(e.length&&!(0,o.isNullOrUndefined)(t)&&t.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Ah(this.parent,["filterItemTemplate"]),this.parent.notify(Ci,{field:this.options.field}),this.unWireEvents(),this.searchInputArgs&&this.searchInputArgs.element&&this.searchInputArgs.element.parentElement&&(Qh.Input.destroy(this.searchInputArgs),(0,o.remove)(this.searchInputArgs.element)),this.searchInputArgs=null,this.sInput=null,this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&("CheckBox"===this.options.column.filter.type||"Excel"===this.options.column.filter.type)&&(this.dialogObj.element.querySelector(".e-dlg-content").innerHTML=""),this.dialogObj.destroy(),"escape"===this.dialogObj.dlgClosedBy&&(this.parent.isColumnMenuFilterClosing=!0),this.dlg&&this.dlg.parentElement&&((0,o.remove)(this.dlg),!this.parent||!this.parent.showColumnChooser)){var i=document.getElementById(this.parent.element.id+"_e-popup");(0,o.isNullOrUndefined)(i)||((0,o.remove)(i),i=null)}this.dlg=null,this.parent.notify(nr,{})}},e.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(en,t),t.cancel||this.options.handler({action:"clear-filter",field:e?e.field:this.options.field})},e.prototype.btnClick=function(e){if(this.filterState){if("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")||13===e.keyCode)this.isCheckboxFilterTemplate||this.fltrBtnHandler();else{var t=e.target.firstChild.textContent.toLowerCase();this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===t?this.isCheckboxFilterTemplate||this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===t&&this.clearFilter()}this.closeDialog()}else e.target&&e.target.firstChild&&e.target.firstChild.textContent.toLowerCase()===this.getLocalizedLabel("CancelButton").toLowerCase()?this.closeDialog():"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog());this.options.column.showColumnMenu&&this.parent.notify(Fr,{}),(0,o.isNullOrUndefined)(this.parent.focusModule)||this.parent.focusModule.filterfocus()},e.prototype.fltrBtnHandler=function(){var e=this;this.infiniteRenderMod&&(this.cBox.innerHTML="",$a(this.cBox,this.infiniteLoadedElem.slice()));var t,i=[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)")),n=i,r="equal",s=this.dialogObj.element.querySelector(".e-dropdownlist");s&&(this.options.operator=r=s.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator,this.options.hideSearchbox||(t=this.searchBox.querySelector(".e-searchinput"));var a,l,h=this.options.allowCaseSensitive,d={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:r,type:this.options.type,matchCase:h,ignoreAccent:this.options.ignoreAccent},p=this.itemsCnt!==i.length&&this.itemsCnt-i.length<i.length,c=this.infiniteRenderMod?this.sBox.querySelector(".e-add-current"):this.cBox.querySelector(".e-add-current"),u=this.infiniteRenderMod?this.sBox.querySelector(".e-selectall"):this.cBox.querySelector(".e-selectall"),g=t&&""!==t.value&&c&&u&&c.classList.contains("e-check")&&u.classList.contains("e-stop"),f=this.existingPredicate&&this.existingPredicate[this.options.field];g&&(p=!f||!f.length),p&&t&&(""===t.value||g)&&(r=this.isMenuNotEqual?"equal":"notequal",i=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),d.predicate=this.isMenuNotEqual?"or":"and",d.operator=r);var m=[];if(i.length!==this.itemsCnt||t&&t.value&&""!==t.value||this.infiniteRenderMod){if(this.infiniteRenderMod)this.infiniteRenderMod&&(!this.infiniteSearchPred||this.infiniteSearchPred&&!this.infiniteSearchPred.isComplex)?this.infiniteFltrBtnHandler(m):this.infiniteSearchPred.isComplex&&(m=this.complexQueryPredicate(i,d,p));else{if(m=this.complexQueryPredicate(i,d,p),(0,o.isNullOrUndefined)(m))return;m=this.filterPreventColumns?this.filterPreventColumns:m}if("date"!==this.options.type&&"dateonly"!==this.options.type&&"datetime"!==this.options.type||!n.length||(l=n.length-1,a=this.values[_a(n[parseInt(l.toString(),10)],"e-ftrchk").getAttribute("data-uid")],(0,o.isNullOrUndefined)(a)&&p&&m.push({field:d.field,matchCase:d.matchCase,operator:"equal",predicate:"or",value:null})),c&&c.classList.contains("e-check"))if(f)for(var y=function(e){m.some(function(t){return t.value===f[parseInt(e.toString(),10)].value})||m.push(f[parseInt(e.toString(),10)])},v=0;v<f.length;v++)y(v);else if(!g)return;if(this.infiniteRenderMod){if(m.length)this.initiateFilter(m);else if(this.sBox.querySelector(".e-selectall").classList.contains("e-check")&&!m.length){this.options.filteredColumns.some(function(t){return e.options.field===t.field})&&this.clearFilter()}}else this.initiateFilter(m)}else{this.options.filteredColumns.some(function(t){return e.options.field===t.field})&&this.clearFilter()}},e.prototype.complexQueryPredicate=function(t,i,n){for(var r,s,a=[],l=0;l<t.length;l++)r=this.values[_a(t[parseInt(l.toString(),10)],"e-ftrchk").getAttribute("data-uid")],s=(0,o.extend)({},{value:r},i),r&&!r.toString().length&&(s.operator=n?"notequal":"equal"),""===r||(0,o.isNullOrUndefined)(r)?a=a.concat(e.generateNullValuePredicates(i)):a.push(s);var h=this.filterPreventColumns&&this.filterPreventColumns.length?this.filterPreventColumns[0]:s;return h&&!this.notifyFilterPrevEvent(h)?(this.filterPreventColumns=a,null):a},e.prototype.infiniteFltrBtnHandler=function(t){var i;if(this.infiniteManualSelectMaintainPred.length)for(var n=0;n<this.infiniteManualSelectMaintainPred.length;n++){var r=this.infiniteManualSelectMaintainPred[n];if(""===(i=r.value+"")||(0,o.isNullOrUndefined)(i)){var s={predicate:r.predicate,field:r.field,type:r.type,uid:r.uid,operator:r.operator,matchCase:r.matchCase,ignoreAccent:r.ignoreAccent};t.push.apply(t,e.generateNullValuePredicates(s))}else t.push(this.infiniteManualSelectMaintainPred[n]);this.notifyFilterPrevEvent(this.infiniteManualSelectMaintainPred[n])}if(!this.localInfiniteSelectAllClicked&&""===this.sInput.value&&(this.options.parentCurrentViewDataCount||!t.length))for(n=0;n<this.infiniteUnloadParentExistPred.length;n++)t.unshift(this.infiniteUnloadParentExistPred[n]),this.notifyFilterPrevEvent(this.existingPredicate[this.options.field][n]);!this.infiniteSearchPred||""===this.sInput.value||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll||(this.infiniteSearchPred.predicate="or",t.unshift(this.infiniteSearchPred),this.notifyFilterPrevEvent(this.infiniteSearchPred))},e.prototype.notifyFilterPrevEvent=function(e){var t={instance:this,handler:this.fltrBtnHandler,arg1:e.field,arg2:e.predicate,arg3:e.operator,arg4:e.matchCase,arg5:e.ignoreAccent,arg6:e.value,cancel:!1};return this.parent.notify(en,t),!t.cancel},e.generateNullValuePredicates=function(e){var t=[];return"string"===e.type&&t.push({field:e.field,ignoreAccent:e.ignoreAccent,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:""}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:null}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:void 0}),t},e.prototype.initiateFilter=function(e){var t,i=e[0];if(i&&"dateonly"===i.type&&(i.value=i.value instanceof Date?i.value.getFullYear()+"-"+kl(i.value.getMonth()+1)+"-"+kl(i.value.getDate()):i.value),!(0,o.isNullOrUndefined)(i)){t=i.ejpredicate?i.ejpredicate:new a.Predicate(i.field,i.operator,i.value,!i.matchCase,i.ignoreAccent);for(var n=1;n<e.length;n++)t=void 0!==e[parseInt(n.toString(),10)].ejpredicate?t[e[parseInt(n.toString(),10)].predicate](e[parseInt(n.toString(),10)].ejpredicate):t[e[parseInt(n.toString(),10)].predicate](e[parseInt(n.toString(),10)].field,e[parseInt(n.toString(),10)].operator,e[parseInt(n.toString(),10)].value,!e[parseInt(n.toString(),10)].matchCase,e[parseInt(n.toString(),10)].ignoreAccent);var r={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:a.Predicate.or(t)};this.options.handler(r)}},e.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},e.prototype.refreshCheckboxes=function(){var t=this,i=this.sInput.value,n=this.options.column,r=this.isForeignColumn(n)?this.foreignKeyQuery.clone():this.options.query.clone(),s=this.options.query.clone(),l=r.queries.filter(function(e){return e&&"onWhere"===e.fn})[0];r.queries=[],s.queries=[];var h="string"!==this.options.type&&parseFloat(i)?parseFloat(i):i,d=this.options.isRemote?"string"===this.options.type?"contains":"equal":this.options.type?"contains":"equal",p=!0,c=this.options.ignoreAccent,u=this.isForeignColumn(n)?n.foreignKeyValue:n.field;h=""===h||void 0===h?void 0:h;var g,f=[],m={field:u,predicate:"or",uid:this.options.uid,operator:"equal",type:this.options.type,matchCase:p,ignoreAccent:c},v=this.options.dataManager.adaptor.getModuleName;if("boolean"===this.options.type&&(void 0!==h&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(h.toLowerCase())?h="true":void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&(h="false"),void 0!==h&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(h.toLowerCase())&&v?(v(),h=!0):void 0!==h&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(h.toLowerCase())&&v&&(v(),h=!1),d="equal"),("date"===this.options.type||"datetime"===this.options.type||"dateonly"===this.options.type)&&this.options.format){var S=new o.Internationalization,C="string"==typeof this.options.format?this.options.format:this.options.format.format;h=C&&S.parseDate(i,{format:C})||new Date(i),"dateonly"===this.options.type&&(h=h.getFullYear()+"-"+kl(h.getMonth()+1)+"-"+kl(h.getDate()))}this.infiniteSearchValChange=!0,this.infiniteLoadedElem=[],this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteSkipCnt=0,this.infiniteDataCount=0,this.infiniteManualSelectMaintainPred=[],""===this.sInput.value?this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]:this.infiniteUnloadParentExistPred=[],this.isForeignColumn(n)||this.addDistinct(r);var w={requestType:Ee,filterModel:this,columnName:u,column:n,operator:d,matchCase:p,ignoreAccent:c,filterChoiceCount:null,query:r,value:h,cancel:!1};this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(w.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(R,w,function(v){if(!v.cancel){if(v.operator=v.operator,g=new a.Predicate(u,v.operator,w.value,v.matchCase,v.ignoreAccent),"date"===t.options.type||"datetime"===t.options.type||"dateonly"===t.options.type){var S={field:u,operator:d="equal",value:h,matchCase:p,ignoreAccent:c};(0,o.isNullOrUndefined)(h)||(g=Al(S,t.options.type))}if(i&&"string"==typeof i&&t.isBlanks&&t.getLocalizedLabel("Blanks").toLowerCase().indexOf(i.toLowerCase())>=0){f=f.concat(e.generateNullValuePredicates(m));var C=e.generatePredicate(f);C.predicates.push(g),g=C,r.where(C)}else i.length?(g=(0,o.isNullOrUndefined)(l)?g:g.and(l.e),r.where(g)):(0,o.isNullOrUndefined)(l)||(g=l.e,r.where(l.e));t.infiniteSearchPred=g,v.filterChoiceCount=(0,o.isNullOrUndefined)(v.filterChoiceCount)?1e3:v.filterChoiceCount,t.infiniteRenderMod&&t.parent.filterSettings.itemsCount!==v.filterChoiceCount&&(t.parent.filterSettings.itemsCount=w.filterChoiceCount);var b={};if((0,y.showSpinner)(t.spinner),t.renderEmpty=!1,t.isForeignColumn(n)&&i.length)("result"in n.dataSource?new a.DataManager(n.dataSource.result):n.dataSource).executeQuery(r).then(function(e){var i=t.options.column.columnData;t.options.column.columnData=e.result,t.parent.notify(Ii,{predicate:b,column:n}),b.predicate.predicates.length?s.where(b.predicate):t.renderEmpty=!0,t.options.column.columnData=i,t.infiniteRenderMod?(t.infiniteInitialLoad=!!(0,o.isNullOrUndefined)(t.fullData),t.makeInfiniteScrollRequest(s),s.requiresCount()):s.take(v.filterChoiceCount),t.search(v,s)});else t.infiniteRenderMod&&t.parent.filterSettings.itemsCount?(t.infiniteInitialLoad=!!(0,o.isNullOrUndefined)(t.fullData),t.makeInfiniteScrollRequest(r),r.requiresCount()):r.take(v.filterChoiceCount),t.search(v,r)}})},e.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},e.prototype.getPredicateFromCols=function(t){for(var i=e.getPredicate(t),n=[],r={},s=void 0!==this.parent.getForeignKeyColumns,o=s?this.parent.getForeignKeyColumns():[],l=0,h=Object.keys(i);l<h.length;l++){var d=h[l],p=void 0;s&&!this.parent.getColumnByField(d)&&(p=Ol(d,o)),p?(this.parent.notify(Ii,{predicate:r,column:p}),r.predicate.predicates.length&&n.push(a.Predicate.or(r.predicate.predicates))):n.push(i[""+d])}return n.length&&a.Predicate.and(n)},e.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new a.Query},e.prototype.getAllData=function(){var e=this;this.customQuery=!1;var t=this.getQuery(),i=this.options.dataManager.adaptor.getModuleName;!(0,o.isNullOrUndefined)(this.parent.getDataModule)&&i&&"ODataV4Adaptor"===i()||t.requiresCount(),this.addDistinct(t);var n={requestType:Re,query:t,filterChoiceCount:null};n.filterModel=this,this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(n.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(R,n,function(i){i.filterChoiceCount=(0,o.isNullOrUndefined)(i.filterChoiceCount)?1e3:i.filterChoiceCount,e.infiniteRenderMod&&e.parent.filterSettings.itemsCount!==i.filterChoiceCount&&(e.parent.filterSettings.itemsCount=i.filterChoiceCount),e.infiniteRenderMod||t.take(i.filterChoiceCount),i.query.distincts.length&&!e.infiniteRenderMod||(e.customQuery=!0,e.queryGenerate(t)),e.infiniteRenderMod&&(e.infiniteInitialLoad=!!(0,o.isNullOrUndefined)(e.fullData),e.makeInfiniteScrollRequest(t)),e.parent.dataSource&&"result"in e.parent.dataSource?e.filterEvent(i,t):e.processDataOperation(t,!0)})},e.prototype.addDistinct=function(e){var t=this,i=a.DataUtil.distinct(this.options.filteredColumns,"field");i.indexOf(this.options.column.field)<=-1&&(i=i.concat(this.options.column.field));var n=this.options.dataManager.adaptor.getModuleName;if(n&&"ODataV4Adaptor"===n()&&this.parent&&this.parent.query instanceof a.Query)for(var r=this.parent.query,s=0;s<r.queries.length;s++){var o=r.queries[parseInt(s.toString(),10)];"onWhere"===o.fn&&(this.getPredicateFields(o.e),this.queryFilteredColumn.map(function(e){-1===i.indexOf(e)&&i.push(e)}),this.queryFilteredColumn=[])}if(this.infiniteRenderMod||e.distinct(i),this.infiniteRenderMod&&!this.options.isRemote&&""===this.sInput.value){var l;this.options.dataSource=this.options.dataSource instanceof a.DataManager?this.options.dataSource:new a.DataManager(this.options.dataSource),this.infinitePermenantLocalData=this.options.dataSource.dataSource.json.slice(),this.options&&this.options.dataManager&&this.options.dataManager.adaptor&&this.options.dataManager.adaptor.getModuleName&&(l=this.options.dataManager.adaptor.getModuleName);var h=l&&"RemoteSaveAdaptor"===l()&&this.infinitePermenantLocalData?this.infinitePermenantLocalData:this.options.dataSource.dataSource,d=new a.Query;this.queryGenerate(d);var p=new a.DataManager(h).executeLocal(d);this.options.dataSource=new a.DataManager(a.DataUtil.distinct(p,this.options.column.field,!0)),this.isForeignColumn(this.options.column)&&(this.options.column.dataSource=this.options.column.dataSource instanceof a.DataManager?this.options.column.dataSource:new a.DataManager(this.options.column.dataSource),this.options.dataSource.dataSource.json=this.options.dataSource.dataSource.json.map(function(e,i){return Object.assign({},e,t.options.column.dataSource.dataSource.json[i])}))}else if(this.infiniteRenderMod&&this.options.isRemote){e.select(this.options.column.field),e.sortBy(this.options.column.field,"ascending");var c=this.options.dataManager.adaptor.getModuleName;c&&c()&&("ODataV4Adaptor"===c()||"WebApiAdaptor"===c()||"CustomDataAdaptor"===c()||"GraphQLAdaptor"===c()||"ODataAdaptor"===c())&&e.distinct([this.options.column.field])}return e},e.prototype.getPredicateFields=function(e){var t=this;e.isComplex&&e.predicates?e.predicates.forEach(function(e){Array.isArray(e)?e.forEach(function(e){return t.getPredicateFields(e)}):t.getPredicateFields(e)}):e.field&&!e.isComplex&&this.queryFilteredColumn.indexOf(e.field)<=-1&&(this.queryFilteredColumn=this.queryFilteredColumn.concat(a.DataUtil.distinct([e.field],"field")))},e.prototype.filterEvent=function(e,t){var i=this,n=Zl(e,t);this.parent.trigger(Ti,n.state),this.addInfiniteScrollEvent(t),n.deffered.promise.then(function(e){i.infiniteDataCount=i.infiniteRenderMod&&!i.infiniteDataCount?e.count:i.infiniteDataCount;var t=i.infiniteRenderMod?e.result:e;i.dataSuccess(t)})},e.prototype.addInfiniteScrollEvent=function(e){this.infiniteRenderMod&&(this.infiniteQuery=e.clone(),this.infiniteInitialLoad?(this.cBox.classList.add("e-checkbox-infinitescroll"),o.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this),o.EventHandler.add(this.cBox,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),o.EventHandler.add(this.cBox,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.infiniteSearchValChange&&(this.cBox.innerHTML=""))},e.prototype.infiniteScrollMouseKeyDownHandler=function(){o.EventHandler.remove(this.cBox,"scroll",this.infiniteScrollHandler)},e.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this;o.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this);var i=this.cBox;i.children.length>1&&(i.scrollTop>=i.scrollHeight-i.offsetHeight||i.scrollTop<=0)&&this.infiniteScrollHandler(),rl.timer=setTimeout(function(){t.clickHandler(e),rl.timer=null},0)},e.prototype.getShimmerTemplate=function(){return'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},e.prototype.showMask=function(){var e,t=5,i=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxMaskList",className:"e-checkboxlist e-fields e-infinite-list e-masklist"});i.style.zIndex="10";var n=this.cBox;if(this.removeMask(),n){var r=getComputedStyle(n),s=Lh(n),o=n.children.length?parseInt(r.height,10):Math.floor(parseInt(r.height.split("px")[0],10))-5;this.parent.enableAdaptiveUI&&this.infiniteRenderMod&&(i.style.height=o-s+"px",this.dlg.querySelector(".e-dlg-content").style.overflow="hidden");var a=!this.isExcel||n.children.length||this.dlg.classList.contains("e-excelfilter")?getComputedStyle(this.dlg.querySelector(".e-dlg-content")).backgroundColor:"";i.style.cssText="width: "+r.width+"; min-height: "+r.minHeight+"; height: "+o+"px; margin: "+r.margin+"; border-style: "+r.borderStyle+"; border-width: "+r.borderWidth+"; border-color: "+r.borderColor+"; position: absolute; background-color: "+a+";",t=Math.floor(o/s),t=n.children.length>t?n.children.length:t,e=s+"px"}var l='<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>";(i.innerHTML="",n.children.length)||(this.spinner.insertAdjacentHTML("beforebegin",l),this.spinner.parentElement.querySelector(".e-ftrchk.e-mask-ftrchk").style.cssText="width: 100%; height: "+e+";",this.spinner.parentElement.querySelector(".e-checkbox-wrapper").style.width="100%",(d=[].slice.call(this.spinner.parentElement.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),d[1].classList.add("e-mask-checkbox-filter-span-intent"));this.spinner.insertBefore(i,this.cBox);for(var h=0;t&&h<t;h++){var d;i.innerHTML+=l,i.lastElementChild.style.cssText="width: 100%; height: "+e+";",i.lastElementChild.querySelector(".e-checkbox-wrapper").style.width="100%",(d=[].slice.call(i.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),d[1].classList.add("e-mask-checkbox-filter-span-intent")}this.cBox&&(i.scrollTop=this.cBox.scrollTop)},e.prototype.removeMask=function(){var e=this.dialogObj.element.querySelectorAll(".e-mask-ftrchk");if(e.length)for(var t=0;t<e.length;t++)(0,o.remove)(e[t]);this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist")&&(0,o.remove)(this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist"))},e.prototype.infiniteScrollHandler=function(){var e=this.cBox;e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length<=this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount&&(!this.infiniteDataCount||this.infiniteDataCount>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)?(this.makeInfiniteScrollRequest(),this.prevInfiniteScrollDirection="down"):e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(Fh([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt+="down"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,$a(this.cBox,this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.parent.filterSettings.itemsCount+this.infiniteSkipCnt)),this.prevInfiniteScrollDirection="down"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.infiniteLoadedElem.length>3*this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(Fh([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt-="up"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,Mh([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.cBox.children.length<3*this.parent.filterSettings.itemsCount&&(Fh([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.infiniteDataCount%this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt=(Math.floor(this.infiniteDataCount/this.parent.filterSettings.itemsCount)-3)*this.parent.filterSettings.itemsCount,Mh([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},e.prototype.makeInfiniteScrollRequest=function(e){var t=this;!this.infiniteInitialLoad&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator?setTimeout(function(){t.infiniteQueryExecutionPending&&t.showMask()},500):this.infiniteInitialLoad||((0,y.createSpinner)({target:this.spinner,cssClass:this.parent.cssClass?this.parent.cssClass:null},this.parent.createElement),(0,y.showSpinner)(this.spinner));if(this.infiniteQuery&&this.infiniteQuery.queries&&this.infiniteQuery.queries.length)for(var i=0;i<this.infiniteQuery.queries.length;i++)"onTake"!==this.infiniteQuery.queries[i].fn&&"onSkip"!==this.infiniteQuery.queries[i].fn||(this.infiniteQuery.queries.splice(i,1),i--);var n=!!e;if(e=e||this.infiniteQuery,this.infiniteInitialLoad||this.infiniteSearchValChange?this.infiniteSkipCnt=0:this.infiniteSkipCnt+=this.parent.filterSettings.itemsCount,e.skip(this.infiniteSkipCnt),this.infiniteInitialLoad||this.infiniteSearchValChange?(e.take(3*this.parent.filterSettings.itemsCount),this.infiniteSkipCnt+=2*this.parent.filterSettings.itemsCount):e.take(this.parent.filterSettings.itemsCount),!n)if(this.parent.dataSource&&"result"in this.parent.dataSource){var r={requestType:Re,query:e,filterChoiceCount:null,filterModel:this};this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(r.filterChoiceCount=this.parent.filterSettings.itemsCount),this.filterEvent(r,e)}else this.processDataOperation(e),this.infiniteQueryExecutionPending=!0},e.prototype.processDataOperation=function(e,t){var i=this;this.options.dataSource=this.options.dataSource instanceof a.DataManager?this.options.dataSource:new a.DataManager(this.options.dataSource);var n=[],r=[];if(this.isForeignColumn(this.options.column)&&t){var s="result"in this.options.column.dataSource?new a.DataManager(this.options.column.dataSource.result):this.options.column.dataSource;this.foreignKeyQuery.params=e.params,n.push(s.executeQuery(this.foreignKeyQuery)),r.push(function(e){return i.foreignKeyData=e})}if(this.addInfiniteScrollEvent(e),this.infiniteRenderMod&&this.infiniteInitialLoad&&!this.options.isRemote){var o=this.isForeignColumn(this.options.column)?this.options.foreignKeyValue:this.options.column.field;this.options.dataSource.executeQuery((new a.Query).sortBy(o,a.DataUtil.fnAscending)).then(function(t){i.options.dataSource.dataSource.json=t.result,i.executeQueryOperations(e,n,r)})}else this.executeQueryOperations(e,n,r)},e.prototype.executeQueryOperations=function(e,t,i){var n=this,r=this.options.dataManager.adaptor.getModuleName;t.push(this.options.dataSource.executeQuery(e)),i.push(this.dataSuccess.bind(this));var s=0;Promise.all(t).then(function(e){n.infiniteQueryExecutionPending=!n.infiniteRenderMod&&n.infiniteQueryExecutionPending;for(var t=0;t<e.length;t++)n.infiniteDataCount=n.infiniteRenderMod&&!n.infiniteDataCount?e[t].count:n.infiniteDataCount,r&&"ODataV4Adaptor"===r()&&n.searchInputArgs&&""!==n.searchInputArgs.element.value&&!(0,o.isNullOrUndefined)(e[parseInt(t.toString(),10)].actual)?i[s++](e[parseInt(t.toString(),10)].actual):i[s++](e[parseInt(t.toString(),10)].result)}).catch(function(){n.infiniteRenderMod&&n.parent.filterSettings&&"Shimmer"===n.parent.filterSettings.loadingIndicator&&n.parent.showMaskRow(void 0,n.dialogObj.element)})},e.prototype.dataSuccess=function(t){if(this.infiniteInitialLoad||!this.infiniteDataCount||!(this.infiniteSkipCnt>=this.infiniteDataCount&&!this.infiniteSearchValChange||0===t.length)){this.fullData=t;var i={dataSource:this.fullData,executeQuery:!0,field:this.options.field};if(this.parent.notify(qn,i),i.executeQuery){var n=new a.Query;this.customQuery||this.queryGenerate(n);var r=new a.DataManager(i.dataSource).executeLocal(n),s=this.options.column;this.filteredData=e.getDistinct(r,this.options.field,s,this.foreignKeyData,this).records||[]}var o=i.executeQuery?this.filteredData:i.dataSource;this.processDataSource(null,!0,o,i),(this.infiniteRenderMod&&this.infiniteInitialLoad||!this.infiniteRenderMod)&&(this.sInput?this.sInput.focus():this.dlg.querySelector(".e-chk-hidden")&&this.dlg.querySelector(".e-ftrchk")&&(this.dlg.querySelector(".e-chk-hidden").focus(),this.dlg.querySelector(".e-ftrchk").classList.add("e-chkfocus"))),(this.infiniteInitialLoad||this.infiniteSearchValChange)&&(this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1);var l={requestType:De,columnName:this.options.field,columnType:this.options.type};l.filterModel=this,this.parent.notify($i,l),this.isCheckboxFilterTemplate&&(0,y.hideSpinner)(this.spinner)}},e.prototype.queryGenerate=function(e){if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var t=this.options.dataManager.adaptor.getModuleName;if(!(0,o.isNullOrUndefined)(this.parent.getForeignKeyColumns())&&this.parent.getForeignKeyColumns().length||!(0,o.isNullOrUndefined)(this.parent.getDataModule)&&t&&"ODataV4Adaptor"===t())this.parent.getDataModule().searchQuery(e);else{var i=this.parent.searchSettings,n=i.fields.length?i.fields:this.options.columns.map(function(e){return e.field});e.search(i.key,n,i.operator,i.ignoreCase,i.ignoreAccent)}}if(this.options.filteredColumns.length){for(var r=[],s=0;s<this.options.filteredColumns.length;s++){var a=this.options.filteredColumns[parseInt(s.toString(),10)];this.options.uid?(a.uid=a.uid||this.parent.getColumnByField(a.field).uid,a.uid!==this.options.uid&&r.push(this.options.filteredColumns[parseInt(s.toString(),10)])):a.field!==this.options.field&&r.push(this.options.filteredColumns[parseInt(s.toString(),10)])}var l=this.getPredicateFromCols(r);l&&e.where(l)}},e.prototype.processDataSource=function(e,t,i,n){(0,y.showSpinner)(this.spinner),this.updateResult();var r={dataSource:this.fullData,isCheckboxFilterTemplate:!1,column:this.options.column,element:this.cBox,type:this.options.type,format:this.options.type,btnObj:this.options.isResponsiveFilter?null:this.dialogObj.btnObj[0],searchBox:this.searchBox};this.parent.notify(Mr,r),this.isCheckboxFilterTemplate=r.isCheckboxFilterTemplate,this.isCheckboxFilterTemplate?this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask():this.createFilterItems(i,t,n)},e.prototype.processSearch=function(e){this.processDataOperation(e)},e.prototype.updateResult=function(){this.result={};var e=this.infiniteRenderMod&&this.existingPredicate[this.options.field]?this.getPredicateFromCols(this.existingPredicate[this.options.field]):this.getPredicateFromCols(this.options.filteredColumns),t=new a.Query;e&&t.where(e),this.parent.notify(xr,{query:t});for(var i=0,n=new a.DataManager(this.fullData).executeLocal(t);i<n.length;i++){var r=n[i];this.result[Ml(this.options.field,r)]=!0}},e.prototype.clickHandler=function(e){var t;(0,o.isNullOrUndefined)(rl.timer)||clearTimeout(rl.timer);var i=e.target;if((0,o.isNullOrUndefined)(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||!_a(i,"e-mask-ftrchk")){var n=_a(i,"e-checkbox-wrapper");if(_a(i,"e-searchbox")&&this.searchBoxClick(e),n&&!this.isCheckboxFilterTemplate){var r=n.querySelector(".e-selectall");if(r)this.updateAllCBoxes(!r.classList.contains("e-check"));else if(Il(n.parentElement),this.infiniteRenderMod&&!n.parentElement.querySelector(".e-add-current")){this.localInfiniteSelectionInteracted=!0;var s=this.options.allowCaseSensitive,l=n.parentElement.querySelector(".e-frame").previousSibling,h=l.checked?"equal":"notequal",d=l.checked?"or":"and",p={field:this.options.field,predicate:d,uid:this.options.uid,operator:h,type:this.options.type,matchCase:s,ignoreAccent:this.options.ignoreAccent},c=this.values[_a(l,"e-ftrchk").getAttribute("data-uid")];if(this.updateInfiniteManualSelectPred(p,c),this.infiniteRenderMod&&!this.options.isRemote&&this.options.parentTotalDataCount&&this.infiniteUnloadParentExistPred.length){var u=this.getPredicateFromCols((t=this.options.filteredColumns).concat.apply(t,this.infiniteManualSelectMaintainPred)),g=new a.Query;u&&g.where(u);var f=new a.DataManager(this.infinitePermenantLocalData).executeLocal(g);this.options.parentTotalDataCount!==f.length&&(this.options.parentTotalDataCount=f.length),!this.options.parentTotalDataCount&&this.infiniteUnloadParentExistPred.length&&(this.infiniteUnloadParentExistPred=[])}!this.infiniteUnloadParentExistPred.length||this.options.parentTotalDataCount!==this.infiniteDataCount&&this.options.parentTotalDataCount||(this.infiniteUnloadParentExistPred=[])}this.updateIndeterminatenBtn(),n.querySelector(".e-chk-hidden").focus()}this.setFocus(_a(n,"e-ftrchk"))}},e.prototype.updateInfiniteManualSelectPred=function(e,t){for(var i=0;i<this.infiniteManualSelectMaintainPred.length;i++){var n=this.infiniteManualSelectMaintainPred[i];if(n.value+""==t+""&&("equal"===n.operator||"notequal"===n.operator)){this.infiniteManualSelectMaintainPred.splice(i,1);break}}("or"!==e.predicate||this.localInfiniteSelectAllClicked&&this.infiniteLocalSelectAll)&&("and"!==e.predicate||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll)||(this.infiniteManualSelectMaintainPred.push((0,o.extend)({},{value:t},e)),"or"===e.predicate?this.options.parentTotalDataCount++:this.options.parentTotalDataCount--)},e.prototype.focusNextOrPrev=function(e,t){var i="ArrowUp"===e.key?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1,n=t[(i+t.length)%t.length];if(n){n.focus();var r=n.classList.contains("e-chk-hidden")?_a(n,"e-ftrchk"):n;this.setFocus(r)}},e.prototype.keyupHandler=function(e){if("Tab"!==e.key&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)||this.setFocus(_a(e.target,"e-ftrchk")),("ArrowUp"===e.key||"ArrowDown"===e.key)&&!e.altKey&&this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type){e.preventDefault();var t=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"])'));this.focusNextOrPrev(e,t)}},e.prototype.setFocus=function(e){var t=this.dlg.querySelector(".e-chkfocus");t&&t.classList.remove("e-chkfocus"),e&&e!==t&&e.classList.add("e-chkfocus")},e.prototype.updateAllCBoxes=function(e){this.infiniteRenderMod&&(this.localInfiniteSelectAllClicked=!0,this.infiniteLocalSelectAll=e,this.infiniteUnloadParentExistPred=[],this.infiniteManualSelectMaintainPred=[]);for(var t=0,i=this.infiniteRenderMod?this.infiniteLoadedElem.map(function(e){return e.querySelector(".e-frame")}):[].slice.call(this.cBox.querySelectorAll(".e-frame:not(.e-add-current)"));t<i.length;t++){var n=i[t];Dl(n,e),xl(n.previousSibling,e)}},e.prototype.dialogOpen=function(){this.parent.element.classList.contains("e-device")&&(this.dialogObj.element.querySelector(".e-input-group").classList.remove("e-input-focus"),this.options.isResponsiveFilter||this.dialogObj.element.querySelector(".e-btn").focus())},e.prototype.createCheckbox=function(e,t,i){var n=t?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);xl(n.querySelector("input"),t);var r=n.querySelector(".e-label"),s=Bl({},i,{column:this.options.column,parent:this.parent}),a=this.parent.getModuleName;r[""+((0,o.isNullOrUndefined)(a)||"spreadsheet"!==a()?this.options.disableHtmlEncode?"textContent":"innerHTML":"textContent")]=!(0,o.isNullOrUndefined)(e)&&e.toString().length?this.parent.enableHtmlSanitizer?o.SanitizeHtmlHelper.sanitize(e):e:this.getLocalizedLabel("Blanks");var l=Za("cbox");if(r.setAttribute("id",l+"cboxLabel"),n.querySelector("input").setAttribute("aria-labelledby",r.id),r.innerHTML===this.getLocalizedLabel("Blanks")&&(this.isBlanks=!0),"boolean"==typeof e&&(r.innerHTML=!0===e?this.getLocalizedLabel("FilterTrue"):this.getLocalizedLabel("FilterFalse")),(0,o.addClass)([r],["e-checkboxfiltertext"]),this.options.template&&i[this.options.column.field]!==this.getLocalizedLabel("SelectAll")&&i[this.options.column.field]!==this.getLocalizedLabel("AddCurrentSelection")){r.innerHTML="";var h=this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&!(this.options.column.filter.itemTemplate.prototype&&this.options.column.filter.itemTemplate.prototype.CSPTemplate),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;h||d?(this.options.template(s,this.parent,"filterItemTemplate",null,null,null,r),this.parent.renderTemplates()):$a(r,this.options.template(s,this.parent,"filterItemTemplate",null,null,null,null,this.parent.root))}return n},e.prototype.updateIndeterminatenBtn=function(){var e,t=this.infiniteRenderMod?this.infiniteLoadedElem.length:this.cBox.children.length-1,i=[],n=!1,r=this.infiniteRenderMod?this.sBox.querySelector(".e-selectall"):this.cBox.querySelector(".e-selectall"),s=this.infiniteRenderMod?this.infiniteLoadedElem.filter(function(e){return e.querySelector(".e-check")}).length:this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)").length;this.cBox.querySelector(".e-add-current")&&(t-=1),this.options.isResponsiveFilter||((e=this.dialogObj.btnObj[0]).disabled=!1);var a=r.previousSibling;xl(a,!1),a.indeterminate=!1,!this.infiniteRenderMod||""!==this.sInput.value||this.options.parentCurrentViewDataCount||this.localInfiniteSelectionInteracted||this.localInfiniteSelectAllClicked&&(this.infiniteLocalSelectAll||s)||t===s&&t!==s?this.infiniteRenderMod&&this.infiniteLoadedElem.length<this.infiniteDataCount&&this.infiniteUnloadParentExistPred.length&&(!s||t===s)&&this.infiniteLocalSelectAll&&(s?t+=this.infiniteUnloadParentExistPred.length:s+=this.infiniteUnloadParentExistPred.length):s=0,t===s?(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-check"],xl(a,!0)):s?(i=["e-stop"],a.indeterminate=!0):(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!1,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-uncheck"],n=!0,e&&(e.disabled=!0)),e&&(this.filterState=!e.disabled,e.dataBind()),(0,o.removeClass)([r],["e-check","e-stop","e-uncheck"]),(0,o.addClass)([r],i),this.parent.notify(rr,{disabled:n})},e.prototype.createFilterItems=function(e,t,i){var n,r,s,l,h=this.options.dataManager.adaptor.getModuleName,d=this.parent.createElement("div"),p=!1;this.options.isResponsiveFilter||(l=this.dialogObj.btnObj[0]);var c=-1,u="ejValue";i.executeQuery||(u=i.field);for(var g=0;g<e.length;g++){var f=(0,o.getValue)(u,e[parseInt(g.toString(),10)]);if((""===f||(0,o.isNullOrUndefined)(f))&&(c+=1),h&&"ODataV4Adaptor"===h()){var m=(0,o.getValue)("dataObj.groupCount",e[parseInt(g.toString(),10)]);(0,o.isNullOrUndefined)(m)||(this.infiniteOdataCount+=m)}}if(this.infiniteRenderMod||(this.itemsCnt=-1!==c?e.length-c:e.length),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask(),e.length&&!this.renderEmpty){var v=this.getLocalizedLabel("SelectAll"),S=this.cBox.querySelector(".e-checkfltrnmdiv");S&&S.classList.remove("e-checkfltrnmdiv");var C=this.createCheckbox(v,!1,((n={})[this.options.field]=v,n));if(this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(0,o.addClass)([C],this.parent.cssClass.split(" ")):(0,o.addClass)([C],[this.parent.cssClass])),this.infiniteInitialLoad||!this.infiniteRenderMod)(P=Rl(Za("cbox"),C,"e-ftrchk")).querySelector(".e-frame").classList.add("e-selectall"),this.infiniteRenderMod?(P.classList.add("e-infinitescroll"),this.parent.enableAdaptiveUI&&(this.spinner.style.height=this.spinner.offsetHeight-Lh(this.cBox)+"px"),this.sBox.insertBefore(P,this.spinner)):d.appendChild(P);else this.sBox.querySelector(".e-ftrchk .e-selectall")&&(this.sBox.querySelector(".e-ftrchk .e-selectall").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-selectall").parentElement.classList.remove("e-checkbox-disabled"));var w=new a.Predicate("field","equal",this.options.field);this.options.foreignKeyValue&&(w=w.or("field","equal",this.options.foreignKeyValue));var b=new a.DataManager(this.options.filteredColumns).executeLocal((new a.Query).where(w)).length;if(this.sInput&&this.sInput.value){var I=this.createCheckbox(this.getLocalizedLabel("AddCurrentSelection"),!1,((r={})[this.options.field]=this.getLocalizedLabel("AddCurrentSelection"),r));if(this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(0,o.addClass)([I],this.parent.cssClass.split(" ")):(0,o.addClass)([I],[this.parent.cssClass])),this.infiniteRenderMod&&!(0,o.isNullOrUndefined)(this.sBox.children[2])&&this.sBox.children[2].innerText!==this.getLocalizedLabel("AddCurrentSelection")||!this.infiniteRenderMod){var x=Rl(Za("cbox"),I,"e-ftrchk");if(x.querySelector(".e-frame").classList.add("e-add-current"),this.infiniteRenderMod){x.classList.add("e-infinitescroll"),this.sBox.insertBefore(x,this.spinner);var R=this.spinner.querySelector(".e-checkboxlist"),D=Math.ceil(x.getBoundingClientRect().height);R.style.height=parseInt(getComputedStyle(R).height.split("px")[0],10)-D+"px",R.style.minHeight=R.style.height}else d.appendChild(x)}else this.sBox.querySelector(".e-ftrchk .e-add-current")&&(this.sBox.querySelector(".e-ftrchk .e-add-current").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-add-current").parentElement.classList.remove("e-checkbox-disabled"))}else if(this.infiniteRenderMod&&!(0,o.isNullOrUndefined)(this.sBox.children[2])&&this.sBox.children[2].innerText===this.getLocalizedLabel("AddCurrentSelection")){R=this.spinner.querySelector(".e-checkboxlist");var T=Math.ceil(this.sBox.children[2].getBoundingClientRect().height);R.style.height=parseInt(getComputedStyle(R).height.split("px")[0],10)+T+"px",R.style.minHeight=R.style.height,(0,o.remove)(this.sBox.children[2])}var E=void 0;for(g=0;g<e.length;g++){var O=Za("cbox");this.values[""+O]=(0,o.getValue)(u,e[parseInt(g.toString(),10)]);var k=(0,o.getValue)(this.options.field,e[parseInt(g.toString(),10)]);if(this.options.formatFn){if("dateonly"===this.options.type&&!(0,o.isNullOrUndefined)(k)){var A=k.split(/[^0-9.]/);k=new Date(parseInt(A[0],10),parseInt(A[1],10)-1,parseInt(A[2],10))}k=this.valueFormatter.toView(k,this.options.formatFn)}var F={value:k,column:this.options.column,data:e[parseInt(g.toString(),10)]};if(this.parent.notify(rn,F),""===(k=F.value)||(0,o.isNullOrUndefined)(k)){if(E)continue;E=!0}this.infiniteRenderMod&&this.updateInfiniteUnLoadedCheckboxExistPred(k,this.infiniteUnloadParentExistPred);var M=this.localInfiniteSelectAllClicked?this.createCheckbox(k,this.infiniteLocalSelectAll,(0,o.getValue)("dataObj",e[g])):this.createCheckbox(k,this.getCheckedState(b,this.values[""+O]),(0,o.getValue)("dataObj",e[g]));d.appendChild(Rl(O,M,"e-ftrchk")),this.infiniteRenderMod&&(d.lastChild.style.height=Lh(this.cBox)+"px")}var L=this.cBox.scrollTop;!this.infiniteRenderMod||this.infiniteSearchValChange?this.cBox.innerHTML="":this.infiniteRenderMod&&this.cBox.children.length&&Fh([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteRenderMod&&((s=this.infiniteLoadedElem).push.apply(s,[].slice.call(d.children)),this.itemsCnt=-1!==c?this.infiniteLoadedElem.length-c:this.infiniteLoadedElem.length),this.infiniteUnloadParentExistPred.length&&(this.infiniteLoadedElem.length>=this.infiniteDataCount||!this.options.parentCurrentViewDataCount||this.options.parentTotalDataCount===this.infiniteDataCount&&this.options.parentCurrentViewDataCount)&&(this.infiniteUnloadParentExistPred=[]),$a(this.cBox,[].slice.call(d.children)),this.infiniteRenderMod&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=Math.round(L-this.cBox.scrollTop)),this.updateIndeterminatenBtn(),this.infiniteRenderMod?p=!(!l||!l.disabled):(l&&(l.disabled=!1),p=!1)}else{if(d.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",this.infiniteRenderMod){var P;if(P=this.sBox.querySelector(".e-ftrchk .e-selectall")){var N=P.parentElement.parentElement;P.classList.contains("e-check")?Il(N):P.classList.contains("e-stop")&&(Il(N),P.classList.remove("e-stop"),Il(N)),P.previousSibling.disabled=!0,P.parentElement.classList.add("e-checkbox-disabled")}var B=this.sBox.querySelector(".e-ftrchk .e-add-current");if(B){var z=B.parentElement.parentElement;B.classList.contains("e-check")&&Il(z),B.previousSibling.disabled=!0,B.parentElement.classList.add("e-checkbox-disabled")}}this.cBox.appendChild(this.parent.createElement("div",{className:"e-checkfltrnmdiv"})),$a(this.cBox.children[0],[].slice.call(d.children)),l&&(l.disabled=!0),p=!0,this.filterState=!p}l&&e.length&&(this.filterState=!l.disabled,l.dataBind());var q={requestType:Re,dataSource:this.renderEmpty?[]:e};q.filterModel=this,this.parent.notify($i,q),this.parent.notify(rr,{disabled:p}),this.infiniteRenderMod&&this.infiniteInitialLoad&&(this.cBox.style.marginTop="0px"),(0,y.hideSpinner)(this.spinner),h&&"ODataV4Adaptor"===h()&&this.infiniteOdataCount===this.options.parentTotalDataCount&&this.infiniteDataCount!==this.options.parentTotalDataCount&&(this.infiniteDataCount=this.infiniteLoadedElem.length)},e.prototype.updateInfiniteUnLoadedCheckboxExistPred=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.value instanceof Date?this.valueFormatter.toView(n.value,this.options.formatFn):n.value,s=this.options.column;if(s.isForeignColumn()){var a=El(s,{},r,this.foreignKeyData)[0];e=(0,o.getValue)(s.foreignKeyField,a)}e!==r||"equal"!==n.operator&&"notequal"!==n.operator||(this.infiniteManualSelectMaintainPred.push(t[i]),t.splice(i,1),i--)}},e.prototype.getCheckedState=function(e,t){if(this.isFiltered&&e){var i=!(!this.sInput||!this.sInput.value)||this.result[""+t];return this.infiniteRenderMod?i:"notequal"===this.options.operator?!i:i}return!0},e.getDistinct=function(e,t,i,n,r){for(var s,l=e.length,h=[],d={},p=!(!i||!i.isForeignColumn)&&i.isForeignColumn();l--;){var c="string"!=typeof(s=Ml(t,s=e[parseInt(l.toString(),10)]))||(0,o.isNullOrUndefined)(r)||(0,o.isNullOrUndefined)(r.parent)||(0,o.isNullOrUndefined)(r.parent.filterSettings)||(0,o.isNullOrUndefined)(r.parent.filterSettings.enableCaseSensitivity)?s:s.toLowerCase();if(!(c in d)){var u={};if(u.ejValue=s,d[""+c]=!0,p){var g=El(i,{},s,n)[0];(0,o.setValue)(Ri,g,e[parseInt(l.toString(),10)]),s=(0,o.getValue)(i.foreignKeyValue,g)}(0,o.setValue)(t,(0,o.isNullOrUndefined)(s)?null:s,u),(0,o.setValue)("dataObj",e[parseInt(l.toString(),10)],u),h.push(u)}}return a.DataUtil.group(a.DataUtil.sort(h,t,a.DataUtil.fnAscending),"ejValue")},e.getPredicate=function(t){for(var i=a.DataUtil.distinct(t,"field",!0)||[],n=[],r={},s=0;s<i.length;s++)0!==(n=new a.DataManager(t).executeLocal((new a.Query).where("field","equal",i[parseInt(s.toString(),10)].field))).length&&(r[i[parseInt(s.toString(),10)].field]=e.generatePredicate(n));return r},e.generatePredicate=function(t){var i,n=t?t.length:0,r=e.updateDateFilter(t[0]);r.ignoreAccent=!(0,o.isNullOrUndefined)(r.ignoreAccent)&&r.ignoreAccent,i="date"===r.type||"datetime"===r.type||"dateonly"===r.type?Al(r,r.type):r.ejpredicate?r.ejpredicate:new a.Predicate(r.field,r.operator,r.value,!e.getCaseValue(r),r.ignoreAccent);for(var s=1;s<n;s++)t[parseInt(s.toString(),10)]=e.updateDateFilter(t[parseInt(s.toString(),10)]),n>2&&s>1&&("or"===t[s].predicate&&"or"===t[s-1].predicate||"and"===t[s].predicate&&"and"===t[s-1].predicate)?"date"===t[s].type||"datetime"===t[s].type||"dateonly"===t[s].type?i.predicates.push(Al(t[parseInt(s.toString(),10)],t[s].type)):i.predicates.push(new a.Predicate(t[s].field,t[parseInt(s.toString(),10)].operator,t[parseInt(s.toString(),10)].value,!e.getCaseValue(t[parseInt(s.toString(),10)]),t[parseInt(s.toString(),10)].ignoreAccent)):i="date"===t[s].type||"datetime"===t[s].type||"dateonly"===t[s].type?i[t[parseInt(s.toString(),10)].predicate](Al(t[parseInt(s.toString(),10)],t[parseInt(s.toString(),10)].type),t[parseInt(s.toString(),10)].type,t[parseInt(s.toString(),10)].ignoreAccent):t[parseInt(s.toString(),10)].ejpredicate?i[t[parseInt(s.toString(),10)].predicate](t[parseInt(s.toString(),10)].ejpredicate):i[t[parseInt(s.toString(),10)].predicate](t[parseInt(s.toString(),10)].field,t[parseInt(s.toString(),10)].operator,t[parseInt(s.toString(),10)].value,!e.getCaseValue(t[parseInt(s.toString(),10)]),t[parseInt(s.toString(),10)].ignoreAccent);return i||null},e.getCaseValue=function(e){return(0,o.isNullOrUndefined)(e.matchCase)?!("string"===e.type||(0,o.isNullOrUndefined)(e.type)&&"string"==typeof e.value):e.matchCase},e.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||"dateonly"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e},e}(),Yh=c(778),Jh=c(570),Zh=c(215),$h=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ed=function(e){function t(t,i){var n=e.call(this,t)||this;return n.childRefs=[],n.eventHandlers={},n.isDevice=!1,n.focusedMenuItem=null,n.customFilterOperators=i,n.isExcel=!0,n}return $h(t,e),t.prototype.getCMenuDS=function(e,t){var i={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","NotContains","","CustomFilter"]};i.date=i.number,i.datetime=i.number,i.dateonly=i.number;var n=[];if(!(0,o.isNullOrUndefined)(e))for(var r=0;r<i[""+e].length;r++)i[""+e][parseInt(r.toString(),10)].length?t?n.push({text:this.getLocalizedLabel(i[""+e][parseInt(r.toString(),10)])+"...",iconCss:"e-icons e-icon-check "+(t===i[""+e][parseInt(r.toString(),10)].toLowerCase()?"":"e-emptyicon")}):n.push({text:this.getLocalizedLabel(i[""+e][parseInt(r.toString(),10)])+"..."}):n.push({separator:!0});return n},t.prototype.destroy=function(){if(this.dlg&&(this.unwireExEvents(),e.prototype.closeDialog.call(this)),!this.isDevice&&this.menuObj){var t=this.menuObj.element.querySelector("li.e-focused");t&&_a(t,"e-excel-menu")||this.destroyCMenu()}this.dlgObj&&!this.dlgObj.isDestroyed&&this.removeDialog()},t.prototype.createMenu=function(e,t,i,n){this.menu=this.parent.createElement("div",{className:"e-contextmenu-wrapper"}),this.parent.enableRtl?this.menu.classList.add("e-rtl"):this.menu.classList.remove("e-rtl"),this.parent.cssClass&&this.menu.classList.add(this.parent.cssClass);var r=this.parent.createElement("ul"),s=t?"e-excl-filter-icon e-filtered":"e-excl-filter-icon";if(this.parent.allowSorting&&"grid"===this.parent.getModuleName()&&!this.options.isResponsiveFilter){var a=this.parent.getColumnHeaderByUid(n.uid).getAttribute("aria-sort"),l=this.parent.getColumnByField(n.field).allowSorting,h=l&&"ascending"!==a?"e-excel-ascending":"e-disabled e-excel-ascending",d=l&&"descending"!==a?"e-excel-descending":"e-disabled e-excel-descending",p="string"===e?this.getLocalizedLabel("SortAtoZ"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByOldest"):this.getLocalizedLabel("SortSmallestToLargest"),c="string"===e?this.getLocalizedLabel("SortZtoA"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByNewest"):this.getLocalizedLabel("SortLargestToSmallest");r.appendChild(this.createMenuElem(p,h,"e-sortascending")),r.appendChild(this.createMenuElem(c,d,"e-sortdescending"));var u=this.parent.createElement("li",{className:"e-separator e-menu-item e-excel-separator"});r.appendChild(u)}this.options.isResponsiveFilter||r.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),t?"":"e-disabled",s)),"boolean"!==e&&r.appendChild(this.createMenuElem(this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",dateonly:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[""+e]),"e-submenu",!(0,o.isNullOrUndefined)(e)&&i&&this.ensureTextFilter()?"e-icon-check":s+" e-emptyicon",!0)),this.menu.appendChild(r),this.parent.notify(tn,{element:this.menu}),this.parent.notify(sr,{isFiltered:t})},t.prototype.createMenuElem=function(e,t,i,n){var r=this.parent.createElement("li",{className:t+" e-menu-item"});return r.innerHTML=e,r.tabIndex=r.classList.contains("e-disabled")?-1:0,r.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+i,attrs:{"aria-hidden":"true"}}),r.firstChild),n&&r.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),r},t.prototype.wireExEvents=function(){o.Browser.isDevice||o.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),o.EventHandler.add(this.dlg,"click",this.clickExHandler,this),o.EventHandler.add(this.dlg,"keyup",this.keyUp,this),o.EventHandler.add(this.dlg,"keydown",this.keyDown,this)},t.prototype.unwireExEvents=function(){o.Browser.isDevice||o.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),o.EventHandler.remove(this.dlg,"click",this.clickExHandler),o.EventHandler.remove(this.dlg,"keyup",this.keyUp),o.EventHandler.remove(this.dlg,"keydown",this.keyDown)},t.prototype.clickExHandler=function(e){var t=_a(e.target,"e-menu-item");t&&(this.getLocalizedLabel("ClearFilter")===t.innerText.trim()?(this.clearFilter(),this.closeDialog()):(this.options.isResponsiveFilter||o.Browser.isDevice)&&this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type])===t.innerText.trim()&&this.hoverHandler(e))},t.prototype.focusNextOrPrevElement=function(e,t,i){var n="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1,r=t[(n+t.length)%t.length];if(r){r.focus();var s=r.classList.contains("e-chk-hidden")?"e-chkfocus":i,o=r.classList.contains("e-chk-hidden")?_a(r,"e-ftrchk"):_a(r,"e-menu-item");this.excelSetFocus(o,s)}},t.prototype.keyUp=function(e){if("Tab"===e.key&&e.shiftKey||"Tab"===e.key){var t=e.target.classList.contains("e-chk-hidden")?"e-chkfocus":"e-menufocus",i=e.target.classList.contains("e-menu-item")?_a(e.target,"e-menu-item"):_a(e.target,"e-ftrchk");this.excelSetFocus(i,t)}else if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)"Enter"!==e.key&&"ArrowRight"!==e.code||!e.target.classList.contains("e-menu-item")||(e.preventDefault(),e.target.click(),e.target.classList.contains("e-submenu")&&(this.hoverHandler(e),this.menuObj.element.querySelector(".e-menu-item").focus(),this.excelSetFocus(_a(this.menuObj.element.querySelector(".e-menu-item"),"e-menu-item"),"e-focused"),this.focusedMenuItem=this.menuObj.element.querySelector(".e-menu-item")));else{e.preventDefault();var n=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)'));this.focusNextOrPrevElement(e,n,"e-menufocus")}},t.prototype.keyDown=function(e){"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.preventDefault()},t.prototype.excelSetFocus=function(e,t){var i=this.cmenu.querySelector("."+t),n=this.menu.querySelector("."+t);i&&i.classList.remove(t),n&&n.classList.contains("e-menufocus")&&n.classList.remove(t),e&&e.classList.add(t)},t.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),o.EventHandler.remove(this.menuObj.element,"keydown",this.contextKeyDownHandler),(0,o.remove)(this.cmenu),this.parent.notify(or,{target:null,header:"",isOpen:!1,col:this.options.column}))},t.prototype.hoverHandler=function(e){if(!this.options.isResponsiveFilter||"mouseover"!==e.type){var t,i=e.target.querySelector(".e-contextmenu"),n=_a(e.target,"e-menu-item"),r=this.menu.querySelector(".e-focused");if(r&&r.classList.remove("e-focused"),n&&(n.classList.add("e-focused"),t=n.classList.contains("e-submenu")),!i){if(!t){var s=this.menu.querySelector(".e-submenu");(0,o.isNullOrUndefined)(s)||s.classList.remove("e-selected"),this.destroyCMenu()}var a=this.ensureTextFilter();if(!this.isCMenuOpen&&t){n.classList.add("e-selected"),this.isCMenuOpen=!0;var l={items:this.getCMenuDS(this.options.type,a?a.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,animationSettings:{effect:o.Browser.isDevice?"ZoomIn":"None"},beforeClose:this.preventClose.bind(this),cssClass:this.options.isResponsiveFilter&&this.parent.cssClass?"e-res-contextmenu-wrapper "+this.parent.cssClass:this.options.isResponsiveFilter?"e-res-contextmenu-wrapper":this.parent.cssClass?this.parent.cssClass:""};this.parent.element.appendChild(this.cmenu),this.menuObj=new Zh.ContextMenu(l),this.menuObj.isAngular=lh(this.parent),this.menuObj.appendTo(this.cmenu),o.EventHandler.add(this.menuObj.element,"keydown",this.contextKeyDownHandler,this);var h=this.menu.querySelector(".e-submenu").getBoundingClientRect(),d={top:0,left:0};if(this.options.isResponsiveFilter){var p=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.menuObj.element.style.height="calc(100% - "+p+"px)",this.menuObj.open(p,0,document.body);var c=this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type]);this.parent.notify(or,{target:this.menuObj.element.parentElement,header:c,isOpen:!0})}else{if(o.Browser.isDevice){this.isDevice=!0;var u=this.getContextBounds();d.top=(window.innerHeight-u.height)/2,d.left=(window.innerWidth-u.width)/2,this.closeDialog(),this.isDevice=!1}else d.top=o.Browser.isIE?window.pageYOffset+h.top:window.scrollY+h.top,d.left=this.getCMenuYPosition(this.dlg);this.menuObj.open(d.top,d.left,e.target)}Vl(this.parent.element,this.menuObj.element.parentElement)}}}},t.prototype.contextKeyDownHandler=function(e){if("Tab"===e.key&&e.shiftKey||"Tab"===e.key){e.preventDefault();var t=Array.from(this.menuObj.element.querySelectorAll('[tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)'));this.focusNextOrPrevElement(e,t,"e-focused")}else"ArrowLeft"!==e.key&&"Escape"!==e.key||(e.preventDefault(),this.menuObj.close(),this.focusedMenuItem=null,document.querySelector(".e-submenu.e-menu-item").classList.remove("e-selected"),document.querySelector(".e-submenu.e-menu-item").focus())},t.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},t.prototype.preventClose=function(e){if(this.options&&this.options.isResponsiveFilter&&e.event){var t=e.event.target,i=t.classList&&(t.classList.contains("e-resfilterback")||t.classList.contains("e-res-back-btn")||t.classList.contains("e-menu-item"));e.cancel=!i}else e.event instanceof MouseEvent&&e.event.target&&e.event.target.classList&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},t.prototype.getContextBounds=function(){return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},t.prototype.getCMenuYPosition=function(e){var t=this.getContextBounds().width,i=e.getBoundingClientRect(),n=this.parent.element.getBoundingClientRect(),r=i.left-t-n.left,s=i.right+t-n.right,o=e.offsetWidth-e.clientWidth;return o=o?o+1:0,(this.parent.enableRtl?r:s)<1?i.right+1-o:i.left-t-1+o},t.prototype.openDialog=function(e){var t=this;if(this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),!e.cancel){this.dialogObj.dataBind();var i=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return t.options.field===e.field}).length;this.createMenu(e.type,i>0,1===i||2===i,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),this.parent&&!(0,o.isNullOrUndefined)(this.parent.getContent)&&this.parent.getContent()&&this.parent.getContent().firstElementChild.offsetHeight<this.dlg.offsetHeight&&!_a(this.parent.element,"e-gantt-dialog")&&hh(this.parent,this.dialogObj),this.parent.enableRtl&&this.dlg.classList.add("e-rtl"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.dlg.querySelectorAll(".e-menu-item").forEach(function(e){e.scrollWidth>e.clientWidth&&e.setAttribute("title",e.textContent)}),e.column.showColumnMenu&&this.parent.notify(Si,{}),this.wireExEvents()}},t.prototype.closeDialog=function(){this.destroy()},t.prototype.selectHandler=function(e){e.item&&(this.parent.notify(ar,{}),this.menuItem=e.item,this.closeDialog(),this.renderDialogue(e))},t.prototype.renderDialogue=function(e){var t=this,i=e?e.element:void 0,n=this.options.field,r=!(0,o.isNullOrUndefined)(n)&&hl(n),s=!(0,o.isNullOrUndefined)(n)&&dl(n),a=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:r?s+"-xlflmenu":n+"-xlflmenu"});(this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:r?s+"-xlfldlg":n+"-xlfldlg"}),this.options.isResponsiveFilter)?document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv);this.dlgObj=new y.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,locale:this.parent.locale,closeOnEscape:!0,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){for(var e=[].slice.call(t.dlgObj.element.querySelectorAll("table.e-xlfl-table tr.e-xlfl-fields")),i=0;i<e.length;i++){var n=e[i].children[1].querySelector(".e-control"),r=e[i].querySelector(".e-dropdownlist.e-control").ej2_instances[0];"isempty"===r.value||"isnotempty"===r.value||"isnull"===r.value||"isnotnull"===r.value?n.ej2_instances[0].enabled=!1:n&&!(0,o.isNullOrUndefined)(n.getAttribute("disabled"))&&(n.ej2_instances[0].enabled=!0)}var s=t.dlgObj.element.querySelector("table.e-xlfl-table>tr");if(t.options.column.filterTemplate){var a=hl(t.options.column.field)?dl(t.options.column.field):t.options.column.field,l=t.parent.isReact&&"string"!=typeof t.options.column.filterTemplate&&!(t.options.column.filterTemplate.prototype&&t.options.column.filterTemplate.prototype.CSPTemplate),h=t.parent.parentDetails&&t.parent.parentDetails.parentInstObj&&t.parent.parentDetails.parentInstObj.isReact;l||h?t.parent.renderTemplates(function(){s.querySelector("#"+a+"-xlfl-frstvalue").focus()}):s.querySelector("#"+a+"-xlfl-frstvalue").focus()}},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,i,n),buttons:[{click:this.filterBtnClick.bind(this,n),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-xlfl-okbtn "+this.parent.cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:this.parent.cssClass?"e-xlfl-cancelbtn "+this.parent.cssClass:"e-xlfl-cancelbtn"}}],content:a,width:430,animationSettings:{effect:"None"},cssClass:this.parent.cssClass?this.parent.cssClass:""});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),ah(this.parent,this.dlgObj),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.childRefs.unshift(this.dlgObj),this.dlgObj.appendTo(this.dlgDiv)},t.prototype.renderResponsiveDialog=function(){if(this.options.isResponsiveFilter){var e=document.querySelector(".e-row-responsive-filter");e&&e.classList.remove("e-row-responsive-filter"),this.dlgObj.buttons=[{}],this.dlgObj.header=void 0,this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.showCloseIcon=!1}},t.prototype.removeDialog=function(){this.parent.notify(lr,{}),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Ah(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),(0,o.remove)(this.dlgDiv),this.parent.notify(nr,{})},t.prototype.createdDialog=function(e,t){if(this.renderCustomFilter(e,t),this.dlgObj.element.style.left="0px",this.options.isResponsiveFilter){var i=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4;this.dlgObj.element.style.top=i+"px"}else this.dlgObj.element.style.top="0px";!this.options.isResponsiveFilter&&o.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify(Xi,{column:t,dialog:this.dialogObj});var n={column:t,dialogInstance:this.dialogObj,cancel:!1,target:e};if(this.parent.trigger(Qi,n),n.cancel)return(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Ah(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),void(0,o.remove)(this.dlgDiv);this.dlgObj.show(),Vl(this.parent.element,this.dlgObj.element.parentElement)},t.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),n=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"});i.appendChild(n);var r=this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"});i.appendChild(r),this.renderFilterUI(t,i)},t.prototype.filterBtnClick=function(e){var t,i,n=!(0,o.isNullOrUndefined)(e)&&hl(e),r=!(0,o.isNullOrUndefined)(e)&&dl(e),s=n?r:e;"string"===this.options.type&&(0,o.isNullOrUndefined)(this.options.template)?(t=this.dlgDiv.querySelector("#"+s+"-xlfl-frstvalue"),i=this.dlgDiv.querySelector("#"+s+"-xlfl-secndvalue")):(t=this.dlgDiv.querySelector("#"+s+"-xlfl-frstvalue").ej2_instances[0],i=this.dlgDiv.querySelector("#"+s+"-xlfl-secndvalue").ej2_instances[0]);var a,l=this.dlgDiv.querySelector("#"+s+"-xlfl-frstoptr").ej2_instances[0],h=this.dlgDiv.querySelector("#"+s+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(a=this.dlgDiv.querySelector("#"+s+"-xlflmtcase").ej2_instances[0].checked);var d=this.dlgDiv.querySelector("#"+s+"e-xlfl-frstpredicate").ej2_instances[0].checked?"and":"or";this.filterByColumn(this.options.field,l.value,t.value,d,a,this.options.ignoreAccent,h.value,i.value),this.removeDialog()},t.prototype.filterByColumn=function(e,t,i,n,r,s,l,h){var d,p=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,c=this.isForeignColumn(p)?p.foreignKeyValue:e,u=[],g={instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:r,arg6:s,arg7:l,arg8:h,cancel:!1};if(this.parent.notify(en,g),!g.cancel){u.push({field:c,predicate:n,matchCase:r,ignoreAccent:s,operator:t,value:g.arg3,type:this.options.type}),d=new a.Predicate(c,t.toLowerCase(),g.arg3,!r,s),(0,o.isNullOrUndefined)(l)||(u.push({field:c,predicate:n,matchCase:r,ignoreAccent:s,operator:l,value:g.arg8,type:this.options.type}),d=d[""+n](c,l.toLowerCase(),h,!r,s));var f={action:"filtering",filterCollection:u,field:this.options.field,ejpredicate:d,actualPredicate:u};this.isForeignColumn(p)?this.foreignKeyFilter(f,u,d):this.options.handler(f)}},t.prototype.renderOperatorUI=function(e,t,i,n,r){var s=this.parent.createElement("tr",{className:"e-xlfl-fields",attrs:{role:"row"}});t.appendChild(s);var a=this.parent.createElement("td",{className:"e-xlfl-optr"});s.appendChild(a);var l=this.parent.createElement("div",{className:"e-xlfl-optrdiv"}),h=!(0,o.isNullOrUndefined)(e)&&hl(e),d=!(0,o.isNullOrUndefined)(e)&&dl(e),p=this.parent.createElement("input",{id:h?d+i:e+i});l.appendChild(p),a.appendChild(l);var c=this.options.type+"Operator",u=this.customFilterOperators[""+c];this.optrData=u;var g=this.dropSelectedVal(this.options.column,n,r),f="";this.menuItem&&((f=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(g=r?f:void 0),f===this.getLocalizedLabel("Between")&&(g=this.getLocalizedLabel(r?"GreaterThanOrEqual":"LessThanOrEqual")));var m=this.options.column,y=new Yh.DropDownList(Ua({dataSource:u,fields:{text:"text",value:"value"},text:g,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:null},m.filter.params));y.isAngular=lh(this.parent),this.childRefs.unshift(y);var v={open:this.dropDownOpen.bind(this),change:this.dropDownValueChange.bind(this)};return Oh(p.id,[Es,Os],v,this),y.addEventListener(Es,this.eventHandlers[p.id][Es]),y.addEventListener(Os,this.eventHandlers[p.id][Os]),y.appendTo(p),{fieldElement:s,operator:this.getSelectedValue(g)}},t.prototype.removeHandlersFromComponent=function(e){e.element.classList.contains("e-dropdownlist")?kh(e,[Es,Os],this):e.element.classList.contains("e-autocomplete")&&kh(e,[D,ks],this)},t.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},t.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString();var t=e.element.closest(".e-xlfl-fields").children[1].querySelector(".e-control"),i=e.element.ej2_instances[0];"isempty"===i.value||"isnotempty"===i.value||"isnull"===i.value||"isnotnull"===i.value?t.ej2_instances[0].enabled=!1:(0,o.isNullOrUndefined)(t.getAttribute("disabled"))||(t.ej2_instances[0].enabled=!0)},t.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},t.prototype.getSelectedValue=function(e){var t=new a.DataManager(this.optrData).executeLocal((new a.Query).where("text","equal",e));return(0,o.isNullOrUndefined)(t[0])?"":t[0].value},t.prototype.dropSelectedVal=function(e,t,i){var n;return n=t&&t.length>0?2===t.length?i?t[0].operator:t[1].operator:i?t[0].operator:void 0:i&&"string"===e.type&&!e.filter.operator?"startswith":i?e.filter.operator||"equal":void 0,this.getSelectedText(n)},t.prototype.getSelectedText=function(e){var t=new a.DataManager(this.optrData).executeLocal((new a.Query).where("value","equal",e));return(0,o.isNullOrUndefined)(t[0])?"":t[0].text},t.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[""+e],n=this.parent.createElement("table",{className:"e-xlfl-table",attrs:{role:"grid"}});t.appendChild(n);var r=this.parent.createElement(Ts);r.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',n.appendChild(r);var s=this.renderOperatorUI(e,n,"-xlfl-frstoptr",i,!0);this.firstOperator=s.operator,this.renderFlValueUI(e,s,"-xlfl-frstvalue",i,!0);var o=this.parent.createElement("tr",{className:"e-xlfl-predicate",attrs:{role:"row"}});n.appendChild(o),this.renderRadioButton(e,o,i),s=this.renderOperatorUI(e,n,"-xlfl-secndoptr",i,!1),this.secondOperator=s.operator,this.renderFlValueUI(e,s,"-xlfl-secndvalue",i,!1)},t.prototype.renderRadioButton=function(e,t,i){var n=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}});t.appendChild(n);var r=this.parent.createElement("div",{className:"e-xlfl-radiodiv"});r.style.display="inline-block";var s=!(0,o.isNullOrUndefined)(e)&&hl(e),a=!(0,o.isNullOrUndefined)(e)&&dl(e),l=this.parent.createElement("input",{id:s?a+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),h=this.parent.createElement("input",{id:s?a+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}});r.appendChild(l),r.appendChild(h),n.appendChild(r),"string"===this.options.type&&this.renderMatchCase(e,t,n,"-xlflmtcase",i);var d=new Js.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",checked:!0,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:""});this.childRefs.unshift(d);var p=new Js.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:""});this.childRefs.unshift(p),"and"===(i&&2===i.length?i[1].predicate:"and")?(d.checked=!0,p.checked=!1):(p.checked=!0,d.checked=!1),d.appendTo(l),p.appendTo(h),d.element.nextElementSibling.classList.add("e-xlfl-radio-and"),p.element.nextElementSibling.classList.add("e-xlfl-radio-or")},t.prototype.removeObjects=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n&&!n.isDestroyed&&(this.removeHandlersFromComponent(n),n.destroy())}},t.prototype.renderFlValueUI=function(e,t,i,n,r){var s=this.parent.createElement("td",{className:"e-xlfl-value"});t.fieldElement.appendChild(s);var a=!(0,o.isNullOrUndefined)(e)&&hl(e),l=!(0,o.isNullOrUndefined)(e)&&dl(e),h=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),d=this.options.filteredColumns.some(function(t){return e===t.field}),p=this.options.filteredColumns.filter(function(t){return t.field===e});if(this.options.column.filterTemplate){var c={},u=this.options.column;d&&i&&(c=this.getExcelFilterData(i,c,u,n,p));var g=this.parent.isReact&&"string"!=typeof this.options.column.filterTemplate&&!(this.options.column.filterTemplate.prototype&&this.options.column.filterTemplate.prototype.CSPTemplate),f=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,m=this.parent.element.id+u.uid+"filterTemplate";if(g||f)this.options.column.getFilterTemplate()(c,this.parent,"filterTemplate",m,null,null,h);else{var y=this.options.column.getFilterTemplate()(c,this.parent,"filterTemplate",m,null,null,null,this.parent.root);$a(h,y)}g||f?this.parent.renderTemplates(function(){h.querySelector("input").id=a?l+i:e+i,s.appendChild(h)}):((this.parent.isAngular?h.children[0]:h.querySelector("input")).id=a?l+i:e+i,s.appendChild(h))}else{var v=this.parent.createElement("input",{id:a?l+i:e+i});h.appendChild(v),s.appendChild(h);var S=void 0,C=void 0;n&&n.length>0&&(S=(C=2===n.length?r?n[0]:n[1]:r?n[0]:void 0)&&C.operator===t.operator?C.value:void 0,(0,o.isNullOrUndefined)(S)&&(S=void 0)),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),dateonly:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,e,v,S,this.parent.enableRtl)}},t.prototype.getExcelFilterData=function(e,t,i,n,r){var s="-xlfl-frstvalue"===e?0:1;if("-xlfl-frstvalue"===e||r.length>1){t={column:n instanceof Array?n[parseInt(s.toString(),10)]:n};var o=this.options.column.columnData&&r.length>1?1===this.options.column.columnData.length?0:1:s;t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[parseInt(o.toString(),10)][i.foreignKeyValue]:r[parseInt(o.toString(),10)].value,this.options.foreignKeyValue&&(t[this.options.foreignKeyValue]=this.options.column.columnData[parseInt(o.toString(),10)][i.foreignKeyValue])}return t},t.prototype.renderMatchCase=function(e,t,i,n,r){var s=this.parent.createElement("div",{className:"e-xlfl-matchcasediv"});s.style.display="inline-block";var a=!(0,o.isNullOrUndefined)(e)&&hl(e),l=!(0,o.isNullOrUndefined)(e)&&dl(e),h=this.parent.createElement("input",{id:a?l+n:e+n,attrs:{type:"checkbox"}});s.appendChild(h),i.appendChild(s);var d=!!(r&&r.length>0)&&(r&&2===r.length?r[1].matchCase:r[0].matchCase),p=new Js.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:d,cssClass:this.parent.cssClass?this.parent.cssClass:""});this.childRefs.unshift(p),p.appendTo(h)},t.prototype.renderDate=function(e,t,i,n,r){var s=Ll(e.format,e.type)||e.format,o=new Jh.DatePicker(Ua({format:s,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:r,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(o),o.appendTo(i)},t.prototype.renderDateTime=function(e,t,i,n,r){var s=Ll(e.format,e.type),o=new Jh.DateTimePicker(Ua({format:s,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:r,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(o),o.appendTo(i)},t.prototype.completeAction=function(e){e.result=Sl(e.result)},t.prototype.renderNumericTextBox=function(e,t,i,n,r){var s=new Qh.NumericTextBox(Ua({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:r,value:n,locale:this.parent.locale,cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.filter.params));this.childRefs.unshift(s),s.appendTo(i)},t.prototype.renderAutoComplete=function(e,t,i,n,r){var s=this.options.column,o=this.isForeignColumn(s),l=o?s.dataSource:e.dataSource,h={value:o?s.foreignKeyValue:t},d=new Yh.AutoComplete(Ua({dataSource:l instanceof a.DataManager?l:new a.DataManager(l),fields:h,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:r,text:n},s.filter.params));if(l&&"result"in l){var p=Zl({requestType:"stringfilterrequest"},this.getQuery());this.parent.trigger(Ti,p.state),p.deffered.promise.then(function(e){d.dataSource=new a.DataManager(e)})}this.childRefs.unshift(d);var c={actionComplete:this.acActionComplete(d,t),focus:this.acFocus(d,t,e,i)};Oh(i.id,[D,ks],c,this),d.addEventListener(ks,this.eventHandlers[i.id][ks]),d.addEventListener(D,this.eventHandlers[i.id][D]),d.appendTo(i)},t.prototype.acActionComplete=function(e,t){return function(i){var n=!(0,o.isNullOrUndefined)(t)&&hl(t);i.result=i.result.filter(function(t,i,r){return r.map(function(t){return n?Ih(e.fields.value,t):t[e.fields.value]}).indexOf(n?Ih(e.fields.value,t):t[e.fields.value])===i})}},t.prototype.acFocus=function(e,t,i,n){var r=this;return function(){var s=!(0,o.isNullOrUndefined)(t)&&hl(t),a=!(0,o.isNullOrUndefined)(t)&&dl(t),l=s?a:t;e.filterType=r.dlgDiv.querySelector("#"+l+(n.id===l+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,e.ignoreCase="string"!==i.type||!r.dlgDiv.querySelector("#"+l+"-xlflmtcase").ej2_instances[0].checked,e.filterType=(0,o.isNullOrUndefined)(e.filterType)?"equal":e.filterType}},t}(Xh),td=function(){function e(e,t,i,n){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new eo,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=n,this.focus=n.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}return e.prototype.updateModel=function(){var e,t={field:this.columnName,direction:this.direction},i=this.parent.groupSettings.columns,n=!1;if(this.isMultiSort)(e=this.getSortedColsIndexByField(this.columnName))>-1&&this.sortSettings.columns.splice(e,1),this.sortSettings.columns.push(t),this.sortSettings.columns=this.sortSettings.columns;else if(i.length){for(var r=[],s=0,o=i.length;s<o;s++)if(e=this.getSortedColsIndexByField(i[parseInt(s.toString(),10)],r),this.columnName===i[parseInt(s.toString(),10)])n=!0,r.push(t);else{var a=this.getSortColumnFromField(i[parseInt(s.toString(),10)]);r.push({field:a.field,direction:a.direction,isFromGroup:a.isFromGroup})}n||r.push(t),this.sortSettings.columns=r}else this.sortSettings.columns=[t];this.parent.dataBind(),this.lastSortedCol=this.columnName},e.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"sorting",type:D}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:D};this.isRemove=!1,this.parent.trigger(D,(0,o.extend)(e,t))},e.prototype.sortColumn=function(e,t,i){var n=this.parent;!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen()?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e}):(n.allowMultiSorting||(i=n.allowMultiSorting),this.isActionPrevent()?n.notify(Wt,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:i}):(this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=i,this.removeSortIcons(),this.updateSortedCols(e,i),this.updateModel()))},e.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,r.isSort)},e.prototype.backupSettings=function(){this.lastSortedCols=Ba(this.sortSettings.columns),this.lastCols=this.sortedColumns},e.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},e.prototype.updateSortedCols=function(e,t){if(!t)if(this.parent.allowGrouping)for(var i=0,n=this.sortedColumns.length;i<n;i++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[parseInt(i.toString(),10)])<0&&(this.sortedColumns.splice(i,1),n--,i--);else this.sortedColumns.splice(0,this.sortedColumns.length);this.sortedColumns.indexOf(e)<0&&this.sortedColumns.push(e)},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){if(this.contentRefresh){var t=this.sortSettings.columns.length?{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:R,target:this.currentTarget,cancel:!1}:{requestType:"sorting",type:R,cancel:!1,target:this.currentTarget};this.parent.notify(Ue,t)}this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons()}},e.prototype.refreshSortSettings=function(){this.sortedColumns.length=0;for(var e=this.sortSettings.columns,t=0;t<e.length;t++)e[parseInt(t.toString(),10)].isFromGroup||this.sortedColumns.push(e[parseInt(t.toString(),10)].field)},e.prototype.clearSorting=function(){var e=Qa(this.sortSettings.columns);if(this.isActionPrevent())this.parent.notify(Wt,{instance:this,handler:this.clearSorting});else for(var t=0,i=e.length;t<i;t++)this.removeSortColumn(e[parseInt(t.toString(),10)].field)},e.prototype.isActionPrevent=function(){return fl(this.parent)},e.prototype.removeSortColumn=function(e){var t=this.parent,i=this.sortSettings.columns;if(!(0===i.length&&this.sortedColumns.indexOf(e)<0))if(this.isActionPrevent())this.parent.notify(Wt,{instance:this,handler:this.removeSortColumn,arg1:e});else{this.backupSettings(),this.removeSortIcons();for(var n={requestType:"sorting",type:R,target:this.currentTarget},r=0,s=i.length;r<s;r++)if(i[parseInt(r.toString(),10)].field===e){if(t.allowGrouping&&t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)>-1)continue;this.sortedColumns.splice(this.sortedColumns.indexOf(i[parseInt(r.toString(),10)].field),1),i.splice(r,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(Ue,n);break}n.cancel||this.addSortIcons()}},e.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,n=0,r=i.length;n<r;n++)if(i[parseInt(n.toString(),10)].field===e)return n;return-1},e.prototype.getModuleName=function(){return"sort"},e.prototype.initialEnd=function(){if(this.parent.off(Ne,this.initialEnd),this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=this.sortSettings.columns.length>1;for(var t=0,i=e.sortSettings.columns.slice();t<i.length;t++){var n=i[t];this.sortedColumns.indexOf(n.field)>-1&&this.sortColumn(n.field,n.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:hr,handler:this.setFullScreenDialog},{event:Ur,handler:this.renderResponsiveChangeAction},{event:Ne,handler:this.initialEnd},{event:Ke,handler:this.onActionComplete},{event:qe,handler:this.onPropertyChanged},{event:St,handler:this.clickHandler},{event:je,handler:this.refreshSortIcons},{event:vt,handler:this.keyPressed},{event:Li,handler:this.cancelBeginEvent},{event:Ct,handler:this.destroy}],Rh(this.parent,this.evtHandlers,!0,this),o.EventHandler.add(document.body,"click",this.excelFilterSortAction,this),o.EventHandler.add(document.body,"touchend",this.excelFilterSortAction,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(Rh(this.parent,this.evtHandlers,!1),o.EventHandler.remove(document.body,"click",this.excelFilterSortAction),o.EventHandler.remove(document.body,"touchend",this.excelFilterSortAction))},e.prototype.excelFilterSortAction=function(e){var t=_a(e.target,"e-grid-popup"),i=this.parent.element.id+"_e-popup";t&&t.id===i&&_a(e.target,"e-excelfilter")&&this.excelFilterSortActionHandler(e)},e.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowSorting||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},e.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},e.prototype.clickHandler=function(e){var t=this.parent;this.currentTarget=null,this.popUpClickHandler(e);var i=(0,o.closest)(e.target,".e-headercell");if(i&&!e.target.classList.contains("e-grptogglebtn")&&!i.classList.contains("e-resized")&&!e.target.classList.contains("e-rhandler")&&!e.target.classList.contains("e-columnmenu")&&!e.target.classList.contains("e-filtermenudiv")&&!_a(e.target,"e-stackedheadercell")&&!(t.allowSelection&&t.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell"))){var n=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));"checkbox"!==n.type&&(this.initiateSort(i,e,n),o.Browser.isDevice&&this.showPopUp(e))}i&&i.classList.remove("e-resized"),this.excelFilterSortActionHandler(e)},e.prototype.excelFilterSortActionHandler=function(e){if(_a(e.target,"e-excel-ascending")||_a(e.target,"e-excel-descending")){var t=(0,o.closest)(e.target,".e-filter-popup").getAttribute("data-uid"),i=(0,o.isNullOrUndefined)(_a(e.target,"e-excel-descending"))?"Ascending":"Descending";this.sortColumn(this.parent.getColumnByUid(t).field,i,!1)}},e.prototype.keyPressed=function(e){var t=e.target;if(!this.parent.isEdit&&("enter"===e.action||"ctrlEnter"===e.action||"shiftEnter"===e.action)&&(0,o.closest)(t,".e-headercell")){var i=this.focus.getFocusedElement();if((0,o.isNullOrUndefined)(i)||!i.classList.contains("e-headercell")||!i.querySelector(".e-headercelldiv"))return;var n=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));this.initiateSort(i,e,n)}},e.prototype.initiateSort=function(e,t,i){var n=this.parent,r=i.field;this.currentTarget=t.target;var s=e.getElementsByClassName("e-ascending").length?"Descending":"Ascending";this.isMultiSort=t.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&t.metaKey,t.shiftKey||this.sortSettings.allowUnsort&&e.getElementsByClassName("e-descending").length&&!(n.groupSettings.columns.indexOf(r)>-1)?this.removeSortColumn(r):this.sortColumn(r,s,this.isMultiSort)},e.prototype.showPopUp=function(e){var t=(0,o.closest)(e.target,".e-headercell");!this.parent.allowMultiSorting||(0,o.isNullOrUndefined)(t)&&!this.parent.isContextMenuOpen()||Va(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(this.sortedColumns.length>1?" e-spanclicked":""))},e.prototype.popUpClickHandler=function(e){var t=e.target;(0,o.closest)(t,".e-headercell")||e.target.classList.contains(is)||(0,o.closest)(t,".e-gridpopup")?t.classList.contains("e-sortdirect")&&(t.classList.contains("e-spanclicked")?(t.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(t.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},e.prototype.addSortIcons=function(){for(var e,t,i=this.parent,n=this.sortSettings.columns,r=this.parent.getColumns().map(function(e){return e.field}),s=0,a=n.length;s<a;s++)e=i.getColumnHeaderByField(n[parseInt(s.toString(),10)].field),-1===r.indexOf(n[parseInt(s.toString(),10)].field)||(0,o.isNullOrUndefined)(e)||(this.aria.setSort(e,n[parseInt(s.toString(),10)].direction.toLowerCase()),n.length>1&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(s+1).toString()}),e.querySelector(".e-headertext")),t=e.querySelector(".e-sortfilterdiv"),"Ascending"===n[parseInt(s.toString(),10)].direction?(0,o.classList)(t,["e-ascending","e-icon-ascending"],[]):(0,o.classList)(t,["e-descending","e-icon-descending"],[]))},e.prototype.removeSortIcons=function(e){for(var t,i=this.parent,n=this.parent.getColumns().map(function(e){return e.field}),r=e||0,s=(0,o.isNullOrUndefined)(e)?n.length:e+1;r<s;r++)t=i.getColumnHeaderByField(n[parseInt(r.toString(),10)]),(0,o.isNullOrUndefined)(t)||i.allowGrouping&&i.groupSettings.columns.indexOf(n[parseInt(r.toString(),10)])>-1&&!t.querySelector(".e-sortfilterdiv")||(0,o.isNullOrUndefined)(n[parseInt(r.toString(),10)])||(this.aria.setSort(t,"none"),(0,o.classList)(t.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),t.querySelector(".e-sortnumber")&&t.querySelector(".e-headercelldiv").removeChild(t.querySelector(".e-sortnumber")))},e.prototype.getSortColumnFromField=function(e){for(var t=0,i=this.sortSettings.columns.length;t<i;t++)if(this.sortSettings.columns[parseInt(t.toString(),10)].field===e)return this.sortSettings.columns[parseInt(t.toString(),10)];return!1},e.prototype.updateAriaAttr=function(){for(var e=this.parent.getColumns().map(function(e){return e.field}),t=0,i=this.sortedColumns;t<i.length;t++){var n=i[t];if(-1!==e.indexOf(n)){var r=this.parent.getColumnHeaderByField(n);this.aria.setSort(r,this.getSortColumnFromField(n).direction)}}},e.prototype.refreshSortIcons=function(){this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr()},e.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},e.prototype.showCustomSort=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()},e}(),id=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},e.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.refreshAriaAttrLabel(),this.updateStyles()},e.prototype.refreshNumericLinks=function(){var e,t=this.pagerModule,i=t.element.querySelector(".e-numericcontainer"),n=document.createDocumentFragment();i.innerHTML="";for(var r=1;r<=t.pageCount;r++)e=(0,o.createElement)("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{tabindex:"-1","aria-label":t.getLocalizedLabel("Page")+r+t.getLocalizedLabel("Of")+t.totalPages+t.getLocalizedLabel("Pages"),href:"#"}}),t.currentPage===r&&((0,o.classList)(e,["e-currentitem","e-active"],["e-pager-default"]),e.setAttribute("aria-current","page")),n.appendChild(e);i.appendChild(n),this.links=[].slice.call(i.childNodes)},e.prototype.wireEvents=function(){o.EventHandler.add(this.pagerElement,"click",this.clickHandler,this),o.EventHandler.add(this.pagerElement,"auxclick",this.auxiliaryClickHandler,this)},e.prototype.unwireEvents=function(){o.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler),o.EventHandler.remove(this.pagerModule.element,"auxclick",this.auxiliaryClickHandler)},e.prototype.destroy=function(){this.unwireEvents()},e.prototype.refreshAriaAttrLabel=function(){for(var e=this.pagerModule,t=e.element.querySelector(".e-numericcontainer").querySelectorAll("a"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasAttribute("aria-label")&&t[parseInt(i.toString(),10)].hasAttribute("data-index")&&t[parseInt(i.toString(),10)].setAttribute("aria-label",e.getLocalizedLabel("Page")+t[parseInt(i.toString(),10)].getAttribute("data-index")+e.getLocalizedLabel("Of")+e.totalPages+e.getLocalizedLabel("Pages"))},e.prototype.renderNumericContainer=function(){this.element=(0,o.createElement)("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild((0,o.createElement)("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},e.prototype.renderFirstNPrev=function(e){this.first=(0,o.createElement)("div",{className:"e-first e-icons e-icon-first",attrs:{title:this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}}),this.prev=(0,o.createElement)("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}),(0,o.append)([this.first,this.prev],e)},e.prototype.renderPrevPagerSet=function(e){var t=(0,o.createElement)("div");this.PP=(0,o.createElement)("a",{className:"e-link e-pp e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",href:"#"}}),t.appendChild(this.PP),e.appendChild(t)},e.prototype.renderNextPagerSet=function(e){var t=(0,o.createElement)("div");this.NP=(0,o.createElement)("a",{className:"e-link e-np e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",href:"#"}}),t.appendChild(this.NP),e.appendChild(t)},e.prototype.renderNextNLast=function(e){this.next=(0,o.createElement)("div",{className:"e-next e-icons e-icon-next",attrs:{title:this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}}),this.last=(0,o.createElement)("div",{className:"e-last e-icons e-icon-last",attrs:{title:this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}),(0,o.append)([this.next,this.last],e)},e.prototype.clickHandler=function(e){var t=this.pagerModule;return this.target=e.target,this.target.classList.contains("e-numericitem")&&e.preventDefault(),t.previousPageNo=t.currentPage,this.target.classList.contains("e-disable")||(0,o.isNullOrUndefined)(this.target.getAttribute("data-index"))||(t.currentPage=parseInt(this.target.getAttribute("data-index"),10),this.pagerModule.isInteracted=!0,t.dataBind()),!1},e.prototype.auxiliaryClickHandler=function(e){this.target=e.target,this.target.classList.contains("e-numericitem")&&1===e.button&&e.preventDefault()},e.prototype.updateLinksHtml=function(){var e,t,i,n=this.pagerModule,r=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');n.currentPage=1===n.totalPages?1:n.currentPage,n.currentPage>n.totalPages&&n.totalPages&&(n.currentPage=n.totalPages),e=parseInt((n.currentPage/n.pageCount).toString(),10),n.currentPage%n.pageCount===0&&e>0&&(e-=1);for(var s=0;s<n.pageCount;s++){if(n.isPagerResized){var a=this.pagerElement.querySelector(".e-focus"),l=this.target?this.target:a||null,h=!1,d=!1,p=!1,c=!1,u=!1,g=!1,f=!1;if(l){var m=l.classList;if(m.contains("e-icons"))switch(!0){case m.contains("e-prev"):h=!0;break;case m.contains("e-next"):d=!0;break;case m.contains("e-first"):p=!0;break;case m.contains("e-last"):c=!0}else if(m.contains("e-numericitem"))switch(!0){case m.contains("e-np"):g=!0;break;case m.contains("e-pp"):f=!0;break;default:u=m.contains("e-numericitem")}}t=c||"End"===this.pagerModule.keyAction,r=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');var y=Array.from(r).some(function(e){return parseInt(e.getAttribute("data-index"),10)===n.currentPage});i=p||"Home"===this.pagerModule.keyAction?1+s:c||"End"===this.pagerModule.keyAction?e*n.pageCount+1+s:d||"ArrowRight"===this.pagerModule.keyAction||h||"ArrowLeft"===this.pagerModule.keyAction?y?parseInt(r[0].getAttribute("data-index"),10)+s:h||"ArrowLeft"===this.pagerModule.keyAction?parseInt(this.PP.getAttribute("data-index"),10)+s:n.currentPage+s:g||f?n.currentPage+s:u?parseInt(r[0].getAttribute("data-index"),10)+s:e*n.pageCount+1+s}else i=e*n.pageCount+1+s;i<=n.totalPages?(this.links[parseInt(s.toString(),10)].classList.remove("e-hide"),this.links[parseInt(s.toString(),10)].style.display="",this.links[parseInt(s.toString(),10)].setAttribute("data-index",i.toString()),this.links[parseInt(s.toString(),10)].innerHTML=n.customText?n.customText+i:i.toString(),n.currentPage!==i?this.links[parseInt(s.toString(),10)].classList.add("e-pager-default"):this.links[parseInt(s.toString(),10)].classList.remove("e-pager-default")):(this.links[parseInt(s.toString(),10)].innerHTML=n.customText?n.customText+i:i.toString(),this.links[parseInt(s.toString(),10)].style.display="none"),(0,o.classList)(this.links[parseInt(s.toString(),10)],[],["e-currentitem","e-active"]),this.links[parseInt(s.toString(),10)].removeAttribute("aria-current")}(0,o.attributes)(this.first,{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),(0,o.attributes)(this.pagerElement.querySelector(".e-mfirst"),{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),(0,o.attributes)(this.last,{"data-index":n.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),(0,o.attributes)(this.pagerElement.querySelector(".e-mlast"),{"data-index":n.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),(0,o.attributes)(this.prev,{"data-index":(n.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),(0,o.attributes)(this.pagerElement.querySelector(".e-mprev"),{"data-index":(n.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),(0,o.attributes)(this.next,{"data-index":(n.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")}),(0,o.attributes)(this.pagerElement.querySelector(".e-mnext"),{"data-index":(n.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")});var v=this.pagerModule.isPagerResized&&r.length?t?parseInt(r[0].getAttribute("data-index"),10)-n.avgNumItems:parseInt(r[0].getAttribute("data-index"),10)-r.length:parseInt(this.links[0].getAttribute("data-index"),10)-n.pageCount;(0,o.attributes)(this.PP,{"data-index":v<1?"1":v.toString(),title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip")});var S=this.pagerModule.isPagerResized&&r.length?parseInt(r[r.length-1].getAttribute("data-index"),10):parseInt(this.links[this.links.length-1].getAttribute("data-index"),10);(0,o.attributes)(this.NP,{"data-index":(S+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip")}),this.target=void 0},e.prototype.updateStyles=function(){var e=this;if(this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length){var t=this.links.findIndex(function(t){return t.getAttribute("data-index")===e.pagerModule.currentPage.toString()}),i=this.pagerModule.isPagerResized&&-1!==t?t:(this.pagerModule.currentPage-1)%this.pagerModule.pageCount;this.links[parseInt(i.toString(),10)]&&((0,o.classList)(this.links[parseInt(i.toString(),10)],["e-currentitem","e-active"],[]),this.links[parseInt(i.toString(),10)].setAttribute("aria-current","page"))}},e.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],t=["e-firstpagedisabled","e-disable"],i=["e-prevpage","e-pager-default"],n=["e-prevpagedisabled","e-disable"];this.pagerModule.totalPages>0&&this.pagerModule.currentPage>1?((0,o.classList)(this.prev,i,n),(0,o.classList)(this.first,e,t),(0,o.classList)(this.pagerElement.querySelector(".e-mfirst"),e,t),(0,o.classList)(this.pagerElement.querySelector(".e-mprev"),i,n)):((0,o.classList)(this.prev,n,i),(0,o.classList)(this.first,t,e),(0,o.classList)(this.pagerElement.querySelector(".e-mprev"),n,i),(0,o.classList)(this.pagerElement.querySelector(".e-mfirst"),t,e))},e.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount||this.pagerModule.isPagerResized&&this.links.findIndex(function(e){return 1===parseInt(e.getAttribute("data-index"),10)})?(0,o.classList)(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):(0,o.classList)(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},e.prototype.updateNextPagerSetStyles=function(){var e=this.pagerModule,t=this.links[0].innerHTML.replace(e.customText,""),i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');!t.length||!this.links.length||parseInt(t,10)+e.pageCount>e.totalPages||e.isPagerResized&&Array.from(i).some(function(t){return parseInt(t.getAttribute("data-index"),10)===e.totalPages})?(0,o.classList)(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):(0,o.classList)(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},e.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],t=["e-lastpagedisabled","e-disable"],i=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],r=this.pagerModule;r.currentPage===r.totalPages||0===r.totalRecordsCount?((0,o.classList)(this.last,t,e),(0,o.classList)(this.next,n,i),(0,o.classList)(this.pagerElement.querySelector(".e-mlast"),t,e),(0,o.classList)(this.pagerElement.querySelector(".e-mnext"),n,i)):((0,o.classList)(this.last,e,t),(0,o.classList)(this.next,i,n),(0,o.classList)(this.pagerElement.querySelector(".e-mlast"),e,t),(0,o.classList)(this.pagerElement.querySelector(".e-mnext"),i,n))},e}(),nd=function(){function e(e){this.pagerModule=e}return e.prototype.render=function(){var e=(0,o.createElement)("div",{className:"e-parentmsgbar"});this.pageNoMsgElem=(0,o.createElement)("span",{className:"e-pagenomsg"}),this.pageNoMsgElem.style.textAlign="right",this.pageCountMsgElem=(0,o.createElement)("span",{className:"e-pagecountmsg"}),this.pageCountMsgElem.style.textAlign="right",(0,o.append)([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},e.prototype.refresh=function(){var e=this.pagerModule;this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0,e.totalRecordsCount||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel(e.totalRecordsCount<=1?"totalItemInfo":"totalItemsInfo"),[e.totalRecordsCount||0,e.totalRecordsCount?e.pageSize*(e.currentPage-1)+1:0,e.pageSize*e.currentPage>e.totalRecordsCount?e.totalRecordsCount:e.pageSize*e.currentPage]),this.pageNoMsgElem.parentElement.classList.remove("e-hide")},e.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},e.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},e.prototype.destroy=function(){},e.prototype.format=function(e,t){for(var i,n=RegExp,r=0;r<t.length;r++)i=new n("\\{"+r+"\\}","gm"),e=this.isValidLocale(this.pagerModule.locale)?e.replace(i,t[parseInt(r.toString(),10)].toLocaleString(this.pagerModule.locale)):e.replace(i,t[parseInt(r.toString(),10)].toString());return e},e.prototype.isValidLocale=function(e){try{return new Intl.NumberFormat(e),!0}catch(e){return!1}},e}(),rd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),sd=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},od=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;return r.hasParent=!1,r.checkAll=!0,r.pageRefresh="pager-refresh",r.firstPagerFocus=!1,r.isCancel=!1,r.isInteracted=!1,r.parent=n,r}return rd(t,e),t.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this],name:"ExternalMessage"}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this],name:"PagerDropDown"}),e},t.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",totalItemInfo:"({0} item)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager items",previousPagerTooltip:"Go to previous pager items",pagerDropDown:"Items per page",pagerAllDropDown:"Items",CurrentPageInfo:"{0} of {1} pages",TotalItemsInfo:"({0} items)",FirstPageTooltip:"Go to first page",LastPageTooltip:"Go to last page",NextPageTooltip:"Go to next page",PreviousPageTooltip:"Go to previous page",NextPagerTooltip:"Go to next pager items",PreviousPagerTooltip:"Go to previous pager items",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All",Container:"Pager Container",Information:"Pager Information",ExternalMsg:"Pager external message",Page:"Page ",Of:" of ",Pages:" Pages"},this.containerModule=new id(this),this.pagerMessageModule=new nd(this)},t.prototype.setCurrentPageValue=function(e){var t=parseInt(e,10);this.hasParent&&this.parent.setProperties({pageSettings:{currentPage:t}},!0),this.currentPage=t},t.prototype.render=function(){if(this.element.setAttribute("data-role","pager"),this.element.setAttribute("tabindex","-1"),this.initLocalization(),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.element.classList.add("e-mac-safari"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?(0,o.addClass)([this.element],this.cssClass.split(" ")):(0,o.addClass)([this.element],[this.cssClass])),this.hasParent||this.element.setAttribute("tabindex","0"),this.enableQueryString){var e=new URL(window.location.href).searchParams.get("page");!(0,o.isNullOrUndefined)(e)&&window.location.href.indexOf("?page=")>0&&this.setCurrentPageValue(e)}this.template?this.isReactTemplate()?(this.on(this.pageRefresh,this.pagerTemplate,this),this.notify(this.pageRefresh,{})):this.pagerTemplate():(this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount})),this.wireEvents(),this.addListener()},t.prototype.getPersistData=function(){return this.addOnPersist(["currentPage","pageSize"])},t.prototype.destroy=function(){this.isDestroyed||(this.isReactTemplate()&&(this.off(this.pageRefresh,this.pagerTemplate),this.hasParent||this.destroyTemplate(["pagerTemplate"])),this.removeListener(),this.unwireEvents(),e.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate()||(this.element.innerHTML=""))},t.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},t.prototype.getModuleName=function(){return"pager"},t.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed)if(e.pageSize!==this.getLocalizedLabel("All")||t.pageSize!==this.totalRecordsCount){e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,n=Object.keys(e);i<n.length;i++){switch(n[i]){case"currentPage":this.checkGoToPage(e.currentPage,t.currentPage)&&this.currentPageChanged(e,t);break;case"pageSize":case"totalRecordsCount":case"customText":this.checkpagesizes()&&this.pagerdropdownModule&&(t.pageSize!==e.pageSize&&(this.currentPage=1),this.pagerdropdownModule.setDropDownValue("value",this.pageSize)),e.pageSize!==t.pageSize?(this.pageSize=e.pageSize,this.currentPageChanged(e,t),this.isCancel&&this.hasParent&&this.parent.setProperties({pageSettings:{pageSize:t.pageSize}},!0)):this.refresh();break;case"pageSizes":this.checkpagesizes()&&this.pagerdropdownModule&&(this.pagerdropdownModule.destroy(),this.pagerdropdownModule.render()),this.refresh();break;case"template":this.templateFn=this.compile(this.template),this.refresh();break;case"locale":this.initLocalization(),this.refresh();break;case"enableExternalMessage":this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render();break;case"externalMessage":this.externalMessageModule&&this.externalMessageModule.refresh();break;case"enableRtl":this.updateRTL();break;case"enablePagerMessage":this.enablePagerMessage?this.pagerMessageModule.showMessage():this.pagerMessageModule.hideMessage()}}this.resizePager()}else this.pageSize=this.totalRecordsCount},t.prototype.wireEvents=function(){this.hasParent||(o.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),o.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)),o.EventHandler.add(this.element,"focusin",this.onFocusIn,this),o.EventHandler.add(this.element,"focusout",this.onFocusOut,this),o.EventHandler.add(window,"resize",this.resizePager,this),o.EventHandler.add(window,"load",this.resizePager,this)},t.prototype.unwireEvents=function(){this.hasParent||(o.EventHandler.remove(this.element,"keydown",this.keyPressHandler),o.EventHandler.remove(document.body,"keydown",this.keyDownHandler)),o.EventHandler.remove(this.element,"focusin",this.onFocusIn),o.EventHandler.remove(this.element,"focusout",this.onFocusOut),o.EventHandler.remove(window,"resize",this.resizePager),o.EventHandler.remove(window,"load",this.resizePager)},t.prototype.onFocusIn=function(e){var t=this.getFocusedTabindexElement();if((0,o.isNullOrUndefined)(t)){var i=e.target,n=this.getDropDownPage();if(this.hasParent||(this.element.tabIndex=-1),i===this.element&&!this.hasParent){var r=this.getFocusablePagerElements(this.element,[]);return void this.addFocus(r[0],!0)}if(i===this.element)return void(this.element.tabIndex=0);i===n||i.classList.contains("e-disable")||this.addFocus(i,!0)}},t.prototype.onFocusOut=function(e){var t=this.getFocusedElement(),i=this.getDropDownPage();(0,o.isNullOrUndefined)(t)||this.removeFocus(t,!0),this.pageSizes&&i&&i.classList.contains("e-input-focus")&&this.removeFocus(i,!0),this.setTabIndexForFocusLastElement(),this.hasParent||(this.element.tabIndex=0),this.hasParent&&(this.element.tabIndex=-1)},t.prototype.keyDownHandler=function(e){if(e.altKey&&74===e.keyCode){var t=this.getFocusablePagerElements(this.element,[]);t.length>0&&t[0].focus()}},t.prototype.keyPressHandler=function(e){var t=(0,o.extend)(e,{cancel:!1});this.notify(vt,t),!0===t.cancel&&e.stopImmediatePropagation()},t.prototype.addListener=function(){this.isDestroyed||this.hasParent||this.on(vt,this.onKeyPress,this)},t.prototype.removeListener=function(){this.isDestroyed||this.hasParent||this.off(vt,this.onKeyPress)},t.prototype.onKeyPress=function(e){this.hasParent||(this.checkPagerHasFocus()?this.changePagerFocus(e):(e.preventDefault(),this.setPagerFocus()))},t.prototype.checkPagerHasFocus=function(){return!!this.getFocusedTabindexElement()},t.prototype.setPagerContainerFocus=function(){this.element.focus()},t.prototype.setPagerFocus=function(){var e=this.getFocusablePagerElements(this.element,[]);e.length>0&&e[0].focus()},t.prototype.setPagerFocusForActiveElement=function(){var e=this.getActiveElement();e&&e.focus()},t.prototype.setTabIndexForFocusLastElement=function(){var e=this.getFocusablePagerElements(this.element,[]),t=this.getDropDownPage();this.pageSizes&&t&&!(0,o.isNullOrUndefined)(t.offsetParent)?t.tabIndex=0:e.length>0&&(e[e.length-1].tabIndex=0)},t.prototype.changePagerFocus=function(e){this.keyAction=e.key,e.shiftKey&&9===e.keyCode?this.changeFocusByShiftTab(e):9===e.keyCode?this.changeFocusByTab(e):13===e.keyCode||32===e.keyCode?this.navigateToPageByEnterOrSpace(e):37!==e.keyCode&&39!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||this.navigateToPageByKey(e),this.keyAction=""},t.prototype.getFocusedTabindexElement=function(){for(var e,t=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])'),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n&&(n.classList.contains("e-focused")||n.classList.contains("e-input-focus"))){e=n;break}}return e},t.prototype.changeFocusByTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(i.length>0)if(this.pageSizes&&n&&t===i[i.length-1])n.tabIndex=0;else for(var r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)]){var s=r+1;s<i.length&&(e.preventDefault(),i[parseInt(s.toString(),10)].focus());break}},t.prototype.changeFocusByShiftTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(this.pageSizes&&n&&n.classList.contains("e-input-focus"))n.tabIndex=-1,this.addFocus(i[i.length-1],!0);else if(i.length>0)for(var r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)]){var s=r-1;if(s>=0)e.preventDefault(),i[parseInt(s.toString(),10)].focus();else if(this.hasParent){var o=this.parent.getRows(),a=o[o.length-1].lastChild;e.preventDefault(),a.focus(),this.firstPagerFocus=!0}break}},t.prototype.checkFirstPagerFocus=function(){return!!this.firstPagerFocus&&(this.firstPagerFocus=!1,!0)},t.prototype.navigateToPageByEnterOrSpace=function(e){var t=this.getFocusedElement();if(t){this.goToPage(parseInt(t.getAttribute("data-index"),10));var i=this.getActiveElement(),n=this.getClass(t),r=this.getElementByClass(n);"e-first"!==n&&"e-prev"!==n&&"e-next"!==n&&"e-last"!==n&&"e-pp"!==n&&"e-np"!==n||!r||r.classList.contains("e-disable")?this.checkFocusInAdaptiveMode(t)?this.changeFocusInAdaptiveMode(t):i&&i.focus():r.focus()}},t.prototype.navigateToPageByKey=function(e){var t=37===e.keyCode?".e-prev":39===e.keyCode?".e-next":35===e.keyCode?".e-last":36===e.keyCode?".e-first":"",i=this.element.querySelector(t),n=this.getFocusedElement();if(!(0,o.isNullOrUndefined)(i)&&i.hasAttribute("data-index")&&!isNaN(parseInt(i.getAttribute("data-index"),10))){this.goToPage(parseInt(i.getAttribute("data-index"),10));var r=this.getActiveElement();this.checkFocusInAdaptiveMode(n)?this.changeFocusInAdaptiveMode(n):r&&r.focus()}},t.prototype.checkFocusInAdaptiveMode=function(e){var t=this.getClass(e);return"e-mfirst"===t||"e-mprev"===t||"e-mnext"===t||"e-mlast"===t},t.prototype.changeFocusInAdaptiveMode=function(e){var t=this.getClass(e),i=this.getElementByClass(t);i&&i.classList.contains("e-disable")&&("e-mnext"===t||"e-mlast"===t?this.element.querySelector(".e-mprev").focus():this.setPagerFocus())},t.prototype.removeTabindexLastElements=function(){var e=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])');if(e.length>1)for(var t=1;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i&&(i.tabIndex=-1)}},t.prototype.getActiveElement=function(){return this.element.querySelector(".e-active")},t.prototype.getDropDownPage=function(){var e,t=this.element.querySelector(".e-pagerdropdown");return t&&(e=t.children[0]),e},t.prototype.getFocusedElement=function(){return this.element.querySelector(".e-focused")},t.prototype.getClass=function(e){for(var t,i=["e-mfirst","e-mprev","e-first","e-prev","e-pp","e-np","e-next","e-last","e-mnext","e-mlast"],n=0;n<i.length;n++)if(e&&e.classList.contains(i[parseInt(n.toString(),10)]))return t=i[parseInt(n.toString(),10)];return t},t.prototype.getElementByClass=function(e){return this.element.querySelector("."+e)},t.prototype.getFocusablePagerElements=function(e,t){for(var i=e.children,n=t,r=0;r<i.length;r++){var s=i[parseInt(r.toString(),10)];if(s.children.length>0&&!s.classList.contains("e-pagesizes"))n=this.getFocusablePagerElements(s,n);else{var a=i[parseInt(r.toString(),10)];!a.hasAttribute("tabindex")||s.classList.contains("e-disable")||"none"===s.style.display||(0,o.isNullOrUndefined)(s.offsetParent)||n.push(a)}}return n},t.prototype.addFocus=function(e,t){(0,o.isNullOrUndefined)(e)||(t&&(0,o.addClass)([e],["e-focused","e-focus"]),e.tabIndex=0)},t.prototype.removeFocus=function(e,t){t&&(0,o.removeClass)([e],["e-focused","e-focus"]),e.tabIndex=-1},t.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},t.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.isInteracted=!1,this.dataBind())},t.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},t.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},t.prototype.checkGoToPage=function(e,t){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),(0,o.isNullOrUndefined)(t)||(this.previousPageNo=t),this.previousPageNo!==e&&e>=1&&e<=this.totalPages},t.prototype.currentPageChanged=function(e,t){if(this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage!==t.currentPage||e.pageSize!==t.pageSize){var i={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1,isInteracted:this.isInteracted};this.trigger("click",i),i.cancel?(this.isCancel=!0,t&&t.pageSize&&(this.setProperties({pageSize:t.pageSize},!0),this.pagerdropdownModule&&(this.pagerdropdownModule.setDropDownValue("value",t.pageSize),this.pagerdropdownModule.dropDownListObject.text=t.pageSize+""))):(this.isCancel=!1,this.refresh())}},t.prototype.pagerTemplate=function(){if(!this.isReactTemplate()||!this.hasParent){var e;this.element.classList.add("e-pagertemplate"),this.compile(this.template);var t={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},i=this.element.parentElement.id+"_template";this.isReactTemplate()&&!this.isVue?(this.getPagerTemplate()(t,this,"pagerTemplate",i,null,null,this.element),this.renderReactTemplates()):(e=this.isVue?this.getPagerTemplate()(t,this,"pagerTemplate",null,null,null,null,this.root):this.getPagerTemplate()(t),$a(this.element,e))}},t.prototype.updateTotalPages=function(){this.totalPages=this.isAllPage?1:this.totalRecordsCount%this.pageSize===0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},t.prototype.getPagerTemplate=function(){return this.templateFn},t.prototype.compile=function(e){if(e)try{"function"==typeof e?this.templateFn=(0,o.compile)(e):document.querySelectorAll(e).length?this.templateFn=(0,o.compile)(document.querySelector(e).innerHTML.trim()):this.templateFn=(0,o.compile)(e)}catch(t){this.templateFn=(0,o.compile)(e)}},t.prototype.refresh=function(){if(this.template)this.isReactTemplate()?(this.updateTotalPages(),this.notify(this.pageRefresh,{})):(this.parent&&this.parent.isAngular?this.parent.destroyTemplate(["pagerTemplate"]):this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate());else{this.updateRTL();var e=this.getFocusedTabindexElement();this.containerModule.refresh(),this.removeTabindexLastElements(),e&&e.classList.contains("e-disable")&&(this.checkFocusInAdaptiveMode(e)?this.changeFocusInAdaptiveMode(e):this.setPagerFocusForActiveElement()),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh(),this.setTabIndexForFocusLastElement(),this.resizePager()}},t.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},t.prototype.initLocalization=function(){this.localeObj=new o.L10n(this.getModuleName(),this.defaultConstants,this.locale)},t.prototype.updateQueryString=function(e){var t=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:t},"",t),this.isReact&&window.dispatchEvent(new PopStateEvent("popstate"))},t.prototype.getUpdatedURL=function(e,t,i){var n=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");if(e.match(n))return e.replace(n,"$1"+t+"="+i+"$2");var r="";return-1!==e.indexOf("#")&&(r=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+r},t.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild((0,o.createElement)("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild((0,o.createElement)("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}))},t.prototype.renderNextLastDivForDevice=function(){this.element.appendChild((0,o.createElement)("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild((0,o.createElement)("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}))},t.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!o.Browser.isDevice)for(var t=0;t<e.length;t++){var i=this.element.querySelector(e[parseInt(t.toString(),10)]);i.setAttribute("aria-label",i.getAttribute("title"))}},t.prototype.isReactTemplate=function(){return(this.isReact||this.isVue)&&this.template&&"string"!=typeof this.template&&!(this.template.prototype&&this.template.prototype.CSPTemplate)},t.prototype.calculateActualWidth=function(){for(var e=this.element.querySelectorAll(".e-mfirst, .e-mprev, .e-icon-first, .e-icon-prev, .e-pp:not(.e-disable), .e-numericitem:not(.e-hide), .e-numericitem.e-active.e-hide, .e-np:not(.e-disable), .e-icon-next, .e-icon-last, .e-parentmsgbar, .e-mnext, .e-mlast, .e-pagerdropdown, .e-pagerconstant"),t=0,i=0;i<e.length;i++)"none"!==getComputedStyle(e[parseInt(i.toString(),10)]).display&&(t+=e[parseInt(i.toString(),10)].offsetWidth+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginRight));var n=this.element.querySelector(".e-pagercontainer");return t+=parseFloat(getComputedStyle(n).marginLeft)+parseFloat(getComputedStyle(n).marginRight)},t.prototype.hideDetailItems=function(e,t,i,n){var r=this.calculateActualWidth();if(r>e-t){var s=Math.floor((e-(r-i))/this.averageDetailWidth);s=n.length-s;for(var o=0;o<(s>n.length?n.length:s);o++)n[parseInt(o.toString(),10)].classList.add("e-hide")}},t.prototype.setShowItems=function(e,t,i,n,r){var s=this,o=Math.floor(e/(t+i));o=o>r.length?r.length:o-1;for(var a=Array.from(r).filter(function(e){return parseInt(e.getAttribute("data-index"),10)<s.currentPage}).sort(function(e,t){return parseInt(t.getAttribute("data-index"),10)-parseInt(e.getAttribute("data-index"),10)}),l=Array.from(r).filter(function(e){return parseInt(e.getAttribute("data-index"),10)>s.currentPage}),h=a.length&&a||l.length&&l,d=1;d<=o;d++){var p=h&&h[Math.abs(n-d)];p&&(p.classList.remove("e-hide"),p===h[h.length-1]&&(h=null))}},t.prototype.resizePager=function(){var e=this,t=this.element.classList.contains("e-pager")?getComputedStyle(this.element).getPropertyValue("border-style").includes("solid"):null;if(!this.template&&t){var i=this.element.querySelector(".e-pagercontainer"),n=this.calculateActualWidth(),r=this.element.clientWidth-parseFloat(getComputedStyle(this.element).paddingLeft)-parseFloat(getComputedStyle(this.element).paddingRight)-parseFloat(getComputedStyle(this.element).marginLeft)-parseFloat(getComputedStyle(this.element).marginRight),s=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),a=i.querySelectorAll('.e-numericitem.e-hide:not([style*="display: none"])'),l=s.length,h=(0,o.isNullOrUndefined)(_a(this.element,"e-bigger"))?5:10,d=i.querySelector(".e-np"),p=i.querySelector(".e-pp"),c=this.element.querySelectorAll('.e-parentmsgbar:not(.e-hide):not([style*="display: none"]), .e-pagesizes:not(.e-hide):not([style*="display: none"])'),u=0;c.length&&(c.forEach(function(e){u+=e.offsetWidth}),this.averageDetailWidth=u/c.length);for(var g=0,f=0;f<s.length;f++)g+=s[parseInt(f.toString(),10)].offsetWidth+parseFloat(getComputedStyle(s[parseInt(f.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(s[parseInt(f.toString(),10)]).marginRight);var m=g/s.length;if(r>0&&n>=r-(m||0)){this.isPagerResized=!0,this.currentPage!==this.totalPages&&(0,o.classList)(d,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]),n=this.calculateActualWidth();var y=Math.abs(n-r),v=Math.ceil(y/m);v=0===v?1:v>s.length?s.length-1:v;for(f=1;f<=v;f++){var S=l-parseInt(f.toString(),10);s=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),1===this.currentPage||parseInt(s[Math.abs(S)].getAttribute("data-index"),10)!==this.currentPage&&parseInt(s[s.length-1].getAttribute("data-index"),10)!==this.currentPage||(S=0,(0,o.classList)(p,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])),s[Math.abs(S)]&&!s[Math.abs(S)].classList.contains("e-currentitem")&&s[Math.abs(S)].classList.add("e-hide")}(s=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length<=1&&c.length&&window.innerWidth>=768&&this.hideDetailItems(r,h,u,c)}else if(n<r&&a.length){y=Math.abs(r-n);var C=this.element.querySelectorAll(".e-parentmsgbar.e-hide, .e-pagesizes.e-hide");C.length&&y>this.averageDetailWidth+this.averageDetailWidth/4&&C[C.length-1].classList.remove("e-hide"),y>2*m&&!C.length&&window.innerWidth>=768&&this.setShowItems(y,m,h,1,a)}if((s=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length){parseInt(s[s.length-1].getAttribute("data-index"),10)===this.totalPages&&(0,o.classList)(d,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),1===parseInt(s[0].getAttribute("data-index"),10)&&(0,o.classList)(p,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]);var w=Array.from(s).some(function(t){return parseInt(t.getAttribute("data-index"),10)===e.totalPages}),b=parseInt(s[0].getAttribute("data-index"),10)-(w&&!(0,o.isNullOrUndefined)(this.avgNumItems)?this.avgNumItems:s.length);p.setAttribute("data-index",b<1?"1":b.toString()),d.setAttribute("data-index",(parseInt(s[s.length-1].getAttribute("data-index"),10)+1).toString()),this.avgNumItems=w?this.avgNumItems:s.length}this.element.offsetWidth<769&&"none"!==window.getComputedStyle(this.element.querySelector(".e-mfirst")).getPropertyValue("display")&&this.pageSizes?(this.element.querySelector(".e-pagesizes").classList.remove("e-hide"),this.element.querySelector(".e-parentmsgbar").classList.remove("e-hide"),this.element.classList.add("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.element.offsetWidth<481?this.currentPage+" / "+this.totalPages:this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" "):(this.element.classList.remove("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" ")}},sd([(0,o.Property)(!1)],t.prototype,"enableQueryString",void 0),sd([(0,o.Property)(!1)],t.prototype,"enableExternalMessage",void 0),sd([(0,o.Property)(!0)],t.prototype,"enablePagerMessage",void 0),sd([(0,o.Property)(12)],t.prototype,"pageSize",void 0),sd([(0,o.Property)(10)],t.prototype,"pageCount",void 0),sd([(0,o.Property)(1)],t.prototype,"currentPage",void 0),sd([(0,o.Property)()],t.prototype,"totalRecordsCount",void 0),sd([(0,o.Property)()],t.prototype,"externalMessage",void 0),sd([(0,o.Property)(!1)],t.prototype,"pageSizes",void 0),sd([(0,o.Property)()],t.prototype,"template",void 0),sd([(0,o.Property)("")],t.prototype,"customText",void 0),sd([(0,o.Event)()],t.prototype,"click",void 0),sd([(0,o.Property)("")],t.prototype,"cssClass",void 0),sd([(0,o.Event)()],t.prototype,"dropDownChanged",void 0),sd([(0,o.Event)()],t.prototype,"created",void 0),t=sd([o.NotifyPropertyChanges],t)}(o.Component),ad=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"pagerdropdown"},e.prototype.render=function(){var e=this.pagerModule;this.pagerDropDownDiv=(0,o.createElement)("div",{className:"e-pagesizes"});var t=(0,o.createElement)("div",{className:"e-pagerdropdown"}),i=(0,o.createElement)("div",{className:"e-pagerconstant"}),n=(0,o.createElement)("input",{attrs:{type:"text",tabindex:"-1"}});this.pagerCons=(0,o.createElement)("span",{className:"e-constant",innerHTML:this.pagerModule.getLocalizedLabel("pagerDropDown")}),t.appendChild(n),i.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(t),this.pagerDropDownDiv.appendChild(i),this.pagerModule.element.appendChild(this.pagerDropDownDiv);var r=this.pagerModule.pageSizes,s=r.length?this.convertValue(r):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],a=this.pagerModule.pageSize;this.dropDownListObject=new Yh.DropDownList({dataSource:s,value:a.toString(),change:this.onChange.bind(this),placeholder:this.pagerModule.getLocalizedLabel("pagerDropDown"),cssClass:this.pagerModule.cssClass?"e-alldrop "+this.pagerModule.cssClass:"e-alldrop"}),this.dropDownListObject.isAngular=lh(e.parent),this.dropDownListObject.appendTo(n),r.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=a,e.dataBind(),e.trigger("dropDownChanged",{pageSize:a}),this.addEventListener()},e.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.pagerModule.isAllPage=!0,this.refresh(),e.value=this.pagerModule.pageSize,document.getElementsByClassName("e-popup-open e-alldrop").length&&(document.getElementsByClassName("e-popup-open e-alldrop")[0].style.display="none")):(this.pagerModule.pageSize=parseInt(this.dropDownListObject.value,10),this.pagerModule.isAllPage=!1,this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&this.refresh()),this.pagerModule.dataBind(),this.pagerModule.isCancel||this.pagerModule.trigger("dropDownChanged",{pageSize:this.pagerModule.isAllPage||void 0===this.pagerModule.isAllPage&&this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?this.pagerModule.totalRecordsCount:parseInt(this.dropDownListObject.value,10)})},e.prototype.refresh=function(){this.pagerCons&&(this.isPageSizeAll(this.pagerModule.pageSize)?(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerAllDropDown"),this.pagerCons.parentElement.classList.add("e-page-all")):(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerDropDown"),this.pagerCons.parentElement.classList.remove("e-page-all")),this.pagerDropDownDiv.classList.remove("e-hide"))},e.prototype.beforeValueChange=function(e){if("number"==typeof e.newProp.value){var t=e.newProp.value.toString();e.newProp.value=t}},e.prototype.convertValue=function(e){for(var t=e,i=0;i<t.length;i++)t[parseInt(i.toString(),10)]=parseInt(t[parseInt(i.toString(),10)],10)?t[parseInt(i.toString(),10)].toString():""!==this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)])?this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)];return t},e.prototype.isPageSizeAll=function(e){return("string"==typeof e&&e!==this.pagerModule.getLocalizedLabel("All")?parseInt(e,10):e)===this.pagerModule.totalRecordsCount||e===this.pagerModule.getLocalizedLabel("All")},e.prototype.setDropDownValue=function(e,t){if(this.dropDownListObject){var i=this.pagerModule.isAllPage;this.pagerModule.isAllPage=this.isPageSizeAll(t),this.pagerModule.isAllPage&&"object"==typeof this.pagerModule.pageSizes&&-1===this.pagerModule.pageSizes.indexOf("All")&&(this.pagerModule.isAllPage=!1),this.pagerModule.checkAll=!(!i||!this.pagerModule.isAllPage),this.dropDownListObject[""+e]=this.pagerModule.isAllPage?this.pagerModule.getLocalizedLabel("All"):t}},e.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},e.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},e.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),this.pagerDropDownDiv&&this.pagerDropDownDiv.parentNode&&(0,o.remove)(this.pagerDropDownDiv))},e}(),ld=function(){function e(e){this.pagerModule=e}return e.prototype.getModuleName=function(){return"externalMessage"},e.prototype.render=function(){this.element=(0,o.createElement)("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":this.pagerModule.getLocalizedLabel("ExternalMsg")}}),this.pagerModule.element.appendChild(this.element),this.refresh()},e.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},e.prototype.hideMessage=function(){(0,o.isNullOrUndefined)(this.element)||(this.element.style.display="none")},e.prototype.showMessage=function(){this.element.style.display=""},e.prototype.destroy=function(){this.element&&this.element.parentElement&&(0,o.remove)(this.element)},e}(),hd=function(){function e(e,t){this.isInitialRender=!0,this.isCancel=!1,od.Inject(ld,ad),this.parent=e,this.pageSettings=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.render=function(){var e=this.parent;this.pagerDestroy(),(0,o.isNullOrUndefined)(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"});var t=Ua({},(0,o.extend)({},Ga(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:e.enableRtl,locale:e.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]);t.cssClass=this.parent.cssClass?this.parent.cssClass:"",this.pagerObj=new od(t,void 0,this.parent),this.pagerObj.root=e.root?e.root:e,this.pagerObj.hasParent=!0,this.pagerObj.on(mr,this.renderReactPagerTemplate,this),this.pagerObj.allowServerDataBinding=!1},e.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},e.prototype.addAriaAttr=function(){if(!this.pageSettings.template){this.parent.getContentTable()&&this.element.setAttribute("aria-controls",this.parent.getContentTable().id);for(var e=this.parent.createElement("div",{className:"e-numericcontainer"}),t=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),n=this.element.querySelector(".e-numericcontainer"),r=n.querySelectorAll("a"),s=0;s<r.length;s++){var o=this.parent.createElement("div");o.appendChild(r[parseInt(s.toString(),10)]),i.appendChild(o)}e.appendChild(i),t.replaceChild(e,n)}},e.prototype.dataReady=function(e){this.updateModel(e)},e.prototype.refresh=function(){this.pagerObj.refresh()},e.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},e.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},e.prototype.updateModel=function(e){this.parent.pageSettings.totalRecordsCount=e.count;var t="add"===e.action&&"save"===e.requestType||"batchsave"===e.requestType,i=this.parent.filterModule&&this.parent.filterModule.isFilterCleared,n=""===e.searchString&&"searching"===e.requestType||"filtering"===e.requestType&&("clearFilter"===e.action||"clear-filter"===e.action)||i;i&&(this.parent.filterModule.isFilterCleared=!1),this.pagerObj.isAllPage&&!t&&(!n||n&&this.pagerObj.checkAll)&&(this.parent.pageSettings.pageSize=this.parent.pageSettings.totalRecordsCount),t&&this.pagerObj.isAllPage&&e.count===this.pageSettings.pageSize&&this.pagerObj.setProperties({pageSize:e.count},!0),this.parent.dataBind()},e.prototype.onActionComplete=function(e){this.parent.trigger(D,(0,o.extend)(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:D}))},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.pagerObj[""+r]=t[""+r]}this.pagerObj.dataBind()}},e.prototype.clickHandler=function(e){var t=this.parent;if(this.isForceCancel||fl(t)&&!t.prevPageMoving&&!this.isCancel)return this.isForceCancel?this.isForceCancel=!1:((0,o.isNullOrUndefined)(e.newProp)||(0,o.isNullOrUndefined)(e.newProp.pageSize)?e.currentPage&&(t.notify(Wt,{instance:this,handler:this.goToPage,arg1:e.currentPage}),this.pagerObj.currentPage=t.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:t.pageSettings.currentPage):(t.notify(Wt,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.setProperties({pageSize:e.oldProp.pageSize},!0),this.parent.setProperties({pageSettings:{pageSize:e.oldProp.pageSize}},!0),this.pagerObj.setProperties({currentPage:t.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:t.pageSettings.currentPage},!0)),this.isForceCancel=!0,this.pagerObj.dataBind()),void(e.cancel=!0);t.pageSettings.pageSize=this.pagerObj.pageSize,t.prevPageMoving=!1;var i=this.pageSettings.currentPage,n={cancel:!1,requestType:"paging",previousPage:i,currentPage:e.currentPage,pageSize:t.pageSettings.pageSize,type:R};if(e.oldProp&&e.oldProp.pageSize&&(n.previousPageSize=e.oldProp.pageSize),this.isCancel||(this.pageSettings.currentPage=e.currentPage,this.parent.notify(Ue,n),t.pageRequireRefresh=!1),n.cancel)return e.cancel=!0,this.parent.setProperties({pageSettings:{currentPage:i}},!0),this.pagerObj.setProperties({currentPage:i},!0),void(this.isCancel=!0);this.isCancel=!1,this.parent.requestTypeAction="paging"},e.prototype.keyPressHandler=function(e){if(e.action in dd){e.preventDefault();var t=this.element.querySelector(dd[e.action]);t.classList.contains("e-nextprevitemdisabled")||t.click()}},e.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},e.prototype.appendToElement=function(){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.isReact=this.parent.isReact,this.pagerObj.isVue=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue,this.pagerObj.appendTo(this.element),this.isInitialLoad=!1},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement(),this.isReactTemplate()&&(this.pagerObj.updateTotalPages(),this.created()))},e.prototype.addEventListener=function(){this.handlers={load:this.render,end:this.appendToElement,ready:this.dataReady,complete:this.onActionComplete,updateLayout:this.enableAfterRender,inboundChange:this.onPropertyChanged,keyPress:this.keyPressHandler,created:this.created},this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.addEventListener(As,this.handlers.created.bind(this)),this.evtHandlers=[{event:Me,handler:this.handlers.load},{event:Le,handler:this.handlers.end},{event:Pe,handler:this.handlers.ready},{event:Ge,handler:this.handlers.complete},{event:Be,handler:this.handlers.updateLayout},{event:qe,handler:this.handlers.inboundChange},{event:vt,handler:this.handlers.keyPress},{event:Ct,handler:this.destroy}],Rh(this.parent,this.evtHandlers,!0,this))},e.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},e.prototype.isReactTemplate=function(){return(this.parent.isReact||this.parent.isVue)&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},e.prototype.renderReactPagerTemplate=function(){if(!this.isInitialRender&&this.isReactTemplate()){var e=void 0;this.parent.destroyTemplate(["pagerTemplate"]),this.element.classList.add("e-pagertemplate"),this.pagerObj.compile(this.pagerObj.template);var t=this.parent.pageSettings,i={currentPage:t.currentPage,pageSize:t.pageSize,pageCount:t.pageCount,totalRecordsCount:t.totalRecordsCount,totalPages:this.pagerObj.totalPages},n=this.parent.id+"_pagertemplate";this.parent.isReact?(this.pagerObj.templateFn(i,this.parent,"pagerTemplate",n,null,null,this.pagerObj.element),this.parent.renderTemplates()):(e=this.pagerObj.templateFn(i,this.parent,"pagerTemplate"),$a(this.pagerObj.element,e))}},e.prototype.removeEventListener=function(){this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.removeEventListener(As,this.handlers.created),this.parent.off(mr,this.renderReactPagerTemplate),Rh(this.parent,this.evtHandlers,!1))},e.prototype.destroy=function(){this.removeEventListener(),this.isReactTemplate()&&this.parent.destroyTemplate(["pagerTemplate"]),this.pagerObj.destroy()},e.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),(0,o.remove)(this.element))},e}(),dd={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"},pd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TH",{className:"e-filterbarcell",attrs:{role:"columnheader"}}),t}return pd(t,e),t.prototype.getGui=function(){return this.parent.createElement("div")},t.prototype.render=function(e,t){var i,n=this.parent.element.querySelector(".e-filterbar"),r=this.element.cloneNode(),s=this.getGui(),a=e.column;if(n.appendChild(r),r.setAttribute("data-mappinguid",a.uid),a.filterTemplate){var l={};t&&(l[a.field]=t[a.field]);if(l.column=a,a.visible){"FilterBar"===this.parent.filterSettings.type&&r.classList.add("e-fltrtemp");var h=this.parent.isReact&&"string"!=typeof a.filterTemplate&&!(a.filterTemplate.prototype&&a.filterTemplate.prototype.CSPTemplate),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,p=this.parent.element.id+a.uid+"filterTemplate";if(h||d)a.getFilterTemplate()(l,this.parent,"filterTemplate",p,null,null,r),this.parent.renderTemplates();else $a(r,a.getFilterTemplate()(l,this.parent,"filterTemplate",p,null,null,null,this.parent.root))}else r.classList.add("e-hide")}else if("checkbox"!==a.type){if(!(0,o.isNullOrUndefined)(a.allowFiltering)&&!a.allowFiltering||(0,o.isNullOrUndefined)(a.filterBarTemplate)){(0,o.attributes)(s,{class:"e-filterdiv e-fltrinputdiv"}),i=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:a.headerText+e.attributes.title,value:t[e.column.field]?t[e.column.field]:""}}),s.appendChild(i);c={element:i,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0,cssClass:this.parent.cssClass}};this.parent.filterModule.inputList.push(c),Qh.Input.createInput(c,this.parent.createElement)}else if(r.classList.add("e-fltrtemp"),(0,o.attributes)(s,{class:"e-fltrtempdiv"}),(0,o.isNullOrUndefined)(a.filterBarTemplate.create))i=this.parent.createElement("input",{id:a.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:a.headerText}}),s.appendChild(i);else{var c={column:a,node:Element},u=a.filterBarTemplate.create;if("string"==typeof u&&(u=(0,o.getValue)(u,window)),"string"==typeof(i=u(c))){var g=this.parent.createElement("div");g.innerHTML=i,i=g.firstChild}(0,o.attributes)(s,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:a.headerText,id:a.field+"_filterBarcell"}),s.appendChild(i)}(!1===a.allowFiltering||""===a.field||(0,o.isNullOrUndefined)(a.field))&&(i.setAttribute("disabled","true"),i.classList.add("e-disable"));var f=s.querySelector(".e-clear-icon");if(f&&f.setAttribute("title",this.parent.localeObj.getConstant("ClearButton")),a.visible||r.classList.add("e-hide"),this.appendHtml(r,s),this.parent.filterSettings.showFilterBarOperator&&"FilterBar"===this.parent.filterSettings.type&&!this.parent.isPrinting&&(0,o.isNullOrUndefined)(a.filterTemplate)&&(0,o.isNullOrUndefined)(a.filterBarTemplate)&&this.operatorIconRender(s,a,e),((0,o.isNullOrUndefined)(a.allowFiltering)||a.allowFiltering)&&!(0,o.isNullOrUndefined)(a.filterBarTemplate)){var m=a.filterBarTemplate.write;c={element:i,column:a};"string"==typeof m&&(m=(0,o.getValue)(m,window)),m.call(this,c)}}else a.visible||r.classList.add("e-hide");return this.parent.isFrozenGrid()&&yh(this.parent,a,r),r},t.prototype.appendHtml=function(e,t){return e.appendChild(t),e},t.prototype.operatorIconRender=function(e,t,i){var n,r=this.parent,s=this.parent.createElement("input",{className:" e-filterbaroperator e-icons e-icon-filter",id:i.column.uid});if(e.querySelector("span").appendChild(s),t.filter&&t.filter.operator)n=t.filter.operator;else if(r.filterSettings.columns.length)for(var a=0,l=r.filterSettings.columns;a<l.length;a++){var h=l[parseInt(a.toString(),10)];if(h.field===t.field){n=h.operator;break}n="equal"}else n="equal";(0,o.isNullOrUndefined)(r.filterModule.operators[t.field])||(n=r.filterModule.operators[t.field]),this.dropOptr=new Yh.DropDownList({fields:{text:"text",value:"value"},popupHeight:"auto",value:n,width:"0px",enabled:t.allowFiltering,popupWidth:"auto",enableRtl:this.parent.enableRtl,change:this.internalEvent.bind(this),beforeOpen:function(){var e=r.filterModule.customOperators;this.dataSource=e[r.getColumnByUid(this.element.id).type+"Operator"];for(var i=0;i<this.dataSource.length;i++)t.filter&&t.filter.operator&&(0,o.isNullOrUndefined)(r.filterModule.operators[t.field])&&this.dataSource[parseInt(i.toString(),10)].value===t.filter.operator&&(this.value=t.filter.operator)},cssClass:this.parent.cssClass?"e-popup-flbar "+this.parent.cssClass:"e-popup-flbar"}),this.dropOptr.isAngular=lh(this.parent),this.dropOptr.appendTo(s);var d=(0,o.closest)(this.dropOptr.element,"span");d.classList.add("e-filterbardropdown"),d.removeAttribute("tabindex")},t.prototype.internalEvent=function(e){var t=this.parent,i=t.getColumnByUid(e.element.getAttribute("id"));e.column=i,t.filterModule.operators[i.field]=e.value;var n=e.value;if(t.filterModule&&t.filterModule.filterSettings.showFilterBarOperator){var r=document.getElementById(i.field+"_filterBarcell");"isempty"===n||"isnotempty"===n||"isnotnull"===n||"isnull"===n?(r.setAttribute("readOnly","true"),t.filterModule.filterByColumn(i.field,n,null,t.filterModule.predicate,t.filterModule.filterSettings.enableCaseSensitivity,t.filterModule.ignoreAccent,i.isForeignColumn())):r&&r.readOnly&&(r.removeAttribute("readOnly"),t.filterModule.removeFilteredColsByField(i.field))}t.notify(Fn,e)},t}($s),ud=function(){function e(e,t,i,n){this.ddOpen=this.dropDownOpen.bind(this),this.parent=e,this.serviceLocator=i,this.filterSettings=n,this.customFilterOperators=t,this.parent&&(this.parent.on(Ci,this.destroyDropDownList,this),this.parent.on(Ct,this.destroyDropDownList,this))}return e.prototype.renderOperatorUI=function(e,t,i,n,r){var s=this;this.dialogObj=n;var a=i.type+"Operator";this.optrData=this.customOptr=(0,o.isNullOrUndefined)(r)?(0,o.isNullOrUndefined)(this.parent.filterSettings.operators)||(0,o.isNullOrUndefined)(this.parent.filterSettings.operators[""+a])?this.customFilterOperators[""+a]:this.parent.filterSettings.operators[""+a]:r;var l=this.customOptr,h=this.dropSelectedVal(i,a),d=this.parent.createElement("div",{className:"e-flm_optrdiv"});e.appendChild(d);var p=this.parent.createElement("input",{id:i.uid+"-floptr"});d.appendChild(p),this.dropOptr=new Yh.DropDownList({dataSource:l,fields:{text:"text",value:"value"},cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",enableRtl:this.parent.enableRtl,text:h,change:function(){var e=document.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===s.dropOptr.value||"isnotempty"===s.dropOptr.value||"isnotnull"===s.dropOptr.value||"isnull"===s.dropOptr.value?(0,o.isNullOrUndefined)(e.ej2_instances)?e.setAttribute("disabled","true"):e.ej2_instances[0].enabled=!1:(0,o.isNullOrUndefined)(e.getAttribute("disabled"))||((0,o.isNullOrUndefined)(e.ej2_instances)?e.removeAttribute("disabled"):e.ej2_instances[0].enabled=!0),bl(s.dropOptr.value,i.uid,i,i.type,n,s.dropOptr.previousValue)}}),this.dropOptr.isAngular=lh(this.parent),this.dropOptr.addEventListener(Es,this.ddOpen),this.dropOptr.appendTo("#"+i.uid+"-floptr")},e.prototype.renderResponsiveDropDownList=function(e){e.popup.element.style.width="100%"},e.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString(),this.parent.enableAdaptiveUI&&this.renderResponsiveDropDownList(e)},e.prototype.dropSelectedVal=function(e,t){for(var i="",n=0,r=this.parent.filterSettings.columns;n<r.length;n++){var s=r[n];if(e.field===s.field||e.isForeignColumn()&&e.foreignKeyValue===s.field){var l=new a.DataManager(this.optrData).executeLocal((new a.Query).where("value","equal",s.operator));i=(0,o.isNullOrUndefined)(l[0])?"":l[0].text}}if(""===i&&this.optrData)if(e.filter.operator)for(var h=Object.keys(this.optrData).length,d=0;d<h;d++)this.optrData[parseInt(d.toString(),10)].value===e.filter.operator&&(i=this.optrData[parseInt(d.toString(),10)].text);else i=this.optrData[0].text;return i},e.prototype.getFlOperator=function(){return this.dropOptr.value},e.prototype.destroyDropDownList=function(){this.dropOptr.isDestroyed||(this.dropOptr.removeEventListener(Es,this.ddOpen),this.dropOptr.destroy(),this.parent.off(Ci,this.destroyDropDownList),this.parent.off(Ct,this.destroyDropDownList))},e}(),gd=function(){function e(e,t,i){Yh.MultiSelect.Inject(Yh.CheckBoxSelection),this.parent=e,this.serLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Ci,this.destroy,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"strui-"+e.column.uid}),e.target.appendChild(this.instance),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectstrui-"+e.column.uid}),e.target.appendChild(this.multiSelectCheckBoxInstance),this.dialogObj=e.dialogObj,this.processDataOperation(e),this.createMultiSelectDropDown(e),bl(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},e.prototype.processDataOperation=function(e){var t=this;e.column.isForeignColumn()?this.parent.getDataModule().dataManager.executeQuery(this.parent.getDataModule().generateQuery(!0)).then(function(i){t.getAutoCompleteOptions(e,i),bl(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)}):this.getAutoCompleteOptions(e)},e.prototype.getAutoCompleteOptions=function(e,t){var i,n=e.column.isForeignColumn();if(n){for(var r=Xh.getDistinct(t.result,e.column.field).records||[],s=void 0,l=0;l<r.length;l++)s=s?s.or(e.column.field,"contains",r[parseInt(l.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent):new a.Predicate(e.column.field,"contains",r[parseInt(l.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent);(i=(new a.Query).where(s)).params=this.parent.query.params}var h=n?e.column.dataSource:this.parent.dataSource,d={value:n?e.column.foreignKeyValue:e.column.field},p=new Yh.AutoComplete((0,o.extend)({dataSource:h instanceof a.DataManager?h:new a.DataManager(h),fields:d,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:n?i:this.parent.getDataModule().generateQuery(!0,!0),sortOrder:"Ascending",cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionBegin:function(){if(this.query.queries.length&&"onWhere"===this.query.queries[0].fn&&this.query.queries[0].e&&this.query.queries[0].e.predicates){for(var e=0;e<this.query.queries[0].e.predicates.length;e++)this.properties.fields.value===this.query.queries[0].e.predicates[""+e].field&&(this.query.queries[0].e.predicates.splice(e,1),e-=1);this.query.queries[0].e.predicates.length||this.query.queries.splice(0,1)}}},e.column.filter.params));if(this.acFocus=this.focus(p,e),this.acComplete=this.actionComplete(p),this.acOpen=this.openPopup.bind(this),p.addEventListener(ks,this.acFocus),p.addEventListener(Es,this.acOpen),p.addEventListener(D,this.acComplete),h&&"result"in h){var c=Zl({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new a.Query);this.parent.trigger(Ti,c.state),c.deffered.promise.then(function(e){p.dataSource=new a.DataManager(e)})}this.actObj=p,this.actObj.appendTo(this.instance),n&&this.parent.filterModule.filterModule.afterRenderFilterUI()},e.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getAutoCompleteInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:""===e.filteredValue||(0,o.isNullOrUndefined)(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},e.prototype.read=function(e,t,i,n){if("in"===i||"notin"===i){var r=this.getMultiSelectInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",this.parent.filterSettings.enableCaseSensitivity)}else{var s=this.getAutoCompleteInstance(t.uid);r=e.value;o.Browser.isDevice&&(s.hidePopup(),s.focusOut()),((0,o.isNullOrUndefined)(r)||""===r)&&(r=null),n.filterByColumn(t.field,i,r,"and",this.parent.filterSettings.enableCaseSensitivity)}},e.prototype.getAutoCompleteInstance=function(e){return document.querySelector("#strui-"+e).ej2_instances[0]},e.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectstrui-"+e).ej2_instances[0]},e.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=t?e.column.dataSource:this.parent.dataSource,n=t?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new Yh.MultiSelect((0,o.extend)({dataSource:i instanceof a.DataManager?i:new a.DataManager(i),fields:{text:n,value:n},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new a.Query).select(n),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionCompleteMultiCheckBox(n),this.multiSelectObj.addEventListener(Es,this.dropdownOpen),this.multiSelectObj.addEventListener(D,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},e.prototype.openPopup=function(e){wl(e,this.dialogObj)},e.prototype.focus=function(e,t){return function(){e.filterType=t.getOptrInstance.getFlOperator()}},e.prototype.actionComplete=function(e){return function(t){t.result=t.result.filter(function(t,i,n){return n.map(function(t){return(0,o.getValue)(e.fields.value,t)}).indexOf((0,o.getValue)(e.fields.value,t))===i})}},e.prototype.actionCompleteMultiCheckBox=function(e){return function(t){t.result=a.DataUtil.distinct(t.result,e,!0)}},e.prototype.destroy=function(){this.parent.off(Ci,this.destroy),this.parent.off(Ct,this.destroy),this.actObj&&!this.actObj.isDestroyed&&(this.actObj.removeEventListener(ks,this.acFocus),this.actObj.removeEventListener(Es,this.acOpen),this.actObj.removeEventListener(D,this.acComplete),this.actObj.destroy()),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(Es,this.dropdownOpen),this.multiSelectObj.removeEventListener(D,this.dropdownComplete),this.multiSelectObj.destroy())},e}(),fd=function(){function e(e,t,i){Yh.MultiSelect.Inject(Yh.CheckBoxSelection),this.filterSettings=i,this.parent=e,this.serviceLocator=t,this.parent&&(this.parent.on(Ci,this.destroy,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.keyEventHandler=function(e){if(13===e.keyCode||9===e.keyCode){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)}},e.prototype.create=function(e){this.numericInstance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectnumberui-"+e.column.uid}),e.target.appendChild(this.numericInstance),e.target.appendChild(this.multiSelectCheckBoxInstance),this.createNumericTextBox(e),this.createMultiSelectDropDown(e),bl(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},e.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getNumericInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:(i.element.addEventListener("keydown",this.keyEventHandler),Array.isArray(e.filteredValue)||(i.value=e.filteredValue))},e.prototype.read=function(e,t,i,n){if("in"===i||"notin"===i){var r=this.getMultiSelectInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!0)}else{r=this.getNumericInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!0)}},e.prototype.createNumericTextBox=function(e){this.numericTxtObj=new Qh.NumericTextBox((0,o.extend)({format:"string"==typeof e.column.format||(0,o.isUndefined)(e.column.format)?e.column.format:e.column.format.format,locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.numericInstance)},e.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=t?e.column.dataSource:this.parent.dataSource,n=t?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new Yh.MultiSelect((0,o.extend)({dataSource:i instanceof a.DataManager?i:new a.DataManager(i),fields:{text:n,value:n},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new a.Query).select(n),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(n),this.multiSelectObj.addEventListener(Es,this.dropdownOpen),this.multiSelectObj.addEventListener(D,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},e.prototype.getNumericInstance=function(e){return document.querySelector("#numberui-"+e).ej2_instances[0]},e.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectnumberui-"+e).ej2_instances[0]},e.prototype.openPopup=function(e){wl(e,this.dialogObj)},e.prototype.actionComplete=function(e){return function(t){t.result=a.DataUtil.distinct(t.result,e,!0)}},e.prototype.destroy=function(){this.parent.off(Ci,this.destroy),this.parent.off(Ct,this.destroy),this.numericTxtObj&&!this.numericTxtObj.isDestroyed&&this.numericTxtObj.destroy(),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(Es,this.dropdownOpen),this.multiSelectObj.removeEventListener(D,this.dropdownComplete),this.multiSelectObj.destroy())},e}(),md=function(){function e(e,t,i){Yh.MultiSelect.Inject(Yh.CheckBoxSelection),this.parent=e,this.serviceLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Ci,this.destroy,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.create=function(e){this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.multiSelectElement=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectbool-ui-"+e.column.uid}),e.target.appendChild(this.multiSelectElement),this.createDropDownList(e),this.createMultiSelectDropDown(e),bl(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},e.prototype.write=function(e){var t=this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getBooleanInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:(0,o.isNullOrUndefined)(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},e.prototype.read=function(e,t,i,n){if("in"===i||"notin"===i){var r=this.getMultiSelectInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!0)}else{r=this.getBooleanInstance(t.uid).value;n.filterByColumn(t.field,i,r,"and",!1)}},e.prototype.createDropDownList=function(e){var t=this,i=e.column.isForeignColumn(),n=i?e.column.dataSource:this.parent.dataSource,r=i?e.column.foreignKeyValue:e.column.field;if(this.dialogObj=e.dialogObj,this.dropInstance=new Yh.DropDownList((0,o.extend)({dataSource:n instanceof a.DataManager?n:new a.DataManager(n),query:(new a.Query).select(r),fields:{text:r,value:r},placeholder:e.localizeText.getConstant("SelectValue"),cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(r),this.dropInstance.addEventListener(Es,this.dropdownOpen),this.dropInstance.addEventListener(D,this.dropdownComplete),n&&"result"in n){var s=Zl({requestType:"booleanfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new a.Query);this.parent.trigger(Ti,s.state),s.deffered.promise.then(function(i){t.dropInstance.dataSource=new a.DataManager(i),t.dropInstance.dataBind();for(var n=0,r=t.parent.filterSettings.columns;n<r.length;n++){var s=r[n];e.column.uid===s.uid&&(t.dropInstance.value=s.value)}})}this.dropInstance.appendTo(this.elem)},e.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=t?e.column.dataSource:this.parent.dataSource,n=t?e.column.foreignKeyValue:e.column.field;this.multiSelectCheckBoxInstance=new Yh.MultiSelect((0,o.extend)({dataSource:i instanceof a.DataManager?i:new a.DataManager(i),fields:{text:n,value:n},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new a.Query).select(n),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.multiSelectDropdownOpen=this.openPopup.bind(this),this.multiSelectDropdownComplete=this.actionComplete(n),this.multiSelectCheckBoxInstance.addEventListener(Es,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.addEventListener(D,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.appendTo(this.multiSelectElement)},e.prototype.getBooleanInstance=function(e){return document.querySelector("#bool-ui-"+e).ej2_instances[0]},e.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectbool-ui-"+e).ej2_instances[0]},e.prototype.openPopup=function(e){wl(e,this.dialogObj)},e.prototype.actionComplete=function(e){return function(t){t.result=a.DataUtil.distinct(t.result,e,!0)}},e.prototype.destroy=function(){this.parent.off(Ci,this.destroy),this.parent.off(Ct,this.destroy),this.dropInstance&&!this.dropInstance.isDestroyed&&(this.dropInstance.removeEventListener(Es,this.dropdownOpen),this.dropInstance.removeEventListener(D,this.dropdownComplete),this.dropInstance.destroy()),this.multiSelectCheckBoxInstance&&!this.multiSelectCheckBoxInstance.isDestroyed&&(this.multiSelectCheckBoxInstance.removeEventListener(Es,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.removeEventListener(D,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.destroy())},e}(),yd=function(){function e(e,t,i){this.dpOpen=this.openPopup.bind(this),this.parent=e,this.locator=t,this.fltrSettings=i,this.parent&&(this.parent.on(Ci,this.destroy,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.create=function(e){var t=Ll(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),"date"===e.column.type||"dateonly"===e.column.type?this.datePickerObj=new Jh.DatePicker((0,o.extend)({format:t,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new Jh.DateTimePicker((0,o.extend)({format:t,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params))),this.datePickerObj.addEventListener(Es,this.dpOpen),this.datePickerObj.appendTo(this.inputElem)},e.prototype.write=function(e){document.querySelector("#dateui-"+e.column.uid).ej2_instances[0].value=(0,o.isNullOrUndefined)(e.filteredValue)?null:new Date(e.filteredValue)},e.prototype.read=function(e,t,i,n){var r=document.querySelector("#dateui-"+t.uid).ej2_instances[0].value;r=(0,o.isNullOrUndefined)(r)?null:r,n.filterByColumn(t.field,i,r,"and",!0)},e.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},e.prototype.destroy=function(){this.parent.off(Ci,this.destroy),this.parent.off(Ct,this.destroy),(0,o.isNullOrUndefined)(this.datePickerObj)||this.datePickerObj.isDestroyed||(this.datePickerObj.removeEventListener(Es,this.dpOpen),this.datePickerObj.destroy())},e}(),vd=function(){function e(e,t,i,n,r){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.colTypes={string:gd,number:fd,date:yd,dateonly:yd,boolean:md,datetime:yd},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=n,this.filterObj=r,this.flMuiObj=new ud(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new Xh(e)}return e.prototype.clearCustomFilter=function(e){this.clearBtnClick(e)},e.prototype.applyCustomFilter=function(e){this.filterBtnClick(e.col)},e.prototype.openDialog=function(e){this.options=e,this.col=this.parent.getColumnByField(e.field),((0,o.isNullOrUndefined)(this.col.filter)||(0,o.isNullOrUndefined)(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},e.prototype.closeDialog=function(e){var t=this;if(this.dlgObj){var i=document.getElementById(this.dlgObj.element.id);if(this.dlgObj&&!this.dlgObj.isDestroyed&&i){var n={cancel:!1,column:this.col,target:e,element:i};if(n.cancel)return void(this.parent.isColumnMenuFilterClosing=!1);this.parent.notify(Ci,n),this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off($i,this.actionComplete),this.isMenuCheck=!1);var r=this.col;if(!(0,o.isNullOrUndefined)(r.filter)&&!(0,o.isNullOrUndefined)(r.filter.ui)&&!(0,o.isNullOrUndefined)(r.filter.ui.destroy)){var s=r.filter.ui.destroy;"string"==typeof s&&(s=(0,o.getValue)(s,window)),s()}if((this.parent.isReact||this.parent.isVue)&&this.col.filterTemplate&&this.col.filterTemplate instanceof Function?this.parent.clearTemplate(["filterTemplate"],void 0,function(){t.dlgObj.destroy()}):(this.dlgObj.destroy(),(0,o.remove)(i)),!this.parent.showColumnChooser){var a=document.getElementById(this.parent.element.id+"_e-popup");(0,o.isNullOrUndefined)(a)||((0,o.remove)(a),a=null)}(0,o.isNullOrUndefined)(this.dlgObj.storeActiveElement)||this.dlgObj.storeActiveElement.focus()}this.parent.notify(nr,{})}},e.prototype.renderDlgContent=function(e,t){var i={requestType:Te,columnName:t.field,columnType:t.type};i.filterModel=this,this.parent.trigger(R,i);var n=this.parent.createElement("div",{className:"e-flmenu-maindiv",id:t.uid+"-flmenu"});(this.dlgDiv=this.parent.createElement("div",{className:"e-flmenu",id:t.uid+"-flmdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("FilterMenuDialogARIA")),this.parent.enableAdaptiveUI)?document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv").appendChild(this.dlgDiv):this.parent.element.appendChild(this.dlgDiv);this.dlgObj=new y.Dialog({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,t),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,t),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-flmenu-okbtn "+this.parent.cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,t),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:this.parent.cssClass?"e-flmenu-cancelbtn "+this.parent.cssClass:"e-flmenu-cancelbtn"}}],content:n,width:!(0,o.isNullOrUndefined)(_a(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:this.parent.cssClass?"e-filter-popup "+this.parent.cssClass:"e-filter-popup"});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgObj.appendTo(this.dlgDiv)},e.prototype.renderResponsiveDialog=function(){this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.buttons=[{}])},e.prototype.dialogCreated=function(e,t){!o.Browser.isDevice&&e?Cl(e,this.dlgObj,this.parent):this.options.isResponsiveFilter||(this.dlgObj.position={X:"center",Y:"center"}),this.currentDialogCreatedColumn=t,this.renderFilterUI(e,t),t.isForeignColumn()&&((0,o.isNullOrUndefined)(t.filter)||(0,o.isNullOrUndefined)(t.filter.ui)||(0,o.isNullOrUndefined)(t.filter.ui.create))||(0,o.isNullOrUndefined)(t.type)||this.afterRenderFilterUI();var i=this.parent.isReact&&"string"!=typeof t.filterTemplate,n=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(0,o.isNullOrUndefined)(t.filterTemplate)||i||n?(0,o.isNullOrUndefined)(this.dlgDiv.querySelector(".e-flmenu-input"))||(this.dlgDiv.querySelector(".e-flmenu-input").focus(),this.dlgDiv.querySelector(".e-flmenu-input").parentElement.classList.add("e-input-focus")):(this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.focus(),this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.classList.add("e-input-focus"))},e.prototype.afterRenderFilterUI=function(){var e=this.currentDialogCreatedColumn;e.showColumnMenu&&this.parent.notify(Si,{}),this.parent.enableAdaptiveUI?(this.dlgObj.element.style.left="0px",this.dlgObj.element.style.maxHeight="none"):this.dlgObj.element.style.maxHeight=this.maxHeight,this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!_a(this.parent.element,"e-gantt-dialog")&&hh(this.parent,this.dlgObj);var t=this.flMuiObj.getFlOperator(),i=this.dlgObj.element.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===t||"isnotempty"===t||"isnull"===t||"isnotnull"===t?(0,o.isNullOrUndefined)(i.ej2_instances)?i.setAttribute("disabled","true"):i.ej2_instances[0].enabled=!1:(0,o.isNullOrUndefined)(i&&i.getAttribute("disabled"))||((0,o.isNullOrUndefined)(i.ej2_instances)?i.removeAttribute("disabled"):i.ej2_instances[0].enabled=!0),e.filterTemplate||this.writeMethod(e,this.dlgObj.element.querySelector("#"+e.uid+"-flmenu"));var n={requestType:De,columnName:e.field,columnType:e.type};n.filterModel=this,this.isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(D,n)},e.prototype.renderFilterUI=function(e,t){var i=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},e.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},e.prototype.renderFlValueUI=function(e,t,i){var n=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),r=this.filterObj;if(e.appendChild(n),!(0,o.isNullOrUndefined)(i.type)){var s=new this.colTypes[i.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(i.filterTemplate){var a={};a[i.field]=a.value=r.values[i.field],i.foreignKeyValue&&(a[i.foreignKeyValue]=r.values[i.field],a[i.field]=void 0);a.column=i;var l=this.parent.isReact&&"string"!=typeof i.filterTemplate&&!(i.filterTemplate.prototype&&i.filterTemplate.prototype.CSPTemplate),h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,d=this.parent.element.id+i.uid+"filterTemplate";if(l||h)i.getFilterTemplate()(a,this.parent,"filterTemplate",d,null,null,n),this.parent.renderTemplates();else $a(n,i.getFilterTemplate()(a,this.parent,"filterTemplate",d,null,null,null,this.parent.root));this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on($i,this.actionComplete,this),this.menuFilterBase.getAllData())}else if((0,o.isNullOrUndefined)(i.filter)||(0,o.isNullOrUndefined)(i.filter.ui)||(0,o.isNullOrUndefined)(i.filter.ui.create))s.create({column:i,target:n,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj});else{var p=i.filter.ui.create;"string"==typeof p&&(p=(0,o.getValue)(p,window)),p({column:i,target:n,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj})}}},e.prototype.writeMethod=function(e,t){for(var i,n=t.querySelector(".e-flmenu-valinput"),r=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),s=0,a=this.filterSettings.columns;s<a.length;s++){var l=a[s];e.uid===l.uid&&(i=l.value)}if((0,o.isNullOrUndefined)(e.filter)||(0,o.isNullOrUndefined)(e.filter.ui)||(0,o.isNullOrUndefined)(e.filter.ui.write))r.write({column:e,target:n,parent:this.parent,filteredValue:i});else{var h=e.filter.ui.write;"string"==typeof h&&(h=(0,o.getValue)(h,window)),h({column:e,target:n,parent:this.parent,filteredValue:i})}},e.prototype.filterBtnClick=function(e){var t=this.dlgObj.element.querySelector(".e-flmenu-valuediv input"),i=this.flMuiObj.getFlOperator(),n=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);if(e.filterTemplate){var r=this.dlgDiv.querySelector(".e-flmenu-valuediv"),s=void 0;if(r.children[0].value)s=r.children[0].value;else if((0,o.isNullOrUndefined)(r.children[0].ej2_instances)){var a=r.querySelector(".e-control");(0,o.isNullOrUndefined)(a)||(s="boolean"===e.type?a.checked:(0,o.isNullOrUndefined)(a.ej2_instances)?a.value:a.ej2_instances[0].value)}else s=(this.parent.isAngular?r.children[0]:r.querySelector("input")).ej2_instances[0].value;this.filterObj.filterByColumn(e.field,i,s)}else if((0,o.isNullOrUndefined)(e.filter)||(0,o.isNullOrUndefined)(e.filter.ui)||(0,o.isNullOrUndefined)(e.filter.ui.read))n.read(t,e,i,this.filterObj);else{var l=e.filter.ui.read;"string"==typeof l&&(l=(0,o.getValue)(l,window)),l({element:t,column:e,operator:i,fltrObj:this.filterObj})}this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(Fr,{})},e.prototype.closeResponsiveDialog=function(){this.closeDialog()},e.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(Fr,{})},e.prototype.destroy=function(){this.closeDialog()},e.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},e.prototype.getOperatorDropdown=function(){return this.flMuiObj.dropOptr},e.prototype.renderCheckBoxMenu=function(){return this.isMenuCheck=!0,this.menuFilterBase.updateModel(this.options),this.menuFilterBase.getAndSetChkElem(this.options),this.dlgObj.buttons=[{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{content:this.menuFilterBase.getLocalizedLabel("FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{cssClass:"e-flat",content:this.menuFilterBase.getLocalizedLabel("ClearButton")}}],this.menuFilterBase.dialogObj=this.dlgObj,this.menuFilterBase.dlg=this.dlgObj.element,this.menuFilterBase.dlg.classList.add("e-menucheckbox"),this.menuFilterBase.dlg.classList.remove("e-checkboxfilter"),this.maxHeight="800px",this.menuFilterBase.sBox.innerHTML},e.prototype.actionComplete=function(e){this.isMenuCheck&&this.parent.trigger(D,e)},e}(),Sd=function(){function e(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new Xh(e),this.addEventListener()}return e.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},e.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},e.prototype.closeDialog=function(){this.destroy(),this.isresetFocus&&this.parent.notify(on,{})},e.prototype.closeResponsiveDialog=function(){this.checkBoxBase.closeDialog()},e.prototype.getModuleName=function(){return"checkboxFilter"},e.prototype.actionBegin=function(e){this.parent.trigger(R,e)},e.prototype.actionComplete=function(e){this.parent.trigger(D,e)},e.prototype.actionPrevent=function(e){fl(this.parent)&&(this.parent.notify(Wt,e),e.cancel=!0)},e.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},e.prototype.applyCustomFilter=function(){this.checkBoxBase.fltrBtnHandler(),this.checkBoxBase.closeDialog()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Zi,this.actionBegin,this),this.parent.on($i,this.actionComplete,this),this.parent.on(en,this.actionPrevent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Zi,this.actionBegin),this.parent.off($i,this.actionComplete),this.parent.off(en,this.actionPrevent))},e}(),Cd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wd=function(e){function t(t,i,n,r){var s=e.call(this,t,i,n)||this;return s.parent=t,s.isresetFocus=!0,s.excelFilterBase=new ed(t,r),s}return Cd(t,e),t.prototype.destroy=function(){this.excelFilterBase.closeDialog()},t.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},t.prototype.closeDialog=function(){this.excelFilterBase.closeDialog(),this.isresetFocus&&this.parent.notify(on,{})},t.prototype.clearCustomFilter=function(e){this.excelFilterBase.clearFilter(e)},t.prototype.closeResponsiveDialog=function(e){e?this.excelFilterBase.removeDialog():this.closeDialog()},t.prototype.applyCustomFilter=function(e){e.isCustomFilter?this.excelFilterBase.filterBtnClick(e.col.field):(this.excelFilterBase.fltrBtnHandler(),this.excelFilterBase.closeDialog())},t.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.excelFilterBase.filterByColumn(e,t,i,n,r,s,o,a)},t.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},t.prototype.getModuleName=function(){return"excelFilter"},t}(Sd),bd=function(){function e(e,t,i){this.predicate="and",this.contentRefresh=!0,this.filterByMethod=!0,this.refresh=!0,this.values={},this.operators={},this.cellText={},this.nextFlMenuOpen="",this.type={Menu:vd,CheckBox:Sd,Excel:wd},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.actualPredicate={},this.inputList=[],this.isFilterCleared=!1,this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}return e.prototype.render=function(e){if(!a.DataUtil.getObject("args.isFrozen",e)){var i=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&i.columns.length){var n=this.parent.element.querySelector(".e-filterbar");n&&(0,o.remove)(n);var r=new js(this.serviceLocator,t.Filter,i);this.serviceLocator.getService("cellRendererFactory").addCellRenderer(t.Filter,new cd(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),r.element=this.parent.createElement("tr",{className:"e-filterbar",attrs:{role:"row"}});var s=this.generateRow();s.data=this.values,this.parent.getHeaderContent().querySelector("thead:not(.e-masked-thead)").appendChild(r.element);var l=this.parent.element.querySelector(".e-rowdragheader");if(this.element=r.render(s,i.getColumns(),null,null,r.element),this.element.querySelectorAll(".e-leftfreeze").length&&(this.element.querySelectorAll(".e-indentcell").length||this.element.querySelectorAll(".e-grouptopleftcell").length))for(var h=this.element.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),d=0;d<h.length;d++)h[parseInt(d.toString(),10)].classList.add("e-leftfreeze"),gh(h[parseInt(d.toString(),10)],30*d,this.parent.enableRtl,"Left");uh(this.element);var p=this.element.querySelector(".e-detailheadercell");p&&(p.className="e-filterbarcell e-mastercell"),l&&(l.classList.contains("e-leftfreeze")?l.className="e-dragheadercell e-mastercell e-leftfreeze":l.className="e-filterbarcell e-mastercell");var c=[].slice.call(this.element.getElementsByClassName("e-grouptopleftcell"));c.length&&c[c.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(pi,{case:"filter"})}}},e.prototype.showCustomFilter=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog(this.column)},e.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},e.prototype.setFilterModel=function(e){var t=e.filter.type||this.parent.filterSettings.type;this.filterModule=new this.type[""+t](this.parent,this.parent.filterSettings,this.serviceLocator,this.customOperators,this)},e.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+ns)||e.querySelector("."+rs))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowFiltering||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&!this.parent.isDestroyed){if(this.filterSettings.showFilterBarOperator)for(var t=[].slice.call(this.element.getElementsByClassName("e-filterbaroperator")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].ej2_instances[0]&&t[parseInt(i.toString(),10)].ej2_instances[0].destroy();this.parent.getColumns().map(function(e){if(e.filterBarTemplate&&!(0,o.isNullOrUndefined)(e.filterBarTemplate.destroy)){var t=e.filterBarTemplate.destroy;"string"==typeof t&&(t=(0,o.getValue)(t,window)),t()}})}if(this.element){if(this.element.parentElement){for(i=0;i<this.inputList.length;i++)Qh.Input.destroy(this.inputList[parseInt(i.toString(),10)],this.inputList[parseInt(i.toString(),10)].element.nextElementSibling),(0,o.remove)(this.inputList[parseInt(i.toString(),10)].element);this.inputList=[],(0,o.remove)(this.element),this.element=null}var n=this.parent.getHeaderContent().querySelector(".e-filterbar");n&&(0,o.remove)(n)}}},e.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,r.isFilter)},e.prototype.generateRow=function(){var e=new $r({});return e.cells=this.generateCells(),e},e.prototype.generateCells=function(){var e=[];if(this.parent.allowGrouping)for(var i=0,n=this.parent.groupSettings.columns.length;i<n;i++)e.push(this.generateCell({},t.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},t.DetailHeader)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&e.push(this.generateCell({},t.RowDragHIcon));for(var r=0,s=this.parent.getColumns();r<s.length;r++){var o=s[r];e.push(this.generateCell(o))}return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&e.push(this.generateCell({},t.RowDragHIcon)),e},e.prototype.generateCell=function(e,i){var n={visible:e.visible,isDataCell:!1,rowId:"",column:e,cellType:i||t.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new es(n)},e.prototype.updateModel=function(){var e=this.column.isForeignColumn()||this.parent.enableColumnVirtualization?this.parent.getColumnByUid(this.column.uid,!0):this.parent.getColumnByField(this.fieldName);this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex];for(var t=Array.isArray(this.value)&&this.value.length?this.value:[this.value],i=this.parent.dataSource.adaptor&&this.parent.dataSource.adaptor.getModuleName?this.parent.dataSource.adaptor.getModuleName():void 0,n=0,r=t.length;n<r;n++){var s=e.isForeignColumn()?e.foreignKeyValue:this.fieldName,l="notequal"===this.operator;"in"===this.operator||"notin"===this.operator?(!this.parent.getDataModule().isRemote()||"date"!==e.type&&"dateonly"!==e.type&&"datetime"!==e.type||(t=a.DataUtil.parse.arrayReplacer(t)),this.currentFilterObject={field:s,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t,predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},r=0):this.currentFilterObject={field:s,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t[parseInt(n.toString(),10)],predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}};var h=this.getFilteredColsIndexByField(e);h>-1&&(!Array.isArray(this.value)||Array.isArray(this.value)&&("in"===this.operator||"notin"===this.operator))?this.filterSettings.columns[parseInt(h.toString(),10)]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject),this.column.isForeignColumn()||!this.prevFilterObject||!(0,o.isNullOrUndefined)(this.prevFilterObject.value)&&""!==this.prevFilterObject.value||"equal"!==this.prevFilterObject.operator&&"notequal"!==this.prevFilterObject.operator||"ODataAdaptor"===i||"ODataV4Adaptor"===i||this.handleExistingFilterCleanup(s),this.column.isForeignColumn()||!(0,o.isNullOrUndefined)(this.value)||"equal"!==this.operator&&"notequal"!==this.operator||"ODataAdaptor"===i||"ODataV4Adaptor"===i||(this.handleExistingFilterCleanup(s),"string"===e.type&&this.filterSettings.columns.push({field:s,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:l?"and":"or",value:""}),this.filterSettings.columns.push({field:s,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:l?"and":"or",value:void 0}),this.filterSettings.columns.push({field:s,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:l?"and":"or",value:null}))}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},e.prototype.handleExistingFilterCleanup=function(e){for(var t=0;t<this.filterSettings.columns.length;t++)this.filterSettings.columns[""+t].field!==e||"equal"!==this.filterSettings.columns[""+t].operator&&"notequal"!==this.filterSettings.columns[""+t].operator||!(0,o.isNullOrUndefined)(this.filterSettings.columns[""+t].value)||(this.filterSettings.columns.splice(t,1),t-=1)},e.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return i;return-1},e.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"filtering",type:D}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:(0,o.isNullOrUndefined)(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:D};this.parent.trigger(D,(0,o.extend)(e,t)),this.isRemove=!1},e.prototype.wireEvents=function(){o.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},e.prototype.unWireEvents=function(){o.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},e.prototype.refreshFilterValue=function(){(0,o.isNullOrUndefined)(this.parent.modelObserver.boundedEvents)||this.parent.removeEventListener(fe,this.refreshFilterValueFn),"FilterBar"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||!this.filterSettings.columns.length||this.parent.getCurrentViewRecords().length||this.initialEnd()},e.prototype.initialEnd=function(){if(this.parent.off(Ne,this.initialEnd),this.parent.getColumns().length&&this.filterSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.initialLoad=!0;for(var t=0,i=e.filterSettings.columns;t<i.length;t++){var n=i[t];this.filterByColumn(n.field,n.operator,n.value,n.predicate,n.matchCase,n.ignoreAccent,n.actualFilterValue,n.actualOperator,n.isForeignKey)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(hr,this.setFullScreenDialog,this),this.parent.on(Be,this.enableAfterRender,this),this.parent.on(Qe,this.onActionComplete,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(vt,this.keyUpHandler,this),this.parent.on(xt,this.columnPositionChanged,this),this.parent.on(je,this.render,this),this.parent.on(Ne,this.initialEnd,this),this.parent.on(Ci,this.filterMenuClose,this),this.parent.on(Ur,this.renderResponsiveChangeAction,this),this.docClickHandler=this.clickHandler.bind(this),o.EventHandler.add(document,"click",this.docClickHandler,this),o.EventHandler.add(this.parent.element,"mousedown",this.refreshClearIcon,this),this.parent.on(vi,this.columnMenuFilter,this),this.parent.on(St,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on(kn,this.clickHandler,this),this.parent.on(Ct,this.destroy,this),this.refreshFilterValueFn=this.refreshFilterValue.bind(this),this.parent.addEventListener(fe,this.refreshFilterValueFn))},e.prototype.removeEventListener=function(){o.EventHandler.remove(document,"click",this.docClickHandler),o.EventHandler.remove(this.parent.element,"mousedown",this.refreshClearIcon),this.parent.isDestroyed||(this.parent.off(hr,this.setFullScreenDialog),this.parent.off(Be,this.enableAfterRender),this.parent.off(Qe,this.onActionComplete),this.parent.off(qe,this.onPropertyChanged),this.parent.off(vt,this.keyUpHandler),this.parent.off(xt,this.columnPositionChanged),this.parent.off(je,this.render),this.parent.off(vi,this.columnMenuFilter),this.parent.off(Ci,this.filterMenuClose),this.parent.off(Ur,this.renderResponsiveChangeAction),this.parent.off(St,this.filterIconClickHandler),this.parent.off(kn,this.clickHandler),this.parent.off(Ct,this.destroy))},e.prototype.refreshClearIcon=function(e){if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type&&e.target.closest("th")&&e.target.closest("th").classList.contains("e-filterbarcell")&&e.target.classList.contains("e-clear-icon")){var t=e.target.previousElementSibling;Qh.Input.setValue(null,t,"Never",!0),"Immediate"===this.filterSettings.mode&&this.removeFilteredColsByField(t.id.slice(0,-14))}},e.prototype.filterMenuClose=function(){this.fltrDlgDetails.isOpen=!1},e.prototype.filterByColumn=function(e,t,i,n,r,s,a,l,h){var d,p=this,c=this.parent;if("string"==typeof i&&(i=this.parent.sanitize(i)),this.column=c.grabColumnByFieldFromAllCols(e,h),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(0,o.isNullOrUndefined)(this.column.filterBarTemplate)&&(0,o.isNullOrUndefined)(this.column.filterTemplate)&&(t=this.getOperatorName(e)),"like"===t&&i&&-1===i.indexOf("%")&&(i="%"+i+"%"),this.column)if("FilterBar"===this.filterSettings.type&&(d=c.getHeaderContent().querySelector("[id='"+this.column.field+"_filterBarcell']")),(0,o.isNullOrUndefined)(this.column.allowFiltering)||this.column.allowFiltering)if(fl(c))c.notify(Wt,{instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:r,arg6:s,arg7:a,arg8:l});else{if(this.predicate=n||(Array.isArray(i)?"or":"and"),this.value=i,this.matchCase=r||!1,this.ignoreAccent=this.ignoreAccent=(0,o.isNullOrUndefined)(s)?this.parent.filterSettings.ignoreAccent:s,this.fieldName=e,this.operator=t,""===(i=(0,o.isNullOrUndefined)(i)?i:i.toString())&&(i=null),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),d&&"FilterBar"===this.filterSettings.type){if(i&&i.length<1||!this.filterByMethod&&this.checkForSkipInput(this.column,i))return this.filterStatusMsg=i&&i.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg();d.value!==i&&(d.value=i)}(0,o.isNullOrUndefined)(this.column.format)?this.values[this.column.field]=i:(this.applyColumnFormat(i),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(d.value=this.values[this.column.field]));var u={field:this.fieldName,predicate:n,matchCase:r,ignoreAccent:s,operator:this.operator,value:this.value,type:this.column.type};this.parent.filterSettings.columns.filter(function(e){return e.field===p.fieldName}).length>1&&!(0,o.isNullOrUndefined)(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(u):this.actualPredicate[this.fieldName]=[u],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:this.column.headerText})},e.prototype.applyColumnFormat=function(e){var t=this,i="date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type?new Date(e):parseFloat(e);("date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type)&&e&&Array.isArray(this.value)&&e.split(",").length>1?this.values[this.column.field]=e.split(",").map(function(e){return""===e&&(e=null),t.setFormatForFlColumn(new Date(e),t.column)}):this.values[this.column.field]=this.setFormatForFlColumn(i,this.column)},e.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),n=0;n<i.length;n++){var r=Object.keys(e[i[parseInt(n.toString(),10)]]);1===r.length&&"uid"===r[0]&&(t=!1)}return t},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var n=i[t];switch(n){case"columns":var r={currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,action:"filter",columns:this.filterSettings.columns,requestType:"filtering",type:R,cancel:!1};if(this.contentRefresh&&this.skipUid(e.properties.columns)){if(this.parent.notify(Ue,r),r.cancel){if("CheckBox"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||this.column&&this.column.filter&&"Menu"===this.column.filter.type)(0,o.isNullOrUndefined)(this.prevFilterObject)?this.filterSettings.columns.splice(this.filterSettings.columns.length-1,1):this.filterSettings.columns[this.filterObjIndex]=this.prevFilterObject;else{this.filterSettings.columns=this.actualData.length<=1?this.checkboxPrevFilterObject:this.checkboxFilterObject,this.actualPredicate[this.column.field]=this.filterSettings.columns;var s=this.parent.getColumnByField(this.column.field),a=this.parent.showColumnMenu&&s.showColumnMenu?".e-columnmenu":".e-icon-filter",l=this.parent.getColumnHeaderByField(this.column.field).querySelector(a);0===this.checkboxPrevFilterObject.length?l.classList.remove("e-filtered"):l.classList.add("e-filtered")}return}this.updateFilterIcon(),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter()}break;case"showFilterBarStatus":e.properties[""+n]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":this.parent.refreshHeader(),this.refreshFilterSettings(),"100%"===this.parent.height&&this.parent.scrollModule.refresh()}}},e.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(var e=0;e<this.filterSettings.columns.length;e++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[parseInt(e.toString(),10)].uid)||this.parent.getColumnByField(this.filterSettings.columns[parseInt(e.toString(),10)].field);var t=this.filterSettings.columns[parseInt(e.toString(),10)].value;if(t=!(0,o.isNullOrUndefined)(t)&&t.toString(),(0,o.isNullOrUndefined)(this.column.format)){var i=this.filterSettings.columns[parseInt(e.toString(),10)].field;this.values[""+i]=this.filterSettings.columns[parseInt(e.toString(),10)].value}else this.applyColumnFormat(t);(r=this.getFilterBarElement(this.column.field))&&(""===this.cellText[this.filterSettings.columns[parseInt(e.toString(),10)].field]||(0,o.isNullOrUndefined)(this.cellText[this.filterSettings.columns[parseInt(e.toString(),10)].field])?r.value=this.filterSettings.columns[parseInt(e.toString(),10)].value:r.value=this.cellText[this.column.field]);r&&this.filterSettings.showFilterBarOperator&&["isnull","isnotnull","isempty","isnotempty"].indexOf(this.filterSettings.columns[parseInt(e.toString(),10)].operator)>-1&&(r.value=this.l10n.getConstant({isnull:"IsNull",isnotnull:"NotNull",isnotempty:"IsNotEmpty",isempty:"IsEmpty"}[this.filterSettings.columns[parseInt(e.toString(),10)].operator]))}if(0===this.filterSettings.columns.length){var n=this.parent.getColumns();for(e=0;e<n.length;e++){var r;(r=this.getFilterBarElement(n[parseInt(e.toString(),10)].field))&&""!==r.value&&(r.value="",delete this.values[n[parseInt(e.toString(),10)].field])}}}},e.prototype.updateFilterIcon=function(){if(0===this.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var e=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),t=0,i=e.length;t<i;t++)e[parseInt(t.toString(),10)].classList.remove("e-filtered")},e.prototype.getFilterBarElement=function(e){var t,i="[id='"+e+"_filterBarcell']";return i&&!(0,o.isNullOrUndefined)(this.element)&&(t=this.element.querySelector(i)),t},e.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},e.prototype.clearFiltering=function(e){var t=this,i=Qa(this.filterSettings.columns);if(this.isFilterCleared=!0,!(0,o.isNullOrUndefined)(e))return this.refresh=!1,e.forEach(function(e){t.removeFilteredColsByField(e,!1)}),this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.parent.renderModule.refresh(),void(this.refresh=!0);if(fl(this.parent))this.parent.notify(Wt,{instance:this,handler:this.clearFiltering});else{for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=i[parseInt(n.toString(),10)].uid||this.parent.getColumnByField(i[parseInt(n.toString(),10)].field).uid;var r=i.map(function(e){return e.uid}),s=r.filter(function(e,t){return r.indexOf(e)===t});this.refresh=!1;n=0;for(var a=s.length;n<a;n++)this.removeFilteredColsByField(this.parent.getColumnByUid(s[parseInt(n.toString(),10)]).field,!1);if(this.refresh=!0,s.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered")){var l=[].slice.call(this.parent.element.getElementsByClassName("e-filtered"));for(n=0,a=l.length;n<a;n++)l[0].classList.remove("e-filtered")}this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()}},e.prototype.checkAlreadyColFiltered=function(e){for(var t=0,i=this.filterSettings.columns;t<i.length;t++){var n=i[t];if(n.field===e&&n.operator===this.operator&&n.predicate===this.predicate&&"Menu"===this.parent.filterSettings.type&&("date"===n.type||"datetime"===n.type))return this.checkDateColumnValue(n.value,this.value);if(n.field===e&&n.value===this.value&&n.operator===this.operator&&n.predicate===this.predicate)return!0}return!1},e.prototype.checkDateColumnValue=function(e,t){return!(!(0,o.isNullOrUndefined)(e)||!(0,o.isNullOrUndefined)(t))||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():"string"==typeof e&&"string"==typeof t&&e===t)},e.prototype.columnMenuFilter=function(e){this.column=e.col;var t=(0,o.closest)(e.target,"#"+e.id);e.isClose&&!t?this.filterModule.closeDialog():t&&this.filterDialogOpen(this.column,e.target)},e.prototype.filterDialogOpen=function(e,t,i,n){this.filterModule&&(this.filterModule.isresetFocus=!1,this.filterModule.closeDialog()),this.setFilterModel(e),this.filterModule.openDialog(this.createOptions(e,t,i,n))},e.prototype.createOptions=function(e,t,i,n){var r=this.parent,s=e.filter.dataSource||r.dataSource&&"result"in r.dataSource?r.dataSource:r.getDataModule().dataManager,a=e.filter.type||this.parent.filterSettings.type;return{type:e.type,field:e.field,displayName:e.headerText,dataSource:s,format:e.format,height:800,columns:r.getColumns(),filteredColumns:r.filterSettings.columns,target:t,dataManager:r.getDataModule().dataManager,formatFn:e.getFormatter(),ignoreAccent:r.filterSettings.ignoreAccent,parserFn:e.getParser(),query:r.query,template:e.getFilterItemTemplate(),hideSearchbox:!(0,o.isNullOrUndefined)(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:r.getLocaleConstants(),position:{X:i,Y:n},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:r.localeObj,isRemote:r.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity,isResponsiveFilter:this.parent.enableAdaptiveUI,operator:this.actualPredicate[e.field]&&"Menu"===a?this.actualPredicate[e.field][0].operator:"equal",parentTotalDataCount:r.getDataModule().isRemote()&&r.allowPaging?r.pagerModule.pagerObj.totalRecordsCount:r.getDataModule().isRemote()?r.totalDataRecordsCount:r.getFilteredRecords().length,parentCurrentViewDataCount:r.currentViewData.length,parentFilteredLocalRecords:r.getDataModule().isRemote()?[]:r.getFilteredRecords()}},e.prototype.removeFilteredColsByField=function(e,t){var i,n=this.filterSettings.columns;if(fl(this.parent)){var r={instance:this,handler:this.removeFilteredColsByField,arg1:e,arg2:t};this.parent.notify(Wt,r)}else{var s=n.map(function(e){return e.uid}),a=s.filter(function(e,t){return s.indexOf(e)===t});if(!(0,o.isNullOrUndefined)(this.column)){var l=this.column.isForeignColumn()?this.parent.getColumnByUid(this.column.uid):this.parent.getColumnByField(e);this.filterObjIndex=this.getFilteredColsIndexByField(l),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex]}for(var h=function(r,s){n[parseInt(r.toString(),10)].uid=n[parseInt(r.toString(),10)].uid||d.parent.getColumnByField(n[parseInt(r.toString(),10)].field).uid;var o=n.length,l=d.parent.grabColumnByUidFromAllCols(a[parseInt(r.toString(),10)]);if(l.field===e||l.field===l.foreignKeyValue&&l.isForeignColumn()){var h=d.filterSettings.columns.filter(function(e){return e.uid===l.uid})[0];if("FilterBar"===d.filterSettings.type&&!t){var p="[id='"+l.field+"_filterBarcell']";(i=d.parent.getHeaderContent().querySelector(p))&&(i.value="",delete d.values[""+e])}for(;o--;)n[parseInt(o.toString(),10)].uid===l.uid&&n.splice(o,1);var c=d.parent.getColumnHeaderByField(l.field);if("FilterBar"!==d.filterSettings.type||d.parent.showColumnMenu){var u=d.parent.showColumnMenu&&l.showColumnMenu?".e-columnmenu":".e-icon-filter";c.querySelector(u).classList.remove("e-filtered")}return d.isRemove=!0,d.actualPredicate[""+e]&&delete d.actualPredicate[""+e],d.values[""+e]&&delete d.values[""+e],d.refresh&&d.parent.notify(Ue,{requestType:"filtering",type:R,currentFilterObject:h,currentFilterColumn:l,action:"clearFilter"}),"break"}},d=this,p=0,c=a.length;p<c;p++){if("break"===h(p))break}this.updateFilterMsg(),this.parent.renderModule.resetPartialRecords()}},e.prototype.getModuleName=function(){return"filter"},e.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},e.prototype.keyUpHandler=function(e){var t=this.parent,i=e.target;if(i&&(0,o.matches)(i,".e-filterbar input")){var n=(0,o.closest)(i,"th.e-filterbarcell");if(this.column=t.getColumnByUid(n.getAttribute("data-mappinguid")),!this.column)return;if("altDownArrow"===e.action&&this.parent.filterSettings.showFilterBarOperator){var r=(0,o.closest)(i,"span").querySelector(".e-filterbaroperator");r.ej2_instances[0].showPopup(),r.focus()}"Immediate"!==this.filterSettings.mode&&(13!==e.keyCode||e.target.classList.contains("e-filterbaroperator"))||9===e.keyCode||this.column.filterTemplate||(this.value=i.value.trim(),this.processFilter(e))}if("altDownArrow"===e.action&&"FilterBar"!==this.filterSettings.type&&!_a(e.target,"e-toolbar")&&(0,o.isNullOrUndefined)(this.parent.element.querySelector(".e-filter-popup"))&&!this.parent.enableAdaptiveUI){var s=t.focusModule.currentInfo.element;if(s&&s.classList.contains("e-headercell")&&!s.classList.contains("e-stackedheadercell")){var a=t.getColumnByUid(s.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));this.openMenuByField(a.field),this.parent.focusModule.clearIndicator()}}"escape"===e.action&&"Menu"===this.filterSettings.type&&this.filterModule&&(this.parent.showColumnMenu&&this.filterModule.isDialogOpen&&(this.parent.isColumnMenuFilterClosing=!0),this.filterModule.closeDialog(),t.notify(on,{}),this.parent.showColumnMenu||t.notify(on,{}))},e.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},e.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,t=void 0,i=this.filterSettings.columns,n=void 0;if(!this.filterSettings.showFilterBarStatus)return;if(i.length>0&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var r=0;r<i.length;r++)if(n=e.grabColumnByUidFromAllCols(i[parseInt(r.toString(),10)].uid)||e.grabColumnByFieldFromAllCols(i[parseInt(r.toString(),10)].field,i[parseInt(r.toString(),10)].isForeignKey),r&&(this.filterStatusMsg+=" && "),(0,o.isNullOrUndefined)(n.format))this.filterStatusMsg+=n.headerText+": "+this.values[n.field];else{var s="date"===n.type||"datetime"===n.type||"dateonly"===n.type?this.valueFormatter.fromView(this.values[n.field],n.getParser(),"dateonly"===n.type?"date":n.type):this.values[n.field];if("date"!==n.type&&"datetime"!==n.type&&"dateonly"!==n.type)t=this.serviceLocator.getService("valueFormatter").toView(s,n.getParser()).toString();else t=this.setFormatForFlColumn(s,n);this.filterStatusMsg+=n.headerText+": "+t}}e.allowPaging&&(e.updateExternalMessage(this.filterStatusMsg),"100%"===this.parent.height&&this.parent.scrollModule.refresh()),this.filterStatusMsg=""}},e.prototype.setFormatForFlColumn=function(e,t){var i=this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter());return(0,o.isNullOrUndefined)(i)?i:i.toString()},e.prototype.checkForSkipInput=function(e,t){var i;if("number"===e.type)(a.DataUtil.operatorSymbols[""+t]||this.skipNumberInput.indexOf(t)>-1)&&(i=!0);else if("string"===e.type)for(var n=0,r=t;n<r.length;n++){var s=r[n];this.skipStringInput.indexOf(s)>-1&&(i=!0)}return i},e.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},e.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.onTimerTick=function(){var e,t="[id='"+this.column.field+"_filterBarcell']",i=this.element.querySelector(t);if(i||(i=this.parent.getHeaderContent().querySelector(t)),this.cellText[this.column.field]=i.value,this.stopTimer(),(0,o.isNullOrUndefined)(this.column.filterBarTemplate))e=JSON.parse(JSON.stringify(i.value));else{var n=this.column.filterBarTemplate.read;"string"==typeof n&&(n=(0,o.getValue)(n,window)),(0,o.isNullOrUndefined)(n)||(this.value=n.call(this,i))}(0,o.isNullOrUndefined)(this.value)||""===this.value?this.removeFilteredColsByField(this.column.field):(this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent,this.column.isForeignColumn()),this.filterByMethod=!0,i.value=e,this.updateFilterMsg())},e.prototype.validateFilterValue=function(e){var t,i;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal,t=[">","<","=","!"];for(var n=0;n<e.length;n++)if(t.indexOf(e[parseInt(n.toString(),10)])>-1){i=n;break}this.getOperator(e.substring(i)),0!==i&&(this.value=e.substring(0,i)),""!==this.value&&e.length>=1&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),(0,o.isNullOrUndefined)(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,this.column.filter.operator?this.operator=this.column.filter.operator:-1!==e.indexOf("*")||-1!==e.indexOf("?")||-1!==e.indexOf("%3f")?this.operator=this.filterOperators.wildCard:-1!==e.indexOf("%")?this.operator=this.filterOperators.like:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},e.prototype.getOperator=function(e){var t=e.charAt(0),i=e.slice(0,2),n=(0,o.extend)({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},a.DataUtil.operatorSymbols);(n.hasOwnProperty(t)||n.hasOwnProperty(i))&&(this.operator=n[""+t],this.value=e.substring(1),this.operator||(this.operator=n[""+i],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},e.prototype.columnPositionChanged=function(){this.parent.filterSettings.type},e.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"isempty",text:this.l10n.getConstant("IsEmpty")},{value:"doesnotstartwith",text:this.l10n.getConstant("NotStartsWith")},{value:"doesnotendwith",text:this.l10n.getConstant("NotEndsWith")},{value:"doesnotcontain",text:this.l10n.getConstant("NotContains")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnotempty",text:this.l10n.getConstant("IsNotEmpty")},{value:"like",text:this.l10n.getConstant("Like")}],numberOperator:e,dateOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],datetimeOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],dateonlyOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}],booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]},"Menu"===this.filterSettings.type&&(this.customOperators.stringOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.booleanOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.numberOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}))},e.prototype.openMenuByField=function(e){var t=this.parent;if(t.enableAdaptiveUI)this.showCustomFilter(!1);else{var i=t.getColumnByField(e),n=t.getColumnHeaderByField(e).querySelector(".e-filtermenudiv");if(n){var r=t.element.getBoundingClientRect(),s=n.getBoundingClientRect();this.filterDialogOpen(i,n,s.right-r.left,s.bottom-r.top)}}},e.prototype.filterIconClickHandler=function(e){var t=e.target;if(t.classList.contains("e-filtermenudiv")&&("Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)){var i=this.parent.getColumnByUid(_a(t,"e-headercell").querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));if(this.column=i,this.fltrDlgDetails.field===i.field&&this.fltrDlgDetails.isOpen)return;this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:i.field,isOpen:!0},this.openMenuByField(i.field)}},e.prototype.clickHandler=function(e){if("FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator){if(_a(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")){var t=(0,o.closest)(e.target,"div").querySelector(".e-filterbaroperator");t?t.focus():e.target.focus()}if(e.target.classList.contains("e-list-item")){var i=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","");-1!==i.indexOf("grid-column")&&(0,o.closest)(document.getElementById(i),"div").querySelector(".e-filtertext").focus()}}if("Immediate"===this.filterSettings.mode||"Menu"===this.parent.filterSettings.type||"CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type){var n=e.target,r=n.classList.contains("e-day"),s=_a(this.parent.element,"e-dialog"),a=!1,l=_a(n,"e-popup"),h=document.getElementById(this.parent.element.id+"_e-popup"),d=this.parent.element.classList.contains("e-device")?document.querySelector(".e-filter-popup"):h&&h.querySelector(".e-filter-popup")?h.querySelector(".e-filter-popup"):this.parent.element.querySelector(".e-filter-popup");if(s&&l&&(a=s.id===l.id),this.filterModule&&d&&(_a(n,"e-excel-ascending")||_a(n,"e-excel-descending"))&&this.filterModule.closeDialog(n),_a(n,"e-filter-popup")||n.classList.contains("e-filtermenudiv"))return;!this.filterModule||_a(n,"e-date-overflow")||_a(n,"e-popup-wrapper")||(0,o.closest)(n,".e-filter-item.e-menu-item")||r||_a(n,"e-search-wrapper")&&!d||(a&&!_a(n,"e-filter-popup")&&!_a(n,"e-popup-flmenu")||!l&&d)&&(this.filterModule.isresetFocus=_a(n,"e-grid")&&_a(n,"e-grid").id===this.parent.element.id&&!(_a(n,"e-search-wrapper")&&d),this.filterModule.closeDialog(n))}},e.prototype.filterHandler=function(e){this.actualPredicate[e.field]=e.actualPredicate,this.actualData=Object.keys(this.actualPredicate);var t=new a.DataManager(this.filterSettings.columns),i=(new a.Query).where("field",this.filterOperators.equal,e.field);this.checkboxFilterObject=t.dataSource.json,this.checkboxPrevFilterObject=t.executeLocal(i);for(var n=0;n<this.checkboxPrevFilterObject.length;n++){for(var r=-1,s=0;s<this.filterSettings.columns.length;s++)if(this.checkboxPrevFilterObject[parseInt(n.toString(),10)].field===this.filterSettings.columns[parseInt(s.toString(),10)].field){r=s;break}-1!==r&&this.filterSettings.columns.splice(r,1)}this.values[e.field]&&delete this.values[e.field];var o=this.parent.getColumnByField(e.field),l=this.parent.showColumnMenu&&o.showColumnMenu?".e-columnmenu":".e-icon-filter",h=this.parent.getColumnHeaderByField(e.field).querySelector(l);"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&h&&h.classList.add("e-filtered")):(h&&h.classList.remove("e-filtered"),this.parent.renderModule.resetPartialRecords(),e.requestType="filtering",this.parent.renderModule.refresh(e)),this.parent.dataBind()},e.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||Ol(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns());var i=e[parseInt(t.toString(),10)].field;this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||(i=Ol(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(i,e[parseInt(t.toString(),10)].operator,e[parseInt(t.toString(),10)].value,e[parseInt(t.toString(),10)].type,e[parseInt(t.toString(),10)].predicate,e[parseInt(t.toString(),10)].matchCase,e[parseInt(t.toString(),10)].ignoreAccent,e[parseInt(t.toString(),10)].uid)}this.parent.renderModule.resetPartialRecords()},e.prototype.refreshFilterIcon=function(e,t,i,n,r,s,o,a){var l={field:e,predicate:r,matchCase:s,ignoreAccent:o,operator:t,value:i,type:n};this.actualPredicate[""+e]?this.actualPredicate[""+e].push(l):this.actualPredicate[""+e]=[l];var h=a?this.parent.grabColumnByUidFromAllCols(a).field:e;this.addFilteredClass(h)},e.prototype.addFilteredClass=function(e){var t,i=this.parent.getColumnByField(e);this.parent.showColumnMenu&&i.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):i&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},e.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},e.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},e.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()},e}(),Id={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},xd=function(){function e(e){this.tapped=!1,this.isDblClk=!0,this.resizeProcess=!1,this.isCancelAutoFit=!1,this.parent=e,this.parent.isDestroyed||(this.widthService=new ko(e),this.addEventListener())}return e.prototype.autoFitColumns=function(e,t,i){var n=this,r=null==e||e.length<=0?this.parent.getColumns().map(function(e){return e.autoFit=!0,e.field}):"string"==typeof e?[e]:e;this.parent.isAutoFitColumns=!0,(0,o.isNullOrUndefined)(e)||"object"!=typeof e||0===e.length?"string"==typeof e&&""!==e.trim()&&(this.parent.getColumnByField(e).autoFit=!0):e.forEach(function(e){n.parent.getColumnByField(e)&&(n.parent.getColumnByField(e).autoFit=!0)}),this.parent.enableAdaptiveUI&&this.parent.element.classList.add("e-grid-autofit"),this.findColumn(r,t,i)},e.prototype.autoFit=function(){var e=this.parent.getColumns(),t=0,i=e.filter(function(e){return(0,o.isNullOrUndefined)(e.maxWidth)||t++,!0===e.autoFit}).map(function(e){return e.field||e.headerText});i.length>0&&!this.parent.preventAutoFit&&this.autoFitColumns(i);var n=this.parent.getContentTable();this.parent.allowResizing&&t&&("Auto"===this.parent.resizeSettings.mode||"Normal"===this.parent.resizeSettings.mode&&!this.parent.autoFit&&0===i.length)?this.widthService.setWidthToTable(-1===n.style.width.indexOf("px")):this.parent.autoFit&&"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable(),-1!==n.style.width.indexOf("px")&&n.getBoundingClientRect().width<n.parentElement.clientWidth&&(0,o.addClass)([this.parent.getHeaderTable(),n],["e-tableborder"])},e.prototype.getCellElementsByColumnIndex=function(e){return this.parent.frozenRows?[].slice.call(this.parent.getHeaderTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)")).concat([].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))):[].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))},e.prototype.resizeColumn=function(e,t,i,n,r){var s,a,l=this.parent,h=0,d=l.getHeaderTable(),c=l.getContentTable(),u=rs,g=ss,f=0,m=i||this.parent.getUidByColumnField(e),y=this.parent.getNormalizedColumnIndex(m),v=(0,o.closest)(d.querySelector('[data-mappinguid="'+m+'"]'),"th").cloneNode(!0),S=this.getCellElementsByColumnIndex(y),C=this.parent.getColumnIndexByField(e);(0,o.isNullOrUndefined)(l.getFooterContent())||(s=l.getFooterContentTable()),s&&(a=s.querySelectorAll("td:nth-child("+(y+1)+"):not(.e-groupcaption)"));var w=[].slice.call(d.querySelector("tr").getElementsByClassName("e-grouptopleftcell"));if(w.length>0)for(var b=0;b<w.length;b++)f+=w[parseInt(b.toString(),10)].offsetWidth;var I=c.querySelector(".e-detailrowcollapse")||c.querySelector(".e-detailrowexpand");(this.parent.detailTemplate||this.parent.childGrid)&&I&&(f+=I.offsetWidth);var x=[v],R=[],D=[];if(s)for(b=0;b<a.length;b++)D[parseInt(b.toString(),10)]=a[parseInt(b.toString(),10)].cloneNode(!0);for(b=0;b<S.length;b++)R[parseInt(b.toString(),10)]=S[parseInt(b.toString(),10)].cloneNode(!0);var T=this.createTable(d,x,"e-gridheader"),E=null,O=null;l.getCurrentViewRecords().length&&(O=this.createTable(c,R,u,n,r)),D.length&&(E=this.createTable(s,D,g));var k=l.getColumns()[parseInt(C.toString(),10)],A=k.width=(0,o.formatUnit)(Math.max(T,O,E)),F=k.maxWidth&&parseFloat(k.maxWidth.toString());if(parseInt(A,10)>F&&(k.width=F),this.widthService.setColumnWidth(l.getColumns()[parseInt(C.toString(),10)]),!1===l.getColumns().some(function(e){return(e.visible||l.groupSettings.columns.length)&&(null===e.width||void 0===e.width||e.width.length<=0)})){var M=l.getColumns();for(b=0;b<M.length;b++)M[parseInt(b.toString(),10)].visible&&(h+=parseFloat(M[parseInt(b.toString(),10)].width))}var L=h+f;h>0&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new p({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(L="100%"),d.style.width=(0,o.formatUnit)(L),c.style.width=(0,o.formatUnit)(L),(0,o.isNullOrUndefined)(s)||(s.style.width=(0,o.formatUnit)(L))),l.isFrozenGrid()&&l.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar();var P=d.offsetWidth;c.parentElement.scrollWidth>P?((0,o.isNullOrUndefined)(c.querySelector(".e-emptyrow"))?(0,o.addClass)([d,c],["e-tableborder"]):((0,o.addClass)([d],["e-tableborder"]),(0,o.removeClass)([c],["e-tableborder"])),(0,o.removeClass)([l.element],["e-left-shadow","e-right-shadow"])):((0,o.removeClass)([d,c],["e-tableborder"]),l.getVisibleFrozenRightCount()&&(0,o.addClass)([l.element],"e-right-shadow")),(0,o.isNullOrUndefined)(s)||s.classList.add("e-tableborder")},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},e.prototype.getModuleName=function(){return"resize"},e.prototype.findColumn=function(e,t,i){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=this.parent.getColumnIndexByField(r),a=this.parent.getColumns()[parseInt(s.toString(),10)];s>-1&&!(0,o.isNullOrUndefined)(a)&&!0===a.visible&&this.resizeColumn(r,s,null,t,i)}(this.parent.detailTemplate||this.parent.childGrid)&&"Auto"===this.parent.resizeSettings.mode&&this.parent.isAutoFitColumns&&(this.parent.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.parent.recalcIndentWidth()),this.parent.allowTextWrap&&this.parent.notify(pi,{case:"refreshHeight",isModeChg:!0}),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0)},e.prototype.createTable=function(e,t,i,n,r){void 0===n&&(n=1),void 0===r&&(r=t.length),n>r&&(n^=r,n^=r^=n);var s=this.parent.createElement("div"),a=this.parent.enableAdaptiveUI?" e-bigger":"";s.className=this.parent.element.className+a,s.style.cssText="display: inline-block;visibility:hidden;position:absolute";var l=this.parent.createElement("div");l.className=i;var h,d=this.parent.createElement("table",{attrs:{role:"grid"}});d.className=e.className,d.classList.add("e-resizetable"),d.style.cssText="table-layout: auto;width: auto","e-gridheader"===i&&(h=this.parent.createElement("thead"),d.appendChild(h));for(var p=this.parent.createElement("tr"),c=n<=0?1:n;c<=(r>t.length?t.length:r);c++){var u=p.cloneNode();u.className=e.querySelector("tr").className,u.appendChild(t[parseInt((c-1).toString(),10)]),(0,o.isNullOrUndefined)(h)?d.appendChild(u):h.appendChild(u)}l.appendChild(d),s.appendChild(l),document.body.appendChild(s);var g=d.getBoundingClientRect().width;return document.body.removeChild(s),Math.ceil(g)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(je,this.refreshHeight,this),this.parent.on(zr,this.refreshResizePosition,this),this.parent.on(Le,this.wireEvents,this),this.parent.on(Ne,this.autoFit,this),this.parent.on(Un,this.refreshHeight,this),this.parent.on(Ct,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(je,this.refreshHeight),this.parent.off(zr,this.refreshResizePosition),this.parent.off(Le,this.wireEvents),this.parent.off(Un,this.refreshHeight),this.parent.off(Ct,this.destroy))},e.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},e.prototype.refreshHeight=function(){if(this.parent.getHeaderTable()){for(var e=this.getResizeHandlers(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].parentElement.offsetHeight>0&&(e[parseInt(t.toString(),10)].style.height="100%");this.setHandlerHeight()}},e.prototype.wireEvents=function(){o.EventHandler.add(this.parent.getHeaderContent(),o.Browser.touchStartEvent,this.touchResizeStart,this),o.EventHandler.add(this.parent.getHeaderContent(),Mt,this.callAutoFit,this)},e.prototype.unwireEvents=function(){o.EventHandler.remove(this.parent.getHeaderContent(),o.Browser.touchStartEvent,this.touchResizeStart),o.EventHandler.remove(this.parent.getHeaderContent(),Mt,this.callAutoFit)},e.prototype.getResizeHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(Id.root))},e.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().getElementsByClassName(Id.suppress)),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height="100%"},e.prototype.callAutoFit=function(e){if(o.Browser.isDevice&&"function"==typeof e.preventDefault&&this.isDblClk&&e.preventDefault(),e.target.classList.contains("e-rhandler")&&!this.isCancelAutoFit){var t=this.getTargetColumn(e);if(t.columns)return;if(this.resizeColumn(t.field,this.parent.getNormalizedColumnIndex(t.uid),t.uid),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0),this.isDblClk&&"mousedown"===e.type){var i={e,column:t};this.parent.trigger(Ce,i)}(0,o.closest)(e.target,Id.header).classList.add("e-resized")}},e.prototype.touchResizeStart=function(e){if(!rl.timer)return rl.timer=setTimeout(function(){rl.timer=null},300),this.resizeStart(e);clearTimeout(rl.timer),rl.timer=null,this.callAutoFit(e)},e.prototype.resizeStart=function(e){var t=this,i=this.parent.getContentTable().style.width,n=!1;if(-1!==i.indexOf("%")&&parseFloat(i)>100&&(n=!0),e.target.classList.contains("e-rhandler")){this.isCancelAutoFit=!1;var r={e,column:this.getTargetColumn(e)};if(this.parent.trigger(ve,r,function(e){if(e.cancel||t.parent.isEdit)return t.cancelResizeAction(),void(t.isCancelAutoFit=!0)}),!this.isCancelAutoFit){if(!this.helper){if(0===this.getScrollBarWidth()||n){this.resizeProcess=!0;for(var s=0,a=this.refreshColumnWidth();s<a.length;s++){var l=a[s];this.widthService.setColumnWidth(l)}if(this.parent.allowGrouping)for(var h=0;h<this.parent.groupSettings.columns.length;h++)this.widthService.setColumnWidth(new p({width:"30px"}),h);this.parent.isRowDragable()&&this.widthService.setColumnWidth(new p({width:"30px"})),this.widthService.setWidthToTable(),this.resizeProcess=!1}this.refreshStackedColumnWidth(),this.element=e.target,this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),this.column.getFreezeTableName()===bs?this.parent.enableRtl?this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat((0,o.isNullOrUndefined)(this.column.width)?"":this.column.width.toString()):this.minMove=parseFloat((0,o.isNullOrUndefined)(this.column.width)?"":this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.parent.enableRtl?this.minMove=parseFloat(this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat((0,o.isNullOrUndefined)(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}o.EventHandler.add(document,o.Browser.touchEndEvent,this.resizeEnd,this),o.EventHandler.add(this.parent.element,o.Browser.touchMoveEvent,this.resizing,this),o.Browser.isDevice&&!this.helper.classList.contains(Id.icon)?(this.helper.classList.add(Id.icon),o.EventHandler.add(document,o.Browser.touchStartEvent,this.removeHelper,this),o.EventHandler.add(this.helper,o.Browser.touchStartEvent,this.resizeStart,this)):this.updateCursor("add")}}},e.prototype.cancelResizeAction=function(e){e&&(o.EventHandler.remove(this.parent.element,o.Browser.touchMoveEvent,this.resizing),o.EventHandler.remove(document,o.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),o.Browser.isDevice&&!(0,o.isNullOrUndefined)(this.helper)&&(o.EventHandler.remove(document,o.Browser.touchStartEvent,this.removeHelper),o.EventHandler.remove(this.helper,o.Browser.touchStartEvent,this.resizeStart)),(0,o.isNullOrUndefined)(this.helper)||(0,o.detach)(this.helper),this.refresh()},e.prototype.getWidth=function(e,t,i){return t&&e<t?t:i&&e>i?i:e},e.prototype.updateResizeEleHeight=function(){for(var e=[].slice.call(this.parent.getHeaderContent().getElementsByClassName("e-rhandler")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height=this.element.parentElement.offsetHeight+"px"},e.prototype.getColData=function(e,t){return{width:parseFloat((0,o.isNullOrUndefined)(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+t,minWidth:e.minWidth?parseFloat(e.minWidth.toString()):null,maxWidth:e.maxWidth?parseFloat(e.maxWidth.toString()):null}},e.prototype.refreshResizeFixedCols=function(e){for(var t=this.parent.getColumns(),i=this.parent.enableColumnVirtualization?this.parent.translateX:0,n=[].slice.call(this.parent.getHeaderContent().querySelector("tbody").querySelectorAll(".e-fixedfreeze")).concat([].slice.call(this.parent.getContent().querySelectorAll(".e-fixedfreeze"))),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)],o=void 0;if(s.classList.contains("e-summarycell")){var a=s.getAttribute("data-mappinguid");o=this.parent.getColumnByUid(a)}else{var l=parseInt(s.getAttribute("aria-colindex"),10)-1;o=t[parseInt(l.toString(),10)]}var h=0;if("Left"===e){this.parent.getVisibleFrozenLeftCount()?h=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(h=30*this.parent.groupSettings.columns.length);for(var d=0;d<t.length;d++)if(o.index>t[parseInt(d.toString(),10)].index){if(o.uid===t[parseInt(d.toString(),10)].uid)break;("Left"===t[parseInt(d.toString(),10)].freeze||t[parseInt(d.toString(),10)].isFrozen||"Fixed"===t[parseInt(d.toString(),10)].freeze)&&t[parseInt(d.toString(),10)].visible&&(h+=parseFloat(t[parseInt(d.toString(),10)].width.toString()))}gh(s,(0===h?h:h-1)-i,this.parent.enableRtl,"Left")}if("Right"===e){h="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0;for(d=t.length-1;d>=0&&o.uid!==t[parseInt(d.toString(),10)].uid;d--)"Right"!==t[parseInt(d.toString(),10)].freeze&&"Fixed"!==t[parseInt(d.toString(),10)].freeze||t[parseInt(d.toString(),10)].visible&&(h+=parseFloat(t[parseInt(d.toString(),10)].width.toString()));var p=0;s.colSpan>1&&(p=this.calculateColspanWidth(t,s,o.index)),gh(s,h-p+i,this.parent.enableRtl,"Right")}}},e.prototype.calculateColspanWidth=function(e,t,i){for(var n=0,r=i+1;r<i+t.colSpan;r++)n+=parseInt(e[parseInt(r.toString(),10)].width.toString(),10);return n},e.prototype.refreshResizePosition=function(){this.refreshResizefrzCols(!0)},e.prototype.refreshResizefrzCols=function(e,t){var i=this,n=this.parent.enableColumnVirtualization?this.parent.translateX:0;if(e||"Left"===this.column.freeze||this.column.isFrozen||this.column.columns&&"Left"===ch(this.column)){var r=30*this.parent.getIndentCount(),s=this.parent.getColumns().filter(function(e){return"Left"===e.freeze||e.isFrozen});e&&!t||this.frzHdrRefresh("Left");for(var o=0;o<s.length;o++){if(e||s[parseInt(o.toString(),10)].index>this.column.index){(this.parent.frozenRows?[].slice.call(this.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(o+1)+'"]')).concat([].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(o+1)+'"]'))):[].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(o+1)+'"]'))).filter(function(e){gh(e,r-n,i.parent.enableRtl,"Left")}),this.parent.enableColumnVirtualization&&(s[parseInt(o.toString(),10)].valueX=r)}s[parseInt(o.toString(),10)].visible&&(r+=parseFloat(s[parseInt(o.toString(),10)].width.toString()))}this.refreshResizeFixedCols("Left")}if(e||"Right"===this.column.freeze||this.column.columns&&"Right"===ch(this.column)){var a="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,l=this.parent.getColumns();e&&!t||this.frzHdrRefresh("Right");var h=l.filter(function(e){return"Right"===e.freeze}),d=function(e){(p.parent.frozenRows?[].slice.call(p.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(e+1)+'"]')).concat([].slice.call(p.parent.getContent().querySelectorAll('td[aria-colindex="'+(e+1)+'"]'))):[].slice.call(p.parent.getContent().querySelectorAll('td[aria-colindex="'+(e+1)+'"]'))).filter(function(t){var r=0;t.colSpan>1&&(r=i.calculateColspanWidth(l,t,l[parseInt(e.toString(),10)].index)),gh(t,a-r+n,i.parent.enableRtl,"Right")}),p.parent.enableColumnVirtualization&&(l[parseInt(e.toString(),10)].valueX=a),l[parseInt(e.toString(),10)].visible&&(a+=parseFloat(l[parseInt(e.toString(),10)].width.toString()))},p=this;for(o=l.length-1;o>=l.length-h.length;o--)d(o);this.refreshResizeFixedCols("Right")}this.column&&("Fixed"===this.column.freeze||this.column.columns&&"Fixed"===ch(this.column))&&(this.refreshResizeFixedCols("Left"),this.refreshResizeFixedCols("Right"),this.frzHdrRefresh("Left"),this.frzHdrRefresh("Right")),this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&this.parent.getContent().querySelector(".e-groupcaptionrow")&&this.refreshGroupCaptionRow()},e.prototype.refreshGroupCaptionRow=function(){for(var e=[].slice.call(this.parent.getContent().querySelectorAll(".e-groupcaptionrow")),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.querySelector(".e-summarycell")&&Kl(i,this.parent)}},e.prototype.frzHdrRefresh=function(e){var t=this,i=this.parent.enableColumnVirtualization?this.parent.translateX:0;if("Left"===e)for(var n=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),r=0;r<n.length;r++)for(var s=[].slice.call(n[parseInt(r.toString(),10)].querySelectorAll(".e-leftfreeze,.e-fixedfreeze")),o=function(e){var n=s[parseInt(e.toString(),10)];if(n.classList.contains("e-rowdragheader")||n.classList.contains("e-dragheadercell")||n.classList.contains("e-grouptopleftcell"))return"continue";var r=a.getParticularCol(n),o=a.parent.getColumns(),l=0,h=[];if(a.parent.aggregates.length&&a.parent.getFooterContent()){if(a.parent.getContent().querySelectorAll(".e-summaryrow").length)[].slice.call(a.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){h.push(e.querySelector('[data-mappinguid="'+r.uid+'"]'))});h=h.concat([].slice.call(a.parent.getFooterContent().querySelectorAll('[data-mappinguid="'+r.uid+'"]')))}if(n.classList.contains("e-fixedfreeze")){a.parent.getVisibleFrozenLeftCount()?l=30*a.parent.getIndentCount():"Right"===a.parent.getFrozenMode()&&(l=30*a.parent.groupSettings.columns.length);for(var d=0;d<o.length;d++)if(r.index>o[parseInt(d.toString(),10)].index){if(r.uid===o[parseInt(d.toString(),10)].uid)break;("Left"===o[parseInt(d.toString(),10)].freeze||o[parseInt(d.toString(),10)].isFrozen||"Fixed"===o[parseInt(d.toString(),10)].freeze)&&o[parseInt(d.toString(),10)].visible&&(l+=parseInt(o[parseInt(d.toString(),10)].width.toString(),10))}h&&h.length&&h.filter(function(e){gh(e,l-i,t.parent.enableRtl,"Left")}),gh(n,(0===l?l:l-1)-i,a.parent.enableRtl,"Left")}else{if(l=30*a.parent.getIndentCount(),0===r.index)h&&h.length&&h.filter(function(e){gh(e,l-i,t.parent.enableRtl,"Left")}),gh(n,l-i,a.parent.enableRtl,"Left"),a.parent.enableColumnVirtualization&&(r.valueX=l);else{for(var p=0;p<o.length&&!(r.index<o[parseInt(p.toString(),10)].index||r.uid===o[parseInt(p.toString(),10)].uid);p++)o[parseInt(p.toString(),10)].visible&&(l+=parseInt(o[parseInt(p.toString(),10)].width.toString(),10));h&&h.length&&h.filter(function(e){gh(e,l-i,t.parent.enableRtl,"Left")}),gh(n,l-i,a.parent.enableRtl,"Left"),a.parent.enableColumnVirtualization&&(r.valueX=l)}yh(a.parent,r,n)}},a=this,l=0;l<s.length;l++)o(l);if("Right"===e)for(n=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),r=0;r<n.length;r++){s=[].slice.call(n[parseInt(r.toString(),10)].querySelectorAll(".e-rightfreeze, .e-fixedfreeze"));var h=function(e){var n=s[parseInt(e.toString(),10)],r=d.getParticularCol(n),o=d.parent.getColumns(),a=0,l=[];if(d.parent.aggregates.length&&d.parent.getFooterContent()){if(d.parent.getContent().querySelectorAll(".e-summaryrow").length)[].slice.call(d.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){l.push(e.querySelector('[data-mappinguid="'+r.uid+'"]'))});l=l.concat([].slice.call(d.parent.getFooterContent().querySelectorAll('[data-mappinguid="'+r.uid+'"]')))}if(n.classList.contains("e-fixedfreeze")){a="Right"===d.parent.getFrozenMode()&&d.parent.isRowDragable()?30:0;for(var h=o.length-1;h>=0;h--)if(r.index<o[parseInt(h.toString(),10)].index){if(r.columns&&dh(r,o[parseInt(h.toString(),10)].uid)||r.index>o[parseInt(h.toString(),10)].index)break;"Right"!==o[parseInt(h.toString(),10)].freeze&&"Fixed"!==o[parseInt(h.toString(),10)].freeze||o[parseInt(h.toString(),10)].visible&&(a+=parseFloat(o[parseInt(h.toString(),10)].width.toString()))}l.length&&l.filter(function(e){gh(e,a+i,t.parent.enableRtl,"Right")}),gh(n,a+i,d.parent.enableRtl,"Right")}else{a="Right"===d.parent.getFrozenMode()&&d.parent.isRowDragable()?30:0;for(var p=o.length-1;p>=0&&!(r.columns&&dh(r,o[parseInt(p.toString(),10)].uid)||r.index>o[parseInt(p.toString(),10)].index||r.uid===o[parseInt(p.toString(),10)].uid);p--)o[parseInt(p.toString(),10)].visible&&(a+=parseInt(o[parseInt(p.toString(),10)].width.toString(),10));l.length&&l.filter(function(e){gh(e,a+i,t.parent.enableRtl,"Right")}),gh(n,a+i,d.parent.enableRtl,"Right"),d.parent.enableColumnVirtualization&&(r.valueX=a)}},d=this;for(l=s.length-1;l>=0;l--)h(l)}},e.prototype.getParticularCol=function(e){var t=e.classList.contains("e-filterbarcell")?e.getAttribute("data-mappinguid"):e.querySelector("[data-mappinguid]").getAttribute("data-mappinguid");return this.parent.getColumnByUid(t)},e.prototype.resizing=function(e){var t=this;if(o.Browser.isDevice&&"function"==typeof e.preventDefault&&e.preventDefault(),!(0,o.isNullOrUndefined)(this.column)){var i=0;(0,o.isNullOrUndefined)(this.column)&&(i=_a(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight());var n=this.getPointX(e),r=this.parent.enableRtl?-(n-this.pageX):n-this.pageX,s=parseFloat(this.column.width.toString()),a=this.getColData(this.column,r);a.width||(a.width=(0,o.closest)(this.element,"th").offsetWidth);var l=this.getWidth(a.width,a.minWidth,a.maxWidth);if(this.parent.log("resize_min_max",{column:this.column,width:l}),(!this.parent.enableRtl&&this.minMove>=n||this.parent.enableRtl&&this.minMove<=n)&&(l=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=n=this.minMove),l!==parseFloat((0,o.isNullOrUndefined)(this.column.width)||"auto"===this.column.width?i.toString():this.column.width.toString())){this.pageX=n,this.column.width=(0,o.formatUnit)(l);var h={e,column:this.column};if(this.parent.trigger(Se,h),h.cancel)return void this.cancelResizeAction(!0);var d=[this.column],p=[this.column];this.column.columns&&(d=this.getSubColumns(this.column,[]),d=this.calulateColumnsWidth(d,!1,r),p=this.calulateColumnsWidth(d,!0,r));var c=0,u=this.parent.getColumns().filter(function(e){return e.visible&&(c+=parseInt(e.width.toString(),10)),e.visible&&(e.maxWidth||e.minWidth)});if("Auto"===this.parent.resizeSettings.mode&&u.length&&c<this.parentElementWidth){var g=this.parent.getColumns().filter(function(e){return e.visible&&e.uid!==t.column.uid}),f=this.distributeColWidth(g,r,0);Math.round(f.usedWidth)!==Math.abs(r)&&(p[0].width=s+f.usedWidth*Math.sign(r)),p=p.concat(f.columns)}this.resizeProcess=!0;for(var m=0,y=p;m<y.length;m++){var v=y[m];this.widthService.setColumnWidth(v,null,"resize")}this.resizeProcess=!1,this.updateHelper()}this.parent.isFrozenGrid()&&this.refreshResizefrzCols(),this.isDblClk=!1}},e.prototype.distributeColWidth=function(e,t,i){for(var n=t/e.length,r=Math.abs(n),s=[],o=[],a=0,l=0,h=e;l<h.length;l++){var d=h[l],p=parseFloat(d.width.toString())-n;if(d.minWidth&&p<parseInt(d.minWidth.toString(),10))a+=c=parseFloat((parseInt(d.minWidth.toString(),10)-p).toFixed(3)),i+=r-c,d.width=d.minWidth,s.push(d);else if(d.maxWidth&&p>parseInt(d.maxWidth.toString(),10)){var c;a+=c=parseFloat((p-parseInt(d.maxWidth.toString(),10)).toFixed(3)),i+=r-c,d.width=d.maxWidth,s.push(d)}else i+=r,d.width=p,o.push(d)}var u=a&&o.length?this.distributeColWidth(o,a*Math.sign(t),i):{columns:o,usedWidth:i};return{columns:s.concat(u.columns),usedWidth:u.usedWidth}},e.prototype.calulateColumnsWidth=function(e,t,i){for(var n=[],r=0,s=e;r<s.length;r++){for(var a=s[r],l=0,h=0;h<e.length;h++)l+=parseFloat(e[parseInt(h.toString(),10)].width.toString());var d=this.getColData(a,parseFloat(a.width)*i/l),p=this.getWidth(d.width,d.minWidth,d.maxWidth);p!==parseFloat(a.width.toString())&&(t&&(a.width=(0,o.formatUnit)(p<1?1:p)),n.push(a))}return n},e.prototype.getSubColumns=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var r=n[i];!1!==r.visible&&r.allowResizing&&(r.columns?this.getSubColumns(r,t):t.push(r))}return t},e.prototype.resizeEnd=function(e){if(this.helper&&!this.parent.isDestroyed){var t=this.parent;t.isFrozenGrid()&&this.refreshResizePosition(),o.EventHandler.remove(this.parent.element,o.Browser.touchMoveEvent,this.resizing),o.EventHandler.remove(document,o.Browser.touchEndEvent,this.resizeEnd),o.Browser.isDevice&&(o.EventHandler.remove(document,o.Browser.touchStartEvent,this.removeHelper),o.EventHandler.remove(this.helper,o.Browser.touchStartEvent,this.resizeStart)),this.updateCursor("remove"),(0,o.detach)(this.helper);var i={e,column:this.column},n=this.parent.getContent().querySelector("."+ps);n.scrollHeight>n.clientHeight&&(this.parent.scrollModule.setPadding(),n.style.overflowY="scroll"),rl.timer&&this.isDblClk||(this.parent.trigger(Ce,i),(0,o.closest)(this.element,".e-headercell").classList.add("e-resized")),this.isFrozenColResized=!1,this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify(Fi,{case:"textwrap"}));var r,s=t.getHeaderTable(),a=t.getContentTable();(0,o.isNullOrUndefined)(t.getFooterContent())||(r=t.getFooterContentTable());var l=s.offsetWidth,h=t.getContent().scrollWidth;h>l?((0,o.isNullOrUndefined)(a.querySelector(".e-emptyrow"))?h>a.scrollWidth&&(0,o.addClass)([s,a],["e-tableborder"]):((0,o.addClass)([s],["e-tableborder"]),(0,o.removeClass)([a],["e-tableborder"])),(0,o.removeClass)([t.element],["e-left-shadow","e-right-shadow"])):((0,o.removeClass)([s,a],["e-tableborder"]),t.getVisibleFrozenRightCount()&&(0,o.addClass)([t.element],"e-right-shadow")),(0,o.isNullOrUndefined)(r)||r.classList.add("e-tableborder"),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0}},e.prototype.getPointX=function(e){return e.touches&&e.touches.length?e.touches[0].pageX:e.pageX},e.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,i=[].slice.apply(this.parent.getHeaderContent().querySelectorAll('th.e-headercell:not(.e-hide):not([style*="display: none"])'));t<i.length;t++)for(var n=i[t],r=0,s=e;r<s.length;r++){var o=s[r];if(n.querySelector("[data-mappinguid]")&&n.querySelector("[data-mappinguid]").getAttribute("data-mappinguid")===o.uid&&o.visible){o.width=n.getBoundingClientRect().width;break}}return e},e.prototype.refreshStackedColumnWidth=function(){for(var e=0,t=this.parent.getStackedColumns(this.parent.columns);e<t.length;e++){var i=t[e];i.width=this.getStackedWidth(i,0)}},e.prototype.getStackedWidth=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var r=n[i];!1!==r.visible&&(r.columns?t=this.getStackedWidth(r,t):t+=parseFloat(r.width.toString()))}return t},e.prototype.getTargetColumn=function(e){var t=(0,o.closest)(e.target,Id.header),i=(t=t.querySelector(".e-headercelldiv")||t.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");return this.parent.getColumnByUid(i)},e.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var i=0,n=t;i<n.length;i++){n[i].classList[""+e](Id.cursor)}},e.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},e.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:Id.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},e.prototype.resizeHelperHeight=function(e){for(var t=this.parent.getContent().offsetHeight-this.getScrollBarWidth(),i=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),n=i.indexOf(e.parentElement);n<i.length&&n>-1;n++)t+=i[parseInt(n.toString(),10)].offsetHeight;return t},e.prototype.setHelperHeight=function(){var e=(0,o.closest)(this.element,Id.header),t=this.resizeHelperHeight(e),i=this.calcPos(e),n=e.getBoundingClientRect();i.left=(i.left<=1?0:i.left)+(this.parent.enableRtl?0:Number(n.width.toFixed(1)))-1,this.helper.style.cssText="height: "+t+"px; top: "+i.top+"px; left:"+Math.floor(i.left)+"px;",this.parent.enableVirtualization&&this.helper.classList.add("e-virtual-rhandler")},e.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?ol():0},e.prototype.removeHelper=function(e){var t=e.target.classList;t.contains(Id.root)||t.contains(Id.icon)||!this.helper||(o.EventHandler.remove(document,o.Browser.touchStartEvent,this.removeHelper),o.EventHandler.remove(this.helper,o.Browser.touchStartEvent,this.resizeStart),(0,o.detach)(this.helper),this.refresh())},e.prototype.updateHelper=function(){var e,t=(0,o.closest)(this.element,Id.header),i=this.calcPos(t),n=t.getBoundingClientRect();(e=Math.floor(Number((i.left<=1?0:i.left).toFixed(1))+(this.parent.enableRtl?0:Number(n.width.toFixed(1)))-1))>this.parentElementWidth&&(e=this.parentElementWidth-2),this.helper.style.height=this.resizeHelperHeight(t)+"px",this.helper.style.left=e+"px"},e.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),n=e.ownerDocument,r=_a(e,"e-grid")||n.documentElement;r&&(r===n.body||r===n.documentElement)&&"static"===r.style.position;)r=r.parentNode;return r&&r!==e&&1===r.nodeType&&(t=r.getBoundingClientRect()),{top:i.top-t.top,left:i.left-t.left}},e.prototype.doubleTapEvent=function(e){var t=this;this.getUserAgent()&&this.isDblClk&&(this.tapped?(clearTimeout(this.tapped),this.callAutoFit(e),this.tapped=null):this.tapped=setTimeout(function(){t.tapped=null},300))},e.prototype.getUserAgent=function(){var e=o.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},e.prototype.timeoutHandler=function(){this.tapped=null},e}(),Rd=function(){function e(e){this.idx=0,this.parent=e,this.parent.isDestroyed||(this.parent.on(Ot,this.headerDrop,this),this.parent.on(Be,this.enableAfterRender,this),this.parent.on(Ze,this.onActionComplete,this),this.parent.on(j,this.drag,this),this.parent.on(H,this.dragStart,this),this.parent.on(Et,this.dragStop,this),this.parent.on(Ot,this.headerDrop,this),this.parent.on(je,this.createReorderElement,this),this.parent.on(vt,this.keyPressHandler,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.chkDropPosition=function(e,t){var i=t.querySelector(".e-headercelldiv")||t.querySelector(".e-stackedheadercelldiv"),n=i||t.firstElementChild,r=this.parent.getColumnByUid(n.getAttribute("data-mappinguid")),s=!r||!r.lockColumn;return(e.parentElement.isEqualNode(t.parentElement)||this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()&&Array.prototype.indexOf.call((0,o.closest)(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call((0,o.closest)(t,"thead").children,t.parentElement))&&this.targetParentContainerIndex(e,t)>-1&&s},e.prototype.chkDropAllCols=function(e,t){for(var i,n=this.getHeaderCells();!i&&n.length>0;)i=e!==n.pop()&&this.targetParentContainerIndex(e,t)>-1;return i},e.prototype.findColParent=function(e,t,i){for(var n=0,r=t.length;n<r;n++){if(e===t[parseInt(n.toString(),10)])return!0;if(t[parseInt(n.toString(),10)].columns){var s=i.length;if(i.push(t[parseInt(n.toString(),10)]),this.findColParent(e,t[parseInt(n.toString(),10)].columns,i))return!0;i.splice(s,i.length-s)}}return!1},e.prototype.getColumnsModel=function(e,t){for(var i=[],n=[],r=0,s=e.length;r<s;r++)(0,o.isNullOrUndefined)(e[parseInt(r.toString(),10)])||((e[parseInt(r.toString(),10)].visible||t)&&i.push(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].columns&&(n=n.concat(e[parseInt(r.toString(),10)].columns)));return n.length&&(i=i.concat(this.getColumnsModel(n))),i},e.prototype.headerDrop=function(e){var t=this.parent,i=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid"),n=t.getColumnByUid(i);if((0,o.closest)(e.target,"th")&&((0,o.isNullOrUndefined)(n)||n.allowReordering&&!n.lockColumn)){var r=(0,o.closest)(e.target,".e-headercell"),s=(r.querySelector(".e-headercelldiv")||r.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");if(!(0,o.isNullOrUndefined)(s)){var a=t.getColumnByUid(s);if((0,o.isNullOrUndefined)(a)||!a.allowReordering||a.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:a})}if(r&&this.chkDropPosition(this.element,r)&&this.chkDropAllCols(this.element,r))if(this.parent.enableColumnVirtualization){var l=this.parent.columns,h=this.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),d=this.parent.columns.filter(function(e){return e.uid===h}),p=null,c=d[0],u=r.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");l.some(function(e,t){return e.uid===u&&(p=t,e.uid===u)}),(0,o.isNullOrUndefined)(p)||this.moveColumns(p,c)}else{var g=this.targetParentContainerIndex(this.element,r),f=this.element.querySelector(".e-stackedheadercelldiv"),m=f?f.getAttribute("data-mappinguid"):this.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");if(this.destElement=r,this.parent.notify(jn,{ele:r}),m)this.moveColumns(g,this.parent.getColumnByUid(m));else{var y=this.getHeaderCells(),v=Ka(this.element,y);l=this.getColumnsModel(this.parent.columns);this.moveColumns(g,l[parseInt(v.toString(),10)])}}}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n})},e.prototype.isActionPrevent=function(e){return fl(e)},e.prototype.moveColumns=function(e,t,i,n){var r=this.parent;if(this.isActionPrevent(r))r.notify(Wt,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});else{var s=this.getColParent(t,this.parent.columns),o=s?s.columns:this.parent.columns,a=Wa(t,o);if((s||this.parent.lockcolPositionCount)&&!i&&!this.parent.enableColumnVirtualization){for(var l=0;l<o.length;l++)if(o[parseInt(l.toString(),10)].field===t.field){a=l;break}var h=this.parent.getColumnByUid(this.destElement.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));if(h){for(l=0;l<o.length;l++)if(o[parseInt(l.toString(),10)].field===h.field){e=l;break}}else for(l=0;l<o.length;l++)o[parseInt(l.toString(),10)].headerText===this.destElement.innerText.trim()&&(e=l)}if(r.allowReordering&&a!==e&&-1!==a&&-1!==e){o.splice(e,0,o.splice(a,1)[0]);var d={column:t,destIndex:e,columns:o,parent:s,cancel:!1};if(r.notify(Hn,d),!d.cancel){if(this.parent.isFrozenGrid())if(this.parent.frozenColumns)for(l=0;l<o.length;l++)"Left"===o[parseInt(l.toString(),10)].freeze&&(o[parseInt(l.toString(),10)].freeze=void 0);else s&&s.columns||(this.parent.getFrozenLeftCount()>e?t.freeze="Left":o.length-this.parent.getFrozenRightColumnsCount()<=e?t.freeze="Right":t.freeze="Fixed"===t.freeze?"Fixed":void 0);if(!1!==n){var p={type:R,requestType:"reorder",fromIndex:e,toIndex:a,toColumnUid:t.uid,cancel:!1};if(r.notify(Ue,p),p.cancel)return void o.splice(a,0,o.splice(e,1)[0])}if(r.getColumns(!0),r.preventAutoFit=!0,r.notify(xt,{fromIndex:e,toIndex:a}),this.parent.isFrozenGrid()){var c=this.parent.columns;this.idx=0,this.refreshColumnIndex(c),this.parent.notify(Br,{})}}}}},e.prototype.refreshColumnIndex=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].index=this.idx,this.idx++,e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length&&this.refreshColumnIndex(e[parseInt(t.toString(),10)].columns)},e.prototype.targetParentContainerIndex=function(e,t){var i=this.parent.columns,n=this.getHeaderCells(),r=this.parent.getStackedColumns(i),s=[];r.length&&(s=this.getAllStackedheaderParentColumns(n));var o=r.length&&s.length?this.getColumnsModel(s):this.getColumnsModel(i,!0),a=this.getColParent(o[Ka(e,n)],i);return i=a?a.columns:i,Wa(o[Ka(t,n)],i)},e.prototype.getAllStackedheaderParentColumns=function(e){for(var t=[],i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].classList.contains("e-hide"))e.splice(i,1),i--;else if(e[parseInt(i.toString(),10)].closest("thead").firstChild===e[parseInt(i.toString(),10)].parentElement){var n=e[parseInt(i.toString(),10)];n.querySelector(".e-stackedheadercelldiv")?t.push(this.parent.getColumnByUid(n.querySelector(".e-stackedheadercelldiv").getAttribute("data-mappinguid"))):t.push(this.parent.getColumnByUid(n.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")))}return t},e.prototype.getHeaderCells=function(){return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},e.prototype.getColParent=function(e,t){var i=[];return this.findColParent(e,t,i),i[i.length-1]},e.prototype.reorderSingleColumn=function(e,t){var i=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:this.parent.getColumnByField(e),n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===t})[0]:this.parent.getColumnByField(t);if(((0,o.isNullOrUndefined)(i)||i.allowReordering&&!i.lockColumn)&&((0,o.isNullOrUndefined)(n)||n.allowReordering&&!n.lockColumn)){var r=n,s=this.getColParent(r,this.parent.columns),a=Wa(r,s?s.columns:this.parent.columns);a>-1&&this.moveColumns(a,i,!0)}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:i,destColumn:n})},e.prototype.reorderMultipleColumns=function(e,t){var i=this.parent.getColumnIndexByField(t),n=this.parent.getColumnByField(t);if(!(i<0)&&((0,o.isNullOrUndefined)(n)||n.allowReordering&&!n.lockColumn)){for(var r=0;r<e.length;r++){var s=this.parent.getColumnByField(e[parseInt(r.toString(),10)]);if(!(0,o.isNullOrUndefined)(s)&&(!s.allowReordering||s.lockColumn))return}for(r=0;r<e.length;r++){s=this.parent.getColumnByIndex(i);var a=this.getColParent(s,this.parent.columns),l=Wa(s,a?a.columns:this.parent.columns);l>-1&&this.moveColumns(l,this.parent.getColumnByField(e[parseInt(r.toString(),10)]),!0,!0),this.parent.getColumnIndexByField(e[r+1])>=l&&i++}}},e.prototype.moveTargetColumn=function(e,t){t>-1&&this.moveColumns(t,e,!0)},e.prototype.reorderSingleColumnByTarget=function(e,t){this.moveTargetColumn(this.parent.getColumnByField(e),t)},e.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[parseInt(i.toString(),10)],t)},e.prototype.reorderColumns=function(e,t){"string"==typeof e?(this.reorderSingleColumn(e,t),this.fromCol=e):(this.reorderMultipleColumns(e,t),this.fromCol=e[0])},e.prototype.reorderColumnByModel=function(e,t){if(!(0,o.isNullOrUndefined)(e)&&!(0,o.isNullOrUndefined)(t)&&e instanceof p&&t instanceof p){if(!e.allowReordering||e.lockColumn||!t.allowReordering||t.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:e,destColumn:t});var i=this.targetParentContainerIndex(this.parent.getColumnHeaderByUid(e.uid),this.parent.getColumnHeaderByUid(t.uid));this.moveTargetColumn(e,i)}},e.prototype.reorderColumnByIndex=function(e,t){this.moveTargetColumn(this.parent.getColumnByIndex(e),t)},e.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},e.prototype.createReorderElement=function(e){e&&e.args&&e.args.isXaxis&&this.setDisplay("none");var t=this.parent.element.querySelector("."+os),i=this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow"});i.style.display="none",this.upArrow=i,t.appendChild(this.upArrow);var n=this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow"});n.style.display="none",this.downArrow=n,t.appendChild(this.downArrow)},e.prototype.onActionComplete=function(e){this.parent.preventAutoFit=!1,this.parent.trigger(D,(0,o.extend)(e,{type:D}));var t=this.fromCol&&this.parent.getColumnHeaderByField(this.fromCol);t&&this.parent.focusModule.onClick({target:t},!0)},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.upArrow.parentNode&&(0,o.remove)(this.upArrow),this.downArrow.parentNode&&(0,o.remove)(this.downArrow),this.parent.off(Ot,this.headerDrop),this.parent.off(Be,this.enableAfterRender),this.parent.off(Ze,this.onActionComplete),this.parent.off(j,this.drag),this.parent.off(H,this.dragStart),this.parent.off(Et,this.dragStop),this.parent.off(je,this.createReorderElement),this.parent.off(vt,this.keyPressHandler),this.parent.off(Ct,this.destroy))},e.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("leftArrow"===e.action?e.action="ctrlLeftArrow":"rightArrow"===e.action&&(e.action="ctrlRightArrow")),e.action){case"ctrlLeftArrow":case"ctrlRightArrow":var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var n=t.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),r=t.getVisibleColumns(),s=r.indexOf(n),o="ctrlLeftArrow"===e.action?r[s-1]:r[s+1];o&&o.field&&n.field&&this.reorderColumns(n.field,o.field)}}},e.prototype.drag=function(e){var t=this.parent,i=e.target,n=(0,o.closest)(i,".e-headercell:not(.e-stackedHeaderCell)"),r=t.element.querySelector(".e-cloneproperties"),s=t.getContent().firstElementChild,a=this.x>Ya(e.event).x+s.scrollLeft;if((0,o.removeClass)([].slice.call(t.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),(0,o.classList)(r,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),n&&!n.isEqualNode(this.element)){var l=(i=n).querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid");this.chkDropPosition(this.element,i)&&this.chkDropAllCols(this.element,i)&&t.getColumnByUid(l).allowReordering&&e.column.allowReordering?(this.updateArrowPosition(i,a),(0,o.classList)(i,["e-allowDrop","e-reorderindicate"],[])):t.allowGrouping&&_a(e.target,"e-groupdroparea")||(0,o.classList)(r,["e-notallowedcur"],["e-defaultcur"])}else n&&n.isEqualNode(this.element)&&!(t.allowGrouping&&e.column.allowGrouping||e.column.allowReordering)?(0,o.classList)(r,["e-notallowedcur"],["e-defaultcur"]):n||t.allowGrouping&&_a(e.target,"e-groupdroparea")||(0,o.classList)(r,["e-notallowedcur"],["e-defaultcur"]);e.column.allowReordering&&!e.column.lockColumn&&t.trigger(j,{target:i,draggableType:"headercell",column:e.column})},e.prototype.updateScrollPostion=function(e){var t=this,i=Ya(e).x,n=this.parent.element.getBoundingClientRect(),r=n.right,s=n.left,o=this.parent.getContent().firstElementChild;i>s&&i<s+35?this.timer=window.setInterval(function(){t.setScrollLeft(o,!0)},50):i<r&&i>r-35&&(this.timer=window.setInterval(function(){t.setScrollLeft(o,!1)},50))},e.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.updateArrowPosition=function(e,t){var i=e.getBoundingClientRect(),n=this.parent.element.getBoundingClientRect();if(!(t&&i.left<n.left||!t&&i.right>n.right)){var r=this.parent.getHeaderContent().classList.contains("e-sticky");this.upArrow.style.top=r?i.top+i.height+"px":i.top+i.height-n.top+"px",this.downArrow.style.top=r?i.top-7+"px":i.top-n.top-7+"px",this.upArrow.style.left=this.downArrow.style.left=r?(t?i.left:i.right)-4+"px":(t?i.left:i.right)-n.left-4+"px",this.setDisplay("")}},e.prototype.dragStart=function(e){var t=this.parent,i=e.target;if(this.element=i.classList.contains("e-headercell")?i:_a(i,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn){var n=t.getContent().firstElementChild;this.x=Ya(e.event).x+n.scrollLeft,t.trigger(H,{target:i,draggableType:"headercell",column:e.column})}},e.prototype.dragStop=function(e){var t=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||t.trigger(V,{target:e.target,draggableType:"headercell",column:e.column}),(0,o.removeClass)([].slice.call(t.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"])},e.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},e.prototype.getModuleName=function(){return"reorder"},e}(),Dd=function(){function e(e){var t=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.isReplaceDragEle=!0,this.istargetGrid=!1,this.helper=function(e){var i=t.parent,n=t.draggable.currentStateTarget;(0,o.isNullOrUndefined)(n)||!i.rowDropSettings.targetID||(0,o.isNullOrUndefined)(n.classList)||n.classList.contains("e-rowcell")||(n=_a(n,"e-rowcell"));var r=t.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone"});r.style.height="auto";var s=t.parent.createElement("table",{attrs:{role:"grid"}}),a=t.parent.createElement(Ds,{attrs:{role:"rowgroup"}});if(document.getElementsByClassName("e-griddragarea").length||i.rowDropSettings.targetID&&(!(0,o.isNullOrUndefined)(n)&&!n.classList.contains("e-selectionbackground")&&"Single"!==i.selectionSettings.type||!_a(n,"e-rowcell"))||!i.rowDropSettings.targetID&&!_a(n,"e-rowdragdrop"))return!1;if(i.rowDropSettings.targetID&&"Row"===i.selectionSettings.mode&&"Single"===i.selectionSettings.type&&i.selectRow(parseInt(t.draggable.currentStateTarget.parentElement.getAttribute(Rs),10)-1),t.startedRow=(0,o.closest)(n,"tr").cloneNode(!0),t.parent.isFrozenGrid())for(var l=[].slice.call(t.startedRow.querySelectorAll(".e-rowcell")),h=0;h<l.length;h++)(0,o.removeClass)([l[parseInt(h.toString(),10)]],["e-leftfreeze","e-freezeleftborder","e-fixedfreeze","e-freezerightborder","e-rightfreeze","e-unfreeze"]),l[parseInt(h.toString(),10)].removeAttribute("style");t.processArgs(n);var d={selectedRow:t.rows,dragelement:n,cloneElement:r,cancel:!1,data:t.rowData},p=i.getSelectedRows();i.trigger(G,d);if(d.cancel)return!1;if(Xa(t.startedRow,".e-indentcell"),Xa(t.startedRow,".e-detailrowcollapse"),Xa(t.startedRow,".e-detailrowexpand"),i.enableInfiniteScrolling&&i.infiniteScrollSettings.enableCache||t.removeCell(t.startedRow,gs),t.startedRow.querySelectorAll(".e-active").forEach(function(e){return e.classList.remove("e-active")}),a.appendChild(t.startedRow),i.getSelectedRowIndexes().length>1&&t.startedRow.hasAttribute("aria-selected")){var c=t.parent.createElement("span",{className:"e-dropitemscount",innerHTML:""+p.length});r.appendChild(c)}var u=(0,o.closest)(n,"tr").querySelector(".e-icon-rowdragicon");return u&&u.classList.add("e-dragstartrow"),s.appendChild(a),r.appendChild(s),i.element.appendChild(r),r},this.dragStart=function(e){var i=t.parent;if((i.enableVirtualization||i.infiniteScrollSettings.enableCache)&&i.allowGrouping&&i.groupSettings.columns.length&&!(0,o.isNullOrUndefined)(e.target.closest("tr")))for(var n=e.dragElement.querySelectorAll("tr"),r=e.target.closest("tr").querySelectorAll(".e-indentcell"),s=0;s<n.length;s++)for(var a=0;a<r.length;a++){var l=r[parseInt(a.toString(),10)].cloneNode(!0);n[parseInt(s.toString(),10)].insertBefore(l,n[parseInt(s.toString(),10)].firstElementChild)}i.element.classList.contains("e-childgrid")&&(t.getParentGrid(i.element).appendChild(e.dragElement),i.element.appendChild(i.createElement("div",{className:"e-drag-ref"})));if(document.body.classList.add("e-prevent-select"),!document.getElementsByClassName("e-griddragarea").length){var h=e.target,d=t.parent.element.querySelector(".e-dropitemscount");t.parent.getSelectedRecords().length>1&&d&&(d.style.left=t.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),t.processArgs(h),i.trigger(_,{rows:t.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(t.rows[0].getAttribute(Rs),10)-1,data:t.rowData[0]&&Object.keys(t.rowData[0]).length>0?t.rowData:t.currentViewData()}),t.dragStartData=t.rowData;var p=document.getElementById(i.rowDropSettings.targetID);i.rowDropSettings.targetID&&p&&p.ej2_instances&&"grid"===p.ej2_instances[0].getModuleName()&&p.ej2_instances[0].getContent().classList.add("e-allowRowDrop")}},this.drag=function(e){var i=t.parent;if(t.isDropGrid=t.parent,t.istargetGrid=!1,t.parent.rowDropSettings.targetID){var n=document.getElementById(i.rowDropSettings.targetID);t.isDropGrid=n.ej2_instances[0],_a(e.target,"e-grid")&&(t.istargetGrid=t.parent.rowDropSettings.targetID===_a(e.target,"e-grid").id)}var r=t.parent.element.querySelector(".e-cloneproperties");i.element.classList.contains("e-childgrid")&&(r=t.getParentGrid(i.element).querySelector(".e-cloneproperties"));var s=t.getElementFromPosition(r,e.event);(0,o.classList)(r,["e-defaultcur"],["e-notallowedcur","e-movecur","e-grabcur"]),t.isOverflowBorder=!0,t.hoverState=i.enableHover;var a=_a(s,"e-grid")?(0,o.closest)(e.target,"tr"):null;if(e.target){t.processArgs(s),i.enableVirtualization&&(0,o.isNullOrUndefined)(t.rows[0])&&(0,o.classList)(r,["e-notallowedcur"],["e-movecur"]);var l={rows:t.rows,target:s,draggableType:"rows",data:t.rowData,originalEvent:e,cancel:!1};if(i.trigger(K,l),t.stopTimer(),!l.cancel){if(i.element.classList.add("e-rowdrag"),a&&(_a(s,"e-grid").id===r.parentElement.id||_a(s,"e-grid").id)?t.isDropGrid.element.querySelector(".e-emptyrow")?t.dragTarget=0:t.dragTarget=parseInt(a.getAttribute("aria-rowindex"),10)-1:t.dragTarget=parseInt(t.startedRow.getAttribute("aria-rowindex"),10)-1,i.rowDropSettings.targetID){var h=document.querySelector(".e-drag-ref");!_a(s,"e-grid")||h&&_a(h.parentElement,"e-grid").id===_a(s,"e-grid").id||_a(r.parentElement,"e-grid").id===_a(s,"e-grid").id?(0,o.classList)(r,["e-notallowedcur"],["e-defaultcur"]):(0,o.classList)(r,["e-grabcur"],["e-notallowedcur"])}else{var d=_a(s,"e-grid");d&&d.id===r.parentElement.id&&_a(s,"e-row")&&!_a(s,"e-addedrow")?(0,o.classList)(r,["e-movecur"],["e-defaultcur"]):(0,o.classList)(r,["e-notallowedcur"],["e-movecur"])}if(_a(t.isDropGrid.element,"e-grid")){if((!t.isDropGrid.groupSettings.columns.length||t.isDropGrid.groupSettings.columns.length)&&!t.isDropGrid.element.querySelector(".e-emptyrow"))if(_a(s,"e-grid")&&_a(s,"e-grid").id===t.isDropGrid.element.id&&t.updateScrollPostion(e.event),(t.isOverflowBorder||t.parent.frozenRows>t.dragTarget)&&(parseInt(t.startedRow.getAttribute(Rs),10)-1!==t.dragTarget||t.istargetGrid)||t.istargetGrid&&a&&t.isDropGrid.getRowByIndex(t.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===a.getAttribute("data-uid"))t.moveDragRows(e,t.startedRow,a);else{var p=void 0;if(t.parent.enableVirtualization)p=a&&parseInt(a.getAttribute(Rs),10)-1==t.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var c=t.parent.enableInfiniteScrolling&&t.parent.infiniteScrollSettings.enableCache&&!t.parent.groupSettings.enableLazyLoading?t.parent.pageSettings.currentPage*t.parent.pageSettings.pageSize-1:t.parent.getCurrentViewRecords().length-1,u=t.parent.getRowByIndex(c);p=a&&u&&u.getAttribute("data-uid")===a.getAttribute("data-uid")&&u.getAttribute("data-uid")!==t.startedRow.getAttribute("data-uid"),t.isNewRowAdded()&&"Bottom"===t.parent.editSettings.newRowPosition&&(p=!1)}if(p&&!t.parent.rowDropSettings.targetID){var g=t.parent.createElement("div",{className:"e-lastrow-dragborder"}),f=t.parent.getContent();g.style.width=t.parent.element.offsetWidth-t.getScrollWidth()+"px",t.parent.enableVirtualization&&(g.style.zIndex="1"),f.getElementsByClassName("e-lastrow-dragborder").length||i.allowGrouping&&i.groupSettings.columns.length&&!(0,o.isNullOrUndefined)(a.nextSibling)||(f.classList.add("e-grid-relative"),f.appendChild(g),g.style.bottom=t.getScrollWidth()+"px")}t.removeBorder(a)}if(s&&s.classList.contains(ps)&&!t.isDropGrid.element.querySelector(".e-emptyrow")&&t.istargetGrid){t.removeBorder(a);c=t.isDropGrid.getCurrentViewRecords().length-1;var m=[];(m=t.parent.allowGrouping&&t.parent.groupSettings.columns&&t.parent.groupSettings.columns.length?[].slice.call(t.isDropGrid.getRowByIndex(c).querySelectorAll(".e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),.e-detailrowcollapse:not(.e-hide)")):[].slice.call(t.isDropGrid.getRowByIndex(c).querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))).length>0&&(t.parent.allowGrouping&&t.parent.groupSettings.columns&&t.parent.groupSettings.columns.length?t.groupRowDDIndicator(m,!0):vl(m,!0,"e-dragborder"))}}}}},this.dragStop=function(e){t.parent.isCheckBoxSelection&&t.parent.enableInfiniteScrolling&&window.getSelection().removeAllRanges(),document.body.classList.remove("e-prevent-select"),fl(t.parent)?t.parent.notify(Wt,{instance:t,handler:t.processDragStop,arg1:e}):t.processDragStop(e)},this.processDragStop=function(e){var i=t.parent;if(!t.parent.isDestroyed){var n=t.getElementFromPosition(e.helper,e.event),r=n&&!n.classList.contains("e-dlg-overlay")?n:e.target;i.element.classList.remove("e-rowdrag");var s=document.getElementById(i.rowDropSettings.targetID);if(i.rowDropSettings.targetID&&s&&s.ej2_instances&&"grid"===s.ej2_instances[0].getModuleName()&&s.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),_a(t.isDropGrid.element,"e-grid")){t.stopTimer(),t.isDropGrid.enableHover=t.hoverState,t.isDropGrid.getContent().classList.remove("e-grid-relative"),t.removeBorder(n);var a=t.isDropGrid.element.querySelector(".e-dragstartrow");a&&a.classList.remove("e-dragstartrow")}if(t.processArgs(r),!i.enableVirtualization||!(0,o.isNullOrUndefined)(t.rows[0])){var l={target:r,draggableType:"rows",cancel:!1,fromIndex:parseInt(t.rows[0].getAttribute(Rs),10)-1,dropIndex:t.dragTarget,rows:t.rows,data:Object.keys(t.dragStartData[0]).length>0?t.dragStartData:t.currentViewData()};i.trigger(W,l,function(){if(!(_a(r,us)||_a(r,"e-emptyrow")||_a(r,rs))||l.cancel||t.parent.pinnedTopRowModels.length&&_a(r,os))return t.dragTarget=null,void(0,o.remove)(e.helper);t.isRefresh=!1;var n=t.parent.getSelectedRowIndexes();i.isRowDragable()&&(!t.parent.rowDropSettings.targetID&&t.startedRow.querySelector("td.e-selectionbackground")&&n.length>1&&n.length!==t.parent.getCurrentViewRecords().length?t.reorderRows(n,l.dropIndex):t.reorderRows([parseInt(t.startedRow.getAttribute(Rs),10)-1],t.dragTarget),t.dragTarget=null,i.rowDropSettings.targetID||(e.helper.classList.contains("e-cloneproperties")&&document.querySelector("."+e.helper.classList[0])&&(0,o.remove)(e.helper),!i.enableVirtualization||i.sortSettings.columns.length||i.filterSettings.columns.length||t.parent.allowGrouping&&i.groupSettings.columns.length?t.rowOrder(l):(i.refresh(),i.contentModule.vgenerator.startIndex=null)),t.parent.getContentTable().scrollHeight<t.parent.getContent().clientHeight&&t.parent.scrollModule.setLastRowCell()),t.isRefresh=!0})}}},this.removeCell=function(e,t){return[].slice.call(e.querySelectorAll("td")).filter(function(i){i.classList.contains(t)&&e.deleteCell(i.cellIndex)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(Le,this.initializeDrag,this),this.parent.on(V,this.columnDrop,this),this.parent.on(et,this.onActionComplete,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(E,this.onDataBoundFn),this.parent.on(Be,this.enableAfterRender,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.getParentGrid=function(e){for(var t=e,i=!1;!i;)t.ej2_instances[0].parentDetails&&(t=document.getElementById(t.ej2_instances[0].parentDetails.parentID)),t.classList.contains("e-childgrid")||(i=!0);return t},e.prototype.isNewRowAdded=function(){return this.parent.editSettings&&this.parent.editSettings.showAddNewRow&&!(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization)},e.prototype.groupRowDDIndicator=function(e,t){vl([e[0]],t,"e-dragleft"),vl(e,t,"e-dragtop","e-dragbottom"),vl([e[e.length-1]],t,"e-dragright")},e.prototype.refreshRow=function(e,t,i){for(var n=this.parent,r=n.getContentTable().querySelector(Ds),s=n.getHeaderTable().querySelector(Ds),a=0,l=e.rows.length;a<l;a++){var h=e.rows[parseInt(a.toString(),10)];if((n.enableVirtualization&&n.allowGrouping&&n.groupSettings.columns.length||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache)&&1===e.rows.length){var d=n.getRowElementByUID(h.getAttribute("data-uid"));(0,o.isNullOrUndefined)(d)||(0,o.remove)(d)}var p=h.querySelector(".e-dragstartrow");if(p&&p.classList.remove("e-dragstartrow"),t.insertBefore(h,i),n.allowGrouping&&n.groupSettings.columns.length){var c=h.getAttribute("data-uid"),u=e.target.parentElement.getAttribute("data-uid"),g=n.getRowObjectFromUID(c),f=n.getRowObjectFromUID(u);g.parentUid!==f.parentUid&&n.groupModule.groupReorderHandler(g,f)}}var m=[].slice.call(n.editSettings.showAddNewRow?t.querySelectorAll(".e-row:not(.e-addedrow)"):t.getElementsByClassName(us));if(n.allowGrouping&&n.groupSettings.columns.length?n.groupSettings.enableLazyLoading||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&m.length>3*n.pageSettings.pageSize?n.refresh():(nh(this.parent,e,m),n.enableVirtualization||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache?ih(n):th(this.parent,n.getRowsObject().filter(function(e){return e.isDataRow}),m),this.parent.notify(dr,{rows:n.enableVirtualization?this.parent.vRows:this.parent.getRowsObject()})):n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&!n.groupSettings.columns.length?m.length>3*n.pageSettings.pageSize?n.refresh():(nh(this.parent,e,m),ih(n)):this.refreshData(m),this.parent.frozenRows)for(a=0,l=m.length;a<l;a++)a<this.parent.frozenRows?s.appendChild(m[parseInt(a.toString(),10)]):r.appendChild(m[parseInt(a.toString(),10)])},e.prototype.updateFrozenRowreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(Ds),n=t.getHeaderTable().querySelector(Ds),r=[].slice.call(n.getElementsByClassName(us)).concat([].slice.call(i.getElementsByClassName(us))),s=t.createElement(Ds,{attrs:{role:"rowgroup"}});t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection();for(var o=this.refreshRowTarget(e),a=0,l=r.length;a<l;a++)s.appendChild(r[parseInt(a.toString(),10)]);this.refreshRow(e,s,o)},e.prototype.refreshRowTarget=function(e){var t=this.parent,i=parseInt(e.target.parentElement.getAttribute(Rs),10)-1;t.enableVirtualization&&t.allowGrouping&&t.groupSettings.columns.length&&(i=this.parent.getDataRows().indexOf(e.target.parentElement)),!(e.fromIndex<e.dropIndex||e.fromIndex===e.dropIndex)||t.allowGrouping&&t.groupSettings.columns.length||(i+=1);var n=t.getRowByIndex(i);return i===t.getRows().length&&this.isNewRowAdded()&&"Bottom"===this.parent.editSettings.newRowPosition&&(n=this.parent.element.querySelector(".e-row.e-addedrow")),t.allowGrouping&&t.groupSettings.columns.length&&-1!==i&&e.fromIndex<e.dropIndex&&n?n.nextSibling:n},e.prototype.updateFrozenColumnreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(Ds);t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection();var n=this.refreshRowTarget(e);this.refreshRow(e,i,n)},e.prototype.refreshData=function(e){for(var t={},i={},n=this.parent.getRowsObject(),r=this.parent.getCurrentViewRecords(),s=this.parent.isRemote(),o=0,a=e.length;o<a;o++){var l=parseInt(e[parseInt(o.toString(),10)].getAttribute(Rs),10)-1-this.parent.pinnedTopRowModels.length;t[parseInt(o.toString(),10)]=n[parseInt(l.toString(),10)],s||(i[parseInt(o.toString(),10)]=r[parseInt(l.toString(),10)])}var h=this.parent.getRows();for(o=0,a=e.length;o<a;o++)h[parseInt(o.toString(),10)]=e[parseInt(o.toString(),10)],n[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)],s||(r[parseInt(o.toString(),10)]=i[parseInt(o.toString(),10)]);th(this.parent,n,e,this.parent.pinnedTopRowModels.length),this.parent.selectionModule.setPinnedSelectionIndexes()},e.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)&&!_a(e.target,"e-groupcaption")){if(this.parent.isDetail()){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector(Ds).children),i=this.parent.getRowsObject();t.filter(function(e){e.classList.contains("e-detailrow")&&e.remove()});for(var n=0,r=i.length;n<r&&i[parseInt(n.toString(),10)];n++)i[parseInt(n.toString(),10)].isDetailRow&&(this.parent.getRowsObject().splice(n,1),n--)}if((e.target.classList.contains("e-rowcelldrag")||e.target.classList.contains("e-dtdiagonalright")||e.target.classList.contains("e-dtdiagonaldown"))&&(e.target=e.target.parentElement),!e.target.classList.contains("e-rowcell")&&_a(e.target,"e-rowcell")&&(e.target=_a(e.target,"e-rowcell")),this.parent.frozenRows?this.updateFrozenRowreOrder(e):this.updateFrozenColumnreOrder(e),this.parent.allowGrouping&&this.parent.groupSettings.columns.length||!(this.selectedRowColls.length>0))this.selectedRowColls=[];else{this.parent.selectRows(this.selectedRowColls);var s=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(n=0,r=e.rows.length;n<r;n++)s.push(parseInt(e.rows[parseInt(n.toString(),10)].getAttribute(Rs),10)-1);this.selectedRowColls=s}this.selectedRowColls=[]}}},e.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute(Rs),10)-1,n=0,r=e.length;n<r;n++){t[parseInt(n.toString(),10)]=this.parent.currentViewData[e[parseInt(n.toString(),10)]]}return this.parent.rowDropSettings.targetID||0!==e.length||(t[0]=this.parent.currentViewData[parseInt(i.toString(),10)]),t},e.prototype.reorderRows=function(e,t){for(var i=this.parent.isRemote(),n=this.parent.getSelectedRowIndexes(),r=[],s=[],o=i?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json,a=this.parent.allowPaging&&!i?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-this.parent.pageSettings.pageSize:0,l=t+a,h=e[0]+a,d=0,p=e.length;d<p;d++)s[parseInt(d.toString(),10)]=o[e[parseInt(d.toString(),10)]+a];for(d=0,p=n.length;d<p;d++)r[parseInt(d.toString(),10)]=o[n[parseInt(d.toString(),10)]+a];for(d=0,p=s.length;d<p;d++){if(0!==d){for(var c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(s[parseInt(d.toString(),10)])){h=c;break}for(c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(s[d-1])){h>c&&(l=c+1);break}}this.reorderRow(h-a,l-a)}this.isRefresh&&this.parent.notify(Ue,{type:R,requestType:"rowdraganddrop"});for(d=0,p=r.length;d<p;d++)for(c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(r[parseInt(d.toString(),10)])){n[parseInt(d.toString(),10)]=c-a;break}this.selectedRowColls=n},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.onActionComplete=function(e){this.parent.trigger(D,(0,o.extend)(e,{type:D,requestType:"rowdraganddrop"}))},e.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new o.Draggable(e.element,{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,isReplaceDragEle:this.isReplaceDragEle,isPreventSelect:!1,isPreventScroll:!0})},e.prototype.updateScrollPostion=function(e){var t=this,i=Ya(e).y,n=this.isDropGrid.getContent().getBoundingClientRect(),r=this.isDropGrid.getRowHeight()-15,s=this.isDropGrid.getContent().firstElementChild,o=this.parent.enableVirtualization?20:0;if(n.top>=i){var a=-this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){t.setScrollDown(s,a)},200)}else if(n.top+this.isDropGrid.getContent().clientHeight-r-33-o<=i){var l=this.isDropGrid.getRowHeight();this.isOverflowBorder=!1,this.timer=window.setInterval(function(){t.setScrollDown(s,l)},200)}},e.prototype.setScrollDown=function(e,t){e.scrollTop=e.scrollTop+t},e.prototype.moveDragRows=function(e,t,i){var n=this.parent.element.querySelector(".e-cloneproperties");this.parent.element.classList.contains("e-childgrid")&&(n=this.getParentGrid(this.parent.element).querySelector(".e-cloneproperties"));var r=(0,o.closest)(e.target,"tr");if(_a(r,"e-grid")&&(!this.parent.rowDropSettings.targetID&&_a(n.parentElement,"e-grid").id===_a(r,"e-grid").id||this.istargetGrid)){var s=r;r||(s=t),this.setBorder(s,e.event,t,i)}},e.prototype.setBorder=function(e,t,i,n){var r=this.parent.element;this.istargetGrid&&(r=this.isDropGrid.element);var s=this.parent.element.querySelector(".e-cloneproperties");if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.removeBorder(e):(this.removeFirstRowBorder(e),this.removeLastRowBorder(e)),_a(e,"e-grid")&&e.classList.contains(us)&&(!this.parent.rowDropSettings.targetID&&_a(s.parentElement,"e-grid").id===_a(e,"e-grid").id||this.istargetGrid)){this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?(0,o.removeClass)(r.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragtop","e-dragright","e-dragbottom","e-dragleft"]):(0,o.removeClass)(r.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]);var a=[],l=parseInt(n.getAttribute(Rs),10)-1;if(!n||0!==l||this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition)this.parent.rowDropSettings.targetID&&n?(e=this.isDropGrid.getRowByIndex(l-1),a=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):n&&parseInt(i.getAttribute(Rs),10)-1>l?(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(l=this.parent.getDataRows().indexOf(n)),this.parent.allowGrouping&&this.parent.groupSettings.columns.length?(e=n,a=[].slice.call(e.querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),\n .e-detailrowcollapse:not(.e-hide)"))):(e=0===l&&this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition?this.parent.element.querySelector(".e-row.e-addedrow tr"):this.parent.getRowByIndex(l-1),a=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")))):a=[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));else if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length)e=n,a=[].slice.call(e.querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"));else{var h=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),d=this.isDropGrid.getHeaderContent();d.classList.add("e-grid-relative"),h.style.width=r.offsetWidth-this.getScrollWidth()+"px",d.getElementsByClassName("e-firstrow-dragborder").length||(this.parent.frozenRows?(this.parent.isFrozenGrid()&&(h.style.width=this.parent.getContent().firstElementChild.scrollWidth+"px"),d.querySelector("thead").appendChild(h),h.style.position="relative"):d.appendChild(h))}a.length>0&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(a,!0):vl(a,!0,"e-dragborder"))}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?Ko.getScrollBarWidth():0},e.prototype.removeFirstRowBorder=function(e){if(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length>0&&e&&(0!==e.rowIndex||e.classList.contains("e-columnheader")))(0,o.remove)(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0]);else{var t=this.parent.element.querySelector(".e-row.e-addedrow tr");if(t&&t.querySelector(".e-dragborder"))vl([].slice.call(t.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")),!1,"e-dragborder")}},e.prototype.removeLastRowBorder=function(e){var t;if(this.parent.enableVirtualization)t=e&&parseInt(e.getAttribute(Rs),10)-1!=this.parent.renderModule.data.dataManager.dataSource.json.length-1;else{var i=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-1:this.parent.getCurrentViewRecords().length-1,n=this.parent.getRowByIndex(i);t=e&&n&&n.getAttribute("data-uid")!==e.getAttribute("data-uid")}this.parent.element.getElementsByClassName("e-lastrow-dragborder").length>0&&e&&t&&(0,o.remove)(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},e.prototype.removeBorder=function(e){if(this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),e=this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(this.isDropGrid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector("td.e-dragtop.e-dragbottom")})[0]:this.isDropGrid.getRows().filter(function(e){return e.querySelector("td.e-dragborder")})[0]){var t=this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(e.querySelectorAll(".e-dragtop.e-dragbottom")):[].slice.call(e.getElementsByClassName("e-dragborder"));this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(t,!1):vl(t,!1,"e-dragborder")}},e.prototype.getElementFromPosition=function(e,t){var i=Ya(t);e.style.display="none";var n=document.elementFromPoint(i.x,i.y);return e.style.display="",n},e.prototype.onDataBound=function(){this.selectedRowColls.length>0&&(this.parent.enableVirtualization||this.parent.allowRowDragAndDrop)&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute(Rs),10)-1:0},e.prototype.singleRowDrop=function(e){var t=(0,o.closest)(e.target,"tr"),i=e.droppedElement.parentElement.ej2_instances[0],n=t?t.rowIndex:i.currentViewData.length-1;this.reorderRow(this.startedRowIndex,n)},e.prototype.columnDrop=function(e){var t=this.parent;if("grouping"!==e.droppedElement.getAttribute("action")&&(_a(e.target,us)||_a(e.target,"e-emptyrow")||_a(e.target,rs))){var i=(0,o.closest)(e.target,"tr"),n=void 0,r=document.querySelector(".e-drag-ref");if("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&(e.droppedElement.parentElement.id===t.element.id||r&&r.parentElement.id===t.element.id)||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==t.element.id)return;if(e.droppedElement.parentElement.id!==t.element.id)r?(n=r.parentElement.ej2_instances[0],(0,o.remove)(r)):n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id!==t.element.id&&n.rowDropSettings.targetID!==t.element.id)return;var s=n.getSelectedRecords(),l=this.getTargetIdx(i);if(e.target&&e.target.classList.contains("e-content")&&t.getCurrentViewRecords().length){var h=t.getContentTable().querySelector("tr:last-child");h&&(l=parseInt(h.getAttribute(Rs),10))}isNaN(l)&&(l=0),t.allowPaging&&(l=l+t.pageSettings.currentPage*t.pageSettings.pageSize-t.pageSettings.pageSize),t.notify(Dt,{toIndex:l,records:s}),t.notify(Ue,{type:R,requestType:"rowdraganddrop"});var d=n.getSelectedRowIndexes(),p=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0;this.selectedRows=[];for(var c=0,u=s.length;c<u;c++)this.selectedRows.push(p+d[parseInt(c.toString(),10)]);n.notify(Tt,{indexes:this.selectedRows,records:s}),n.dataSource instanceof a.DataManager&&n.dataSource.dataSource.offline&&n.notify(Ue,{type:R,requestType:"rowdraganddrop"})}},e.prototype.reorderRow=function(e,t){var i=this.parent;if(!i.groupSettings.columns.length){var n=i.allowPaging&&!this.parent.isRemote()?i.pageSettings.currentPage*i.pageSettings.pageSize-i.pageSettings.pageSize:0;t+=n,this.selectedRows=i.getSelectedRowIndexes(),i.notify(Hi,{fromIndex:e+n,toIndex:t})}},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.draggable.destroy(),this.parent.off(Le,this.initializeDrag),this.parent.off(V,this.columnDrop),this.parent.off(et,this.onActionComplete),this.parent.removeEventListener(E,this.onDataBoundFn),this.parent.off(Be,this.enableAfterRender),this.parent.off(Ct,this.destroy))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute(Rs),10)-1;t.getSelectedRecords().length>0&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache?this.rows=[this.startedRow]:this.rows=[t.getRowByIndex(i)],this.rowData=[t.getRowInfo(this.startedRow.querySelector("."+is)).rowData],(t.enableVirtualization||t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache)&&t.allowGrouping&&t.groupSettings.columns.length&&t.getSelectedRows().length&&(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))):(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))},e}(),Td=function(){function e(e,t,i,n){var r=this;this.sortRequired=!0,this.groupSortFocus=!1,this.groupTextFocus=!1,this.groupCancelFocus=!1,this.preventFocusOnGroup=!1,this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.isAppliedCaptionRowBorder=!1,this.reorderingColumns=[],this.visualElement=(0,o.createElement)("div",{className:"e-cloneproperties e-dragclone e-gdclone",attrs:{action:"grouping"}}),this.helper=function(e){var t=r.parent,i=e.sender.target,n=i.classList.contains("e-groupheadercell")?i:_a(i,"e-groupheadercell");return!(!n||!i.classList.contains("e-drag")&&r.groupSettings.allowReordering)&&(r.column=t.getColumnByField(n.firstElementChild.getAttribute("data-mappingname")),r.visualElement.textContent=n.textContent,(0,o.updateCSSText)(r.visualElement,"width: "+(n.offsetWidth+2)+"px;\n height: "+(n.offsetHeight+2)+"px; line-height: 23px;"),r.visualElement.setAttribute("data-mappinguid",r.column.uid),t.element.appendChild(r.visualElement),r.visualElement)},this.dragStart=function(e){r.parent.element.classList.add("e-ungroupdrag")},this.drag=function(e){r.groupSettings.allowReordering&&r.animateDropper(e);var t=e.target,i=r.parent.element.querySelector(".e-cloneproperties");r.parent.trigger(j,{target:t,draggableType:"headercell",column:r.column}),r.groupSettings.allowReordering||((0,o.classList)(i,["e-defaultcur"],["e-notallowedcur"]),_a(t,rs)||_a(t,"e-headercell")||(0,o.classList)(i,["e-notallowedcur"],["e-defaultcur"]))},this.dragStop=function(e){r.parent.element.classList.remove("e-ungroupdrag");var t=!(_a(e.target,rs)||_a(e.target,"e-gridheader"));if(r.groupSettings.allowReordering&&t){if((0,o.remove)(e.helper),_a(e.target,"e-groupdroparea"))r.rearrangeGroup();else if(!_a(e.target,"e-grid")){var i=r.parent.getColumnByUid(e.helper.getAttribute("data-mappinguid")).field;-1!==r.groupSettings.columns.indexOf(i)&&r.ungroupColumn(i)}}else t&&(0,o.remove)(e.helper)},this.animateDropper=function(e){var t=r.parent.element.querySelector(".e-cloneproperties").getAttribute("data-mappinguid"),i=r.parent.getColumnByUid(t).field,n=_a(e.target,"e-groupdroparea"),s=_a(e.target,"e-group-animator"),o=[].slice.call(r.element.getElementsByClassName("e-groupheadercell")).map(function(e){return e.querySelector("div").getAttribute("data-mappingname")}),a=JSON.parse(JSON.stringify(o));if(s||n){if(s){var l=s.querySelector("div[data-mappingname]").getAttribute("data-mappingname"),h=+s.getAttribute("data-index");if(l!==i){var d=a.indexOf(i);-1!==d&&a.splice(d,1);var p=-1!==h&&d===h;a.splice(h+(p?1:0),0,i)}}else n&&-1===a.indexOf(i)&&a.push(i);r.element.innerHTML="",a.length&&!r.element.classList.contains("e-grouped")&&r.element.classList.add("e-grouped"),r.reorderingColumns=a;for(var c=0;c<a.length;c++)r.addColToGroupDrop(a[parseInt(c.toString(),10)])}else r.addLabel(),r.removeColFromGroupDrop(i)},this.drop=function(e){var t=r.parent,i=t.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid"));r.element.classList.remove("e-hover"),(0,o.remove)(e.droppedElement),r.aria.setDropTarget(r.parent.element.querySelector(".e-groupdroparea"),!1),r.aria.setGrabbed(r.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),(0,o.isNullOrUndefined)(i)||!1===i.allowGrouping||_a(t.getColumnHeaderByUid(i.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id")?r.parent.log("action_disabled_column",{moduleName:r.getModuleName(),columnName:i?i.headerText:void 0}):r.groupColumn(i.field)},this.contentRefresh=!0,this.aria=new eo,this.parent=e,this.groupSettings=t,this.serviceLocator=n,this.sortedColumns=i,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new Xs(this.parent)}return e.prototype.addLabel=function(){if(!this.element.getElementsByClassName("e-group-animator").length){var e=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=e,this.element.classList.remove("e-grouped")}},e.prototype.rearrangeGroup=function(){this.sortRequired=!1,this.updateModel()},e.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&e.column.allowGrouping&&this.animateDropper(e);var t=this.parent.element.querySelector(".e-cloneproperties");this.parent.allowReordering||(0,o.classList)(t,["e-defaultcur"],["e-notallowedcur"]),e.column.allowGrouping&&(_a(e.target,"e-groupdroparea")||_a(e.target,"e-headercell")&&_a(e.target,"e-headercell").isEqualNode(this.parent.getColumnHeaderByField(e.column.field)))||this.parent.allowReordering&&_a(e.target,"e-headercell")||(0,o.classList)(t,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},e.prototype.columnDragStart=function(e){if(!e.target.classList.contains("e-stackedheadercell")){var t=this.parent.element.querySelector(".e-groupdroparea");this.aria.setDropTarget(t,e.column.allowGrouping);var i=e.target.classList.contains("e-headercell")?e.target:_a(e.target,"e-headercell");this.aria.setGrabbed(i,!0,!e.column.allowGrouping)}},e.prototype.columnDrop=function(e){var t=this.parent;if("grouping"===e.droppedElement.getAttribute("action")){var i=t.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid"));if((0,o.isNullOrUndefined)(i)||!1===i.allowGrouping||_a(t.getColumnHeaderByUid(i.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id"))return;this.ungroupColumn(i.field)}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.enableAfterRender,this),this.parent.on(it,this.onActionComplete,this),this.parent.on(rt,this.onActionComplete,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.on(St,this.clickHandler,this),this.parent.on(j,this.columnDrag,this),this.parent.on(H,this.columnDragStart,this),this.parent.on(Ot,this.columnDrop,this),this.parent.on(V,this.columnDrop,this),this.parent.on(je,this.refreshSortIcons,this),this.parent.on(Ke,this.refreshSortIcons,this),this.parent.on(vt,this.keyPressHandler,this),this.parent.on(Ne,this.initialEnd,this),this.parent.on(ze,this.initialEnd,this),this.parent.on(Le,this.render,this),this.parent.on(st,this.onGroupAggregates,this),this.parent.on(Ct,this.destroy,this),this.parent.on("group-expand-collapse",this.updateExpand,this),this.parent.on("persist-data-changed",this.initialEnd,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Le,this.render),this.parent.off(Be,this.enableAfterRender),this.parent.off(it,this.onActionComplete),this.parent.off(rt,this.onActionComplete),this.parent.off(qe,this.onPropertyChanged),this.parent.off(St,this.clickHandler),this.parent.off(j,this.columnDrag),this.parent.off(H,this.columnDragStart),this.parent.off(V,this.columnDrop),this.parent.off(Ot,this.columnDrop),this.parent.off(je,this.refreshSortIcons),this.parent.off(Ke,this.refreshSortIcons),this.parent.off(vt,this.keyPressHandler),this.parent.off(st,this.onGroupAggregates),this.parent.off(Ct,this.destroy),this.parent.off("group-expand-collapse",this.updateExpand))},e.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(Ne,this.initialEnd),this.parent.off(ze,this.initialEnd),this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var t=0,i=e.groupSettings.columns;t<i.length;t++){var n=i[t];this.preventFocusOnGroup=!0,this.groupColumn(n),this.preventFocusOnGroup=!1}this.contentRefresh=!0}},e.prototype.keyPressHandler=function(e){var t=this.parent;if(e.target&&_a(e.target,"e-groupheadercell")&&("tab"===e.action||"shiftTab"===e.action)){var i=this.getFocusableGroupedItems();if("tab"===e.action&&e.target===i[i.length-1]||"shiftTab"===e.action&&e.target===i[0])return;for(var n=0;n<i.length;n++)if(e.target===i[parseInt(n.toString(),10)]){e.preventDefault();var r="tab"===e.action?n+1:n-1;return void i[parseInt(r.toString(),10)].focus()}}if(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),("ctrlSpace"===e.action||this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))&&(!this.parent.groupSettings.enableLazyLoading||!this.groupSettings.columns.length||"ctrlUpArrow"!==e.action&&"ctrlDownArrow"!==e.action))switch(e.action){case"altDownArrow":case"altUpArrow":var s=t.allowSelection?t.getSelectedRowIndexes():[];if(s.length){e.preventDefault();var a=t.getContentTable().querySelector(Ds).children,l=void 0;for(n=t.getDataRows()[s[s.length-1]].rowIndex;n>=0;n--)if(!a[parseInt(n.toString(),10)].classList.contains(us)&&!a[parseInt(n.toString(),10)].classList.contains("e-detailrow")){l=a[parseInt(n.toString(),10)];break}this.expandCollapseRows(l.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":e.preventDefault(),this.expandAll();break;case"ctrlUpArrow":e.preventDefault(),this.collapseAll();break;case"enter":if(e.target.classList.contains("e-groupsort")){this.groupSortFocus=!0,e.preventDefault(),this.applySortFromTarget(e.target);break}if(e.target.classList.contains("e-ungroupbutton")){this.groupCancelFocus=!0,e.preventDefault(),this.unGroupFromTarget(e.target);break}if(this.parent.isEdit||null!==(0,o.closest)(e.target,"#"+this.parent.element.id+"_searchbar")||_a(e.target,"e-pager")||_a(e.target,"e-toolbar"))return;var h=this.focus.getFocusedElement();h&&(h.classList.contains("e-icon-grightarrow")||h.classList.contains("e-icon-gdownarrow"))&&(h=h.parentElement);var d=h&&h.parentElement?h.parentElement.querySelector('[class^="e-record"]'):null;if(!d)break;h.children.length&&(h.children[0].classList.contains("e-icon-grightarrow")||h.children[0].classList.contains("e-icon-gdownarrow"))&&(e.preventDefault(),this.expandCollapseRows(d));break;case"ctrlSpace":var p=t.focusModule.currentInfo.element;if(p&&p.classList.contains("e-headercell")){e.preventDefault();var c=t.getColumnByUid(p.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));c.field&&t.groupSettings.columns.indexOf(c.field)<0?this.groupColumn(c.field):this.ungroupColumn(c.field)}}},e.prototype.getFocusableGroupedItems=function(){var e=[];if(this.groupSettings.columns.length)for(var t=this.element.querySelectorAll(".e-groupheadercell"),i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)].querySelector(".e-grouptext")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-groupsort")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-ungroupbutton"));return e},e.prototype.wireEvent=function(){o.EventHandler.add(this.element,"focusin",this.onFocusIn,this),o.EventHandler.add(this.element,"focusout",this.onFocusOut,this),o.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this)},e.prototype.unWireEvent=function(){o.EventHandler.remove(this.element,"focusin",this.onFocusIn),o.EventHandler.remove(this.element,"focusout",this.onFocusOut),o.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler)},e.prototype.onFocusIn=function(e){this.parent.focusModule.currentInfo&&this.parent.focusModule.currentInfo.element&&((0,o.removeClass)([this.parent.focusModule.currentInfo.element,this.parent.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.parent.focusModule.currentInfo.element.tabIndex=-1),this.addOrRemoveFocus(e)},e.prototype.onFocusOut=function(e){this.addOrRemoveFocus(e)},e.prototype.addOrRemoveFocus=function(e){if(e.target.classList.contains("e-groupdroparea")||e.target.classList.contains("e-grouptext")||e.target.classList.contains("e-groupsort")||e.target.classList.contains("e-ungroupbutton")){var t=e.target.classList.contains("e-grouptext")?e.target.parentElement.parentElement:e.target;"focusin"===e.type?(this.parent.focusModule.currentInfo.element=e.target,this.parent.focusModule.currentInfo.elementToFocus=e.target,(0,o.addClass)([t],["e-focused","e-focus"]),e.target.tabIndex=0):((0,o.removeClass)([t],["e-focused","e-focus"]),e.target.tabIndex=-1)}},e.prototype.clickHandler=function(e){e.target.classList.contains("e-grouptext")&&(this.groupTextFocus=!0),e.target.classList.contains("e-groupsort")&&(this.groupSortFocus=!0),e.target.classList.contains("e-ungroupbutton")&&(this.groupCancelFocus=!0),(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow"))&&e.preventDefault();var t=_a(e.target,"e-recordplusexpand")||_a(e.target,"e-recordpluscollapse");t&&(t.children[0].classList.contains("e-icon-gdownarrow")||t.children[0].classList.contains("e-icon-grightarrow"))&&this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},e.prototype.auxilaryclickHandler=function(e){(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow")&&1===e.button)&&e.preventDefault()},e.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("data-mappingname"))},e.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("data-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("data-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("data-mappingname")))},e.prototype.applySortFromTarget=function(e){var t=this.parent,i=(0,o.closest)(e,".e-groupheadercell");if(t.allowSorting&&i&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")){var n=i.firstElementChild.getAttribute("data-mappingname");t.getColumnHeaderByField(n).getElementsByClassName("e-ascending").length?t.sortColumn(n,"Descending",!0):t.sortColumn(n,"Ascending",!0)}},e.prototype.expandCollapseRows=function(e){var t=_a(e,"e-recordplusexpand")||_a(e,"e-recordpluscollapse");if(t){var i=[].slice.call(this.parent.getContentTable().querySelector(Ds).children);this.parent.editSettings.showAddNewRow&&(i[0].classList.contains("e-addedrow")?i.shift():i[i.length-1].classList.contains("e-addedrow")&&i.pop());var n=void 0,r=void 0,s=void 0,a=this.parent,l=t.parentElement.getElementsByClassName("e-indentcell").length,h=t.parentElement.getAttribute("data-uid"),d=a.getRowObjectFromUID(h),p=!1;if(t.classList.contains("e-recordpluscollapse")?((0,o.addClass)([t],"e-recordplusexpand"),(0,o.removeClass)([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded")),p=!0,d.isExpand=!0,Fl(a)&&this.updateVirtualRows(a,e,p,s,r),this.parent.groupSettings.enableLazyLoading&&((this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length||this.parent.searchSettings.key.length)&&0===this.parent.getContent().firstElementChild.scrollTop&&(this.parent.contentModule.isTop=!0),(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionExpand(t.parentElement))):(n=!0,d.isExpand=!1,(0,o.removeClass)([t],"e-recordplusexpand"),(0,o.addClass)([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")),Fl(a)&&this.updateVirtualRows(a,e,!n,s,r),this.parent.groupSettings.enableLazyLoading&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionCollapse(t.parentElement)),this.aria.setExpand(t,p),!Fl(a)&&!this.parent.groupSettings.enableLazyLoading){for(var c=a.getRowsObject(),u=c.indexOf(d),g={},f=a.enableInfiniteScrolling&&a.infiniteScrollSettings&&a.infiniteScrollSettings.enableCache&&c.length!==i.length?Array.from(i).indexOf(t.parentElement):void 0,m=u;m<c.length&&!(m>u&&c[parseInt(m.toString(),10)].indent===l);m++){if(c[parseInt(m.toString(),10)].isDetailRow){var y=c[m-1].isExpand&&c[m-1].visible;f&&f>0&&f<i.length?i[parseInt(f.toString(),10)].style.display=y?"":"none":(0,o.isNullOrUndefined)(f)&&(i[parseInt(m.toString(),10)].style.display=y?"":"none")}else if(!1===g[c[parseInt(m.toString(),10)].parentUid])c[parseInt(m.toString(),10)].visible=!1,f&&f>0&&f<i.length?i[parseInt(f.toString(),10)].style.display="none":(0,o.isNullOrUndefined)(f)&&(i[parseInt(m.toString(),10)].style.display="none");else{if(!(c[parseInt(m.toString(),10)].isDataRow||c[parseInt(m.toString(),10)].isCaptionRow||c[parseInt(m.toString(),10)].isDetailRow||c[parseInt(m.toString(),10)].isAggregateRow))if((y=c[parseInt(m.toString(),10)].cells.some(function(e){return e.isDataCell&&e.visible}))===c[parseInt(m.toString(),10)].visible)continue;c[parseInt(m.toString(),10)].visible=!0,f&&f>0&&f<i.length?(i[parseInt(f.toString(),10)].style.display="",i[parseInt(f.toString(),10)].classList.remove("e-hide")):(0,o.isNullOrUndefined)(f)&&(i[parseInt(m.toString(),10)].style.display="",i[parseInt(m.toString(),10)].classList.remove("e-hide"))}c[parseInt(m.toString(),10)].isCaptionRow&&(g[c[parseInt(m.toString(),10)].uid]=c[parseInt(m.toString(),10)].isExpand&&c[parseInt(m.toString(),10)].visible),(0,o.isNullOrUndefined)(f)||f++}this.lastCaptionRowBorder(),this.parent.notify(dr,{rows:this.parent.getRowsObject()})}this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading||this.parent.notify(Or,{isCollapse:n,parentUid:h})}},e.prototype.lastCaptionRowBorder=function(){var e=this.parent.getContentTable(),t=this.parent.getContent().clientHeight;if((!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.groupSettings.enableLazyLoading)&&(e.scrollHeight<t||this.isAppliedCaptionRowBorder)){if(this.isAppliedCaptionRowBorder||e.querySelector(".e-lastrowcell")){for(var i=e.querySelectorAll(".e-lastrowcell"),n=0,r=i.length;n<r;n++)(0,o.removeClass)([i[parseInt(n.toString(),10)]],"e-lastrowcell");this.isAppliedCaptionRowBorder=!1}var s=this.parent.getContentTable().querySelector(Ds).children,a=s[s.length-1];if("none"===a.style.display||a.classList.contains("e-groupcaptionrow")){for(n=s.length-1,r=0;n>r;n--)if("none"!==s[parseInt(n.toString(),10)].style.display&&s[parseInt(n.toString(),10)].classList.contains("e-groupcaptionrow")&&s[parseInt(n.toString(),10)].querySelector(".e-recordpluscollapse")){(0,o.addClass)(s[parseInt(n.toString(),10)].childNodes,"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0;break}}else e.scrollHeight<t&&((0,o.addClass)(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0)}},e.prototype.updateVirtualRows=function(e,t,i,n,r){var s=e.getRowObjectFromUID(t.closest("tr").getAttribute("data-uid"));s.isExpand=i,Fa(e),this.parent.notify(ur,{}),n=e.getDataModule().generateQuery(!1);var o={requestType:"virtualscroll",rowObject:s};e.contentModule&&(o.virtualInfo=e.contentModule.prevInfo),e.getDataModule().getData(o,n.requiresCount()).then(function(t){return e.renderModule.dataManagerSuccess(t,o)})},e.prototype.expandCollapse=function(e){var t=this.parent.getRowsObject();if(this.parent.groupSettings.columns.length&&t.length){e||this.parent.notify(En,e);for(var i,n=this.parent.getContentTable().querySelector(Ds).children,r=0,s=n.length;r<s;r++)n[parseInt(r.toString(),10)].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length?((i=n[parseInt(r.toString(),10)].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(e?(i.className="e-recordplusexpand",i.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",i.setAttribute("aria-expanded","true"),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))):(i.className="e-recordpluscollapse",i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",i.setAttribute("aria-expanded","false"),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")))),n[parseInt(r.toString(),10)].firstElementChild.classList.contains("e-recordplusexpand")||n[parseInt(r.toString(),10)].firstElementChild.classList.contains("e-recordpluscollapse")||(n[parseInt(r.toString(),10)].style.display=e?"":"none")):n[parseInt(r.toString(),10)].style.display=e?"":"none",t[parseInt(r.toString(),10)].isCaptionRow&&(t[parseInt(r.toString(),10)].isExpand=!!e);this.parent.updateVisibleExpandCollapseRows(),this.lastCaptionRowBorder(),this.parent.notify(dr,{rows:this.parent.getRowsObject()})}},e.prototype.expandAll=function(){this.expandCollapse(!0)},e.prototype.collapseAll=function(){this.expandCollapse(!1)},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn(),this.wireEvent()},e.prototype.refreshDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");if(!(0,o.isNullOrUndefined)(e)){this.updateGroupDropArea(!0);for(var t=0;t<this.groupSettings.columns.length;t++)this.addColToGroupDrop(this.groupSettings.columns[parseInt(t.toString(),10)])}},e.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&(0,o.remove)(e),this.element=this.parent.createElement("div",{className:"e-groupdroparea",attrs:{tabindex:"-1"}}),this.groupSettings.allowReordering&&this.element.classList.add("e-group-animate"),this.updateGroupDropArea(),this.parent.element.insertBefore(this.element,this.parent.element.firstChild),this.groupSettings.showDropArea&&"Vertical"!==this.parent.rowRenderingMode||(this.element.style.display="none")},e.prototype.updateGroupDropArea=function(e){if(this.groupSettings.showDropArea&&!this.groupSettings.columns.length){var t=this.l10n.getConstant("GroupDropArea");this.element.innerHTML=t,this.element.classList.remove("e-grouped")}else(this.element.innerHTML===this.l10n.getConstant("GroupDropArea")&&(1===this.groupSettings.columns.length||!this.isAppliedGroup&&!this.isAppliedUnGroup)||e)&&(this.element.innerHTML=""),this.element.classList.add("e-grouped")},e.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},e.prototype.initializeGHeaderDrag=function(){new o.Draggable(this.element,{dragTarget:this.groupSettings.allowReordering?".e-drag":".e-groupheadercell",distance:this.groupSettings.allowReordering?-10:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},e.prototype.initializeGHeaderDrop=function(){new o.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},e.prototype.groupColumn=function(e){var t=this.parent,i=t.getColumnByField(e);(0,o.isNullOrUndefined)(i)||!1===i.allowGrouping||this.contentRefresh&&this.groupSettings.columns.indexOf(e)>-1?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:i.headerText}):fl(t)?t.notify(Wt,{instance:this,handler:this.groupColumn,arg1:e}):(i.visible=t.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),this.isAppliedGroup=!1)},e.prototype.ungroupColumn=function(e){var t=this.parent,i=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(t){return t.field===e})[0]:t.getColumnByField(e);if(!((0,o.isNullOrUndefined)(i)||!1===i.allowGrouping||this.groupSettings.columns.indexOf(e)<0))if(fl(t))t.notify(Wt,{instance:this,handler:this.ungroupColumn,arg1:e});else{i.visible=!0,this.colName=i.field;var n=JSON.parse(JSON.stringify(this.groupSettings.columns));if(n.splice(n.indexOf(this.colName),1),this.sortedColumns.indexOf(e)<0)for(var r=0,s=t.sortSettings.columns.length;r<s;r++)if(e===t.sortSettings.columns[parseInt(r.toString(),10)].field){t.sortSettings.columns.splice(r,1);break}this.groupSettings.allowReordering&&(this.reorderingColumns=n),this.groupSettings.columns=n,t.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},e.prototype.updateModel=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));e=this.reorderingColumns.length?JSON.parse(JSON.stringify(this.reorderingColumns)):e,this.sortRequired&&(-1===e.indexOf(this.colName)&&e.push(this.colName),this.groupAddSortingQuery(this.colName)),this.sortRequired=!0,this.parent.groupSettings.columns=e,this.parent.dataBind()},e.prototype.onActionComplete=function(e){"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName),this.groupSettings.showDropArea&&"100%"===this.parent.height&&this.parent.scrollModule.refresh();var t=this.groupSettings.columns.indexOf(this.colName)>-1?{columnName:this.colName,requestType:"grouping",type:D}:{requestType:"ungrouping",type:D};this.parent.trigger(D,(0,o.extend)(e,t)),this.colName=null},e.prototype.groupAddSortingQuery=function(e){for(var t=0;t<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[parseInt(t.toString(),10)].field!==e;)t++;this.parent.sortSettings.columns.length===t?this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0}):this.parent.allowSorting||(this.parent.sortSettings.columns[parseInt(t.toString(),10)].direction="Ascending")},e.prototype.createElement=function(e){var t=this.parent,i="Ascending",n=this.parent.createElement("div",{className:"e-grid-icon e-group-animator"}),r=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),s=this.parent.createElement("div",{attrs:{"data-mappingname":e}});hl(e)&&s.setAttribute("ej-complexname",dl(e));var a=this.parent.getColumnByField(e),l=t.getColumnHeaderByUid(a.uid);this.groupSettings.allowReordering&&s.appendChild(this.parent.createElement("span",{className:"e-drag e-icons e-icon-drag",innerHTML:" ",attrs:{title:"Drag",tabindex:"-1","aria-label":this.l10n.getConstant("GroupedDrag"),role:"button"}})),s.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:a.headerText,attrs:{tabindex:"-1"}})),this.groupSettings.showToggleButton&&s.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:" ",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupAria")}})),l.querySelectorAll(".e-ascending,.e-descending").length&&(i=l.querySelector(".e-ascending")?"Ascending":"Descending"),s.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+i.toLowerCase()+" e-icon-"+i.toLowerCase(),innerHTML:" ",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupedSortIcon")+a.headerText,role:"button"}}));var h=this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:" ",attrs:{title:this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupIcon")+a.headerText,role:"button"}});return(0,o.updateCSSText)(h,this.groupSettings.showUngroupButton?"":"display: none;"),s.appendChild(h),r.appendChild(s),this.groupSettings.allowReordering&&(n.appendChild(r),n.appendChild(this.createSeparator()),r=n),r},e.prototype.addColToGroupDrop=function(e){var t=hl(e)?this.parent.element.querySelector(".e-groupdroparea div[ej-complexname="+pl(dl(e))+"]"):this.parent.element.querySelector(".e-groupdroparea div[data-mappingname="+pl(e)+"]");if(!t||!this.groupSettings.allowReordering&&t.getAttribute("data-mappingname")!==e){var i=this.parent.getColumnByField(e);if(!(0,o.isNullOrUndefined)(i)){var n=this.createElement(e);if(this.groupSettings.allowReordering){var r=this.element.getElementsByClassName("e-group-animator").length;n.setAttribute("data-index",r.toString())}this.element.appendChild(n);var s=this.parent.focusModule;s.setActive(!0);var a=[0,0];0===s.active.matrix.matrix[a[0]][a[1]]&&(a=Uh(s.active.matrix.matrix,a,!0)),s.active.matrix.current=a,this.parent.editSettings.showAddNewRow?this.parent.notify(jr,{}):this.parent.isInitialLoad&&!this.preventFocusOnGroup&&s.focus()}}},e.prototype.createSeparator=function(){var e=this.parent.createElement("span",{className:"e-nextgroup e-icons e-icon-next",innerHTML:" ",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupSeperator"),role:"button"}});return(0,o.updateCSSText)(e,this.groupSettings.showUngroupButton?"":"display: none;"),e},e.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var t=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-headercelldiv")),i=0,n=t.length;i<n;i++)if(!t[parseInt(i.toString(),10)].classList.contains("e-emptycell")&&!t[parseInt(i.toString(),10)].classList.contains("e-headerchkcelldiv")){var r=this.parent.getColumnByUid(t[parseInt(i.toString(),10)].getAttribute("data-mappinguid"));(!this.parent.showColumnMenu||this.parent.showColumnMenu&&!r.showColumnMenu)&&(t[parseInt(i.toString(),10)].getElementsByClassName("e-grptogglebtn").length&&(0,o.remove)(t[parseInt(i.toString(),10)].querySelectorAll(".e-grptogglebtn")[0]),e||t[parseInt(i.toString(),10)].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(this.groupSettings.columns.indexOf(r.field)>-1?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":(0,o.isNullOrUndefined)(this.l10n)?this.parent.localeObj.getConstant("GroupButton"):this.l10n.getConstant("GroupButton")}})))}},e.prototype.removeColFromGroupDrop=function(e){if(!(0,o.isNullOrUndefined)(this.getGHeaderCell(e))){var t=this.getGHeaderCell(e);if(this.groupSettings.allowReordering){var i=_a(t,"e-group-animator");(0,o.remove)(i)}else(0,o.remove)(t);this.updateGroupDropArea(),this.parent.editSettings.showAddNewRow&&this.parent.notify(jr,{})}this.isAppliedUnGroup=!1},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var n=i[t];switch(n){case"columns":var r=void 0;if(this.contentRefresh){if(this.isAppliedUnGroup)r={columnName:this.colName,requestType:"ungrouping",type:R};else{if(!this.isAppliedGroup){this.updateGroupDropArea(!0);for(var s=0;s<this.parent.sortSettings.columns.length;s++)this.parent.sortSettings.columns[parseInt(s.toString(),10)].isFromGroup&&(this.parent.sortSettings.columns.splice(s,1),s--);for(var o=0;o<this.groupSettings.columns.length;o++){this.colName=this.groupSettings.columns[parseInt(o.toString(),10)],this.parent.getColumnByField(this.colName).visible=this.parent.groupSettings.showGroupedColumn,this.groupAddSortingQuery(this.colName),o<this.groupSettings.columns.length-1&&this.addColToGroupDrop(this.groupSettings.columns[parseInt(o.toString(),10)])}}r={columnName:this.colName,requestType:e.properties[""+n].length?"grouping":"ungrouping",type:R,preventFocusOnGroup:!1}}if(!this.groupSettings.showGroupedColumn){var a=e.oldProperties[""+n];for(o=0;o<a.length;o++)-1===e.properties[""+n].indexOf(a[parseInt(o.toString(),10)])&&(this.parent.getColumnByField(a[parseInt(o.toString(),10)]).visible=!0)}this.parent.notify(Ue,r)}break;case"showDropArea":this.updateGroupDropArea(),this.groupSettings.showDropArea?(this.element.style.display="",this.parent.headerModule.refreshUI()):this.element.style.display="none","100%"===this.parent.height&&this.parent.scrollModule.refresh();break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify(Ue,{requestType:"refresh"});break;case"showUngroupButton":this.updateButtonVisibility(this.groupSettings.showUngroupButton,"e-ungroupbutton");break;case"showToggleButton":this.updateButtonVisibility(this.groupSettings.showToggleButton,"e-togglegroupbutton "),this.parent.refreshHeader();break;case"enableLazyLoading":this.parent.freezeRefresh()}}},e.prototype.updateGroupedColumn=function(e){for(var t=0;t<this.groupSettings.columns.length;t++)this.parent.getColumnByField(this.groupSettings.columns[parseInt(t.toString(),10)]).visible=e},e.prototype.updateButtonVisibility=function(e,t){for(var i=[].slice.call(this.element.getElementsByClassName(t)),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].style.display=e?"":"none"},e.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(!this.parent.isDestroyed&&this.parent.allowGrouping||this.parent.refreshing||this.clearGrouping(),this.unWireEvent(),this.removeEventListener(),this.refreshToggleBtn(!0),this.element.parentNode&&(0,o.remove)(this.element))},e.prototype.clearGrouping=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));this.contentRefresh=!1;for(var t=0,i=e.length;t<i;t++)t===i-1&&(this.contentRefresh=!0),this.ungroupColumn(e[parseInt(t.toString(),10)]);this.contentRefresh=!0},e.prototype.getModuleName=function(){return"group"},e.prototype.refreshSortIcons=function(){var e,t=this.parent,i=t.sortSettings.columns,n=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var r=0,s=i.length;r<s;r++)-1!==n.indexOf(i[parseInt(r.toString(),10)].field)&&(e=t.getColumnHeaderByField(i[parseInt(r.toString(),10)].field),!t.allowSorting&&(this.sortedColumns.indexOf(i[parseInt(r.toString(),10)].field)>-1||this.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)>-1)?((0,o.classList)(e.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),i.length>1&&e.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(r+1).toString()}))):this.getGHeaderCell(i[parseInt(r.toString(),10)].field)&&this.getGHeaderCell(i[parseInt(r.toString(),10)].field).getElementsByClassName("e-groupsort").length&&("Ascending"===i[parseInt(r.toString(),10)].direction?(0,o.classList)(this.getGHeaderCell(i[parseInt(r.toString(),10)].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):(0,o.classList)(this.getGHeaderCell(i[parseInt(r.toString(),10)].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])))},e.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[data-mappingname="'+e+'"]')?this.element.querySelector('[data-mappingname="'+e+'"]').parentElement:null},e.prototype.onGroupAggregates=function(e){if(this.parent.groupSettings.enableLazyLoading)"Batch"!==this.parent.editSettings.mode&&this.updateLazyLoadGroupAggregates(e);else{var t=this.iterateGroupAggregates(e),i=this.groupGenerator.generateRows(t,{}),n=this.parent.getRowsObject().filter(function(e){return!e.isDataRow}),r=i.filter(function(e){return!e.isDataRow});(this.parent.isReact||this.parent.isVue)&&this.parent.destroyTemplate(["groupFooterTemplate","groupCaptionTemplate","footerTemplate"]);for(var s=0;s<r.length;s++){var o=r[parseInt(s.toString(),10)],a={cells:o.cells.filter(function(e){return e.isDataCell}),data:o.data,dataUid:n[parseInt(s.toString(),10)]?n[parseInt(s.toString(),10)].uid:""};this.parent.notify(at,a)}}},e.prototype.updateLazyLoadGroupAggregates=function(e,t){var i=this,n=this.getGroupAggregateTemplates(!0),r=this.getGroupAggregateTemplates(!1);if(n.length||r.length)for(var s=this.parent,o=s.getDataModule().isRemote(),a=e[0],l=e.row,h=s.groupSettings.columns,d=s.contentModule,p=d.getGroupCache()[s.pageSettings.currentPage],c=t||[],u=function(t){var u=h[parseInt(t.toString(),10)],f=a[""+u],m=g.getGroupCaptionRowObject(l,h.length-t);if(o&&c.length){if(0!==t){var y=h[t-1],v=a[""+y];c=c.find(function(e){return e.key===v}).items}g.updateLazyLoadGroupAggregatesRow(c,f,m,p,n,r)}else{var S=s.renderModule.data.generateQuery();if(0!==t){var C=p.filter(function(e){return e.isCaptionRow&&e.parentUid===m.parentUid}),w=C.indexOf(m),b=s.groupSettings.columns.slice(0,t).reverse(),I=b.map(function(e){return a[""+e]}),x=zh(Bh(b,I,d)),R={level:t,skip:w,take:1,where:x};S.lazyLoad.push({key:"onDemandGroupInfo",value:R})}if(s.renderModule.data.getData({},S).then(function(s){o?i.updateLazyLoadGroupAggregates(e,s.result):i.updateLazyLoadGroupAggregatesRow(s.result,f,m,p,n,r),(t===h.length-1||o)&&i.destroyRefreshGroupCaptionFooterTemplate()}).catch(function(e){return s.renderModule.dataManagerFailure(e,{requestType:"grouping"})}),o)return"break"}},g=this,f=0;f<h.length;f++){if("break"===u(f))break}},e.prototype.destroyRefreshGroupCaptionFooterTemplate=function(){var e=this.parent;(e.isAngular||e.isReact||e.isVue)&&e.destroyTemplate(["groupCaptionTemplate","groupFooterTemplate"]),e.refreshGroupCaptionFooterTemplate(),e.removeMaskRow(),e.hideSpinner()},e.prototype.updateLazyLoadGroupAggregatesRow=function(e,t,i,n,r,s){var o=e.find(function(e){return e.key===t});if(r.length&&this.updateLazyLoadGroupAggregatesCell(o,i,r),s.length){var a=n.find(function(e){return e.isAggregateRow&&e.parentUid===i.uid});this.updateLazyLoadGroupAggregatesCell(o,a,s)}},e.prototype.updateLazyLoadGroupAggregatesCell=function(e,t,i){var n=t.data,r=e.aggregates;t.isCaptionRow&&(n.aggregates=r);for(var s=0;s<i.length;s++){var o=i[parseInt(s.toString(),10)],a=o.field+" - "+o.type,l=n[o.field];l[""+a]=r[""+a],l[Hh(o.type)]=r[""+a],l[o.type]&&(l[o.type]=r[""+a])}},e.prototype.getGroupCaptionRowObject=function(e,t){for(var i=this.parent,n=e.getAttribute("data-uid"),r=i.getRowObjectFromUID(n),s=0;s<t;s++)r=i.getRowObjectFromUID(r.parentUid);return r},e.prototype.getGroupAggregateTemplates=function(e){for(var t=[],i=this.parent.aggregates,n=0;n<i.length;n++)for(var r=i[parseInt(n.toString(),10)],s=0;s<r.columns.length;s++)if(e&&r.columns[parseInt(s.toString(),10)].groupCaptionTemplate||!e&&r.columns[parseInt(s.toString(),10)].groupFooterTemplate){var o;o={type:r.columns[parseInt(s.toString(),10)].type.toString().toLowerCase(),field:r.columns[parseInt(s.toString(),10)].field},t.push(o)}return t},e.prototype.groupedRowReorder=function(e,t){var i=this.parent.getRowElementByUID(e.uid),n=this.parent.getRowElementByUID(t.uid),r={rows:[i],target:n,fromIndex:e.index,dropIndex:t.index};if(!(0,o.isNullOrUndefined)(e)&&!(0,o.isNullOrUndefined)(t)&&e.parentUid!==t.parentUid){n?("none"===n.style.display&&(i.style.display="none"),r.fromIndex>r.dropIndex?this.parent.getContentTable().querySelector(Ds).insertBefore(i,n):this.parent.getContentTable().querySelector(Ds).insertBefore(i,n.nextSibling)):(0,o.remove)(i),this.groupReorderHandler(e,t);var s=[].slice.call(this.parent.getContentTable().getElementsByClassName(us));nh(this.parent,r,s,t),this.parent.enableVirtualization?ih(this.parent):th(this.parent,this.parent.getRowsObject().filter(function(e){return e.isDataRow}),s),this.parent.notify(dr,{rows:this.parent.getRowsObject()})}},e.prototype.groupReorderHandler=function(e,t){for(var i=this.parent,n=e.data,r=t.data,s=i.groupModule.getGroupAggregateTemplates(!1),a=i.getRowObjectFromUID(t.parentUid),l=i.getRowObjectFromUID(e.parentUid),h=[a],d=[l],p=i.groupSettings.columns,c=0;c<p.length;c++)n[p[parseInt(c.toString(),10)]]=r[p[parseInt(c.toString(),10)]],c>0&&(h.push(i.getRowObjectFromUID(h[c-1].parentUid)),d.push(i.getRowObjectFromUID(d[c-1].parentUid)));e.parentUid=t.parentUid,e.visible=t.visible,e.parentGid=t.parentGid,e.changes!==n&&(e.changes=n);var u=this.iterateGroupAggregates([{dragRowObjects:d,dropRowObjects:h}]),g=u.filter(function(e){return e.key===d[d.length-1].data.key||e.key instanceof Date&&e.key.toString()===d[d.length-1].data.key.toString()}),f=u.filter(function(e){return e.key===h[h.length-1].data.key||e.key instanceof Date&&e.key.toString()===h[h.length-1].data.key.toString()});u=[],(0,o.isNullOrUndefined)(g[0])||u.push(g[0]),(0,o.isNullOrUndefined)(f[0])||u.push(f[0]);for(var m=i.currentViewData,y=0;y<m.length;y++)(0,o.isNullOrUndefined)(g[0])&&m[parseInt(y.toString(),10)].key===d[d.length-1].data.key||(0,o.isNullOrUndefined)(f[0])&&m[parseInt(y.toString(),10)].key===h[h.length-1].data.key?(m.splice(y,1),y--):(0,o.isNullOrUndefined)(g[0])||m[parseInt(y.toString(),10)].key!==g[0].key?(0,o.isNullOrUndefined)(f[0])||m[parseInt(y.toString(),10)].key!==f[0].key||(m[parseInt(y.toString(),10)]=f[0]):m[parseInt(y.toString(),10)]=g[0];var v=this.groupGenerator.generateRows(u,{}),S=[],C=[];for(y=0;y<d.length;y++)S.push.apply(S,this.getGroupParentFooterAggregateRowObject(d[parseInt(y.toString(),10)].uid));for(y=0;y<h.length;y++)C.push.apply(C,this.getGroupParentFooterAggregateRowObject(h[parseInt(y.toString(),10)].uid));d.push.apply(d,S),h.push.apply(h,C),this.updatedRowObjChange(d,v,s,!0),this.updatedRowObjChange(h,v,s),this.groupReorderRefreshHandler(d),this.groupReorderRefreshHandler(h)},e.prototype.updatedRowObjChange=function(e,t,i,n){var r=this.parent,s=r.getRowsObject(),a={},l=[];r.enableVirtualization&&(a=r.contentModule.vgenerator.cache,l=r.vcRows);for(var h=0;h<e.length;h++){for(var d=!1,p=e[parseInt(h.toString(),10)],c=0;c<t.length;c++){var u=t[parseInt(c.toString(),10)];if(!((0,o.isNullOrUndefined)(u)||(0,o.isNullOrUndefined)(p.data.key)||(0,o.isNullOrUndefined)(u.data.key))&&(p.data.key===u.data.key||p.data.key instanceof Date&&p.data.key.toString()===u.data.key.toString())){var g=!0,f=e[parseInt((h+1).toString(),10)];if(n&&f&&!f.isAggregateRow){var m=f.data.key.toString(),y=f.data.field,v=u.data.items.records?u.data.items.records:u.data.items;v&&v.length&&v[0][""+y]&&v[0][""+y].toString()!==m&&(g=!1)}if(!g&&n)continue;if(-1!==(C=s.indexOf(p))&&(s[parseInt(C.toString(),10)].data=u.data,s[parseInt(C.toString(),10)].gSummary=u.gSummary),r.enableVirtualization)-1!==(w=l.indexOf(p))&&(l[parseInt(w.toString(),10)].data=u.data,l[parseInt(w.toString(),10)].gSummary=u.gSummary);p.data=u.data,p.gSummary=["gSummary"],t.splice(c,1),c--,d=!0;break}if(p.isAggregateRow&&u.isAggregateRow){for(var S=0;S<i.length;S++)if(this.evaluateGroupAggregateValueChange(p,u,i[parseInt(S.toString(),10)])){var C,w;if(-1!==(C=s.indexOf(p))&&(s[parseInt(C.toString(),10)].data=u.data,s[parseInt(C.toString(),10)].gSummary=u.gSummary),r.enableVirtualization)-1!==(w=l.indexOf(p))&&(l[parseInt(w.toString(),10)].data=u.data,l[parseInt(w.toString(),10)].gSummary=u.gSummary);p.data=u.data,p.gSummary=u.gSummary,d=!0;break}if(d)break}}if(!d){var b=r.getRowElementByUID(p.uid);if((0,o.isNullOrUndefined)(b)||(0,o.remove)(b),s.splice(s.indexOf(p),1),r.enableVirtualization){l.splice(l.indexOf(p),1);for(var I=1;I<=Object.keys(a).length;I++){var x=a[parseInt(I.toString(),10)].indexOf(p);-1!==x&&a[parseInt(I.toString(),10)].splice([parseInt(x.toString(),10)],1)}}r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache&&r.infiniteScrollModule.resetInfiniteCache(s)}}},e.prototype.groupReorderRefreshHandler=function(e){for(var t=this.parent,i=new js(t.serviceLocator,null,t),n=t.getColumns(),r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)];(0,o.isNullOrUndefined)(s.uid)||(0,o.isNullOrUndefined)(t.getRowElementByUID(s.uid))||i.refresh(s,n,!1)}},e.prototype.getGroupParentFooterAggregateRowObject=function(e){for(var t=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&this.parent.groupSettings.columns.length?this.parent.contentModule.rows:this.parent.getRowsObject(),i=[],n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)];r.parentUid===e&&r.isAggregateRow&&i.push(r)}return i},e.prototype.evaluateGroupAggregateValueChange=function(e,t,i){var n=!1;return e.data[i.field].field===t.data[i.field].field&&e.data[i.field].key===t.data[i.field].key&&e.data[i.field].hasOwnProperty(i.field+" - "+i.type)&&t.data[i.field].hasOwnProperty(i.field+" - "+i.type)&&(n=!0),n},e.prototype.gettingVirtualData=function(e,t,i){for(var n=[],r=function(r){if(-1===t.indexOf(e[parseInt(r.toString(),10)].data)&&n.push(e[parseInt(r.toString(),10)].data),e[parseInt(r.toString(),10)].data.field===s.parent.groupSettings.columns[0]){var a=e[parseInt(r.toString(),10)].data.items;(0,o.isNullOrUndefined)(a.records)||(a=a.records);for(var l=function(e){i&&-1===t.findIndex(function(t){return t[i.toString()]===a[parseInt(e.toString(),10)][i.toString()]})&&n.push(a[parseInt(e.toString(),10)])},h=0;h<a.length;h++)l(h)}},s=this,a=0;a<e.length;a++)r(a);return n},e.prototype.iterateGroupAggregates=function(e){var t=this,i=e instanceof Array?e:[],n=this.parent.getRowsObject(),r=this.parent.getCurrentViewRecords().slice(),s=this.parent.getPrimaryKeyFieldNames()[0],l=e&&e.length?e[0]&&e[0].dragRowObjects:null,h=e&&e.length?e[0]&&e[0].dropRowObjects:null,d=null,p=null;!(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)||(0,o.isNullOrUndefined)(l)&&(0,o.isNullOrUndefined)(h)||(l&&r.push.apply(r,this.gettingVirtualData(l,r,s)),h&&r.push.apply(r,this.gettingVirtualData(h,r,s)));var c=this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&e.length&&this.parent.groupSettings.columns.length&&!(0,o.isNullOrUndefined)(l)&&!(0,o.isNullOrUndefined)(h);c&&(r=[],d=h[h.length-1].data.key,p=l[l.length-1].data.key,this.parent.getRowsObject().map(function(e){var i=e.data[t.parent.groupSettings.columns[0]];e.isDataRow&&(i===d||i===p||i instanceof Date&&(i.toString()===d.toString()||i.toString()===p.toString()))&&r.push(e.data)}));var u=[],g=n.map(function(e){return"delete"===e.edit&&u.push(e.data),e.changes instanceof Object?e.changes:e.data});g=0===i.length?g:i;var f=r.map(function(e){var t,i=a.DataUtil.getObject(s,e);return g.some(function(e){return t=e,i===a.DataUtil.getObject(s,e)})?t:e}),m=e;if((!m.type||"cancel"!==m.type)&&u.length>0)for(var y=0;y<u.length;y++){var v=f.indexOf(u[parseInt(y.toString(),10)]);f.splice(v,1)}for(var S,C,w=[],b=this.parent.aggregates,I=0;I<b.length;I++)for(var x=b[parseInt(I.toString(),10)],R=0;R<x.columns.length;R++)for(var D={},T=0,E=x.columns[parseInt(R.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});T<E.length;T++){D={type:E[T].toLowerCase(),field:x.columns[parseInt(R.toString(),10)].field},w.push(D)}for(var O=this.parent.groupSettings.columns,k=0;k<O.length;k++)C=S||f,S=a.DataUtil.group(C,O[parseInt(k.toString(),10)],w,null,null);if(c){var A=this.parent.currentViewData[this.parent.currentViewData.length-1].key;if(A instanceof Date&&(A.toString()===d.toString()||A.toString()===p.toString())||A===d||A===p){var F=[];for(y=0;y<S.length;y++)F.push(S[parseInt(y.toString(),10)]);var M=[],L=this.parent.getDataModule().generateQuery(!0);!function(e){for(var i=0;i<F.length;i++)M.push(new a.Predicate("field","==",F[parseInt(i.toString(),10)].field).and(t.parent.renderModule.getPredicate("key","equal",F[parseInt(i.toString(),10)].key)));e.where(a.Predicate.or(M))}(L);var P=this.parent.getDataModule().dataManager.executeLocal(L);this.parent.renderModule.updateGroupInfo(S,P)}}return S},e.prototype.updateExpand=function(e){for(var t=e.uid,i=e.isExpand,n=this.parent.getRowsObject(),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)];if(s.uid===t||(0,o.isNullOrUndefined)(t)){s.isExpand=i;for(var a=function(e){var i=n[parseInt(e.toString(),10)],r=void 0;if(i.parentUid!==s.uid&&(r=n.filter(function(e){return e.uid===i.parentUid})[0]),i.parentUid===s.uid?i.visible=s.isExpand:(0,o.isNullOrUndefined)(r)||i.parentUid!==r.uid||(r.isExpand&&!0===r.visible?i.visible=!0:r.isExpand&&!1===r.visible&&(i.visible=!1)),(0,o.isNullOrUndefined)(t))return"break"},l=r+1;l<n.length;l++){if("break"===a(l))break}}}this.parent.notify(Ne,{rows:n,args:{isFrozen:!1,rows:n}})},e}(),Ed=function(){function e(e,t){this.aria=new eo,this.childRefs=[],this.parent=e,this.serviceLocator=t,this.focus=t.getService("focus"),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(o.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this),this.parent.on(St,this.clickHandler,this),this.parent.on(Ct,this.destroy,this),this.parent.on(vt,this.keyPressHandler,this),this.parent.on(Bi,this.expand,this),this.parent.on(wt,this.refreshColSpan,this),this.parent.on(Ct,this.destroyChildGrids,this),this.parent.on(Tr,this.destroyChildGrids,this),this.parent.on(Ct,this.detachDetailTemplate,this),this.parent.on(Yr,this.detachDetailTemplate,this))},e.prototype.clickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||e.preventDefault(),this.toogleExpandcollapse((0,o.closest)(e.target,"td"),e)},e.prototype.auxilaryclickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||1!==e.button||e.preventDefault()},e.prototype.toogleExpandcollapse=function(e,i){this.l10n=this.serviceLocator.getService("localization");var n,r=this.parent,s=this.parent.getContentTable(),a=this.parent.getCurrentViewRecords().length-1,l=e&&e.classList.contains("e-detailrowcollapse");if(!(!e||!e.classList.contains("e-detailrowcollapse")&&!e.classList.contains("e-detailrowexpand")||e&&e.classList.contains("e-masked-cell"))){var h=e.parentElement,d=h.getAttribute("data-uid"),p=r.getRowObjectFromUID(d);if(!(0,o.isNullOrUndefined)(p)){var c=!1,u=this.parent.getContentTable().querySelector(Ds).children[h.rowIndex+1];if(e.classList.contains("e-detailrowcollapse")){var g=p.data,f={rowData:g,parentRow:e.closest("tr"),cancel:!1,detailRow:this.isDetailRow(u)?u:null};if((0,o.isNullOrUndefined)(i)||(f.event=i),!(0,o.isNullOrUndefined)(r.childGrid)&&(f.childGrid=r.childGrid,this.isDetailRow(u))){var m=u.querySelector(".e-grid");f.childGridInstance=m?m.ej2_instances[0]:null}if(r.trigger(J,f),f.cancel)return;if(this.isDetailRow(u))u.style.display="",r.notify(an,{data:g,childGrid:r.childGrid,detailElement:e,isExpanded:l}),c=!0;else if(r.getDetailTemplate()||r.childGrid){var y=Za("grid-row"),v=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":y,role:"row"}}),S=this.parent.createElement("th",{className:"e-detailcell",attrs:{scope:"col",role:"columnheader"}}),C=this.parent.getVisibleColumns().length;this.parent.allowRowDragAndDrop&&C++,S.setAttribute("colspan",C.toString());var w=new $r({isDataRow:!0,isExpand:!0,uid:y,isDetailRow:!0,cells:[new es({cellType:t.Indent}),new es({isDataCell:!0,visible:!0})]});w.parentUid=p.uid;for(var b=0,I=r.groupSettings.columns.length;b<I;b++)v.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),w.cells.unshift(new es({cellType:t.Indent}));v.appendChild(this.parent.createElement("th",{className:"e-detailindentcell",attrs:{scope:"col"}})),v.appendChild(S),h.parentNode.insertBefore(v,h.nextSibling);var x=void 0,R=void 0;if(r.detailTemplate){x=this.parent.isReact&&"string"!=typeof r.detailTemplate&&!(r.detailTemplate.prototype&&r.detailTemplate.prototype.CSPTemplate),R=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;var D=this.parent.printGridParent&&this.parent.printGridParent.isReact,T=r.element.id+"detailTemplate";x||R||D?(r.getDetailTemplate()(g,r,"detailTemplate",T,null,null,S),this.parent.renderTemplates(function(){r.trigger(Y,{detailElement:S,data:g,childGrid:n})})):$a(S,r.getDetailTemplate()(g,r,"detailTemplate",T,void 0,void 0,void 0,this.parent.root))}else{(n=new Ia(this.getGridModel(r,p,r.printMode))).height=r.enableInfiniteScrolling&&"auto"===n.height?300:n.height,n.root=r.root?r.root:r,this.childRefs.push(n),n.query&&(n.query=n.query.clone()),n.parentDetails={parentID:r.element.id,parentPrimaryKeys:r.getPrimaryKeyFieldNames(),parentKeyField:r.childGrid.queryString,parentKeyFieldValue:r.childGrid.queryString&&hl(r.childGrid.queryString)?Ml(r.childGrid.queryString,g):g[r.childGrid.queryString],parentRowData:g},r.isReact||r.isVue?n.parentDetails.parentInstObj=r:r.parentDetails&&r.parentDetails.parentInstObj&&(r.parentDetails.parentInstObj.isReact||r.parentDetails.parentInstObj.isVue)&&(n.parentDetails.parentInstObj=r.parentDetails.parentInstObj),r.printGridParent&&r.printGridParent.isReact&&(n.printGridParent=r.printGridParent),n.isLegacyTemplate=r.isReact||r.isLegacyTemplate,r.isPrinting&&(n.isPrinting=!0,n.on(Ne,this.promiseResolve(n),this),n.on(ze,this.promiseResolve(n),this)),p.childGrid=n;var E=n.getInjectedModules(),O=r.getInjectedModules();E&&E.length===O.length||n.setInjectedModules(O);var k=this.parent.createElement("div",{id:"child"+el(h,"e-grid").length+"_grid"+h.rowIndex+Za(""),className:"e-childgrid"});S.appendChild(k),n.appendTo(k)}v.appendChild(S),h.nextSibling?h.parentNode.insertBefore(v,h.nextSibling):h.parentNode.appendChild(v);var A=r.getRows(),F=r.getRowsObject();if(A.splice(A.indexOf(h)+1,0,v),r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache){var M=r.contentModule.infiniteCache,L=Object.keys(M);for(b=0;b<L.length;b++){var P=M[parseInt(L[parseInt(b.toString(),10)],10)].indexOf(p);if(-1!==P){M[parseInt(L[parseInt(b.toString(),10)],10)].splice(P+1,0,w);break}}}else F.splice(F.indexOf(p)+1,0,w);x&&R||r.trigger(Y,{detailElement:S,data:g,childGrid:n}),r.notify(Y,{rows:F})}if((0,o.classList)(e,["e-detailrowexpand"],["e-detailrowcollapse"]),(0,o.classList)(e.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),p.isExpand=!0,e.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>s.scrollHeight){(0,o.removeClass)(e.parentElement.querySelectorAll("td"),"e-lastrowcell");var N=s.querySelector(Ds).getElementsByClassName("e-detailrow").length-1;(0,o.addClass)(s.querySelector(Ds).getElementsByClassName("e-detailrow")[parseInt(N.toString(),10)].childNodes,["e-lastrowcell"]),this.lastrowcell=!0}this.aria.setExpand(e,!0),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))}else{if(this.isDetailRow(u)){var B={rowData:p.data,parentRow:e.closest("tr"),cancel:!1,detailRow:this.isDetailRow(u)?u:null};if((0,o.isNullOrUndefined)(i)||(B.event=i),!(0,o.isNullOrUndefined)(r.childGrid)&&(B.childGrid=r.childGrid,this.isDetailRow(u))){m=u.querySelector(".e-grid");B.childGridInstance=m?m.ej2_instances[0]:null}if(r.trigger(Z,B),B.cancel)return;u.style.display="none",r.notify(an,{data:p.data,childGrid:r.childGrid,detailElement:e,isExpanded:l})}(0,o.classList)(e,["e-detailrowcollapse"],["e-detailrowexpand"]),(0,o.classList)(e.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(h.getAttribute(Rs),10)-1===a&&this.lastrowcell&&((0,o.addClass)(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),p.isExpand=!1,c=!0,this.aria.setExpand(e,!1),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed"))}(!(0,o.isNullOrUndefined)(r.detailTemplate)||r.childGrid&&c)&&(r.updateVisibleExpandCollapseRows(),r.notify(dr,{rows:r.getRowsObject()})),this.parent.allowTextWrap&&"auto"===this.parent.height&&(this.parent.getContentTable().scrollHeight>this.parent.getContent().clientHeight?this.parent.scrollModule.setPadding():this.parent.scrollModule.removePadding())}}},e.prototype.getGridModel=function(e,t,i){var n;return e.isPrinting&&t.isExpand&&e.expandedRows&&e.expandedRows[t.index]&&e.expandedRows[t.index].gridModel?(e.expandedRows[t.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,n=(0,o.extend)({},e.expandedRows[t.index].gridModel,e.childGrid,!0)):n=(0,o.extend)({},{},e.childGrid,!0),e.isPrinting&&e.childGrid.allowPaging&&(n.allowPaging="CurrentPage"===i),n},e.prototype.promiseResolve=function(e){var t=this;return function(){e.off(Ne,t.promiseResolve),e.off(ze,t.promiseResolve),e.notify(Ni,{})}},e.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},e.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(o.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler),this.parent.off(St,this.clickHandler),this.parent.off(Ct,this.destroy),this.parent.off(vt,this.keyPressHandler),this.parent.off(Bi,this.expand),this.parent.off(wt,this.refreshColSpan),this.parent.off(Ct,this.destroyChildGrids),this.parent.off(Tr,this.destroyChildGrids),this.parent.off(Ct,this.detachDetailTemplate),this.parent.off(Yr,this.detachDetailTemplate))},e.prototype.getTDfromIndex=function(e,t){var i=(0,o.isNullOrUndefined)(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];return i&&i.querySelector(t)?i.querySelector(t):null},e.prototype.expand=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowcollapse")),e&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},e.prototype.collapse=function(e){isNaN(e)||(e=this.getTDfromIndex(e,".e-detailrowexpand")),e&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},e.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(D,{requestType:"expandAllComplete",type:D,moduleObj:this})},e.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(D,{requestType:"collapseAllComplete",type:D,moduleObj:this})},e.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),n=0,r=i.length;n<r;n++)t=i[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},e.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"altUpArrow":case"altDownArrow":var i=t.allowSelection?t.getSelectedRowIndexes():[];if(i.length){var n=t.getDataRows()[i[i.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand");"altDownArrow"===e.action?this.expand(n):this.collapse(n)}break;case"enter":if(this.parent.isEdit)return;var r=this.focus.getFocusedElement();if(r&&(r.classList.contains("e-icon-grightarrow")||r.classList.contains("e-icon-gdownarrow"))&&(r=r.parentElement),r&&!r.classList.contains("e-detailrowcollapse")&&!r.classList.contains("e-detailrowexpand"))break;this.toogleExpandcollapse(r,e)}},e.prototype.refreshColSpan=function(){for(var e=this.parent.contentModule.getTable().querySelectorAll("tr.e-detailrow"),t=this.parent.getVisibleColumns().length,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].querySelector(".e-detailcell").setAttribute("colspan",t+"")},e.prototype.destroyChildGrids=function(e){var t=this.parent;if(t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&"infiniteScroll"===e.requestType&&t.infiniteScrollSettings.enableCache){var i="down"===e.direction?e.currentPage-t.infiniteScrollSettings.initialBlocks:e.currentPage+t.infiniteScrollSettings.initialBlocks,n=t.contentModule.infiniteCache[parseInt(i.toString(),10)],r=n.filter(function(e){return e.isDetailRow&&e.parentUid});if(t.childGrid)for(var s=function(e){var i=t.getContentTable().querySelector('[data-uid="'+r[parseInt(e.toString(),10)].uid+'"]'),s=i.querySelector(".e-childgrid"),a=o.childRefs.findIndex(function(e){return e.element.id===s.id});o.childRefs[parseInt(a.toString(),10)].isDestroyed||(o.childRefs[parseInt(a.toString(),10)].destroy(),o.childRefs.splice(a,1));var l=n.indexOf(r[parseInt(e.toString(),10)]);n.splice(l,1),n[l-1].childGrid=null,n[l-1].isExpand=!1,i.remove()},o=this,a=0;a<r.length;a++)s(a);if(t.detailTemplate&&r.length){var l=[],h=function(e){l.push({detailRow:t.getContentTable().querySelector('[data-uid="'+r[parseInt(e.toString(),10)].uid+'"]'),detailRowObject:r[parseInt(e.toString(),10)],parentRowObject:n.find(function(t){return r[parseInt(e.toString(),10)].parentUid===t.uid})})};for(a=0;a<r.length;a++)h(a);this.parent.trigger(Xr,l,function(){for(var e=0;e<r.length;e++){var i=t.getContentTable().querySelector('[data-uid="'+r[parseInt(e.toString(),10)].uid+'"]'),s=n.indexOf(r[parseInt(e.toString(),10)]);n.splice(s,1),n[s-1].isExpand=!1,i.remove()}})}}else{var d=this.parent.getRowsObject();for(a=0;a<d.length;a++)d[parseInt(a.toString(),10)].childGrid=null;for(a=0;a<this.childRefs.length;a++)this.childRefs[parseInt(a.toString(),10)].isDestroyed||this.childRefs[parseInt(a.toString(),10)].destroy();this.childRefs=[]}},e.prototype.detachDetailTemplate=function(){var e=this.parent;if(e.detailTemplate){var t=e.getRowsObject(),i=t.filter(function(e){return e.isDetailRow&&e.parentUid});if(i.length){var n=[];i.map(function(i){n.push({detailRow:e.getContentTable().querySelector('[data-uid="'+i.uid+'"]'),detailRowObject:i,parentRowObject:t.find(function(e){return i.parentUid===e.uid})})}),e.trigger(Xr,n,function(){i.map(function(t){e.getContentTable().querySelector('[data-uid="'+t.uid+'"]').remove()})})}}},e.prototype.getModuleName=function(){return"detailRow"},e}(),Od=function(){function e(e,t){this.predefinedItems={},this.isSearched=!1,this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.isRightToolbarMenu=!1,this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization");for(var e=this.parent.enableAdaptiveUI,t=["Edit","Delete","Update","Cancel"],i=0,n=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport"];i<n.length;i++){var r=n[i],s=r.toLowerCase(),a=s[0].toUpperCase()+s.slice(1);this.predefinedItems[""+r]={id:this.gridID+"_"+s,prefixIcon:"e-"+s,text:this.l10n.getConstant(a),tooltipText:this.l10n.getConstant(a)},e&&(this.predefinedItems[""+r].text="",this.predefinedItems[""+r].visible=-1===t.indexOf(r))}this.predefinedItems.Search={id:this.gridID+"_search",tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper",type:"Input"},this.isRightToolbarMenu=!1,this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!0)&&("Horizontal"===this.parent.rowRenderingMode||"Vertical"===this.parent.rowRenderingMode&&!this.parent.allowFiltering&&!this.parent.allowSorting)&&(this.isRightToolbarMenu=!0),e&&this.isResponsiveToolbarMenuItems(!1)?this.predefinedItems.responsiveToolbarItems={id:this.gridID+"_responsivetoolbaritems",cssClass:"e-responsive-toolbar-items e-menu-toolbar",suffixIcon:"e-responsivetoolbaritems-btn",align:this.isRightToolbarMenu?"Left":"Right"}:this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:e?"":this.l10n.getConstant("Columnchooser"),tooltipText:this.l10n.getConstant("Columnchooser"),align:"Right"},"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&(this.predefinedItems.responsiveFilter={id:this.gridID+"_responsivefilter",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resfilter-icon",tooltipText:this.l10n.getConstant("FilterIcon")}),this.parent.allowSorting&&(this.predefinedItems.responsiveSort={id:this.gridID+"_responsivesort",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-ressort-icon",tooltipText:this.l10n.getConstant("SortIcon")})),this.parent.enableAdaptiveUI&&this.parent.toolbar&&this.parent.toolbar.some(function(e){return"object"==typeof e&&"Search"===e.text||"Search"===e})&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon",visible:!1}),this.createToolbar(),this.parent.enableAdaptiveUI&&((0,o.isNullOrUndefined)(this.responsiveToolbarMenu)&&this.renderResponsiveToolbarpopup(),this.toolbar.element&&this.toolbar.refreshOverflow())},e.prototype.isResponsiveToolbarMenuItems=function(e){for(var t=e?["Add","Edit","Delete","Search"]:["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"],i=this.parent.toolbar||[],n=0;n<t.length;n++)if(i.indexOf(t[parseInt(n.toString(),10)])>=0)return!e;return!!e},e.prototype.getToolbar=function(){return this.toolbar.element},e.prototype.destroy=function(){if(this.toolbar&&!this.toolbar.isDestroyed){if(this.responsiveToolbarMenu&&this.responsiveToolbarMenu.destroy(),this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.unWireEvent(),this.removeEventListener(),this.toolbar.created=null,this.toolbar.clicked=null,this.toolbar.element?this.toolbar.destroy():(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.parent.isAngular){this.toolbar.viewContainerRef=null,this.toolbar.registeredTemplate=null}this.element.parentNode&&((0,o.remove)(this.element),this.toolbar=null)}},e.prototype.bindSearchEvents=function(){this.searchElement=(0,o.select)("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},e.prototype.toolbarCreated=function(e){if(this.element.querySelector(".e-search-wrapper")){if(!this.parent.enableAdaptiveUI||e){var t=this.parent.cssClass?"e-input-group e-search "+this.parent.cssClass:"e-input-group e-search";this.element.querySelector(".e-search-wrapper").innerHTML='<div class="'+t+'" role="search"> <input id="'+this.gridID+'_searchbar" class="e-input e-search" name="input" type="search" placeholder= "'+this.l10n.getConstant("Search")+'"/> <span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon" tabindex="-1" aria-label= "clear" role= "button" ></span> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" role= "search"></span> </div>'}else this.element.querySelector(".e-search-wrapper").innerHTML='<span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon" tabindex="-1" role= "button" aria-label= "clear" ></span> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" role= "button" title="'+this.l10n.getConstant("Search")+'"></span> </div>';this.element.querySelector("#"+this.gridID+"_clearbutton").style.cursor="default"}this.element.querySelector(".e-responsive-toolbar-items")&&(this.element.querySelector(".e-responsive-toolbar-items").innerHTML='<button id="'+this.gridID+'_responsivetoolbaritems" class="e-tbar-btn e-control e-btn e-lib e-icon-btn" type="button" data-ripple="true" tabindex="-1" data-tabindex="-1" aria-label="responsivetoolbaritems" aria-disabled="false" ><span class="e-btn-icon e-responsivetoolbaritems-btn e-icons"></span>',this.element.querySelector("#"+this.gridID+"_responsivetoolbaritems").style.width="auto"),this.bindSearchEvents()},e.prototype.createToolbar=function(){var e=this.getItems();this.toolbar=new Zh.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this),cssClass:this.parent.cssClass?this.parent.cssClass:""}),this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this);this.toolbar.isStringTemplate=!0;var t="viewContainerRef";if(this.parent[""+t]&&(this.toolbar.registeredTemplate={},this.toolbar[""+t]=this.parent[""+t]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&this.element.classList.add("e-res-toolbar"),this.parent.toolbarTemplate){var i=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue;if("string"!=typeof this.parent.toolbarTemplate||i&&!document.querySelectorAll(this.parent.toolbarTemplate).length||!document.querySelector(this.parent.toolbarTemplate)||"script"===document.querySelector(this.parent.toolbarTemplate).tagName.toLowerCase()){var n=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate&&!(this.parent.toolbarTemplate.prototype&&this.parent.toolbarTemplate.prototype.CSPTemplate),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s=this.parent.element.id+"toolbarTemplate";n||r?(za(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",s,null,null,this.element),this.parent.renderTemplates()):$a(this.element,za(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",null,null,null,null,this.parent.root))}else this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element;this.element.classList.add("e-temp-toolbar")}else this.toolbar.appendTo(this.element);this.parent.element.insertBefore(this.element,this.parent.getHeaderContent());var o=this.element.querySelector(".e-toolbar-left"),a=this.element.querySelector(".e-toolbar-center"),l=this.element.querySelector(".e-toolbar-right"),h=this.element.querySelector(".e-toolbar-items"),d=this.element,p=o?o.clientWidth:0,c=a?a.clientWidth:0,u=l?l.clientWidth:0,g=h?h.clientWidth:0,f=d?d.clientWidth:0;(p>f||c>f||u>f||g>f)&&this.toolbar.refreshOverflow()},e.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},e.prototype.renderResponsiveSearch=function(e){if(e){this.toolbarCreated(!0),this.refreshResponsiveToolbarItems(s.isSearch),this.searchElement=(0,o.select)("#"+this.gridID+"_searchbar",this.element);var t=_a(this.searchElement,"e-toolbar-right");t&&t.classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox()}else this.refreshResponsiveToolbarItems(s.isInitial);this.toolbar.element&&this.toolbar.element.querySelector(".e-hscroll")&&this.toolbar.refreshOverflow(),e&&(this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus())},e.prototype.refreshResponsiveToolbarItems=function(e){if(e===s.isInitial){for(var t=this.parent.element.id,i=[t+"_edit",t+"_delete"],n=this.parent.getSelectedRowIndexes(),r=[t+"_responsiveback",t+"_update",t+"_cancel"],o=0,a=this.toolbar.items;o<a.length;o++){(p=(c=a[o]).template&&c.template.length?_a(this.toolbar.element.querySelector("#"+c.id),"e-template").children[0]:this.toolbar.element.querySelector("#"+c.id))&&(i.indexOf(c.id)>-1?n.length?p.parentElement.classList.remove("e-hidden"):p.parentElement.classList.add("e-hidden"):-1===r.indexOf(c.id)||r.indexOf(c.id)>0&&this.parent.isEdit?p.parentElement.classList.remove("e-hidden"):p.parentElement.classList.add("e-hidden"))}if(this.searchElement){var l=_a(this.searchElement,"e-toolbar-right");l&&l.classList.remove("e-responsive-right"),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0}}if(e===s.isSearch){i=[this.parent.element.id+"_responsiveback",this.parent.element.id+"_search"];for(var h=0,d=this.toolbar.items;h<d.length;h++){var p,c=d[h];(p=this.toolbar.element.querySelector("#"+c.id))&&(i.indexOf(c.id)>-1?p.parentElement.classList.remove("e-hidden"):p.parentElement.classList.add("e-hidden"))}}},e.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],n=[],r=t.editSettings,s=t.currentViewData&&t.currentViewData.length||"Batch"===t.editSettings.mode&&!(0,o.isNullOrUndefined)(t.editModule)&&t.editModule.getBatchChanges()[Ss].length,a=r.showAddNewRow&&!t.element.querySelector(".e-editedrow");r.allowAdding?i.push(this.gridID+"_add"):n.push(this.gridID+"_add"),r.allowEditing&&s?i.push(this.gridID+"_edit"):n.push(this.gridID+"_edit"),r.allowDeleting&&s?i.push(this.gridID+"_delete"):n.push(this.gridID+"_delete"),t.allowPdfExport&&s?i.push(this.gridID+"_pdfexport"):n.push(this.gridID+"_pdfexport"),t.allowExcelExport&&s?(i.push(this.gridID+"_excelexport"),i.push(this.gridID+"_csvexport")):(n.push(this.gridID+"_excelexport"),n.push(this.gridID+"_csvexport")),t.showColumnChooser?i.push(this.gridID+"_columnchooser"):n.push(this.gridID+"_columnchooser"),"Batch"===t.editSettings.mode?t.element.getElementsByClassName("e-updatedtd").length&&(r.allowAdding||r.allowEditing)?(i.push(this.gridID+"_update"),i.push(this.gridID+"_cancel")):(n.push(this.gridID+"_update"),n.push(this.gridID+"_cancel")):(t.isEdit||r.showAddNewRow)&&(r.allowAdding||r.allowEditing)?(i=a?[this.gridID+"_update",this.gridID+"_cancel",this.gridID+"_edit",this.gridID+"_delete"]:[this.gridID+"_update",this.gridID+"_cancel"],n=a?[this.gridID+"_add"]:[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(n.push(this.gridID+"_update"),n.push(this.gridID+"_cancel")),this.enableItems(i,!0),this.enableItems(n,!1)},e.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&e.push(this.getItemObject("responsiveFilter")),this.parent.allowSorting&&e.push(this.getItemObject("responsiveSort")));for(var i=0,n=t;i<n.length;i++){var r=n[i];if(!this.parent.enableAdaptiveUI||-1===["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"].indexOf(r))switch(this.parent.enableAdaptiveUI&&("object"==typeof r&&"Search"===r.text||"Search"===r)&&e.push(this.getItemObject("responsiveBack")),typeof r){case"number":e.push(this.getItemObject(this.items[r]));break;case"string":e.push(this.getItemObject(r));break;default:e.push(this.getItem(r))}}return this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!1)&&e.push(this.getItemObject("responsiveToolbarItems")),e},e.prototype.getItem=function(e){var t=this.predefinedItems[e.text];return t?(0,o.extend)(t,t,e):e},e.prototype.getItemObject=function(e){return this.predefinedItems[""+e]||{text:e,id:this.gridID+"_"+e}},e.prototype.enableItems=function(e,t){for(var i=0,n=e;i<n.length;i++){var r=n[i],s=(0,o.select)("#"+r,this.element);s&&this.toolbar.enableItems(s.closest(".e-toolbar-item"),t)}},e.prototype.toolbarClickHandler=function(e){var t=this,i=this.parent,n=this.gridID,r=e.originalEvent;if(this.parent.enableAdaptiveUI&&e.item.id===n+"_responsivetoolbaritems")this.openResponsiveToolbarMenuPopup(r,e.item.id);else{(0,o.extend)(e,{cancel:!1});var s=e;i.trigger($,s,function(e){if(e.originalEvent=e.originalEvent?e.originalEvent:r,!e.cancel)switch(!(0,o.isNullOrUndefined)(e.item)&&e.item.id){case n+"_print":i.print();break;case n+"_edit":i.startEdit();break;case n+"_update":i.endEdit();break;case n+"_cancel":i.closeEdit();break;case n+"_add":i.addRecord();break;case n+"_delete":i.deleteRecord();break;case n+"_search":e.originalEvent.target.id===n+"_searchbutton"&&t.searchElement?t.search():!i.enableAdaptiveUI||t.searchElement||!e.originalEvent.target.classList.contains("e-search-wrapper")&&e.originalEvent.target.id!==n+"_searchbutton"?e.originalEvent.target.classList.contains("e-clear-icon")&&e.originalEvent.target.id===n+"_clearbutton"&&t.searchElement&&(t.searchElement.value="",t.searchElement&&(t.sIcon=t.searchElement.parentElement.querySelector(".e-sicon"),t.sIcon.classList.remove("e-clear-icon"),t.sIcon.removeAttribute("title"),t.sIcon.style.cursor="default"),(t.isSearched||t.parent.searchSettings.key.length)&&(t.parent.search(t.searchElement.value),t.isSearched=!1)):t.renderResponsiveSearch(!0);break;case n+"_columnchooser":if(t.parent.enableAdaptiveUI)i.showResponsiveCustomColumnChooser();else{var s=t.parent.element.querySelector(".e-ccdiv"),a=s.getBoundingClientRect().top,l=s.getBoundingClientRect().left,h=e.originalEvent.target;a=s.getBoundingClientRect().top+s.offsetTop,i.createColumnchooser(l,a,h)}break;case n+"_responsivefilter":i.notify(Ur,{action:3}),i.showResponsiveCustomFilter();break;case n+"_responsivesort":i.notify(Ur,{action:2}),i.showResponsiveCustomSort();break;case n+"_responsiveback":t.renderResponsiveSearch(!1),t.toolbar.refreshOverflow()}})}},e.prototype.openResponsiveToolbarMenuPopup=function(e,t){var i={top:0,left:0};this.toolbarMenuElement.style.cssText="display:block;visibility:hidden";var n,r=this.toolbarMenuElement.getBoundingClientRect(),s=this.parent.element.getBoundingClientRect();this.toolbarMenuElement.style.cssText="display:none;visibility:visible",n=(0,o.isNullOrUndefined)(e)?this.parent.element.querySelector("#"+t):e.target,this.parent.enableRtl?(i=(0,y.calculatePosition)(n,"left","bottom"),this.isRightToolbarMenu&&(i.left-=r.width)):(i=(0,y.calculatePosition)(n,"right","bottom"),this.isRightToolbarMenu||(i.left-=r.width),i.left+r.width+1>=s.right&&(i.left-=35)),this.responsiveToolbarMenu.open(i.top,i.left),e&&e.preventDefault&&e.preventDefault(),Vl(this.parent.element,this.responsiveToolbarMenu.element.parentElement)},e.prototype.getMenuItems=function(){for(var e=[],t=0,i=this.parent.toolbar||[];t<i.length;t++){var n=i[t];"string"!=typeof n||"ColumnChooser"!==n&&"PdfExport"!==n&&"ExcelExport"!==n&&"CsvExport"!==n&&"Print"!==n||e.push({text:this.getLocaleText(n),id:this.gridID+"_"+n.toLowerCase(),iconCss:"e-btn-icon e-"+n.toLowerCase()+" e-icons"})}return e},e.prototype.getLocaleText=function(e){var t;return"ColumnChooser"===e?t=this.l10n.getConstant("Columnchooser"):"PdfExport"===e?t=this.l10n.getConstant("Pdfexport"):"ExcelExport"===e?t=this.l10n.getConstant("Excelexport"):"CsvExport"===e?t=this.l10n.getConstant("Csvexport"):"Print"===e&&(t=this.l10n.getConstant("Print")),t},e.prototype.renderResponsiveToolbarpopup=function(){this.l10n=this.serviceLocator.getService("localization"),this.toolbarMenuElement=this.parent.createElement("ul",{id:this.gridID+"__toolbaritemsmenu",className:"e-responsivetoolbar-menu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ToolbarMenuDialogARIA")),this.parent.element.appendChild(this.toolbarMenuElement),this.responsiveToolbarMenu=new Zh.ContextMenu({cssClass:this.parent.cssClass?"e-grid-toolbarmenu e-bigger "+this.parent.cssClass:"e-grid-toolbarmenu e-bigger",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,beforeOpen:this.beforeOpenResponsiveToolbarMenuItem.bind(this),items:this.getMenuItems(),select:this.ResponsiveToolbarMenuItemClick.bind(this)}),this.responsiveToolbarMenu.isAngular=lh(this.parent),this.responsiveToolbarMenu.appendTo(this.toolbarMenuElement)},e.prototype.ResponsiveToolbarMenuItemClick=function(e){var t=this,i=this.parent,n=e.element;e.item.id=n.id;var r={cancel:!1,name:"clicked",item:e.item,originalEvent:e.event};i.trigger($,r,function(e){if(!e.cancel)switch(!(0,o.isNullOrUndefined)(e.item)&&e.item.id){case t.gridID+"_columnchooser":i.notify(Ur,{action:5}),i.showResponsiveCustomColumnChooser();break;case t.gridID+"_print":i.print()}})},e.prototype.beforeOpenResponsiveToolbarMenuItem=function(){var e=this,t=this.parent.toolbar||[],i=[{key:"PdfExport",enabled:this.parent.allowPdfExport},{key:"ExcelExport",enabled:this.parent.allowExcelExport},{key:"CsvExport",enabled:this.parent.allowExcelExport},{key:"ColumnChooser",enabled:this.parent.showColumnChooser}],n=[],r=[];i.forEach(function(i){if(-1!==t.indexOf(i.key)){var s=e.getLocaleText(i.key);i.enabled?n.push(s):r.push(s)}}),this.responsiveToolbarMenu.enableItems(n,!0),this.responsiveToolbarMenu.enableItems(r,!1)},e.prototype.modelChanged=function(e){"edit"===e.module&&this.refreshToolbarItems()},e.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&this.parent.toolbar&&(this.element&&(0,o.remove)(this.element),this.render())},e.prototype.keyUpHandler=function(e){13===e.keyCode&&(this.parent.searchModule.refreshSearch=!1,this.search()),this.searchElement&&(this.sIcon=this.searchElement.parentElement.querySelector(".e-sicon"),this.searchElement.value.length&&!(0,o.isNullOrUndefined)(this.sIcon)?(this.sIcon.classList.add("e-clear-icon"),this.sIcon.setAttribute("title",this.l10n.getConstant("Clear")),this.sIcon.style.cursor="pointer"):(this.sIcon.classList.remove("e-clear-icon"),this.sIcon.removeAttribute("title"),this.sIcon.style.cursor="default"))},e.prototype.search=function(){this.isSearched=!0,this.parent.search(this.searchElement.value)},e.prototype.updateSearchBox=function(){this.searchElement&&(this.searchElement.value=this.parent.searchSettings.key)},e.prototype.wireEvent=function(){this.searchElement&&(this.searchBoxObj=new No(this.searchElement,this.serviceLocator),o.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()),o.EventHandler.add(this.element,"focusin",this.onFocusIn,this),o.EventHandler.add(this.element,"focusout",this.onFocusOut,this)},e.prototype.unWireEvent=function(){this.searchElement&&(o.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent()),o.EventHandler.remove(this.element,"focusin",this.onFocusIn),o.EventHandler.remove(this.element,"focusout",this.onFocusOut)},e.prototype.onFocusIn=function(e){var t=this.parent.focusModule.currentInfo;t&&t.element&&((0,o.removeClass)([t.element,t.elementToFocus],["e-focused","e-focus"]),t.element.tabIndex=-1),e.target.tabIndex=0},e.prototype.onFocusOut=function(e){e.target.tabIndex=-1,e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(!e.relatedTarget||e.relatedTarget.id!==this.parent.element.id+"_clearbutton"&&e.relatedTarget.id!==this.parent.element.id+"_searchbutton")&&(this.parent.searchModule.refreshSearch=!1,this.search())},e.prototype.setFocusToolbarItem=function(e){var t=e.querySelector(".e-btn,.e-input,.e-toolbar-item-focus");!t&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.classList.contains("e-search-wrapper")&&(t=e.querySelector("#"+this.gridID+"_searchbutton")),t.focus()},e.prototype.getFocusableToolbarItems=function(){for(var e=[].slice.call(this.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)")),t=[],i=0;i<e.length;i++)(0,o.isNullOrUndefined)(e[parseInt(i.toString(),10)].querySelector(".e-btn,.e-input,.e-toolbar-item-focus"))||t.push(e[parseInt(i.toString(),10)]);return t},e.prototype.keyPressedHandler=function(e){if(e.target&&_a(e.target,"e-toolbar-item")){var t=_a(e.target,"e-toolbar-item"),i=this.getFocusableToolbarItems();if("tab"===e.action||"shiftTab"===e.action){if("tab"===e.action&&t===i[i.length-1]||"shiftTab"===e.action&&t===i[0])return;for(var n=0;n<i.length;n++)if(t===i[parseInt(n.toString(),10)]){e.preventDefault();var r="tab"===e.action?n+1:n-1;return void this.setFocusToolbarItem(i[parseInt(r.toString(),10)])}}"enter"===e.action&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.target.id===this.gridID+"_searchbutton"&&this.renderResponsiveSearch(!0)}},e.prototype.reRenderToolbar=function(){this.element&&(0,o.remove)(this.element),this.render()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:hr,handler:this.reRenderToolbar},{event:Le,handler:this.render},{event:Be,handler:this.onPropertyChanged},{event:qe,handler:this.updateSearchBox.bind(this)},{event:Ue,handler:this.refreshToolbarItems},{event:Lt,handler:this.refreshToolbarItems},{event:qe,handler:this.modelChanged},{event:E,handler:this.refreshToolbarItems},{event:St,handler:this.removeResponsiveSearch},{event:pr,handler:this.reRenderToolbar},{event:Ct,handler:this.destroy},{event:vt,handler:this.keyPressedHandler}],Rh(this.parent,this.evtHandlers,!0,this),this.rowSelectedFunction=this.rowSelected.bind(this),this.rowDeSelectedFunction=this.rowSelected.bind(this),this.parent.addEventListener(k,this.rowSelectedFunction),this.parent.addEventListener(F,this.rowDeSelectedFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(Rh(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(k,this.rowSelectedFunction),this.parent.removeEventListener(F,this.rowDeSelectedFunction))},e.prototype.removeResponsiveSearch=function(e){var t=e.target,i=t.classList.contains("e-search-icon")||t.classList.contains("e-search-wrapper");this.parent.enableAdaptiveUI&&!i&&this.searchElement&&!_a(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},e.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.toolbar.element&&(this.refreshResponsiveToolbarItems(s.isInitial),this.toolbar.refreshOverflow())},e.prototype.getModuleName=function(){return"toolbar"},e}(),kd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ad=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.aggregates={},n.parent=t,n.locator=i,n.modelGenerator=new _s(n.parent),n.addEventListener(),n}return kd(t,e),t.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:ss}),t=this.parent.createElement("div",{className:"e-summarycontent"});e.appendChild(t),this.setPanel(e),this.parent.allowPaging&&null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},t.prototype.renderTable=function(){var e=this.createContentTable("_footer_table").querySelector("."+cs),t=this.parent.createElement("tfoot");e.appendChild(t),this.setTable(e)},t.prototype.renderSummaryContent=function(e,t,i,n){var r=this.parent.dataSource instanceof Array?!this.parent.getDataModule().isRemote()&&this.parent.parentDetails?this.getData():this.parent.dataSource:this.parent.currentViewData,s=this.modelGenerator.getData(),a=(0,o.isNullOrUndefined)(i)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(i),l=(0,o.isNullOrUndefined)(i)?this.modelGenerator.generateRows(r,e||this.aggregates):this.modelGenerator.generateRows(r,e||this.aggregates,i,n),h=document.createDocumentFragment(),d=new js(this.locator,null,this.parent);d.element=this.parent.createElement("TR",{className:"e-summaryrow",attrs:{role:"row"}});for(var p=0,c=s.length;p<c;p++){var u=l[parseInt(p.toString(),10)];if(u){var g=d.render(u,a);if(g.querySelectorAll(".e-leftfreeze").length&&g.querySelectorAll(".e-indentcell").length)for(var f=g.querySelectorAll(".e-indentcell"),m=0;m<f.length;m++)f[parseInt(m.toString(),10)].classList.add("e-leftfreeze"),gh(f[parseInt(m.toString(),10)],30*m,this.parent.enableRtl,"Left");this.parent.isFrozenGrid()&&g.querySelectorAll(".e-summarycell").length&&(0,o.removeClass)([].slice.call(g.querySelectorAll(".e-summarycell")),["e-freezeleftborder","e-freezerightborder"]),h.appendChild(g)}}var y=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||y)&&s.length&&this.parent.isInitialLoad?this.parent.renderTemplates(function(){t.tFoot.innerHTML="",t.tFoot.appendChild(h)}):t.tFoot.appendChild(h),this.aggregates=(0,o.isNullOrUndefined)(e)?this.aggregates:e},t.prototype.refresh=function(e){var t=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||t)&&this.parent.isInitialLoad||(this.getTable().tFoot.innerHTML=""),this.renderSummaryContent(e,this.getTable(),void 0,void 0),(0,o.isNullOrUndefined)(e)&&this.parent.isAutoFitColumns&&this.parent.autoFitColumns(),this.onScroll()},t.prototype.refreshCol=function(){var e=this.parent.enableColumnVirtualization?this.parent.headerModule.getColGroup():this.parent.element.querySelector("."+ns).querySelector(Ts).cloneNode(!0);this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},t.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=(0,o.formatUnit)(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},t.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},t.prototype.getColFromIndex=function(e){return this.getColGroup().children[parseInt(e.toString(),10)]},t.prototype.columnVisibilityChanged=function(){this.refresh()},t.prototype.addEventListener=function(){this.evtHandlers=[{event:He,handler:this.refreshCol},{event:It,handler:this.onWidthChange},{event:bt,handler:this.onScroll},{event:wt,handler:this.columnVisibilityChanged},{event:ot,handler:this.refreshFooterRenderer}],Rh(this.parent,this.evtHandlers,!0,this)},t.prototype.removeEventListener=function(){Rh(this.parent,this.evtHandlers,!1)},t.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},t.prototype.refreshFooterRenderer=function(e){var t=this.onAggregates(e);this.refresh(t)},t.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)][""+i]===e[""+i])return n;return-1},t.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},t.prototype.onAggregates=function(e){e=e instanceof Array?e:[];var t,i=this.parent.getPrimaryKeyFieldNames()[0],n=[],r=!1,s={},l="dataSource",h=!1;if(this.parent.renderModule.data.isRemote()||!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result||!(this.parent.allowFiltering&&this.parent.filterSettings.columns.length||this.parent.searchSettings.key.length)||(h=!0),t=!(0,o.isNullOrUndefined)(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.getCurrentViewRecords():this.parent.dataSource instanceof Array?h?this.parent.getFilteredRecords():this.parent.dataSource:this.parent.dataSource[""+l].json.length?h?this.parent.getFilteredRecords():this.parent.dataSource[""+l].json:this.parent.getCurrentViewRecords(),this.parent.parentDetails&&!this.parent.getDataModule().isRemote()&&(t=this.getData()),this.parent.editModule&&(s=this.parent.editModule.getBatchChanges()),Object.keys(s).length){for(var d=0;d<t.length;d++)r=!1,s[vs].length&&this.getIndexByKey(t[parseInt(d.toString(),10)],s[vs])>-1&&(r=!0,n.push(s[vs][this.getIndexByKey(t[parseInt(d.toString(),10)],s[vs])])),s[Cs].length&&this.getIndexByKey(t[parseInt(d.toString(),10)],s[Cs])>-1?r=!0:r||n.push(t[parseInt(d.toString(),10)]);if(s[Ss].length)for(d=0;d<s[Ss].length;d++)n.push(s[Ss][parseInt(d.toString(),10)])}else{if(e.length)n=(m=Ba(t)).map(function(t){var n,r=a.DataUtil.getObject(i,t);return e.some(function(e){return n=e,r===a.DataUtil.getObject(i,e)})?n:t});else n=t}var p=e;p.type&&"cancel"===p.type&&(n=t);var c,u={},g=this.parent.aggregates;for(d=0;d<g.length;d++)for(var f=0;f<g[parseInt(d.toString(),10)].columns.length;f++){var m=[];m=n;for(var y=0,v=g[parseInt(d.toString(),10)].columns[parseInt(f.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});y<v.length;y++){var S=v[y];c=tl(S,m,g[parseInt(d.toString(),10)].columns[parseInt(f.toString(),10)],this.parent),u[g[parseInt(d.toString(),10)].columns[parseInt(f.toString(),10)].field+" - "+S.toLowerCase()]=c}}return{result:n,count:n.length,aggregates:u}},t}(Ys),Fd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Md=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=t.parent.createElement("TD",{className:"e-summarycell",attrs:{tabindex:"-1",role:"gridcell"}}),t}return Fd(t,e),t.prototype.getValue=function(e,t,i){var n=(0,o.isNullOrUndefined)(i.type)?i.columnName:i.field+" - "+("string"==typeof i.type?i.type.toLowerCase():"");return t[i.columnName]?t[i.columnName][""+n]:""},t.prototype.evaluate=function(e,t,i,n){var r=t.column;if(this.parent.on(at,this.refreshWithAggregate(e,t),this),!(r.footerTemplate||r.groupFooterTemplate||r.groupCaptionTemplate))return"Vertical"===this.parent.rowRenderingMode&&(e.style.display="none"),!0;"Vertical"===this.parent.rowRenderingMode&&e.classList.add("e-lastsummarycell");var s=r.getTemplate(t.cellType),a=this.parent.getColumnByField(i[r.columnName].field);if(!(0,o.isNullOrUndefined)(a)&&(i[r.columnName].headerText=a.headerText,a.isForeignColumn())){var l=a.columnData.filter(function(e){return e[a.foreignKeyField]===i[r.columnName].key})[0];l&&(i[r.columnName].foreignKey=l[a.foreignKeyValue])}var h=r.footerTemplate?"string"!=typeof r.footerTemplate&&!(r.footerTemplate.prototype&&r.footerTemplate.prototype.CSPTemplate):r.groupFooterTemplate?"string"!=typeof r.groupFooterTemplate&&!(r.groupFooterTemplate.prototype&&r.groupFooterTemplate.prototype.CSPTemplate):!!r.groupCaptionTemplate&&("string"!=typeof r.groupCaptionTemplate&&!(r.groupCaptionTemplate.prototype&&r.groupCaptionTemplate.prototype.CSPTemplate)),d=this.parent.isReact&&h,p=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact&&h,c=this.parent.printGridParent&&this.parent.printGridParent.isReact;if(d||p||c){var u=i[r.columnName];if("groupCaptionTemplate"===s.property||"groupFooterTemplate"===s.property){u.groupKey=u.key}s.fn(u,this.parent,s.property,"",null,null,e),this.parent.isInitialLoad||this.parent.renderTemplates()}else $a(e,s.fn(i[r.columnName],this.parent,s.property,"",null,null,null,this.parent.root));return!1},t.prototype.refreshWithAggregate=function(e,t){var i=this,n=t;return function(t){var r=n,s=r.column.columnName?r.column.columnName:null,a=(0,o.isNullOrUndefined)(s)?null:t.cells.filter(function(e){return e.column.columnName===s})[0];e.parentElement&&e.parentElement.getAttribute("data-uid")===t.dataUid&&s&&a&&s===a.column.columnName&&i.refreshTD(e,a,t.data)}},t}($s),Ld=function(){function e(e,t){this.parent=e,this.locator=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"aggregate"},e.prototype.initiateRender=function(){for(var e=this,i=this.locator.getService("cellRendererFactory"),n=new Md(this.parent,this.locator),r=[t.Summary,t.CaptionSummary,t.GroupSummary],s=0;s<r.length;s++)i.addCellRenderer(r[parseInt(s.toString(),10)],n);this.footerRenderer=new Ad(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable();var a=this.footerRenderer.getPanel();this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&a&&(0,o.addClass)([a],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer);var l=function(){e.prepareSummaryInfo(),e.parent.off(Pe,l)};this.parent.on(Pe,l,this),this.parent.on(Pe,this.footerRenderer.refresh,this.footerRenderer)},e.prototype.prepareSummaryInfo=function(){var e=this;Pd(this.parent.aggregates,function(t){var i=(0,o.getValue)("customFormat",t);if((0,o.isNullOrUndefined)(i)||t.setPropertiesSilent({format:i}),"object"==typeof t.format){var n=new l;t.setFormatter(n.getFormatFunction((0,o.extend)({},t.format)))}else if("string"==typeof t.format){var r=e.locator.getService("valueFormatter");t.setFormatter(r.getFormatFunction({format:t.format}))}t.setPropertiesSilent({columnName:t.columnName||t.field})})},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){(0,o.isNullOrUndefined)(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh();var t=new Ws(this.parent);0===new Ks(this.parent).getData().length&&t.isEmpty()||this.parent.notify(Ue,{})}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Le,this.initiateRender,this),this.parent.on(Be,this.onPropertyChanged,this),this.parent.on(lt,this.refresh,this),this.parent.on(Ct,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(Le,this.initiateRender),this.parent.off(Pe,this.footerRenderer.refresh),this.parent.off(Be,this.onPropertyChanged),this.parent.off(lt,this.refresh),this.parent.off(Ct,this.destroy),this.parent.element.querySelector("."+ss)&&(0,o.remove)(this.parent.element.querySelector("."+ss)))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.refresh=function(e,t){var i=e instanceof Array?e:[e];this.parent.notify(ot,i),t&&(i.row=t),this.parent.groupSettings.columns.length>0&&this.parent.notify(st,i)},e}();function Pd(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].columns.length;n++)t(e[parseInt(i.toString(),10)].columns[parseInt(n.toString(),10)],e[parseInt(i.toString(),10)])}var Nd=function(){function e(e,t,i){var n=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-n.containerRect.top,r=n.containerRect.bottom>e.bottom?n.containerRect.bottom-e.bottom:0;return t.entered=i>=0,i+n.options.pageHeight/2>=0||r>0&&e.bottom>0},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=n.containerRect.bottom,i-n.containerRect.top-n.options.pageHeight/2<=n.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){var i=e.right;return t.entered=i<n.containerRect.right,i-n.containerRect.width<=n.containerRect.right},axis:"X"},left:{check:function(e,t){var i=e.left;return t.entered=i>0,i+n.containerRect.width>=n.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}return e.prototype.observe=function(e,t){var i=this;this.containerRect=this.options.container.getBoundingClientRect(),o.EventHandler.add(this.options.container,"wheel",function(){return i.fromWheel=!0},this),(0,o.isNullOrUndefined)(this.options.horizontalScrollbar)||(o.EventHandler.add(this.options.horizontalScrollbar,"wheel",function(){return i.fromWheel=!0},this),o.EventHandler.add(this.options.horizontalScrollbar,"scroll",this.onVirtualContentScroll(),this)),(0,o.isNullOrUndefined)(this.options.verticalScrollbar)||(o.EventHandler.add(this.options.verticalScrollbar,"wheel",function(){return i.fromWheel=!0},this),o.EventHandler.add(this.options.verticalScrollbar,"scroll",this.onVirtualContentScroll(),this)),o.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,t),this)},e.prototype.check=function(e){var t=this.sentinelInfo[""+e];return t.check(this.element.getBoundingClientRect(),t)},e.prototype.onVirtualContentScroll=function(){var e=this;return function(t){t.target.classList.contains("e-virtual-vertical-scrollbar")&&(e.options.container.scrollTop=t.target.scrollTop),t.target.classList.contains("e-virtual-horizontal-scrollbar")&&(e.options.container.scrollLeft=t.target.scrollLeft)}},e.prototype.virtualScrollHandler=function(e,t){var i=this,n="chrome"===o.Browser.info.name?200:100,r=(0,o.debounce)(e,n),s=(0,o.debounce)(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var n=e.target.scrollTop,a=e.target.scrollLeft,l=i.options.prevTop<n?"down":"up";l=i.options.prevLeft===a?l:i.options.prevLeft<a?"right":"left",i.options.prevTop=n,i.options.prevLeft=a,(0,o.isNullOrUndefined)(i.options.verticalScrollbar)||(i.options.verticalScrollbar.scrollTop=i.options.container.scrollTop),(0,o.isNullOrUndefined)(i.options.horizontalScrollbar)||(i.options.horizontalScrollbar.scrollLeft=i.options.container.scrollLeft);var h=i.sentinelInfo[""+l];if(-1!==i.options.axes.indexOf(h.axis)){i.containerRect=i.options.container.getBoundingClientRect();var d=i.check(l);if(h.entered&&t(i.element,h,l,{top:n,left:a},i.fromWheel,d),d){var p=r;"X"===h.axis&&(p=s),p({direction:l,sentinel:h,offset:{top:n,left:a},focusElement:document.activeElement})}i.fromWheel=!1}}},e.prototype.setPageHeight=function(e){this.options.pageHeight=e},e}(),Bd=function(){function e(e){this.cOffsets={},this.cache={},this.rowCache={},this.data={},this.groups={},this.currentInfo={},this.prevInfo={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=this.parent.allowGrouping?new Xs(this.parent):new Vs(this.parent)}return e.prototype.columnInfiniteRows=function(e,t){var i=[];if("virtualscroll"===t.requestType){var n=this.parent.getRowsObject();if(i.push.apply(i,this.rowModelGenerator.refreshRows(n)),this.parent.infiniteScrollSettings.enableCache){var r=this.parent.frozenRows&&1===this.parent.pageSettings.currentPage?0:Ph(this.parent.getContentTable().querySelector(".e-row:not(.e-addedrow)")),s=i.slice(r,r+3*this.parent.pageSettings.pageSize);this.parent.frozenRows&&1!==this.parent.pageSettings.currentPage&&(s=i.slice(0,this.parent.frozenRows).concat(s)),i=s}}else i.push.apply(i,this.rowModelGenerator.generateRows(e,t));return i},e.prototype.generateRows=function(e,t){var i=this;if(this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling)return this.columnInfiniteRows(e,t);var n=!1,r=t.virtualInfo=t.virtualInfo||("sorting"===t.requestType||"delete"===t.requestType)&&jh(this.parent)&&this.prevInfo||this.getData();this.prevInfo=r;var s=r.sentinelInfo&&"X"===r.sentinelInfo.axis,a=s||!r.loadNext||r.loadSelf?r.page:r.nextInfo.page,l=[],h=this.getBlockIndexes(a),d=[];if(this.currentInfo.blockIndexes&&(h=r.blockIndexes=t.virtualInfo.blockIndexes=this.includePrevPage?this.currentInfo.blockIndexes.slice(1):this.currentInfo.blockIndexes.slice(0,this.currentInfo.blockIndexes.length-1),n=!0),this.checkAndResetCache(t.requestType),"pin-row"!==t.requestType&&"unpin-row"!==t.requestType||(this.startIndex=null),Fl(this.parent)&&this.parent.vcRows.length){var p=this.parent.vcRows.filter(function(e){return e.isDataRow});if(this.parent.isManualRefresh&&p.length===e.records.length||!this.parent.isManualRefresh)return l=this.parent.vcRows}if(this.parent.enableColumnVirtualization)for(var c=0;c<r.blockIndexes.length;c++)this.isBlockAvailable(r.blockIndexes[parseInt(c.toString(),10)])&&(this.cache[r.blockIndexes[parseInt(c.toString(),10)]]=this.rowModelGenerator.refreshRows(this.cache[r.blockIndexes[parseInt(c.toString(),10)]]));var u=r.blockIndexes,g=function(i){if(!f.isBlockAvailable(u[parseInt(i.toString(),10)])){var a=(0,o.isNullOrUndefined)(f.startIndex)||isNaN(f.startIndex)?f.getStartIndex(u[parseInt(i.toString(),10)],e):f.startIndex;a=!Fl(f.parent)||f.parent.vcRows.length||"sorting"!==t.requestType&&"delete"!==t.requestType&&"refresh-aggregate-on-save"!==t.requestType?a:0;var p=f.rowModelGenerator.generateRows(e,{virtualInfo:r,startIndex:a});Fl(f.parent)&&!f.parent.vcRows.length&&(f.recordsCount=e.records.length,f.parent.vRows=p,f.parent.vcRows=p,f.parent.notify(ur,{}));var c=void 0;if(Fl(f.parent))f.getGroupVirtualRecordsByIndex(p);else if(n)f.setBlockForManualRefresh(f.cache,h,p);else if(("sorting"===t.requestType||"delete"===t.requestType||f.parent.isTreeGrid&&f.parent.getDataModule().isRemote()&&"refresh"===t.requestType)&&jh(f.parent))for(var g=Vh(r.blockIndexes),m=0,y=0;y<g.length;y++){var v=f.getBlockIndexes(g[parseInt(y.toString(),10)]),S=f.model.pageSize*y,C=S+f.model.pageSize;if(f.parent.allowGrouping&&f.parent.groupSettings.columns.length){var w=p.filter(function(e){return e.isDataRow}).slice(S,C);S=m,C=p.indexOf(w[w.length-1])+1}var b=p.slice(S,C),I=~~Math.max(b.length,f.model.pageSize)/2;f.isBlockAvailable(v[0])||(f.cache[v[0]]=b.slice(0,I)),f.isBlockAvailable(v[1])||(f.cache[v[1]]=b.slice(I)),m=C}else c=~~Math.max(p.length,f.model.pageSize)/2,f.isBlockAvailable(h[0])||(f.cache[h[0]]=p.slice(0,c)),f.isBlockAvailable(h[1])||(f.cache[h[1]]=p.slice(c))}if(f.parent.groupSettings.columns.length&&!s&&f.cache[u[parseInt(i.toString(),10)]]&&!f.parent.groupSettings.enableLazyLoading&&(f.cache[u[parseInt(i.toString(),10)]]=f.updateGroupRow(f.cache[u[parseInt(i.toString(),10)]],u[parseInt(i.toString(),10)])),!t.renderMovableContent&&!t.renderFrozenRightContent&&f.cache[u[parseInt(i.toString(),10)]]){l.push.apply(l,f.cache[u[parseInt(i.toString(),10)]]);var x=[];f.parent.enableVirtualization&&f.parent.groupSettings.columns.length&&l.forEach(function(e){x.includes(e)||x.push(e)}),l=x.length?x:l}f.isBlockAvailable(u[parseInt(i.toString(),10)])&&d.push(u[parseInt(i.toString(),10)])},f=this;for(c=0;c<u.length;c++)g(c);if(Fl(this.parent)&&this.parent.vcRows.length&&"sorting"===t.requestType&&0!==t.scrollTop.top)return l=this.parent.vcRows;r.blockIndexes=d;var m="records";return this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.parent.groupSettings.enableLazyLoading?l.filter(function(e){e.isDataRow&&(i.parent.currentViewData[e.index]=e.data)}):this.parent.currentViewData[""+m]=l.map(function(e){return e.data}):this.parent.currentViewData=l.map(function(e){return e.data}),"grouping"===t.requestType&&(this.parent.currentViewData[""+m]=this.parent.currentViewData[""+m].filter(function(e,t){return i.parent.currentViewData[""+m].indexOf(e)===t})),Fl(this.parent)&&this.parent.vcRows.length&&["save","delete","refresh-aggregate-on-save"].some(function(e){return t.requestType===e})?l=this.parent.vcRows:l},e.prototype.generatePinnedTopRows=function(e){return this.rowModelGenerator.generatePinnedTopRows(e)},e.prototype.setBlockForManualRefresh=function(e,t,i){var n=this.model.pageSize/2;this.includePrevPage?(e[t[0]-1]=i.slice(0,n),e[t[0]]=i.slice(n,2*n),e[t[1]]=i.slice(2*n,3*n),e[t[2]]=i.slice(3*n,4*n)):(e[t[0]]=i.slice(0,n),e[t[1]]=i.slice(n,2*n),e[t[2]]=i.slice(2*n,3*n),e[t[2]+1]=i.slice(3*n,4*n))},e.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},e.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},e.prototype.isBlockAvailable=function(e){return e in this.cache},e.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},e.prototype.getStartIndex=function(e,t,i){void 0===i&&(i=!0);var n=e%2==0,r=(this.getPage(e)-1)*this.model.pageSize+this.parent.pinnedTopRowModels.length;return i||!n?r:r+~~(this.model.pageSize/2)},e.prototype.getColumnIndexes=function(e){var t=this;void 0===e&&(e=this.parent.getHeaderContent().querySelector("."+os));var i=[],n=0|e.scrollLeft,r=Object.keys(this.cOffsets),s=e.getBoundingClientRect().width;n=Math.min(this.cOffsets[r.length-1]-s,n);var a=o.Browser.isDevice?2*s:s/2,l=n+s+(0===n?a:0),h=0,d=n-a;if(this.parent.isFrozenGrid()){if(h=this.parent.leftrightColumnWidth("left"),d>0)for(var p=this.parent.getVisibleFrozenLeftCount()-1;p>=0;p--)if(d<=this.cOffsets[parseInt(p.toString(),10)]){h-=this.cOffsets[parseInt(p.toString(),10)];break}if(this.parent.getFrozenMode()===ws){var c=this.parent.getVisibleFrozenRightCount();r.splice(r.length-1-c,c)}}var u=this.parent.getVisibleFrozenLeftCount();return r.some(function(e){var n=Number(e),r=t.cOffsets[""+e];return(d<0&&n<u||d+h<=r&&l+a>=r)&&i.push(n),l+a<r}),i},e.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save","pin-row","unpin-row"].some(function(t){return e===t});return t&&(this.cache={},this.data={},this.groups={}),t},e.prototype.refreshColOffsets=function(){var e=this,t=0;this.cOffsets={};for(var i=this.parent.groupSettings.columns.length,n=this.parent.getVisibleColumns(),r=n.length,s=function(t){return t.visible&&(e.parent.groupSettings.showGroupedColumn?t.visible:e.parent.groupSettings.columns.indexOf(t.field)<0)},o=this.parent.groupSettings.columns,a=0;a<o.length;a++)this.cOffsets[parseInt(a.toString(),10)]=30+(0|this.cOffsets[a-1]);for(var l=Array.apply(null,Array(r)).map(function(){return t++}),h=0;h<l.length;h++)l[parseInt(h.toString(),10)]=l[parseInt(h.toString(),10)]+i,this.cOffsets[l[parseInt(h.toString(),10)]]=(0|this.cOffsets[l[parseInt(h.toString(),10)]-1])+(s(n[parseInt(h.toString(),10)])?parseInt(n[parseInt(h.toString(),10)].width,10):0)},e.prototype.updateGroupRow=function(e,t){for(var i=e[0],n=[],r=Object.keys(this.cache),s=0;s<r.length;s++)Number(r[parseInt(s.toString(),10)])<t&&(n=n.concat(this.cache[r[parseInt(s.toString(),10)]]));return i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,n)},e.prototype.iterateGroup=function(e,t){var i=e[0],n=0;return i&&i.isDataRow||e.some(function(e){return t.some(function(t,i){var r=t&&void 0!==t.data.field&&t.data.field===e.data.field&&t.data.key===e.data.key;return r&&(n=i),r})})&&(e.shift(),e=this.iterateGroup(e,t.slice(n))),e},e.prototype.getRows=function(){for(var e=[],t=Object.keys(this.cache),i=0;i<t.length;i++)e=e.concat(this.cache[t[parseInt(i.toString(),10)]]);return e},e.prototype.generateCells=function(e){for(var t=[],i=this.parent.columnModel,n=0;n<i.length;n++)t.push(this.rowModelGenerator.generateCell(i[parseInt(n.toString(),10)],null,null,null,null,e));return t},e.prototype.getGroupVirtualRecordsByIndex=function(e){var t=this.parent.contentModule.getGroupedTotalBlocks(),i=this.parent.contentModule.getBlockSize();if(0===Object.keys(this.cache).length)for(var n=0,r=1;r<=t;r++){var s=0;this.cache[parseInt(r.toString(),10)]=[];for(var o=(r-1)*i+n;o<e.length&&s!==i;o++)this.cache[parseInt(r.toString(),10)].push(e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].isDataRow&&s++,n++;n-=s}},e}(),zd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qd=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.prevHeight=0,n.startIndex=0,n.preStartIndex=0,n.preventEvent=!1,n.actions=["filtering","searching","grouping","ungrouping"],n.offsets={},n.tmpOffsets={},n.virtualEle=new Hd,n.offsetKeys=[],n.isFocused=!1,n.isSelection=!1,n.isBottom=!1,n.isBottomNotify=!1,n.diff=0,n.heightChange=!1,n.isTop=!1,n.empty=void 0,n.isCancel=!1,n.requestTypes=["beginEdit","cancel","delete","add","save","sorting","columnstate"],n.isNormaledit="Normal"===n.parent.editSettings.mode,n.virtualData={},n.virtualInfiniteData={},n.emptyRowData={},n.isContextMenuOpen=!1,n.isSelectionScroll=!1,n.validationCheck=!1,n.firstCellFocus=!1,n.prevPage=0,n.prevCurrentInfo={},n.locator=i,n.eventListener("on"),n.widthServices=i.getService("widthService"),n.parent.on(wt,n.setVisible,n),n.vgenerator=n.generator,n}return zd(t,e),t.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(i.Header),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.gridContent=this.parent.element.querySelector("."+rs),this.virtualEle.content=this.content=this.getPanel().querySelector("."+ps),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.parent.enableSeamlessScrolling&&(this.parent.enableVirtualization&&this.virtualEle.renderVerticalScrollbar(),this.parent.enableColumnVirtualization&&Number(this.widthServices.getTableWidth(this.parent.getColumns()))>this.content.clientWidth&&this.virtualEle.renderHorizontalScrollbar()),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.virtualEle.wrapper.style.position="absolute");var t=this.parent.dataSource instanceof a.DataManager&&!this.parent.dataSource.dataSource.offline,n={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:t,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"],verticalScrollbar:this.virtualEle.verticalScrollbar,horizontalScrollbar:this.virtualEle.horizontalScrollbar};this.observer=new Nd(this.virtualEle.wrapper,n)},t.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(Ds).innerHTML=""),this.virtualEle.adjustTable(0,0)},t.prototype.getReorderedFrozenRows=function(e){var t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,n=e.virtualInfo.page;e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.virtualInfo.columnIndexes=[];var r=this.parent.getCurrentViewRecords().length,s=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,r),o=this.vgenerator.generateRows(s,e);return e.virtualInfo.blockIndexes=t,e.virtualInfo.columnIndexes=i,e.virtualInfo.page=n,o.splice(0,this.parent.frozenRows)},t.prototype.scrollListener=function(e){if((this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"up"!==e.direction&&"down"!==e.direction)&&!this.isBottomNotify)if(this.scrollAfterEdit(),this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)this.preventEvent=!1;else{if((0,o.isNullOrUndefined)(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===(0,o.closest)(document.activeElement,"."+ps)||this.content===document.activeElement,this.parent.islazyloadRequest&&"down"===e.direction)return this.parent.removeMaskRow(),void(this.parent.islazyloadRequest=!1);var t=e.sentinel,i=this.currentInfo=this.getInfoFromView(e.direction,t,e.offset);if(Fl(this.parent))return i.blockIndexes&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()?void this.parent.removeMaskRow():(i.event="refresh-virtual-block",(0,o.isNullOrUndefined)(i.offsets)||(i.offsets.top=this.content.scrollTop),this.parent.pageSettings.currentPage=i.page,this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect()),this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),void this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}));if(this.prevInfo&&("Y"===t.axis&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()||"X"===t.axis&&this.prevInfo.columnIndexes.toString()===i.columnIndexes.toString()||this.parent.isFrozenGrid()&&"X"===t.axis&&this.parent.getVisibleFrozenLeftCount()>=i.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(i.columnIndexes.toString())))return this.parent.removeMaskRow(),o.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===t.axis&&this.restoreEdit(),void(this.parent.groupSettings.enableLazyLoading&&1===this.prevInfo.blockIndexes[0]&&1===i.blockIndexes[0]&&"up"===e.direction&&this.virtualEle.adjustTable(0,i.offsets.top<this.offsets[1]?0:this.getBlockHeight()));if(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?i.columnIndexes:[]),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.parent.pageSettings.currentPage=i.loadNext&&!i.loadSelf?i.nextInfo.page:i.page),this.requestType="virtualscroll",this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect()),this.parent.islazyloadRequest=!1,this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),this.parent.notify(Hr,{action:"clear"}),this.parent.isInitialLoad||!this.parent.enablePersistence){if(this.prevPage===this.parent.pageSettings.currentPage&&i.event===Ue)return void(this.currentInfo=this.prevCurrentInfo);i.event===Ue&&(this.prevPage=this.parent.pageSettings.currentPage,this.prevCurrentInfo=this.currentInfo),this.isBottomNotify=this.isBottom&&i.event===Ue,this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement})}this.parent.enableColumnVirtualization&&!this.parent.getContentTable().querySelector("tr.e-row")&&(this.parent.removeMaskRow(),this.appendContent(void 0,void 0,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}),this.prevInfo=i)}},t.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},t.prototype.getInfoFromView=function(e,t,i){var n=!1,r=[],s={direction:e,sentinelInfo:t,offsets:i,startIndex:this.preStartIndex,endIndex:this.preEndIndex};s.page=this.getPageFromTop(i.top,s),s.blockIndexes=r=this.vgenerator.getBlockIndexes(s.page),s.loadSelf=!this.vgenerator.isBlockAvailable(r[s.block]);var o=this.ensureBlocks(s);if("upArrow"===this.activeKey&&s.blockIndexes.toString()!==o.toString()){var a=o[o.length-1];-1===s.blockIndexes.indexOf(a)&&(n=!0)}if(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(s.blockIndexes=o),s.loadNext=!o.filter(function(e){return-1===r.indexOf(e)}).every(this.block.bind(this)),s.event=s.loadNext||s.loadSelf?Ue:Ft,s.nextInfo=s.loadNext?{page:Math.max(1,s.page+("down"===e?1:-1))}:{},n&&(s.blockIndexes=[s.blockIndexes[0]-1,s.blockIndexes[0],s.blockIndexes[0]+1]),"downArrow"===this.activeKey&&!isNaN(this.rowIndex)){var l=Math.ceil(this.rowIndex/this.getBlockSize());if(1!==l&&(s.blockIndexes[1]!==l||s.blockIndexes.length<3)&&(s.blockIndexes=[l-1,l,l+1],s.loadNext)){for(var h=this.vgenerator.getBlockIndexes(s.nextInfo.page),d=!1,p=0;p<s.blockIndexes.length;p++){for(var c=0;c<h.length;c++)if(s.blockIndexes[parseInt(p.toString(),10)]===h[parseInt(c.toString(),10)]){d=!0;break}if(d)break}d||(s.loadNext=!1,s.nextInfo={},s.event=Ft)}}return s.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(s.event=Ft),s},t.prototype.ensureBlocks=function(e){var t,i=this,n=e.blockIndexes[e.block],r=n,s=Math.max,o="down"===e.direction?[s(n,1),++n,++n]:[s(n-1,1),n,n+1];this.prevInfo=this.prevInfo||this.vgenerator.getData(),o=o.filter(function(e,t){return o.indexOf(e)===t});var a=!1;return jh(this.parent)&&"up"===e.direction&&((e.page+1===this.prevInfo.page||e.page===this.prevInfo.page)&&(1===e.block||0===e.block&&1===e.page)||e.page===this.prevInfo.page&&2===o.length)&&this.vgenerator.isBlockAvailable(e.blockIndexes[1]+1)&&(a=e.page+1===this.prevInfo.page&&1===e.block,o=[s((n+=1)-1,1),n,n+1]),this.prevInfo.blockIndexes.toString()===o.toString()||((e.loadSelf&&!a||"down"===e.direction&&this.isEndBlock(r))&&(o=this.vgenerator.getBlockIndexes(e.page)),o.some(function(e,n){var r=e===(Fl(i.parent)?i.getGroupedTotalBlocks():i.getTotalBlocks());return r&&(t=n),r}),void 0!==t&&(o=o.slice(0,t+1),0===e.block&&1===o.length&&this.vgenerator.isBlockAvailable(o[0]-1)&&(o=[o[0]-1,o[0]]))),o},t.prototype.appendContent=function(e,t,i){var n=this,r=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==i.virtualInfo.page?this.currentInfo:i.virtualInfo;this.prevInfo=this.prevInfo||i.virtualInfo;var s,a=r.columnIndexes[0]-1,l=this.getColumnOffset(a),h=r.blockIndexes;this.parent.groupSettings.columns.length&&this.refreshOffsets(),"100%"===this.parent.height&&(this.parent.element.style.height="100%");var d=this.parent.height.toString().indexOf("%")<0?this.content.getBoundingClientRect().height:this.parent.element.getBoundingClientRect().height;!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(d=0);var p=0;if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){var c=0;this.parent.getColumns().filter(function(e){e.visible&&(p+=parseInt(e.width.toString(),10),"Left"===e.freeze&&(c+=parseInt(e.width.toString(),10)))});var u=r.columnIndexes;s=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",a>this.parent.getVisibleFrozenLeftCount()&&(l-=c),this.resetStickyLeftPos(l,t)}if(!this.requestTypes.some(function(e){return e===n.requestType})){var g=this.getTranslateY(this.content.scrollTop,d,r);this.parent.groupSettings.enableLazyLoading&&r&&this.prevInfo&&1===this.prevInfo.blockIndexes[0]&&1===r.blockIndexes[0]&&"up"===r.direction?this.virtualEle.adjustTable(0,this.content.scrollTop<this.offsets[1]?0:this.getBlockHeight()):this.virtualEle.adjustTable(l,g)}if(this.parent.enableColumnVirtualization&&this.header.virtualEle.adjustTable(l,0),this.parent.enableColumnVirtualization){u=r.columnIndexes;s=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",this.parent.isFrozenGrid()&&(s=p.toString(),this.parent.allowResizing&&(this.parent.getHeaderTable().style.width=p+"px",this.parent.getContentTable().style.width=p+"Px")),this.header.virtualEle.setWrapperWidth(s)}if(this.virtualEle.setWrapperWidth(s,o.Browser.isIE||"edge"===o.Browser.info.name),!(this.parent.enableColumnVirtualization&&(0,o.isNullOrUndefined)(e)&&(0,o.isNullOrUndefined)(t))){(0,o.isNullOrUndefined)(e)||(0,o.isNullOrUndefined)(e.parentNode)||(0,o.remove)(e);var f=this.parent.element.querySelector("."+ps).querySelector(Ds);if(f&&((0,o.remove)(f),e=null),this.parent.isReact&&!(0,o.isNullOrUndefined)(this.parent.rowTemplate)?e=t:(e=this.parent.createElement(Ds,{attrs:{role:"rowgroup"}})).appendChild(t),this.parent.frozenRows&&"virtualscroll"===i.requestType&&(1===this.parent.pageSettings.currentPage||this.isInfiniteColumnvirtualization()))for(var m=0;m<this.parent.frozenRows;m++)e.children[0].remove();if(this.getTable().appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"right"!==r.direction&&"left"!==r.direction||(this.content.scrollTop=this.currentInfo.offsets.top,this.content.scrollLeft=this.currentInfo.offsets.left),this.parent.groupSettings.columns.length){if(!Fl(this.parent)&&"up"===r.direction){var y=this.offsets[this.getTotalBlocks()]-this.prevHeight,v=this.content.scrollTop;this.content.scrollTop=v+y}this.setVirtualHeight(),this.parent.groupSettings.enableLazyLoading||this.observer.setPageHeight(this.getOffset(h[h.length-1])-this.getOffset(h[0]-1))}this.parent.groupSettings.enableLazyLoading||0!==this.parent.groupSettings.columns.length||"ungrouping"!==i.requestType||this.observer.setPageHeight(2*this.getBlockHeight()),this.prevInfo=r,this.isFocused&&"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey&&this.content.focus();var S=Math.ceil(this.getTotalBlocks()/2);if(this.isBottom&&(this.isBottom=!1,this.isBottomNotify=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage+1!==S&&this.parent.pageSettings.currentPage!==S||2!==h.length||"delete"!==i.requestType||(this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),1!==S&&this.parent.pageSettings.currentPage===S&&1===h.length&&(this.isBottom=!0,setTimeout(function(){var e=n.parent.getContent().firstElementChild;e.scrollTop=n.offsets[n.offsetKeys.length-2];var t={direction:"up",sentinel:n.observer.sentinelInfo.up,offset:{top:e.scrollTop,left:e.scrollLeft},focusElement:n.parent.element};n.scrollListener(t)},0)),this.isTop&&(this.parent.getContent().firstElementChild.scrollTop=0,this.isTop=!1),"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&this.parent.notify(Nt,{}),this.focusCell(i),this.firstCellFocus){this.firstCellFocus=!1;var C=this.parent.focusModule,w=C.active.matrix.current,b=this.parent.getContentTable().rows[w[0]].cells[w[1]];C.currentInfo.element=b,C.currentInfo.elementToFocus=b,b.classList.add("e-focus"),b.classList.add("e-focused"),b.tabIndex=0,b.focus()}if(this.restoreEdit(i),this.restoreAdd(),this.ensureSelectedRowPosition(),this.validationScrollLeft(),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.widthServices.refreshFrozenScrollbar(),!this.initialRowTop){var I=this.parent.element.getBoundingClientRect().top;this.parent.getRowByIndex(0)&&(this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-I)}}},t.prototype.validationScrollLeft=function(){if(this.validationCheck)if(this.validationCol){var e=this.vgenerator.cOffsets[this.validationCol.index-this.parent.getVisibleFrozenColumns()-1];this.validationCol=null,this.content.scrollLeft=e}else this.validationCheck=!1,this.parent.editModule.editFormValidate()},t.prototype.ensureSelectedRowPosition=function(){if(!this.isSelection&&this.isSelectionScroll&&!(0,o.isNullOrUndefined)(this.selectRowIndex)){this.isSelectionScroll=!1;var e=this.parent.getRowByIndex(this.selectRowIndex);e&&!this.isRowInView(e)&&this.rowSelected({rowIndex:this.selectRowIndex,row:e},!0)}},t.prototype.focusCell=function(e){if("upArrow"===this.activeKey||"downArrow"===this.activeKey){var t=this.parent.getRowByIndex(this.rowIndex);t.cells[this.cellIndex].focus({preventScroll:!0}),this.parent.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||this.parent.selectRow(parseInt(t.getAttribute(Rs),10)-1),this.activeKey=this.empty}},t.prototype.restoreEdit=function(e){if(this.isNormaledit){if(this.parent.editSettings.allowEditing&&this.parent.editModule&&!(0,o.isNullOrUndefined)(this.editedRowIndex)){var t=this.getRowByIndex(this.editedRowIndex),i=this.content,n=Object.keys(this.virtualData),r=e&&e.virtualInfo&&"X"===e.virtualInfo.sentinelInfo.axis;if(n.length&&t&&!i.querySelector("."+fs)&&-1===["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].indexOf(e.requestType)){var s=t.getBoundingClientRect().top-this.parent.element.getBoundingClientRect().top;(r||s<this.content.offsetHeight&&s>this.parent.getRowHeight())&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(t))}if(t&&this.content.querySelector("."+fs)&&!n.length){var a=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.enableCacheOnInfiniteColumnVirtual()?this.virtualInfiniteData:(0,o.extend)({},this.parent.getCurrentViewRecords()[this.editedRowIndex]):(0,o.extend)({},this.getRowObjectByIndex(this.editedRowIndex));this.virtualData=this.getVirtualEditedData(a)}}this.restoreAdd()}},t.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.getElementsByClassName("e-gridform"));if(!(this.parent.editModule&&this.parent.editModule.formObj&&this.parent.editModule.formObj.isDestroyed))for(var i=0;i<t.length;i++)e=this.parent.editModule.getCurrentEditedData(t[parseInt(i.toString(),10)],e);return e},t.prototype.restoreAdd=function(){var e=!this.parent.element.querySelector("."+ms);if(this.isNormaledit&&this.isAdd&&e){var t="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),i="Bottom"===this.parent.editSettings.newRowPosition&&this.parent.pageSettings.currentPage===this.maxPage;(t||i)&&(this.parent.isEdit=!1,this.parent.addRecord())}},t.prototype.onDataReady=function(e){(0,o.isNullOrUndefined)(e.count)||(this.count=e.count,this.maxPage=Math.ceil((this.parent.groupSettings.columns.length&&this.parent.vcRows.length?this.parent.vcRows.length:e.count)/this.parent.pageSettings.pageSize)),this.vgenerator.checkAndResetCache(e.requestType),["refresh","filtering","searching","grouping","ungrouping","reorder",void 0].some(function(t){return e.requestType===t})&&this.refreshOffsets(),this.setVirtualHeight(),this.resetScrollPosition(e.requestType)},t.prototype.updateScrollbarOnResize=function(){!this.parent.enableVirtualization||(0,o.isNullOrUndefined)(this.virtualEle.verticalScrollbar)||(0,o.isNullOrUndefined)(this.content)||(this.virtualEle.verticalScrollbar.style.width=ol(!0)+1+"px"),!this.parent.enableColumnVirtualization||(0,o.isNullOrUndefined)(this.virtualEle.horizontalScrollbar)||(0,o.isNullOrUndefined)(this.content)||(this.virtualEle.horizontalScrollbar.style.height=ol(!0)+1+"px")},t.prototype.updateVirtualScrollbar=function(e,t){!this.parent.enableVirtualization||(0,o.isNullOrUndefined)(this.virtualEle.verticalScrollbar)||(0,o.isNullOrUndefined)(this.virtualEle.verticalScrollerContainer)||(0,o.isNullOrUndefined)(this.content)||(this.virtualEle.verticalScrollbar.style.overflowX=this.parent.enableVirtualization&&parseInt(t,10)>this.virtualEle.wrapper.clientWidth?"scroll":"hidden",this.virtualEle.gridContent.style.position="relative",this.virtualEle.verticalScrollerContainer.style.height=(0,o.isNullOrUndefined)(e)?"0px":e+"px",this.virtualEle.verticalScrollbar.style.width=ol()+1+"px"),!this.parent.enableColumnVirtualization||(0,o.isNullOrUndefined)(this.virtualEle.horizontalScrollbar)||(0,o.isNullOrUndefined)(this.virtualEle.horizontalScrollerContainer)||(0,o.isNullOrUndefined)(this.content)||(this.virtualEle.horizontalScrollbar.style.overflowY=this.parent.enableColumnVirtualization&&e>this.virtualEle.wrapper.clientHeight?"scroll":"hidden",!t||-1!==t.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(t,10)||(t="100%"),this.virtualEle.horizontalScrollerContainer.style.width=t,this.virtualEle.horizontalScrollbar.style.height=ol()+1+"px")},t.prototype.setVirtualHeight=function(e){var t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.getVisibleColumns().length+this.parent.groupSettings.columns.length-1)+"px":"100%",i=this.offsets[Fl(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()];!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(i=0);var n=Fl(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks(),r=Math.ceil(n/2),s=Math.round(this.virtualEle.placeholder.getBoundingClientRect().bottom),a=Math.round(this.virtualEle.wrapper.getBoundingClientRect().bottom);(this.currentInfo.page===r||this.currentInfo.page+1===r)&&"down"===this.currentInfo.direction&&s>a&&!this.diff&&(this.diff=s-a),this.diff&&this.currentInfo.page===r&&s>a&&(!this.isAdd||"Bottom"!==this.parent.editSettings.newRowPosition)?(i-=this.diff,this.heightChange=!0):"virtualscroll"===this.requestType&&this.diff&&this.heightChange&&(i-=this.diff,this.heightChange=!1),this.virtualEle.setVirtualHeight(i,t),this.virtualEle&&this.virtualEle.wrapper&&(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.virtualEle.wrapper.style.minHeight="":this.virtualEle.wrapper.style.minHeight=(0,o.isNullOrUndefined)(i)?"0px":(0,o.formatUnit)(this.parent.height)),this.parent.enableColumnVirtualization&&this.header.virtualEle&&this.header.virtualEle.setVirtualHeight(1,t),this.parent.enableSeamlessScrolling&&this.updateVirtualScrollbar(i,t)},t.prototype.getPageFromTop=function(e,t){var i=this,n=Fl(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),r=0;return this.offsetKeys.some(function(s){var o=Number(s),a=e<=i.offsets[""+s]||o===n&&e>i.offsets[""+s];return a&&(i.offsetKeys.length%2!=0&&o.toString()===i.offsetKeys[i.offsetKeys.length-2]&&e<=i.offsets[i.offsetKeys.length-1]&&(o+=1),t.block=o%2==0?1:0,r=Math.max(1,Math.min(i.vgenerator.getPage(o),i.maxPage))),a}),r},t.prototype.getTranslateY=function(e,t,i,n){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var r=(i.blockIndexes[0]||1)-1,s=this.getOffset(r),o=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]);n&&(i=this.prevInfo);var a=s>e?this.getOffset(r-1):o<e+t?this.getOffset(r+1):s,l=this.offsets[i.blockIndexes[i.blockIndexes.length-1]]-this.tmpOffsets[i.blockIndexes[0]],h=Fl(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return a+l>this.offsets[parseInt(h.toString(),10)]&&(a-=a+l-this.offsets[parseInt(h.toString(),10)]),1===i.page&&0===i.block&&"up"===i.direction&&(a=0),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(a=0),a},t.prototype.getOffset=function(e){return Math.min(0|this.offsets[parseInt(e.toString(),10)],0|this.offsets[this.maxBlock])},t.prototype.onEntered=function(){var e=this;return function(t,i,n,r,s,a){if("down"!==n&&"up"!==n||e.parent.enableVirtualization||!e.parent.enableColumnVirtualization){!o.Browser.isIE||s||!a||e.preventEvent||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.prevInfo=e.prevInfo||e.vgenerator.getData();var l=e.getInfoFromView(n,i,r);if(!(e.parent.isFrozenGrid()&&"X"===i.axis&&e.parent.getVisibleFrozenLeftCount()>=l.columnIndexes[0]&&e.prevInfo&&e.prevInfo.columnIndexes.toString().includes(l.columnIndexes.toString()))){if(e.parent.enableVirtualMaskRow&&!e.preventEvent){var h=parseInt(e.offsetKeys[0],10),d=parseInt(e.offsetKeys[e.offsetKeys.length-1],10),p=e.currentInfo.blockIndexes,c=e.prevInfo&&"X"===i.axis&&e.prevInfo.columnIndexes.toString()===l.columnIndexes.toString()||"down"===n&&e.parent.allowGrouping&&e.parent.groupSettings.columns.length&&(e.parent.allowFiltering&&e.parent.filterSettings.columns.length||e.parent.searchSettings.key.length)&&e.offsetKeys.length<=2;p&&p[0]===h&&"up"===n||p&&p[p.length-1]===d&&"down"===n||c||setTimeout(function(){e.parent.showMaskRow(i.axis)},0)}var u="X"===i.axis,g=e.prevInfo.offsets?e.prevInfo.offsets.top:null,f=e.content.getBoundingClientRect().height,m=e.getColumnOffset(u?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(e.parent.isFrozenGrid()&&e.parent.enableColumnVirtualization&&e.currentInfo&&e.currentInfo.columnIndexes){var y=e.currentInfo.columnIndexes[0]-1,v=0;e.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(v+=parseInt(e.width.toString(),10))}),y>e.parent.getVisibleFrozenLeftCount()&&(m-=v)}if(u){var S=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,C=e.vgenerator.cOffsets[S-1];m=m>C?C:m}if(!e.parent.enableVirtualization&&e.parent.enableColumnVirtualization)e.virtualEle.adjustTable(m,0);else{var w=e.prevInfo&&1===e.prevInfo.page&&(n!==e.prevInfo.direction||n!==e.prevInfo.direction),b=e.getTranslateY(r.top,f,u&&g===r.top?e.prevInfo:void 0,!w);e.virtualEle.adjustTable(m,Math.min(b,e.offsets[e.maxBlock]));var I=e.virtualEle.wrapper.getBoundingClientRect().bottom,x=e.virtualEle.content.getBoundingClientRect().bottom;if("up"===n&&e.prevInfo.page===Math.ceil(e.getTotalBlocks()/2)&&Math.round(I)<Math.round(x)){var R=Math.round(x)-Math.round(I),D=Math.min(b+R,e.offsets[e.maxBlock]);D!==b&&e.virtualEle.adjustTable(m,D)}}e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(m,0),e.parent.isFrozenGrid()&&e.resetStickyLeftPos(m))}}}},t.prototype.dataBound=function(){this.parent.notify(Vn,{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):(this.activeKey=this.empty,this.requestType=this.empty)},t.prototype.resetStickyLeftPos=function(e,t){var i=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze")).concat([].slice.call((t||this.parent.getContent()).querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze"))),n=0,r=0;if(this.parent.getHeaderContent().querySelectorAll(".e-fixedfreeze").length&&(n=this.parent.leftrightColumnWidth("left"),r=this.parent.leftrightColumnWidth("right")),i.length)for(var s=0;s<i.length;s++){var a=i[parseInt(s.toString(),10)],l=void 0;if(a.classList.contains("e-rowcell"))if((0,o.isNullOrUndefined)(a.getAttribute("aria-colindex"))&&a.querySelector("[data-mappinguid]")){var h=a.querySelector("[data-mappinguid]").getAttribute("data-mappinguid");l=this.parent.getColumnByUid(h)}else{var d=parseInt(a.getAttribute("aria-colindex"),10)-1;l=this.parent.getColumnByIndex(parseInt(d.toString(),10))}else if(a.classList.contains("e-headercell")||a.classList.contains("e-filterbarcell")){h=a.classList.contains("e-filterbarcell")?a.getAttribute("data-mappinguid"):a.querySelector("[data-mappinguid]").getAttribute("data-mappinguid");l=this.parent.getColumnByUid(h)}(0,o.isNullOrUndefined)(l)||("Left"===l.freeze?a.style.left=l.valueX-e+"px":"Right"===l.freeze?a.style.right=l.valueX+e+"px":"Fixed"===l.freeze&&(a.style.left=n-e+"px",a.style.right=r+e+"px"))}this.parent.translateX=e},t.prototype.rowSelected=function(e,t){if((this.isSelection||t)&&!this.isLastBlockRow(e.rowIndex)){var i=jl(this.content.firstElementChild),n=this.parent.element.getBoundingClientRect().top,r=e.row.getBoundingClientRect().top-n,s=this.content.getBoundingClientRect().height,o=s<r,a=o?r-s:this.initialRowTop-r,l=o?i.height-a:i.height+a;this.virtualEle.adjustTable(i.width,l);var h=this.virtualEle.wrapper.getBoundingClientRect(),d=this.content.getBoundingClientRect();h.top>d.top&&this.virtualEle.adjustTable(i.width,l-(h.top-d.top)),this.content.querySelector("tbody").lastElementChild.getBoundingClientRect().top-n<s?(l+=s-(e.row.getBoundingClientRect().top-n),this.virtualEle.adjustTable(i.width,l-this.parent.getRowHeight()/2)):d.bottom>h.bottom&&this.virtualEle.adjustTable(i.width,l+(d.bottom-h.bottom)),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.resetStickyLeftPos(i.width)}this.isSelection=!1},t.prototype.isLastBlockRow=function(e){var t=this.parent.getContent().firstElementChild,i=Math.floor(t.offsetHeight/this.parent.getRowHeight())-1;return e>=this.maxPage*this.parent.pageSettings.pageSize-i},t.prototype.refreshMaxPage=function(){this.parent.groupSettings.columns.length&&this.parent.vcRows.length&&(this.maxPage=Math.ceil(this.parent.vcRows.length/this.parent.pageSettings.pageSize))},t.prototype.setVirtualPageQuery=function(e){var t=[];if(this.prevInfo&&this.prevInfo.blockIndexes&&(t=Vh(this.prevInfo.blockIndexes)),("sorting"===this.requestType||"delete"===this.requestType)&&t.length&&jh(this.parent))return e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),void(e.skipPage=!0);var i=this.parent.getContent().querySelector(".e-row");if("virtualscroll"===this.requestType&&this.vgenerator.currentInfo.blockIndexes&&(this.vgenerator.currentInfo={}),i&&(this.parent.isManualRefresh||"pin-row"===this.requestType||"unpin-row"===this.requestType)&&this.currentInfo.blockIndexes&&(3===this.currentInfo.blockIndexes.length||t.length>1)){this.vgenerator.startIndex=parseInt(i.getAttribute("aria-rowindex"),10)-1,this.vgenerator.currentInfo=(0,o.extend)({},this.currentInfo),this.vgenerator.currentInfo.blockIndexes=this.currentInfo.blockIndexes.slice(),(this.vgenerator.includePrevPage=this.currentInfo.blockIndexes[0]%2==0)?(this.vgenerator.startIndex=this.vgenerator.startIndex-this.getBlockSize(),this.vgenerator.currentInfo.blockIndexes.unshift(this.currentInfo.blockIndexes[0]-1)):this.vgenerator.currentInfo.blockIndexes.push(this.currentInfo.blockIndexes[this.currentInfo.blockIndexes.length-1]+1);var n=(this.vgenerator.currentInfo.blockIndexes[0]-1)*this.getBlockSize(),r=this.vgenerator.currentInfo.blockIndexes.length*this.getBlockSize();e.query.skip(n),e.query.take(r),e.skipPage=!0}},t.prototype.eventListener=function(e){var t=this;if(!this.parent.isDestroyed){this.parent[""+e](Pe,this.onDataReady,this),this.parent.addEventListener(E,this.dataBound.bind(this)),this.parent.addEventListener(R,this.actionBegin.bind(this)),this.parent.addEventListener(D,this.actionComplete.bind(this)),this.parent.addEventListener(k,this.rowSelected.bind(this)),this.parent[""+e](Ft,this.refreshContentRows,this),this.parent[""+e](Nr,this.refreshVirtualLazyLoadCache,this),this.parent[""+e](Yi,this.selectVirtualRow,this),this.parent[""+e](dn,this.virtualCellFocus,this),this.parent[""+e](pn,this.editActionBegin,this),this.parent[""+e](yn,this.addActionBegin,this),this.parent[""+e](gn,this.restoreEdit,this),this.parent[""+e](cn,this.editSuccess,this),this.parent[""+e](fn,this.refreshCache,this),this.parent[""+e](mn,this.resetIsedit,this),this.parent[""+e](vn,this.getVirtualData,this),this.parent[""+e](un,this.editCancel,this),this.parent[""+e](ur,this.refreshMaxPage,this),this.parent[""+e](gr,this.setVirtualPageQuery,this),this.parent[""+e](fr,this.selectRowOnContextOpen,this),this.parent[""+e](Cr,this.resetVirtualFocus,this),this.parent[""+e](br,this.refreshCells,this),this.parent[""+e](Ir,this.scrollToEdit,this),this.parent.on(Ct,this.destroy,this);for(var i=this.actions,n=0;n<i.length;n++)this.parent[""+e](i[parseInt(n.toString(),10)]+"-begin",this.onActionBegin,this);var r=function(){window.addEventListener("resize",t.updateScrollbarOnResize.bind(t)),t.observer.observe(function(e){return t.scrollListener(e)},t.onEntered());var e=t.parent;if(e.enablePersistence&&e.scrollPosition){if(e.scrollPosition.top>0){t.content.scrollTop=e.scrollPosition.top;var i={direction:"down",sentinel:t.observer.sentinelInfo.down,offset:e.scrollPosition,focusElement:e.element};t.scrollListener(i)}e.enableColumnVirtualization&&(t.content.scrollLeft=e.scrollPosition.left)}t.parent.off(Ne,r)};this.parent.on(Ne,r,this)}},t.prototype.destroy=function(){this.removeEventListener()},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(window.removeEventListener("resize",this.updateScrollbarOnResize),this.parent.off(Ct,this.destroy))},t.prototype.refreshVirtualLazyLoadCache=function(e){var t,i,n,r=this.currentInfo.blockIndexes;(0,o.isNullOrUndefined)(this.currentInfo.blockIndexes)&&(r=[1,2]);for(var s=0;s<r.length;s++)for(var a=this.vgenerator.cache[r[parseInt(s.toString(),10)]],l=0;l<a.length;l++)if(a[parseInt(l.toString(),10)].uid===e.uid){t=r[parseInt(s.toString(),10)],i=l,n=a;break}e.count?this.vgenerator.cache[parseInt(t.toString(),10)].splice(i+1,e.count):e.rows&&e.rows.length&&(this.vgenerator.cache[parseInt(t.toString(),10)]=[].slice.call(n.slice(0,i+1)).concat([].slice.call(e.rows)).concat([].slice.call(n.slice(i+1,n.length)))),this.refreshOffsets()},t.prototype.scrollToEdit=function(e){var t=!0;if(this.validationCheck=!0,this.isAdd&&this.content.scrollTop>0){t=!1;var i=Object.keys(this.offsets);this.content.scrollTop="Top"===this.parent.editSettings.newRowPosition?0:this.offsets[i.length-1]}var n=this.parent.getRowByIndex(this.editedRowIndex);if(!(n||(0,o.isNullOrUndefined)(this.editedRowIndex)||n&&this.isRowInView(n))){var r=this.parent.getRowHeight(),s=this.editedRowIndex*r;(0,o.isNullOrUndefined)(s)||(t=!1,this.content.scrollTop=s)}if(e&&t){var a=this.vgenerator.cOffsets[e.index-this.parent.getVisibleFrozenColumns()-1];if(!this.parent.enableColumnVirtualization)a=this.parent.getHeaderContent().querySelector('.e-headercelldiv[data-mappinguid="'+e.uid+'"]').parentElement.offsetLeft;this.parent.enableColumnVirtualization&&this.parent.getVisibleFrozenLeftCount()&&(a-=this.parent.leftrightColumnWidth("left")),this.content.scrollLeft=this.parent.enableRtl?-Math.abs(a):a}e&&!t&&(this.validationCol=e)},t.prototype.refreshCells=function(e){e.cells=this.vgenerator.generateCells(e.foreignKeyData)},t.prototype.resetVirtualFocus=function(e){this.isCancel=e.isCancel},t.prototype.getVirtualData=function(e){if(this.isNormaledit){var t=this.parent.element.querySelector('.e-griderror:not([style*="display: none"])'),i=Object.keys(this.virtualData);if(e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis,t)return;this.virtualData=i.length?this.virtualData:e.virtualData,this.getVirtualEditedData(this.virtualData),e.virtualData=this.virtualData,e.isAdd=this.isAdd||this.parent.editSettings.showAddNewRow,e.isCancel=this.isCancel}},t.prototype.selectRowOnContextOpen=function(e){this.isContextMenuOpen=e.isOpen},t.prototype.editCancel=function(e){var t=Jl(this.parent,e.data);(0,o.isNullOrUndefined)(t)||(e.data=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)])},t.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},t.prototype.updateCurrentViewData=function(e){var t=Jl(this.parent,e);(0,o.isNullOrUndefined)(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},t.prototype.actionBegin=function(e){"virtualscroll"!==e.requestType&&(this.requestType=e.requestType),e.cancel?"beginEdit"===e.requestType&&(this.virtualData={}):this.parent.notify(Xn,e)},t.prototype.virtualCellFocus=function(e){var t=document.activeElement;if(t.classList.contains(is)||!(t instanceof HTMLInputElement)&&(0,o.isNullOrUndefined)(t.closest(".e-templatecell"))||(t=t.closest(".e-rowcell")),!(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&t)||!t.classList.contains(is)&&(0,o.isNullOrUndefined)(_a(t,ys))||!e||"shiftEnter"!==e.action&&"upArrow"!==e.action&&"downArrow"!==e.action){if(t&&t.classList.contains(is)&&e&&("upArrow"===e.action||"downArrow"===e.action||"shiftEnter"===e.action)){var i=parseInt(t.parentElement.getAttribute(Rs),10)-1;if(e&&("upArrow"===e.action||"shiftEnter"===e.action||"downArrow"===e.action)){a=this.parent.getContent().firstElementChild;"downArrow"===e.action?i+=1:i-=1,this.rowIndex=i,this.cellIndex=parseInt(t.getAttribute(xs),10)-1;h=this.parent.getRowByIndex(i);var n=this.parent.pageSettings.currentPage,r=Math.floor(a.offsetHeight/this.parent.getRowHeight())-1,s=!1;(0,o.isNullOrUndefined)(h)&&(s=!0,("downArrow"===e.action&&n===this.maxPage-1||("upArrow"===e.action||"shiftEnter"===e.action)&&1===n)&&(s=!1)),s||Ql(h,this.parent)&&"downArrow"===e.action||Xl(h,2*this.parent.getRowHeight())&&("upArrow"===e.action||"shiftEnter"===e.action)?(this.activeKey=e.action,a.scrollTop="downArrow"===e.action?(i-r)*this.parent.getRowHeight():i*this.parent.getRowHeight()):this.activeKey=this.empty,this.parent.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||this.parent.selectRow(i)}}}else{var a,l=(a=this.parent.getContent().firstElementChild).getBoundingClientRect(),h=(0,o.closest)(t,"tr"),d="downArrow"===e.action?h.nextElementSibling:h.previousElementSibling,p=(0,o.isNullOrUndefined)(d)?void 0:d.getBoundingClientRect();if((0,o.isNullOrUndefined)(d)||"downArrow"===e.action&&p.bottom>l.bottom||("upArrow"===e.action||"shiftEnter"===e.action)&&p.top<l.top){this.activeKey=e.action,this.parent.focusModule.virtualSelectionInfo={isPending:(0,o.isNullOrUndefined)(d),direction:e.action,event:e};var c=(0,o.isNullOrUndefined)(d)?this.parent.getRowHeight():"downArrow"===e.action?p.bottom-l.bottom:l.top-p.top;a.scrollTop="downArrow"===e.action?a.scrollTop+c:a.scrollTop-c}else this.activeKey=this.empty}},t.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var t=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?(0,o.extend)({},this.parent.getCurrentViewRecords()[e.index]):(0,o.extend)({},this.getRowObjectByIndex(e.index)),i=Object.keys(this.virtualData);e.data=i.length&&!this.parent.editSettings.showAddNewRow?this.virtualData:this.isInfiniteColumnvirtualization()?e.data:t,this.enableCacheOnInfiniteColumnVirtual()&&(this.virtualInfiniteData=e.data),e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis},t.prototype.getEditedRowObject=function(){for(var e,t=this.parent.vcRows,i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editedRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},t.prototype.refreshCache=function(e){if(!this.isInfiniteColumnvirtualization()){var t=Math.ceil((this.editedRowIndex+1)/this.getBlockSize());this.parent.allowPaging&&this.parent.enableColumnVirtualization&&(t=Math.ceil((this.editedRowIndex+1+(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize)/this.getBlockSize()));var i=this.parent.allowPaging&&this.parent.enableColumnVirtualization?this.editedRowIndex%this.getBlockSize():this.editedRowIndex-(t-1)*this.getBlockSize();if(!(this.parent.pinnedTopRowModels.length&&this.parent.pinnedTopRowModels.length>i))if(this.parent.groupSettings.columns.length){var n=this.getEditedRowObject();n&&(n.data=e.data)}else this.vgenerator.cache[parseInt(t.toString(),10)][parseInt(i.toString(),10)].data=e.data}},t.prototype.actionComplete=function(e){if(this.parent.enableVirtualization||this.parent.enableColumnVirtualization){var t=["delete","save","cancel"];t.some(function(t){return t===e.requestType})&&(this.refreshOffsets(),this.refreshVirtualElement()),this.isNormaledit&&(["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].some(function(t){return t===e.requestType})||t.some(function(t){return t===e.requestType}))&&(this.isCancel=!0,this.isAdd&&this.parent.editSettings&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.virtualEle.placeholder.style.height=parseInt(this.virtualEle.placeholder.style.height.toString(),10)-this.diff+"px"),this.isAdd=this.parent.editSettings.showAddNewRow,this.editedRowIndex=this.empty,this.virtualData={},this.virtualInfiniteData={},this.parent.editModule&&(this.parent.editModule.editModule.previousData=void 0)),this.parent.enableColumnVirtualization&&"filterAfterOpen"===e.requestType&&this.currentInfo.columnIndexes&&this.currentInfo.columnIndexes[0]>0&&this.parent.resetFilterDlgPosition(e.columnName)}},t.prototype.resetIsedit=function(){this.parent.enableVirtualization&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},t.prototype.scrollAfterEdit=function(){if(this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")){var e=this.parent.element.querySelector("."+fs),t=this.parent.element.querySelector("."+ms);if(e||t){var i=e?(0,o.extend)({},this.getRowObjectByIndex(this.editedRowIndex)):(0,o.extend)({},this.emptyRowData),n=Object.keys(this.virtualData);this.virtualData=n.length?this.getVirtualEditedData(this.virtualData):this.getVirtualEditedData(i)}}},t.prototype.createEmptyRowdata=function(){var e=this;this.parent.columnModel.filter(function(t){e.emptyRowData[t.field]=e.empty})},t.prototype.addActionBegin=function(e){if(this.isNormaledit){Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0;var t=this.parent.pageSettings.currentPage;!this.parent.frozenRows&&this.content.scrollTop>0&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.onActionBegin(),e.startEdit=!1,this.content.scrollTop=0),t<this.maxPage-1&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.parent.setProperties({pageSettings:{currentPage:this.maxPage-1}},!0),e.startEdit=!1,this.content.scrollTop=this.offsets[this.offsetKeys.length])}},t.prototype.getRowObjectByIndex=function(e){return this.getRowCollection(e,!0)},t.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},t.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},t.prototype.isEndBlock=function(e){var t=Fl(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return e>=t||e===t-1},t.prototype.isOddPageSize=function(){return this.parent.pageSettings.pageSize%2!=0},t.prototype.getOddBlockSize=function(){return this.isOddPageSize()?this.parent.pageSettings.pageSize/2:this.getBlockSize()},t.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getOddBlockSize()<1?1:e.length/this.getOddBlockSize())},t.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getOddBlockSize())},t.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[parseInt(e.toString(),10)]},t.prototype.getModelGenerator=function(){return new Bd(this.parent)},t.prototype.resetScrollPosition=function(e){if(this.actions.some(function(t){return t===e})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0,Object.keys(this.currentInfo).length)){var t=this.currentInfo.offsets&&!(0,o.isNullOrUndefined)(this.currentInfo.offsets.left)?this.currentInfo.offsets.left:0;this.currentInfo=this.getInfoFromView(this.currentInfo.direction,this.currentInfo.sentinelInfo,{top:0,left:t})}"virtualscroll"!==e&&(this.isAdd=!1)},t.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},t.prototype.getRows=function(){return this.isInfiniteColumnvirtualization()?this.getInfiniteRows():this.vgenerator.getRows()},t.prototype.getRowByIndex=function(e){var t;if(Fl(this.parent))if(!(0,o.isNullOrUndefined)(e)&&this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)for(var i=0;i<this.parent.getDataRows().length;i++)parseInt(this.parent.getDataRows()[parseInt(i.toString(),10)].getAttribute(Rs),10)-1===e&&(t=this.parent.getDataRows()[parseInt(i.toString(),10)]);else t=(0,o.isNullOrUndefined)(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];else!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?t=(0,o.isNullOrUndefined)(e)?void 0:this.enableCacheOnInfiniteColumnVirtual()?this.parent.getDataRows().find(function(t){return parseInt(t.getAttribute(Rs),10)-1===e}):this.parent.getDataRows()[parseInt(e.toString(),10)]:this.prevInfo&&(t=this.getRowCollection(e,!1));return t},t.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},t.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},t.prototype.getRowCollection=function(e,t){var i=(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize();this.parent.pageSettings.pageSize%2!=0&&(i+=Math.floor(i/this.getBlockSize()/2));var n=this.parent.getDataRows(),r=this.parent.pinnedTopRowModels,s=t?this.parent.getCurrentViewRecords():n;t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(i=parseInt(this.parent.getRows()[0].getAttribute(Rs),10)-1,s=s.filter(function(e){return(0,o.isNullOrUndefined)(e.items)})),!t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&n.length&&(i=parseInt(n[0].getAttribute(Rs),10)-1);var a=s[e-i];if(r.length)return e<r.length?a=t?r[parseInt(e.toString(),10)].data:n[parseInt(e.toString(),10)]:(a=t?s[e-i-r.length]:a,this.parent.groupSettings.columns.length&&(a=t?s[e-i]:a)),a;if(t&&!this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&this.parent.aggregates){var l=n[e-i],h=this.parent.getRowObjectFromUID(l.getAttribute("data-uid"));h&&(a=h.data)}return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=t?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?n[parseInt(e.toString(),10)]:n[e-i+this.parent.frozenRows]),a},t.prototype.getVirtualRowIndex=function(e){if((0,o.isNullOrUndefined)(this.prevInfo))return e;var t=this.prevInfo.blockIndexes,i=(t[0]-1)*this.getBlockSize();if(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)for(var n=this.vgenerator.cache[t[0]],r=0;r<n.length;r++)if(n[""+r].isDataRow){i=n[""+r].index;break}return i+e},t.prototype.refreshOffsets=function(){var e=this.parent,t=0,i=this.getBlockSize(),n=this.getOddBlockSize(),r=Fl(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();this.prevHeight=this.offsets[parseInt(r.toString(),10)],this.maxBlock=r%2==0?r-2:r-1,this.offsets={};for(var s=Array.apply(null,Array(r)).map(function(){return++t}),o=0;o<s.length;o++){var a=(this.vgenerator.cache[s[parseInt(o.toString(),10)]]||[]).length,l=Fl(this.parent)?this.isOddPageSize()?Math.ceil(e.vcRows.length%n):e.vcRows.length%i:this.isOddPageSize()?Math.ceil(this.count%n):this.count%i,h=!Fl(this.parent)&&s[parseInt(o.toString(),10)]in this.vgenerator.cache?a*this.parent.getRowHeight():l&&s[parseInt(o.toString(),10)]===r?l*this.parent.getRowHeight():this.getBlockHeight();!this.isOddPageSize()||s[parseInt(o.toString(),10)]in this.vgenerator.cache||l&&s[parseInt(o.toString(),10)]===r||(h=(s[parseInt(o.toString(),10)]%2!=0?Math.floor(n):Math.ceil(n))*this.parent.getRowHeight()),this.offsets[s[parseInt(o.toString(),10)]]=(0|this.offsets[s[parseInt(o.toString(),10)]-1])+h,this.tmpOffsets[s[parseInt(o.toString(),10)]]=0|this.offsets[s[parseInt(o.toString(),10)]-1]}this.offsetKeys=Object.keys(this.offsets),Fl(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},t.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},t.prototype.setVisible=function(e){var t,i=this.parent,n=[];(n=this.getRows()).some(function(e){return e.isDataRow&&(t=e),e.isDataRow});var r=!0;!i.groupSettings.columns.length&&t&&(r=!1);for(var s=i.getDataRows(),a=0,l=e.length;a<l;a++){var h=e[parseInt(a.toString(),10)],d=i.getNormalizedColumnIndex(h.uid),p=!0===h.visible?"":"none",c=this.getColGroup().children;if(-1!==d&&t&&d<t.cells.length&&(0,o.setStyleAttribute)(c[parseInt(d.toString(),10)],{display:p}),!r){var u=void 0;h.width&&(u=h.visible?this.virtualEle.wrapper.offsetWidth+parseInt(h.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(h.width.toString(),10)),u>i.width?(this.setDisplayNone(s,d,p,n),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(u+""),this.refreshVirtualElement()):r=!0}!this.parent.invokedFromMedia&&h.hideAtMedia&&this.parent.updateMediaColumns(h),this.parent.invokedFromMedia=!1}!r||this.parent.enableVirtualization&&this.parent.groupSettings&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?this.parent.notify(Wi,{rows:n,args:{isFrozen:!1,rows:n}}):this.refreshContentRows({requestType:"refresh"})},t.prototype.selectVirtualRow=function(e){var t=this,i=Fl(this.parent)?this.vgenerator.recordsCount:this.count;if(e.isAvailable=e.selectedIndex<i,e.isAvailable&&!this.isContextMenuOpen&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey&&!this.isSelection&&!this.requestTypes.some(function(e){return e===t.requestType})&&!this.parent.selectionModule.isInteracted){var n=this.parent.getRowByIndex(e.selectedIndex),r=this.parent.getRowHeight();if(!n||!this.isRowInView(n)){this.isSelection=!0,this.selectedRowIndex=e.selectedIndex;var s=e.selectedIndex*r;if(Fl(this.parent)){var a=this.parent.vcRows.findIndex(function(t){return t.index===e.selectedIndex});s=-1!==a?a*r:void 0,this.isSelection=-1!==a&&this.isSelection}else if(this.parent.groupSettings.columns.length&&this.parent.getDataModule().isRemote()){var l=Math.ceil((e.selectedIndex+1)/this.parent.pageSettings.pageSize),h=this.vgenerator.getBlockIndexes(l);s=this.offsets[h[0]]}if(!(0,o.isNullOrUndefined)(s)){var d=this.content.scrollTop<s?"down":"up";this.selectRowIndex=e.selectedIndex,this.content.scrollTop=s+1,this.isSelectionScroll=this.observer.check(d)}}}this.requestType=this.empty},t.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t>=this.content.getBoundingClientRect().top&&i<=this.content.getBoundingClientRect().bottom},t}(Ys),Ud=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.virtualEle=new Hd,n.isMovable=!1,n.gen=new Bd(n.parent),n.parent.on(wt,n.setVisible,n),n.parent.on(Ft,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?n.refreshUI():null},n),n}return zd(t,e),t.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+os))),e.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector("."+os),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||!this.parent.enableColumnVirtualization?this.virtualEle.renderPlaceHolder("absolute"):this.virtualEle.renderPlaceHolder()},t.prototype.appendContent=function(e){this.virtualEle.wrapper.appendChild(e)},t.prototype.refreshUI=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+os))),e.prototype.refreshUI.call(this)},t.prototype.setVisible=function(e){for(var t,i,n,r=this.parent,s=0,a=e.length;s<a;s++){var l=e[parseInt(s.toString(),10)];i=r.getNormalizedColumnIndex(l.uid),t=l.visible?"":"none";var h=this.getColGroup().children;if(r.getColumnByField(l.field)&&(0,o.setStyleAttribute)(h[parseInt(i.toString(),10)],{display:t}),r.enableColumnVirtualization&&!r.groupSettings.columns.length){var d=void 0;(d=l.visible?this.virtualEle.wrapper.offsetWidth+parseInt(l.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(l.width.toString(),10))>r.width?(this.setDisplayNone(l,t),this.virtualEle.setWrapperWidth(d+""),this.gen.refreshColOffsets()):n=!0}else n=!0;n&&this.refreshUI()}},t.prototype.setDisplayNone=function(e,t){for(var i=this.getTable(),n=0,r=[].slice.apply(i.querySelectorAll("th.e-headercell"));n<r.length;n++){var s=r[n];if(s.querySelector("[data-mappinguid]")&&s.querySelector("[data-mappinguid]").getAttribute("data-mappinguid")===e.uid){(0,o.setStyleAttribute)(s,{display:t}),""===t&&(0,o.removeClass)([s],"e-hide");break}}},t}(Zs),Hd=function(){function e(){}return e.prototype.renderWrapper=function(e){this.wrapper=(0,o.createElement)("div",{className:"e-virtualtable"}),this.wrapper.style.minHeight=(0,o.formatUnit)(e),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},e.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=(0,o.createElement)("div",{className:"e-virtualtrack"}),this.placeholder.style.position=e,this.content.appendChild(this.placeholder)},e.prototype.renderVerticalScrollbar=function(){this.verticalScrollbar=(0,o.createElement)("div",{className:"e-virtual-vertical-scrollbar"}),this.gridContent.appendChild(this.verticalScrollbar),this.verticalScrollerContainer=(0,o.createElement)("div",{className:"e-virtual-vertical-track"}),this.verticalScrollbar.appendChild(this.verticalScrollerContainer)},e.prototype.renderHorizontalScrollbar=function(){this.horizontalScrollbar=(0,o.createElement)("div",{className:"e-virtual-horizontal-scrollbar"}),this.gridContent.appendChild(this.horizontalScrollbar),this.horizontalScrollerContainer=(0,o.createElement)("div",{className:"e-virtual-horizontal-track"}),this.horizontalScrollbar.appendChild(this.horizontalScrollerContainer)},e.prototype.renderFrozenWrapper=function(e){this.wrapper=(0,o.createElement)("div",{className:"e-virtualtable"}),this.wrapper.style.cssText="min-height:"+(0,o.formatUnit)(e)+"; display: flex;",this.content.appendChild(this.wrapper)},e.prototype.renderFrozenPlaceHolder=function(){this.placeholder=(0,o.createElement)("div",{className:"e-virtualtrack"}),this.content.appendChild(this.placeholder)},e.prototype.adjustTable=function(e,t){Kh()?this.wrapper.style.transform="translate3d("+e+"px, "+t+"px, 0px) translateZ(0)":this.wrapper.style.transform="translate("+e+"px, "+t+"px)"},e.prototype.setWrapperWidth=function(e,t){!e||-1!==e.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(e,10)||(e=void 0,t=!0),this.wrapper.style.width=e?e+"px":t?"100%":""},e.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=(0,o.isNullOrUndefined)(e)?"0px":e+"px",!t||-1!==t.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(t,10)||(t="100%"),this.placeholder.style.width=t},e.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""},e}(),jd=function(){function e(e,t){this.parent=e,this.locator=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"virtualscroll"},e.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var e=this.locator.getService("rendererFactory");this.parent.enableColumnVirtualization&&e.addRenderer(i.Header,new Ud(this.parent,this.locator)),e.addRenderer(i.Content,new qd(this.parent,this.locator)),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||this.ensurePageSize()},e.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=this.parent.height.toString().indexOf("%")<0?this.parent.height:this.parent.element.getBoundingClientRect().height;this.blockSize=~~(parseFloat(t.toString())/e);var i=2*this.blockSize,n=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:n<i?i:n}},!0)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Me,this.instantiateRenderer,this),this.parent.on(It,this.refreshVirtualElement,this),this.parent.on(Rr,this.createVirtualValidationForm,this),this.parent.on(Dr,this.virtualEditFormValidation,this),this.parent.on(Ct,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.instantiateRenderer),this.parent.off(It,this.refreshVirtualElement),this.parent.off(Rr,this.createVirtualValidationForm),this.parent.off(Dr,this.virtualEditFormValidation),this.parent.off(Ct,this.destroy))},e.prototype.getCurrentEditedData=function(e,t){var i={virtualData:(0,o.extend)({},{},e,!0),isAdd:!1,isScroll:!1,endEdit:!0};return this.parent.notify(vn,i),t?i:i.virtualData},e.prototype.createVirtualValidationForm=function(e){var t=this.parent;if(t.enableVirtualization&&"Normal"===t.editSettings.mode){var i=t.columns,n=new js(this.locator,null,this.parent),r=(0,o.extend)({},{},t.getRowObjectFromUID(e.uid),!0);t.notify(br,r);var s=e.argsCreator(this.getCurrentEditedData(e.prevData),{},!1);s.isCustomFormValidation=!0,s.row=n.render(r,i),e.renderer.update(s);for(var a={},l=0;l<i.length;l++)i[parseInt(l.toString(),10)].visible&&i[parseInt(l.toString(),10)].validationRules&&Ch(i[parseInt(l.toString(),10)],0,a,{},{},i.length,!0);s.form.classList.add("e-virtual-validation"),t.editModule.virtualFormObj=t.editModule.createFormObj(s.form,a)}},e.prototype.virtualEditFormValidation=function(e){var t=this.parent,i=t.element.querySelector('.e-griderror:not([style*="display: none"])');if(t.editModule.virtualFormObj)if(i&&"none"!==i.style.display){var n=i.getBoundingClientRect(),r=t.element.querySelectorAll(".e-gridform"),s=r[0],a=t.getContent().getBoundingClientRect().left;if(r.length>1&&(s=r[1]),n.left<a||n.right>t.element.offsetWidth){var l=s.querySelector('.e-tooltip-wrap:not([style*="display: none"])');this.scrollToEdit(l,{editIdx:e.editIdx,addIdx:e.addIdx},!0)}}else if(t.editModule.virtualFormObj&&(!i||"none"===i.style.display)){for(var h=t.editModule.virtualFormObj.element.querySelectorAll('.e-tooltip-wrap:not([style*="display: none"])'),d=0;d<h.length;d++)(0,o.remove)(h[parseInt(d.toString(),10)]);var p=this.getCurrentEditedData(e.prevData,!0);if(this.setEditedDataToValidationForm(t.editModule.virtualFormObj.element,p.virtualData),e.isValid=t.editModule.virtualFormObj.validate(),e.isValid&&(this.parent.editModule.editModule.virtualEditValidationArgs=p),!e.isValid){l=t.editModule.virtualFormObj.element.querySelector('.e-tooltip-wrap:not([style*="display: none"])');this.scrollToEdit(l,{editIdx:e.editIdx,addIdx:e.addIdx})}}},e.prototype.scrollToEdit=function(e,t,i){var n=this.parent;if(e){var r=n.columnModel,s=cl(e.id).split("_")[0],a=n.getColumnByField(s),l=this.parent.getContent().firstElementChild.scrollTop,h=n.getRowByIndex(t.editIdx);if(!(0,o.isNullOrUndefined)(t.addIdx)&&l>0||!(0,o.isNullOrUndefined)(t.editIdx)&&!h||i||!a){for(var d=void 0,p=0;p<r.length&&!a;p++)if(r[parseInt(p.toString(),10)].field===s){d=r[parseInt(p.toString(),10)];break}i&&(d=a),this.parent.notify(Ir,d)}}},e.prototype.setEditedDataToTemplate=function(e,t){if(this.parent.isAngular&&"Normal"===this.parent.editSettings.mode)for(var i=this.parent.columnModel.filter(function(e){return e.editTemplate}),n=0,r=i.length;n<r;n++){var s=dl(i[parseInt(n.toString(),10)].field);if(!(0,o.isNullOrUndefined)(s)){var a=e[s],l=(0,o.getValue)(i[parseInt(n.toString(),10)].field,t);if(l=(0,o.isNullOrUndefined)(l)?"":l,a&&"combobox"===a.getAttribute("aria-label")&&a.closest(".e-combobox")){var h=a.closest(".e-combobox").ej2_instances[0];h.value=l,h.dataBind()}}}},e.prototype.setEditedDataToValidationForm=function(e,t){for(var i=[].slice.call(e.getElementsByClassName("e-field")),n=0,r=i.length;n<r;n++){var s=Th(this.parent,i[parseInt(n.toString(),10)].getAttribute("data-mappinguid"));if(s.field){var a=(0,o.getValue)(s.field,t);a=(0,o.isNullOrUndefined)(a)?"":a,i[parseInt(n.toString(),10)].value=a}}this.setEditedDataToTemplate(e,t)},e.prototype.refreshVirtualElement=function(e){this.parent.enableColumnVirtualization&&"resize"===e.module&&this.locator.getService("rendererFactory").getRenderer(i.Content).refreshVirtualElement()},e.prototype.destroy=function(){this.removeEventListener()},e}(),Vd=function(){function e(e){this.parent=e}return e.prototype.addNew=function(e,t){var i;if(this.isEdit=!1,i=(this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderTable().querySelector(Ds):this.parent.getContentTable().querySelector(Ds),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),this.parent.getContentTable().querySelector(".e-emptyrow")&&!this.parent.editSettings.showAddNewRow){var n=this.parent.getContentTable().querySelector(".e-emptyrow");n.parentNode.removeChild(n),this.parent.frozenRows&&this.parent.element.querySelector(".e-frozenrow-empty")&&this.parent.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}"Top"===this.parent.editSettings.newRowPosition?i.insertBefore(t.row,i.firstChild):i.appendChild(t.row),t.row.appendChild(this.getEditElement(e,!1,void 0,t,!0)),this.parent.editModule.checkLastRow(t.row,t)},e.prototype.update=function(e,t){this.isEdit=!0;var i=[].slice.call(t.row.querySelectorAll("td.e-rowcell"));t.row.innerHTML="",t.row.appendChild(this.getEditElement(e,!0,i,t,!0)),t.row.classList.add(fs),this.parent.editModule.checkLastRow(t.row,t)},e.prototype.getEditElement=function(e,t,i,n,r){var s=this.parent,a=0,l=(0,o.isNullOrUndefined)(s.detailTemplate)&&(0,o.isNullOrUndefined)(s.childGrid)?0:1;s.allowGrouping&&(a=s.groupSettings.columns.length);var h=this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(s.getCurrentVisibleColumns(this.parent.enableColumnVirtualization).length+this.parent.getIndentCount()).toString()}}),d=n.form=this.parent.createElement("form",{id:s.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)return this.appendChildren(d,n.rowData,r),h.appendChild(d),h;var p=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25",role:"grid"}});p.appendChild(s.getContentTable().querySelector(Ts).cloneNode(!0));var c=this.parent.createElement(Ds,{attrs:{role:"rowgroup"}}),u=this.parent.createElement("tr");this.parent.rowHeight&&(u.style.height=this.parent.rowHeight+"px");var g=0;for(l&&u.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),u.firstChild),s.isRowDragable()&&u.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));g<a;)u.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),g++;var f,m=0;g=0;for(var y=!0,v=n.isCustomFormValidation?this.parent.columnModel:s.getColumns();t&&m<i.length&&g<v.length||g<v.length;){var S=t&&i[parseInt(m.toString(),10)]?i[parseInt(m.toString(),10)].getAttribute("colspan"):null,C=v[parseInt(g.toString(),10)];f=e[C.uid].value,f=(0,o.isNullOrUndefined)(f)?"":f;var w=this.parent.createElement("td",{className:is,attrs:{colspan:S||""}});if(w.style.cssText=C.textAlign?"text-align: "+C.textAlign+";":"",C.visible?(w.appendChild(e[C.uid]),"Vertical"===this.parent.rowRenderingMode&&(qa(w,{"data-cell":C.headerText}),0===g&&w.classList.add("e-responsive-editcell")),"booleanedit"===C.editType?w.classList.add("e-boolcell"):(C.commands||C.commandsTemplate)&&(0,o.addClass)([w],"e-unboundcell"),this.parent.enableRtl||"Vertical"!==s.gridLines&&"Both"!==s.gridLines||!y||(a?w.classList.add("e-grid-group-first-cell"):this.parent.renderModule&&this.parent.renderModule.isFirstColumnHidden&&!(this.parent.allowRowDragAndDrop||this.parent.childGrid||this.parent.detailTemplate)&&w.classList.add("e-first-visible-cell"),y=!1)):w.classList.add("e-hide"),this.parent.isFrozenGrid()){if(yh(this.parent,C,w),this.parent.isSpan){var b=w.getAttribute("colspan")?parseInt(w.getAttribute("colspan"),10):1;fh(this.parent,C,w,b)}this.parent.enableColumnVirtualization&&("Left"!==C.freeze||(0,o.isNullOrUndefined)(C.valueX)?"Right"!==C.freeze||(0,o.isNullOrUndefined)(C.valueX)?"Fixed"===C.freeze&&(w.style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",w.style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"):w.style.right=C.valueX+this.parent.translateX+"px":w.style.left=C.valueX-this.parent.translateX+"px")}w.setAttribute("aria-label",f+this.parent.localeObj.getConstant("ColumnHeader")+C.headerText),u.appendChild(w),g=S?g+parseInt(S,10):g+1,m++}return uh(u),c.appendChild(u),p.appendChild(c),d.appendChild(p),h.appendChild(d),h},e.prototype.removeEventListener=function(){},e.prototype.appendChildren=function(e,t,i){var n=(0,o.extend)({},t,{isAdd:!this.isEdit,isFrozen:i},!0),r=this.parent.element.id+"editSettingsTemplate";!this.parent.isReact||"string"==typeof this.parent.editSettings.template||this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate?$a(e,this.parent.getEditTemplate()(n,this.parent,"editSettingsTemplate",r,null,null,null,this.parent.root)):(this.parent.getEditTemplate()(n,this.parent,"editSettingsTemplate",r,null,null,e),this.parent.renderTemplates())},e}(),Gd=function(){function e(e){this.parent=e}return e.prototype.update=function(e,t){if(this.parent.isReact&&t.columnObject&&t.columnObject.template){var i=t.cell.parentElement,n=t.cell.cloneNode(!0);i.insertBefore(n,t.cell),n.focus(),t.cell.remove(),t.cell=n}t.cell.setAttribute("aria-label",t.cell.innerHTML+this.parent.localeObj.getConstant("ColumnHeader")+t.columnObject.field),t.cell.innerHTML="",t.cell.appendChild(this.getEditElement(e,t)),t.cell.classList.add("e-editedbatchcell"),(0,o.classList)(t.row,[fs,"e-batchrow"],[])},e.prototype.getEditElement=function(e,t){var i=this.parent,n=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return n.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),n},e}(),_d=function(){function e(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(Qt,this.destroy,this),this.parent.on(Ct,this.destroy,this))}return e.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},e.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},e.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},e.prototype.createDialogHeader=function(e){var t=this,i=this.parent;if(this.parent.enableAdaptiveUI){var n=new To(this.parent,this.serviceLocator);return n.action=this.isEdit?r.isEdit:r.isAdd,n.renderResponsiveHeader(void 0,e)}return i.editSettings.headerTemplate?(0,o.initializeCSPTemplate)(function(){return t.getDialogEditTemplateElement("HeaderTemplate",e).outerHTML}):this.isEdit?this.l10n.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},e.prototype.createDialog=function(e,t){var i=this,n=this.parent;this.dialog=this.parent.createElement("div",{id:n.element.id+"_dialogEdit_wrapper"}),this.dialog.style.width="auto",n.enableAdaptiveUI&&this.dialog.classList.add("e-responsive-dialog"),n.element.appendChild(this.dialog),this.setLocaleObj(),this.dialog.setAttribute("aria-label",this.l10n.getConstant("DialogEdit")),this.dialogObj=new y.Dialog((0,o.extend)({header:this.createDialogHeader(t),isModal:!0,visible:!0,cssClass:this.parent.cssClass?"e-edit-dialog "+this.parent.cssClass:"e-edit-dialog",content:this.getEditElement(e,t),showCloseIcon:!0,allowDragging:!0,close:this.dialogClose.bind(this),created:this.dialogCreated.bind(this),closeOnEscape:!0,width:n.editSettings.template?"auto":"330px",target:t.target?t.target:document.body,animationSettings:{effect:"None"},footerTemplate:n.editSettings.footerTemplate?(0,o.initializeCSPTemplate)(function(){return i.getDialogEditTemplateElement("FooterTemplate",t).outerHTML}):null,buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},n.editSettings.dialog&&n.editSettings.dialog.params||{})),t.dialog=this.dialogObj;this.dialogObj.isStringTemplate=!0,this.renderResponsiveDialog(),ah(this.parent,this.dialogObj),this.dialogObj.appendTo(this.dialog),Vl(this.parent.element,this.dialogObj.element.parentElement),n.enableAdaptiveUI&&this.dialogObj.show(!0)},e.prototype.dialogCreated=function(){bh(this.parent)},e.prototype.renderResponsiveDialog=function(){var e=this;this.parent.enableAdaptiveUI&&(this.parent.adaptiveDlgTarget&&(this.dialogObj.target=this.parent.adaptiveDlgTarget),this.dialogObj.buttons=[{}],this.dialogObj.showCloseIcon=!0,this.dialogObj.visible=!1,this.dialogObj.width="100%",this.dialogObj.open=function(){e.dialogObj.element.style.maxHeight="100%"})},e.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},e.prototype.dialogClose=function(){this.parent.closeEdit()},e.prototype.destroy=function(e){for(var t=["template","headerTemplate","footerTemplate"],i=0;i<t.length;i++)if(this.parent.editSettings[t[parseInt(i.toString(),10)]]){var n=t[parseInt(i.toString(),10)].charAt(0).toUpperCase()+t[parseInt(i.toString(),10)].slice(1),r=this.parent.element.id+"editSettings"+n;(0,o.updateBlazorTemplate)(r,n,this.parent.editSettings)}this.parent.notify(Jt,{}),this.parent.isEdit=!1,this.parent.notify(Lt,{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),(0,o.remove)(this.dialog))},e.prototype.getDialogEditTemplateElement=function(e,t){var i=this.parent.createElement("div",{className:"e-dialog"+e}),n=(0,o.extend)({},t.rowData,{isAdd:!this.isEdit},!0),r=this.parent.element.id+"editSettings"+e;return $a(i,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(n,this.parent,"editSettings"+e,r)),(0,o.updateBlazorTemplate)(r,e,this.parent.editSettings),i},e.prototype.getEditElement=function(e,t){var i=this,n=this.parent,r=this.parent.createElement("div",{className:this.isEdit?fs:"e-insertedrow"}),s=t.form=this.parent.createElement("form",{id:n.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template){var a=this.parent.element.id+"editSettingsTemplate",l=(0,o.extend)({},t.rowData,{isAdd:!this.isEdit},!0),h=this.parent.isReact&&"string"!=typeof this.parent.editSettings.template&&!(this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;h||d?(this.parent.getEditTemplate()(l,this.parent,"editSettingsTemplate",a,null,null,s),this.parent.renderTemplates()):$a(s,this.parent.getEditTemplate()(l,this.parent,"editSettingsTemplate",a,null,null,null,n.root));return(0,o.updateBlazorTemplate)(a,"Template",this.parent.editSettings,!0,function(){for(var e=i.parent.getColumns(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].validationRules&&(i.parent.editModule.formObj.rules[e[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].validationRules)}),r.appendChild(s),r}for(var p=this.parent.createElement("table",{className:cs,attrs:{cellspacing:"6px",role:"grid"}}),c=this.parent.createElement(Ds,{attrs:{role:"rowgroup"}}),u=n.getColumns(),g=0;g<u.length;g++)if(!(this.parent.editModule.checkColumnIsGrouped(u[parseInt(g.toString(),10)])||u[parseInt(g.toString(),10)].commands||u[parseInt(g.toString(),10)].commandsTemplate||"checkbox"===u[parseInt(g.toString(),10)].type)){var f=this.parent.createElement("tr",{attrs:{role:"row"}}),m=this.parent.createElement("td",{className:is});m.style.cssText="text-align: "+(this.parent.enableRtl?"right":"left")+"; width: 190px;",e[u[parseInt(g.toString(),10)].uid].classList.remove("e-input"),m.appendChild(e[u[parseInt(g.toString(),10)].uid]),f.appendChild(m),c.appendChild(f)}return p.appendChild(c),s.appendChild(p),r.appendChild(s),r},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Qt,this.destroy),this.parent.off(Ct,this.destroy))},e}(),Kd=function(){function e(e,t){this.editType={Inline:Vd,Normal:Vd,Batch:Gd,Dialog:_d},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}return e.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},e.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),e.isCustomFormValidation||(this.parent.notify(Gi,e),this.convertWidget(e))},e.prototype.convertWidget=function(e){for(var t,i,n=this.parent,r="Dialog"===n.editSettings.mode?(0,o.select)("#"+n.element.id+"_dialogEdit_wrapper .e-gridform",document):n.editSettings.showAddNewRow&&n.element.querySelector(".e-editedrow")?n.element.querySelector(".e-editedrow").getElementsByClassName("e-gridform")[0]:n.element.getElementsByClassName("e-gridform")[0],s=0,a="Batch"!==n.editSettings.mode?n.getColumns():[n.getColumnByField(e.columnName)];s<a.length;s++){var l=a[s];if(!this.parent.editSettings.template||(0,o.isNullOrUndefined)(l.field)){if(!this.parent.editModule.checkColumnIsGrouped(l)&&!l.commands){l.valueAccessor(l.field,e.rowData,l),i=r.querySelector("[data-mappinguid="+l.uid+"]");var h=l.edit.write;if(!(0,o.isNullOrUndefined)(i)&&("string"==typeof h?(h=Ml(h,window))({rowData:e.rowData,element:i,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&Ml(l.field,e.foreignKeyData)}):l.edit.write({rowData:e.rowData,element:i,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&Ml(l.field,e.foreignKeyData)}),!t&&(0,o.isNullOrUndefined)(i.getAttribute("disabled"))&&!_a(i,"e-checkbox-disabled"))){var d=!(0,o.isNullOrUndefined)(l.edit)&&!(0,o.isNullOrUndefined)(l.edit.params)&&l.edit.params.multiline;if("hidden"===i.getAttribute("type")&&d&&i.parentElement&&i.parentElement.classList.contains("e-multi-line-input")){var p=i.parentElement.querySelector("textarea");p&&this.focusElement(p,e.type)}else this.focusElement(i,e.type);t=!0}}}else{var c=(0,o.extend)({},e);c.element=r.querySelector("[name="+dl(l.field)+"]"),"string"==typeof l.edit.write?Ml(l.edit.write,window)(c):l.edit.write(c)}}},e.prototype.focusElement=function(e,t){var i=this.parent.element.querySelector(".e-edit-checkselect");if(!(0,o.isNullOrUndefined)(i)&&i.nextElementSibling&&i.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode)this.focus.onClick({target:(0,o.closest)(e,"td")},!0);else{var n=!this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization||"Normal"!==this.parent.editSettings.mode,r=e.classList.contains("e-dropdownlist")?e.parentElement:e;(n||(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&"Bottom"===this.parent.editSettings.newRowPosition&&_a(e,ms))&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!_a(e,ms)||this.parent.addNewRowFocus)?(r.focus(),this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode&&this.parent.contentModule&&this.parent.contentModule.content&&(this.parent.contentModule.content.scrollTop+=this.parent.getRowHeight())):r.focus({preventScroll:!0})}e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},e.prototype.getEditElements=function(e){var i=this.parent,n={},r="Batch"!==i.editSettings.mode?i.getColumns():[i.getColumnByField(e.columnName)];if(e.isCustomFormValidation&&(r=this.parent.columnModel),this.parent.editSettings.template)return{};for(var s=0,a=r.length;s<a;s++){var l=r[parseInt(s.toString(),10)];if(l.commands||l.commandsTemplate){var h=this.serviceLocator.getService("cellRendererFactory"),d=new Vs(this.parent),p=h.getCellRenderer(t.CommandColumn),c=d.generateRows(e.rowData)[0].cells.filter(function(e){return e.rowID}),u=p.render(c[parseInt(s.toString(),10)],e.rowData,{"data-index":e.row?(parseInt(e.row.getAttribute(Rs),10)-1).toString():0},this.parent.enableVirtualization);(I=u.firstElementChild).setAttribute("textAlign",u.getAttribute("textAlign")),n[l.uid]=I}else{if("dateonly"===l.type&&e.rowData[l.field]instanceof Date){var g=e.rowData[l.field];e.rowData[l.field]=g.getFullYear()+"-"+kl(g.getMonth()+1)+"-"+kl(g.getDate())}var f=l.valueAccessor(l.field,e.rowData,l),m={column:l,value:f,type:e.requestType,data:e.rowData},y=l.edit.create,v=void 0;if(l.editTemplate){v=this.parent.createElement("span",{attrs:{"data-mappinguid":l.uid}});var S=this.parent.element.id+l.uid+"editTemplate",C=Bl({},e.rowData,{column:l}),w=this.parent.isReact&&"string"!=typeof l.editTemplate&&!(l.editTemplate.prototype&&l.editTemplate.prototype.CSPTemplate),b=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;if(w||b)l.getEditTemplate()((0,o.extend)({index:e.rowIndex},C),this.parent,"editTemplate",S,null,null,v),this.parent.renderTemplates();else $a(v,l.getEditTemplate()((0,o.extend)({index:e.rowIndex},C),this.parent,"editTemplate",S,null,null,null,i.root))}else{var I;if("string"==typeof(v="string"==typeof y?(y=Ml(y,window))(m):l.edit.create(m)))(I=this.parent.createElement("div")).innerHTML=v,v=I.firstChild;var x="input"!==v.tagName&&v.querySelectorAll("input").length,R=dl(l.field);(0,o.attributes)(x?v.querySelector("input"):v,{name:R,"data-mappinguid":l.uid,id:i.element.id+R}),(0,o.classList)(v,["e-input","e-field"],[]),"Right"===l.textAlign&&v.classList.add("e-ralign"),((l.isPrimaryKey||l.isIdentity)&&"beginEdit"===e.requestType||l.isIdentity&&"add"===e.requestType)&&v.setAttribute("disabled","")}n[l.uid]=v}}return n},e.prototype.destroy=function(){this.renderer.removeEventListener()},e}(),Wd=function(){function e(e){this.parent=e}return e.prototype.create=function(e){return Dh(this.parent,e.column,"e-field",{type:"text"})},e.prototype.read=function(e){return e.ej2_instances[0].value},e.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.removeEventHandler&&this.removeEventHandler(),this.obj.destroy(),this.obj.element.remove())},e}(),Qd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.activeClasses=["e-selectionbackground","e-active"],t}return Qd(t,e),t.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),this.removeEventHandler=this.removeEventListener,Dh(this.parent,e.column,t,{type:"checkbox",value:e.value})},t.prototype.read=function(e){return e.checked},t.prototype.write=function(e){var t,i;if((0,o.isNullOrUndefined)(e.row)||(t=e.row.querySelector(".e-edit-checkselect")),Ml(e.column.field,e.rowData)&&(i=JSON.parse(Ml(e.column.field,e.rowData).toString().toLowerCase())),!(0,o.isNullOrUndefined)(t)&&"checkbox"===e.column.type){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var n=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));i=!!n&&n.isSelected}vl.apply(void 0,[[].slice.call(e.row.getElementsByClassName(is)),i].concat(this.activeClasses))}this.obj=new Js.CheckBox((0,o.extend)({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!ul(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass?this.parent.cssClass:""},e.column.edit.params)),this.addEventListener(),this.obj.appendTo(e.element)},t.prototype.addEventListener=function(){this.cbChange=this.checkBoxChange.bind(this),this.obj.addEventListener(Os,this.cbChange)},t.prototype.removeEventListener=function(){this.obj.isDestroyed||this.obj.removeEventListener(Os,this.cbChange)},t.prototype.checkBoxChange=function(e){if(this.editRow&&"Dialog"!==this.editType&&this.editRow.getAttribute("aria-rowindex")){var t=parseInt(this.editRow.getAttribute("aria-rowindex"),10)-1;this.parent.selectionModule.addRowsToSelection([t])}},t}(Wd),Yd=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jd=function(e){function t(t){var i=e.call(this)||this;return i.parent=t,i.flag=!1,i.removeEventHandler=i.removeEventListener,i}return Yd(t,e),t.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode;this.column=e.column;var i=new a.Predicate(e.column.field,"notequal",null,!0,!1),n={};if(e.column.edit.params)for(var r=Object.keys(e.column.edit.params),s=0;s<r.length;s++)n[r[parseInt(s.toString(),10)]]="query"===r[parseInt(s.toString(),10)]?e.column.edit.params[r[parseInt(s.toString(),10)]].clone():e.column.edit.params[r[parseInt(s.toString(),10)]];this.obj=new Yh.DropDownList((0,o.extend)({dataSource:this.parent.dataSource instanceof a.DataManager?this.parent.dataSource:new a.DataManager(this.parent.dataSource),query:(new a.Query).where(i).select(e.column.field),enabled:ul(e.column,e.requestType,e.element)&&gl(_a(e.element,"e-rowcell"),this.parent),fields:{value:e.column.field},value:Ml(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:t?"":e.column.headerText,popupHeight:"200px",floatLabelType:t?"Never":"Always",sortOrder:"Ascending",cssClass:this.parent.cssClass?this.parent.cssClass:null,close:this.dropDownClose.bind(this)},n)),this.obj.isAngular=lh(this.parent),this.parent.enableVirtualization&&(n.dataSource?this.obj.dataSource=n.dataSource:this.obj.dataSource=e.column.isForeignColumn()?[e.foreignKeyData[0]]:[e.rowData]),this.addEventListener(),this.obj.query.params=this.parent.query.params,this.obj.appendTo(e.element),e.element.setAttribute("name",dl(e.column.field))},t.prototype.dropDownClose=function(e){e.event&&("escape"===e.event.action?this.parent.editModule.editCellDialogClose=!0:this.parent.isEdit&&"Batch"===this.parent.editSettings.mode&&"enter"===e.event.action&&e.event.stopPropagation())},t.prototype.addEventListener=function(){this.ddCreated=this.dropdownCreated.bind(this),this.ddOpen=this.dropDownOpen.bind(this),this.ddBeforeOpen=this.dropdownBeforeOpen.bind(this),this.ddComplete=this.ddActionComplete.bind(this),this.obj.addEventListener(As,this.ddCreated),this.obj.addEventListener(Es,this.ddOpen),this.obj.addEventListener(Fs,this.ddBeforeOpen),this.obj.addEventListener(D,this.ddComplete)},t.prototype.removeEventListener=function(){this.obj.isDestroyed||(this.obj.removeEventListener(As,this.ddCreated),this.obj.removeEventListener(Es,this.ddOpen),this.obj.removeEventListener(Fs,this.ddBeforeOpen),this.obj.removeEventListener(D,this.ddComplete))},t.prototype.dropdownCreated=function(e){this.flag=!0},t.prototype.dropdownBeforeOpen=function(){this.parent.enableVirtualization&&(this.column.edit.params&&this.column.edit.params.dataSource?this.obj.dataSource=this.column.edit.params.dataSource:this.obj.dataSource=this.column.isForeignColumn()?this.column.dataSource instanceof a.DataManager?this.column.dataSource:new a.DataManager(this.column.dataSource):this.parent.dataSource instanceof a.DataManager?this.parent.dataSource:new a.DataManager(this.parent.dataSource))},t.prototype.ddActionComplete=function(e){e.result=a.DataUtil.distinct(e.result,this.obj.fields.value,!0),!this.flag||!this.column.dataSource||this.column.edit.params&&this.column.edit.params.ddEditedData||("result"in this.column.dataSource?this.column.dataSource.result=e.result:this.column.dataSource instanceof a.DataManager&&(this.column.dataSource.dataSource.json=e.result)),this.flag=!1},t.prototype.dropDownOpen=function(e){var t=_a(this.obj.element,"e-dialog");if("Dialog"===this.parent.editSettings.mode&&!(0,o.isNullOrUndefined)(t)){var i=(0,o.select)("#"+t.id,document).ej2_instances[0];e.popup.element.style.zIndex=(i.zIndex+1).toString()}},t}(Wd),Zd=function(){function e(e){this.parent=e}return e.prototype.keyEventHandler=function(e){if(13===e.keyCode||9===e.keyCode){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)}},e.prototype.create=function(e){return this.instances=new o.Internationalization(this.parent.locale),Dh(this.parent,e.column,"e-field",{})},e.prototype.read=function(e){return this.obj.value},e.prototype.write=function(e){var t=e.column,i="Dialog"!==this.parent.editSettings.mode;this.obj=new Qh.NumericTextBox((0,o.extend)({value:parseFloat(Ml(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,enabled:ul(e.column,e.requestType,e.element)&&gl(_a(e.element,"e-rowcell"),this.parent),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",locale:this.parent.locale,cssClass:this.parent.cssClass?this.parent.cssClass:null},t.edit.params)),e.element.setAttribute("name",dl(e.column.field)),this.obj.appendTo(e.element),this.obj.element.addEventListener("keydown",this.keyEventHandler)},e.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())},e}(),$d=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ep=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $d(t,e),t.prototype.create=function(e){var t={type:"text",value:(0,o.isNullOrUndefined)(e.value)?"":e.value},i=Dh(this.parent,e.column,"e-field e-input e-defaultcell",t);return e.column.textAlign&&(i.style.textAlign=e.column.textAlign),i},t.prototype.read=function(e){return"hidden"!==e.type||(0,o.isNullOrUndefined)(e.ej2_instances[0])||(0,o.isNullOrUndefined)(e.ej2_instances[0].textarea)?e.value:e.ej2_instances[0].value},t.prototype.write=function(e){var t,i=e.column,n="Dialog"!==this.parent.editSettings.mode,r={element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",enableRtl:this.parent.enableRtl,enabled:ul(e.column,e.requestType,e.element)&&gl(_a(e.element,"e-rowcell"),this.parent),placeholder:n?"":e.column.headerText,cssClass:this.parent.cssClass?this.parent.cssClass:""};if(!(0,o.isNullOrUndefined)(i.edit)&&!(0,o.isNullOrUndefined)(i.edit.params)&&i.edit.params.multiline){var s=i.valueAccessor(i.field,e.rowData,i);r.value=s,t=r.element.getAttribute("data-mappinguid"),r.element.removeAttribute("data-mappinguid"),r.element.setAttribute("e-mappinguid",t)}this.obj=new Qh.TextBox((0,o.extend)(r,i.edit.params)),this.obj.appendTo(e.element),(0,o.isNullOrUndefined)(t)||(this.obj.element.removeAttribute("e-mappinguid"),this.obj.element.setAttribute("data-mappinguid",t)),"Batch"===this.parent.editSettings.mode&&this.obj.element.addEventListener("keydown",this.keyEventHandler)},t.prototype.keyEventHandler=function(e){if("Enter"===e.key||"Tab"===e.key){var t=new Event("change",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}},t.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())},t}(Wd),tp=function(){function e(e,t,i){this.args={},this.currentVirtualData={},this.parent=e,this.renderer=i,this.serviceLocator=t,this.addEventListener()}return e.prototype.clickHandler=function(e){var t=e.target,i=this.parent;i.editSettings.showAddNewRow&&(0,o.isNullOrUndefined)(i.element.querySelector("."+fs))||(_a(t,rs)&&_a(_a(t,rs),"e-grid").id===i.element.id||(i.frozenRows||i.pinnedTopRecords.length)&&_a(t,os)&&!_a(t,"e-columnheader"))&&!_a(t,"e-unboundcelldiv")&&(this.rowIndex=_a(t,is)?parseInt(_a(t,is).parentElement.getAttribute(Rs),10)-1:-1,i.isEdit&&i.editModule.endEdit())},e.prototype.dblClickHandler=function(e){!_a(e.target,is)||!this.parent.editSettings.allowEditOnDblClick||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||_a(e.target,"e-addedrow"))||e.target&&(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))||this.parent.editModule.startEdit(_a(e.target,us))},e.prototype.editComplete=function(e){this.parent.isEdit=!!this.parent.editSettings.showAddNewRow;var t="action";switch(e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"edit"===e[""+t]||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||"add"===e[""+t])||(this.parent.allowPaging&&e.index>0&&(e.index=this.parent.pageSettings.currentPage===Math.floor(e.index/this.parent.pageSettings.pageSize)+1?e.index%this.parent.pageSettings.pageSize:-1),this.parent.enableVirtualization&&e.index>0&&(this.parent.selectVirtualRowOnAdd=!0),this.parent.isTreeGrid&&this.parent.enableVirtualization&&(this.parent.sortSettings&&this.parent.sortSettings.columns.length||this.parent.filterSettings&&this.parent.filterSettings.columns.length||this.parent.searchSettings&&this.parent.searchSettings.key.length)||this.parent.selectRow(e.index)),this.parent.trigger(D,(0,o.extend)(e,{requestType:"save",type:D})),this.parent.notify(Sr,{requestType:"save",action:e[""+t]});break;case"delete":this.parent.trigger(D,(0,o.extend)(e,{requestType:"delete",type:D})),this.parent.isCheckBoxSelection||this.parent.enableInfiniteScrolling&&(this.parent.childGrid||this.parent.detailTemplate)||this.parent.selectRow(this.editRowIndex),this.parent.notify(Sr,{requestType:"delete",action:e[""+t]});break;case"refresh-aggregate-on-save":this.parent.trigger(D,(0,o.extend)(e,{requestType:"refresh-aggregate-on-save",type:D})),this.parent.selectRow(this.rowIndex),this.parent.notify(Sr,{requestType:"refresh-aggregate-on-save",action:e[""+t]})}},e.prototype.getEditArgs=function(e,t,i){for(var n=this.parent.getPrimaryKeyFieldNames(),r=[],s=0;s<n.length;s++)r.push(Ml(n[parseInt(s.toString(),10)],e));return{primaryKey:n,primaryKeyValue:r,requestType:"beginEdit",rowData:e,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:t&&t.foreignKeyData,target:void 0,isScroll:i}},e.prototype.startEdit=function(e){var t=this,i=this.parent;if(this.rowIndex=this.editRowIndex=parseInt(e.getAttribute(Rs),10)-1,i.enableVirtualization||i.enableColumnVirtualization||i.enableInfiniteScrolling){var n='.e-row[aria-rowindex="'+(this.rowIndex+1)+'"]';if(!this.parent.element.querySelector(n))return}var r={data:void 0,index:this.rowIndex,isScroll:!1};if(this.parent.notify(pn,r),Fl(i)){var s=i.getRowObjectFromUID(e.getAttribute("data-uid"));this.previousData=s.data}else this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling&&(!this.previousData||this.parent.infiniteScrollSettings.enableCache)?this.previousData=r.data:this.parent.enableVirtualization||(this.previousData=(0,o.extend)({},{},this.parent.getForeignKeyColumns().length||this.parent.allowGrouping&&this.parent.groupSettings.columns.length||this.parent.pinnedTopRowModels.length?this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data:i.getCurrentViewRecords()[this.rowIndex],!0));var a=(0,o.extend)({},{},r.data||this.previousData,!0);this.uid=e.getAttribute("data-uid");var l=i.getRowObjectFromUID(this.uid),h=this.getEditArgs(a,l,r.isScroll);h.row=e,h.isScroll?this.inlineEditHandler(h,e):(this.parent.notify(Rr,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),i.trigger(oe,h,function(n){n.type="actionBegin",i.trigger(R,n,function(i){i.cancel||t.inlineEditHandler(i,e)})}))},e.prototype.disabledShowAddRow=function(e,t){var i=this.parent.element.querySelector(".e-addedrow"),n=[].slice.call(i?i.querySelectorAll(".e-input"):[]);if(i&&i.querySelector(".e-unboundcell"))for(var r=[].slice.call(i.querySelector(".e-unboundcell").querySelectorAll(".e-btn")),s=0;s<r.length;s++)e?(r[parseInt(s.toString(),10)].classList.remove("e-disabled"),r[parseInt(s.toString(),10)].removeAttribute("disabled")):(r[parseInt(s.toString(),10)].classList.add("e-disabled"),r[parseInt(s.toString(),10)].setAttribute("disabled","disabled"));if(n.length)for(s=0;s<n.length;s++){var a=n[parseInt(s.toString(),10)],l=a.getAttribute("data-mappinguid"),h=this.parent.getColumnByUid(l),d=_a(a,"e-rowcell").querySelector(".e-error");d&&d.classList.remove("e-error"),a.ej2_instances?(t&&(0,o.isNullOrUndefined)(h.defaultValue)&&("checkbox"===a.type?(a.ej2_instances[0].checked=!1,a.checked=!1):(a.ej2_instances[0].value=null,a.value=null)),"checkbox"!==a.type||(0,o.isNullOrUndefined)(e)?(0,o.isNullOrUndefined)(e)||(a.ej2_instances[0].enabled=!(!e||!h.allowEditing)):a.ej2_instances[0].disabled=!e||!h.allowEditing):(t&&a.value&&a.value.length&&(0,o.isNullOrUndefined)(h.defaultValue)&&(a.value=null),(0,o.isNullOrUndefined)(e)||(e?h.allowEditing&&(a.classList.remove("e-disabled"),a.removeAttribute("disabled")):(a.classList.add("e-disabled"),a.setAttribute("disabled","disabled"))))}},e.prototype.inlineEditHandler=function(e,t){var i=this.parent;i.isEdit=!0,e.row=e.row?e.row:t,"Dialog"!==i.editSettings.mode&&i.clearSelection(),"Dialog"===i.editSettings.mode&&i.selectionModule&&(i.selectionModule.preventFocus=!0,e.row.classList.add("e-dlgeditrow")),this.renderer.update(e),this.uid=t.getAttribute("data-uid"),i.editModule.applyFormValidation(),i.editSettings.showAddNewRow&&!t.classList.contains("e-addedrow")&&this.disabledShowAddRow(!1,!0),e.type="actionComplete",i.trigger(D,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e,this.parent.allowTextWrap&&this.parent.notify(pi,{case:"textwrap"})},e.prototype.updateRow=function(e,t){var i=this,n=this.parent;this.editRowIndex=e;var r=n.getRowByIndex(e);if(r){var s={requestType:"save",action:"edit",type:R,data:t,cancel:!1,previousData:n.getCurrentViewRecords()[parseInt(e.toString(),10)],row:r};if(n.showSpinner(),n.enableInfiniteScrolling){this.uid=s.row.getAttribute("data-uid");var o=parseInt(s.row.getAttribute("aria-rowindex"),10)-1;this.parent.notify(Ar,{index:o})}n.notify(zt,s),s.promise?s.promise.then(function(){return n.refresh()}).catch(function(e){return i.edFail(e)}):n.enableInfiniteScrolling||(n.refresh(),n.enableVirtualization&&(n.contentModule.vgenerator.startIndex=null))}},e.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.editFormValidate(),i={prevData:this.previousData,isValid:!0,editIdx:this.editRowIndex,addIdx:this.addedRowIndex};return e.notify(Dr,i),t&&i.isValid},e.prototype.endEdit=function(){var e=this,t=this.parent;if(this.parent.isEdit&&this.editFormValidate()){var i=(0,o.extend)({},{},this.previousData,!0),n=(0,o.extend)(this.args,{requestType:"save",type:R,data:i,cancel:!1,previousData:this.previousData,selectedRow:t.selectedRowIndex,foreignKeyData:{}}),r="Dialog"===t.editSettings.mode,s=(0,o.select)("#"+t.element.id+"_dialogEdit_wrapper",document),a=r?s.querySelector(".e-gridform"):t.editSettings.showAddNewRow&&t.element.querySelector("."+fs)?t.element.querySelector("."+fs).getElementsByClassName("e-gridform")[0]:t.element.getElementsByClassName("e-gridform")[0],l={virtualData:(0,o.extend)({},{},this.previousData,!0),isAdd:!1,isScroll:!1,endEdit:!0};this.parent.enableVirtualization&&this.parent.editSettings&&"Normal"===this.parent.editSettings.mode?(l.virtualData=this.virtualEditValidationArgs.virtualData,l.isAdd=this.virtualEditValidationArgs.isAdd,l.isCancel=this.virtualEditValidationArgs.isCancel):this.parent.notify(vn,l),(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling)&&"Normal"===this.parent.editSettings.mode&&Object.keys(l.virtualData).length?this.parent.isEdit&&(this.currentVirtualData=i=n.data=l.virtualData):i=t.editModule.getCurrentEditedData(a,i);var h=[].slice.call(t.element.getElementsByClassName(fs)).length;if(l.isAdd||!Object.keys(this.currentVirtualData).length||h||(h=1),r?s.getElementsByClassName(fs).length:h)n.action="edit",t.trigger(R,n,function(i){i.cancel||("Spinner"===e.parent.loadingIndicator.indicatorType&&t.showSpinner(),"Shimmer"===e.parent.loadingIndicator.indicatorType&&e.parent.showMaskRow(),t.editSettings.showAddNewRow&&e.disabledShowAddRow(!0),t.notify(zt,i))});else{if(n.action="add",n.selectedRow=0,n.index=this.addedRowIndex,t.notify(cn,{}),t.notify(Ue,n),this.addedRowIndex=null,n.cancel)return;this.parent.editSettings.showAddNewRow&&(this.parent.notify(jr,{}),(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.disabledShowAddRow(!0,!0),"Dialog"!==t.editSettings.mode&&(0,o.isNullOrUndefined)(t.editSettings.template)&&(t.editModule.destroyWidgets(),t.editModule.destroyForm()))}}},e.prototype.destroyElements=function(){var e=this.parent;(!e.editSettings.showAddNewRow||e.editSettings.showAddNewRow&&e.element.querySelector(".e-editedrow"))&&(e.editModule.destroyWidgets(),e.editModule.destroyForm(),"Dialog"!==e.editSettings.mode&&(0,o.isNullOrUndefined)(e.editSettings.template)&&(e.editModule.formObj=null)),this.parent.notify(Qt,{})},e.prototype.editHandler=function(e){var t=this;e.promise?e.promise.then(function(i){return t.edSucc(i,e)}).catch(function(e){return t.edFail(e)}):this.editSuccess(e.data,e),this.parent.editSettings.showAddNewRow&&this.parent.editModule.applyFormValidation()},e.prototype.edSucc=function(e,t){this.editSuccess(e,t)},e.prototype.edFail=function(e){this.editFailure(e)},e.prototype.updateCurrentViewData=function(e){this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.parent.getCurrentViewRecords()[this.editRowIndex]=e)},e.prototype.requestSuccess=function(e){this.parent.editModule.formObj&&!this.parent.editModule.formObj.isDestroyed&&(this.destroyElements(),this.stopEditStatus(),"Dialog"===this.parent.editSettings.mode&&"add"!==e.action&&this.parent.selectionModule&&this.parent.element.querySelector(".e-dlgeditrow").classList.remove("e-dlgeditrow"))},e.prototype.editSuccess=function(e,t){if(!((0,o.isNullOrUndefined)(e)||e instanceof Array)){t.data=(0,o.extend)({},(0,o.extend)({},t.rowData,t.data),e)}if(this.requestSuccess(t),this.parent.trigger(fe,t),t.type=D,this.parent.isEdit=!!this.parent.editSettings.showAddNewRow,this.parent.renderModule.resetPartialRecords(),this.refreshRow(t.data),this.parent.notify(cn,t),this.parent.editModule.checkLastRow(t.row),this.parent.editModule.isLastRow=!1,this.updateCurrentViewData(t.data),this.blazorTemplate(),this.editRowIndex=null,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.showGroupedColumn){for(var i=t.row,n=this.parent.getRowsObject(),r=i.getAttribute("data-uid"),s=this.parent.getRowObjectFromUID(r),a=function(e){var i=l;n=n.filter(function(n){var r=n.isDataRow&&n!==s&&!(0,o.isNullOrUndefined)(n.data);if(r){for(var a=i.parent.groupSettings.columns[parseInt(e.toString(),10)].split("."),l=n.data[a[0]],h=t.data[a[0]],d=1;d<a.length;d++)l=l[a[d]],h=h[a[d]];return r&&l===h}return r})},l=this,h=0;h<this.parent.groupSettings.columns.length;h++)a(h);var d=n[0];(0,o.isNullOrUndefined)(s)||(0,o.isNullOrUndefined)(d)||s.parentUid===d.parentUid?!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(Ue,{requestType:"refresh-aggregate-on-save",action:"update"}):this.parent.aggregates.length&&this.parent.aggregateModule.refresh(t.data,this.parent.groupSettings.enableLazyLoading?t.row:void 0):this.parent.groupModule.groupedRowReorder(s,d)}else!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(Ue,{requestType:"refresh-aggregate-on-save",action:"update"}):this.parent.aggregates.length&&this.parent.aggregateModule.refresh(t.data,this.parent.groupSettings.enableLazyLoading?t.row:void 0);this.parent.trigger(D,t),(!this.parent.isCheckBoxSelection&&"Multiple"!==this.parent.selectionSettings.type||!this.parent.isPersistSelection&&!this.parent.selectionSettings.checkboxOnly)&&"Dialog"!==this.parent.editSettings.mode&&this.parent.selectRow(this.rowIndex>-1?this.rowIndex:this.editRowIndex),this.parent.notify(Sr,{requestType:t.requestType,action:t.action}),this.parent.aggregates.length&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.groupModule.getGroupAggregateTemplates(!0).length||this.parent.groupModule.getGroupAggregateTemplates(!1).length)||(this.parent.removeMaskRow(),this.parent.hideSpinner())},e.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow"))},e.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&(0,o.updateBlazorTemplate)(this.parent.element.id+"editSettingsTemplate","Template",this.parent.editSettings);for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.template&&(0,o.updateBlazorTemplate)(this.parent.element.id+i.uid,"Template",i,!1),i.editTemplate&&(0,o.updateBlazorTemplate)(this.parent.element.id+i.uid+"editTemplate","EditTemplate",i)}},e.prototype.editFailure=function(e){e.cancel||(this.parent.removeMaskRow(),this.parent.trigger(T,{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e}))},e.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-normaledit");return!this.parent.enableVirtualization&&!this.parent.infiniteScrollSettings.enableCache||"Normal"!==this.parent.editSettings.mode||t||(e=!1),e},e.prototype.refreshRow=function(e){var t=new js(this.serviceLocator,null,this.parent),i=this.parent.getRowObjectFromUID(this.uid);if(i){if(i.changes=e,this.parent.notify(fn,{data:e}),Tl(i,this.parent.getForeignKeyColumns(),i.changes),this.needRefresh()){var n=this.parent.getPrimaryKeyFieldNames()[0],r=void 0;if(i.index<this.parent.pinnedTopRowModels.length){var s=this.parent.getRowIndexByPrimaryKey(e),o=this.parent.getRowByIndex(s);o&&(r=this.parent.getRowObjectFromUID(o.getAttribute("data-uid")))}else r=this.parent.getPinnedRowObjectByKey(e[""+n]);r&&(r.changes=e,Tl(r,this.parent.getForeignKeyColumns(),r.changes),t.refresh(r,this.parent.getColumns(),!0)),t.refresh(i,this.parent.getColumns(),!0)}for(var a=[].slice.call(this.parent.element.querySelectorAll('[aria-rowindex="'+(i.index+1)+'"]')),l=0;l<a.length;l++)if(uh(a[parseInt(l.toString(),10)]),this.parent.enableColumnVirtualization&&a[parseInt(l.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze").length)for(var h=this.parent.getColumns(),d=[].slice.call(a[parseInt(l.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze.e-fixedfreeze")),p=0;p<d.length;p++)if(d[parseInt(p.toString(),10)].classList.contains("e-leftfreeze"))d[parseInt(p.toString(),10)].style.left=h[parseInt(p.toString(),10)].valueX-this.parent.translateX+"px";else if(d[parseInt(p.toString(),10)].classList.contains("e-rightfreeze")){var c=parseInt(d[parseInt(p.toString(),10)].getAttribute("aria-colindex"),10)-1;d[parseInt(p.toString(),10)].style.right=h[parseInt(c.toString(),10)].valueX+this.parent.translateX+"px"}else d[parseInt(p.toString(),10)].style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",d[parseInt(p.toString(),10)].style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"}},e.prototype.closeEdit=function(){var e=this;if(!this.parent.isEdit||this.parent.editSettings.showAddNewRow&&this.parent.element.querySelector(".e-addedrow")&&(0,o.isNullOrUndefined)(this.parent.element.querySelector("."+fs)))this.parent.editSettings.showAddNewRow&&(this.disabledShowAddRow(!0,!0),this.parent.notify(jr,{}));else{var t=this.parent,i=(0,o.extend)(this.args,{requestType:"cancel",type:R,cancel:!1,data:this.previousData,selectedRow:t.selectedRowIndex});t.notify(un,i),this.blazorTemplate(),t.trigger(R,i,function(n){if(!n.cancel){e.parent.notify(Qr,i),"Dialog"===e.parent.editSettings.mode&&e.parent.notify(Qt,{}),n.type=D,e.parent.editSettings.showAddNewRow||(t.isEdit=!1),"Dialog"!==t.editSettings.mode&&e.refreshRow(n.data),e.stopEditStatus(),t.isEdit=!1,t.editSettings.showAddNewRow&&(e.disabledShowAddRow(!0),t.editModule.applyFormValidation(),t.isEdit=!0);var r=t.groupSettings.enableLazyLoading&&t.groupSettings.columns.length&&!t.getContentTable().querySelector("tr.e-emptyrow");t.getContentTable().querySelector("tr.e-emptyrow")||t.getContentTable().querySelector("tr.e-row")||r||t.renderModule.emptyRow(),"Dialog"!==t.editSettings.mode&&t.selectRow(e.rowIndex),t.trigger(D,n)}})}},e.prototype.addRecord=function(e,t){var i=this,n=this.parent;if(this.addedRowIndex=t=(0,o.isNullOrUndefined)(t)?0:t,e)n.notify(Ue,{requestType:"save",type:R,data:e,selectedRow:0,action:"add",index:t});else if(!n.isEdit){this.previousData={},this.uid="";var r=n.getColumns(),s={virtualData:{},isScroll:!1};n.editSettings.showAddNewRow||this.parent.notify(vn,s);for(var l=0;l<r.length;l++)s.isScroll||r[parseInt(l.toString(),10)].field&&("string"===r[parseInt(l.toString(),10)].type&&(r[parseInt(l.toString(),10)].defaultValue=this.parent.sanitize(r[parseInt(l.toString(),10)].defaultValue)),a.DataUtil.setValue(r[parseInt(l.toString(),10)].field,r[parseInt(l.toString(),10)].defaultValue,this.previousData));var h={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:R,index:t,rowData:this.previousData,target:void 0,isScroll:s.isScroll};(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.infiniteScrollSettings.enableCache)&&Object.keys(s.virtualData).length&&(h.data=h.rowData=s.virtualData),h.isScroll?this.inlineAddHandler(h):(this.parent.notify(Rr,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.editSettings.showAddNewRow?this.inlineAddHandler(h):n.trigger(R,h,function(e){e.cancel||i.inlineAddHandler(e)}))}},e.prototype.inlineAddHandler=function(e){var t=this.parent;if(t.isEdit=!0,"Dialog"!==t.editSettings.mode&&t.clearSelection(),this.renderer.addNew(e),this.parent.isEdit&&!this.parent.isPersistSelection){var i=this.parent.getHeaderContent().querySelector(".e-checkselectall");i&&i.parentElement.classList.add("e-checkbox-disabled")}t.editModule.applyFormValidation(),e.type=D,e.row=t.element.querySelector("."+ms),t.editSettings.showAddNewRow||t.trigger(D,e),t.editSettings.template&&t.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e},e.prototype.deleteRecord=function(e,t){this.editRowIndex=this.parent.selectedRowIndex;var i=this.parent;if(t){t=t instanceof Array?t:[t];var n=Object.keys(t).length;e=e||this.parent.getPrimaryKeyFieldNames()[0];for(var r=function(n){var r,s,o=i.currentViewData.some(function(i){return s=i,t[parseInt(n.toString(),10)]===Ml(e,i)||t[parseInt(n.toString(),10)]===i});t[parseInt(n.toString(),10)]=o?s:t[parseInt(n.toString(),10)][""+e]?t[parseInt(n.toString(),10)]:((r={})[e]=t[parseInt(n.toString(),10)],r)},s=0;s<n;s++)r(s)}var a={requestType:"delete",type:R,foreignKeyData:{},data:t||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1};(0,o.isNullOrUndefined)(this.parent.commandDelIndex)||(a.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data);var l=a.data;if(this.parent.pinnedTopRecords.length&&l.length)for(var h=this.parent.getPrimaryKeyFieldNames()[0],d=function(e){var t=p.parent.pinnedTopRecords.findIndex(function(t){return t[""+h]===e[""+h]});-1!==t&&p.parent.pinnedTopRowKeys[e[""+h]]&&(p.parent.pinnedTopRecords.splice(t,1),p.parent.pinnedTopRowKeys[e[""+h]]=!1)},p=this,c=0,u=l;c<u.length;c++){d(u[c])}this.parent.notify(Ue,a)},e.prototype.stopEditStatus=function(){for(var e=this.parent,t=[].slice.call(e.editSettings.showAddNewRow?[]:e.element.getElementsByClassName(ms)),i=[].slice.call(e.element.getElementsByClassName(fs)),n=0;n<t.length;n++)(0,o.remove)(t[parseInt(n.toString(),10)]);for(n=0;n<i.length;n++)i[parseInt(n.toString(),10)].classList.remove(fs)},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Xt,handler:this.editHandler},{event:Zt,handler:this.dblClickHandler},{event:St,handler:this.clickHandler},{event:Mi,handler:this.requestSuccess},{event:Mt,handler:this.dblClickHandler},{event:_t,handler:this.editComplete},{event:Vt,handler:this.editComplete},{event:pr,handler:this.closeEdit},{event:yr,handler:this.closeForm},{event:Kt,handler:this.editComplete}],Rh(this.parent,this.evtHandlers,!0,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||Rh(this.parent,this.evtHandlers,!1)},e.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()},e}(),ip=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),np=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.renderer=n,r}return ip(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(tp),rp=function(){function e(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.initialRender=!0,this.validationColObj=[],this.addBatchRow=!1,this.prevEditedBatchCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:St,handler:this.clickHandler},{event:Mt,handler:this.dblClickHandler},{event:mt,handler:this.onBeforeCellFocused},{event:yt,handler:this.onCellFocused},{event:Zt,handler:this.dblClickHandler},{event:vt,handler:this.keyDownHandler},{event:Pi,handler:this.editNextValCell},{event:Ct,handler:this.destroy}],Rh(this.parent,this.evtHandlers,!0,this),o.EventHandler.add(this.parent.element,"mousedown",this.mouseDownHandler,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(E,this.dataBoundFunction),this.parent.addEventListener(te,this.batchCancelFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(Rh(this.parent,this.evtHandlers,!1),o.EventHandler.remove(this.parent.element,"mousedown",this.mouseDownHandler),this.parent.removeEventListener(E,this.dataBoundFunction),this.parent.removeEventListener(te,this.batchCancelFunction))},e.prototype.batchCancel=function(){this.parent.focusModule.restoreFocus({requestType:"batchCancel"})},e.prototype.dataBound=function(){this.parent.notify(Lt,{})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.mouseDownHandler=function(e){(0,o.isNullOrUndefined)(this.parent.element.querySelector(".e-gridform"))?this.mouseDownElement=void 0:this.mouseDownElement=e.target},e.prototype.clickHandler=function(e){_a(e.target,this.parent.element.id+"_add",!0)||((this.parent.isEdit&&(0,o.closest)(this.form,"td")!==(0,o.closest)(e.target,"td")&&(0,o.isNullOrUndefined)(this.mouseDownElement)||this.mouseDownElement===e.target)&&(this.saveCell(),this.editNextValCell()),_a(e.target,is)&&!this.parent.isEdit&&this.setCellIdx(e.target))},e.prototype.dblClickHandler=function(e){var t=_a(e.target,is),i=_a(e.target,us),n=i&&parseInt(i.getAttribute(Rs),10)-1,r=t&&parseInt(t.getAttribute(xs),10)-1;(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(n)||isNaN(r)||t.parentElement.classList.contains(fs)||!this.parent.getColumns()[parseInt(r.toString(),10)].allowEditing||this.editCell(n,this.parent.getColumns()[parseInt(r.toString(),10)].field,this.isAddRow(n))},e.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action)>-1)&&(e.cancel=!0,e.byClick?e.clickArgs.preventDefault():e.keyArgs.preventDefault())},e.prototype.onCellFocused=function(e){var t=!(e.container.isContent&&e.container.isDataCell||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&e.container.isHeader);if(this.parent.focusModule.active&&(this.prevEditedBatchCell=this.parent.focusModule.active.matrix.current.toString()===this.prevEditedBatchCellMatrix().toString(),this.crtRowIndex=[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf((0,o.closest)(e.element,"tr"))),e.byKey&&!t){var i=e.container.indexes,n=i[0],r=i[1],s=e.element.getAttribute("aria-colindex")?parseInt(e.element.getAttribute("aria-colindex"),10)-1:r;s!==r&&(r=s),this.parent.frozenRows&&e.container.isContent&&(n+=(this.parent.getContent().querySelector(".e-hiddenrow")?0:this.parent.frozenRows)+this.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length);var a=this.parent.isEdit;if(!this.parent.element.getElementsByClassName("e-popup-open").length)switch(a=a&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var l=this.parent.isRowDragable()&&this.parent.isDetail()?2:this.parent.isRowDragable()||this.parent.isDetail()?1:0,h=this.parent.getColumns()[r-l];h&&!this.parent.isEdit&&this.editCell(n,h.field),(a||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(n,r);break;case"enter":case"shiftEnter":e.keyArgs.preventDefault();var d={cancel:!1,keyArgs:e.keyArgs};this.parent.notify("beforeFocusCellEdit",d),!d.cancel&&a&&this.editCell(n,this.cellDetails.column.field);break;case"f2":this.editCellFromIndex(n,r),this.focus.focus()}}else this.parent.isEdit&&t&&this.saveCell()},e.prototype.isAddRow=function(e){return this.parent.getDataRows()[parseInt(e.toString(),10)].classList.contains("e-insertedrow")},e.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field,this.isAddRow(e))},e.prototype.closeEdit=function(){var e=this.parent,t=this.parent.getRowsObject();this.parent.pinnedTopRowModels.length&&(t=t.concat(this.parent.pinnedTopRowModels));var i={cancel:!1,batchChanges:this.getBatchChanges()};if(e.notify(_i,i),!i.cancel){e.isEdit&&this.saveCell(!0),this.isAdded=!1;var n=[];e.selectionModule&&(n=e.selectionModule.selectedRowIndexes),e.clearSelection();for(var r=0;r<t.length;r++){var s,o=t[parseInt(r.toString(),10)].isDirty;(s=this.removeBatchElementChanges(t[parseInt(r.toString(),10)],o))&&t.splice(r,1),s&&r--}e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();var a=this.parent.getRowsObject();e.notify(te,{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new $r({isDataRow:!0,cells:[new es({isDataCell:!0,visible:!0})]})]}),e.isCheckBoxSelection&&(e.selectionSettings.checkboxOnly||e.selectionSettings.persistSelection)?e.selectRows(n):e.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),e.notify(Lt,{}),this.parent.notify(Bt,{}),a={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger(te,a)}},e.prototype.removeBatchElementChanges=function(e,t){var i=this.parent,n=new js(this.serviceLocator,null,this.parent),r=!1;if(t){e.isDirty=t;var s=i.getRowElementByUID(e.uid);if(s&&(s.classList.contains("e-insertedrow")?((0,o.remove)(s),r=!0):(Tl(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,(0,o.classList)(s,[],["e-hiddenrow","e-updatedtd"]),n.refresh(e,i.getColumns(),!1)),this.parent.aggregates.length>0)){var a=[];a.type="cancel",this.parent.notify(ot,a),this.parent.groupSettings.columns.length>0&&this.parent.notify(st,a)}}return r},e.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),this.parent.aggregates.length>0&&(this.parent.isReact||this.parent.isVue||this.parent.notify(ot,{}),this.parent.groupSettings.columns.length>0&&this.parent.notify(st,{}),(this.parent.isReact||this.parent.isVue)&&this.parent.notify(ot,{}))},e.prototype.addRecord=function(e){this.bulkAddRow(e)},e.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},e.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},e.prototype.batchSave=function(){var e=this.parent,t="deletedRecords";if(e.isCheckBoxSelection){var i=e.element.querySelector(".e-checkselectall").parentElement;i.classList.contains("e-checkbox-disabled")&&e.pageSettings.totalRecordsCount>e.currentViewData.length&&(0,o.removeClass)([i],["e-checkbox-disabled"])}if(this.saveCell(),!(e.isEdit||this.editNextValCell()||e.isEdit)){var n=this.getBatchChanges();"Multiple"===this.parent.selectionSettings.type&&n[""+t].length&&this.parent.selectionSettings.persistSelection&&(n[""+t]=this.removeSelectedData,this.removeSelectedData=[]);var r={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},s={batchChanges:n,cancel:!1};e.trigger(se,s,function(t){t.cancel||(e.showSpinner(),e.notify(Pt,{changes:n,original:r}))})}},e.prototype.getBatchChanges=function(){var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=this.parent.getRowsObject();this.parent.pinnedTopRowModels.length&&(t=t.concat(this.parent.pinnedTopRowModels));for(var i=0,n=t;i<n.length;i++){var r=n[i];if(r.isDirty)switch(r.edit){case"add":e.addedRecords.push(r.changes);break;case"delete":e.deletedRecords.push(r.data);break;default:e.changedRecords.push(r.changes)}}return e},e.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,n=t.length;i<n&&t[parseInt(i.toString(),10)].uid!==e;i++);t.splice(i,1)},e.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition,n=e.clone();i?t.getRowsObject().unshift(n):t.getRowsObject().push(n)},e.prototype.bulkDelete=function(e,t){var i=this;this.removeSelectedData=[];var n=this.parent,r=n.selectedRowIndex,s=n.getSelectedRows(),a={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:r,rowData:t||n.getSelectedRecords(),cancel:!1};a.row=t?n.editModule.deleteRowUid?n.getRowElementByUID(n.editModule.deleteRowUid):n.getRows()[n.getCurrentViewRecords().indexOf(t)]:s,a.row&&n.trigger(re,a,function(e){if(!e.cancel){if(i.removeSelectedData=n.getSelectedRecords(),n.clearSelection(),e.row=e.row?e.row:t?n.getRows()[parseInt(r.toString(),10)]:s,1===s.length||t){Array.isArray(e.row)&&(e.row=e.row[0]);var a=e.row.getAttribute("data-uid");if(a=t&&i.parent.editModule.deleteRowUid?a=i.parent.editModule.deleteRowUid:a,e.row.classList.contains("e-insertedrow"))i.removeRowObjectFromUID(a),(0,o.remove)(e.row);else{var l=n.getRowObjectFromUID(a);l.isDirty=!0,l.edit="delete",(0,o.classList)(e.row,["e-hiddenrow","e-updatedtd"],[]),n.frozenRows&&r<n.frozenRows&&n.getDataRows().length>=n.frozenRows&&n.getHeaderTable().querySelector(Ds).appendChild(n.getRowByIndex(n.frozenRows-1))}delete e.row}else{t&&(r=parseInt(e.row.getAttribute(Rs),10)-1);for(var h=0;h<s.length;h++){var d=s[parseInt(h.toString(),10)].getAttribute("data-uid");if(s[parseInt(h.toString(),10)].classList.contains("e-insertedrow"))i.removeRowObjectFromUID(d),(0,o.remove)(s[parseInt(h.toString(),10)]);else{(0,o.classList)(s[parseInt(h.toString(),10)],["e-hiddenrow","e-updatedtd"],[]);var p=n.getRowObjectFromUID(d);p.isDirty=!0,p.edit="delete",n.frozenRows&&r<n.frozenRows&&n.getDataRows().length>=n.frozenRows&&n.getHeaderTable().querySelector(Ds).appendChild(n.getRowByIndex(n.frozenRows-1))}}delete e.row}i.refreshRowIdx(),t&&(n.editModule.deleteRowUid=void 0),n.isCheckBoxSelection||n.selectRow(r),n.trigger(ie,e),n.notify(ie,{rows:i.parent.getRowsObject()}),n.focusModule.restoreFocus({requestType:"batchDelete"}),n.notify(Lt,{}),n.getContentTable().querySelector("tr.e-row")||n.renderModule.renderEmptyRow()}})},e.prototype.refreshRowIdx=function(){for(var e=this.parent,t=e.getAllDataRows(!0),i=e.getRowsObject().filter(function(e){return!e.isDetailRow}),n=0,r=0,s=t.length;n<s;n++)t[parseInt(n.toString(),10)].classList.contains(us)&&!t[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")?(t[parseInt(n.toString(),10)].setAttribute(Rs,(r+1).toString()),i[parseInt(n.toString(),10)].index=r,r++):(t[parseInt(n.toString(),10)].removeAttribute(Rs),i[parseInt(n.toString(),10)].index=-1)},e.prototype.bulkAddRow=function(e){var i=this,n=this.parent;if(n.editSettings.allowAdding){if(n.isEdit&&(this.saveCell(),this.parent.notify(Pi,{})),!this.validateFormObj()){if(this.initialRender){for(var r=n.getVisibleColumns(),s=0;s<r.length;s++)if(r[parseInt(s.toString(),10)].validationRules&&r[parseInt(s.toString(),10)].validationRules.required){var a={field:r[parseInt(s.toString(),10)].field.slice(),cellIdx:s};this.validationColObj.push(a)}this.initialRender=!1}this.parent.element.classList.add("e-editing");var l={defaultData:e||this.getDefaultData(),primaryKey:n.getPrimaryKeyFieldNames(),cancel:!1};n.trigger(ne,l,function(r){if(!r.cancel){i.isAdded=!0,n.clearSelection();var s,a,l=new js(i.serviceLocator,null,i.parent),h=new Vs(i.parent).generateRows([r.defaultData]),d=l.render(h[0],n.getColumns());uh(d);for(var p=0;p<i.parent.groupSettings.columns.length;p++)d.insertBefore(i.parent.createElement("td",{className:"e-indentcell"}),d.firstChild),h[0].cells.unshift(new es({cellType:t.Indent}));var c=n.getContentTable().querySelector(Ds);if(d.classList.add("e-insertedrow"),c.querySelector(".e-emptyrow")){var u=c.querySelector(".e-emptyrow");u.parentNode.removeChild(u),n.frozenRows&&n.element.querySelector(".e-frozenrow-empty")&&n.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty")}c=n.frozenRows&&"Top"===n.editSettings.newRowPosition?n.getHeaderTable().querySelector(Ds):n.getContentTable().querySelector(Ds),"Top"===i.parent.editSettings.newRowPosition?c.insertBefore(d,c.firstChild):c.appendChild(d),(0,o.addClass)([].slice.call(d.getElementsByClassName(is)),["e-updatedtd"]),h[0].isDirty=!0,h[0].changes=(0,o.extend)({},{},h[0].data,!0),h[0].edit="add",i.addRowObject(h[0]),i.refreshRowIdx(),i.focus.forgetPrevious(),n.notify(ee,{rows:i.parent.getRowsObject()});var g=i.getBatchChanges(),f=i.getBottomIndex();"Top"===i.parent.editSettings.newRowPosition?n.selectRow(0):n.selectRow(f),e||(a=i.findNextEditableCell(0,!0),s=n.getColumns()[parseInt(a.toString(),10)],"Top"===i.parent.editSettings.newRowPosition?i.editCell(0,s.field,!0):i.editCell(f,s.field,!0)),i.parent.aggregates.length>0&&(e||g[Ss].length)&&i.parent.notify(ot,{});var m={defaultData:r.defaultData,row:d,columnObject:s,columnIndex:a,primaryKey:r.primaryKey,cell:(0,o.isNullOrUndefined)(a)?void 0:d.cells[parseInt(a.toString(),10)]};n.trigger(ee,m)}})}}else n.isEdit&&this.saveCell()},e.prototype.findNextEditableCell=function(e,t,i){for(var n,r=this.parent.getColumns(),s=r.length,a=e;a<s;a++)if(n=!!i&&(0,o.isNullOrUndefined)(r[parseInt(a.toString(),10)].validationRules),t&&(!r[parseInt(a.toString(),10)].template||r[parseInt(a.toString(),10)].field)&&r[parseInt(a.toString(),10)].allowEditing&&r[parseInt(a.toString(),10)].visible&&(!r[parseInt(a.toString(),10)].isIdentity||!r[parseInt(a.toString(),10)].isPrimaryKey)&&!n)return a;return-1},e.prototype.getDefaultData=function(){for(var e={},t={number:0,string:null,boolean:!1,date:null,datetime:null,dateonly:null},i=0,n=this.parent.columnModel;i<n.length;i++){var r=n[i];r.field&&(0,o.setValue)(r.field,Object.keys(r).indexOf("defaultValue")>=0?r.defaultValue:t[r.type],e)}return e},e.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("data-index"),10)},e.prototype.editCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t);this.index=e,this.field=t,this.isAdd=i;var s=n.getDataRows();s=s.filter(function(e){return"none"!==e.style.display&&!e.classList.contains("e-childrow-hidden")});var o=parseInt(s[s.length-1].getAttribute("aria-rowindex"),10)-1,a=n.isEdit&&!(this.cellDetails.column.field===t&&this.cellDetails.rowIndex===e&&o!==e&&this.prevEditedBatchCell);n.editSettings.allowEditing&&(!a&&(r.allowEditing||!r.allowEditing&&n.focusModule.active&&n.focusModule.active.getTable().rows[this.crtRowIndex]&&n.focusModule.active.getTable().rows[this.crtRowIndex].classList.contains("e-insertedrow"))?this.editCellExtend(e,t,i):a&&(this.editNext=!0,this.saveCell()))},e.prototype.editCellExtend=function(e,t,i){var n=this,r=this.parent,s=r.getColumnByField(t),a=r.getPrimaryKeyFieldNames();if(!r.isEdit){var l=(0,o.extend)({},{},this.getDataByIndex(e),!0),h=r.getDataRows()[parseInt(e.toString(),10)];if(l=(0,o.extend)({},{},this.getDataByIndex(e),!0),a[0]===s.field&&!h.classList.contains("e-insertedrow")||s.columns||s.isPrimaryKey&&s.isIdentity||s.commands)this.parent.isLastCellPrimaryKey=!0;else{this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing");var d=r.getRowObjectFromUID(h.getAttribute("data-uid")),p=[].slice.apply(h.cells),c={columnName:s.field,isForeignKey:!(0,o.isNullOrUndefined)(s.foreignKeyValue),primaryKey:a,rowData:l,validationRules:(0,o.extend)({},s.validationRules?s.validationRules:{}),value:Ml(s.field,l),type:i?"add":"edit",cancel:!1,foreignKeyData:d&&d.foreignKeyData};c.cell=p[this.getColIndex(p,this.getCellIdx(s.uid))],c.row=h,c.columnObject=s,c.cell&&r.trigger(ae,c,function(t){if(!t.cancel){t.cell=t.cell?t.cell:p[n.getColIndex(p,n.getCellIdx(s.uid))],t.row=t.row?t.row:h,t.columnObject=t.columnObject?t.columnObject:s,n.cellDetails={rowData:l,column:s,value:t.value,isForeignKey:t.isForeignKey,rowIndex:e,cellIndex:parseInt(t.cell.getAttribute(xs),10)-1,foreignKeyData:t.foreignKeyData},t.cell.classList.contains("e-updatedtd")&&(n.isColored=!0,t.cell.classList.remove("e-updatedtd")),r.isEdit=!0;var i=!(0,o.isNullOrUndefined)(t.row.querySelector(".e-selectionbackground"));r.clearSelection(),r.isCheckBoxSelection&&r.isPersistSelection||!i&&r.selectionSettings.checkboxOnly||r.selectRow(n.cellDetails.rowIndex,!0),n.renderer.update(t),n.parent.notify(Ki,t),n.form=(0,o.select)("#"+r.element.id+"EditForm",r.element),r.editModule.applyFormValidation([s]),n.parent.element.querySelector(".e-gridpopup").style.display="none"}})}}},e.prototype.updateCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t),s=n.getColumnIndexByField(t),o=n.getRowByIndex(e).classList.contains("e-insertedrow")&&n.getRowByIndex(e).classList.contains("e-batchrow");if(r&&(!r.isPrimaryKey||o)&&r.allowEditing){var a=this.parent.isSpan?mh(n,e,s):Sh(this.parent,0,e,s);if(this.parent.isSpan&&!a)return;var l=n.getRowObjectFromUID(a.parentElement.getAttribute("data-uid"));if(n.isEdit||!l.changes&&(!(i instanceof Date)&&l.data[""+t]!==i||i instanceof Date&&new Date(l.data[""+t]).toString()!==new Date(i).toString())||l.changes&&(!(i instanceof Date)&&l.changes[""+t]!==i||i instanceof Date&&new Date(l.changes[""+t]).toString()!==new Date(i).toString())){this.refreshTD(a,r,l,i);var h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;if((this.parent.isReact&&this.parent.requireTemplateRef||h&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&r.template){var d=this,p=this.newReactTd;d.parent.renderTemplates(function(){d.parent.trigger(I,{cell:p||a,column:r,data:l.changes})})}else(this.parent.isReact||h)&&r.template?(this.parent.renderTemplates(),this.parent.trigger(I,{cell:this.newReactTd||a,column:r,data:l.changes})):this.parent.trigger(I,{cell:this.newReactTd||a,column:r,data:l.changes})}}},e.prototype.setChanges=function(e,t,i){if(e.changes||(e.changes=(0,o.extend)({},{},e.data,!0)),(0,o.isNullOrUndefined)(t)||("string"==typeof i&&(i=this.parent.sanitize(i)),a.DataUtil.setValue(t,i,e.changes)),e.data[""+t]!==i){var n=this.parent.getColumnByField(t).type;"date"===n||"datetime"===n?new Date(e.data[""+t]).toString()!==new Date(i).toString()&&(e.isDirty=!0):e.isDirty=!0}},e.prototype.updateRow=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.updateCell(e,r,t[""+r])}},e.prototype.getCellIdx=function(e){var t=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return(0,o.isNullOrUndefined)(this.parent.detailTemplate)&&(0,o.isNullOrUndefined)(this.parent.childGrid)||t++,this.parent.isRowDragable()&&t++,t},e.prototype.refreshTD=function(e,t,i,n){var r=new $s(this.parent,this.serviceLocator);n="number"!==t.type||(0,o.isNullOrUndefined)(n)?n:parseFloat(n),i&&(this.setChanges(i,t.field,n),Tl(i,this.parent.getForeignKeyColumns(),i.changes));var s,a,l=i?i.cells:void 0;this.parent.isReact&&(s=e.parentElement,a=e.cellIndex);i&&r.refreshTD(e,l[this.getCellIdx(t.uid)-0],i.changes,{index:this.getCellIdx(t.uid)}),this.parent.isReact?(this.newReactTd=s.cells[parseInt(a.toString(),10)],s.cells[parseInt(a.toString(),10)].classList.add("e-updatedtd")):e.classList.add("e-updatedtd"),e.classList.add("e-updatedtd"),this.parent.notify(Lt,{})},e.prototype.getColIndex=function(e,t){var i=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(i=this.parent.groupSettings.columns.length),(0,o.isNullOrUndefined)(this.parent.detailTemplate)&&(0,o.isNullOrUndefined)(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++;for(var n=0;n<e.length;n++){if(parseInt(e[parseInt(n.toString(),10)].getAttribute(xs),10)-1===t-i)return n}return-1},e.prototype.editNextValCell=function(){var e=this.parent,t=e.element.querySelectorAll(".e-insertedrow"),i=1===t.length;if(i&&this.isAdded&&!e.isEdit){for(var n=this.getBottomIndex(),r=this.cellDetails.cellIndex;r<e.getColumns().length;r++){if(e.isEdit)return;var s=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),o=e.getColumns()[parseInt(s.toString(),10)];if(o){if("Bottom"===this.parent.editSettings.newRowPosition)this.editCell(n,o.field,!0);else{var a={index:0,column:o};this.parent.notify(er,a),this.editCell(a.index,o.field,!0)}this.saveCell()}}e.isEdit||(this.isAdded=!1)}else if(!i&&this.isAdded&&!e.isEdit){for(r=0;r<t.length&&!e.isEdit;r++)for(var l=0;l<this.validationColObj.length&&!e.isEdit;l++)""===t[parseInt(r.toString(),10)].querySelectorAll("td:not(.e-hide, .e-rowdragdrop, .e-detailrowcollapse, .e-detailrowexpand, .e-indentcell)")[this.validationColObj[parseInt(l.toString(),10)].cellIdx].innerHTML&&(this.editCell(parseInt(t[parseInt(r.toString(),10)].getAttribute("aria-rowindex"),10)-1,this.validationColObj[parseInt(l.toString(),10)].field),this.validateFormObj()&&this.saveCell());e.isEdit||(this.isAdded=!1)}},e.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,!e.value&&this.cellDetails.column.validationRules||this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},e.prototype.generateCellArgs=function(){var e=this.parent;this.parent.element.classList.remove("e-editing");var t=this.cellDetails.column,i={};i[t.field]=Ml(t.field,this.cellDetails.rowData);var n=e.editModule.getCurrentEditedData(this.form,i),r=(0,o.extend)({},n);n=(0,o.extend)({},n,this.cellDetails.rowData);var s=Ml(t.field,r);(0,o.isNullOrUndefined)(t.field)||(0,o.isUndefined)(s)||(0,o.setValue)(t.field,s,n);var a={columnName:t.field,value:Ml(t.field,n),rowData:this.cellDetails.rowData,column:t,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1};return a.cell=this.form.parentElement,a.columnObject=t,a},e.prototype.saveCell=function(e){if(!this.preventSaveCell&&this.form){var t=this.parent;if(e||t.isEdit&&!this.validateFormObj()){this.preventSaveCell=!0;var i=this.generateCellArgs();if(i.cell){var n=i.cell.parentElement,r=i.column;i.cell.removeAttribute("aria-label"),e?this.successCallBack(i,n,r)(i):(t.trigger(le,i,this.successCallBack(i,n,r)),t.notify(Vi,{formObj:this.form}))}else this.preventSaveCell=!1}}},e.prototype.successCallBack=function(e,t,i,n){var r=this;return function(e){var s=r.parent;if(e.cell=e.cell?e.cell:r.form.parentElement,e.columnObject=e.columnObject?e.columnObject:i,e.cancel){if(r.preventSaveCell=!1,r.editNext){if(r.editNext=!1,r.cellDetails.rowIndex===r.index&&r.cellDetails.column.field===r.field)return;r.editCellExtend(r.index,r.field,r.isAdd)}}else{s.editModule.destroyWidgets([i]),s.isEdit=!1,s.editModule.destroyForm(),r.parent.notify(Bt,{});var a=s.getRowObjectFromUID(t.getAttribute("data-uid"));if(r.refreshTD(e.cell,i,a,e.value),r.parent.isReact&&(e.cell=r.newReactTd),(0,o.removeClass)([t],[fs,"e-batchrow"]),(0,o.removeClass)([e.cell],["e-editedbatchcell","e-boolcell"]),(!(0,o.isNullOrUndefined)(e.value)&&e.value.toString()===((0,o.isNullOrUndefined)(r.cellDetails.value)?"":r.cellDetails.value).toString()&&!r.isColored||(0,o.isNullOrUndefined)(e.value)&&(0,o.isNullOrUndefined)(a.data[i.field])&&(0,o.isNullOrUndefined)(r.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),(0,o.isNullOrUndefined)(n)){var l=s.isReact&&i.template&&"string"!=typeof i.template,h=s.parentDetails&&s.parentDetails.parentInstObj&&s.parentDetails.parentInstObj.isReact;l||h?s.requireTemplateRef?s.renderTemplates(function(){s.trigger(he,e)}):(s.renderTemplates(),s.trigger(he,e)):s.trigger(he,e)}if(s.notify(Lt,{}),r.isColored=!1,r.parent.aggregates.length>0&&(r.parent.isReact||r.parent.isVue||r.parent.notify(ot,{}),r.parent.groupSettings.columns.length>0&&!r.isAddRow(r.cellDetails.rowIndex)&&r.parent.notify(st,{}),(r.parent.isReact||r.parent.isVue)&&r.parent.notify(ot,{})),r.preventSaveCell=!1,r.editNext){if(r.editNext=!1,r.cellDetails.rowIndex===r.index&&r.cellDetails.column.field===r.field&&r.prevEditedBatchCell)return;var d=s.getColumnByField(r.field);d&&(d.allowEditing||!d.allowEditing&&s.focusModule.active&&s.focusModule.active.getTable().rows[r.crtRowIndex]&&s.focusModule.active.getTable().rows[r.crtRowIndex].classList.contains("e-insertedrow"))&&r.editCellExtend(r.index,r.field,r.isAdd)}n&&s.notify(on,{})}}},e.prototype.prevEditedBatchCellMatrix=function(){var e=[],t=this.parent.focusModule.active.getTable().querySelector(".e-editedbatchcell");if(t){var i=t.parentElement;e=[[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(i),[].slice.call(i.cells).indexOf(t)]}return e},e.prototype.getDataByIndex=function(e){var t=this.parent.getRowObjectFromUID(this.parent.getDataRows()[parseInt(e.toString(),10)].getAttribute("data-uid"));return t.changes?t.changes:t.data},e.prototype.keyDownHandler=function(e){if(this.addBatchRow||("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit){var t=this.parent,i=this.getBottomIndex(),n=_a(e.target,is);if(this.addBatchRow||n&&!this.parent.isReact){var r=void 0;if(n&&(r=n.querySelector(".e-field")),this.addBatchRow||r){var s=this.parent.getVisibleColumns(),o="tab"===e.action?s.length-1:0;(this.addBatchRow||s[parseInt(o.toString(),10)].field===r.getAttribute("id").slice(this.parent.element.id.length))&&(this.cellDetails.rowIndex===i&&"tab"===e.action?("Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord(),this.addBatchRow=!1):this.saveCell())}}}},e.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify(Jt,{}),this.parent.isEdit=!1,this.editNext=!1,this.mouseDownElement=void 0,this.isColored=!1)},e.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e[Ss].length-e[Cs].length-1},e}(),sp=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),op=function(e){function t(t,i,n){var r=e.call(this,t,i)||this;return r.parent=t,r.serviceLocator=i,r.renderer=n,r}return sp(t,e),t.prototype.closeEdit=function(){e.prototype.closeEdit.call(this)},t.prototype.addRecord=function(t,i){e.prototype.addRecord.call(this,t,i)},t.prototype.endEdit=function(){e.prototype.endEdit.call(this)},t.prototype.updateRow=function(t,i){e.prototype.updateRow.call(this,t,i)},t.prototype.deleteRecord=function(t,i){e.prototype.deleteRecord.call(this,t,i)},t.prototype.startEdit=function(t){e.prototype.startEdit.call(this,t)},t}(tp),ap=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lp=function(e){function t(t){var i=e.call(this,t)||this;return i.isMaskModuleInjected=!0,i}return ap(t,e),t.prototype.write=function(e){this.edit=this.parent.editModule,"datepickeredit"===e.column.editType&&(this.obj=new Jh.DatePicker((0,o.extend)(hp(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params)),this.isMaskModuleInjected&&(Jh.DatePicker.Inject(Jh.MaskedDateTime),this.isMaskModuleInjected=!1)),"datetimepickeredit"===e.column.editType&&(this.obj=new Jh.DateTimePicker((0,o.extend)(hp(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params))),this.obj.isAngular=lh(this.parent),this.obj.appendTo(e.element)},t}(Wd);function hp(e,t,i,n,r){var s="Dialog"!==t,o=Ll(e.column.format,e.column.type),a=Ml(e.column.field,e.rowData);return{floatLabelType:s?"Never":"Always",value:a=a?new Date(a):null,format:o,placeholder:s?"":e.column.headerText,enableRtl:i,enabled:ul(e.column,e.requestType,e.element)&&gl(_a(e.element,"e-rowcell"),r&&r.parent?r.parent:null),cssClass:n||null,close:dp.bind(r)}}function dp(e){e.event&&"escape"===e.event.action&&(this.edit.editCellDialogClose=!0)}var pp=function(){function e(e){this.parent=e}return e.prototype.read=function(e,t){return t},e.prototype.write=function(){},e.prototype.destroy=function(){},e}(),cp=function(){function e(e,t){this.isShowAddedRowValidate=!1,this.editType={Inline:np,Normal:np,Batch:rp,Dialog:op},this.fieldname="",this.data={},this.editCellDialogClose=!1,this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}return e.prototype.updateColTypeObj=function(){for(var t=this.parent.columnModel,i=0;i<t.length;i++)if(this.parent.editSettings.template||t[parseInt(i.toString(),10)].editTemplate){t[parseInt(i.toString(),10)].edit=(0,o.extend)(new e.editCellType.templateedit(this.parent),t[parseInt(i.toString(),10)].edit||{})}else t[parseInt(i.toString(),10)].edit=(0,o.extend)(new(e.editCellType[t[parseInt(i.toString(),10)].editType&&e.editCellType[t[parseInt(i.toString(),10)].editType]?t[parseInt(i.toString(),10)].editType:"defaultedit"])(this.parent,this.serviceLocator),t[parseInt(i.toString(),10)].edit||{});this.parent.log("primary_column_missing")},e.prototype.getModuleName=function(){return"edit"},e.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=this.parent,i=0,n=Object.keys(e.properties);i<n.length;i++){switch(n[i]){case"allowAdding":case"allowDeleting":case"allowEditing":(t.editSettings.allowAdding||t.editSettings.allowEditing||t.editSettings.allowDeleting)&&this.initialEnd();break;case"mode":this.updateEditObj(),t.isEdit=!!t.editSettings.showAddNewRow,t.refresh()}}},e.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new Kd(this.parent,this.serviceLocator),this.editModule=new this.editType[this.parent.editSettings.mode](this.parent,this.serviceLocator,this.renderer)},e.prototype.initialEnd=function(){this.updateColTypeObj()},e.prototype.startEdit=function(e){var t=this.parent;if(t.editSettings.allowEditing&&(!t.isEdit||t.editSettings.showAddNewRow&&(!t.editSettings.showAddNewRow||(0,o.isNullOrUndefined)(t.element.querySelector("."+fs))))&&"Batch"!==t.editSettings.mode){if(this.parent.element.classList.add("e-editing"),!t.getSelectedRows().length||(0,o.isNullOrUndefined)(this.parent.getRowByIndex(parseInt(this.parent.getSelectedRows()[0].getAttribute("aria-rowindex"),10)-1))){if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj)}else if(!e)if(this.parent.isTreeGrid&&this.parent.allowPaging&&t.selectionModule.selectedRowIndexes.length){var i=t.selectionModule.selectedRowIndexes[0];e=t.getRowByIndex(i)}else e=t.getSelectedRows()[0];if(this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode){var n=parseInt(e.getAttribute("aria-rowindex"),10)-1;e=this.parent.getRowByIndex(n)}var r=t.getContent().querySelector("tr:last-child"),s=t.getHeaderContent().querySelector("tbody");if(t.frozenRows&&(0,o.isNullOrUndefined)(r)&&s&&s.querySelector("tr:last-child")?this.isLastRow=e.rowIndex===parseInt(t.getHeaderContent().querySelector("tbody").querySelector("tr:last-child").getAttribute("aria-rowindex"),10)-1:r&&(this.isLastRow=e.rowIndex===r.rowIndex),"none"!==e.style.display){if(this.editModule.startEdit(e),this.parent.isEdit&&!this.parent.isPersistSelection){var a=this.parent.getHeaderContent().querySelector(".e-checkselectall");a&&a.parentElement.classList.add("e-checkbox-disabled")}this.refreshToolbar(),t.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{}),t.editSettings.showAddNewRow&&this.destroyToolTip()}}},e.prototype.checkLastRow=function(e,t){var i=this.isLastRow;"auto"!==this.parent.height&&"Bottom"===this.parent.editSettings.newRowPosition&&t&&"add"===t.requestType&&this.parent.getContent().firstElementChild.offsetHeight>this.parent.getContentTable().scrollHeight?(0,o.addClass)([].slice.call(e.getElementsByClassName(is)),"e-lastrowadded"):i&&e&&e.classList&&(0,o.addClass)([].slice.call(e.getElementsByClassName(is)),"e-lastrowcell")},e.prototype.closeEdit=function(){"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.getElementsByClassName("e-updatedtd").length?this.showDialog("CancelEdit",this.dialogObj):(this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),this.refreshToolbar(),this.parent.notify(Sr,{requestType:"cancel"}),this.parent.editSettings.showAddNewRow&&this.destroyToolTip())},e.prototype.refreshToolbar=function(){this.parent.notify(Lt,{})},e.prototype.addRecord=function(e,t){if(this.parent.editSettings.allowAdding){var i={startEdit:!0};e||this.parent.notify(yn,i),i.startEdit&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,t),this.refreshToolbar(),this.parent.notify("start-add",{}))}},e.prototype.deleteRecord=function(e,t){var i=this.parent;if(i.editSettings.allowDeleting){if(t||i.getSelectedRecords().length||!(0,o.isNullOrUndefined)(i.commandDelIndex))return i.editSettings.showDeleteConfirmDialog?(this.fieldname=e,this.data=t,void this.showDialog("ConfirmDelete",this.dialogObj)):void this.editModule.deleteRecord(e,t);this.showDialog("DeleteOperationAlert",this.alertDObj)}},e.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");var t=this.parent.getRowObjectFromUID(this.deleteRowUid);(0,o.isNullOrUndefined)(t)||this.deleteRecord(null,t.data)},e.prototype.endEdit=function(){if("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&((0,o.isNullOrUndefined)(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify(Pi,{}),(0,o.isNullOrUndefined)(this.formObj)||this.formObj.validate()))this.showDialog("BatchSaveConfirm",this.dialogObj);else if(this.endEditing(),!this.parent.isEdit&&!this.parent.isPersistSelection){var e=this.parent.getHeaderContent().querySelector(".e-checkselectall");e&&e.parentElement.classList.remove("e-checkbox-disabled")}},e.prototype.updateCell=function(e,t,i){this.editModule.updateCell(e,t,i)},e.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},e.prototype.batchCancel=function(){this.closeEdit()},e.prototype.batchSave=function(){this.endEdit()},e.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},e.prototype.editFormValidate=function(){return!this.formObj||this.formObj.validate()},e.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},e.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},e.prototype.saveCell=function(){this.editModule.saveCell()},e.prototype.endEditing=function(){this.parent.editSettings.showAddNewRow||this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.isShowAddedRowValidate=!1,this.refreshToolbar()},e.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show(),this.parent.enableRtl&&t.refresh()},e.prototype.getValueFromType=function(e,t){var i=t;switch(e.type){case"number":i=isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(i=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?i=new Date(t):""===t&&(i=null);break;case"dateonly":i=t&&(t=new Date(t))?t.getFullYear()+"-"+kl(t.getMonth()+1)+"-"+kl(t.getDate()):null}return i},e.prototype.destroyToolTip=function(){for(var e=0,t=[].slice.call(this.parent.element.getElementsByClassName("e-griderror"));e<t.length;e++){var i=t[e];(0,o.remove)(i)}this.parent.getContent().firstElementChild.style.position="relative",this.parent.isFrozenGrid()&&(this.parent.element.querySelector(".e-gridheader")&&(this.parent.element.querySelector(".e-gridheader").style.position=""),this.parent.element.querySelector(".e-gridcontent").style.position="")},e.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}],"EditConfirm")},e.prototype.createAlertDlg=function(){this.alertDObj=this.dlgWidget([{click:this.alertClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",isPrimary:!0}}],"EditAlert")},e.prototype.alertClick=function(){this.alertDObj.hide()},e.prototype.dlgWidget=function(e,t){var i=this.parent.createElement("div",{id:this.parent.element.id+t});this.parent.element.appendChild(i);var n={showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"},cssClass:this.parent.cssClass?this.parent.cssClass:""};n.buttons=e;var r=new y.Dialog(n);return r.isStringTemplate=!0,r.appendTo(i),r},e.prototype.dlgCancel=function(){this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.parent.focusModule.clearIndicator(),this.dialogObj.hide(),this.parent.focusModule.restoreFocus({requestType:"cancel"}),this.parent.notify("cancelcnfrmDlg",{})},e.prototype.dlgOk=function(){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord(this.fieldname,this.data),this.parent.editSettings.showDeleteConfirmDialog&&!this.parent.allowSelection&&(this.parent.commandDelIndex=void 0);break;case this.l10n.getConstant("CancelEdit"):this.editModule.closeEdit();break;case this.l10n.getConstant("BatchSaveConfirm"):this.endEditing();break;case this.l10n.getConstant("BatchSaveLostChanges"):"Batch"===this.parent.editSettings.mode&&this.editModule.addCancelWhilePaging(),this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.executeAction()}this.dlgCancel()},e.prototype.destroyEditComponents=function(){if(this.parent.isEdit){if(this.editModule&&!(0,o.isNullOrUndefined)(this.editModule.editRowIndex)&&(0,o.isNullOrUndefined)(this.parent.editSettings.template)){var e=this.parent.columnModel.filter(function(e){return!e.edit.obj});((0,o.isNullOrUndefined)(e)||0===e.length)&&this.closeEdit()}this.destroyWidgets(),this.destroyForm()}this.formObj=null,this.destroy()},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.eventDetails=[{event:qe,handler:this.onPropertyChanged},{event:Le,handler:this.initialEnd},{event:vt,handler:this.keyPressHandler},{event:Nt,handler:this.updateColTypeObj},{event:Bt,handler:this.destroyToolTip},{event:Wt,handler:this.preventBatch},{event:Jt,handler:this.destroyForm},{event:Ct,handler:this.destroyEditComponents}],Rh(this.parent,this.eventDetails,!0,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on(Qr,this.actionBeginFunction),this.parent.addEventListener(D,this.actionCompleteFunction))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(Rh(this.parent,this.eventDetails,!1),this.parent.removeEventListener(D,this.actionCompleteFunction),this.parent.off(Qr,this.actionBeginFunction))},e.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel","filterAfterOpen","filterchoicerequest"].indexOf(e.requestType)<0&&(this.parent.isEdit=!!this.parent.editSettings.showAddNewRow),"batchsave"===e.requestType&&this.parent.focusModule.restoreFocus({requestType:"save"}),this.refreshToolbar()},e.prototype.getCurrentEditedData=function(e,t){var i=this.parent;if(i.editSettings.template){for(var n=[].slice.call(e.elements),r=0;r<n.length;r++)if((n[parseInt(r.toString(),10)].hasAttribute("name")&&"e-multi-hidden"!==n[parseInt(r.toString(),10)].className||n[parseInt(r.toString(),10)].classList.contains("e-multiselect"))&&("hidden"!==n[parseInt(r.toString(),10)].type||!_a(n[parseInt(r.toString(),10)],"e-switch-wrapper")&&!_a(n[parseInt(r.toString(),10)],"e-checkbox-wrapper"))){var s=n[parseInt(r.toString(),10)].hasAttribute("name")?cl(n[parseInt(r.toString(),10)].getAttribute("name")):cl(n[parseInt(r.toString(),10)].getAttribute("id")),l=i.getColumnByField(s)||{field:s,type:n[parseInt(r.toString(),10)].getAttribute("type")},h=void 0;"checkbox"===l.type||"boolean"===l.type?h=n[parseInt(r.toString(),10)].checked:n[parseInt(r.toString(),10)].value?(h=n[parseInt(r.toString(),10)].value,n[parseInt(r.toString(),10)].ej2_instances&&n[parseInt(r.toString(),10)].ej2_instances.length&&!(0,o.isNullOrUndefined)(n[parseInt(r.toString(),10)].ej2_instances[0].value)&&(n[parseInt(r.toString(),10)].blur(),h=n[parseInt(r.toString(),10)].ej2_instances[0].value)):n[parseInt(r.toString(),10)].ej2_instances&&(h=n[parseInt(r.toString(),10)].ej2_instances[0].value),l.edit&&"string"==typeof l.edit.read?h=(0,o.getValue)(l.edit.read,window)(n[parseInt(r.toString(),10)],h):l.edit&&l.edit.read&&(h=l.edit.read(n[parseInt(r.toString(),10)],h)),h=i.editModule.getValueFromType(l,h),"radio"===n[parseInt(r.toString(),10)].type?n[parseInt(r.toString(),10)].checked&&a.DataUtil.setValue(l.field,h,t):("string"==typeof h&&this.parent.sanitize(h),a.DataUtil.setValue(l.field,h,t))}return t}for(var d=i.columnModel.filter(function(e){return e.editTemplate}),p=0;p<d.length;p++)if(e[dl(d[parseInt(p.toString(),10)].field)]){var c=[].slice.call(e[dl(d[parseInt(p.toString(),10)].field)]).filter(function(e){return"input"===e.tagName.toLowerCase()});if(0===c.length){var u=[e[dl(d[parseInt(p.toString(),10)].field)]];this.parent.isAngular&&d[parseInt(p.toString(),10)].editTemplate&&u&&u.length&&"datepicker"===u[0].getAttribute("aria-label")&&u[0].closest(".e-datepicker")&&(u=[u[0].closest(".e-datepicker")]),c=u}var g=c.filter(function(e){return!(0,o.isNullOrUndefined)(e.ej2_instances)});0===g.length&&(g=c.filter(function(e){return e.hasAttribute("name")}));for(r=0;r<g.length;r++){h=this.getValue(d[parseInt(p.toString(),10)],g[parseInt(r.toString(),10)],t);"string"===d[parseInt(p.toString(),10)].type&&(h=this.parent.sanitize(h)),a.DataUtil.setValue(d[parseInt(p.toString(),10)].field,h,t)}}for(var f=[].slice.call(e.getElementsByClassName("e-field")),m=0,y=f.length;m<y;m++){var v=i.getColumnByUid(f[parseInt(m.toString(),10)].getAttribute("data-mappinguid"));if(v&&v.field){h=this.getValue(v,f[parseInt(m.toString(),10)],t);"string"!==v.type||v.isForeignColumn()&&"string"!=typeof h||(h=this.parent.sanitize(h)),a.DataUtil.setValue(v.field,h,t)}}return t},e.prototype.getValue=function(e,t,i){var n=t.ej2_instances?t.ej2_instances[0].value:t.value,r=this.parent,s=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(n=t.checked),"string"==typeof s?(s=(0,o.getValue)(s,window),n=r.editModule.getValueFromType(e,s(t,n))):n=r.editModule.getValueFromType(e,e.edit.read(t,n)),(0,o.isNullOrUndefined)(i[e.field])&&""===n&&(n=i[e.field]),n},e.prototype.onActionBegin=function(e){if(("columnstate"===e.requestType||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&"sorting"===e.requestType)&&this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode)this.closeEdit();else{var t=this.parent.element.querySelector("."+fs),i=this.parent.element.querySelector("."+ms);if(t&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(_a(t,us).getAttribute(Rs),10)-1<this.parent.frozenRows)return;var n=-1===["filterAfterOpen","filterBeforeOpen","filterchoicerequest","filterSearchBegin","save","infiniteScroll","virtualscroll"].indexOf(e.requestType),r=!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!(0,o.isNullOrUndefined)(this.parent.element.querySelector(".e-editedrow")),s=(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.formObj&&r&&!this.formObj.isDestroyed&&(t||i||"cancel"===e.requestType)&&n;(!this.parent.enableVirtualization&&r&&"Batch"!==this.parent.editSettings.mode&&this.formObj&&!this.formObj.isDestroyed&&n&&!e.cancel||s)&&(this.destroyWidgets(),this.destroyForm())}},e.prototype.destroyWidgets=function(e){var t=this.parent;if(t.isWidgetsDestroyed=!0,t.editSettings.template){var i=Nh(this.parent);(i=i.isReact?i:this.parent).destroyTemplate(["editSettingsTemplate"]),this.parent.isReact&&this.parent.renderTemplates()}if("Dialog"===this.parent.editSettings.mode&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length){e=[];for(var n=this.parent.getColumns(),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)];(s.visible||this.parent.groupSettings.columns.indexOf(s.field)>-1)&&e.push(s)}}else e=e||this.parent.getCurrentVisibleColumns(this.parent.enableColumnVirtualization);e.some(function(e){return!(0,o.isNullOrUndefined)(e.editTemplate)})&&(this.parent.destroyTemplate(["editTemplate"]),this.parent.isReact&&this.parent.renderTemplates());for(var a=0,l=e;a<l.length;a++){var h=l[a],d=h.edit.destroy;h.edit.destroy&&("string"==typeof d?(d=(0,o.getValue)(d,window))():h.edit.destroy())}if(this.formObj&&this.formObj.element){var p=[].slice.call(this.formObj.element.elements);for(r=0;r<p.length;r++){var c=p[parseInt(r.toString(),10)];if(c.hasAttribute("name")||c.classList.contains("e-field")){var u=(0,o.isNullOrUndefined)(c.parentElement)?null:c.parentElement.classList.contains("e-ddl")?c.parentElement.querySelector("input"):c;u&&u.ej2_instances&&u.ej2_instances.length&&!u.ej2_instances[0].isDestroyed&&(u.ej2_instances[0].destroy(),u.remove())}}}},e.prototype.destroyForm=function(){this.destroyToolTip();for(var e=[this.formObj,this.virtualFormObj],t=this.parent.columnModel.filter(function(e){return e.editTemplate}),i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];if(n&&n.element&&!n.isDestroyed)n.destroy(),!Nh(this.parent).isReact||"Dialog"!==this.parent.editSettings.mode||(0,o.isNullOrUndefined)(this.parent.editSettings.template)&&!t.length||n.element.remove(),n&&n.element&&(0,o.isNullOrUndefined)(this.parent.editSettings.template)&&(n.element.innerHTML="",this.parent.editSettings.showAddNewRow&&n.element.closest(".e-addedrow")&&(n.element.closest(".e-addedrow").innerHTML=""))}this.destroyToolTip()},e.prototype.destroy=function(){var e=this.parent.element;if(e){var t=!(!e.querySelector("."+ns)||!e.querySelector("."+rs));t&&this.destroyForm(),this.removeEventListener();var i=this.dialogObj.element;i.childElementCount>0&&(this.dialogObj.destroy(),(0,o.remove)(i)),(i=this.alertDObj.element).childElementCount>0&&(this.alertDObj.destroy(),(0,o.remove)(i)),t&&this.editModule&&this.editModule.destroy()}},e.prototype.keyPressHandler=function(e){switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&"ctrlEnter"===e.action&&(e.action="insert"),e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")&&!e.target.classList.contains("e-checkselectall")||document.querySelector(".e-popup-open.e-edit-dialog")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":_a(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(_a(e.target,rs)||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&_a(e.target,os))||document.getElementsByClassName("e-popup-open").length&&(!document.querySelectorAll(".e-popup-open .e-editcell").length||document.querySelectorAll(".e-popup-open:not(.e-dialog)").length)||(e.preventDefault(),this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.endEdit());break;case"escape":this.parent.isEdit&&!this.editCellDialogClose&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.curretRowFocus(e)),this.editCellDialogClose&&(this.editCellDialogClose=!1);break;case"tab":case"shiftTab":this.curretRowFocus(e)}},e.prototype.curretRowFocus=function(e){if(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode){this.parent.isWidgetsDestroyed=!1;var t=_a(e.target,"e-editedrow")||_a(e.target,"e-addedrow");if(t){var i=[].slice.call(t.querySelectorAll(".e-input:not(.e-disabled)")),n=[].slice.call(t.querySelectorAll(".e-unboundcell"));if(n&&n.length)for(var r=0;r<n.length;r++)i=i.concat([].slice.call(n[parseInt(r.toString(),10)].querySelectorAll(".e-btn:not(.e-hide)")));var s=_a(e.target,"e-rowcell");s=s&&s.classList.contains("e-unboundcell")?e.target:s;var a=_a(i[i.length-1],"e-rowcell");if(s===(a=a&&a.classList.contains("e-unboundcell")?i[i.length-1]:a)&&"tab"===e.action||"escape"===e.action||s===_a(i[0],"e-rowcell")&&"shiftTab"===e.action&&!this.parent.editSettings.showAddNewRow){var l=t.getAttribute("data-uid"),h=(this.parent.allowGrouping?(0,o.isNullOrUndefined)(this.parent.getContent())?[]:[].slice.call(this.parent.getContent().querySelectorAll("tr")):this.parent.getRows()).map(function(e){return e.getAttribute("data-uid")}).indexOf(l);if((this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(_a(t,"e-gridheader")?h=t.rowIndex:_a(t,"e-gridcontent")&&(h-=this.parent.frozenRows)),t.classList.contains("e-addedrow")&&(h=0),"escape"===e.action?(this.parent.isFocusFirstCell=!0,this.closeEdit()):(this.isShowAddedRowValidate=!0,this.parent.selectionModule.preventFocus=!1,this.parent.isFocusFirstCell=!0,this.endEdit(),this.isShowAddedRowValidate=!1),this.parent.focusModule.active&&(!this.parent.editSettings.showAddNewRow||t.classList.contains("e-editedrow")||this.parent.editSettings.showAddNewRow&&t.classList.contains("e-addedrow")&&(0,o.isNullOrUndefined)(this.parent.element.querySelector('.e-griderror:not([style*="display: none"])')))){var d=0,p=this.parent.focusModule.active.matrix;if(p&&p.matrix.length&&p.matrix[parseInt(h.toString(),10)]){var c=p.matrix[parseInt(h.toString(),10)];for(r=0;r<c.length;r++)if(c[parseInt(r.toString(),10)]>0){d=r;break}}var u=(0,o.getValue)(h+".cells."+d,this.parent.focusModule.active.matrix.getRowsFromIndex(h,this.parent.focusModule.active));if(u&&0===u.getBoundingClientRect().width)d=this.parent.focusModule.active.matrix.nextVisibleCellFocus(h,d,e.action,this.parent.focusModule.active.keyActions[e.action],this.parent.focusModule.active,this.parent.focusModule.active.matrix.current[1])[1];this.parent.focusModule.active.matrix.current=[h,d]}}this.parent.editSettings.showAddNewRow&&"tab"===e.action&&_a(e.target,"e-addedrow")&&(this.isShowAddedRowValidate=!0)}}},e.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},e.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},e.prototype.applyFormValidation=function(e,t){var i=this.parent,n="Dialog"!==this.parent.editSettings.mode?i.editSettings.showAddNewRow&&i.element.querySelector("."+fs)?i.element.querySelector("."+fs).getElementsByClassName("e-gridform")[parseInt((0).toString(),10)]:i.element.getElementsByClassName("e-gridform")[parseInt((0).toString(),10)]:(0,o.select)("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document),r={},s={},a={};e=e||i.getColumns();for(var l=0;l<e.length;l++)(e[parseInt(l.toString(),10)].visible||"Dialog"===i.editSettings.mode&&(-1!==i.groupSettings.columns.indexOf(e[parseInt(l.toString(),10)].field)||"Dialog"!==i.editSettings.mode))&&e[parseInt(l.toString(),10)].validationRules&&(0,o.isNullOrUndefined)(t)&&Ch(e[parseInt(l.toString(),10)],1,r,s,a,e.length);r=(0,o.extend)(r,s,a),this.parent.editModule.formObj=this.createFormObj(n,t||r)},e.prototype.createFormObj=function(e,t){var i=this;return new Qh.FormValidator(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){i.validationComplete(e)},customPlacement:function(e,t){var n=e.getAttribute("data-mappinguid"),r={column:i.parent.getColumnByUid(n),error:t,inputElement:e,value:e.value};(!(event&&event.relatedTarget&&event.relatedTarget.classList.contains("e-cancelbutton"))&&!i.parent.editSettings.showAddNewRow||i.parent.editSettings.showAddNewRow&&event&&event.target&&(_a(event.target,i.parent.element.id+"_update",!0)||_a(event.target,"e-grid-menu")&&(event.target.classList.contains("e-save")||event.target.querySelector(".e-save"))||i.isShowAddedRowValidate||_a(event.target,"e-unboundcell")&&_a(event.target,"e-update")||"enter"===event.action&&(_a(event.target,"e-content")||_a(event.target,"e-addedrow")))||i.parent.editSettings.showAddNewRow&&!(0,o.isNullOrUndefined)(i.parent.element.querySelector("."+fs)))&&i.valErrorPlacement(e,t),i.isShowAddedRowValidate=!1,i.parent.notify(nn,r)}})},e.prototype.valErrorPlacement=function(e,t){if(this.parent.isEdit){var i=t.getAttribute("for"),n=this.getElemTable(e).querySelector("#"+pl(i)+"_Error");n?n.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,i,"")}},e.prototype.getElemTable=function(e){var t,i,n=this.parent;return"Dialog"!==n.editSettings.mode?(t=n.frozenRows&&(0,o.closest)(e,"."+us)&&n.frozenRows>(parseInt((0,o.closest)(e,"."+us).getAttribute(Rs),10)-1||0),i=this.parent.isFrozenGrid()?n.element:t||n.editSettings.showAddNewRow&&(n.enableVirtualization||n.enableInfiniteScrolling)?n.getHeaderTable():n.getContentTable()):i=(0,o.select)("#"+n.element.id+"_dialogEdit_wrapper",document),i},e.prototype.resetElemPosition=function(e,t){var i=_a(t.element,is);if(i){var n=i.getBoundingClientRect().right,r=e.getBoundingClientRect().right;if(r>n){var s=r-n;e.style.left=e.offsetLeft-s+"px"}}},e.prototype.validationComplete=function(e){if(this.parent.isEdit){var t=this.getElemTable(e.element).querySelector("#"+pl(e.inputName)+"_Error");if(this.parent.editSettings.showAddNewRow&&!t&&e.element){var i=_a(e.element,"e-rowcell").querySelector(".e-error");i&&i.classList.remove("e-error")}t&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")}},e.prototype.setScrollTop=function(e,t,i){var n=this.parent.getContent().querySelector(".e-content");0===this.parent.currentViewData.length&&0===n.scrollTop?n.scrollTop=e.offsetHeight+t.scrollHeight:i.scrollTop=i.scrollTop+e.offsetHeight+t.scrollHeight},e.prototype.setBottomStyles=function(e,t,i){var n=t.scrollWidth>t.offsetWidth?ol():0,r=-1===this.parent.height.toString().indexOf("%")?parseInt(this.parent.height,10):t.offsetHeight;e.style.bottom=r-t.querySelector("table").offsetHeight-n+i.height+9+"px",this.parent.pinnedTopRowModels.length&&(e.style.bottom=i.height+9+"px")},e.prototype.setPositionStyles=function(e,t,i){var n=(this.parent.frozenRows?(e?this.parent.frozenRows+1:this.parent.frozenRows)+(t.length-1):t.length-1)*this.parent.getRowHeight(),r=this.parent.getContent().clientHeight-n;i.style.bottom=r+9+"px"},e.prototype.createTooltip=function(e,t,i,n){var r=this.formObj.element,s=_a(e,"e-virtual-validation");s&&(r=this.virtualFormObj.element);var a,l,h=this.parent.getContent().firstElementChild,d=h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth,p="Dialog"!==this.parent.editSettings.mode,c=(0,o.closest)(e,"."+is),u=(0,o.closest)(e,"."+us),g=!1,f=!1,m=this.parent.editSettings.showAddNewRow&&!(0,o.isNullOrUndefined)(_a(e,ms))&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling),v=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,S=[].slice.call(this.parent.getContent().getElementsByClassName(us));if("Batch"===this.parent.editSettings.mode&&(S=[].slice.call(this.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")),v>1&&S.length>v&&parseInt(S[S.length-1].getAttribute(Rs),10)-1==parseInt(u.getAttribute(Rs),10)-1&&(f=!0)),p){if(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m){var C=this.parent.editSettings.showAddNewRow?".e-row:not(.e-hiddenrow.e-addedrow)":".e-row:not(.e-hiddenrow)",w=[].slice.call(this.parent.getHeaderTable().querySelector(Ds).querySelectorAll(C));g=(a=w.length>(parseInt(u.getAttribute(Rs),10)-1||0))&&parseInt(u.getAttribute(Rs),10)-1==w.length-1;var b=[].slice.call(this.parent.getHeaderTable().querySelector(Ds).querySelectorAll(".e-row:not(.e-hiddenrow)"));1===b.length&&(b[0].classList.contains("e-addedrow")||b[0].classList.contains("e-insertedrow"))&&(g=!0)}(g||v>1&&S.length>v&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||c.classList.contains("e-lastrowcell")&&!u.classList.contains(ms))||f)&&(l=!0)}var I=p?a?this.parent.getHeaderTable():this.parent.getContentTable():(0,o.select)("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document),x=I.getBoundingClientRect(),R=p?this.parent.element.getBoundingClientRect().left:x.left,D=(0,o.closest)(e,"td"),T=D?D.getBoundingClientRect():e.parentElement.getBoundingClientRect(),E=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:i+"_Error"}),O="display:"+n+";top:"+((a?T.top+T.height:T.bottom-x.top)+I.scrollTop+9)+"px;left:"+(T.left-R+I.scrollLeft+T.width/2)+"px;max-width:"+T.width+"px;text-align:center;";(0,o.updateCSSText)(E,O),this.parent.cssClass&&E.classList.add(this.parent.cssClass),p&&x.left<R&&(E.style.left=parseInt(E.style.left,10)-x.left+R+"px");var k,A,F=this.parent.createElement("div",{className:"e-tip-content"});(F.appendChild(t),l?((k=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),k.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((k=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),k.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),E.appendChild(F),E.appendChild(k),!s&&(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&"Dialog"!==this.parent.editSettings.mode)?(("Normal"===this.parent.editSettings.mode?(0,o.closest)(e,".e-editcell"):(0,o.closest)(e,"."+cs)).style.position="relative",E.style.position="absolute",("Batch"===this.parent.editSettings.mode||(0,o.closest)(e,"."+hs)||(0,o.closest)(e,"."+ds)||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(this.parent.isFrozenGrid()?c.classList.contains("e-unfreeze")?((0,o.addClass)([E],"e-unfreeze"),r.appendChild(E)):((A=(0,o.closest)(c,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===S.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(E),A.style.position="relative"):r.appendChild(E))):s?this.virtualFormObj.element.appendChild(E):"Dialog"!==this.parent.editSettings.mode&&this.parent.isFrozenGrid()?c.classList.contains("e-unfreeze")?((0,o.addClass)([E],"e-unfreeze"),this.formObj.element.appendChild(E)):((A=(0,o.closest)(c,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===S.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(E),A.style.position="relative"):this.formObj.element.appendChild(E);(0,o.isNullOrUndefined)(c)||(c.classList.contains("e-fixedfreeze")?E.classList.add("e-fixederror"):(c.classList.contains("e-leftfreeze")||c.classList.contains("e-rightfreeze"))&&E.classList.add("e-freezeerror")),!l&&p&&h.getBoundingClientRect().bottom<T.bottom+T.height&&this.setScrollTop(E,k,h);var M=parseInt(document.defaultView.getComputedStyle(E,null).getPropertyValue("font-size"),10);if((this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&"Dialog"!==this.parent.editSettings.mode?E.style.left=D.offsetLeft+(D.offsetWidth/2-E.offsetWidth/2)+"px":E.style.left=parseInt(E.style.left,10)-E.offsetWidth/2+"px",E.getBoundingClientRect().width<T.width&&E.querySelector("label").getBoundingClientRect().height/(1.2*M)>=2&&(E.style.width=E.style.maxWidth),p&&!d&&!this.parent.allowPaging||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m){var L=(0,y.calculateRelativeBasedPosition)(D,E);E.style.top=L.top+T.height+9+"px"}l&&(!d||"auto"===this.parent.height||this.parent.frozenRows&&this.parent.pinnedTopRowModels.length&&m||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||E.classList.contains("e-freezeerror")&&E.classList.contains("e-fixederror")?E.style.bottom=T.height+9+"px":this.setBottomStyles(E,h,T),S.length<v&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType&&this.setPositionStyles(m,S,E),E.style.top=null)},e.prototype.checkColumnIsGrouped=function(e){return!(e.visible||this.parent.groupSettings.columns.indexOf(e.field)>-1)},e.AddEditors=function(t){e.editCellType=(0,o.extend)(e.editCellType,t)},e.editCellType={dropdownedit:Jd,numericedit:Zd,datepickeredit:lp,datetimepickeredit:lp,booleanedit:Xd,defaultedit:ep,templateedit:pp},e}(),up=function(){return up=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},up.apply(this,arguments)},gp=function(){function e(e,t){this.filterColumns=[],this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.infiniteLoadedElement=[],this.isDlgOpen=!1,this.isColumnChooserOpen=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.sortDirection="None",this.selectedColumnModels=[],this.selectedColumns=[],this.itemsCount=50,this.infiniteSkipCount=0,this.infiniteColumns=[],this.infiniteInitialLoad=!1,this.prevInfiniteScrollDirection="",this.prevShowedCols=[],this.hideDialogFunction=this.hideDialog.bind(this),this.infiniteRenderMode=!1,this.parent=e,this.serviceLocator=t,this.infiniteRenderMode=!!this.parent.enableColumnVirtualization,this.addEventListener(),this.cBoxTrue=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=(0,Js.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass])),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}return e.prototype.destroy=function(){var e=this,t=this.parent.element;if((t.querySelector("."+rs)||t.querySelector("."+ns))&&t&&(this.removeEventListener(),this.unWireEvents(),this.infiniteLoadedElement=null,this.infiniteDiv=null,!(0,o.isNullOrUndefined)(this.dlgObj)&&this.dlgObj.element&&!this.dlgObj.isDestroyed)){this.parent.isReact&&this.parent.columnChooserSettings.template?rl.timer?(clearTimeout(rl.timer),rl.timer=null):rl.timer=setTimeout(function(){(0,o.isNullOrUndefined)(e.dlgObj)||!e.dlgObj.element||e.dlgObj.isDestroyed||e.dlgObj.destroy()},0):this.dlgObj.destroy();var i=document.getElementById(this.parent.element.id+"_e-popup");(0,o.isNullOrUndefined)(i)||((0,o.remove)(i),i=null)}},e.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,r.isColumnChooser),this.parent.enableAdaptiveUI&&(this.parent.on(Hr,this.renderResponsiveColumnChooserDiv,this),this.parent.on(Ur,this.renderResponsiveChangeAction,this))},e.prototype.rtlUpdate=function(){(0,o.isNullOrUndefined)(this.innerDiv)||(this.parent.enableRtl?(0,o.addClass)([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]):(0,o.removeClass)([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]))},e.prototype.addEventListener=function(){this.parent.isDestroyed||(o.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(Be,this.enableAfterRenderEle,this),this.parent.on(Le,this.render,this),this.parent.addEventListener(E,this.hideDialogFunction),this.parent.on(Ct,this.destroy,this),this.parent.on(Oi,this.rtlUpdate,this),this.parent.on(Mn,this.onResetColumns,this),this.parent.on(hr,this.setFullScreenDialog,this),this.parent.on(qe,this.onPropertyChanged,this),this.parent.enableAdaptiveUI&&this.parent.on(Ur,this.renderResponsiveChangeAction,this),(this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.on(Hr,this.renderResponsiveColumnChooserDiv,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(o.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(Le,this.render),this.parent.off(Ct,this.destroy),this.parent.off(Be,this.enableAfterRenderEle),this.parent.off(Oi,this.rtlUpdate),this.parent.off(Mn,this.onResetColumns),this.parent.removeEventListener(E,this.hideDialogFunction),this.parent.off(hr,this.setFullScreenDialog),this.infiniteDiv&&(o.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler),o.EventHandler.remove(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler),o.EventHandler.remove(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler)),this.parent.enableAdaptiveUI&&(this.parent.off(hr,this.setFullScreenDialog),this.parent.off(Ur,this.renderResponsiveChangeAction)),(this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.off(Hr,this.renderResponsiveColumnChooserDiv))},e.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.enableAdaptiveUI||this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},e.prototype.clickHandler=function(e){var t=e.target;if(!this.isCustomizeOpenCC){if((0,o.isNullOrUndefined)((0,o.closest)(t,".e-cc-toolbar"))&&(0,o.isNullOrUndefined)((0,o.closest)(t,".e-cc")))(0,o.isNullOrUndefined)(this.dlgObj)||!this.dlgObj.visible||t.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(t.classList.contains("e-columnchooser-btn")||t.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else t.classList.contains("e-cc-cancel")&&(t.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch("",!1),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.parent.enableAdaptiveUI?this.parent.enableRtl&&(0,o.addClass)([this.cBoxTrue,this.cBoxFalse],["e-rtl"]):this.rtlUpdate()},e.prototype.hideDialog=function(){!(0,o.isNullOrUndefined)(this.dlgObj)&&this.dlgObj.visible&&(this.parent.enableAdaptiveUI?this.responsiveDialogRenderer.hideResponsiveColumnChooser():(this.dlgObj.hide(),this.isDlgOpen=!1))},e.prototype.renderColumnChooser=function(e,t,i){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{var n=this.beforeOpenColumnChooserEvent();if(n.cancel)return;this.infiniteRenderMode||!this.selectedColumns.length||"None"!==this.sortDirection||this.parent.columnChooserSettings.template||this.setOrderedColumns(),n.columns=null,i&&(this.targetdlg=i),this.infiniteRenderMode&&this.dlgObj.show(),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var r=this.dlgObj.element.style.display;if(!this.parent.columnChooserSettings.enableSearching)this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px";this.dlgObj.element.style.display="block";var s=this.parent.getHeaderContent().classList.contains("e-sticky"),a=(0,o.closest)(i,".e-toolbar-item"),l=void 0;document.getElementById(this.parent.element.id+"_e-popup")&&document.getElementById(this.parent.element.id+"_e-popup").querySelector(".e-ccdlg")&&this.parent.element.appendChild(this.dlgObj.element),s?(l=a.getBoundingClientRect(),this.dlgObj.element.classList.add("e-sticky")):(this.dlgObj.element.classList.remove("e-sticky"),l=(0,y.calculateRelativeBasedPosition)(a,this.dlgObj.element)),this.dlgObj.element.style.display=r,this.dlgObj.element.style.top=l.top+(0,o.closest)(i,".e-cc-toolbar").getBoundingClientRect().height+"px";(0,o.isNullOrUndefined)((0,o.closest)(i,".e-bigger"))||(this.dlgObj.width=258),o.Browser.isDevice?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=i.offsetLeft+"px":this.dlgObj.element.style.left=l.left-250+(0,o.closest)(i,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.infiniteRenderMode||this.dlgObj.show();var h=this.dlgObj.element.getBoundingClientRect();window.innerHeight<h.bottom&&(this.dlgObj.element.style.top=window.innerHeight-h.bottom+parseInt(this.dlgObj.element.style.top,10)-5+"px"),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&((0,o.isNullOrUndefined)((0,o.closest)(i,".e-bigger"))?hh(this.parent,this.dlgObj):hh(this.parent,this.dlgObj,258),this.dlgObj.element.querySelector(".e-ccsearch")&&this.dlgObj.element.querySelector(".e-ccsearch").select()),this.parent.notify(ji,{dialog:this.dlgObj})}this.rtlUpdate()},e.prototype.openColumnChooser=function(e,t){if(this.isCustomizeOpenCC=!0,this.parent.enableAdaptiveUI){if(!this.isColumnChooserOpen)return void this.parent.showResponsiveCustomColumnChooser();this.isColumnChooserOpen=!1,this.renderDlgContent()}if(this.dlgObj.visible)this.hideDialog();else{var i=this.beforeOpenColumnChooserEvent();if(!i.cancel){if(this.infiniteRenderMode||!this.selectedColumns.length||"None"!==this.sortDirection||this.parent.columnChooserSettings.template||this.setOrderedColumns(),i.columns=null,this.infiniteRenderMode&&this.dlgObj.show(),this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.parent.columnChooserSettings.template||this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.infiniteRenderMode&&this.refreshCheckboxState(),this.dlgObj.position={X:"center",Y:"center"},(0,o.isNullOrUndefined)(e)?(this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""}),this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=t+"px",this.dlgObj.element.style.left=e+"px"),!this.parent.columnChooserSettings.enableSearching)this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px";this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.infiniteRenderMode||this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&hh(this.parent,this.dlgObj),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this)}}},e.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},e.prototype.keyUpHandler=function(e){"Escape"===e.key&&this.resetColumnState(),e&&e.target&&!(0,o.isNullOrUndefined)((0,o.closest)(e.target,".e-grid-popup"))&&this.parent.trigger("keyPressed",e),this.setFocus(_a(e.target,"e-cclist"))},e.prototype.setFocus=function(e){var t=this.dlgDiv.querySelector(".e-colfocus");t&&t.classList.remove("e-colfocus"),e&&e.classList.add("e-colfocus")},e.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");o.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},e.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");o.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},e.prototype.getColumns=function(){return(this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns()).filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},e.prototype.setOrderedColumns=function(){var e=this;this.selectedColumnModels=[];for(var t=function(t){var n=i.parent.getColumnByField(i.selectedColumns[parseInt(t.toString(),10)])||i.parent.columnModel.find(function(i){return i.headerText===e.selectedColumns[parseInt(t.toString(),10)]&&"checkbox"!==i.type});n&&n.showInColumnChooser&&i.selectedColumnModels.push(n)},i=this,n=0;n<this.selectedColumns.length;n++)t(n)},e.prototype.renderDlgContent=function(){var e=this.parent.enableAdaptiveUI;this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),e||this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new y.Dialog({header:this.parent.enableAdaptiveUI?null:this.renderHeader(),showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),content:this.renderChooserList(),width:250,cssClass:this.parent.cssClass?"e-cc "+this.parent.cssClass:"e-cc",animationSettings:{effect:"None"},footerTemplate:this.parent.enableAdaptiveUI?null:this.renderFooter()}),e||!this.infiniteRenderMode&&this.parent.columnChooserSettings.footerTemplate||(this.dlgObj.buttons=[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-cc e-cc_okbtn "+this.parent.cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat e-cc e-cc-cnbtn "+this.parent.cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}]);if(this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),e){var t=document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv");t&&t.appendChild(this.dlgDiv),this.dlgObj.open=this.mOpenDlg.bind(this),this.dlgObj.target=document.querySelector(".e-rescolumnchooser > .e-dlg-content > .e-mainfilterdiv")}this.wireEvents()},e.prototype.renderHeader=function(){if(this.parent.columnChooserSettings.headerTemplate&&!this.infiniteRenderMode){var e=this.parent.createElement("div",{className:"e-columnChooserHeaderTemplate"}),t=this.parent.element.id+"columnChooserHeaderTemplate";return this.parent.isReact?(this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t,null,null,e),this.parent.renderTemplates()):$a(e,this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t)),e}return this.l10n.getConstant("ChooseColumns")},e.prototype.renderFooter=function(){if(this.parent.columnChooserSettings.footerTemplate&&!this.infiniteRenderMode){var e=this.parent.createElement("div",{className:"e-columnChooserFooterTemplate"}),t=this.parent.element.id+"columnChooserFooterTemplate";return this.parent.isReact?(this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t,null,null,e),this.parent.renderTemplates()):$a(e,this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t)),e}return null},e.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),t=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search"),cssClass:this.parent.cssClass}}),i=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),n=this.parent.createElement("div",{className:"e-cc-contentdiv"});this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),e.appendChild(t),e.appendChild(i),this.searchBoxObj=new No(t,this.serviceLocator);var r=this.getColumns(),s=[],o=[];if(r.forEach(function(e){e.visible?s.push(e.headerText):o.push(e.headerText)}),this.infiniteRenderMode&&!this.isInitialOpen){r=this.parent.columns;for(var a=0;a<r.length;a++)r[parseInt(a.toString(),10)].showInColumnChooser&&this.infiniteColumns.push(r[parseInt(a.toString(),10)])}if(this.parent.columnChooserSettings.template&&!this.infiniteRenderMode){var l=this.parent.createElement("div",{className:"e-columnChooserTemplate"});l.style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;";var h=this.parent.element.id+"columnChooserTemplate",d={columns:r,hideColumns:o,showColumns:s};this.parent.isReact?(this.parent.getColumnChooserTemplate()(d,this.parent,"columnChooserTemplate",h,null,null,l),this.parent.renderTemplates()):$a(l,this.parent.getColumnChooserTemplate()(d,this.parent,"columnChooserTemplate",h,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(l,r):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=Ml(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(l,r))),this.mainDiv.appendChild(e),this.mainDiv.appendChild(l)}else{var p=this.refreshCheckboxList(r);if(this.innerDiv.appendChild(p),n.appendChild(this.innerDiv),this.parent.enableAdaptiveUI){var c=this.parent.createElement("div",{className:"e-cc-searchBox"});c.appendChild(e),this.mainDiv.appendChild(c)}else this.mainDiv.appendChild(e);this.mainDiv.appendChild(n)}return this.parent.columnChooserSettings.enableSearching||(e.style.display="none"),this.mainDiv},e.prototype.confirmDlgBtnClick=function(e){var t={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};if(this.parent.trigger(R,t),!t.cancel){this.stateChangeColumns=[],this.changedStateColumns=[];var i=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns();this.changedColumns=this.changedColumns.length>0?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns);var n=this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length:this.ulElement&&this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length;if(!(0,o.isNullOrUndefined)(e)){if(n<i.length)if(this.changeColumnVisibility({visibleColumns:this.showColumn,hiddenColumns:this.hideColumn},"uid"),0===this.parent.getCurrentViewRecords().length)this.parent.element.querySelector(".e-emptyrow").querySelector("td").setAttribute("colSpan",this.parent.getVisibleColumns().length.toString());this.parent.enableAdaptiveUI&&this.parent.scrollModule&&this.parent.scrollModule.refresh(),this.parent.editSettings.showAddNewRow&&this.parent.notify(jr,{})}var r={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};this.parent.trigger(D,r)}},e.prototype.changeColumnVisibility=function(e,t){if("uid"!==(t=t||"headerText")&&(e.visibleColumns||e.hiddenColumns)){this.stateChangeColumns=[],this.changedStateColumns=[];var i=this.getColumns();e.hiddenColumns=i.filter(function(i){return-1!==e.hiddenColumns.indexOf(i[t])}).map(function(e){return e.uid}),e.visibleColumns=i.filter(function(i){return-1!==e.visibleColumns.indexOf(i[t])}).map(function(e){return e.uid})}e.hiddenColumns.length&&this.columnStateChange(e.hiddenColumns,!1),e.visibleColumns.length&&this.columnStateChange(e.visibleColumns,!0),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),this.clearActions(),this.parent.notify(Bt,{module:"edit"})},e.prototype.onResetColumns=function(e){"columnstate"!==e.requestType||this.resetColumnState()},e.prototype.renderResponsiveColumnChooserDiv=function(e){"open"===e.action?(this.isColumnChooserOpen=!0,this.openColumnChooser()):"clear"===e.action?this.clearBtnClick():"confirm"===e.action&&this.confirmDlgBtnClick(!0)},e.prototype.resetColumnState=function(){if(this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.filterColumns=[],this.searchValue="",this.selectedColumnModels=[],this.selectedColumns=[],this.sortDirection="",this.infiniteRenderMode&&this.dlgDiv){var e=this.dlgDiv.querySelector(".e-cclist.e-cc-selectall.e-colfocus");e&&e.classList.remove("e-colfocus")}this.hideDialog()},e.prototype.changedColumnState=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],n=this.parent.getColumnByUid(i,this.infiniteRenderMode);this.changedStateColumns.push(n)}},e.prototype.columnStateChange=function(e,t){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],r=this.parent.getColumnByUid(n,this.infiniteRenderMode);r&&("checkbox"!==r.type&&(r.visible=t),this.stateChangeColumns.push(r))}},e.prototype.clearActions=function(){this.resetColumnState(),this.addcancelIcon()},e.prototype.clearBtnClick=function(){var e={requestType:"columnChooserClose",cancel:!1};if(this.parent.trigger(R,e),!e.cancel){this.clearActions(),this.parent.notify(An,{dialog:this.dlgObj});this.parent.trigger(D,{requestType:"columnChooserClose",cancel:!1})}},e.prototype.checkstatecolumn=function(e,t,i){void 0===i&&(i=!1);var n=this.parent.getColumnByUid(t,this.infiniteRenderMode);e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1!==this.showColumn.indexOf(t)||n&&n.visible||this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&n&&n.visible&&this.hideColumn.push(t)),i?e?this.unchangedColumns.push(t):this.changedColumns.push(t):-1!==this.changedColumns.indexOf(t)?this.changedColumns.splice(this.changedColumns.indexOf(t),1):this.changedColumns.push(t)},e.prototype.columnChooserSearch=function(e,t){if(t){var i={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1};if(this.parent.trigger(R,i),i.cancel)return}var n,r=!1,s=this.dlgDiv.querySelector(".e-footer-content"),l=this.ulElement&&this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;if(this.infiniteRenderMode&&(l=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length),this.isInitialOpen=!0,s&&s.querySelector(".e-btn")&&(n=s.querySelector(".e-btn").ej2_instances[0]),""===e)this.removeCancelIcon(),this.filterColumns=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns(),r=!0;else{var h=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns();this.filterColumns=new a.DataManager(h).executeLocal((new a.Query).where("headerText",this.searchOperator,e,!0,this.parent.columnChooserSettings.ignoreAccent))}if(0!==this.selectedColumnModels.length||"None"===this.sortDirection||this.parent.columnChooserSettings.template||(this.filterColumns=this.sortColumnChooser(this.filterColumns,this.sortDirection)),this.infiniteRenderMode&&this.updateIfiniteSelectAll(),this.parent.columnChooserSettings.template&&!this.infiniteRenderMode){var d=void 0,p=this.parent.isReact;p?(Ah(this.parent,["columnChooserTemplate"]),d=this.mainDiv.querySelector(".e-columnChooserTemplate")):(this.mainDiv.querySelector(".e-columnChooserTemplate").remove(),(d=this.parent.createElement("div",{className:"e-columnChooserTemplate"})).style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;");var c=this.parent.element.id+"columnChooserTemplate",u=this.filterColumns,g=e,f=[],m=[];u.forEach(function(e){e.visible?f.push(e.headerText):m.push(e.headerText)});var y={columns:u,hideColumns:m,showColumns:f,searchValue:g};p?(this.parent.getColumnChooserTemplate()(y,this.parent,"columnChooserTemplate",c,null,null,d),this.parent.renderTemplates()):$a(d,this.parent.getColumnChooserTemplate()(y,this.parent,"columnChooserTemplate",c,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(d,this.filterColumns):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=Ml(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(d,this.filterColumns))),this.mainDiv.appendChild(d)}else if(this.filterColumns.length)this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.infiniteInitialLoad=!0,this.infiniteLoadedElement=[],this.innerDiv.appendChild(this.refreshCheckboxList(this.filterColumns)),this.infiniteRenderMode&&(this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.remove("e-checkbox-disabled"),this.updateIntermediateBtn()),r?(n&&l&&(n.disabled=!1),l&&this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!1})):(this.addcancelIcon(),this.refreshCheckboxButton());else{var v=this.parent.createElement("span",{className:"e-cc e-nmatch"});v.innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.infiniteRenderMode&&((0,o.removeClass)([this.mainDiv.querySelector(".e-frame.e-selectall")],["e-check","e-stop","e-uncheck"]),this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.add("e-checkbox-disabled")),this.innerDiv.appendChild(v),this.innerDiv.classList.add("e-ccnmdiv"),n&&(n.disabled=!0),this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!0})}if(this.flag=!0,this.stopTimer(),t){var S={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1};this.parent.trigger(D,S)}},e.prototype.sortColumnChooser=function(e,t){return"Ascending"===t?e.slice().sort(function(e,t){return e.field.toLowerCase()<t.field.toLowerCase()?-1:1}):"Descending"===t?e.slice().sort(function(e,t){return e.field.toLowerCase()>t.field.toLowerCase()?-1:1}):e},e.prototype.updateIfiniteSelectAll=function(){this.changedColumns=[],this.hideColumn=[],this.showColumn=[];for(var e=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}),t=0;t<e.length;t++)this.checkState(e[parseInt(t.toString(),10)].querySelector(".e-frame"),!0)},e.prototype.wireEvents=function(){o.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),o.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),o.EventHandler.add(this.dlgObj.element,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()},e.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj&&this.dlgObj.element&&(o.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),o.EventHandler.remove(this.dlgObj.element,"keyup",this.keyUpHandler)),this.searchBoxObj&&(o.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent()))},e.prototype.checkBoxClickHandler=function(e){if(!this.parent.columnChooserSettings.template||this.infiniteRenderMode){var t,i=_a(e.target,"e-checkbox-wrapper"),n=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns();if(i){i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):Il(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check")?t=!0:i.querySelector(".e-uncheck")&&(t=!1),this.infiniteRenderMode||this.updateIntermediateBtn();var r=_a(i,"e-ccheck").getAttribute("data-uid"),s=this.searchValue&&this.searchValue.length||this.selectedColumnModels.length?this.filterColumns:n;if(r===this.parent.element.id+"-selectAll"){this.changedColumns=[],this.unchangedColumns=[];for(var o=0;o<s.length;o++)s[parseInt(o.toString(),10)].showInColumnChooser&&this.checkstatecolumn(t,s[parseInt(o.toString(),10)].uid,!0)}else this.checkstatecolumn(t,r);var a=!!(this.infiniteRenderMode&&i.querySelector(".e-selectall")&&i.querySelector(".e-uncheck"));this.parent.columnChooserSettings.footerTemplate||this.refreshCheckboxButton(a),this.setFocus(_a(e.target,"e-cclist")),this.infiniteRenderMode&&this.updateIntermediateBtn()}}},e.prototype.updateIntermediateBtn=function(){var e=this.infiniteRenderMode?this.infiniteLoadedElement.length:this.ulElement.children.length-1,t=[],i=0,n=0;(this.searchValue&&this.searchValue.length||"None"!==this.sortDirection?this.filterColumns:this.infiniteColumns).filter(function(e){!1===e.visible?i++:n++});var r,s=(this.infiniteRenderMode&&this.mainDiv.querySelector(".e-cc-selectall")?this.mainDiv.querySelector(".e-cc-selectall"):this.ulElement.children[0]).querySelector(".e-frame"),a=this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length:this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;this.parent.enableAdaptiveUI||this.parent.columnChooserSettings.footerTemplate?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!1}):(r=this.dlgObj.btnObj[0]).disabled=!1;var l=s.parentElement.querySelector("input");e===a&&(!this.infiniteRenderMode||this.infiniteRenderMode&&i===this.showColumn.length)?(t=["e-check"],xl(l,!0)):a||this.infiniteRenderMode&&!a&&n!==this.hideColumn.length?(t=["e-stop"],l.indeterminate=!0):(t=["e-uncheck"],xl(l,!1),r&&!this.parent.enableAdaptiveUI?r.disabled=!0:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!0})),r&&!this.parent.enableAdaptiveUI&&r.dataBind(),(0,o.removeClass)([s],["e-check","e-stop","e-uncheck"]),(0,o.addClass)([s],t)},e.prototype.updateSelectAll=function(e){var t=[].slice.call(this.ulElement.getElementsByClassName("e-frame"));this.infiniteRenderMode&&(t=[],this.infiniteLoadedElement.map(function(e){return t.push(e.querySelector(".e-frame"))}),t.unshift(this.mainDiv.querySelector(".e-cc-selectall").querySelector(".e-frame")));for(var i=0,n=t;i<n.length;i++){var r=n[i];Dl(r,e);var s=r.parentElement.querySelector("input");r.classList.contains("e-check")?xl(s,!0):r.classList.contains("e-uncheck")&&xl(s,!1)}},e.prototype.refreshCheckboxButton=function(e){for(var t=this.parent.getVisibleColumns(),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)].uid;-1===this.prevShowedCols.indexOf(n)&&"checkbox"!==t[parseInt(i.toString(),10)].type&&this.prevShowedCols.push(n)}for(i=0;i<this.hideColumn.length;i++){var r=this.prevShowedCols.indexOf(this.hideColumn[parseInt(i.toString(),10)]);-1!==r&&this.prevShowedCols.splice(r,1)}var s,o=0!==this.showColumn.length?1:this.prevShowedCols.length;this.infiniteRenderMode&&(o=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length),this.parent.enableAdaptiveUI?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!1}):(s=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0]).disabled=!1;for(var a=[],l=[].slice.call(document.getElementsByClassName("e-cc-chbox")),h=(i=0,l.length);i<h;i++){var d=l[parseInt(i.toString(),10)];if(!this.infiniteRenderMode||!d.classList.contains("e-selectall")){n=_a(d,"e-ccheck").getAttribute("data-uid");a.push(n)}}var p=this.showColumn.filter(function(e){return-1!==a.indexOf(e)});(this.infiniteRenderMode&&(e||a.length===o)||!this.infiniteRenderMode&&0===o&&0===p.length)&&(this.parent.enableAdaptiveUI?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!0}):s.disabled=!0),this.parent.enableAdaptiveUI||s.dataBind()},e.prototype.refreshCheckboxList=function(e){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var t=this.l10n.getConstant("SelectAll"),i=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"});(0,o.updateCSSText)(i,this.infiniteRenderMode?"list-style: None;":"");var n=this.createCheckBox(t,!1,this.parent.element.id+"-selectAll");return e.length&&(n.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),n.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(n.querySelector(".e-icons"),!0),i.appendChild(n),this.infiniteRenderMode?this.mainDiv.querySelector(".e-cc-contentdiv")&&!this.mainDiv.querySelector(".e-cc-selectall")&&(this.infiniteDiv=this.mainDiv.querySelector(".e-cc-contentdiv"),this.mainDiv.insertBefore(i,this.infiniteDiv),this.infiniteDiv.classList.add("e-checkbox-infinitescroll"),o.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),o.EventHandler.add(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),o.EventHandler.add(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.ulElement.appendChild(i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(0,o.addClass)([n],this.parent.cssClass.split(" ")):(0,o.addClass)([n],[this.parent.cssClass])),this.infiniteRenderMode&&e.length>3*this.itemsCount&&(this.infiniteSkipCount=2*this.itemsCount),this.renderCheckbox(e.slice(0,this.infiniteRenderMode?3*this.itemsCount:e.length)),this.ulElement},e.prototype.infiniteScrollMouseKeyDownHandler=function(){o.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler)},e.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this;o.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this);var i=this.infiniteDiv;this.ulElement.children.length>1&&(i.scrollTop>=i.scrollHeight-i.offsetHeight||i.scrollTop<=0)&&this.infiniteScrollHandler(),rl.timer=setTimeout(function(){t.clickHandler(e),rl.timer=null},0)},e.prototype.infiniteScrollHandler=function(){var e=this.infiniteDiv,t=this.searchValue&&this.searchValue.length||"None"!==this.sortDirection?this.filterColumns:this.infiniteColumns;if(e.scrollTop>=e.scrollHeight-e.offsetHeight&&this.infiniteLoadedElement.length<=this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount&&(!t.length||t.length>this.infiniteSkipCount+this.itemsCount)){var i=t.length-(this.infiniteSkipCount+this.itemsCount),n=0;i<this.itemsCount&&(n=i),Fh([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteInitialLoad=!0,this.infiniteSkipCount+=this.itemsCount,this.renderCheckbox(t.slice(this.infiniteSkipCount,this.infiniteSkipCount+(n+this.itemsCount))),this.prevInfiniteScrollDirection="down"}else e.scrollTop>=e.scrollHeight-e.offsetHeight&&this.infiniteLoadedElement.length>this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(Fh([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteSkipCount+="down"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,$a(this.ulElement,this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.itemsCount+this.infiniteSkipCount)),this.prevInfiniteScrollDirection="down"):0===e.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteLoadedElement.length&&this.infiniteLoadedElement.length>3*this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(Fh([].slice.call(this.ulElement.children).splice(2*this.itemsCount,this.itemsCount)),this.infiniteSkipCount-="up"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,Mh([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.prevInfiniteScrollDirection="up",this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff):0===e.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteSkipCount>2*this.itemsCount&&this.infiniteLoadedElement.length&&this.ulElement.children.length<3*this.itemsCount&&(Fh([].slice.call(this.ulElement.children).splice(2*this.itemsCount,t.length%this.itemsCount)),this.infiniteSkipCount=(Math.floor(t.length/this.itemsCount)-3)*this.itemsCount,Mh([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},e.prototype.refreshCheckboxState=function(){if(this.parent.columnChooserSettings.enableSearching||this.selectedColumnModels.length||"None"!==this.sortDirection){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("",!1);for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),i=0,n=t.length;i<n;i++){var r=t[parseInt(i.toString(),10)],s=void 0;s=this.parent.childGrid||this.parent.detailTemplate?_a(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[parseInt(i.toString(),10)],"e-ccheck").getAttribute("data-uid"):_a(r,"e-ccheck").getAttribute("data-uid");var o=e.getColumnByUid(s,this.infiniteRenderMode),a=[].slice.call(r.parentElement.getElementsByClassName("e-uncheck"));o.visible&&!a.length?(r.checked=!0,this.checkState(r.parentElement.querySelector(".e-icons"),!0)):(r.checked=!1,this.checkState(r.parentElement.querySelector(".e-icons"),!1))}}},e.prototype.checkState=function(e,t){t?(0,o.classList)(e,["e-check"],["e-uncheck"]):(0,o.classList)(e,["e-uncheck"],["e-check"])},e.prototype.createCheckBox=function(e,t,i){var n=t?this.cBoxTrue.cloneNode(!0):this.cBoxFalse.cloneNode(!0);this.parent.enableAdaptiveUI||!this.parent.enableRtl||n.classList.contains("e-rtl")||n.classList.add("e-rtl");var r=n.querySelector(".e-label"),s=n.querySelector("input");return xl(s,t),r.setAttribute("id",i+"label"),r.innerHTML=e,s.setAttribute("aria-labelledby",r.id),Rl(i,n,"e-ccheck")},e.prototype.renderCheckbox=function(e){for(var t,i=this.parent.createElement("div"),n=this.ulElement.offsetHeight,r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)];if(s.showInColumnChooser){var a=this.parent.createElement("li",{className:"e-cclist e-cc",id:"e-ccli_"+s.uid});a.style.listStyle="none";var l=-1!==this.hideColumn.indexOf(s.uid),h=-1!==this.showColumn.indexOf(s.uid),d=this.createCheckBox(s.headerText,s.visible&&!l||h,s.uid);a.appendChild(d),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(0,o.addClass)([d],this.parent.cssClass.split(" ")):(0,o.addClass)([d],[this.parent.cssClass])),this.infiniteRenderMode&&this.infiniteDiv&&(a.style.height=Lh(this.infiniteDiv,!0)+"px"),i.appendChild(a)}}this.infiniteRenderMode&&this.infiniteInitialLoad&&((t=this.infiniteLoadedElement).push.apply(t,[].slice.call(i.children)),this.infiniteInitialLoad=!1),$a(this.ulElement,[].slice.call(i.children)),this.infiniteRenderMode&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=this.ulElement.offsetHeight-n),this.isInitialOpen&&this.updateIntermediateBtn()},e.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},e.prototype.startTimer=function(e){var t=this,i=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue,!0)},i)},e.prototype.stopTimer=function(){window.clearInterval(this.timer)},e.prototype.addcancelIcon=function(){this.dlgDiv&&this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc-cancel").setAttribute("title",this.l10n.getConstant("Clear")))},e.prototype.removeCancelIcon=function(){this.dlgDiv&&this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").setAttribute("title",this.l10n.getConstant("Search")))},e.prototype.mOpenDlg=function(){o.Browser.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0]&&this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus()),this.parent.enableAdaptiveUI&&this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.add("e-input-focus")},e.prototype.getModuleName=function(){return"columnChooser"},e.prototype.hideOpenedDialog=function(){for(var e=[].slice.call(document.getElementsByClassName("e-ccdlg")).filter(function(e){return e.classList.contains("e-popup-open")}),t=0,i=e.length;t<i;t++)(this.parent.element.id+"_ccdlg"!==e[parseInt(t.toString(),10)].id||e[parseInt(t.toString(),10)].classList.contains("e-dialog"))&&e[parseInt(t.toString(),10)].ej2_instances[0].hide()},e.prototype.beforeOpenColumnChooserEvent=function(){var e=up({requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.parent.columnChooserSettings.operator,sortDirection:"None"},this.parent.enableColumnVirtualization?{}:{selectedColumns:[]});return this.parent.trigger(me,e),this.searchOperator=e.searchOperator,this.sortDirection=e.sortDirection,this.parent.enableColumnVirtualization||(this.selectedColumns=e.selectedColumns),e},e.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},e.prototype.showCustomColumnChooser=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()},e.prototype.onPropertyChanged=function(e){if(!e||e.module===this.getModuleName()){var t=this.parent.columnChooserSettings.enableSearching;if(this.dlgObj&&this.dlgObj.element){var i=this.dlgObj.element.querySelector(".e-cc-searchdiv"),n=this.dlgObj.element.querySelector(".e-dlg-content");i.style.display=t?"":"none",n.style.margin=t?"":"0px"}}},e}(),fp=c(437),mp=function(){function e(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},this.parent=e,!e.parentDetails&&t&&(this.foreignKeyData=t)}return e.getQuery=function(e,t){var i=t.generateQuery(!0).requiresCount();return t.isRemote()&&(e.groupSettings.enableLazyLoading&&e.groupSettings.columns.length?i.lazyLoad=[]:i.take(e.pageSettings.totalRecordsCount)),i},e.prototype.getFData=function(e,t){return El(t,{},e,this.foreignKeyData[t.field])[0]},e.prototype.getGridRowModel=function(e,t,i,n){void 0===n&&(n=0);var r=[],s=t.length;if(s){for(var o=0;o<s;o++,n++){var a={isExpand:!1};a.data=t[parseInt(o.toString(),10)],a.index=n,(i.childGrid||i.detailTemplate)&&("All"===i.hierarchyPrintMode?a.isExpand=!0:"Expanded"===i.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(n.toString(),10)]&&(a.isExpand=i.expandedRows[parseInt(n.toString(),10)].isExpand));var l=new $r(a);l.cells=this.generateCells(e,i),r.push(l)}this.processColumns(r)}return r},e.prototype.generateCells=function(e,i){var n=[];if(i.childGridLevel)for(var r=i.childGridLevel,s=0;r>s;s++)n.push(this.generateCell({},t.Indent));for(var o=0,a=e;o<a.length;o++){var l=a[o];n.push(this.generateCell(l,t.Data))}return n},e.prototype.getColumnData=function(e){var t,i=this,n=[],r=e.getForeignKeyColumns();if(r.length){for(var s=0;s<r.length;s++){var o="result"in r[parseInt(s.toString(),10)].dataSource?new a.DataManager(r[parseInt(s.toString(),10)].dataSource.result):r[parseInt(s.toString(),10)].dataSource;n.push(o.executeQuery(new a.Query))}t=Promise.all(n).then(function(e){for(var t=0;t<r.length;t++)i.foreignKeyData[r[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].result})}return t},e.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=ql(e);for(var i=[],n=0;n<this.colDepth;n++)i[parseInt(n.toString(),10)]=new $r({}),i[parseInt(n.toString(),10)].cells=[];return i=this.processColumns(i),{rows:i=this.processHeaderCells(i,e),columns:this.generateActualColumns(e)}},e.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},e.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var r=n[i];if(!r.commands)if(r.columns){if(r.visible||this.hideColumnInclude)0!==this.getCellCount(r,0)&&this.generateActualColumns(r.columns,t)}else(r.visible||this.hideColumnInclude)&&t.push(r)}return t},e.prototype.processHeaderCells=function(e,t){for(var i=t,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].commands||(e=this.appendGridCells(i[parseInt(n.toString(),10)],e,0));return e},e.prototype.appendGridCells=function(e,i,n){if(e.columns||!1===e.visible&&!this.hideColumnInclude||e.commands){if(e.columns){var r=this.getCellCount(e,0);r&&i[parseInt(n.toString(),10)].cells.push(new es({cellType:t.StackedHeader,column:e,colSpan:r}));for(var s=void 0,o=0,a=e.columns.length;o<a;o++)e.columns[parseInt(o.toString(),10)].visible&&!s&&(s=!0),i=this.appendGridCells(e.columns[parseInt(o.toString(),10)],i,n+1)}}else i[parseInt(n.toString(),10)].cells.push(this.generateCell(e,t.Header,this.colDepth-n,n));return i},e.prototype.generateCell=function(e,i,n,r){var s={visible:e.visible,isDataCell:i===t.Data,column:e,cellType:i,rowSpan:n,index:r};return(!s.rowSpan||s.rowSpan<2)&&delete s.rowSpan,new es(s)},e.prototype.processColumns=function(e){var i=this.parent,n=[];i.enableColumnVirtualization&&(n=i.getColumnIndexesInView());for(var r=0,s=e.length;r<s;r++)if(i.allowGrouping)for(var o=0,a=i.groupSettings.columns.length-1;o<a;o++)i.enableColumnVirtualization&&-1===n.indexOf(o)||e[parseInt(r.toString(),10)].cells.splice(0,0,this.generateCell({},t.HeaderIndent));return e},e.prototype.getCellCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getCellCount(e.columns[parseInt(i.toString(),10)],t);else(e.visible||this.hideColumnInclude)&&t++;return t},e.prototype.checkAndExport=function(e,t){Object.keys(e).some(function(t){return!e[""+t]})||t()},e.prototype.failureHandler=function(e,t,i){var n=this;return function(){e[t.id]=!0,n.checkAndExport(e,i)}},e.prototype.createChildGrid=function(e,t,i,n){var r=new Ia(this.parent.detailRowModule.getGridModel(e,t,i));e.isPrinting=!1;r.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:(0,o.getValue)(r.queryString,t.data),parentRowData:t.data};var s=Za("child-grid"),a=(0,o.createElement)("div",{id:s});return a.style.display="none",document.body.appendChild(a),r.id=s,n[""+s]=!1,r.isExportGrid=!0,{childGrid:r,element:a}},e.prototype.getGridExportColumns=function(e){for(var t=[],i=0,n=e;i<n.length;i++)"checkbox"!==n[parseInt(i.toString(),10)].type&&t.push(n[parseInt(i.toString(),10)]);return t},e.prototype.getForeignKeyData=function(){return this.foreignKeyData},e}(),yp=function(){function e(e){this.valueFormatter=new l(e),this.internationalization=new o.Internationalization(e)}return e.prototype.returnFormattedValue=function(e,t){return!(0,o.isNullOrUndefined)(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},e.prototype.formatCellValue=function(e){if(e.isForeignKey&&(e.value=(0,o.getValue)(e.column.foreignKeyValue,El(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format)return"string"==typeof e.column.format&&(e.column.format={format:e.column.format}),e.value||0===e.value?this.internationalization.getNumberFormat(e.column.format)(e.value):"";if("boolean"===e.column.type&&""!==e.value)return e.value?"true":"false";if("date"!==e.column.type&&"dateonly"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format)return((0,o.isNullOrUndefined)(e.column.type)||(0,o.isNullOrUndefined)(e.value))&&(0,o.isNullOrUndefined)(e.value)?"":e.value.toString();if("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format){var t=void 0,i=e.column.format;return t="date"===e.column.type||"dateonly"===e.column.type?{type:"date",skeleton:i}:"time"===e.column.type?{type:"time",skeleton:i}:{type:"dateTime",skeleton:i},this.returnFormattedValue(e,t)}if(e.column.format instanceof Object&&void 0===e.column.format.type)return e.value.toString();var n=void 0;return n="date"===e.column.type||"dateonly"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,n)},e}(),vp=function(){function e(e,t){this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.isCsvExport=!1,this.isChild=!1,this.isElementIdChanged=!1,this.gridPool={},this.sheet={},this.grpFooterTemplates=[],this.footerTemplates=[],this.aggIndex=0,this.totalAggregates=0,this.parent=e,this.helper=new mp(e),this.locator=t,this.l10n=this.locator.getService("localization")}return e.prototype.getModuleName=function(){return"ExcelExport"},e.prototype.init=function(e){null!==e.element&&""===e.element.id&&(e.element.id=(new Date).toISOString(),this.isElementIdChanged=!0),this.parent=e,this.parent.isDestroyed||(this.isExporting=void 0,this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.footer=void 0,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.exportValueFormatter=new yp(e.locale),e.id=Za("main-grid"),this.gridPool[e.id]=!1)},e.prototype.Map=function(e,t,i,n,r,s){var a=e,l="isCsv";this.gridPool={},!e.childGrid&&!e.detailTemplate||!(0,o.isNullOrUndefined)(t)&&"None"===t.hierarchyExportMode||(e.expandedRows=Nl(e).expandedRows);var h={requestType:"beforeExcelExport",gridObject:a,cancel:!1,isMultipleExport:i,workbook:n,isCsv:r,isBlob:s,isChild:this.isChild,grpFooterTemplates:this.grpFooterTemplates};return a.trigger($t,h),h.cancel?new Promise(function(e){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new Zr(a),this.isExporting=!0,this.isBlob=h.isBlob,this.isChild=h.isChild,this.grpFooterTemplates=h.grpFooterTemplates,this.isCsvExport=!!h[""+l]&&h[""+l],ka(t)&&Aa(t,a),this.processRecords(a,t,h.isMultipleExport,h.workbook))},e.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger(ei,this.isBlob?{promise:this.blobPromise}:{gridInstance:this.parent}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book)},e.prototype.processRecords=function(e,t,i,n){var r=this;if((0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(t.dataSource)){if((0,o.isNullOrUndefined)(t)||"CurrentPage"!==t.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()){var s=[],l=mp.getQuery(e,this.data);return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((0,o.isNullOrUndefined)(t)&&(t={hierarchyExportMode:"All"}),t.hierarchyExportMode="None"===t.hierarchyExportMode?"None":"All","All"===t.hierarchyExportMode&&(l.lazyLoad=[])),s.push(this.data.getData({},l)),s.push(this.helper.getColumnData(e)),new Promise(function(o,a){Promise.all(s).then(function(s){r.init(e),r.processInnerRecords(e,t,i,n,s[0]).then(function(){r.exportingSuccess(o)})}).catch(function(e){a(r.book),r.parent.trigger(T,e)})})}return new Promise(function(s){r.init(e),r.processInnerRecords(e,t,i,n,r.parent.getCurrentViewRecords()),r.exportingSuccess(s)})}t.dataSource=t.dataSource instanceof a.DataManager?t.dataSource:new a.DataManager(t.dataSource);var h=t.query?t.query:new a.Query;return((0,o.isNullOrUndefined)(h.isCountRequired)||e.aggregates)&&(h.isCountRequired=!0),new Promise(function(s){t.dataSource.executeQuery(h).then(function(o){r.init(e),r.processInnerRecords(e,t,i,n,o).then(function(){r.exportingSuccess(s)})})})},e.prototype.processInnerRecords=function(e,t,i,n,r){var s=this;this.groupedColLength=e.groupSettings.columns.length;var a,l=5,h=[],d=ql(e.columns),p=!(0,o.isNullOrUndefined)(t);return p&&!(0,o.isNullOrUndefined)(t.multipleExport)&&(this.expType=(0,o.isNullOrUndefined)(t.multipleExport.type)?"AppendToSheet":t.multipleExport.type,(0,o.isNullOrUndefined)(t.multipleExport.blankRows)||(l=t.multipleExport.blankRows)),(0,o.isNullOrUndefined)(n)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.sheet.images=[]):"NewSheet"===this.expType?(this.workSheet=n.worksheets,this.rows=[],this.columns=[],this.sheet.images=[],this.styles=n.styles):(this.workSheet=[],this.rows=n.worksheets[0].rows,this.columns=n.worksheets[0].columns,this.styles=n.styles,this.sheet.images=n.worksheets[0].images,this.rowLength=this.rows[this.rows.length-1].index+l,this.rowLength++),p&&((0,o.isNullOrUndefined)(i)?((0,o.isNullOrUndefined)(t.header)||this.processExcelHeader(JSON.parse(JSON.stringify(t.header))),(0,o.isNullOrUndefined)(t.footer)||(this.footer=JSON.parse(JSON.stringify(t.footer)))):((0,o.isNullOrUndefined)(t.header)||!i&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(t.header))),(0,o.isNullOrUndefined)(t.footer)||"AppendToSheet"===this.expType&&i||(this.footer=JSON.parse(JSON.stringify(t.footer))))),this.includeHiddenColumn=!!p&&t.includeHiddenColumn,new Promise(function(i,n){e.childGridLevel=0,h=s.processGridExport(e,t,r),s.globalResolve=i,s.gridPool[e.id]=!0,s.helper.checkAndExport(s.gridPool,s.globalResolve)}).then(function(){var r=[];if(s.organiseRows(h,h[0].index,r),s.rows=s.rows.concat(r),(0,o.isNullOrUndefined)(s.footer)||("AppendToSheet"===s.expType&&!i||"NewSheet"===s.expType)&&s.processExcelFooter(s.footer),s.columns.length>0&&(s.sheet.columns=s.columns),s.sheet.rows=s.rows,s.sheet.enableRtl=s.parent.enableRtl,s.parent.allowFiltering&&e.getVisibleColumns().length&&p&&t.enableFilter){var l=t.header?t.header.headerRows||t.header.rows.length:0,c={row:d+l,column:s.groupedColLength?s.groupedColLength+1:s.sheet.columns[0].index,lastRow:s.sheet.rows.length,lastColumn:s.sheet.columns.length};s.sheet.autoFilters=c}if(s.workSheet.push(s.sheet),s.book.worksheets=s.workSheet,s.book.styles=s.styles,e.notify("finalPageSetup",s.book),!i){if(s.isCsvExport){p&&!(0,o.isNullOrUndefined)(t.separator)&&","!==t.separator&&(a=t.separator);var u=new fp.Workbook(s.book,"csv",e.locale,o.defaultCurrencyCode,a);s.isBlob?s.blobPromise=u.saveAsBlob("text/csv"):p&&t.fileName?u.save(t.fileName):u.save("Export.csv")}else{u=new fp.Workbook(s.book,"xlsx",e.locale,o.defaultCurrencyCode);s.isBlob?s.blobPromise=u.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):p&&t.fileName?u.save(t.fileName):u.save("Export.xlsx")}s.isElementIdChanged&&(e.element.id=""),delete e.expandedRows}return n})},e.prototype.organiseRows=function(e,t,i){if(!e.length)return t;for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=r.childRows;s?(r.index=t++,delete r.childRows,i.push(r),t=this.organiseRows(s,t,i)):(r.index=t++,i.push(r))}return t},e.prototype.processGridExport=function(e,t,i){var n=[];(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(t.theme)||(this.theme=t.theme),!e.childGrid&&!e.detailTemplate||(0,o.isNullOrUndefined)(t)||(e.hierarchyPrintMode=t.hierarchyExportMode||"Expanded");var r=new mp(e,this.helper.getForeignKeyData()),s=ka(t)?ja(t.columns,e.enableColumnVirtualization):r.getGridExportColumns(e.columns),a=r.getHeaders(s,this.includeHiddenColumn),l=e.groupSettings.columns.length?e.groupSettings.columns.length-1:0;return n=this.processHeaderContent(e,a,l,n),n=!(0,o.isNullOrUndefined)(t)&&Object.keys(t).length&&(0,o.isNullOrUndefined)(t.dataSource)?"CurrentPage"!==t.exportType||e.groupSettings.enableLazyLoading&&!e.getDataModule().isRemote()?this.processRecordContent(e,i,a,t,void 0,n,r):this.processRecordContent(e,i,a,t,e.currentViewData,n,r):this.processRecordContent(e,i,a,t,void 0,n,r),e.notify(Ui,{excelRows:n,type:"excel"}),this.capTemplate=void 0,this.footerTemplates=[],this.grpFooterTemplates=[],this.aggIndex=0,this.totalAggregates=0,n},e.prototype.processRecordContent=function(e,t,i,n,r,s,a){var l;if(l=!(0,o.isNullOrUndefined)(r)&&r.length?r:t.result,(0,o.isNullOrUndefined)(l.level)?this.processRecordRows(e,l,i,0,0,n,s,a):this.processGroupedRows(e,l,i,l.level,0,n,s,a),!(0,o.isNullOrUndefined)(t.aggregates))if((0,o.isNullOrUndefined)(r)||this.parent.groupSettings.enableLazyLoading){var h=t.result.GroupGuid?t.result.records:t.result;this.processAggregates(e,h,s)}else this.processAggregates(e,t.result,s,r);return s},e.prototype.processGroupedRows=function(e,t,i,n,r,s,a,l){for(var h=0,d=t;h<d.length;h++){var p=d[h],c=[],u={};u.index=1+n-1;var g=e.getColumnByField(p.field),f={value:p.key,column:g,style:void 0,isForeignKey:g.isForeignColumn()},m=e.getColumnByField(p.field).headerText+": "+(g.enableGroupByFormat?p.key:this.exportValueFormatter.formatCellValue(f))+" - ";p.count>1?m+=p.count+" items":m+=p.count+" item";var y={captionText:m,type:this.isCsvExport?"CSV":"Excel",data:p};this.parent.trigger(ke,y),u.value=y.captionText,u.style=this.getCaptionThemeStyle(this.theme),(0,o.isNullOrUndefined)(y.style)||(u.style=this.mergeOptions(u.style,y.style));var v=new Ws(e).generateRows(p);if(this.fillAggregates(e,v,t.level+t.childLevels-1,a,this.rowLength),c.push(u),a[a.length-1].cells.length>0){for(var S=t.level+t.childLevels+v[0].cells.length,C=0,w=0,b=a[a.length-1].cells;w<b.length;w++){var I=b[w];I.index<S&&(S=I.index),I.index>C&&(C=I.index),c[c.length-1].index!==I.index&&c.push(I)}S-u.index>1&&(u.colSpan=S-u.index);for(var x=Object.keys(v[0].data),R=x?x.length:0;C<i.columns.length-R+n+t.childLevels;){var D={};D.index=C+1,D.style=this.getCaptionThemeStyle(this.theme);var T={type:this.isCsvExport?"CSV":"Excel",data:p};this.parent.trigger(ke,T),(0,o.isNullOrUndefined)(T.style)||(D.style=this.mergeOptions(D.style,T.style)),c.push(D),C++}}else{for(var E=0,O=0,k=i.columns;O<k.length;O++){k[O].visible&&E++}u.colSpan=t.childLevels+E}if(a[a.length-1].cells=c,this.rowLength++,this.groupedColLength<8&&n>1){var A={outlineLevel:n-1,isCollapsed:!0};a[a.length-1].grouping=A}!(0,o.isNullOrUndefined)(t.childLevels)&&t.childLevels>0?(this.processGroupedRows(e,p.items,i,p.items.level,r,s,a,l),this.processAggregates(e,p,a,void 0,n-1+t.childLevels,!0)):(r=this.processRecordRows(e,p.items,i,n-1,r,s,a,l),this.processAggregates(e,p,a,void 0,n-1,!0))}},e.prototype.processRecordRows=function(e,i,n,r,s,a,l,h){for(var d=1,p=[],c=n.columns,u=0,g=h.getGridRowModel(c,i,e,s);u<g.length;u++){var f=g[u];p=[],s++,d=1;for(var m=void 0,y=0,v=f.cells.length;y<v;y++){var S=f.cells[parseInt(y.toString(),10)];if(S.cellType===t.Data){var C=S.column,w=C.field,b=(0,o.isNullOrUndefined)(w)?"":C.valueAccessor(w,f.data,C),I=(0,o.isNullOrUndefined)(b)?"":b;if("dateonly"===C.type&&"string"==typeof I&&I){var x=I.split(/[^0-9.]/);I=new Date(parseInt(x[0],10),parseInt(x[1],10)-1,parseInt(x[2],10))}var R=void 0;if(C.isForeignColumn&&C.isForeignColumn()&&(R=h.getFData(I,C),I=(0,o.getValue)(C.foreignKeyValue,R)),!(0,o.isNullOrUndefined)(I)){var D={},T=d+r+e.childGridLevel,E={data:f.data,column:C,foreignKeyData:R,value:I,style:void 0,colSpan:1,cell:D};if(e.trigger(ti,E),(0,o.isNullOrUndefined)(E.image)||(0,o.isNullOrUndefined)(E.image.base64)||(m=this.setImage(E,T),E.image.height&&""!==E.value&&(m+=30)),(0,o.isNullOrUndefined)(E.hyperLink)||(E.cell.hyperlink={target:E.hyperLink.target},E.value=E.hyperLink.displayText||E.value),(D=E.cell).index=T,D.value=E.value,""===E.data&&e.childGridLevel&&1===d){var O={hAlign:"left"};E={style:O},D.colSpan=e.getVisibleColumns().length,D.value=this.l10n.getConstant("EmptyRecord")}if(E.colSpan>1&&(D.colSpan=E.colSpan),(0,o.isNullOrUndefined)(E.style))D.style={name:e.element.id+"column"+(d+r)};else{var k=this.getColumnStyle(e,d+r);D.style=this.mergeOptions(this.styles[parseInt(k.toString(),10)],E.style)}p.push(D)}d++}}var A={index:this.rowLength++,cells:p};if((0,o.isNullOrUndefined)(m)||(A.height=m),this.groupedColLength&&this.groupedColLength<8&&r+1>0?(A.grouping={outlineLevel:r+1,isCollapsed:!0},l.push(A)):l.push(A),(f.isExpand||this.isChild)&&(!(0,o.isNullOrUndefined)(e.childGrid)||!(0,o.isNullOrUndefined)(e.detailTemplate)))if((0,o.isNullOrUndefined)(e.childGrid)){B={parentRow:f,row:A,value:{},action:"excelexport",gridInstance:e};this.parent.trigger(ri,B),A.childRows=this.processDetailTemplate(B)}else{e.isPrinting=!0;var F=!(0,o.isNullOrUndefined)(a)&&a.exportType?a.exportType:"AllPages",M=this.helper.createChildGrid(e,f,F,this.gridPool),L=M.childGrid,P=M.element;L.actionFailure=h.failureHandler(this.gridPool,L,this.globalResolve),L.childGridLevel=e.childGridLevel+1;var N=(0,o.extend)(a,{columns:null,dataSource:null,query:null}),B={childGrid:L,row:f,exportProperties:N};this.parent.trigger(ni,B),L.beforeDataBound=this.childGridCell(A,L,N,f),L.appendTo(P)}e.notify(qi,{rowObj:f,type:"excel",excelRows:l})}return s},e.prototype.processDetailTemplate=function(e){var t,i,n=this,r=[];if(e.value.columnHeader||e.value.rows){var s=function(e,r){var s={};if((0,o.isNullOrUndefined)(e.index)&&(e.index=i,i++),s.index=e.index+2,(0,o.isNullOrUndefined)(e.value)||(s.value=e.value),(0,o.isNullOrUndefined)(e.colSpan)||(s.colSpan=e.colSpan),(0,o.isNullOrUndefined)(e.rowSpan)||(s.rowSpan=e.rowSpan),s.style=r?n.getHeaderThemeStyle(n.theme):n.getRecordThemeStyle(n.theme),!(0,o.isNullOrUndefined)(e.style)){var a={fontColor:e.style.fontColor,fontName:e.style.fontName,fontSize:e.style.fontSize,hAlign:e.style.excelHAlign,vAlign:e.style.excelVAlign,rotation:e.style.excelRotation,bold:e.style.bold,indent:e.style.indent,italic:e.style.italic,underline:e.style.underline,backColor:e.style.backColor,wrapText:e.style.wrapText,borders:e.style.excelBorders,numberFormat:e.style.excelNumberFormat,type:e.style.excelType,strikeThrough:e.style.strikeThrough};s.style=n.mergeOptions(a,s.style)}return(0,o.isNullOrUndefined)(e.image)||(0,o.isNullOrUndefined)(e.image.base64)||(e.rowSpan>1?n.setImage(e,s.index):(t=n.setImage(e,s.index),e.image.height&&""!==e.value&&(t+=30))),(0,o.isNullOrUndefined)(e.hyperLink)||(s.hyperlink={target:e.hyperLink.target},s.value=e.hyperLink.displayText),s},a=function(e,a){var l=[];i=0;for(var h=0;h<e.cells.length;h++){var d=e.cells[parseInt(h.toString(),10)],p=s(d,a);l.push(p)}var c={index:n.rowLength++,cells:l};(0,o.isNullOrUndefined)(t)||(c.height=t,t=null),r.push(c)};if(e.value.columnHeader)for(var l=0;l<e.value.columnHeader.length;l++)a(e.value.columnHeader[parseInt(l.toString(),10)],!0);if(e.value.rows)for(l=0;l<e.value.rows.length;l++)a(e.value.rows[parseInt(l.toString(),10)])}else if(e.value.image){t=this.setImage(e.value,2);var h={index:this.rowLength++,cells:[{index:2,style:this.getRecordThemeStyle(this.theme)}]};(0,o.isNullOrUndefined)(t)||(h.height=t,t=null),r.push(h)}else if(e.value.text){h={index:this.rowLength++,cells:[{index:2,value:e.value.text,style:this.getRecordThemeStyle(this.theme)}]};r.push(h)}else if(e.value.hyperLink){h={index:this.rowLength++,cells:[{index:2,hyperlink:{target:e.value.hyperLink.target},value:e.value.hyperLink.displayText,style:this.getRecordThemeStyle(this.theme)}]};r.push(h)}for(l=0;l<r.length;l++)r[parseInt(l.toString(),10)].grouping={outlineLevel:1,isCollapsed:!e.parentRow.isExpand,isHidden:!e.parentRow.isExpand};return r},e.prototype.setImage=function(e,t){(0,o.isNullOrUndefined)(this.sheet.images)&&(this.sheet.images=[]);var i={image:e.image.base64,row:this.rowLength,column:t,lastRow:this.rowLength,lastColumn:t};return e.image.width&&e.image.height&&(i.width=e.image.width,i.height=e.image.height),this.sheet.images.push(i),this.columns[t-1].width=e.image.width||this.columns[t-1].width,e.image.height||50},e.prototype.childGridCell=function(e,t,i,n){var r=this;return function(s){t.beforeDataBound=null,s.cancel=!0,0===s.result.length&&(s.result=[""]),e.childRows=r.processGridExport(t,i,s);for(var a=r.parent.groupSettings.columns.length,l=e.childRows,h=0;h<l.length;h++)l[parseInt(h.toString(),10)].grouping={outlineLevel:a+t.childGridLevel,isCollapsed:!n.isExpand,isHidden:!n.isExpand};return t.destroy(),(0,o.detach)(t.element),r.gridPool[t.id]=!0,r.helper.checkAndExport(r.gridPool,r.globalResolve),e}},e.prototype.processAggregates=function(e,t,i,n,r,s){var a=new _s(e),l=a.getColumns();l=l.filter(function(e){return(0,o.isNullOrUndefined)(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo();var h=void 0;if(h=(0,o.isNullOrUndefined)(n)?t:n,void 0===r&&(r=0),e.groupSettings.columns.length>0&&s){var d=new Ks(e).generateRows(h,{level:h.level});d.length>0&&(i=this.fillAggregates(e,d,r,i))}else{r=e.groupSettings.columns.length>0&&!s?e.groupSettings.columns.length:r;var p=a.generateRows(h,t.aggregates,null,null,l);p.length>0&&!s&&(r=e.groupSettings.columns.length?r-1:r,i=this.fillAggregates(e,p,r,i))}return i},e.prototype.fillAggregates=function(e,i,n,r,s){for(var a=0,l=i;a<l.length;a++){for(var h=l[a],d=[],p=!0,c=0,u=0,g=h.cells;u<g.length;u++){var f=g[u],m={},y={};if((0,o.isNullOrUndefined)(f.attributes["data-index"])||(y=this.parent.getColumnByIndex(f.attributes["data-index"])),f.cellType!==t.DetailFooterIntent&&"checkbox"!==y.type&&!y.commands&&(f.visible||this.includeHiddenColumn))if(c++,f.isDataCell){p=!1;var v=!(0,o.isNullOrUndefined)(f.column.footerTemplate),S=!(0,o.isNullOrUndefined)(f.column.groupFooterTemplate),C=!(0,o.isNullOrUndefined)(f.column.groupCaptionTemplate);if(m.index=c+n+e.childGridLevel,v)m.value=this.getAggreateValue(e,t.Summary,f.column.footerTemplate,f,h);else if(S)m.value=this.getAggreateValue(e,t.GroupSummary,f.column.groupFooterTemplate,f,h);else if(C)m.value=this.getAggreateValue(e,t.CaptionSummary,f.column.groupCaptionTemplate,f,h);else for(var w=0,b=Object.keys(h.data[f.column.field]);w<b.length;w++){b[w]===f.column.type&&((0,o.isNullOrUndefined)(h.data[f.column.field].Sum)?(0,o.isNullOrUndefined)(h.data[f.column.field].Average)?(0,o.isNullOrUndefined)(h.data[f.column.field].Max)?(0,o.isNullOrUndefined)(h.data[f.column.field].Min)?(0,o.isNullOrUndefined)(h.data[f.column.field].Count)?(0,o.isNullOrUndefined)(h.data[f.column.field].TrueCount)?(0,o.isNullOrUndefined)(h.data[f.column.field].FalseCount)?(0,o.isNullOrUndefined)(h.data[f.column.field].Custom)||(m.value=h.data[f.column.field].Custom):m.value=h.data[f.column.field][f.column.field+" - falsecount"]:m.value=h.data[f.column.field][f.column.field+" - truecount"]:m.value=h.data[f.column.field][f.column.field+" - count"]:m.value=h.data[f.column.field][f.column.field+" - min"]:m.value=h.data[f.column.field][f.column.field+" - max"]:m.value=h.data[f.column.field][f.column.field+" - average"]:m.value=h.data[f.column.field][f.column.field+" - sum"])}m.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(f.column,m.style,f.column.field);var I=null!=f.attributes.class?f.attributes.class.toString():"";I&&(m.style.hAlign=I.indexOf("e-rightalign")>-1?"right":I.indexOf("e-centeralign")>-1?"center":"left");var x={row:h,type:v?"Footer":S?"GroupFooter":"GroupCaption",style:m,cell:f};this.parent.trigger(Pn,x),d.push(m)}else if(void 0===s){m.index=c+n+e.childGridLevel,m.style=this.getCaptionThemeStyle(this.theme);x={row:h,type:(0,o.isNullOrUndefined)(f.column.footerTemplate)?(0,o.isNullOrUndefined)(f.column.groupFooterTemplate)?"GroupCaption":"GroupFooter":"Footer",style:m,cell:f};this.parent.trigger(Pn,x),d.push(m)}}if((0,o.isNullOrUndefined)(s)){var R={},D="grouping";if(!(this.groupedColLength<8&&this.groupedColLength>0)||e.groupSettings.enableLazyLoading&&(0,o.isNullOrUndefined)(r[r.length-1][""+D]))R={index:this.rowLength++,cells:d};else{var T={outlineLevel:r[r.length-1][""+D].outlineLevel,isCollapsed:!0};R={index:this.rowLength++,cells:d,grouping:T}}p||r.push(R)}else r.push({index:s,cells:d})}return r},e.prototype.aggregateStyle=function(e,t,i){var n=this.parent.getColumnByField(i);if("object"==typeof e.format){var r=e.format;t.numberFormat=(0,o.isNullOrUndefined)(r.format)?r.skeleton:r.format,(0,o.isNullOrUndefined)(r.type)||(t.type=r.type.toLowerCase())}else t.numberFormat=e.format;!(0,o.isNullOrUndefined)(n)&&(0,o.isNullOrUndefined)(t.type)&&(t.type=n.type.toLowerCase())},e.prototype.getAggreateValue=function(e,i,n,r,s){var a,l={};l[(0,o.getEnumValue)(t,r.cellType)]=(0,o.compile)(n);var h=s.data[r.column.field?r.column.field:r.column.columnName];return(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof r.column.footerTemplate&&"string"!=typeof r.column.groupFooterTemplate&&"string"!=typeof r.column.groupCaptionTemplate?(a=h[r.column.type],(0,o.isNullOrUndefined)(a)?"":a):(a=l[(0,o.getEnumValue)(t,r.cellType)](h,this.parent),this.parent.isVue3&&!(0,o.isNullOrUndefined)(a[1])?a[1].textContent:(0,o.isNullOrUndefined)(a[0])?"":a[0].textContent)},e.prototype.mergeOptions=function(e,t){for(var i={},n=Object.keys(e),r=0;r<n.length;r++)"name"!==n[parseInt(r.toString(),10)]&&(i[n[parseInt(r.toString(),10)]]=e[n[parseInt(r.toString(),10)]]);n=Object.keys(t);for(r=0;r<n.length;r++)"name"!==n[parseInt(r.toString(),10)]&&(i[n[parseInt(r.toString(),10)]]=t[n[parseInt(r.toString(),10)]]);return i},e.prototype.getColumnStyle=function(e,t){for(var i=0,n=0,r=this.styles;n<r.length;n++){if(r[n].name===e.element.id+"column"+t)return i;i++}},e.prototype.headerRotation=function(e){var t=e.style.rotation;t<=90&&t>=0?e.style.hAlign="Left":(t>90&&t<=180||(t=180),e.style.hAlign="Right"),e.style.rotation=t},e.prototype.processHeaderContent=function(e,i,n,r){var s,a=i.rows,l=i.columns,h=[];if(n>0)for(var d=0;d!==n;)this.columns.push({index:d+1,width:30}),d++;for(var p=0;p<l.length;p++)this.parseStyles(e,l[parseInt(p.toString(),10)],this.getRecordThemeStyle(this.theme),n+p+1);for(var c=0;c<a.length;c++){for(var u=1+n,g=[],f=0;f<a[parseInt(c.toString(),10)].cells.length;f++){var m={},y={},v=a[parseInt(c.toString(),10)].cells[parseInt(f.toString(),10)];if(!v.isSpanned&&v.cellType!==t.HeaderIndent&&v.cellType!==t.DetailHeader){for(var S={contains:!0,index:1};S.contains;)if(u=(S=this.getIndex(h,1,u)).index,!S.contains){y.index=S.index+e.childGridLevel;break}if(!(0,o.isNullOrUndefined)(v.rowSpan)&&1!==v.rowSpan){y.rowSpan=v.rowSpan;for(var C=1;C<v.rowSpan+1;C++){var w={rowIndex:0,columnIndex:0,colSpan:0};w.rowIndex=C,w.columnIndex=u,w.colSpan=v.colSpan||1,h.push(w)}}(0,o.isNullOrUndefined)(v.colSpan)||1===v.colSpan||(y.colSpan=v.colSpan,u=u+y.colSpan-1),y.value=v.column.headerText,m=this.getHeaderThemeStyle(this.theme),(0,o.isNullOrUndefined)(v.column.textAlign)||(m.hAlign=v.column.textAlign.toLowerCase()),(0,o.isNullOrUndefined)(v.column.headerTextAlign)||(m.hAlign=v.column.headerTextAlign.toLowerCase());var b={cell:y,gridCell:v,style:m};if(e.trigger(ii,b),v.cellType===t.Header&&y.colSpan>1){u=u+y.colSpan-1;for(var I=1;I<y.colSpan;I++){var x=f+I;x<a[parseInt(c.toString(),10)].cells.length&&(a[parseInt(c.toString(),10)].cells[parseInt(x.toString(),10)].isSpanned=!0)}for(C=0;C<h.length;C++)h[parseInt(C.toString(),10)].columnIndex===y.index&&(h[parseInt(C.toString(),10)].colSpan=y.colSpan)}b.style.rotation&&this.headerRotation(b),(0,o.isNullOrUndefined)(b.image)||(0,o.isNullOrUndefined)(b.image.base64)||(s=this.setImage(b,u)),(0,o.isNullOrUndefined)(b.hyperLink)||(b.cell.hyperlink={target:b.hyperLink.target},y.value=b.hyperLink.displayText||y.value),y.style=b.style,g.push(y),u++}}var R={index:this.rowLength++,cells:g};(0,o.isNullOrUndefined)(s)||(R.height=s),r.push(R)}return r},e.prototype.getHeaderThemeStyle=function(e){var t={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};return(0,o.isNullOrUndefined)(e)||(0,o.isNullOrUndefined)(e.header)||(t=this.updateThemeStyle(e.header,t)),t},e.prototype.updateThemeStyle=function(e,t){return(0,o.extend)(t,e)},e.prototype.getCaptionThemeStyle=function(e){var t={fontSize:13,backColor:"#F6F6F6"};return(0,o.isNullOrUndefined)(e)||(0,o.isNullOrUndefined)(e.caption)||(t=this.updateThemeStyle(e.caption,t)),t},e.prototype.getRecordThemeStyle=function(e){var t={fontSize:13,borders:{color:"#E0E0E0"}};return(0,o.isNullOrUndefined)(e)||(0,o.isNullOrUndefined)(e.record)||(t=this.updateThemeStyle(e.record,t)),t},e.prototype.processExcelHeader=function(e){if(!(0,o.isNullOrUndefined)(e.rows)&&("NewSheet"===this.expType||1===this.rowLength)){var t=void 0;void 0===e.headerRows?this.rowLength=e.rows.length:this.rowLength=e.headerRows,t=this.rowLength<e.rows.length?this.rowLength:e.rows.length,this.rowLength++;for(var i=0;i<t;i++){var n=e.rows[parseInt(i.toString(),10)];(null===n.index||(0,o.isNullOrUndefined)(n.index))&&(n.index=i+1),this.updatedCellIndex(n)}}},e.prototype.updatedCellIndex=function(e){for(var t=e.cells.length,i=0;i<t;i++){var n=e.cells[parseInt(i.toString(),10)];(null===n.index||(0,o.isNullOrUndefined)(n.index))&&(n.index=i+1)}this.rows.push(e)},e.prototype.processExcelFooter=function(e){if(!(0,o.isNullOrUndefined)(e.rows)){var t=void 0;void 0===e.footerRows?this.rowLength+=e.rows.length:e.footerRows>e.rows.length?(this.rowLength+=e.footerRows-e.rows.length,t=e.rows.length):t=e.footerRows;for(var i=0;i<t;i++){var n=e.rows[parseInt(i.toString(),10)];null===n.index||void 0===n.index?n.index=this.rowLength++:n.index+=this.rowLength,this.updatedCellIndex(n)}}},e.prototype.getIndex=function(e,t,i){for(var n=0,r=e;n<r.length;n++){var s=r[n];if(s.rowIndex===t&&s.columnIndex===i)return{contains:!0,index:i+=s.colSpan||1}}return{contains:!1,index:i}},e.prototype.parseStyles=function(e,t,i,n){if(!(0,o.isNullOrUndefined)(t.format))if("object"==typeof t.format){var r=t.format;i.numberFormat=(0,o.isNullOrUndefined)(r.format)?r.skeleton:r.format,(0,o.isNullOrUndefined)(r.type)||(i.type="dateonly"===r.type?"date":r.type.toLowerCase())}else i.numberFormat=t.format,i.type="dateonly"===t.type?"date":t.type;(0,o.isNullOrUndefined)(t.textAlign)||(i.hAlign=t.textAlign.toLowerCase()),Object.keys(i).length>0&&(i.name=e.element.id+"column"+n,this.styles.push(i)),e.childGridLevel||((0,o.isNullOrUndefined)(t.width)||"auto"===t.width?this.columns.push({index:n+e.childGridLevel,width:null}):this.columns.push({index:n+e.childGridLevel,width:"number"==typeof t.width?t.width:this.helper.getConvertedWidth(t.width)}))},e.prototype.destroy=function(){},e}(),Sp=c(461),Cp=function(){function e(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.helper=new mp(e),this.gridPool={}}return e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.init=function(e){this.exportValueFormatter=new yp(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=Za("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new Sp.PdfPageSettings},e.prototype.exportWithData=function(e,t,i,n,r,s,a){var l=this;this.init(e),(0,o.isNullOrUndefined)(t)?this.pdfDocument=new Sp.PdfDocument:this.pdfDocument=t,this.processExport(e,n,r,s).then(function(){l.isExporting=!1,e.trigger(oi,l.isBlob?{promise:l.blobPromise}:{gridInstance:l.parent}),l.parent.log("exporting_complete",l.getModuleName()),i(l.pdfDocument)}).catch(function(e){a(l.pdfDocument),l.parent.trigger(T,e)})},e.prototype.Map=function(e,t,i,n,r){var s=this;this.data=new Zr(this.parent),this.isBlob=r,this.gridPool={};var l=t&&t.query?t.query:new a.Query;!e.childGrid&&!e.detailTemplate||!(0,o.isNullOrUndefined)(t)&&"None"===t.hierarchyExportMode||(e.expandedRows=Nl(e).expandedRows);var h={requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1};h.gridObject=e;if(e.trigger(si,h),!0===h.cancel)return new Promise(function(e,t){return e()});if(ka(t)&&Aa(t,e),h.generateQuery&&(l=mp.getQuery(e,this.data)),this.headerOnPages=h.headerPageNumbers,this.drawPosition=h.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(t.dataSource)){if((0,o.isNullOrUndefined)(t)||"CurrentPage"!==t.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()){var d=[],p=mp.getQuery(e,this.data);return this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((0,o.isNullOrUndefined)(t)&&(t={hierarchyExportMode:"All"}),t.hierarchyExportMode="None"===t.hierarchyExportMode?"None":"All","All"===t.hierarchyExportMode&&(p.lazyLoad=[])),d.push(this.data.getData({},p)),d.push(this.helper.getColumnData(e)),new Promise(function(r,a){Promise.all(d).then(function(l){s.init(e),(0,o.isNullOrUndefined)(n)?s.pdfDocument=new Sp.PdfDocument:s.pdfDocument=n.document,s.processExport(e,l[0],t,i,n).then(function(i){s.isExporting=!1,e.trigger(oi,s.isBlob?{promise:s.blobPromise}:{gridInstance:s.parent}),s.parent.log("exporting_complete",s.getModuleName()),t&&t.multipleExport&&"AppendToPage"===t.multipleExport.type?r(i):r(s.pdfDocument)}).catch(function(e){a(s.pdfDocument),s.parent.trigger(T,e)})})})}return new Promise(function(r,o){s.exportWithData(e,n,r,s.parent.getCurrentViewRecords(),t,i,o)})}return t.dataSource=t.dataSource instanceof a.DataManager?t.dataSource:new a.DataManager(t.dataSource),((0,o.isNullOrUndefined)(l.isCountRequired)||e.aggregates)&&(l.isCountRequired=!0),new Promise(function(r,o){t.dataSource.executeQuery(l).then(function(a){s.exportWithData(e,n,r,a,t,i,o)})})},e.prototype.processExport=function(e,t,i,n,r){var s,a=this,l=r&&i&&i.multipleExport&&"AppendToPage"===i.multipleExport.type?null:this.pdfDocument.sections.add();this.processSectionExportProperties(l,i);var h=r&&i&&i.multipleExport&&"AppendToPage"===i.multipleExport.type?r.result.page:l.pages.add();return new Promise(function(n,r){s=a.processGridExport(e,t,i),a.globalResolve=n,a.gridPool[e.id]=!0,a.helper.checkAndExport(a.gridPool,a.globalResolve)}).then(function(){var t,l,d=a.drawPosition.xPosition;if(r&&i&&i.multipleExport&&"AppendToPage"===i.multipleExport.type?(t=r.result.bounds.y+r.result.bounds.height,i.multipleExport.blankSpace&&(t=r.result.bounds.y+r.result.bounds.height+i.multipleExport.blankSpace)):t=a.drawPosition.yPosition,n){var p=new Sp.PdfGridLayoutFormat;p.layout=Sp.PdfLayoutType.Paginate,p.break=Sp.PdfLayoutBreakType.FitPage,p.paginateBounds=new Sp.RectangleF(0,0,h.getClientSize().width,h.getClientSize().height),l=s.draw(h,d,t,p)}else l=s.draw(h,d,t);return a.drawHeader(i),n||(a.isBlob?a.blobPromise=a.pdfDocument.save():!(0,o.isNullOrUndefined)(i)&&i.fileName?a.pdfDocument.save(i.fileName):a.pdfDocument.save("Export.pdf"),a.pdfDocument.destroy(),delete e.expandedRows),i&&i.multipleExport&&"AppendToPage"===i.multipleExport.type?{document:a.pdfDocument,result:l}:a.pdfDocument})},e.prototype.processSectionExportProperties=function(e,t){return(0,o.isNullOrUndefined)(e)||(0,o.isNullOrUndefined)(t)||(0,o.isNullOrUndefined)(t.pageOrientation)&&(0,o.isNullOrUndefined)(t.pageSize)||(this.pdfPageSettings.orientation="Landscape"===t.pageOrientation?Sp.PdfPageOrientation.Landscape:Sp.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(t.pageSize),e.setPageSettings(this.pdfPageSettings)),e},e.prototype.processGridExport=function(e,t,i){var n=!0;(0,o.isNullOrUndefined)(i)||(this.gridTheme=i.theme,n=!!(0,o.isNullOrUndefined)(i.allowHorizontalOverflow)||i.allowHorizontalOverflow);var r=new mp(e,this.helper.getForeignKeyData()),s=this.processExportProperties(i,t.result),a=ka(i)?ja(i.columns,e.enableColumnVirtualization):r.getGridExportColumns(e.columns);a=a.filter(function(e){return(0,o.isNullOrUndefined)(e.commands)});var l=!1;e.groupSettings.columns.length&&(l=!0),!e.childGrid&&!e.detailTemplate||(0,o.isNullOrUndefined)(i)||(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded");var h=new Sp.PdfGrid,d=this.getHeaderThemeStyle(),p=d.border,c=d.font,u=d.brush,g=r.getHeaders(a,this.hideColumnInclude),f=g.columns;h=this.processGridHeaders(e.groupSettings.columns.length,h,g.rows,f,p,c,u,e,n,a),this.setColumnProperties(f,h,r,e,n);var m=this.getSummaryCaptionThemeStyle();if(!(0,o.isNullOrUndefined)(s)&&s.length){if(l?((0,o.isNullOrUndefined)(m.border)||(p=m.border),this.processGroupedRecords(h,s,f,e,p,0,m.font,m.brush,m.backgroundBrush,t,i,r,0)):this.processRecord(p,f,e,s,h,0,i,r,0),!(0,o.isNullOrUndefined)(t.aggregates)){var y=new _s(e),v=void 0,S=y.getColumns();S=S.filter(function(e){return(0,o.isNullOrUndefined)(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),v=this.customDataSource?y.generateRows(s,t.aggregates,null,null,S):this.currentViewData?y.generateRows(this.parent.getCurrentViewRecords(),t.aggregates):l?y.generateRows(s.records,t.aggregates):y.generateRows(t.result,t.aggregates,null,null,S),this.processAggregates(v,h,p,m.font,m.brush,m.backgroundBrush,!1,null,null,null,!l)}}else h.rows.addRow().style.setBorder(p);return h},e.prototype.getSummaryCaptionThemeStyle=function(){if((0,o.isNullOrUndefined)(this.gridTheme)||(0,o.isNullOrUndefined)(this.gridTheme.caption))return{font:new Sp.PdfStandardFont(Sp.PdfFontFamily.Helvetica,9.75),brush:new Sp.PdfSolidBrush(new Sp.PdfColor(0,0,0)),backgroundBrush:new Sp.PdfSolidBrush(new Sp.PdfColor(246,246,246))};var e=(0,o.isNullOrUndefined)(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,t=(0,o.isNullOrUndefined)(this.gridTheme.caption.fontName)?Sp.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),i=this.getFontStyle(this.gridTheme.caption),n=new Sp.PdfColor(0,0,0);if(!(0,o.isNullOrUndefined)(this.gridTheme.caption.fontColor)){var r=this.hexToRgb(this.gridTheme.caption.fontColor);n=new Sp.PdfColor(r.r,r.g,r.b)}var s=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,a=new Sp.PdfStandardFont(t,e,i);return(0,o.isNullOrUndefined)(this.gridTheme.caption.font)||(a=this.gridTheme.caption.font),{font:a,brush:new Sp.PdfSolidBrush(n),backgroundBrush:new Sp.PdfSolidBrush(new Sp.PdfColor(246,246,246)),border:s}},e.prototype.getGridPdfFont=function(e){var t="fontFamily",i="fontSize",n="fontStyle",r="isTrueType",s=0;if(e.header&&e.header.font){var a=e.header.font[""+t],l=e.header.font[""+i],h=e.header.font[""+n];if(s=(0,o.isNullOrUndefined)(Sp.PdfFontStyle[""+h])?0:Sp.PdfFontStyle[""+h],e.header.font[""+r])e.header.font=new Sp.PdfTrueTypeFont(a,l,s);else{var d=(0,o.isNullOrUndefined)(a)?Sp.PdfFontFamily.Helvetica:this.getFontFamily(a);e.header.font=new Sp.PdfStandardFont(d,l,s)}}if(e.caption&&e.caption.font){var p=e.caption.font[""+t],c=e.caption.font[""+i],u=e.caption.font[""+n];if(s=(0,o.isNullOrUndefined)(Sp.PdfFontStyle[""+u])?0:Sp.PdfFontStyle[""+u],e.caption.font[""+r])e.caption.font=new Sp.PdfTrueTypeFont(p,c,s);else{var g=(0,o.isNullOrUndefined)(p)?Sp.PdfFontFamily.Helvetica:this.getFontFamily(p);e.caption.font=new Sp.PdfStandardFont(g,c,s)}}if(e.record&&e.record.font){var f=e.record.font[""+t],m=e.record.font[""+i],y=e.record.font[""+n];if(s=(0,o.isNullOrUndefined)(Sp.PdfFontStyle[""+y])?0:Sp.PdfFontStyle[""+y],e.record.font[""+r])e.record.font=new Sp.PdfTrueTypeFont(f,m,s);else{var v=(0,o.isNullOrUndefined)(f)?Sp.PdfFontFamily.Helvetica:this.getFontFamily(f);e.record.font=new Sp.PdfStandardFont(v,m,s)}}},e.prototype.getHeaderThemeStyle=function(){var e=new Sp.PdfBorders;if((0,o.isNullOrUndefined)(this.gridTheme)||(0,o.isNullOrUndefined)(this.gridTheme.header))return e.all=new Sp.PdfPen(new Sp.PdfColor(234,234,234)),{border:e,font:new Sp.PdfStandardFont(Sp.PdfFontFamily.Helvetica,10.5),brush:new Sp.PdfSolidBrush(new Sp.PdfColor(102,102,102))};var t=(0,o.isNullOrUndefined)(this.gridTheme.header.fontName)?Sp.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),i=this.getFontStyle(this.gridTheme.header),n=(0,o.isNullOrUndefined)(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,r=new Sp.PdfColor;if(!(0,o.isNullOrUndefined)(this.gridTheme.header.fontColor)){var s=this.hexToRgb(this.gridTheme.header.fontColor);r=new Sp.PdfColor(s.r,s.g,s.b)}var a=new Sp.PdfStandardFont(t,n,i);return(0,o.isNullOrUndefined)(this.gridTheme.header.font)||(a=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:a,brush:new Sp.PdfSolidBrush(r)}},e.prototype.processGroupedRecords=function(e,t,i,n,r,s,a,l,h,d,p,c,u){for(var g=this,f=s,m=function(s){var m=e.rows.addRow(),v=n.getColumnByField(s.field),S={value:s.key,column:v,style:void 0,isForeignKey:v.isForeignColumn()},C={captionText:n.getColumnByField(s.field).headerText+": "+(v.enableGroupByFormat?s.key:y.exportValueFormatter.formatCellValue(S))+" - "+s.count+(t.count>1?" items":" item"),type:"PDF",data:s,style:void 0};y.parent.trigger(ke,C,function(y){var v;m.cells.getCell(f).value=y.captionText,m.cells.getCell(f).style.stringFormat=new Sp.PdfStringFormat(Sp.PdfTextAlignment.Left),m.style.setBorder(r),m.style.setFont(a),m.style.setTextBrush(l),m.style.setBackgroundBrush(h),(0,o.isNullOrUndefined)(y.style)||g.processCellStyle(m.cells.getCell(f),y);var S=new Ws(n);if(v=(0,o.isNullOrUndefined)(s.items.records)?S.generateRows(s.items,s):S.generateRows(s.items.records,s),(0,o.isNullOrUndefined)(v)||0!==v.length||(m.cells.getCell(f+1).columnSpan=e.columns.count-(f+1)),!(0,o.isNullOrUndefined)(t.childLevels)&&t.childLevels>0){g.processAggregates(v,e,r,a,l,h,!0,m,f,null,null,n),g.processGroupedRecords(e,s.items,i,n,r,f+1,a,l,h,d,p,c,u),u=g.rowIndex,v=new Ks(n).generateRows(s.items.records,s),g.processAggregates(v,e,r,a,l,h,!1)}else{g.processAggregates(v,e,r,a,l,h,!0,m,f,null,null,n),u=g.processRecord(r,i,n,s.items,e,f+1,p,c,u),v=new Ks(n).generateRows(s.items,s);g.processAggregates(v,e,r,a,l,h,!1,null,null,!0,null,n)}})},y=this,v=0,S=t;v<S.length;v++){m(S[v])}},e.prototype.processGridHeaders=function(e,i,n,r,s,a,l,h,d,p){for(var c=this,u=r.length+e,g=ql(p),f=p,m=0,y=[],v=0;v<n.length;v++)y[parseInt(v.toString(),10)]=0;h.groupSettings.columns.length&&(m=h.groupSettings.columns.length-1,u-=1),i.columns.add(u),i.style.cellPadding=new Sp.PdfPaddings(5.76,5.76,.5,.5),i.headers.add(n.length);var S=function(e,r,d,p,u){var g=i.headers.getHeader(e),f=g.cells.getCell(r),m=n[parseInt(e.toString(),10)].cells[h.groupSettings.columns.length?r:y[parseInt(e.toString(),10)]];y[parseInt(e.toString(),10)]=y[parseInt(e.toString(),10)]+1,(0,o.isNullOrUndefined)(d.headerTextAlign)||(f.style.stringFormat=c.getHorizontalAlignment(d.headerTextAlign)),p>0&&(f.rowSpan=p,f.style.stringFormat=c.getVerticalAlignment("Bottom",f.style.stringFormat,d.textAlign)),u>0&&(f.columnSpan=u),g.style.setBorder(s),g.style.setFont(a),g.style.setTextBrush(l),f.value=d.headerText,(0,o.isNullOrUndefined)(m)||m.cellType!==t.HeaderIndent&&m.cellType!==t.DetailHeader||(f.value="",f.width=20);var v={cell:f,gridCell:m,style:f.style};c.parent.trigger(li,v);var S=v,C=v.style.borders,w=v.style.font,b=v.style.textBrush;(0,o.isNullOrUndefined)(C)||g.style.setBorder(C),(0,o.isNullOrUndefined)(w)||g.style.setFont(w),(0,o.isNullOrUndefined)(b)||g.style.setTextBrush(b),(0,o.isNullOrUndefined)(S.style.verticalAlignment)||(f.style.stringFormat=c.getVerticalAlignment(S.style.verticalAlignment,f.style.stringFormat)),(0,o.isNullOrUndefined)(S.image)||(f.value=new Sp.PdfBitmap(S.image.base64)),(0,o.isNullOrUndefined)(S.hyperLink)||(f.value=c.setHyperLink(S))},C=function(e,t,i,n,r,s){for(var o=0,a=0;a<e.length;a++)if(s&&(n=o=o+i+(0===a?0:-1),i=0),s||e[parseInt(a.toString(),10)].visible||(n-=1),e[parseInt(a.toString(),10)].columns&&e[parseInt(a.toString(),10)].columns.length){var l=C(e[parseInt(a.toString(),10)].columns,t-1,0,a+n,r+1,!1);l>0&&S(r,a+n+m,e[parseInt(a.toString(),10)],0,l),i+=l,n=n+l-1}else(e[parseInt(a.toString(),10)].visible||c.hideColumnInclude)&&(i++,S(r,a+n+m,e[parseInt(a.toString(),10)],t,0));return i};return C(f,g,0,0,0,!0),i.columns.count>=6&&d&&(i.style.allowHorizontalOverflow=!0),i},e.prototype.processExportProperties=function(e,t){if((0,o.isNullOrUndefined)(e))this.currentViewData=!1,this.customDataSource=!1;else{(0,o.isNullOrUndefined)(e.theme)||(this.gridTheme=e.theme);var i=this.pdfPageSettings.size;if(this.drawHeader(e),!(0,o.isNullOrUndefined)(e.footer)){var n=e.footer,r=new Sp.PointF(0,i.width-80-.75*n.fromBottom),s=new Sp.SizeF(i.width-80,.75*n.height),a=new Sp.RectangleF(r,s);this.pdfDocument.template.bottom=this.drawPageTemplate(new Sp.PdfPageTemplateElement(a),n)}(0,o.isNullOrUndefined)(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),(0,o.isNullOrUndefined)(e.dataSource)?(0,o.isNullOrUndefined)(e.exportType)?(this.currentViewData=!1,this.customDataSource=!1):"CurrentPage"===e.exportType?(t=this.parent.groupSettings&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?t:this.parent.currentViewData,this.currentViewData=!0,this.customDataSource=!1):(this.currentViewData=!1,this.customDataSource=!1):(this.customDataSource=!0,this.currentViewData=!1)}return t},e.prototype.drawHeader=function(e){var t=this,i=this.pdfPageSettings.size;if(!(0,o.isNullOrUndefined)(e)&&!(0,o.isNullOrUndefined)(e.header)){var n=e.header,r=new Sp.PointF(0,n.fromTop),s=new Sp.SizeF(i.width-80,.75*n.height),a=new Sp.RectangleF(r,s);if(this.headerOnPages.length){var l=this.drawPageTemplate(new Sp.PdfPageTemplateElement(a),n);this.headerOnPages.filter(function(e){e-1>=0&&e-1<=t.pdfDocument.pages.count-1&&t.pdfDocument.pages.getPageByIndex(e-1).graphics.drawPdfTemplate(l.template,new Sp.PointF(0,0))})}else this.pdfDocument.template.top=this.drawPageTemplate(new Sp.PdfPageTemplateElement(a),n)}},e.prototype.drawPageTemplate=function(e,t){for(var i=0,n=t.contents;i<n.length;i++){var r=n[i];switch(this.processContentValidation(r),r.type){case"Text":if(""===r.value||void 0===r.value||null===r.value||"string"!=typeof r.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,r);break;case"PageNumber":this.drawPageNumber(e,r);break;case"Image":if(void 0===r.src||null===r.src||""===r.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,r);break;case"Line":this.drawLine(e,r);break;default:throw new Error("Please set valid content type...")}}return e},e.prototype.processContentValidation=function(e){if(void 0===e.type||null===e.type)throw new Error("please set valid content type...");if("Line"===e.type){if(void 0===e.points||null===e.points)throw new Error("please enter valid points in "+e.type+" content...");if(void 0===e.points.x1||null===e.points.x1||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(void 0===e.points.y1||null===e.points.y1||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(void 0===e.points.x2||null===e.points.x2||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(void 0===e.points.y2||null===e.points.y2||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(void 0===e.position||null===e.position)throw new Error("please enter valid position in "+e.type+" content...");if(void 0===e.position.x||null===e.position.x||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(void 0===e.position.y||null===e.position.y||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},e.prototype.drawText=function(e,t){var i=this.getFont(t),n=this.getBrushFromContent(t),r=null;if(!(0,o.isNullOrUndefined)(t.style.textPenColor)){var s=this.hexToRgb(t.style.textPenColor);r=new Sp.PdfPen(new Sp.PdfColor(s.r,s.g,s.b))}null==n&&null==r&&(n=new Sp.PdfSolidBrush(new Sp.PdfColor(0,0,0)));var a=t.value.toString(),l=.75*t.position.x,h=.75*t.position.y,d=new Sp.PdfStringFormat;(0,o.isNullOrUndefined)(t.style.stringFormat)||(d.alignment=t.style.stringFormat.alignment);var p=this.setContentFormat(t,d);null===p||(0,o.isNullOrUndefined)(p.format)||(0,o.isNullOrUndefined)(p.size)?e.graphics.drawString(a,i,r,n,l,h,d):e.graphics.drawString(a,i,r,n,l,h,p.size.width,p.size.height,p.format)},e.prototype.drawPageNumber=function(e,t){var i=this.getFont(t),n=null;if((0,o.isNullOrUndefined)(t.style.textBrushColor))n=new Sp.PdfSolidBrush(new Sp.PdfColor(0,0,0));else{var r=this.hexToRgb(t.style.textBrushColor);n=new Sp.PdfSolidBrush(new Sp.PdfColor(r.r,r.g,r.b))}var s,a,l=new Sp.PdfPageNumberField(i,n);if(l.numberStyle=this.getPageNumberStyle(t.pageNumberType),(0,o.isNullOrUndefined)(t.format))a="{0}",s=new Sp.PdfCompositeField(i,n,a,l);else{var h="$total",d="$current";if(-1!==t.format.indexOf(h)&&-1!==t.format.indexOf(d))(p=new Sp.PdfPageCountField(i)).numberStyle=this.getPageNumberStyle(t.pageNumberType),a=t.format.indexOf(h)>t.format.indexOf(d)?(a=t.format.replace(d,"0")).replace(h,"1"):(a=t.format.replace(d,"1")).replace(h,"0"),s=new Sp.PdfCompositeField(i,n,a,l,p);else if(-1!==t.format.indexOf(d)&&-1===t.format.indexOf(h))a=t.format.replace(d,"0"),s=new Sp.PdfCompositeField(i,n,a,l);else{var p=new Sp.PdfPageCountField(i);a=t.format.replace(h,"0"),s=new Sp.PdfCompositeField(i,n,a,p)}}var c=.75*t.position.x,u=.75*t.position.y,g=this.setContentFormat(t,s.stringFormat);null===g||(0,o.isNullOrUndefined)(g.format)||(0,o.isNullOrUndefined)(g.size)||(s.stringFormat=g.format,s.bounds=new Sp.RectangleF(c,u,g.size.width,g.size.height)),s.draw(e.graphics,c,u)},e.prototype.drawImage=function(e,t){var i=.75*t.position.x,n=.75*t.position.y,r=(0,o.isNullOrUndefined)(t.size)?void 0:.75*t.size.width,s=(0,o.isNullOrUndefined)(t.size)?void 0:.75*t.size.height,a=new Sp.PdfBitmap(t.src);(0,o.isNullOrUndefined)(r)?e.graphics.drawImage(a,i,n):e.graphics.drawImage(a,i,n,r,s)},e.prototype.drawLine=function(e,t){var i=.75*t.points.x1,n=.75*t.points.y1,r=.75*t.points.x2,s=.75*t.points.y2,a=this.getPenFromContent(t);(0,o.isNullOrUndefined)(t.style)||null===t.style||((0,o.isNullOrUndefined)(t.style.penSize)||null===t.style.penSize||"number"!=typeof t.style.penSize||(a.width=.75*t.style.penSize),a.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(a,i,n,r,s)},e.prototype.processAggregates=function(e,i,n,r,s,a,l,h,d,p,c,u){for(var g=0,f=e;g<f.length;g++){var m=f[g],y=-1,v=0,S=!0,C=[],w=c?0:1,b=void 0;(0,o.isNullOrUndefined)(h)&&((b=i.rows.addRow()).style.setBorder(n),b.style.setFont(r),b.style.setTextBrush(s),b.style.setBackgroundBrush(a));for(var I=this.parent.allowRowDragAndDrop&&(0,o.isNullOrUndefined)(this.parent.rowDropSettings.targetID),x=0;x<i.columns.count+w;x++){var R=m.cells[parseInt(v.toString(),10)];if(R.cellType!==t.DetailFooterIntent)if(I&&R.cellType===t.Indent)I=!1,x--,v++;else{if(!this.hideColumnInclude){for(;void 0===R.visible;)R.cellType!==t.DetailFooterIntent&&((0,o.isNullOrUndefined)(h)||(0,o.isNullOrUndefined)(h.cells.getCell(x).value)?C.push(""):(C.push(h.cells.getCell(x).value),S=!1,l||(x+=1)),x+=1,v+=1,R=m.cells[parseInt(v.toString(),10)]);for(;!(0,o.isNullOrUndefined)(R.visible)&&!R.visible;)v+=1,R=m.cells[parseInt(v.toString(),10)]}if(R.isDataCell){var D={},T=!(0,o.isNullOrUndefined)(R.column.footerTemplate),E=!(0,o.isNullOrUndefined)(R.column.groupFooterTemplate),O=!(0,o.isNullOrUndefined)(R.column.groupCaptionTemplate);if(T||O||E){D=(M=this.getTemplateFunction(D,x,y,R)).templateFunction,y=M.leastCaptionSummaryIndex;var k=void 0,A=m.data[R.column.field?R.column.field:R.column.columnName];(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof R.column.footerTemplate&&"string"!=typeof R.column.groupFooterTemplate&&"string"!=typeof R.column.groupCaptionTemplate?(k=A[R.column.type],k=(0,o.isNullOrUndefined)(k)?"":k):(k=D[(0,o.getEnumValue)(t,R.cellType)](A,this.parent),k=this.parent.isVue3&&!(0,o.isNullOrUndefined)(k[1])?k[1].textContent:(0,o.isNullOrUndefined)(k[0])?"":k[0].textContent),S=!1;var F={row:m,type:T?"Footer":E?"GroupFooter":"GroupCaption",style:(0,o.isNullOrUndefined)(h)?b.cells:h.cells,cell:R,value:k};this.parent.trigger(Ln,F),C.push(F.value)}else{var M=this.getSummaryWithoutTemplate(m.data[R.column.field]);(0,o.isNullOrUndefined)(M)||C.push(M)}}else C.push("");S&&""!==C[parseInt(x.toString(),10)]&&!(0,o.isNullOrUndefined)(C[parseInt(x.toString(),10)])&&null!==C[parseInt(x.toString(),10)]&&(S=!1),v+=1}else x--,v++}if(!c)if(l)for(x=u.groupSettings.columns.length;x<C.length-1;x++)C[parseInt(x.toString(),10)]=C[x+1],C[x+1]=C[x+2]?C[x+2]:"";else C.splice(0,1);if(!S)if(l)for(x=0;x<i.columns.count;x++)h.cells.getCell(x).value=C[parseInt(x.toString(),10)].toString(),x===d&&-1!==y&&1!==y?h.cells.getCell(x).columnSpan=y-1-d:x===d&&-1===y&&(h.cells.getCell(x).columnSpan=i.columns.count-d);else for(var x=0;x<i.columns.count;x++)b.cells.getCell(x).value=C[parseInt(x.toString(),10)].toString()}},e.prototype.getTemplateFunction=function(e,i,n,r){return(0,o.isNullOrUndefined)(r.column.footerTemplate)||r.cellType!==t.Summary?(0,o.isNullOrUndefined)(r.column.groupCaptionTemplate)?e[(0,o.getEnumValue)(t,t.GroupSummary)]=(0,o.compile)(r.column.groupFooterTemplate):(-1===n&&(n=i),e[(0,o.getEnumValue)(t,t.CaptionSummary)]=(0,o.compile)(r.column.groupCaptionTemplate)):e[(0,o.getEnumValue)(t,t.Summary)]=(0,o.compile)(r.column.footerTemplate),{templateFunction:e,leastCaptionSummaryIndex:n}},e.prototype.getSummaryWithoutTemplate=function(e){return(0,o.isNullOrUndefined)(e.Sum)?(0,o.isNullOrUndefined)(e.Average)?(0,o.isNullOrUndefined)(e.Max)?(0,o.isNullOrUndefined)(e.Min)?(0,o.isNullOrUndefined)(e.Count)?(0,o.isNullOrUndefined)(e.TrueCount)?(0,o.isNullOrUndefined)(e.FalseCount)?(0,o.isNullOrUndefined)(e.Custom)?void 0:e.Custom:e.FalseCount:e.TrueCount:e.Count:e.Min:e.Max:e.Average:e.Sum},e.prototype.setColumnProperties=function(e,t,i,n,r){for(var s=n.groupSettings.columns.length?n.groupSettings.columns.length-1:0,a=0;a<s;a++)t.columns.getColumn(a).width=20;for(a=0;a<e.length;a++)(0,o.isNullOrUndefined)(e[parseInt(a.toString(),10)].textAlign)||(t.columns.getColumn(a+s).format=this.getHorizontalAlignment(e[parseInt(a.toString(),10)].textAlign)),t.style.allowHorizontalOverflow&&!(0,o.isNullOrUndefined)(e[parseInt(a.toString(),10)].width)&&r&&(t.columns.getColumn(a+s).width="number"==typeof e[parseInt(a.toString(),10)].width?.75*e[parseInt(a.toString(),10)].width:.75*i.getConvertedWidth(e[parseInt(a.toString(),10)].width))},e.prototype.setRecordThemeStyle=function(e,t){if((0,o.isNullOrUndefined)(this.gridTheme)||(0,o.isNullOrUndefined)(this.gridTheme.record))e.style.setTextBrush(new Sp.PdfSolidBrush(new Sp.PdfColor(0,0,0)));else{var i=(0,o.isNullOrUndefined)(this.gridTheme.record.fontName)?Sp.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=(0,o.isNullOrUndefined)(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,r=this.getFontStyle(this.gridTheme.record),s=new Sp.PdfStandardFont(i,n,r);(0,o.isNullOrUndefined)(this.gridTheme.record.font)||(s=this.gridTheme.record.font),e.style.setFont(s);var a=new Sp.PdfColor;if(!(0,o.isNullOrUndefined)(this.gridTheme.record.fontColor)){var l=this.hexToRgb(this.gridTheme.record.fontColor);a=new Sp.PdfColor(l.r,l.g,l.b)}e.style.setTextBrush(new Sp.PdfSolidBrush(a))}var h=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):t;return e.style.setBorder(h),e},e.prototype.processRecord=function(e,i,n,r,s,a,l,h,d){for(var p=0,c=h.getGridRowModel(i,r,n,d);p<c.length;p++){var u=c[p];d++,this.rowIndex=d;for(var g=this.setRecordThemeStyle(s.rows.addRow(),e),f=u.cells.length,m=0;m<f;m++){var y=u.cells[parseInt(m.toString(),10)];if(y.cellType===t.Data){var v=y.column,S=v.field,C=(0,o.isNullOrUndefined)(S)?"":v.valueAccessor(S,u.data,v),w=(0,o.isNullOrUndefined)(C)?"":C,b=void 0;if(v.isForeignColumn&&v.isForeignColumn()&&(b=h.getFData(w,v),w=(0,o.getValue)(v.foreignKeyValue,b)),(F={data:u.data,value:w,column:v,style:void 0,colSpan:1,cell:x=g.cells.getCell(m)}).value="boolean"===F.column.type&&"string"==typeof F.value?F.value:this.exportValueFormatter.formatCellValue(F),this.parent.trigger(ai,F),(0,o.isNullOrUndefined)(F.image)||(F.value=new Sp.PdfBitmap(F.image.base64),F.value.height=F.image.height||F.value.height,F.value.width=F.image.width||F.value.width),x.value=F.value,(0,o.isNullOrUndefined)(F.hyperLink)||(x.value=this.setHyperLink(F)),(0,o.isNullOrUndefined)(F.style)||this.processCellStyle(x,F),F.colSpan>1){m+1+F.colSpan>g.cells.count&&(F.colSpan=g.cells.count-(m+1)),x.columnSpan=F.colSpan;for(var I=1;I<x.columnSpan;I++){g.cells.getCell(m+I).value=""}m+=F.colSpan-1}}}if(u.isExpand){var x,R=this.setRecordThemeStyle(s.rows.addRow(),e),D=this.parent.childGrid||this.parent.detailTemplate?0:a;if((x=R.cells.getCell(D)).columnSpan=R.cells.count-D,x.style.cellPadding=new Sp.PdfPaddings(10,10,10,10),this.parent.childGrid){n.isPrinting=!0;var T=!(0,o.isNullOrUndefined)(l)&&l.exportType?l.exportType:"AllPages",E=this.helper.createChildGrid(n,u,T,this.gridPool),O=E.childGrid,k=E.element;O.actionFailure=h.failureHandler(this.gridPool,O,this.globalResolve);var A=(0,o.extend)(l,{columns:null,dataSource:null,query:null}),F={childGrid:O,row:u,cell:x,exportProperties:A};this.parent.trigger(ni,F),O.beforeDataBound=this.childGridCell(x,O,A),O.appendTo(k)}else if(this.parent.detailTemplate){F={parentRow:u,row:R,value:{},action:"pdfexport",gridInstance:n};this.parent.trigger(ri,F),x.value=this.processDetailTemplate(F)}}this.parent.notify(qi,{type:"pdf",rowObj:u})}return d},e.prototype.processDetailTemplate=function(e){var t=this;if(e.value.columnHeader||e.value.rows){var i=new Sp.PdfGrid,n=this.getHeaderThemeStyle(),r=n.border,s=n.font,a=n.brush,l=function(e,i,n){n&&(i.style.setBorder(r),i.style.setFont(s),i.style.setTextBrush(a));for(var l=0;l<e.cells.length;l++){var h=e.cells[parseInt(l.toString(),10)],d=i.cells.getCell(h.index?h.index:l);if(h.rowSpan>0&&(d.rowSpan=h.rowSpan),h.colSpan>0&&(d.columnSpan=h.colSpan),d.value=h.value,(0,o.isNullOrUndefined)(h.image)||(d.value=new Sp.PdfBitmap(h.image.base64),d.value.height=h.image.height,d.value.width=h.image.width),(0,o.isNullOrUndefined)(h.hyperLink)||(d.value=t.setHyperLink(h)),!(0,o.isNullOrUndefined)(h.style)){var p={style:{backgroundColor:h.style.backColor,textAlignment:h.style.pdfTextAlignment,verticalAlignment:h.style.pdfVerticalAlignment,textBrushColor:h.style.fontColor,textPenColor:h.style.pdfTextPenColor,fontFamily:h.style.pdfFontFamily,fontSize:h.style.fontSize,bold:h.style.bold,italic:h.style.italic,underline:h.style.underline,strikeout:h.style.strikeThrough,border:h.style.pdfBorder,paragraphIndent:h.style.pdfParagraphIndent,cellPadding:h.style.pdfCellPadding}};t.processCellStyle(d,p)}}};if(e.value.columnCount?i.columns.add(e.value.columnCount):e.value.columnHeader&&e.value.columnHeader.length?i.columns.add(e.value.columnHeader[0].cells.length):e.value.rows&&e.value.rows.length&&i.columns.add(e.value.rows[0].cells.length),e.value.columnHeader){i.headers.add(e.value.columnHeader.length);for(var h=0;h<e.value.columnHeader.length;h++){var d=i.headers.getHeader(parseInt(h.toString(),10));l(e.value.columnHeader[parseInt(h.toString(),10)],d,!0)}}if(e.value.rows)for(var p=0,c=e.value.rows;p<c.length;p++){l(c[p],this.setRecordThemeStyle(i.rows.addRow(),r),!1)}return i}return e.value.image?new Sp.PdfBitmap(e.value.image.base64):e.value.text?e.value.text:e.value.hyperLink?this.setHyperLink(e.value):""},e.prototype.setHyperLink=function(e){var t=new Sp.PdfTextWebLink;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new Sp.PdfStandardFont(Sp.PdfFontFamily.Helvetica,9.75),t.brush=new Sp.PdfSolidBrush(new Sp.PdfColor(51,102,187)),t},e.prototype.childGridCell=function(e,t,i){var n=this;return function(r){return t.beforeDataBound=null,r.cancel=!0,e.value=n.processGridExport(t,r,i),t.destroy(),(0,o.detach)(t.element),n.gridPool[t.id]=!0,n.helper.checkAndExport(n.gridPool,n.globalResolve),e}},e.prototype.processCellStyle=function(e,t){if(!(0,o.isNullOrUndefined)(t.style.backgroundColor)){var i=this.hexToRgb(t.style.backgroundColor);e.style.backgroundBrush=new Sp.PdfSolidBrush(new Sp.PdfColor(i.r,i.g,i.b))}if((0,o.isNullOrUndefined)(t.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(t.style.textAlignment)),(0,o.isNullOrUndefined)(t.style.cellPadding)||(e.style.cellPadding=t.style.cellPadding),(0,o.isNullOrUndefined)(t.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(t.style.verticalAlignment,e.style.stringFormat)),!(0,o.isNullOrUndefined)(t.style.textBrushColor)){var n=this.hexToRgb(t.style.textBrushColor);e.style.textBrush=new Sp.PdfSolidBrush(new Sp.PdfColor(n.r,n.g,n.b))}if(!(0,o.isNullOrUndefined)(t.style.textPenColor)){var r=this.hexToRgb(t.style.textPenColor);e.style.textPen=new Sp.PdfPen(new Sp.PdfColor(r.r,r.g,r.b))}if((0,o.isNullOrUndefined)(t.style.fontFamily)&&(0,o.isNullOrUndefined)(t.style.fontSize)&&(0,o.isNullOrUndefined)(t.style.bold)&&(0,o.isNullOrUndefined)(t.style.italic)&&(0,o.isNullOrUndefined)(t.style.underline)&&(0,o.isNullOrUndefined)(t.style.strikeout)||(e.style.font=this.getFont(t)),!(0,o.isNullOrUndefined)(t.style.border)){var s=new Sp.PdfBorders,a=t.style.border.width,l=(0,o.isNullOrUndefined)(a)||"number"!=typeof a?void 0:.75*a,h=new Sp.PdfColor(196,196,196);if(!(0,o.isNullOrUndefined)(t.style.border.color)){var d=this.hexToRgb(t.style.border.color);h=new Sp.PdfColor(d.r,d.g,d.b)}var p=new Sp.PdfPen(h,l);(0,o.isNullOrUndefined)(t.style.border.dashStyle)||(p.dashStyle=this.getDashStyle(t.style.border.dashStyle)),s.all=p,e.style.borders=s}(0,o.isNullOrUndefined)(t.style.paragraphIndent)||(e.style.stringFormat=new Sp.PdfStringFormat,e.style.stringFormat.paragraphIndent=t.style.paragraphIndent)},e.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new Sp.PdfStringFormat),e){case"Right":t.alignment=Sp.PdfTextAlignment.Right;break;case"Center":t.alignment=Sp.PdfTextAlignment.Center;break;case"Justify":t.alignment=Sp.PdfTextAlignment.Justify;break;case"Left":t.alignment=Sp.PdfTextAlignment.Left}return t},e.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new Sp.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=Sp.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=Sp.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=Sp.PdfVerticalAlignment.Top}return t},e.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},e.prototype.getFont=function(e){if(e.font)return e.font;var t=(0,o.isNullOrUndefined)(e.style.fontSize)?9.75:.75*e.style.fontSize,i=(0,o.isNullOrUndefined)(e.style.fontFamily)?Sp.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=Sp.PdfFontStyle.Regular;return!(0,o.isNullOrUndefined)(e.style.bold)&&e.style.bold&&(n|=Sp.PdfFontStyle.Bold),!(0,o.isNullOrUndefined)(e.style.italic)&&e.style.italic&&(n|=Sp.PdfFontStyle.Italic),!(0,o.isNullOrUndefined)(e.style.underline)&&e.style.underline&&(n|=Sp.PdfFontStyle.Underline),!(0,o.isNullOrUndefined)(e.style.strikeout)&&e.style.strikeout&&(n|=Sp.PdfFontStyle.Strikeout),new Sp.PdfStandardFont(i,t,n)},e.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},e.prototype.setContentFormat=function(e,t){if(!(0,o.isNullOrUndefined)(e.size)){var i=.75*e.size.width,n=.75*e.size.height;if(t=new Sp.PdfStringFormat(Sp.PdfTextAlignment.Left,Sp.PdfVerticalAlignment.Middle),!(0,o.isNullOrUndefined)(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=Sp.PdfTextAlignment.Right;break;case"Center":t.alignment=Sp.PdfTextAlignment.Center;break;case"Justify":t.alignment=Sp.PdfTextAlignment.Justify;break;default:t.alignment=Sp.PdfTextAlignment.Left}return(0,o.isNullOrUndefined)(e.style.vAlign)||(t=this.getVerticalAlignment(e.style.vAlign,t)),{format:t,size:new Sp.SizeF(i,n)}}return null},e.prototype.getPageSize=function(e){switch(e){case"Letter":return new Sp.SizeF(612,792);case"Note":return new Sp.SizeF(540,720);case"Legal":return new Sp.SizeF(612,1008);case"A0":return new Sp.SizeF(2380,3368);case"A1":return new Sp.SizeF(1684,2380);case"A2":return new Sp.SizeF(1190,1684);case"A3":return new Sp.SizeF(842,1190);case"A5":return new Sp.SizeF(421,595);case"A6":return new Sp.SizeF(297,421);case"A7":return new Sp.SizeF(210,297);case"A8":return new Sp.SizeF(148,210);case"A9":return new Sp.SizeF(105,148);case"B0":return new Sp.SizeF(2836,4008);case"B1":return new Sp.SizeF(2004,2836);case"B2":return new Sp.SizeF(1418,2004);case"B3":return new Sp.SizeF(1002,1418);case"B4":return new Sp.SizeF(709,1002);case"B5":return new Sp.SizeF(501,709);case"Archa":return new Sp.SizeF(648,864);case"Archb":return new Sp.SizeF(864,1296);case"Archc":return new Sp.SizeF(1296,1728);case"Archd":return new Sp.SizeF(1728,2592);case"Arche":return new Sp.SizeF(2592,3456);case"Flsa":return new Sp.SizeF(612,936);case"HalfLetter":return new Sp.SizeF(396,612);case"Letter11x17":return new Sp.SizeF(792,1224);case"Ledger":return new Sp.SizeF(1224,792);default:return new Sp.SizeF(595,842)}},e.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},e.prototype.getPenFromContent=function(e){var t=new Sp.PdfPen(new Sp.PdfColor(0,0,0));if(!(0,o.isNullOrUndefined)(e.style)&&null!==e.style&&!(0,o.isNullOrUndefined)(e.style.penColor)){var i=this.hexToRgb(e.style.penColor);t=new Sp.PdfPen(new Sp.PdfColor(i.r,i.g,i.b))}return t},e.prototype.getBrushFromContent=function(e){var t=null;if(!(0,o.isNullOrUndefined)(e.style.textBrushColor)){var i=this.hexToRgb(e.style.textBrushColor);t=new Sp.PdfSolidBrush(new Sp.PdfColor(i.r,i.g,i.b))}return t},e.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},e.prototype.getFontStyle=function(e){var t=Sp.PdfFontStyle.Regular;return!(0,o.isNullOrUndefined)(e)&&e.bold&&(t|=Sp.PdfFontStyle.Bold),!(0,o.isNullOrUndefined)(e)&&e.italic&&(t|=Sp.PdfFontStyle.Italic),!(0,o.isNullOrUndefined)(e)&&e.underline&&(t|=Sp.PdfFontStyle.Underline),!(0,o.isNullOrUndefined)(e)&&e.strikeout&&(t|=Sp.PdfFontStyle.Strikeout),t},e.prototype.getBorderStyle=function(e){var t=new Sp.PdfBorders;if((0,o.isNullOrUndefined)(e))t.all=new Sp.PdfPen(new Sp.PdfColor(234,234,234));else{var i=e.width,n=(0,o.isNullOrUndefined)(i)||"number"!=typeof i?void 0:.75*i,r=new Sp.PdfColor(196,196,196);if(!(0,o.isNullOrUndefined)(e.color)){var s=this.hexToRgb(e.color);r=new Sp.PdfColor(s.r,s.g,s.b)}var a=new Sp.PdfPen(r,n);(0,o.isNullOrUndefined)(e.dashStyle)||(a.dashStyle=this.getDashStyle(e.dashStyle)),t.all=a}return t},e.prototype.destroy=function(){},e}(),wp=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bp=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.buttonElement=n.parent.createElement("button",{}),n.unbounDiv=n.parent.createElement("div",{className:"e-unboundcelldiv"}),n.childRefs=[],n.element=n.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{tabindex:"-1",role:"gridcell"}}),n.parent.on(Ct,n.destroyButtons,n),n.parent.on(Lr,n.destroyButtons,n),n}return wp(t,e),t.prototype.destroyButtons=function(e){for(var t=0;t<this.childRefs.length;t++)!this.childRefs[parseInt(t.toString(),10)]||this.childRefs[parseInt(t.toString(),10)].isDestroyed||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&_a(this.childRefs[parseInt(t.toString(),10)].element,"e-addedrow")||(this.childRefs[parseInt(t.toString(),10)].destroy(),this.childRefs[parseInt(t.toString(),10)].element&&(this.childRefs[parseInt(t.toString(),10)].element.innerHTML=""));if(this.childRefs=[],"refreshCommandColumn"===e.type){var i=this.parent.element.querySelectorAll(".e-gridcontent .e-unboundcell");if(i.length){for(t=0;t<i.length;t++)!i[parseInt(t.toString(),10)]||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&_a(i[parseInt(t.toString(),10)],"e-addedrow")||(i[parseInt(t.toString(),10)].querySelector(".e-unboundcelldiv")&&(i[parseInt(t.toString(),10)].querySelector(".e-unboundcelldiv").innerHTML=""),i[parseInt(t.toString(),10)].innerHTML="");i=null}}else this.parent.off(Ct,this.destroyButtons),this.parent.off(Lr,this.destroyButtons)},t.prototype.render=function(e,t,i,n){var r=this.element.cloneNode();if(r.appendChild(this.unbounDiv.cloneNode()),r.setAttribute("aria-label",this.localizer.getConstant("CommandColumnAria")+e.column.headerText),e.column.commandsTemplate)if(!this.parent.isReact||"string"==typeof e.column.commandsTemplate||e.column.commandsTemplate.prototype&&e.column.commandsTemplate.prototype.CSPTemplate)$a(r.firstElementChild,e.column.getColumnTemplate()(t,this.parent,"commandsTemplate",null,null,null,null,this.parent.root));else{var s=this.parent+"commandsTemplate";e.column.getColumnTemplate()(t,this.parent,"commandsTemplate",s,null,null,r.firstElementChild),this.parent.renderTemplates()}else for(var a=0,l=e.commands;a<l.length;a++){var h=l[a];r=this.renderButton(r,h,i["data-index"],h.uid)}return this.setAttributes(r,e,i),!this.parent.enableVirtualization&&this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow"))||n&&this.parent.enableVirtualization?((0,o.addClass)([].slice.call(r.getElementsByClassName("e-edit-delete")),"e-hide"),(0,o.removeClass)([].slice.call(r.getElementsByClassName("e-save-cancel")),"e-hide")):((0,o.addClass)([].slice.call(r.getElementsByClassName("e-save-cancel")),"e-hide"),(0,o.removeClass)([].slice.call(r.getElementsByClassName("e-edit-delete")),"e-hide")),this.parent.isFrozenGrid()&&yh(this.parent,e.column,r),r},t.prototype.renderButton=function(e,t,i,n){var r=this.buttonElement.cloneNode();(0,o.attributes)(r,{id:this.parent.element.id+(t.type||"")+"_"+i+"_"+n,type:"button",title:(0,o.isNullOrUndefined)(t.title)?t.buttonOption.content||this.localizer.getConstant(t.type)||t.type:t.title,"data-uid":n}),r.onclick=t.buttonOption.click,t.buttonOption.cssClass=this.parent.cssClass?t.buttonOption.cssClass+" "+this.parent.cssClass:t.buttonOption.cssClass;var s=new Js.Button(t.buttonOption,r);switch(this.childRefs.push(s),s.commandType=t.type,e.firstElementChild.appendChild(s.element),t.type){case"Edit":case"Delete":(0,o.addClass)([r],["e-edit-delete","e-"+t.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":(0,o.addClass)([r],["e-save-cancel","e-"+t.type.toLowerCase()+"button"])}return e},t}($s),Ip=function(){function e(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}return e.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(t.CommandColumn,new bp(this.parent,this.locator))},e.prototype.commandClickHandler=function(e){var t=this.parent,i=(0,o.closest)(e.target,"button");if(i&&(0,o.closest)(e.target,".e-unboundcell")){for(var n,r=i.ej2_instances[0],s=r.commandType,a=i.getAttribute("data-uid"),l=t.getRowObjectFromUID((0,o.closest)(i,"."+us).getAttribute("data-uid")),h=this.parent.columnModel,d=0;d<h.length;d++)if(h[parseInt(d.toString(),10)].commands)for(var p=h[parseInt(d.toString(),10)].commands,c=0;c<p.length;c++){var u="type";if(p[parseInt(c.toString(),10)].uid===a&&p[parseInt(c.toString(),10)][""+u]===s)n=p[parseInt(c.toString(),10)];else{var g=[].slice.call((0,o.closest)(i,".e-unboundcell").querySelectorAll("button")).findIndex(function(e){return e===i});g<p.length&&p[parseInt(g.toString(),10)][""+u]===s&&String(p[parseInt(c.toString(),10)].uid)===a&&(n=p[parseInt(g.toString(),10)])}}var f={cancel:!1,target:i,commandColumn:n,rowData:(0,o.isNullOrUndefined)(l)?void 0:l.data};this.parent.trigger(Oe,f,function(e){if(!r.disabled&&t.editModule&&!e.cancel)switch(s){case"Edit":t.editModule.endEdit(),t.editModule.startEdit((0,o.closest)(i,"tr"));break;case"Cancel":t.isFocusFirstCell=!0,t.editModule.closeEdit();break;case"Save":t.isFocusFirstCell=!0,t.editModule.endEdit();break;case"Delete":"Batch"!==t.editSettings.mode&&t.editModule.endEdit(),t.commandDelIndex=parseInt((0,o.closest)(i,"tr").getAttribute(Rs),10)-1,t.clearSelection(),t.selectRow(t.commandDelIndex,!1),t.isFocusFirstCell=!0,t.editModule.deleteRecord(),t.editSettings.showDeleteConfirmDialog&&!t.allowSelection||(t.commandDelIndex=void 0)}})}},e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(St,this.commandClickHandler),this.parent.off(vt,this.keyPressHandler),this.parent.off(Le,this.load),this.parent.off(Ct,this.destroy))},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(St,this.commandClickHandler,this),this.parent.on(vt,this.keyPressHandler,this),this.parent.on(Le,this.load,this),this.parent.on(Ct,this.destroy,this))},e.prototype.keyPressHandler=function(e){"enter"!==e.action&&"space"!==e.action||!(0,o.closest)(e.target,".e-unboundcelldiv")||(this.commandClickHandler(e),e.preventDefault())},e.prototype.load=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)if(e[parseInt(t.toString(),10)].commands)for(var i=e[parseInt(t.toString(),10)].commands,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=Za("gridcommand")},e}(),xp={header:"."+ns,content:"."+rs,edit:".e-inline-edit",batchEdit:".e-editedbatchcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup",autofit:"e-icon-autofit",autofitall:"e-icon-autofitall",chart:"e-grid-chart-icon",barChart:"e-grid-bar-chart-icon",bar:"e-grid-bar-icon",stackingBar:"e-grid-stacking-bar-icon",stackingBar100:"e-grid-stacking-bar-100-icon",pie:"e-grid-pie-icon",columnChart:"e-grid-column-chart-icon",column:"e-grid-column-icon",stackingColumn:"e-grid-stacking-column-icon",stackingColumn100:"e-grid-stacking-column-100-icon",lineChart:"e-grid-line-chart-icon",line:"e-grid-line-icon",stackingLine:"e-grid-stacking-line-icon",stackingLine100:"e-grid-stacking-line-100-icon",areaChart:"e-grid-area-chart-icon",area:"e-grid-area-icon",stackingArea:"e-grid-stacking-area-icon",stackingArea100:"e-grid-stacking-area-100-icon",scatter:"e-grid-scatter-icon",pin:"e-grid-icon-pin",unpin:"e-grid-icon-unpin"},Rp=function(){function e(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.barChartList=["Bar","StackingBar","StackingBar100"],this.pieChartList=["Pie"],this.columnChartList=["Column","StackingColumn","StackingColumn100"],this.lineChartList=["Line","StackingLine","StackingLine100"],this.areaChartList=["Area","StackingArea","StackingArea100"],this.scatterChartList=["Scatter"],this.chartList=this.barChartList.concat(this.pieChartList,this.columnChartList,this.lineChartList,this.areaChartList,this.scatterChartList),this.localeText=this.setLocaleKey(),this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Be,this.enableAfterRenderMenu,this),this.parent.on(Me,this.render,this),this.parent.on(Ct,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.render),this.parent.off(Be,this.enableAfterRenderMenu),this.parent.off(Ct,this.destroy),o.EventHandler.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},e.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close(),"Escape"===e.code&&(this.contextMenu.close(),this.parent.notify(on,{}))},e.prototype.render=function(){this.parent.element.classList.add("e-noselect"),this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_cmenu"}),o.EventHandler.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new Zh.ContextMenu({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),beforeClose:this.contextMenuBeforeClose.bind(this),cssClass:this.parent.cssClass?"e-grid-menu "+this.parent.cssClass:"e-grid-menu"}),this.contextMenu.isAngular=lh(this.parent),this.contextMenu.appendTo(this.element)},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),(0,o.remove)(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},e.prototype.getMenuItems=function(){for(var e,t,i=[],n=[],r=[],s=[],o=[],a=[],l=[],h=0,d=this.parent.contextMenuItems;h<d.length;h++){var p=d[h];"string"==typeof p&&-1!==this.getDefaultItems().indexOf(p)?-1!==this.barChartList.indexOf(p)?s.push(this.buildDefaultItems(p)):-1!==this.pieChartList.indexOf(p)?e=this.buildDefaultItems(p):-1!==this.columnChartList.indexOf(p)?o.push(this.buildDefaultItems(p)):-1!==this.lineChartList.indexOf(p)?a.push(this.buildDefaultItems(p)):-1!==this.areaChartList.indexOf(p)?l.push(this.buildDefaultItems(p)):-1!==this.scatterChartList.indexOf(p)?t=this.buildDefaultItems(p):-1!==p.toLocaleLowerCase().indexOf("export")?n.push(this.buildDefaultItems(p)):i.push(this.buildDefaultItems(p)):"string"!=typeof p&&i.push(p)}if(a.length>0){var c=this.buildDefaultItems("LineChart");c.items=a,r.push(c)}if(l.length>0){var u=this.buildDefaultItems("AreaChart");u.items=l,r.push(u)}if(o.length>0){var g=this.buildDefaultItems("ColumnChart");g.items=o,r.push(g)}if(s.length>0){var f=this.buildDefaultItems("BarChart");f.items=s,r.push(f)}if(t&&r.push(t),e&&r.push(e),r.length>0){var m=this.buildDefaultItems("Chart");m.items=r,i.push(m)}if(n.length>0){var y=this.buildDefaultItems("export");y.items=n,i.push(y)}return i},e.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},e.prototype.contextMenuOpen=function(){this.isOpen=!0},e.prototype.contextMenuItemClick=function(e){var t=this.getKeyFromId(e.item.id);switch(t){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute(xs),10)-1)&&this.parent.editModule.editCell(parseInt(this.row.getAttribute(Rs),10)-1,this.parent.getColumns()[parseInt(this.cell.getAttribute(xs),10)-1].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?(this.parent.isCheckBoxSelection||(this.parent.isFocusFirstCell=!0),this.parent.editModule.deleteRow(this.row)):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.endEdit());break;case"Cancel":this.parent.editModule&&(this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.closeEdit());break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1);break;case"Bar":case"StackingBar":case"StackingBar100":case"Pie":case"Column":case"StackingColumn":case"StackingColumn100":case"Line":case"StackingLine":case"StackingLine100":case"Area":case"StackingArea":case"StackingArea100":case"Scatter":e.records=this.parent.getSelectedRecords(),e.gridInstance=this.parent,e.chartType=t;break;case"PinRow":this.parent.pinRows([this.targetRowdata.rowData]);break;case"UnpinRow":this.parent.unpinRows([this.targetRowdata.rowData])}e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(di,e)},e.prototype.contextMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof Zh.ContextMenu&&this.updateItemStatus(),this.parent.notify(fr,{isOpen:!1})},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},e.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},e.prototype.contextMenuBeforeOpen=function(e){var t=(0,o.closest)(e.event.target,".e-grid");if(e.event&&t&&t!==this.parent.element)e.cancel=!0;else if(e.event&&((0,o.closest)(e.event.target,"."+xp.groupHeader)||(0,o.closest)(e.event.target,"."+xp.touchPop)||(0,o.closest)(e.event.target,".e-summarycell")||(0,o.closest)(e.event.target,".e-groupcaption")||(0,o.closest)(e.event.target,".e-filterbarcell"))||this.parent.editSettings.showAddNewRow&&(0,o.closest)(e.event.target,".e-addedrow")&&this.parent.element.querySelector(".e-editedrow"))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),_a(e.event.target,"e-grid")&&(this.targetRowdata=this.parent.getRowInfo(e.event.target)),(0,o.isNullOrUndefined)(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify(fr,{isOpen:!0}),this.selectRow(e.event,!this.targetRowdata.cell.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type));for(var i=[],n=[],r=0,s=e.items;r<s.length;r++){var a=s[r],l=this.getKeyFromId(a.id),h=this.defaultItems[""+l];if(-1!==this.getDefaultItems().indexOf(l))if(this.ensureDisabledStatus(l)&&this.disableItems.push(a.text),e.event&&(this.ensureTarget(e.event.target,xp.edit)||this.ensureTarget(e.event.target,xp.batchEdit)))"Save"!==l&&"Cancel"!==l&&this.hiddenItems.push(a.text);else{if(this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&((0,o.closest)(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges()[vs].length||this.parent.editModule.getBatchChanges()[Ss].length||this.parent.editModule.getBatchChanges()[Cs].length)&&("Save"===l||"Cancel"===l))continue;(0,o.isNullOrUndefined)(e.parentItem)&&e.event&&!(0,o.isNullOrUndefined)(h)&&!this.ensureTarget(e.event.target,h.target)&&this.hiddenItems.push(a.text)}else a.target&&e.event&&!this.ensureTarget(e.event.target,a.target)?a.separator?i.push(a.id):this.hiddenItems.push(a.text):this.ensureTarget(e.event.target,a.target)&&a.separator&&n.push(a.id);"PinRow"===l&&!(0,o.isNullOrUndefined)(this.targetRowdata.row)&&this.targetRowdata.row.classList.contains("e-grid-pin-row")?this.hiddenItems.push(a.text):"UnpinRow"!==l||(0,o.isNullOrUndefined)(this.targetRowdata.row)||this.targetRowdata.row.classList.contains("e-grid-pin-row")||this.hiddenItems.push(a.text)}n.length>0&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),i.length>0&&this.contextMenu.hideItems(i,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(ui,e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}Vl(this.parent.element,this.contextMenu.element.parentElement)},e.prototype.contextMenuBeforeClose=function(e){e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(gi,e)},e.prototype.ensureTarget=function(e,t){var i=e;return(i=!this.ensureFrozenHeader(e)||t!==xp.header&&t!==xp.content?t===xp.content||t===xp.header?_a((0,o.closest)(e,"."+cs),t.substr(1,t.length)):(0,o.closest)(e,t):(0,o.closest)(e,t===xp.header?"thead":Ds))&&_a(i,"e-grid")===this.parent.element},e.prototype.ensureFrozenHeader=function(e){return!(!this.parent.frozenRows&&!this.parent.pinnedTopRecords.length||!(0,o.closest)(e,xp.header))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(xd)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(Td)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.field)&&(t=!0);break;case"Ungroup":(!this.parent.allowGrouping||!this.parent.ensureModuleInjected(Td)||this.parent.ensureModuleInjected(Td)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(t=!0);break;case"Copy":(0===this.parent.getSelectedRowIndexes().length&&0===this.parent.getSelectedRowCellIndexes().length||0===this.parent.getCurrentViewRecords().length)&&(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(vp)||this.parent.allowPdfExport&&this.parent.ensureModuleInjected(Cp)||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(Cp)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(vp)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(td)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(td)&&this.parent.sortSettings.columns.length>0&&this.targetColumn)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(t=!0);break;case"FirstPage":case"PrevPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(hd)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(hd)&&1===this.parent.pageSettings.currentPage)&&(t=!0);break;case"LastPage":case"NextPage":(!this.parent.allowPaging||!this.parent.ensureModuleInjected(hd)||0===this.parent.getCurrentViewRecords().length||this.parent.ensureModuleInjected(hd)&&this.parent.pageSettings.currentPage===this.getLastPage())&&(t=!0);break;case"Chart":t=!this.parent.getSelectedRecords().length}return t},e.prototype.getContextMenu=function(){return this.element},e.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ns)||e.querySelector("."+rs))&&(this.contextMenu&&(this.contextMenu.select=null,this.contextMenu.beforeOpen=null,this.contextMenu.onOpen=null,this.contextMenu.onClose=null),this.removeEventListener(),this.contextMenu.destroy(),this.element.parentNode&&(0,o.remove)(this.element),this.parent.element.classList.remove("e-noselect"))},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},e.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},e.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":t={target:xp.header,iconCss:xp.autofitall};break;case"AutoFit":t={target:xp.header,iconCss:xp.autofit};break;case"Group":t={target:xp.header,iconCss:xp.group};break;case"Ungroup":t={target:xp.header,iconCss:xp.ungroup};break;case"Edit":t={target:xp.content,iconCss:xp.editIcon};break;case"Delete":t={target:xp.content,iconCss:xp.delete};break;case"Save":t={target:xp.edit,iconCss:xp.save};break;case"Cancel":t={target:xp.edit,iconCss:xp.cancel};break;case"Copy":t={target:xp.content,iconCss:xp.copy};break;case"export":t={target:xp.content};break;case"PdfExport":t={target:xp.content,iconCss:xp.pdf};break;case"ExcelExport":t={target:xp.content,iconCss:xp.excel};break;case"CsvExport":t={target:xp.content,iconCss:xp.csv};break;case"SortAscending":t={target:xp.header,iconCss:xp.ascending};break;case"SortDescending":t={target:xp.header,iconCss:xp.descending};break;case"FirstPage":t={target:xp.pager,iconCss:xp.fPage};break;case"PrevPage":t={target:xp.pager,iconCss:xp.pPage};break;case"LastPage":t={target:xp.pager,iconCss:xp.lPage};break;case"NextPage":t={target:xp.pager,iconCss:xp.nPage};break;case"Chart":t={target:xp.content,iconCss:xp.chart};break;case"BarChart":t={target:xp.content,iconCss:xp.barChart};break;case"Bar":t={target:xp.content,iconCss:xp.bar};break;case"StackingBar":t={target:xp.content,iconCss:xp.stackingBar};break;case"StackingBar100":t={target:xp.content,iconCss:xp.stackingBar100};break;case"Pie":t={target:xp.content,iconCss:xp.pie};break;case"ColumnChart":t={target:xp.content,iconCss:xp.columnChart};break;case"Column":t={target:xp.content,iconCss:xp.column};break;case"StackingColumn":t={target:xp.content,iconCss:xp.stackingColumn};break;case"StackingColumn100":t={target:xp.content,iconCss:xp.stackingColumn100};break;case"LineChart":t={target:xp.content,iconCss:xp.lineChart};break;case"Line":t={target:xp.content,iconCss:xp.line};break;case"StackingLine":t={target:xp.content,iconCss:xp.stackingLine};break;case"StackingLine100":t={target:xp.content,iconCss:xp.stackingLine100};break;case"AreaChart":t={target:xp.content,iconCss:xp.areaChart};break;case"Area":t={target:xp.content,iconCss:xp.area};break;case"StackingArea":t={target:xp.content,iconCss:xp.stackingArea};break;case"StackingArea100":t={target:xp.content,iconCss:xp.stackingArea100};break;case"Scatter":t={target:xp.content,iconCss:xp.scatter};break;case"PinRow":t={target:".e-rowcell",iconCss:xp.pin};break;case"UnpinRow":t={target:".e-rowcell",iconCss:xp.unpin}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[""+e]},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","Group","Ungroup","Edit","Delete","Save","Cancel","Copy","export","PdfExport","ExcelExport","CsvExport","SortAscending","SortDescending","FirstPage","PrevPage","LastPage","NextPage","Chart","BarChart","ColumnChart","LineChart","AreaChart","PinRow","UnpinRow"].concat(this.chartList)},e.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Copy:"Copy",Group:"Group",Ungroup:"Ungroup",Edit:"EditRecord",Delete:"DeleteRecord",Save:"Save",Cancel:"CancelButton",PdfExport:"Pdfexport",ExcelExport:"Excelexport",CsvExport:"Csvexport",export:"Export",SortAscending:"SortAscending",SortDescending:"SortDescending",FirstPage:"FirstPage",LastPage:"LastPage",PrevPage:"PreviousPage",NextPage:"NextPage",Chart:"Chart",BarChart:"BarChart",Bar:"Bar",StackingBar:"StackingBar",StackingBar100:"StackingBar100",Pie:"Pie",ColumnChart:"ColumnChart",Column:"Column",StackingColumn:"StackingColumn",StackingColumn100:"StackingColumn100",LineChart:"LineChart",Line:"Line",StackingLine:"StackingLine",StackingLine100:"StackingLine100",AreaChart:"AreaChart",Area:"Area",StackingArea:"StackingArea",StackingArea100:"StackingArea100",Scatter:"Scatter",PinRow:"PinRow",UnpinRow:"UnpinRow"}},e.prototype.getColumn=function(e){var t=(0,o.closest)(e.target,"th.e-headercell");if(t){var i=t.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid");return this.parent.getColumnByUid(i)}return this.parent.getRowInfo(e.target).column||null},e.prototype.selectRow=function(e,t){this.cell=e.target,this.row=(0,o.closest)(e.target,"tr.e-row")||this.row,this.row&&t&&!_a(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute(Rs),10)-1)},e}(),Dp=function(){function e(e,t){this.parent=e,this.locator=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"freeze"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Me,this.instantiateRenderer,this),this.parent.on(Ct,this.destroy,this))},e.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName())},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.instantiateRenderer),this.parent.off(Ct,this.destroy))},e.prototype.destroy=function(){this.removeEventListener()},e}(),Tp=function(){function e(e,t){this.defaultItems={},this.localeText=this.setLocaleKey(),this.disableItems=[],this.hiddenItems=[],this.isOpen=!1,this.GROUP="e-icon-group",this.UNGROUP="e-icon-ungroup",this.ASCENDING="e-icon-ascending",this.DESCENDING="e-icon-descending",this.ROOT="e-columnmenu",this.FILTER="e-icon-filter",this.POP="e-filter-popup",this.WRAP="e-col-menu",this.COL_POP="e-colmenu-popup",this.CHOOSER="_chooser_",this.AUTOFIT="e-icon-autofit",this.AUTOFITALL="e-icon-autofitall",this.COLUMNCHOOSER="e-icon-columnchooser",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener(),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}return e.prototype.wireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)o.EventHandler.add(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown,this)},e.prototype.unwireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)o.EventHandler.remove(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown)},e.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,r.isColMenu)},e.prototype.destroy=function(){var e=this.parent.element;(e.querySelector("."+rs)||e.querySelector("."+ns))&&e&&(this.columnMenu&&this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),!this.parent.enableAdaptiveUI&&this.element.parentNode&&(0,o.remove)(this.element))},e.prototype.columnMenuHandlerClick=function(e){if(e.target.classList.contains("e-columnmenu"))if(this.parent.enableAdaptiveUI){this.headerCell=this.getHeaderCell(e);var t=this.getColumn();this.responsiveDialogRenderer.isCustomDialog=!0,this.parent.notify(Ur,{action:4}),this.parent.notify(vi,{col:t,target:e.target,isClose:null,id:null}),this.responsiveDialogRenderer.showResponsiveDialog(null,t)}else this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.isOpen&&this.headerCell!==this.getHeaderCell(e)||document.querySelector(".e-grid-menu .e-menu-parent.e-ul")?(this.columnMenu.close(),this.openColumnMenu(e)):this.isOpen?this.columnMenu.close():this.openColumnMenu(e)},e.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},e.prototype.afterFilterColumnMenuClose=function(){this.columnMenu&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.columnMenu.close())},e.prototype.openColumnMenu=function(e){var t=this.parent.getContent().getClientRects()[0],i=this.parent.getHeaderContent(),n=i.getBoundingClientRect(),r={top:0,left:0};this.element.style.cssText="display:block;visibility:hidden";var s=this.element.getBoundingClientRect(),o=this.parent.element.getBoundingClientRect();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),this.parent.enableRtl?r=this.parent.enableStickyHeader?(0,y.calculatePosition)(this.headerCell,"left","bottom",!0):(0,y.calculatePosition)(this.headerCell,"left","bottom"):((r=this.parent.enableStickyHeader?(0,y.calculatePosition)(this.headerCell,"right","bottom",!0):(0,y.calculatePosition)(this.headerCell,"right","bottom")).left-=s.width,i.classList.contains("e-sticky")?(r.top=this.parent.element.offsetTop+n.top+n.height,n.top+n.height>t.top&&(r.top+=n.top+n.height-t.top)):this.parent.enableStickyHeader&&(r.top=this.parent.element.offsetTop+i.offsetTop+n.height),r.left+s.width+1>=o.right&&(r.left-=35)),this.columnMenu.open(r.top,r.left),e.preventDefault&&e.preventDefault(),Vl(this.parent.element,this.columnMenu.element.parentElement)},e.prototype.columnMenuHandlerDown=function(){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},e.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(this.ROOT))},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(je,this.wireEvents,this),this.parent.on(Be,this.enableAfterRenderMenu,this),this.parent.on(Le,this.render,this),this.isFilterItemAdded()&&this.parent.on(Si,this.filterPosition,this),this.parent.on(hr,this.setFullScreenDialog,this),this.parent.on(Ur,this.renderResponsiveChangeAction,this),this.parent.on(St,this.columnMenuHandlerClick,this),this.parent.on(Fr,this.afterFilterColumnMenuClose,this),this.parent.on(vt,this.keyPressHandler,this),this.parent.on(Ct,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(je,this.unwireEvents),this.parent.off(Be,this.enableAfterRenderMenu),this.parent.off(Le,this.render),this.isFilterItemAdded()&&this.parent.off(Si,this.filterPosition),this.parent.off(hr,this.setFullScreenDialog),this.parent.off(Ur,this.renderResponsiveChangeAction),this.parent.off(St,this.columnMenuHandlerClick),this.parent.on(Fr,this.afterFilterColumnMenuClose),this.parent.off(vt,this.keyPressHandler),this.parent.off(Ct,this.destroy))},e.prototype.keyPressHandler=function(e){var t=this.parent;if("altDownArrow"===e.action&&!this.parent.enableAdaptiveUI){var i=t.focusModule.currentInfo.element;if(i&&i.classList.contains("e-headercell")){var n=t.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));this.openColumnMenuByField(n.field)}}},e.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),(0,o.remove)(this.element)),this.parent.enableAdaptiveUI||this.render())},e.prototype.render=function(){this.parent.enableAdaptiveUI||(this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_columnmenu",className:"e-colmenu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ColumnMenuDialogARIA")),this.parent.element.appendChild(this.element),this.columnMenu=new Zh.ContextMenu({cssClass:this.parent.cssClass?"e-grid-menu e-grid-column-menu "+this.parent.cssClass:"e-grid-menu e-grid-column-menu",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,items:this.getItems(),select:this.columnMenuItemClick.bind(this),beforeOpen:this.columnMenuBeforeOpen.bind(this),onOpen:this.columnMenuOnOpen.bind(this),onClose:this.columnMenuOnClose.bind(this),beforeItemRender:this.beforeMenuItemRender.bind(this),beforeClose:this.columnMenuBeforeClose.bind(this)}),this.columnMenu.isAngular=lh(this.parent),this.element&&_a(this.element,"e-popup")&&this.element.classList.add(this.COL_POP),this.columnMenu.appendTo(this.element),this.wireFilterEvents())},e.prototype.wireFilterEvents=function(){!o.Browser.isDevice&&this.isFilterItemAdded()&&o.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},e.prototype.unwireFilterEvents=function(){o.Browser.isDevice||!this.isFilterItemAdded()||this.parent.enableAdaptiveUI||o.EventHandler.remove(this.element,"mouseover",this.appendFilter)},e.prototype.beforeMenuItemRender=function(e){var t;if(this.isChooserItem(e.item)){var i=this.getKeyFromId(e.item.id,this.CHOOSER),n=this.parent.columnModel.filter(function(e){return e.field===i}),r=(0,Js.createCheckBox)(this.parent.createElement,!1,{label:e.item.text,checked:n[0].visible});this.parent.enableRtl&&r.classList.add("e-rtl"),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(t=r.classList).add.apply(t,this.parent.cssClass.split(" ")):r.classList.add(this.parent.cssClass)),e.element.innerHTML="",e.element.appendChild(r)}else e.item.id&&"Filter"===this.getKeyFromId(e.item.id)&&(e.element.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),e.element.className+="e-filter-item e-menu-caret-icon")},e.prototype.columnMenuBeforeClose=function(e){if(e.column=this.targetColumn,this.parent.trigger(yi,e),e.event&&e.event.target instanceof Document&&"scroll"===e.event.type)this.parent.enableStickyHeader||(e.cancel=!0);else{var t=e.event?(0,o.closest)(e.event.target,".e-menu-item"):null;!(0,o.isNullOrUndefined)(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&t&&this.isChooserItem(t)?e.cancel=!e.event||"Escape"!==e.event.code:e.event&&((0,o.closest)(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&_a(e.event.currentTarget.activeElement,"e-filter-popup")||_a(e.event.target,"e-popup")&&_a(e.event.target,"e-colmenu-popup")||_a(e.event.target,"e-multiselect-flmenu")||_a(e.event.target,"e-popup-wrapper"))&&!o.Browser.isDevice||e.event&&e.event.target&&e.event.target.classList.contains("e-filter-item")&&"Enter"===e.event.key?e.cancel=!0:this.parent.isColumnMenuFilterClosing&&(this.parent.isColumnMenuFilterClosing=!1,e.cancel=!0)}},e.prototype.isChooserItem=function(e){return e.id&&e.id.indexOf("_colmenu_")>=0&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},e.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger(mi,e);for(var t=0,i=e.items;t<i.length;t++){var n=i[t],r=this.getKeyFromId(n.id),s=this.defaultItems[""+r];-1!==this.getDefaultItems().indexOf(r)&&this.ensureDisabledStatus(r)&&!s.hide&&this.disableItems.push(n.text),n.hide&&this.hiddenItems.push(n.text)}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},e.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight||this.parent.element.offsetHeight>window.innerHeight)&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto",this.parent.enableStickyHeader&&(e.element.style.position="fixed"))},e.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(Td)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)>=0||this.targetColumn&&!this.targetColumn.allowGrouping)&&(t=!0);break;case"AutoFitAll":case"AutoFit":t=!this.parent.ensureModuleInjected(xd);break;case"Ungroup":(!this.parent.ensureModuleInjected(Td)||this.parent.ensureModuleInjected(Td)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"SortDescending":case"SortAscending":if(this.parent.allowSorting&&this.parent.ensureModuleInjected(td)&&this.parent.sortSettings.columns.length>0&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(t=!0);else(!this.parent.allowSorting||!this.parent.ensureModuleInjected(td)||this.parent.allowSorting&&this.targetColumn&&!this.targetColumn.allowSorting)&&(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(bd)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:!this.parent.ensureModuleInjected(bd)||!this.targetColumn||this.targetColumn.allowFiltering&&this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type||(t=!0)}return t},e.prototype.columnMenuItemClick=function(e){switch(this.isChooserItem(e.item)?"ColumnChooser":this.getKeyFromId(e.item.id)){case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"AutoFitAll":this.parent.autoFitColumns([]);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"SortAscending":this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"ColumnChooser":var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=e.element.querySelector(".e-checkbox-wrapper .e-frame");i&&i.classList.contains("e-check")?(i.classList.remove("e-check"),this.parent.hideColumns(t,"field")):i&&(this.parent.showColumns(t,"field"),i.classList.add("e-check"));break;case"Filter":this.getFilter(e.element,e.item.id)}e.column=this.targetColumn,this.parent.trigger(fi,e)},e.prototype.columnMenuOnClose=function(e){e.items.length>0&&e.items[0].parentObj instanceof Zh.ContextMenu&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen()&&this.getFilter(e.element,e.element.id,!0)),(0,o.isNullOrUndefined)(e.parentItem)||"ColumnChooser"!==this.getKeyFromId(e.parentItem.id)?this.parent.notify(on,{}):this.columnMenu.element.querySelector(".e-selected")&&this.columnMenu.element.querySelector(".e-selected").focus()},e.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},e.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems?this.parent.columnMenuItems:this.getDefault();t<i.length;t++){var n=i[t];if("string"==typeof n)if("ColumnChooser"===n){var r=this.getDefaultItem(n);r.items=this.createChooserItems(),e.push(r)}else e.push(this.getDefaultItem(n));else e.push(n)}return e},e.prototype.getDefaultItem=function(e){var t={};switch(e){case"SortAscending":t={iconCss:this.ASCENDING};break;case"SortDescending":t={iconCss:this.DESCENDING};break;case"Group":t={iconCss:this.GROUP};break;case"Ungroup":t={iconCss:this.UNGROUP};break;case"Filter":t={iconCss:this.FILTER};break;case"ColumnChooser":t={iconCss:this.COLUMNCHOOSER};break;case"AutoFit":t={iconCss:this.AUTOFIT};break;case"AutoFitAll":t={iconCss:this.AUTOFITALL}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[""+e]},e.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},e.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},e.prototype.getKeyFromId=function(e,t){return e.indexOf("_colmenu_")>0&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},e.prototype.getColumnMenu=function(){return this.element},e.prototype.getModuleName=function(){return"columnMenu"},e.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},e.prototype.getHeaderCell=function(e){return(0,o.closest)(e.target,"th.e-headercell")},e.prototype.getColumn=function(){if(this.headerCell){var e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("data-mappinguid");return this.parent.getColumnByUid(e)}return null},e.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t<i.length;t++){var n=i[t];n.showInColumnChooser&&n.field&&e.push({id:this.generateID(n.field,this.CHOOSER),text:n.headerText?n.headerText:n.field})}return e},e.prototype.appendFilter=function(e){var t="Filter";if(this.defaultItems[""+t]){var i=this.defaultItems[""+t].id;(0,o.closest)(e.target,"#"+i)&&!this.isFilterPopupOpen()?this.getFilter(e.target,i):!(0,o.closest)(e.target,"#"+i)&&this.isFilterPopupOpen()&&this.getFilter(e.target,i,!0)}},e.prototype.getFilter=function(e,t,i){var n=this.getFilterPop();if(n){if(n.style.display=!o.Browser.isDevice&&i?"none":"block","none"!==n.style.display)if("Menu"===this.parent.filterSettings.type){if(n.querySelector(".e-flmenu-input"))n.querySelector(".e-flmenu-input").focus();else if(n.querySelector(".e-flmenu-valuediv")){var r=n.querySelector(".e-flmenu-valuediv").firstElementChild;(0,o.isNullOrUndefined)(r)||r.focus()}}else"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||n.querySelector(".e-searchinput")&&n.querySelector(".e-searchinput").focus()}else this.parent.notify(vi,{col:this.targetColumn,target:e,isClose:i,id:t})},e.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),n=e.getBoundingClientRect(),r=n.left-i.left,s=n.top-i.top;i.height<s?s=s-t.offsetHeight+n.height:i.height<s+t.offsetHeight&&(s=i.height-t.offsetHeight),window.innerHeight<t.offsetHeight+s+i.top&&(s=window.innerHeight-t.offsetHeight-i.top),s+i.top<0&&(s=0),this.parent.enableStickyHeader&&i.top<=0&&(s=n.top-i.top),r+=this.parent.enableRtl?-t.offsetWidth:n.width,i.width<=r+t.offsetWidth?(r-=n.width+t.offsetWidth,n.left<t.offsetWidth&&(r=n.left+t.offsetWidth/2)):r<0&&(r+=t.offsetWidth+n.width),t.style.top=s+"px",t.style.left=r+"px"},e.prototype.filterPosition=function(){var e=this.getFilterPop();if(!this.parent.enableAdaptiveUI&&(e.classList.add(this.WRAP),!o.Browser.isDevice)){var t=e.style.display;e.style.cssText+="display:block;visibility:hidden";var i=this.element.querySelector("."+this.FILTER);i&&(this.setPosition(i.parentElement,e),e.style.cssText+="display:"+t+";visibility:visible")}},e.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(xd)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(Td)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(td)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(bd)&&e.push("Filter"),e},e.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},e.prototype.getFilterPop=function(){if(!(0,o.isNullOrUndefined)(this.targetColumn)&&"Menu"===this.parent.filterSettings.type&&o.Browser.isDevice)return document.getElementById(this.targetColumn.uid+"-flmdlg");var e=this.parent.element.querySelector("."+this.POP);if(!e){var t=document.getElementById(this.parent.element.id+"_e-popup");e=t?t.querySelector("."+this.POP):null}if(!e&&this.parent.element.classList.contains("e-treelistgrid")){var i=(0,o.closest)(this.parent.element,".e-gantt");e=i?i.querySelector("."+this.POP):null}return e},e.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&this.parent.columnMenuItems.indexOf("Filter")>=0||!this.parent.columnMenuItems},e.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},e}(),Ep=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Op=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.parent=t,n.serviceLocator=i,n.initEvent(),n}return Ep(t,e),t.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on(wi,this.initForeignKeyColumns,this),this.parent.on(bi,this.getForeignKeyData,this),this.parent.on(Ii,this.generateQueryFormData,this))},t.prototype.initForeignKeyColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].dataSource=e[parseInt(t.toString(),10)].dataSource instanceof a.DataManager?e[parseInt(t.toString(),10)].dataSource:(0,o.isNullOrUndefined)(e[parseInt(t.toString(),10)].dataSource)?new a.DataManager:"result"in e[parseInt(t.toString(),10)].dataSource?e[parseInt(t.toString(),10)].dataSource:new a.DataManager(e[parseInt(t.toString(),10)].dataSource)},t.prototype.eventfPromise=function(e,t,i,n){var r=this.getStateEventArgument(t),s=new a.Deferred,l=new a.Deferred;r.action=e.action;var h=this.parent.getDataModule();return!(0,o.isNullOrUndefined)(e.action)&&e.action.requestType&&!1!==h.foreignKeyDataState.isDataChanged?(h.setForeignKeyDataState({isPending:!0,resolver:l.resolve}),l.promise.then(function(){s.resolve(n.dataSource)}),r.setColumnData=this.parent.setForeignKeyData.bind(this.parent),this.parent.trigger(Di,r)):(h.setForeignKeyDataState({}),s.resolve(i)),s},t.prototype.getForeignKeyData=function(e){var t=this,i=e.column?[e.column]:this.parent.getForeignKeyColumns();"ExcludeHidden"===this.parent.columnQueryMode&&(i=i.filter(function(e){return!1!==e.visible}));for(var n=[],r=function(t){var r=void 0,o=e.isComplex?s.genarateColumnQuery(i[parseInt(t.toString(),10)]):s.genarateQuery(i[parseInt(t.toString(),10)],e.result.result,!1,!0);o.params=s.parent.query.params;var a=i[parseInt(t.toString(),10)].dataSource;a&&"result"in a?r=s.eventfPromise(e,o,a,i[parseInt(t.toString(),10)]).promise:r=!a.ready||a.dataSource.offline?a.executeQuery(o):a.ready.then(function(){return a.executeQuery(o)});n.push(r)},s=this,l=0;l<i.length;l++)r(l);Promise.all(n).then(function(t){for(var n=0;n<t.length;n++)i[parseInt(n.toString(),10)].columnData=t[parseInt(n.toString(),10)].result,"dropdownedit"===i[parseInt(n.toString(),10)].editType&&"result"in i[parseInt(n.toString(),10)].dataSource&&(i[parseInt(n.toString(),10)].edit.params=(0,o.extend)(i[parseInt(n.toString(),10)].edit.params,{dataSource:t[parseInt(n.toString(),10)].result,query:new a.Query,fields:{value:i[parseInt(n.toString(),10)].foreignKeyField||i[parseInt(n.toString(),10)].field,text:i[parseInt(n.toString(),10)].foreignKeyValue}}));e.promise.resolve(e.result)}).catch(function(i){var n=i;return n.error||(n={error:n}),t.parent.log(["actionfailure","foreign_key_failure"],n),e.promise&&e.promise.reject&&e.promise.reject(i),i})},t.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},t.prototype.genarateQuery=function(e,t,i,n){var r=this.parent,s=[],o=new a.Query,l=i?e.foreignKeyField:e.field;if(this.parent.searchSettings&&this.parent.searchSettings.key.length){var h=(new a.Query).where(e.foreignKeyValue,"contains",this.parent.searchSettings.key,!0);t=new a.DataManager(t).executeLocal(h)}if(r.allowPaging||r.enableVirtualization||i){t=new a.DataManager(r.allowGrouping&&r.groupSettings.columns.length&&!i?t.records:t).executeLocal((new a.Query).select(l));var d=a.DataUtil.distinct(t,l,!1);l=i?e.field:e.foreignKeyField;for(var p=0;p<d.length;p++)d[parseInt(p.toString(),10)]&&d[parseInt(p.toString(),10)].getDay?s.push(Al({field:l,operator:"equal",value:d[parseInt(p.toString(),10)],matchCase:!1})):s.push(new a.Predicate(l,"equal",d[parseInt(p.toString(),10)],!1))}return n?s.length?o.where(a.Predicate.or(s)):o:s.length?a.Predicate.or(s):{predicates:[]}},t.prototype.genarateColumnQuery=function(e){var t=this.parent,i=new a.Query,n=this.isFiltered(e);if(n.isTrue&&(i=this.filterQuery(i,n.column,!0)),t.searchSettings.key.length){var r=t.searchSettings;e.dataSource instanceof a.DataManager&&e.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===e.dataSource.adaptor.getModuleName()?i=this.searchQuery(i,e,!0):i.search(r.key,e.foreignKeyValue,r.operator,r.ignoreCase)}return i},t.prototype.isFiltered=function(e){var t=this.parent.filterSettings.columns.filter(function(t){return t.field===e.foreignKeyValue&&t.uid===e.uid});return{column:t,isTrue:!!t.length}},t.prototype.getModuleName=function(){return"foreignKey"},t.prototype.destroy=function(){this.destroyEvent()},t.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off(wi,this.initForeignKeyColumns),this.parent.off(bi,this.getForeignKeyData),this.parent.off(Ii,this.generateQueryFormData))},t}(Zr),kp=function(){function e(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},this.isDownScroll=!1,this.isUpScroll=!1,this.isScroll=!0,this.enableContinuousScroll=!1,this.initialRender=!0,this.isRemove=!1,this.isInitialCollapse=!1,this.prevScrollTop=0,this.actions=["filtering","searching","grouping","ungrouping","reorder","sorting","refresh"],this.keys=[Ms,Ls,Bs,zs],this.rowTop=0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.isFocusScroll=!1,this.isGroupCollapse=!1,this.infiniteDetailDestroy=!1,this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=new Vs(this.parent)}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(Pe,this.onDataReady,this),this.parent.on(kt,this.dataSourceModified,this),this.parent.on(bn,this.infinitePageQuery,this),this.parent.on(wn,this.infiniteScrollHandler,this),this.parent.on(mt,this.infiniteCellFocus,this),this.parent.on(xn,this.appendInfiniteRows,this),this.parent.on(Rn,this.removeInfiniteCacheRows,this),this.parent.on(Cn,this.resetInfiniteBlocks,this),this.parent.on(Dn,this.setCache,this),this.parent.on(En,this.ensureIntialCollapse,this),this.parent.on(vt,this.infiniteCellFocus,this),this.parent.on(In,this.setDisplayNone,this),this.parent.on(pn,this.editActionBegin,this),this.parent.on(vn,this.getVirtualInfiniteData,this),this.parent.on(mn,this.resetInfiniteEdit,this),this.parent.on(cn,this.infiniteEditSuccess,this),this.parent.on(fn,this.refreshInfiniteCache,this),this.parent.on(Ar,this.refreshInfiniteEditrowindex,this),this.parent.on(Tn,this.infiniteEditHandler,this),this.parent.on(yn,this.infiniteAddActionBegin,this),this.parent.on(Ue,this.modelChanged,this),this.parent.on(tr,this.refreshInfiniteCurrentViewData,this),this.parent.on(Ct,this.destroy,this),this.parent.on(Ne,this.selectNewRow,this),this.parent.on(Or,this.captionActionComplete,this),this.parent.on(gr,this.setGroupCollapsePageQuery,this),this.parent.on(Vr,this.onActionComplete,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.dataBoundFunction=this.dataBound.bind(this),this.parent.addEventListener(R,this.actionBeginFunction),this.parent.addEventListener(D,this.actionCompleteFunction),this.parent.addEventListener(E,this.dataBoundFunction)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Pe,this.onDataReady),this.parent.off(kt,this.dataSourceModified),this.parent.off(bn,this.infinitePageQuery),this.parent.off(wn,this.infiniteScrollHandler),this.parent.off(mt,this.infiniteCellFocus),this.parent.off(xn,this.appendInfiniteRows),this.parent.off(Rn,this.removeInfiniteCacheRows),this.parent.off(Cn,this.resetInfiniteBlocks),this.parent.off(Dn,this.setCache),this.parent.off(En,this.ensureIntialCollapse),this.parent.off(vt,this.infiniteCellFocus),this.parent.off(In,this.setDisplayNone),this.parent.off(pn,this.editActionBegin),this.parent.off(vn,this.getVirtualInfiniteData),this.parent.off(mn,this.resetInfiniteEdit),this.parent.off(cn,this.infiniteEditSuccess),this.parent.off(fn,this.refreshInfiniteCache),this.parent.on(Ar,this.refreshInfiniteEditrowindex),this.parent.off(Tn,this.infiniteEditHandler),this.parent.off(yn,this.infiniteAddActionBegin),this.parent.off(Ue,this.modelChanged),this.parent.off(tr,this.refreshInfiniteCurrentViewData),this.parent.off(Ct,this.destroy),this.parent.off(Ne,this.selectNewRow),this.parent.off(Or,this.captionActionComplete),this.parent.off(gr,this.setGroupCollapsePageQuery),this.parent.off(Vr,this.onActionComplete),this.parent.removeEventListener(R,this.actionBeginFunction),this.parent.removeEventListener(D,this.actionCompleteFunction),this.parent.removeEventListener(E,this.dataBoundFunction))},e.prototype.dataBound=function(){"collapse"===this.groupCaptionAction?(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()):"refresh"===this.groupCaptionAction&&(this.parent.hideSpinner(),this.groupCaptionAction=this.empty)},e.prototype.setGroupCollapsePageQuery=function(e){var t=this.parent;if(!t.infiniteScrollSettings.enableCache&&this.isGroupCollapse)if(e.skipPage=!0,this.isGroupCollapse=!1,"collapse"===this.groupCaptionAction){for(var i=t.getRowObjectFromUID(this.parentCapUid),n=t.getRowsObject(),r=0,s=n.length-1;s>=0&&n[parseInt(s.toString(),10)].indent!==i.indent;s--)n[parseInt(s.toString(),10)].isDataRow&&r++;var o=qh(n.indexOf(i),n),a=Bh(o.fields,o.keys,this),l=zh(a);a=l[l.length-1];for(s=l.length-2;s>=0;s--)a=a.and(l[parseInt(s.toString(),10)]);e.query.where(a),e.query.skip(r),this.parentCapUid=this.empty}else{var h=t.getRows(),d=t.pageSettings.pageSize,p=Ph(h[h.length-1])+1,c=p-p%d+d-p;p%d===0&&(c=0),e.query.skip(p),e.query.take(t.infiniteScrollSettings.initialBlocks*t.pageSettings.pageSize+c)}},e.prototype.captionActionComplete=function(e){var t=this.parent;if(!t.infiniteScrollSettings.enableCache&&e.isCollapse){var i=t.getContent().firstElementChild.getBoundingClientRect(),n=t.contentModule.getTable().getBoundingClientRect();if(Math.round(n.bottom-t.getRowHeight())<=Math.round(i.bottom)){this.parentCapUid=e.parentUid,this.groupCaptionAction="collapse",t.showSpinner();var r=t.getRowObjectFromUID(e.parentUid);this.getCaptionChildCount(r)?this.makeGroupCollapseRequest(e.parentUid):(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest())}}},e.prototype.makeGroupCollapseRequest=function(e){var t=this.parent,i=[].slice.call(t.getContentTable().querySelectorAll("tr")),n=t.groupSettings.enableLazyLoading?i:t.getRows(),r=t.groupSettings.enableLazyLoading?t.contentModule.visibleRows.length-1:Ph(n[n.length-1]),s=this.parent.pageSettings.currentPage,o=Math.ceil(r/this.parent.pageSettings.pageSize)+1;if(s>=this.maxPage||o>this.maxPage)t.hideSpinner();else{this.parent.pageSettings.currentPage=o;var a={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:s,startIndex:r+1,direction:"down",isCaptionCollapse:!0,parentUid:e};this.isGroupCollapse=!0,this.parent.notify("model-changed",a)}},e.prototype.getCaptionChildCount=function(e){for(var t=this.parent.getRowsObject(),i=!1,n=t.indexOf(e);n<t.length&&(!(t[parseInt(n.toString(),10)].indent===e.indent||t[parseInt(n.toString(),10)].indent<e.indent)||t[parseInt(n.toString(),10)].data.key===e.data.key);n++)if(t[parseInt(n.toString(),10)].isCaptionRow&&!this.childCheck(t,t[parseInt(n.toString(),10)],n)){i=!0;break}return i},e.prototype.childCheck=function(e,t,i){for(var n=0,r=i+1;r<e.length&&e[parseInt(r.toString(),10)].indent!==t.indent;r++)e[parseInt(r.toString(),10)].indent===t.indent+1&&e[parseInt(r.toString(),10)].parentUid===t.uid&&n++;return t.data.count===n},e.prototype.updateCurrentViewData=function(){var e=this.parent;if(!e.groupSettings.columns.length){var t=Object.keys(this.infiniteCurrentViewData);e.currentViewData=[];for(var i=e.pageSettings.currentPage,n=e.infiniteScrollSettings.enableCache,r=e.infiniteScrollSettings.maxBlocks,s=n&&(i>r||this.isUpScroll&&i>1),o=s?this.isUpScroll?i:i-r+1:1,a=s?o+r-1:n?r:t.length,l=o;l<=a;l++)this.infiniteCurrentViewData[parseInt(l.toString(),10)]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[parseInt(l.toString(),10)]))}},e.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent,i=t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType);"add"!==e.args.action||"save"!==e.args.requestType||i||(this.parent.pageSettings.currentPage=Math.ceil(e.args.index/this.parent.pageSettings.pageSize)?Math.ceil(e.args.index/this.parent.pageSettings.pageSize):1);var n=this.parent.pageSettings.currentPage,r=this.parent.pageSettings.pageSize,s=this.parent.infiniteScrollSettings.initialBlocks,o=Object.keys(this.infiniteCurrentViewData),a=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var l="save"===e.args.requestType&&!(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key),h="delete"===e.args.requestType;if(a||!l&&!h||i)s>1&&e.data.length===s*r?(i&&(this.infiniteCurrentViewData={},this.firstBlock=1),this.setInitialCache(e.data.slice(),{},a&&"delete"===e.args.requestType,!0)):this.infiniteCurrentViewData[parseInt(n.toString(),10)]=e.data.slice();else if(l){for(var d=0,p=1;p<=o.length;p++)if(d+=this.infiniteCurrentViewData[parseInt(p.toString(),10)].length-1,e.args.index<=d){this.resetCurrentViewData(p),this.infiniteCurrentViewData[parseInt(p.toString(),10)].splice(e.args.index,0,e.args.data);break}}else this.infiniteCurrentViewData[o[o.length-1]].push(e.data[0])}},e.prototype.resetCurrentViewData=function(e){for(var t=Object.keys(this.infiniteCurrentViewData),i=e;i<=t.length;i++){var n=this.infiniteCurrentViewData[parseInt(i.toString(),10)][this.infiniteCurrentViewData[parseInt(i.toString(),10)].length-1];this.infiniteCurrentViewData[i+1]&&this.infiniteCurrentViewData[i+1].splice(0,0,n),this.infiniteCurrentViewData[parseInt(i.toString(),10)].pop()}},e.prototype.modelChanged=function(e){var t=this.parent.getRows();if("save"===e.requestType&&e.index&&e.data&&(this.addRowIndex=e.index),t&&t.length&&"infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)){if(this.firstIndex=Ph(t[0]),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=Ph(t[t.length-1]),"delete"===e.requestType){var i=this.parent.getRowsObject();e.startIndex=this.parent.infiniteScrollSettings.enableCache?(this.firstBlock-1)*this.parent.pageSettings.pageSize:i[i.length-1].index}else e.startIndex=this.firstIndex;this.parent.infiniteScrollSettings.enableCache||this.parent.pageSettings.currentPage!==this.maxPage||"delete"!==e.requestType||(this.isLastPage=!0,this.lastIndex=this.lastIndex-1)}},e.prototype.infiniteAddActionBegin=function(e){this.isNormaledit&&(this.isAdd=!0,this.parent.infiniteScrollSettings.enableCache&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.parent.pageSettings.currentPage>1&&(e.startEdit=!1,this.resetInfiniteBlocks({},!0),this.makeRequest({currentPage:1}))))},e.prototype.infiniteEditHandler=function(e){if(!this.parent.infiniteScrollSettings.enableCache&&("delete"===e.e.requestType||"save"===e.e.requestType&&"add"===this.requestType)){var t=this.parent.getRows(),i=this.parent.getRowsObject();this.ensureRowAvailability(i,e.result[0])&&(!t.length||this.addRowIndex&&this.addRowIndex>=t.length||this.resetRowIndex(i,e.e,t,"add"===this.requestType,!0),this.isLastPage?(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index<this.parent.frozenRows&&((0,o.remove)(t[this.parent.frozenRows-1]),this.createRow([i[this.parent.frozenRows-1]],e,!1,!0),sh(this.parent))):this.createRow(i,e)),this.parent.hideSpinner(),this.parent.notify(kr,{}),"delete"===this.requestType?this.parent.notify(_t,e.e):this.parent.notify(Vt,e.e)}this.parent.notify(pi,{case:"refreshHeight"})},e.prototype.createRow=function(e,t,i,n,r){var s=n?e:this.generateRows(t.result,t.e),a=new js(this.serviceLocator,null,this.parent);if(this.parent.removeMaskRow(),!("save"===t.e.requestType&&t.e.index&&t.e.data&&(s[0].index=this.addRowIndex,this.addRowIndex=null,s[0].index>=e.length))){var l;l=this.parent.getContent().querySelector(Ds),this.parent.frozenRows&&(l=n&&"add"!==this.requestType||!n&&"add"===this.requestType?this.parent.getHeaderContent().querySelector(Ds):l);var h={rows:e,cancel:!1,args:t,isMovable:i,isFrozenRows:n,isFrozenRight:n,row:s};if(this.parent.notify(ir,h),!h.cancel)for(var d=s.length-1;d>=0;d--)"delete"===this.requestType?l.appendChild(a.render(s[parseInt(d.toString(),10)],this.parent.getColumns())):l.insertBefore(a.render(s[parseInt(d.toString(),10)],this.parent.getColumns()),l.rows[t.e.index]);if(!n&&this.parent.frozenRows&&(this.parent.selectionModule.index<this.parent.frozenRows||"add"===this.requestType)){var p=this.parent.getRows(),c=(i||r)&&"add"===this.requestType?this.parent.frozenRows:this.parent.frozenRows-1;(0,o.remove)(p[parseInt(c.toString(),10)]),this.createRow([e[this.parent.frozenRows-1]],t,!1,!0,!1)}this.parent.infiniteScrollSettings.enableCache||n||(sh(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?s.concat(e):e.concat(s))}},e.prototype.ensureRowAvailability=function(e,t){var i=!0;if(this.parent.frozenRows&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.sortSettings.columns&&"add"===this.requestType)for(var n=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<e.length;r++)if(e[parseInt(r.toString(),10)].data[""+n]===t[""+n]){i=!1;break}return i},e.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},e.prototype.resetRowIndex=function(e,t,i,n,r){var s=this,a=this.parent.getPrimaryKeyFieldNames()[0],l=!(i.length%this.parent.pageSettings.pageSize);n?l&&(r&&!this.parent.groupSettings.columns.length&&this.swapCurrentViewData(1,!0),(0,o.remove)(i[e.length-1]),i.splice(e.length-1,1),e.splice(e.length-1,1)):e.filter(function(n,l){if(n.data[""+a]===t.data[0][""+a]){if(r&&!s.parent.groupSettings.columns.length){var h=Math.ceil((l+1)/s.parent.pageSettings.pageSize);s.resetInfiniteCurrentViewData(h,l)}e.splice(l,1);var d=s.parent.getRowElementByUID(n.uid);if(d){var p=i.indexOf(d);(0,o.remove)(d),i.splice(p,1)}}});var h=n?this.addRowIndex?this.addRowIndex+1:1:0;th(this.parent,e,i,h,this.addRowIndex?this.addRowIndex:0)},e.prototype.resetInfiniteCurrentViewData=function(e,t){t-=(e-1)*this.parent.pageSettings.pageSize,this.infiniteCurrentViewData[parseInt(e.toString(),10)].splice(t,1),this.swapCurrentViewData(e,!1)},e.prototype.swapCurrentViewData=function(e,t){for(var i=Object.keys(this.infiniteCurrentViewData),n=t?i.length+1:i.length,r=e;r<n;r++)if(this.infiniteCurrentViewData[r+1]){var s=t?r:r+1,o=t?this.infiniteCurrentViewData[parseInt(r.toString(),10)].length-1:0,a=this.infiniteCurrentViewData[parseInt(s.toString(),10)].splice(o,1);t?(this.infiniteCurrentViewData[r+1]=a.concat(this.infiniteCurrentViewData[r+1]),r+1===n-1&&this.infiniteCurrentViewData[r+1].splice(this.infiniteCurrentViewData[r+1].length-1,1)):this.infiniteCurrentViewData[parseInt(r.toString(),10)].push(a[0])}this.updateCurrentViewData()},e.prototype.setDisplayNone=function(e){if(this.parent.infiniteScrollSettings.enableCache){for(var t=Object.keys(this.infiniteCache),i=1;i<=t.length;i++){this.infiniteCache[parseInt(i.toString(),10)].filter(function(t){t.cells[e.index].visible=""===e.visible})}this.resetContentModuleCache(this.infiniteCache)}},e.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e.data},e.prototype.refreshInfiniteCacheRowVisibleLength=function(e,t){var i=e[parseInt(t.toString(),10)];if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){for(var n=0,r=0,s=0,a=0;a<i.length;a++)i[parseInt(a.toString(),10)].visible||(0,o.isNullOrUndefined)(i[parseInt(a.toString(),10)].visible)?r++:s++;return s>r?(n=s-r)>r&&(n=r):(n=r-s)>s&&(n=s),0===n&&(n=1),n}return i.length},e.prototype.refreshInfiniteEditrowindex=function(e){this.editRowIndex=e.index},e.prototype.getEditedRowObject=function(){var e,t=this.parent.getRowsObject();if(this.parent.pinnedTopRowModels.length&&this.editRowIndex<this.parent.pinnedTopRowModels.length){t=this.parent.pinnedTopRowModels;for(var i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].index===this.editRowIndex)return e=t[parseInt(i.toString(),10)]}for(i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},e.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=this.parent.editSettings.showAddNewRow)},e.prototype.updateCurrentViewRecords=function(e){var t=Jl(this.parent,e);(0,o.isNullOrUndefined)(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},e.prototype.actionBegin=function(e){"add"===e.requestType||"delete"===e.requestType?this.requestType=e.requestType:"add"===e.action&&"save"===e.requestType&&(this.requestType=e.action),(this.parent.isFrozenGrid()&&!e.cancel&&"searching"===e.requestType||"sorting"===e.requestType||"filtering"===e.requestType)&&(this.isInitialRender=!0)},e.prototype.actionComplete=function(e){"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.requestType=this.empty,this.isCancel="cancel"===e.requestType||"save"===e.requestType,this.isAdd=this.isEdit=this.parent.editSettings.showAddNewRow,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},e.prototype.onActionComplete=function(e){var t={type:D};this.parent.trigger(D,(0,o.extend)(e,t))},e.prototype.resetInfiniteEdit=function(){this.parent.enableInfiniteScrolling&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.isEdit||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},e.prototype.getVirtualInfiniteData=function(e){this.getVirtualInfiniteEditedData(),e.virtualData=this.parent.enableColumnVirtualization&&!this.parent.infiniteScrollSettings.enableCache?e.virtualData:this.virtualInfiniteData,e.isAdd=this.isAdd,e.isCancel=this.isCancel},e.prototype.editActionBegin=function(e){this.isEdit=!0,this.editRowIndex=e.index;var t=(0,o.extend)({},this.getEditedRowObject().data);e.data=Object.keys(this.virtualInfiniteData).length?this.virtualInfiniteData:t},e.prototype.dataSourceModified=function(){this.resetInfiniteBlocks({requestType:this.empty},!0)},e.prototype.onDataReady=function(e){(0,o.isNullOrUndefined)(e.count)||"infiniteScroll"===e.requestType||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize))},e.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},e.prototype.infiniteScrollHandler=function(e){if(!this.infiniteDetailDestroy){this.restoreInfiniteEdit(),this.restoreInfiniteAdd();var t=e.target,i=t.classList.contains(ps),n=!(!this.parent.childGrid&&!this.parent.detailTemplate);if(i&&this.parent.enableInfiniteScrolling&&!e.isLeft){var r=this.parent.getContent().firstElementChild,s=[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.prevScrollTop=r.scrollTop;var a=n?this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}):this.parent.groupSettings.enableLazyLoading?s:this.parent.getRows();if(!a.length)return;var l=Ph(a[a.length-1])+1,h=this.parent.pageSettings.currentPage,d=void 0,p=t.scrollHeight-t.scrollTop,c=Math.round(t.scrollHeight-t.scrollTop),u=p<t.clientHeight?Math.ceil(p):Math.floor(p),g=t.clientHeight;u>g?u-=1:g>u&&(g-=1);var f=u===g||c===g;if(!(0,o.isNullOrUndefined)(this.groupCaptionAction))return;if(this.isScroll&&f&&(this.parent.pageSettings.currentPage<=this.maxPage-1||this.enableContinuousScroll)){this.parent.infiniteScrollSettings.enableCache&&(this.isUpScroll=!1,this.isDownScroll=!0);var m=n?this.getGridRows().filter(function(e){return e.classList.contains("e-row")&&!e.classList.contains("e-addedrow")}):[].slice.call(r.querySelectorAll(".e-row:not(.e-addedrow)")),y=m[m.length-1],v=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length?this.parent.contentModule.visibleRows.length-1:Ph(y);this.parent.pageSettings.currentPage=Math.ceil(v/this.parent.pageSettings.pageSize)+1,d={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:h,startIndex:l,direction:"down"},this.makeRequest(d)}if(this.isScroll&&this.parent.infiniteScrollSettings.enableCache&&0===t.scrollTop&&1!==this.parent.pageSettings.currentPage){this.parent.infiniteScrollSettings.enableCache&&(this.isDownScroll=!1,this.isUpScroll=!0);v=Ph((y=n?this.getGridRows().filter(function(e){return e.classList.contains(us)}):[].slice.call(r.getElementsByClassName(us)))[this.parent.pageSettings.pageSize-1]);var S=Ph(y[0])-this.parent.pageSettings.pageSize;this.parent.pageSettings.currentPage=Math.ceil(v/this.parent.pageSettings.pageSize)-1,this.parent.pageSettings.currentPage&&(d={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:h,startIndex:S,direction:"up"},this.makeRequest(d))}this.parent.infiniteScrollSettings.enableCache&&!this.isScroll&&(0,o.isNullOrUndefined)(d)&&(this.isDownScroll||this.isUpScroll)&&(r.scrollTop=this.top)}}},e.prototype.makeRequest=function(e){var t=this;if(this.parent.pageSettings.currentPage!==e.prevPage){var i=this.parent.infiniteScrollSettings.initialBlocks;i<this.maxPage&&this.parent.pageSettings.currentPage<=this.maxPage?(this.isInfiniteScroll=!0,(0,o.isNullOrUndefined)(this.infiniteCache[e.currentPage])?setTimeout(function(){t.getVirtualInfiniteEditedData(),t.parent.notify("model-changed",e)},100):setTimeout(function(){t.getVirtualInfiniteEditedData(),t.parent.notify(Sn,e)},100)):this.parent.pageSettings.currentPage=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&i>=this.maxPage?1:this.maxPage}},e.prototype.infinitePageQuery=function(e){this.initialRender||("add"===this.requestType||"delete"===this.requestType)&&(this.parent.childGrid||this.parent.detailTemplate)?(this.initialRender=!1,this.intialPageQuery(e)):"delete"===this.requestType||"add"===this.requestType?this.isInfiniteScroll||this.parent.groupSettings.enableLazyLoading?this.parent.groupSettings.enableLazyLoading&&!this.parent.infiniteScrollSettings.enableCache?this.parent.infiniteScrollSettings.initialBlocks<this.parent.pageSettings.currentPage?e.page(1,this.parent.pageSettings.pageSize*this.parent.pageSettings.currentPage):e.page(1,this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize):this.editPageQuery(e):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize)},e.prototype.editPageQuery=function(e){var t=this.parent.infiniteScrollSettings.initialBlocks;if(this.parent.infiniteScrollSettings.enableCache)this.infiniteCache={},this.infiniteCurrentViewData={},e.skip(this.firstIndex),e.take(t*this.parent.pageSettings.pageSize);else{"Dialog"===this.parent.editSettings.mode&&this.parent.clearSelection();var i="delete"===this.requestType?this.lastIndex:this.addRowIndex?this.addRowIndex:this.firstIndex;e.skip(i),(0,o.isNullOrUndefined)(this.parent.getDataModule().dataManager.dataSource.url)||""===this.parent.getDataModule().dataManager.dataSource.url||"delete"!==this.requestType&&"add"!==this.requestType?e.take(1):e.take(t*this.parent.pageSettings.pageSize)}},e.prototype.intialPageQuery=function(e){this.parent.infiniteScrollSettings.enableCache&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var t=this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks;e.page(1,t)},e.prototype.scrollToLastFocusedCell=function(e){var t=this.parent,i=this.lastFocusInfo.rowIdx+(e.keyArgs.action===Ls?-1:1),n=this.lastFocusInfo.cellIdx,r=t.getRowByIndex(i);if(!r){var s=new js(this.serviceLocator,null,this.parent),a=Math.floor(i/this.parent.pageSettings.pageSize)+1;t.pageSettings.currentPage=a;var l=t.getColumns();(0,o.remove)(t.getContent().querySelector("tbody")),t.getContent().querySelector("table").appendChild(t.createElement("tbody",{attrs:{role:"rowgroup"}}));for(var h=[],d=1===a||this.maxPage===a?0:-1,p=0;p<t.infiniteScrollSettings.maxBlocks;this.maxPage===a?d--:d++,p++){var c=this.infiniteCache[a+d];if(c){h=h.concat(c);for(var u=0;u<c.length;u++)t.getContent().querySelector("tbody").appendChild(s.render(c[parseInt(u.toString(),10)],l))}}t.notify(Ne,{rows:h,args:{}}),sh(t)}var g=(r=t.getRowByIndex(i)).cells[parseInt(n.toString(),10)];t.focusModule.isInfiniteScroll=!0,t.focusModule.onClick({target:g},!0),t.selectRow(i),g.focus(),this.isFocusScroll=!1,e.cancel=!0},e.prototype.setLastCellFocusInfo=function(e){var t=e.byClick&&e.clickArgs.target||e.byKey&&e.keyArgs.target||(!this.isFocusScroll&&e).target;if(t&&t.classList.contains("e-rowcell")){var i=parseInt(t.getAttribute("aria-colindex"),10)-1,n=parseInt(t.parentElement.getAttribute("aria-rowindex"),10)-1;this.lastFocusInfo={rowIdx:n,cellIdx:i}}},e.prototype.infiniteCellFocus=function(e){var t=this.parent,i=t.infiniteScrollSettings.enableCache;if(e.byKey){if(i&&this.isFocusScroll)return void this.scrollToLastFocusedCell(e);var n=document.activeElement,r=Ph(n.parentElement);this.cellIndex=parseInt(n.getAttribute(xs),10)-1;var s=t.getContent().firstElementChild,o=this.maxPage*t.pageSettings.pageSize-1,a=Math.floor(s.offsetHeight/this.parent.getRowHeight()),l=s.getBoundingClientRect();if(!isNaN(r))if(e.keyArgs.action===Ms||e.keyArgs.action===Bs){this.rowIndex=r+=1;var h=(d=t.getRowByIndex(r))&&d.getBoundingClientRect();i&&(r=n.parentElement.rowIndex+1),this.isFocusScroll||!d&&r<o||h&&h.bottom>=l.bottom?(this.isFocusScroll||(this.pressedKey=e.keyArgs.action),this.isFocusScroll=!1,s.scrollTop=(r-a+1)*this.parent.getRowHeight()):!i&&d&&h&&(h.bottom>=l.bottom||h.top<l.top)&&d.cells[this.cellIndex].scrollIntoView()}else if(e.keyArgs.action===Ls||e.keyArgs.action===zs){this.rowIndex=r-=1;var d;h=(d=t.getRowByIndex(r))&&d.getBoundingClientRect();i&&(r=n.parentElement.rowIndex-1),(!d||h.top<=l.top)&&(this.pressedKey=e.keyArgs.action,s.scrollTop=r*this.parent.getRowHeight())}}else"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);this.setLastCellFocusInfo(e)},e.prototype.createEmptyRowdata=function(){var e=this;this.parent.getColumns().filter(function(t){e.emptyRowData[t.field]=e.empty})},e.prototype.getVirtualInfiniteEditedData=function(){var e=this.parent.element.querySelector("."+fs),t=this.parent.element.querySelector("."+ms),i=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||t)){var n=e?(0,o.extend)({},this.getEditedRowObject().data):(0,o.extend)({},this.emptyRowData);this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(i,n);for(var r=this.parent.getHiddenColumns(),s=0;s<r.length;s++)r[parseInt(s.toString(),10)].defaultValue&&(this.virtualInfiniteData[r[parseInt(s.toString(),10)].field]=r[parseInt(s.toString(),10)].defaultValue)}},e.prototype.restoreInfiniteEdit=function(){var e=this.parent.getContent().firstElementChild,t=!this.parent.frozenRows||this.editRowIndex>=this.parent.frozenRows;if(this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&t&&this.parent.editSettings.allowEditing&&!(0,o.isNullOrUndefined)(this.editRowIndex)){var i=this.parent.getRowByIndex(this.editRowIndex);if(Object.keys(this.virtualInfiniteData).length&&i&&!this.parent.getContent().querySelector("."+fs)){var n=i.getBoundingClientRect().top;n<e.offsetHeight&&n>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(i))}}},e.prototype.restoreInfiniteAdd=function(){var e=this.parent.getContent().firstElementChild;this.parent.getCurrentViewRecords().length&&this.parent.getRowByIndex(0)&&this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&this.isAdd&&!e.querySelector("."+ms)&&(e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord()))},e.prototype.appendInfiniteRows=function(e){var t=this.parent,i=this.parent.getContent().firstElementChild,n=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;if(t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType)&&(i.scrollTop=0,t.pageSettings.currentPage=1),(this.parent.isAngular||this.parent.isReact||this.parent.isVue||this.parent.isVue3)&&n&&!e.args.isFrozen&&this.parent.infiniteScrollSettings.enableCache){var r=!(!this.parent.childGrid||!this.parent.element.querySelectorAll(".e-childgrid").length),s=this.parent.getDataRows();this.parent.refreshReactTemplateTD(s,r)}(n&&!e.args.isFrozen||!n)&&(n&&"up"===e.args.direction?e.tbody.insertBefore(e.frag,e.tbody.firstElementChild):e.tbody.appendChild(e.frag)),this.parent.contentModule.getTable().appendChild(e.tbody),this.updateCurrentViewData(),this.isInitialRender&&!e.args.isFrozen&&(this.isInitialRender=!1,this.parent.scrollModule.setHeight()),e.args.isFrozen||(this.rowTop=this.rowTop?this.rowTop:this.parent.getRows()[0].getBoundingClientRect().top,n&&(this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(i.scrollTop=this.top),sh(this.parent)),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1,this.infiniteDetailDestroy=!1},e.prototype.selectNewRow=function(e){var t=this,i=this.parent,n=i.getRowByIndex(this.rowIndex),r=i.infiniteScrollSettings.enableCache;if(n&&this.keys.some(function(e){return e===t.pressedKey})){var s=i.getContent().firstElementChild,o=i.getRowHeight(),a=n.cells[this.cellIndex];(this.pressedKey===Ms||this.pressedKey===Bs||r&&(this.pressedKey===Ls||this.pressedKey===zs))&&(r||this.pressedKey===Ls||this.pressedKey===zs||(s.scrollTop=s.scrollTop+o),i.focusModule.isInfiniteScroll=!0,i.focusModule.onClick({target:a},!0),i.selectRow(this.rowIndex))}else if(this.lastFocusInfo&&(this.pressedKey===Ns||this.pressedKey===Ps)){var l=r?0:this.lastFocusInfo.rowIdx;if(i.getRowByIndex(l))(a=i.getCellFromIndex(l,this.lastFocusInfo.cellIdx))&&(this.isFocusScroll=!0,r?a.focus({preventScroll:!0}):(i.focusModule.isInfiniteScroll=!0,i.focusModule.onClick({target:a},!0)))}this.pressedKey=void 0},e.prototype.removeInfiniteCacheRows=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;if(!e.args.isFrozen&&t&&this.parent.infiniteScrollSettings.enableCache&&this.isRemove){var i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n=i?this.getGridRows().filter(function(e){return e.classList.contains(us)}):[].slice.call(this.parent.getContentTable().getElementsByClassName(us));if("down"===e.args.direction){if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){var r=i?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(r,e.args)}var s=this.parent.element.querySelector("."+ms)?0:1;this.removeTopRows(n,this.parent.pageSettings.pageSize-s)}if("up"===e.args.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length){r=i?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"));this.removeCaptionRows(r,e.args)}else this.removeBottomRows(n,n.length-1,e.args);this.isScroll=!1,this.top=this.calculateScrollTop(e.args)}},e.prototype.calculateScrollTop=function(e){var t=0,i=this.parent.getContent().firstElementChild;if("down"===e.direction){this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse&&(t=this.captionRowHeight());var n=[].slice.call(this.parent.getContent().firstElementChild.querySelectorAll("tr:not(.e-row)")),r=0;this.isInitialCollapse&&!(0,o.isNullOrUndefined)(n)&&(r=Math.round((n.length-1)/this.parent.groupSettings.columns.length));for(var s=r||this.parent.pageSettings.pageSize*(this.parent.infiniteScrollSettings.maxBlocks-1),a=0,l=0;a<i.clientHeight;)a=++l*this.parent.getRowHeight();t+=(s-(l-=1))*this.parent.getRowHeight()}if("up"===e.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse)t=this.refreshInfiniteCacheRowVisibleLength(this.infiniteCache,this.parent.pageSettings.currentPage)*this.parent.getRowHeight();else if(this.isInitialCollapse){var h=this.infiniteCache[this.parent.pageSettings.currentPage],d=0;for(l=0;l<h.length;l++)h[parseInt(l.toString(),10)].isCaptionRow&&d++;t+=Math.round(d/this.parent.groupSettings.columns.length)*this.parent.getRowHeight()}else t+=this.parent.pageSettings.pageSize*this.parent.getRowHeight()+ol();return t},e.prototype.captionRowHeight=function(){return[].slice.call(this.parent.getContent().querySelectorAll("tr:not(.e-row)")).length*this.parent.getRowHeight()},e.prototype.removeTopRows=function(e,t){for(var i=0;i<=t;i++)this.parent.frozenRows&&this.parent.pageSettings.currentPage===this.parent.infiniteScrollSettings.maxBlocks+1&&i>t-this.parent.frozenRows||(0,o.remove)(e[parseInt(i.toString(),10)])},e.prototype.removeBottomRows=function(e,t,i){var n=0,r=this.parent.pageSettings.pageSize;this.infiniteCache[i.prevPage].length<r&&(n=this.parent.pageSettings.pageSize-this.infiniteCache[i.prevPage].length);for(var s=t;n<r;s--)n++,(0,o.remove)(e[parseInt(s.toString(),10)])},e.prototype.removeCaptionRows=function(e,t){var i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n=i?this.getGridRows().filter(function(e){return e.classList.contains(us)}):[].slice.call(this.parent.getContent().getElementsByClassName(us));if("down"===t.direction)for(var r=Ph(n[this.parent.pageSettings.pageSize-1])-1,s=0,a=0;s<r;a++)e[parseInt(a.toString(),10)].classList.contains(us)?s=Ph(e[parseInt(a.toString(),10)]):(0,o.remove)(e[parseInt(a.toString(),10)]);if("up"===t.direction){var l=Ph(n[n.length-1]),h=Math.ceil(l/this.parent.pageSettings.pageSize),d=0;for(a=this.parent.pageSettings.currentPage+1;a<h;a++)d+=i?this.infiniteCache[parseInt(a.toString(),10)].filter(function(e){return!e.isDetailRow}).length:this.infiniteCache[parseInt(a.toString(),10)].length;for(a=d;a<e.length;a++)(0,o.remove)(e[parseInt(a.toString(),10)])}},e.prototype.getGridRows=function(){return[].slice.call(this.parent.getContentTable().rows)},e.prototype.resetInfiniteBlocks=function(e,t){var i=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==e.requestType;if(!this.initialRender&&!(0,o.isNullOrUndefined)(this.parent.infiniteScrollModule)&&i&&(this.actions.some(function(t){return t===e.requestType})||t||"save"===e.requestType&&(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key))){var n=this.parent.getContent().firstElementChild;this.parent.notify(Yr,{}),this.initialRender=!0,n.scrollTop=0,this.parent.pageSettings.currentPage=1,this.infiniteCache={},this.infiniteCurrentViewData={},this.resetContentModuleCache({}),this.isRemove=!1,this.top=0,this.isInitialCollapse=!1,this.parent.contentModule.isRemove=this.isRemove,this.parent.contentModule.isAddRows=this.isRemove,this.parent.contentModule.visibleRows=[],this.parent.contentModule.visibleFrozenRows=[]}},e.prototype.setCache=function(e){if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){var t=this.parent,i=(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType),n="infiniteScroll"!==e.args.requestType&&("delete"===this.requestType||"add"===this.requestType),r=this.parent.pageSettings.currentPage;Object.keys(this.infiniteCache).length&&!n||(i&&(this.infiniteCache={}),this.setInitialCache(e.modelData,e.args,n)),(0,o.isNullOrUndefined)(this.infiniteCache[this.parent.pageSettings.currentPage])&&!i&&(this.infiniteCache[this.parent.pageSettings.currentPage]=e.modelData,this.resetContentModuleCache(this.infiniteCache)),e.isInfiniteScroll&&!this.isRemove&&(this.isRemove=(r-1)%this.parent.infiniteScrollSettings.maxBlocks==0,this.parent.contentModule.isRemove=this.isRemove)}},e.prototype.setInitialCache=function(e,t,i,n){for(var r=i?(0,o.isNullOrUndefined)(this.firstBlock)?1:this.firstBlock:1,s=1;s<=this.parent.infiniteScrollSettings.initialBlocks;s++){var a=(s-1)*this.parent.pageSettings.pageSize,l=s*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!n?this.setInitialGroupCache(e,r,a,l):n?this.infiniteCurrentViewData[parseInt(r.toString(),10)]=e.slice(a,l):(this.infiniteCache[parseInt(r.toString(),10)]=e.slice(a,l),this.resetContentModuleCache(this.infiniteCache)),r++}},e.prototype.setInitialGroupCache=function(e,t,i,n){for(var r=[],s=0,o=1;o<=Object.keys(this.infiniteCache).length;o++)s+=this.infiniteCache[parseInt(o.toString(),10)].length;var a=i;for(o=s;o<e.length&&a<n&&((e[parseInt(o.toString(),10)].index<n||e[parseInt(o.toString(),10)].isCaptionRow)&&(a=e[parseInt(o.toString(),10)].isCaptionRow?a:e[parseInt(o.toString(),10)].index,r.push(e[parseInt(o.toString(),10)])),!(e[parseInt(o.toString(),10)].index>=n||e[parseInt(o.toString(),10)].index===n-1));o++);this.infiniteCache[parseInt(t.toString(),10)]=r,this.resetContentModuleCache(this.infiniteCache)},e.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},e.prototype.resetInfiniteCache=function(e){var t=Object.keys(this.infiniteCache).length;this.infiniteCache={};for(var i=1;i<=t;i++){var n=(i-1)*this.parent.pageSettings.pageSize,r=i*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.setInitialGroupCache(e,i,n,r):(this.infiniteCache[parseInt(i.toString(),10)]=e.slice(n,r),this.resetContentModuleCache(this.infiniteCache))}},e.prototype.destroy=function(){this.removeEventListener()},e}(),Ap=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fp=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.childCount=0,n.scrollData=[],n.isFirstChildRow=!1,n.isScrollDown=!1,n.isScrollUp=!1,n.groupCache={},n.cacheRowsObj={},n.startIndexes={},n.captionCounts={},n.rowsByUid={},n.objIdxByUid={},n.initialGroupCaptions={},n.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete","filterBeforeOpen","filterchoicerequest","infiniteScroll","virtualscroll","columnVisibilityUpdate"],n.scrollTopCache=void 0,n.refRowsObj={},n.cacheMode=!1,n.cacheBlockSize=5,n.ignoreAccent=!!n.parent.allowFiltering&&n.parent.filterSettings.ignoreAccent,n.allowCaseSensitive=!0,n.lazyLoadQuery=[],n.startIndex=0,n.locator=i,n.groupGenerator=new Xs(n.parent),n.summaryModelGen=new Ks(n.parent),n.captionModelGen=new Ws(n.parent),n.rowRenderer=new js(n.locator,null,n.parent),n.eventListener(),n}return Ap(t,e),t.prototype.eventListener=function(){this.parent.addEventListener(R,this.actionBegin.bind(this)),this.parent.addEventListener(D,this.actionComplete.bind(this)),this.parent.on(Le,this.setLazyLoadPageSize,this),this.parent.on(Nn,this.setCache,this),this.parent.on(Bn,this.scrollHandler,this),this.parent.on(wt,this.setVisible,this),this.parent.on(zn,this.collapseShortcut,this)},t.prototype.captionExpand=function(e){var t=this,i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],r=e.getAttribute("data-uid");this.refreshCaches(),this.scrollTopCache&&!(this.parent.scrollModule.content.scrollTop>this.scrollTopCache)||this.parent.enableVirtualization||(this.scrollTopCache=this.parent.scrollModule.content.scrollTop);var s=this.getRowObjectIndexByUid(r),o=!!n[s+1]&&n[parseInt(s.toString(),10)].indent<n[s+1].indent;this.parent.enableVirtualization&&(o=!!this.cacheRowsObj[""+r]);for(var a=n[parseInt(s.toString(),10)],l=qh(s,n),h=0;h<l.fields.length;h++){var d=this.parent.getColumnByField(l.fields[parseInt(h.toString(),10)]);d.enableGroupByFormat&&(l.keys[parseInt(h.toString(),10)]=this.locator.getService("valueFormatter").fromView(l.keys[parseInt(h.toString(),10)],d.getParser(),"dateonly"===d.type?"date":d.type))}var p={captionRowElement:e,groupInfo:a,enableCaching:!0,cancel:!1};this.parent.trigger(Ae,p,function(n){n.cancel||(n.keys=l.keys,n.fields=l.fields,n.rowIndex=e.rowIndex,n.makeRequest=!n.enableCaching||!o,!n.enableCaching&&o&&t.clearCache([r]),n.skip=0,n.take=t.pageSize,a.isExpand=!0,t.rowsByUid[parseInt(i.toString(),10)][a.uid]&&(t.rowsByUid[parseInt(i.toString(),10)][a.uid].isExpand=!0),t.captionRowExpand(n))})},t.prototype.captionCollapse=function(e){var t=this,i=this.groupCache[this.parent.pageSettings.currentPage],n=e.rowIndex,r=e.getAttribute("data-uid");this.refreshCaches();var s=this.getRowObjectIndexByUid(r),a={captionRowElement:e,groupInfo:i[parseInt(s.toString(),10)],cancel:!1};this.parent.trigger(Fe,a,function(e){if(!e.cancel){e.isExpand=!1;for(var i=0;i<t.lazyLoadQuery.length;i++){var a=t.lazyLoadQuery[parseInt(i.toString(),10)][0];e.groupInfo.data.key===a.value&&t.lazyLoadQuery.splice(i,1)}if(t.removeRows(s,n,r),t.parent.isRemote()){var l=t.parent.getHeaderContent().querySelector(".e-checkselectall");l&&(0===t.getAllPagesData().length&&t.parent.selectionModule&&!t.parent.selectionModule.selectedRowIndexes.length?l.parentElement.classList.add("e-checkbox-disabled"):l.parentElement.classList.remove("e-checkbox-disabled"))}(t.parent.enableInfiniteScrolling||t.parent.enableVirtualization)&&(t.groupCache[t.parent.pageSettings.currentPage]=(0,o.extend)([],t.refRowsObj[t.parent.pageSettings.currentPage]),t.refreshRowObjects([],s))}})},t.prototype.setLazyLoadPageSize=function(){var e=this.parent.getContent().firstElementChild,t=Math.floor(e.offsetHeight/this.parent.getRowHeight())-1;this.pageSize=this.pageSize?this.pageSize:3*t,this.blockSize=Math.ceil(this.pageSize/2)},t.prototype.clearLazyGroupCache=function(){this.clearCache()},t.prototype.clearCache=function(e){e=e||this.getInitialCaptionIndexes();var t=this.groupCache[this.parent.pageSettings.currentPage];if(e.length)for(var i=0;i<e.length;i++){var n=this.getRowObjectIndexByUid(e[parseInt(i.toString(),10)]),r=t[parseInt(n.toString(),10)];if(r){if(this.captionCounts[this.parent.pageSettings.currentPage][r.uid])for(var s=n+1;s<t.length;s++){if(t[parseInt(s.toString(),10)].indent===r.indent||t[parseInt(s.toString(),10)].indent<r.indent){delete this.captionCounts[this.parent.pageSettings.currentPage][r.uid];break}t[parseInt(s.toString(),10)].isCaptionRow&&delete this.captionCounts[this.parent.pageSettings.currentPage][t[parseInt(s.toString(),10)].uid]}if(r.isExpand){var o=this.parent.getRowElementByUID(r.uid);if(!o)return;this.parent.groupModule.expandCollapseRows(o.querySelector(".e-recordplusexpand"))}var a=this.getNextChilds(n);if(a.length){var l=[];a[a.length-1].isCaptionRow&&(l=this.getChildRowsByParentIndex(t.indexOf(a[a.length-1]),!1,!1,null,!0,!0));var h=t.indexOf(a[0]),d=l.length?t.indexOf(l[l.length-1]):t.indexOf(a[a.length-1]);t.splice(h,d-(h-1)),this.refreshCaches()}}}},t.prototype.refreshCaches=function(){var e=this.parent.pageSettings.currentPage,t=this.groupCache[parseInt(e.toString(),10)];this.parent.enableInfiniteScrolling?(this.rowsByUid[parseInt(e.toString(),10)]=[],this.objIdxByUid[parseInt(e.toString(),10)]=[]):(this.rowsByUid={},this.objIdxByUid={});for(var i=0;i<t.length;i++)this.maintainRows(t[parseInt(i.toString(),10)],i)},t.prototype.getInitialCaptionIndexes=function(){for(var e=this.parent.pageSettings.currentPage,t=[],i=0;i<this.initialGroupCaptions[parseInt(e.toString(),10)].length;i++)t.push(this.initialGroupCaptions[parseInt(e.toString(),10)][parseInt(i.toString(),10)].uid);return t},t.prototype.getRowObjectIndexByUid=function(e){return this.objIdxByUid[this.parent.pageSettings.currentPage][""+e]},t.prototype.collapseShortcut=function(e){if(this.parent.groupSettings.columns.length&&e.target&&_a(e.target,ps)&&"TR"===e.target.parentElement.tagName){if(!e.collapse&&_a(e.target,us))return;var t=e.target.parentElement.getAttribute("data-uid");if(e.collapse){var i=this.getRowByUid(t);if((r=this.getRowByUid(i.parentUid)).isCaptionRow&&r.isExpand){var n=this.getRowElementByUid(i.parentUid);this.parent.groupModule.expandCollapseRows(n.cells[i.indent-1])}}else{var r;if((r=this.getRowByUid(t)).isCaptionRow&&!r.isExpand){n=this.getRowElementByUid(t);this.parent.groupModule.expandCollapseRows(n.cells[r.indent])}}}},t.prototype.getRowByUid=function(e){return this.rowsByUid[this.parent.pageSettings.currentPage][""+e]},t.prototype.actionBegin=function(e){if(!e.cancel){if(this.requestType.some(function(t){return t===e.requestType})||(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization&&(this.parent.contentModule.currentInfo={})),"reorder"===e.requestType&&this.parent.groupSettings.columns.length)for(var t=Object.keys(this.groupCache),i=0;i<t.length;i++)for(var n=this.groupCache[t[parseInt(i.toString(),10)]],r=0;r<n.length;r++)if(n[parseInt(r.toString(),10)].isCaptionRow&&!this.captionModelGen.isEmpty()&&this.changeCaptionRow(n[parseInt(r.toString(),10)],null,t[parseInt(i.toString(),10)]),n[parseInt(r.toString(),10)].isDataRow){var s=e.fromIndex+n[parseInt(r.toString(),10)].indent,o=e.toIndex+n[parseInt(r.toString(),10)].indent;this.moveCells(n[parseInt(r.toString(),10)].cells,s,o)}("delete"===e.requestType||"add"===e.action&&"save"===e.requestType)&&(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization&&(this.parent.contentModule.currentInfo={}))}},t.prototype.actionComplete=function(e){!e.cancel&&-1===["columnstate","reorder","save","beginEdit","delete","infiniteScroll","columnVisibilityUpdate","columnChooserClose","filterchoicerequest","filterAfterOpen"].indexOf(e.requestType)&&this.parent.groupSettings.columns.length&&this.scrollReset()},t.prototype.resetRowMaintenance=function(){this.startIndexes={},this.captionCounts={},this.rowsByUid={},this.objIdxByUid={},this.initialGroupCaptions={}},t.prototype.moveCells=function(e,t,i){if(t>=e.length)for(var n=t-e.length;1+n--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},t.prototype.removeRows=function(e,t,i){var n,r=this.parent.pageSettings.currentPage,s=this.groupCache[parseInt(r.toString(),10)],a=[].slice.call(this.parent.getContent().querySelectorAll("tr")),l=0;if(this.parent.aggregates.length){var h=this.getAggregateByCaptionIndex(e);n=h.length?h[h.length-1].uid:void 0}var d,p=s[parseInt(e.toString(),10)].indent;this.addClass(this.getNextChilds(parseInt(e.toString(),10))),s[parseInt(e.toString(),10)].isExpand=!1,this.rowsByUid[parseInt(r.toString(),10)][s[parseInt(e.toString(),10)].uid]&&(this.rowsByUid[parseInt(r.toString(),10)][s[parseInt(e.toString(),10)].uid].isExpand=!1);for(var c=e+1;c<s.length;c++){if(s[parseInt(c.toString(),10)].indent===p||s[parseInt(c.toString(),10)].indent<p){d=s[parseInt(c.toString(),10)].uid;break}s[parseInt(c.toString(),10)].isCaptionRow&&s[parseInt(c.toString(),10)].isExpand&&this.addClass(this.getNextChilds(c))}for(c=t+1;c<a.length&&a[parseInt(c.toString(),10)].getAttribute("data-uid")!==d;c++){if(a[parseInt(c.toString(),10)].getAttribute("data-uid")===n){(0,o.remove)(a[parseInt(c.toString(),10)]);break}(0,o.remove)(a[parseInt(c.toString(),10)]),this.refRowsObj[parseInt(r.toString(),10)].splice(t+1,1),l+=1}this.cacheRowsObj[""+i]=this.groupCache[parseInt(r.toString(),10)].slice(e+1,e+1+l),this.groupCache[parseInt(r.toString(),10)].splice(e+1,l),this.parent.enableVirtualization&&(this.parent.notify(Nr,{rows:[],uid:s[parseInt(e.toString(),10)].uid,count:l}),this.parent.contentModule.setVirtualHeight(),this.parent.islazyloadRequest=!1),this.parent.scrollModule.content.scrollTop>this.scrollTopCache&&!this.parent.enableVirtualization&&(this.parent.scrollModule.content.scrollTop=this.scrollTopCache),this.parent.getContentTable().scrollHeight<this.parent.getContent().clientHeight&&"auto"!==this.parent.height&&this.parent.scrollModule.setLastRowCell(),this.parent.notify(dr,{rows:this.refRowsObj[parseInt(r.toString(),10)]})},t.prototype.addClass=function(e){var t=e[this.blockSize];t&&(t.lazyLoadCssClass="e-lazyload-middle-down")},t.prototype.getNextChilds=function(e,t){for(var i=this.groupCache[this.parent.pageSettings.currentPage],n=t||i,r=i[parseInt(e.toString(),10)].indent+1,s=[],o=t?0:e+1;o<n.length&&!(n[parseInt(o.toString(),10)].indent<r);o++)n[parseInt(o.toString(),10)].indent===r&&s.push(n[parseInt(o.toString(),10)]);return s},t.prototype.lazyLoadHandler=function(e){this.setStartIndexes();var t=this.parent.getContent().querySelectorAll("tr")[e.index],i=t.getAttribute("data-uid"),n=this.getRowObjectIndexByUid(i),r=this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],s=e.isRowExist?e.isScroll?this.scrollData:this.parent.enableVirtualization?this.cacheRowsObj[""+i]:this.getChildRowsByParentIndex(n,!0,!0,null,!0):[];if(this.scrollData=[],!e.isRowExist)if(this.setRowIndexes(n,r),this.refreshCaptionRowCount(this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],e.count),-1!==Object.keys(e.data).indexOf("GroupGuid"))for(var o=0;o<e.data.length;o++){var a=this.groupGenerator.generateCaptionRow(e.data[parseInt(o.toString(),10)],e.level,r.parentGid,void 0,0,r.uid);s.push(a),this.parent.aggregates.length&&(s=s.concat(this.summaryModelGen.generateRows(e.data[parseInt(o.toString(),10)],{level:e.level+1,parentUid:a.uid})))}else this.groupGenerator.index=this.parent.allowPaging?this.getStartIndex(n,e.isScroll):e.isScroll?this.startIndex:r.data.startIndex,s=this.groupGenerator.generateDataRows(e.data,e.level,r.parentGid,0,r.uid);var l=e.isScroll?this.rowIndex:e.index,h=this.getNextChilds(n,s),d=!!e.up||this.hasLastChildRow(e.isScroll,e.count,h.length);e.isRowExist||d||(h[this.blockSize].lazyLoadCssClass="e-lazyload-middle-down"),d||(h[h.length-1].lazyLoadCssClass="e-not-lazyload-end");var p=e.isScroll||e.isRowExist?[]:this.getAggregateByCaptionIndex(n);if(e.up||(!e.isRowExist||this.parent.enableVirtualization&&e.isRowExist&&this.cacheRowsObj[""+i])&&this.refreshRowObjects(s,e.isScroll?this.rowObjectIndex:n),this.parent.enableVirtualization){var c=e.isScroll?this.groupCache[this.parent.pageSettings.currentPage][this.rowIndex].uid:r.uid;this.parent.notify(Nr,{rows:s,uid:c}),this.parent.contentModule.setVirtualHeight(),this.parent.contentModule.isTop=!1}this.render(l,s,d,p),this.isFirstChildRow&&!e.up&&(this.parent.getContent().firstElementChild.scrollTop=s.length*this.parent.getRowHeight()),this.isFirstChildRow=!1,this.rowIndex=void 0,this.rowObjectIndex=void 0,this.childCount=0;for(o=0;o<s.length;o++){this.refRowsObj[this.parent.pageSettings.currentPage].splice(n+o+1,0,s[parseInt(o.toString(),10)]);var u=s[parseInt(o.toString(),10)];u.isSelected&&(this.parent.selectionModule.selectedRecords.push(this.getRowByIndex(u.index)),this.parent.allowPaging&&this.parent.selectionModule.selectedRowIndexes.push(u.index))}d&&t.querySelector(".e-lastrowcell")&&this.parent.groupModule.lastCaptionRowBorder(),this.parent.notify(dr,{rows:this.refRowsObj[this.parent.pageSettings.currentPage]}),this.parent.enableVirtualMaskRow&&this.parent.removeMaskRow()},t.prototype.setRowIndexes=function(e,t){this.captionCounts[this.parent.pageSettings.currentPage]||(this.captionCounts[this.parent.pageSettings.currentPage]={}),t.isCaptionRow&&(this.captionCounts[this.parent.pageSettings.currentPage][t.uid]=t.data.count)},t.prototype.getStartIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(t)return n[this.rowObjectIndex].index+1;var r=0,s=0,o=this.getRowByUid(n[parseInt(e.toString(),10)].parentUid);if(o&&(s=this.prevCaptionCount(o)),n[parseInt(e.toString(),10)].indent>0)for(var a=e-1;a>=0&&!(n[parseInt(a.toString(),10)].indent<n[parseInt(e.toString(),10)].indent);a--)n[parseInt(a.toString(),10)].isCaptionRow&&n[parseInt(a.toString(),10)].indent===n[parseInt(e.toString(),10)].indent&&(r+=n[parseInt(a.toString(),10)].data.count);return r+s+this.startIndexes[parseInt(i.toString(),10)][n[parseInt(e.toString(),10)].parentGid]},t.prototype.prevCaptionCount=function(e){for(var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=0,r=i.indexOf(e)-1;r>=0&&0!==i[parseInt(r.toString(),10)].indent&&!(i[parseInt(r.toString(),10)].indent<e.indent);r--)if(i[parseInt(r.toString(),10)].isCaptionRow&&i[parseInt(r.toString(),10)].indent===e.indent){var s=this.captionCounts[parseInt(t.toString(),10)][i[parseInt(r.toString(),10)].uid];n+=s||i[parseInt(r.toString(),10)].data.count}var o=this.getRowByUid(e.parentUid);return o&&(n+=this.prevCaptionCount(o)),n},t.prototype.setStartIndexes=function(){var e=this.groupCache[this.parent.pageSettings.currentPage];if(!this.startIndexes[this.parent.pageSettings.currentPage]){for(var t=[],i=void 0,n=0;n<e.length;n++)e[parseInt(n.toString(),10)].isCaptionRow&&(t.length?t.push(e[parseInt(i.toString(),10)].data.count+t[t.length-1]):t.push(0),i=n);this.startIndexes[this.parent.pageSettings.currentPage]=t}},t.prototype.hasLastChildRow=function(e,t,i){return e?t===this.childCount+i:t===i},t.prototype.refreshCaptionRowCount=function(e,t){e.data.count=t},t.prototype.render=function(e,t,i,n){var r=this.parent.getContent().querySelectorAll("tr")[parseInt(e.toString(),10)],s=this.parent.getContent().firstElementChild,o=this.parent.getRowHeight();if(r&&n.length)for(var a=n.length-1;a>=0;a--)r.insertAdjacentElement("afterend",this.rowRenderer.render(n[parseInt(a.toString(),10)],this.parent.getColumns()));if(r&&t.length){var l=this.parent.getHeaderContent().querySelector(".e-checkselectall");for(a=t.length-1;a>=0;a--)this.confirmRowRendering(t[parseInt(a.toString(),10)])&&(r.insertAdjacentElement("afterend",this.rowRenderer.render(t[parseInt(a.toString(),10)],this.parent.getColumns())),this.isScrollDown&&(s.scrollTop=s.scrollTop-o),this.isScrollUp&&(s.scrollTop=s.scrollTop+o));this.parent.isRemote()&&this.parent.isCheckBoxSelection&&l&&l.nextElementSibling&&(l.nextElementSibling.classList.contains("e-check")||l.nextElementSibling.classList.contains("e-stop"))&&this.parent.selectionModule.onDataBound()}this.isScrollDown=!1,this.isScrollUp=!1},t.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[parseInt(i.toString(),10)]||(this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={}),e.uid&&(this.rowsByUid[parseInt(i.toString(),10)][e.uid]=e),this.objIdxByUid[parseInt(i.toString(),10)][e.uid]=t},t.prototype.confirmRowRendering=function(e){var t=!0;if((0,o.isNullOrUndefined)(e.indent)&&!e.isDataRow&&!e.isCaptionRow){var i=this.getRowByUid(e.parentUid);i.isCaptionRow&&!i.isExpand&&(t=!1)}return t},t.prototype.refreshRowObjects=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={};for(var r=[],s=0,a=0;a<n.length;a++)if(a===t){this.maintainRows(n[parseInt(a.toString(),10)],s),r.push(n[parseInt(a.toString(),10)]),s++;for(var l=0;l<e.length;l++)this.maintainRows(e[parseInt(l.toString(),10)],s),r.push(e[parseInt(l.toString(),10)]),s++}else this.maintainRows(n[parseInt(a.toString(),10)],s),r.push(n[parseInt(a.toString(),10)]),s++;this.groupCache[this.parent.pageSettings.currentPage]=(0,o.extend)([],r),this.updateCurrentViewData()},t.prototype.getAggregateByCaptionIndex=function(e){for(var t=this.groupCache[this.parent.pageSettings.currentPage],i=t[parseInt(e.toString(),10)],n=i.indent,r=i.uid,s=[],a=e+1;a<t.length&&t[parseInt(a.toString(),10)].indent!==n;a++)(0,o.isNullOrUndefined)(t[parseInt(a.toString(),10)].indent)&&t[parseInt(a.toString(),10)].parentUid===r&&s.push(t[parseInt(a.toString(),10)]);return s},t.prototype.getChildRowsByParentIndex=function(e,t,i,n,r,s){var a=n||this.groupCache[this.parent.pageSettings.currentPage],l=a[parseInt(e.toString(),10)],h=[];if(!l.isCaptionRow||l.isCaptionRow&&!l.isExpand&&!s)return[];r&&this.parent.aggregates.length&&(h=this.getAggregateByCaptionIndex(e));for(var d=l.indent,p=l.uid,c=[],u=0,g=e+1;g<a.length;g++){if(a[parseInt(g.toString(),10)].parentUid===p){if((0,o.isNullOrUndefined)(a[parseInt(g.toString(),10)].indent))continue;if(u++,c.push(a[parseInt(g.toString(),10)]),t&&a[parseInt(g.toString(),10)].isCaptionRow&&(c=c.concat(this.getChildRowsByParentIndex(g,t,i,n,r))),i&&u===this.pageSize)break}if(a[parseInt(g.toString(),10)].indent===d)break}return c.concat(h)},t.prototype.initialGroupRows=function(e){var t=[],i=this.groupCache[this.parent.pageSettings.currentPage];if(e)return this.getRenderedRowsObject();for(var n=0;n<i.length;n++)0===i[parseInt(n.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),t=t.concat(this.getChildRowsByParentIndex(n,!0,!0,i,!0)));return t},t.prototype.getRenderedRowsObject=function(){for(var e=[],t=[].slice.call(this.parent.getContent().querySelectorAll("tr")),i=0;i<t.length;i++)e.push(this.getRowByUid(t[parseInt(i.toString(),10)].getAttribute("data-uid")));return e},t.prototype.getCacheRowsOnDownScroll=function(e){for(var t=[],i=this.groupCache[this.parent.pageSettings.currentPage],n=e,r=0;r<this.pageSize&&(i[parseInt(n.toString(),10)]&&!(i[parseInt(n.toString(),10)].indent<i[parseInt(e.toString(),10)].indent));r++)i[parseInt(n.toString(),10)].indent===i[parseInt(e.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),i[parseInt(n.toString(),10)].isCaptionRow&&i[parseInt(n.toString(),10)].isExpand&&(t=t.concat(this.getChildRowsByParentIndex(n,!0,!0,null,!0)))),(i[parseInt(n.toString(),10)].indent>i[parseInt(e.toString(),10)].indent||(0,o.isNullOrUndefined)(i[parseInt(n.toString(),10)].indent))&&r--,n++;return t},t.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var n=[],r=this.groupCache[this.parent.pageSettings.currentPage],s=!1,o=0;o<r.length&&(!s||r[parseInt(o.toString(),10)]&&!(r[parseInt(o.toString(),10)].indent<r[parseInt(i.toString(),10)].indent)&&r[parseInt(o.toString(),10)].uid!==t);o++)s||r[parseInt(o.toString(),10)].uid!==e||(s=!0),s&&r[parseInt(o.toString(),10)].indent===r[parseInt(i.toString(),10)].indent&&(n.push(r[parseInt(o.toString(),10)]),r[parseInt(o.toString(),10)].isCaptionRow&&r[parseInt(o.toString(),10)].isExpand&&(n=n.concat(this.getChildRowsByParentIndex(o,!0,!0,null,!0))));return n},t.prototype.scrollHandler=function(e){if(!this.parent.isDestroyed&&!this.childCount){var t,i,n=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-down")),r=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-up")),s=[].slice.call(this.parent.getContent().getElementsByClassName("e-not-lazyload-end")),o=!1,a=!1,l=!1;if(e.scrollDown&&n.length)t=(i=this.findRowElements(n)).tr,o=i.entered;if(!e.scrollDown&&s)for(var h=0;h<s.length;h++){var d=s[parseInt(h.toString(),10)].getBoundingClientRect().top,p=this.parent.getContent().scrollHeight;if(d>0&&d<p){t=s[parseInt(h.toString(),10)],l=!0,this.rowIndex=t.rowIndex;break}}if(!e.scrollDown&&r.length&&!l)t=(i=this.findRowElements(r)).tr,a=i.entered;t&&!t.classList.contains("e-masked-row")&&(o&&e.scrollDown&&o&&t&&this.scrollDownHandler(t),!e.scrollDown&&l&&t&&this.scrollUpEndRowHandler(t),this.cacheMode&&!e.scrollDown&&!l&&a&&t&&this.scrollUpHandler(t))}},t.prototype.scrollUpEndRowHandler=function(e){var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=e.getAttribute("data-uid"),r=this.rowObjectIndex=this.getRowObjectIndexByUid(n),s=r,o=i[parseInt(r.toString(),10)],a=this.getRowByUid(o.parentUid),l=this.getRowObjectIndexByUid(a.uid),h=this.parent.getContent().querySelector("tr[data-uid="+a.uid+"]").rowIndex,d=this.getChildRowsByParentIndex(l).indexOf(o),p=Math.ceil(d/this.pageSize);if(1!==p)if(this.childCount=p*this.pageSize,r=this.getCurrentBlockEndIndex(o,r),this.childCount<a.data.count){e.classList.remove("e-not-lazyload-end"),o.lazyLoadCssClass="";var c=!!i[r+1]&&o.indent===i[r+1].indent;this.scrollData=c?this.getCacheRowsOnDownScroll(r+1):[];var u=qh(l,i),g={rowIndex:h,makeRequest:!c,groupInfo:a,fields:u.fields,keys:u.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount>=this.pageSize*this.cacheBlockSize){var f=this.getChildRowsByParentIndex(l),m=Math.ceil(f.indexOf(i[parseInt(s.toString(),10)])/this.pageSize)-(this.cacheBlockSize-1);this.removeBlock(n,c,m,f),g.cachedRowIndex=m*this.pageSize}this.captionRowExpand(g)}else this.childCount=0},t.prototype.scrollDownHandler=function(e){var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=e.getAttribute("data-uid"),r=this.getRowObjectIndexByUid(n),s=r,a=i[parseInt(r.toString(),10)],l=this.getRowByUid(a.parentUid),h=this.getRowObjectIndexByUid(l.uid),d=this.getRowElementByUid(l.uid).rowIndex,p=this.getChildRowsByParentIndex(h);if(0!==p.length){var c=p.indexOf(a),u=Math.ceil(c/this.pageSize);if(this.childCount=u*this.pageSize,!(0,o.isNullOrUndefined)(p[this.childCount-1])){this.parent.enableVirtualization&&(this.parent.islazyloadRequest=!0),r=this.rowObjectIndex=this.getRowObjectIndexByUid(p[this.childCount-1].uid);var g=i[parseInt(r.toString(),10)],f=this.getRowElementByUid(g.uid);if(this.rowIndex=f.rowIndex,r=this.getCurrentBlockEndIndex(g,r),this.childCount===l.data.count&&(this.parent.islazyloadRequest=!1),this.childCount<l.data.count){var m=!!i[r+1]&&a.indent===i[r+1].indent;if(m&&!(0,o.isNullOrUndefined)(this.getRowElementByUid(i[r+1].uid)))return this.parent.islazyloadRequest=!1,void(this.childCount=0);(u>1||!this.cacheMode)&&(e.classList.remove("e-lazyload-middle-down"),f.classList.remove("e-not-lazyload-end"),g.lazyLoadCssClass=""),this.scrollData=m?this.getCacheRowsOnDownScroll(this.rowObjectIndex+1):[];var y=qh(h,i),v={rowIndex:d,makeRequest:!m,groupInfo:l,fields:y.fields,keys:y.keys,skip:this.childCount,take:this.pageSize,isScroll:!0};if(this.cacheMode&&this.childCount-this.pageSize>=this.pageSize*this.cacheBlockSize){this.isScrollDown=!0;var S=this.getChildRowsByParentIndex(h),C=Math.ceil(S.indexOf(i[parseInt(s.toString(),10)])/this.pageSize)-1-(this.cacheBlockSize-1)+1;this.removeBlock(n,m,C,S,g),v.cachedRowIndex=C*this.pageSize}this.captionRowExpand(v)}else this.childCount=0,this.parent.islazyloadRequest=!1}}},t.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(e.isCaptionRow){if(e.isExpand){var r=this.getChildRowsByParentIndex(t,!0).length;this.rowIndex=this.rowIndex+r}var s=this.getAggregateByCaptionIndex(t);this.rowObjectIndex=this.rowObjectIndex+s.length;for(var o=t,a=o+1;a<n.length;a++){if(n[parseInt(a.toString(),10)].indent===n[parseInt(t.toString(),10)].indent||n[parseInt(a.toString(),10)].indent<n[parseInt(t.toString(),10)].indent){t=o;break}o++}}return t},t.prototype.removeBlock=function(e,t,i,n,r){var s=this.parent.pageSettings.currentPage,o=this.groupCache[parseInt(s.toString(),10)],a=n[(i+1)*this.pageSize-1-this.blockSize].uid,l=n[i*this.pageSize-this.pageSize].uid,h=n[i*this.pageSize].uid,d=this.getRowObjectIndexByUid(a);o[parseInt(d.toString(),10)].lazyLoadCssClass="e-lazyload-middle-up",this.getRowElementByUid(a).classList.add("e-lazyload-middle-up"),r&&(this.getRowElementByUid(h).classList.add("e-not-lazyload-first"),this.getRowByUid(h).lazyLoadCssClass="e-not-lazyload-first",this.getRowByUid(l).lazyLoadCssClass=""),t?this.removeTopRows(r?r.uid:e,l,h):(this.uid1=l,this.uid2=h,this.uid3=r?r.uid:e)},t.prototype.scrollUpHandler=function(e){var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=e.getAttribute("data-uid"),r=this.getRowByUid(n),s=this.rowObjectIndex=this.getRowObjectIndexByUid(n),a=this.getRowByUid(r.parentUid),l=this.rowIndex=this.getRowObjectIndexByUid(a.uid),h=this.parent.getRowElementByUID(a.uid).rowIndex,d=this.getChildRowsByParentIndex(l),p=d.indexOf(i[parseInt(s.toString(),10)]),c=Math.floor(p/this.pageSize),u=this.blockSize;2*this.blockSize>this.pageSize&&(u=2*this.blockSize-this.pageSize,u=this.blockSize-u);var g=d[p-(u-1)-this.pageSize].uid,f=d[p-(u-1)].uid;this.scrollData=this.getCacheRowsOnUpScroll(g,f,s-(u-1)),this.isFirstChildRow=c>1,this.isFirstChildRow&&(this.scrollData[0].lazyLoadCssClass="e-not-lazyload-first"),this.getRowByUid(f).lazyLoadCssClass="",this.getRowElementByUid(f).classList.remove("e-not-lazyload-first");var m=c+this.cacheBlockSize;if(d.length!==a.data.count&&m*this.pageSize>d.length)return this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",void this.getRowElementByUid(f).classList.add("e-not-lazyload-first");var y=m*this.pageSize>a.data.count?a.data.count:m*this.pageSize,v=m*this.pageSize>a.data.count?this.pageSize-(this.pageSize*m-a.data.count):this.pageSize,S=this.getChildRowsByParentIndex(i.indexOf(d[y-1]),!0,!1,null,!0),C=S.length?S[S.length-1].uid:d[y-1].uid,w=d[y-v].uid,b=d[y-v-1].uid,I=this.objIdxByUid[parseInt(t.toString(),10)][""+w]-u;if("e-lazyload-middle-down"===i[parseInt(I.toString(),10)].lazyLoadCssClass){var x=this.getRowElementByUid(i[parseInt(I.toString(),10)].uid);x&&x.classList.add("e-lazyload-middle-down")}if(this.getRowByUid(C).lazyLoadCssClass="",this.getRowByUid(b).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(b).classList.add("e-not-lazyload-end"),this.removeBottomRows(C,w,b),this.rowIndex=e.rowIndex-u,e.classList.length>1?e.classList.remove("e-lazyload-middle-up"):e.removeAttribute("class"),!(0,o.isNullOrUndefined)(this.getRowElementByUid(g)))return this.childCount=0,void(this.scrollData=[]);var R=qh(this.getRowObjectIndexByUid(a.uid),i),D={rowIndex:h,makeRequest:!1,groupInfo:a,fields:R.fields,keys:R.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0};this.isScrollUp=!0,this.captionRowExpand(D)},t.prototype.findRowElements=function(e){for(var t,i=!1,n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)].rowIndex;if(this.parent.enableVirtualization){var s=this.parent.contentModule.currentInfo;s&&s.blockIndexes&&s.blockIndexes[0]>1&&(r+=this.parent.contentModule.offsets[s.blockIndexes[0]-1]/this.parent.getRowHeight())}if(Yl(r,this.parent)){i=!0,this.rowIndex=r,t=e[parseInt(n.toString(),10)];break}}return{entered:i,tr:t}},t.prototype.getRowElementByUid=function(e){return this.parent.getContent().querySelector("tr[data-uid="+e+"]")},t.prototype.removeTopRows=function(e,t,i){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),r=!1,s=0;s<n.length;s++){if(n[parseInt(s.toString(),10)].getAttribute("data-uid")===i){var a=this.parent.getContent().querySelector("tr[data-uid="+e+"]");a&&(this.rowIndex=a.rowIndex);break}n[parseInt(s.toString(),10)].getAttribute("data-uid")===t&&(r=!0),r&&(0,o.remove)(n[parseInt(s.toString(),10)])}},t.prototype.removeBottomRows=function(e,t,i){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),r=!1,s=0;s<n.length&&(n[parseInt(s.toString(),10)].getAttribute("data-uid")===t&&(r=!0),!r||((0,o.remove)(n[parseInt(s.toString(),10)]),n[parseInt(s.toString(),10)].getAttribute("data-uid")!==e));s++);},t.prototype.setCache=function(e){var t=this.parent.pageSettings.currentPage;if(this.parent.enableVirtualization&&(this.parent.lazyLoadRender=this),this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType&&e.args.prevPage!==e.args.currentPage){this.groupCache[parseInt(t.toString(),10)]=this.initialGroupCaptions[parseInt(t.toString(),10)]=this.groupCache[e.args.prevPage].concat((0,o.extend)([],e.data));for(var i=Object.keys(this.groupCache),n=0;n<i.length;n++)e.args.currentPage!==parseInt(i[parseInt(n.toString(),10)],10)&&(delete this.groupCache[""+i[parseInt(n.toString(),10)]],delete this.initialGroupCaptions[""+i[parseInt(n.toString(),10)]])}else this.groupCache[parseInt(t.toString(),10)]=this.initialGroupCaptions[parseInt(t.toString(),10)]=(0,o.extend)([],e.data)},t.prototype.captionRowExpand=function(e){var t=this,i=e.groupInfo,n=this.parent.groupSettings.columns.indexOf(i.data.field)+1,r=zh(Bh(e.fields,e.keys,this)),s={level:n,skip:e.skip,take:e.take,where:r};if(e.lazyLoadQuery=s,e.requestType="onDemandGroupInfo",e.makeRequest){var o=this.parent.renderModule.data.generateQuery(!0);o.isCountRequired||(o.isCountRequired=!0),o.lazyLoad.push({key:"onDemandGroupInfo",value:s}),this.lazyLoadQuery.push(s.where),e.isScroll&&this.parent.enableVirtualMaskRow?this.parent.showMaskRow():this.parent.showSpinner(),this.parent.renderModule.data.getData(e,o).then(function(i){if(t.parent.enableVirtualization&&(t.parent.islazyloadRequest=!0),t.parent.hideSpinner(),t.parent.removeMaskRow(),0!==i.result.length){var r=0===e.skip?e.groupInfo&&e.groupInfo.data&&e.groupInfo.data.startIndex:t.parent.groupSettings.columns.length===e.keys.length?e.skip+e.groupInfo.data.startIndex:t.startIndex;if(t.parent.groupSettings&&t.parent.groupSettings.columns.length!==e.keys.length)for(var s=0;s<i.result.length;s++)i.result[parseInt(s.toString(),10)].startIndex=r,r+=i.result[parseInt(s.toString(),10)].count;t.startIndex=r,t.cacheMode&&t.uid1&&t.uid2&&(t.removeTopRows(t.uid3,t.uid1,t.uid2),t.uid1=t.uid2=t.uid3=void 0),t.lazyLoadHandler({data:i.result,count:i.count,level:n,index:e.rowIndex,isRowExist:!1,isScroll:e.isScroll,up:!1,rowIndex:e.cachedRowIndex})}}).catch(function(e){return t.parent.renderModule.dataManagerFailure(e,{requestType:"grouping"})})}else this.lazyLoadHandler({data:null,count:e.groupInfo.data.count,level:n,index:e.rowIndex,isRowExist:!0,isScroll:e.isScroll,up:e.scrollUp,rowIndex:e.cachedRowIndex})},t.prototype.scrollReset=function(e){this.parent.getContent().firstElementChild.scrollTop=e?this.parent.getContent().firstElementChild.scrollTop+e:0},t.prototype.updateCurrentViewData=function(){var e=[];if(this.getRows().filter(function(t){t.isDataRow&&(e[t.index]=t.data)}),this.parent.isRemote()){var t=this.parent.getHeaderContent().querySelector(".e-checkselectall");t&&(e.length||this.getAllPagesData().length?t.parentElement.classList.remove("e-checkbox-disabled"):this.parent.selectionModule&&!this.parent.selectionModule.selectedRowIndexes.length&&t.parentElement.classList.add("e-checkbox-disabled"))}this.parent.currentViewData=e.length?e:this.parent.currentViewData},t.prototype.getGroupCache=function(){return this.groupCache},t.prototype.getRows=function(){return this.groupCache[this.parent.pageSettings.currentPage]||[]},t.prototype.getRowElements=function(){return[].slice.call(this.parent.getContent().getElementsByClassName(us))},t.prototype.getRowByIndex=function(e){for(var t,i=[].slice.call(this.parent.getContent().getElementsByClassName(us)),n=0;!(0,o.isNullOrUndefined)(e)&&n<i.length;n++){var r=parseInt(i[parseInt(n.toString(),10)].getAttribute(Rs),10);if(r&&r-1===e){t=i[parseInt(n.toString(),10)];break}}return t},t.prototype.setVisible=function(e){var t,i=this.parent;this.getRows().some(function(e){return e.isDataRow&&(t=e),e.isDataRow});for(var n=this.getRows().filter(function(e){return!e.isDetailRow}),r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)],a=this.parent.getNormalizedColumnIndex(s.uid),l=this.parent.getColumnIndexByUid(s.uid),h=!0===s.visible?"":"none",d=this.getColGroup();-1!==a&&t&&a<t.cells.length&&!(0,o.isNullOrUndefined)(d)&&(0,o.setStyleAttribute)(d.childNodes[parseInt(a.toString(),10)],{display:h}),this.setDisplayNone(i.getDataRows(),l,h,n,a),!this.parent.invokedFromMedia&&s.hideAtMedia&&this.parent.updateMediaColumns(s),this.parent.invokedFromMedia=!1}},t.prototype.setDisplayNone=function(e,t,i,n,r){if(this.parent.groupSettings.columns.length){var s=!1;if(this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.vgenerator){for(var a=this.parent.contentModule.vgenerator.cache,l=Object.keys(a),h=this.parent.getVisibleColumns().length,d=0;d<l.length;d++)for(var p=a[l[parseInt(d.toString(),10)]],c=0;c<p.length;c++){var u=p[parseInt(c.toString(),10)];u.isCaptionRow&&(u.cells[u.indent+1].colSpan=this.parent.enableColumnVirtualization?1:h+this.parent.groupSettings.columns.length+(this.parent.detailTemplate||this.parent.childGrid?1:0)-u.indent+(h?-1:0)),u.isDataRow&&(u.cells[parseInt(r.toString(),10)].visible=""===i)}s=!0}for(var g=Object.keys(this.groupCache),f=0;f<g.length;f++){var m=this.rowsByUid[g[parseInt(f.toString(),10)]];if(!(0,o.isNullOrUndefined)(m)){var y=Object.keys(m);for(d=0;d<y.length;d++){var v=this.parent.getContent().querySelector("tr[data-uid="+y[parseInt(d.toString(),10)]+"]"),S=m[y[parseInt(d.toString(),10)]];S.isCaptionRow&&(this.captionModelGen.isEmpty()?(s||(S.cells[S.indent+1].colSpan=""===i?S.cells[S.indent+1].colSpan+1:S.cells[S.indent+1].colSpan-1),v&&(v.cells[S.indent+1].colSpan=S.cells[S.indent+1].colSpan)):this.changeCaptionRow(S,v,g[parseInt(f.toString(),10)])),S.isDataRow&&(this.showAndHideCells(v,t,i,!1),S.cells[parseInt(r.toString(),10)].visible=""===i),S.isCaptionRow||S.isDataRow||!(0,o.isNullOrUndefined)(S.indent)||(S.cells[parseInt(r.toString(),10)].visible=""===i,S.visible=S.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(v,t,i,!0,S))}}}}else xh(e,t,i,n)},t.prototype.changeCaptionRow=function(e,t,i){var n=e,r=e.data,s=this.groupGenerator.generateCaptionRow(r,n.indent,n.parentGid,void 0,n.tIndex,n.parentUid);(s.uid=e.uid,s.isExpand=e.isExpand,s.lazyLoadCssClass=e.lazyLoadCssClass,this.rowsByUid[parseInt(i.toString(),10)][e.uid]=s,this.groupCache[parseInt(i.toString(),10)][this.objIdxByUid[parseInt(i.toString(),10)][e.uid]]=s,t)&&this.parent.getContentTable().querySelector(Ds).replaceChild(this.rowRenderer.render(s,this.parent.getColumns()),t)},t.prototype.showAndHideCells=function(e,t,i,n,r){if(e){var s=n?"td.e-summarycell":"td.e-rowcell";(0,o.setStyleAttribute)(e.querySelectorAll(s)[parseInt(t.toString(),10)],{display:i}),e.querySelectorAll(s)[parseInt(t.toString(),10)].classList.contains("e-hide")&&(0,o.removeClass)([e.querySelectorAll(s)[parseInt(t.toString(),10)]],["e-hide"]),n&&(r.visible&&e.classList.contains("e-hide")?(0,o.removeClass)([e],["e-hide"]):r.visible||(0,o.addClass)([e],["e-hide"]))}},t.prototype.getAllPagesData=function(){for(var e=[],t=Object.keys(this.groupCache),i=0;i<t.length;i++){var n=parseInt(t[parseInt(i.toString(),10)],10),r=this.groupCache[parseInt(n.toString(),10)];r&&r.length&&e.push.apply(e,r.filter(function(e){return e.isDataRow}).map(function(e){return e.data}))}return e},t}(Ys),Mp=function(){function e(e,t){this.parent=e,this.serviceLocator=t,this.addEventListener()}return e.prototype.getModuleName=function(){return"lazyLoadGroup"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Me,this.instantiateRenderer,this),this.parent.on(Ct,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Me,this.instantiateRenderer),this.parent.off(Ct,this.destroy))},e.prototype.instantiateRenderer=function(){"auto"===this.parent.height&&(this.parent.height=this.parent.pageSettings.pageSize*this.parent.getRowHeight());var e=this.serviceLocator.getService("rendererFactory"),t=null;this.parent.groupSettings.enableLazyLoading&&(t=new Fp(this.parent,this.serviceLocator),e.addRenderer(i.Content,t)),this.parent.enableVirtualization&&(this.parent.lazyLoadRender=t)},e.prototype.destroy=function(){this.removeEventListener()},e}(),Lp=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Lp(t,e),t.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.object=new Yh.AutoComplete((0,o.extend)({dataSource:this.parent.dataSource instanceof a.DataManager?this.parent.dataSource:new a.DataManager(this.parent.dataSource),query:(new a.Query).select(e.column.field),enabled:ul(e.column,e.requestType,e.element),fields:{value:e.column.field},value:Ml(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always"},e.column.edit.params)),this.object.appendTo(e.element),e.element.setAttribute("name",dl(e.column.field))},t.prototype.selectedValues=function(e){e.result=a.DataUtil.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},t}(Wd),Np=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Np(t,e),t.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new Yh.ComboBox((0,o.extend)({dataSource:this.parent.dataSource instanceof a.DataManager?this.parent.dataSource:new a.DataManager(this.parent.dataSource),query:(new a.Query).select(e.column.field),fields:{value:e.column.field},value:Ml(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always",enabled:ul(e.column,e.requestType,e.element),cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element)},t.prototype.finalValue=function(e){e.result=a.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)},t}(Wd),zp=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zp(t,e),t.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new Yh.MultiSelect((0,o.extend)({fields:{text:e.column.field,value:e.column.field},value:(0,o.getValue)(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:t?"":e.column.headerText,popupHeight:"200px",floatLabelType:t?"Never":"Always",cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",dl(e.column.field))},t}(Wd),Up=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Hp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Up(t,e),t.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=Ml(e.column.field,e.rowData);i=i?new Date(i):null,this.obj=new Jh.TimePicker((0,o.extend)({floatLabelType:t?"Never":"Always",value:i,placeholder:t?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:ul(e.column,e.requestType,e.element)&&gl(_a(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element)},t}(Wd),jp=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.activeClasses=["e-selectionbackground","e-active"],t}return jp(t,e),t.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),Dh(this.parent,e.column,t,{type:"checkbox",value:e.value})},t.prototype.read=function(e){return e.checked},t.prototype.write=function(e){var t=!(0,o.isNullOrUndefined)(e.row)&&e.row.querySelector(".e-edit-checkselect"),i=Ml(e.column.field,e.rowData),n=i&&JSON.parse(i.toString().toLowerCase());if(!(0,o.isNullOrUndefined)(t)){if(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType){var r=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid"));n=!!r&&r.isSelected}vl.apply(void 0,[[].slice.call(e.row.getElementsByClassName(is)),n].concat(this.activeClasses))}this.obj=new Js.Switch((0,o.extend)({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:n,disabled:!ul(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this),cssClass:this.parent.cssClass?this.parent.cssClass:""},e.column.edit.params)),this.obj.appendTo(e.element)},t.prototype.switchModeChange=function(e){if(this.editRow&&"Dialog"!==this.editType){var t=!1;e.checked?(t=!0,this.editRow.setAttribute("aria-selected",t.toString())):this.editRow.removeAttribute("aria-selected"),vl.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(is)),t].concat(this.activeClasses))}},t}(Wd),Gp=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Gp(t,e),t.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new Qh.MaskedTextBox((0,o.extend)({fields:{value:e.column.field},value:Ml(e.column.field,e.rowData),floatLabelType:t?"Never":"Always",mask:"000-000-0000",enabled:ul(e.column,e.requestType,e.element)&&gl(_a(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass?this.parent.cssClass:null},e.column.edit.params)),this.obj.appendTo(e.element)},t}(Wd)})(),u})());
|