@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 229 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("kendo.data.js"),require("kendo.columnsorter.js"),require("kendo.editable.js"),require("kendo.window.js"),require("kendo.filtermenu.js"),require("kendo.filtercell.js"),require("kendo.columnmenu.js"),require("kendo.groupable.js"),require("kendo.pager.js"),require("kendo.selectable.js"),require("kendo.sortable.js"),require("kendo.reorderable.js"),require("kendo.resizable.js"),require("kendo.ooxml.js"),require("kendo.excel.js"),require("kendo.pane.js"),require("kendo.pdf.js"),require("kendo.dialog.js"),require("kendo.switch.js"),require("kendo.html.button.js"),require("kendo.textbox.js"),require("kendo.form.js"),require("kendo.toolbar.js"),require("kendo.icons.js"),require("kendo.menu.js"),require("kendo.loader.js"),require("kendo.html.loadercontainer.js"),require("kendo.loaderContainer.chunk.js")):"function"==typeof define&&define.amd?define(["exports","kendo.data","kendo.columnsorter","kendo.editable","kendo.window","kendo.filtermenu","kendo.filtercell","kendo.columnmenu","kendo.groupable","kendo.pager","kendo.selectable","kendo.sortable","kendo.reorderable","kendo.resizable","kendo.ooxml","kendo.excel","kendo.pane","kendo.pdf","kendo.dialog","kendo.switch","kendo.html.button","kendo.textbox","kendo.form","kendo.toolbar","kendo.icons","kendo.menu","kendo.loader","kendo.html.loadercontainer","kendo.loaderContainer.chunk"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Grid={}),e.kendo._globals.Data,e.kendo._globals.Columnsorter,e.kendo._globals.Editable,e.kendo._globals.Window,e.kendo._globals.Filtermenu,e.kendo._globals.Filtercell,e.kendo._globals.Columnmenu,e.kendo._globals.Groupable,e.kendo._globals.Pager,e.kendo._globals.Selectable,e.kendo._globals.Sortable,e.kendo._globals.Reorderable,e.kendo._globals.Resizable,e.kendo._globals.Ooxml,e.kendo._globals.Excel,e.kendo._globals.Pane,e.kendo._globals.Pdf,e.kendo._globals.Dialog,e.kendo._globals.Switch,e.kendo._globals.HtmlButton,e.kendo._globals.Textbox,e.kendo._globals.Form,e.kendo._globals.Toolbar,e.kendo._globals.Icons,e.kendo._globals.Menu,e.kendo._globals.Loader,e.kendo._globals.HtmlLoadercontainer,e.kendo._globals.LoaderContainerChunk)}(this,(function(e,t,r,o,l,a,i,n,s,d,c,u,p,h,f,g,m,b,_,k,v,w,C,y,S,x,T,H,R){!function(e){var t=window.kendo,r=t.ui.ContextMenu,o=e.extend,l=t.htmlEncode,a="action",i=r.extend({init:function(e,t){var o=this;r.fn.init.call(o,e,t),o._overrideTemplates(),o._extendItems(),o.bind("select",o._onSelect.bind(o)),o.bind("open",o._onOpen.bind(o))},_overrideTemplates:function(){this.templates.sprite=({icon:e,spriteCssClass:r})=>`${e||r?t.ui.icon({icon:l(e||""),iconClass:l(r||"")}):""}`},defaultItems:{separator:{name:"separator",separator:!0},create:{name:"create",text:"Add",icon:"plus",command:"AddCommand",rules:"isEditable"},edit:{name:"edit",text:"Edit",icon:"pencil",command:"EditCommand",rules:"isEditable"},destroy:{name:"destroy",text:"Delete",icon:"trash",command:"DeleteCommand",rules:"isEditable"},select:{name:"select",text:"Select",icon:"table-body",rules:"isSelectable",items:[{name:"selectRow",text:"Row",icon:"table-row-groups",command:"SelectRowCommand"},{name:"selectAllRows",text:"All rows",icon:"grid",command:"SelectAllRowsCommand"},{name:"clearSelection",text:"Clear selection",icon:"table-unmerge",softRules:"hasSelection",command:"ClearSelectionCommand"}]},copySelection:{name:"copySelection",text:"Copy selection",icon:"page-header-section",rules:"isSelectable",softRules:"hasSelection",command:"CopySelectionCommand",options:"withHeaders"},copySelectionNoHeaders:{name:"copySelectionNoHeaders",text:"Copy selection (No Headers)",icon:"file-txt",rules:"isSelectable",softRules:"hasSelection",command:"CopySelectionCommand"},paste:{name:"paste",text:"Paste (use CTRL/⌘ + V)",rules:"allowPaste",softRules:"alwaysDisabled",icon:"clipboard"},reorderRow:{name:"reorderRow",text:"Reorder row",icon:"caret-alt-expand",rules:"isRowReorderable",softRules:"isSorted",items:[{name:"reorderRowUp",text:"Up",icon:"caret-alt-up",command:"ReorderRowCommand",options:"dir:up"},{name:"reorderRowDown",text:"Down",icon:"caret-alt-down",command:"ReorderRowCommand",options:"dir:down"},{name:"reorderRowTop",text:"Top",icon:"caret-alt-to-top",command:"ReorderRowCommand",options:"dir:top"},{name:"reorderRowBottom",text:"Bottom",icon:"caret-alt-to-bottom",command:"ReorderRowCommand",options:"dir:bottom"}]},exportPDF:{name:"exportPDF",text:"Export to PDF",icon:"file-pdf",command:"ExportPDFCommand"},exportExcel:{name:"exportExcel",text:"Export to Excel",icon:"file-excel",items:[{name:"exportToExcelAll",text:"All",command:"ExportExcelCommand"},{name:"exportToExcelSelection",text:"Selection",command:"ExportExcelCommand",softRules:"hasSelection",options:"selection,withHeaders"},{name:"exportToExcelSelectionNoHeaders",text:"Selection (No Headers)",softRules:"hasSelection",command:"ExportExcelCommand",options:"selection"}]},sortAsc:{name:"sortAsc",text:"Sort Ascending",icon:"sort-asc-small",rules:"isSortable",command:"SortCommand",options:"dir:asc"},sortDesc:{name:"sortDesc",text:"Sort Descending",icon:"sort-desc-small",rules:"isSortable",command:"SortCommand",options:"dir:desc"},moveGroupPrevious:{name:"moveGroupPrevious",text:"Move previous",icon:"arrow-left",rules:"isGroupable",softRules:"canMoveGroupPrev",command:"MoveGroupCommand",options:"dir:prev"},moveGroupNext:{name:"moveGroupNext",text:"Move next",icon:"arrow-right",rules:"isGroupable",softRules:"canMoveGroupNext",command:"MoveGroupCommand",options:"dir:next"}},events:r.fn.events.concat([a]),_onSelect:function(t){var r=e(t.item).data("command"),o=e(t.item).data("options");o=o?o.split(",").map((e=>{if(e.indexOf(":")>-1){var[t,e]=e.split(":");return{[t||"_"]:e}}return{[e]:!0}})).reduce(((e,t)=>Object.assign(e,t)),{}):{};var l=e(t.target);r&&this.action({command:r,options:Object.assign(o,{target:l})})},_onOpen:function(r){var o=r.sender,l=o.options.items,a=e(r.event?r.event.target:null);!l&&e.isEmptyObject(this.defaultItems)||a.closest(".k-grid-column-menu").length?r.preventDefault():(this._toggleSeparatorVisibility(),o.element.find(`[${t.attr("soft-rules")}]`).each(((r,l)=>{var i=e(l).attr(t.attr("soft-rules")).split(";");o.enable(l,this._validateSoftRules(i,a))})))},_toggleSeparatorVisibility:function(){this.element.find(".k-item.k-separator").filter(((t,r)=>{var o=e(r).prev(".k-item:not(.k-separator)"),l=e(r).next(".k-item:not(.k-separator)");return!(o.length&&l.length)})).hide()},_extendItems:function(){var t,r=this,o=r.options.items;if(o&&o.length)for(var l=0;l<o.length;l++)t=o[l],e.isPlainObject(t)&&1===Object.keys(t).length&&t.name&&(t=t.name),e.isPlainObject(t)?r._append(t):r.defaultItems[t]?(t=r.defaultItems[t],r._append(t)):"string"==typeof t&&(t={name:t,text:t,spriteCssClass:t,command:t+"Command"},r._append(t));else for(var a in r.defaultItems)t=r.defaultItems[a],r._append(t)},_extendItem:function(e){var r=this,l=r.options.messages,a=e.attr||{};if(e.command&&(a[t.attr("command")]=e.command),e.options&&(a[t.attr("options")]=e.options),e.softRules&&(a[t.attr("soft-rules")]=e.softRules),e.items)for(var i=0;i<e.items.length;i++)e.items.forEach((e=>{r._extendItem(e)}));o(e,{text:l.commands[e.name],icon:e.icon||"",spriteCssClass:e.spriteCssClass||"",attr:a,uid:t.guid()})},_validateSoftRules:function(e,t){if(!e||!e||!e.length)return!0;for(var r=0;r<e.length;r++)if(!this._readState(e[r],t))return!1;return!0},_validateRules:function(e){var t=e.rules?e.rules.split(";"):[];if(!t.length)return!0;for(var r=0;r<t.length;r++)if(!this._readState(t[r]))return!1;return!0},_readState:function(e,r){var o=this.options.states;return t.isFunction(o[e])?o[e](r):o[e]},_append:function(e){var t=this;t._extendItem(e),t._validateRules(e)&&t.append(e)},action:function(e){this.trigger(a,e)}});t.ui.grid=t.ui.grid||{},o(t.ui.grid,{ContextMenu:i})}(window.kendo.jQuery),function(e){var t=window.kendo,r=e.extend,o=t.Class.extend({init:function(e){this.options=e,this.grid=e.grid}}),l=o.extend({exec:function(){var e=this.grid.groupable,t=this.options,r=t.target.closest(".k-chip"),o="next"===t.dir?"after":"before";("next"===t.dir?r.next():r.prev())[o](r),e._change()}}),a=o.extend({exec:function(){var e,t,r=this.grid,o=r.dataSource,l=o.sort()||[],a=this.options,i=a.dir,n=r._getCellField(a.target),s=r.options.sortable.mode&&"multiple"===r.options.sortable.mode,d=r.options.compare;if(s){for(t=0,e=l.length;t<e;t++)if(l[t].field===n){l.splice(t,1);break}l.push({field:n,dir:i,compare:d})}else l=[{field:n,dir:i,compare:d}];o.sort(l)}}),i=o.extend({exec:function(){this.grid.addRow()}}),n=o.extend({exec:function(){var e=this,t=e.grid,r="incell"===t._editMode(),o=r?e.options.target:e.options.target.closest("tr");r?t.editCell(o):t.editRow(o)}}),s=o.extend({exec:function(){var e=this.grid,t=this.options.target.closest("tr");e.removeRow(t)}}),d=o.extend({exec:function(){var e=this.grid,t=this.options.withHeaders;e.copySelectionToClipboard(t)}}),c=o.extend({exec:function(){var e=this.grid,r=t.ui.Selectable.parseOptions(e.options.selectable),o=this.options.target.closest("tr");e.select(r.cell?o.find("td"):o)}}),u=o.extend({exec:function(){var e=this.grid,r=t.ui.Selectable.parseOptions(e.options.selectable),o=e.items();e.select(r.cell?o.find("td"):o)}}),p=o.extend({exec:function(){this.grid.clearSelection()}}),h=o.extend({exec:function(){var e,t=this,r=t.grid,o=t.options.dir,l=t.options.target.closest("tr"),a=l.index();switch(o){case"up":e=a-1;break;case"down":e=a+2;break;case"top":e=0;break;case"bottom":e=r.items().length}r.reorderRowTo(l,e)}}),f=o.extend({exec:function(){this.grid.saveAsPDF()}}),g=o.extend({exec:function(){var e=this,t=e.options.selection,r=e.options.withHeaders,o=e.grid;t?o.exportSelectedToExcel(r):o.saveAsExcel()}});t.ui.grid=t.ui.grid||{},r(t.ui.grid,{GridCommand:o,commands:{SortCommand:a,AddCommand:i,EditCommand:n,DeleteCommand:s,CopySelectionCommand:d,SelectRowCommand:c,SelectAllRowsCommand:u,ClearSelectionCommand:p,ReorderRowCommand:h,ExportPDFCommand:f,ExportExcelCommand:g,MoveGroupCommand:l}})}(window.kendo.jQuery);!function(e,t){let r=window.kendo,o=r.ui,l=r.data.DataSource,a=r.data.ObservableObject,i=r.support.tbodyInnerHtml,n=r._activeElement,s=o.Widget,d=r._outerWidth,c=r._outerHeight,u=r.keys,p=r.type,h=e.isPlainObject,f=e.extend,g=e.map,m=e.grep,b=Array.isArray,_=e.inArray,k=Array.prototype.push,v=r.isFunction,w=r.htmlEncode,C=e.isEmptyObject,y=e.contains,S=Math,x=".",T="progress",H="error",I=":not(.k-group-cell):not(["+r.attr("virtual")+"]):not(.k-hierarchy-cell:not(:has(.k-icon.k-i-caret-alt-down,.k-icon.k-i-caret-alt-right,.k-svg-icon.k-svg-i-caret-alt-down,.k-svg-icon.k-svg-i-caret-alt-right,.k-svg-icon.k-svg-i-caret-alt-left,.k-icon.k-i-caret-alt-left))):visible",E=":not(["+r.attr("virtual")+"]):not(.k-hierarchy-cell:not(:has(.k-icon.k-i-caret-alt-down,.k-icon.k-i-caret-alt-right,.k-svg-icon.k-svg-i-caret-alt-down,.k-svg-icon.k-svg-i-caret-alt-right,.k-svg-icon.k-svg-i-caret-alt-left,.k-icon.k-i-caret-alt-left)))",A="tr:not(.k-footer-template):visible",z=":not(.k-group-cell):not(.k-detail-cell):not(.k-hierarchy-cell):visible",F="tr:not(.k-grouping-row):not(.k-detail-row):not(.k-footer-template):not(.k-group-footer):visible",D="col:not(.k-group-col, .k-hierarchy-col)",M="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",L="a[class*='-i-caret-alt-down']",q="a[class*='-i-caret-alt-right']",O=q,P=".kendoGrid",V="edit",B="beforeEdit",W="save",G="remove",N="detailInit",j="filterMenuInit",U="columnMenuInit",K="filterMenuOpen",$="columnMenuOpen",Q="cellClose",Y="changing",J="change",X="columnHide",Z="columnShow",ee="saveChanges",te="dataBound",re="detailExpand",oe="detailCollapse",le="itemchange",ae="page",ie="paging",ne="paste",se="scroll",de="sync",ce="loadStart",ue="loadEnd",pe="requestEnd",he="k-focus",fe="k-hover",ge="k-active",me=":kendoFocusable",be="k-selected",_e="k-checkbox",ke="input[data-role='checkbox'].k-select-checkbox."+_e,ve="k-grid-norecords",we="k-link",Ce="k-icon",ye="k-svg-icon",Se="k-sort-order",xe="k-sorted",Te="k-header",He="k-grid-column-menu",Re="k-grid-filter-menu",Ie="k-grid-content-sticky",Ee="k-grid-header-sticky",Ae="k-grid-footer-sticky",ze="k-grid-no-left-border",Fe="k-grouping-row",De="resize",Me="rowResize",Le="columnResize",qe="columnReorder",Oe="columnLock",Pe="columnUnlock",Ve="columnStick",Be="columnUnstick",We="rowReorder",Ge="navigate",Ne="click",je="mousedown",Ue="mouseup",Ke="mouseenter",$e="mouseleave",Qe="mousemove",Ye="dblclick",Je="height",Xe="width",Ze="auto",et="tabIndex",tt="function",rt="string",ot="bottom",lt="container-for",at="field",it="input",nt="incell",st="inline",dt="overflow",ct="sort",ut="group-sort",pt="Collapse",ht="Expand",ft="id",gt="px",mt="tr",bt="div",_t="aria-label",kt="aria-owns",vt="aria-rowcount",wt="aria-colcount",Ct="aria-colindex",yt="aria-rowindex",St="aria-expanded",xt="aria-checked",Tt="aria-activedescendant",Ht="role",Rt="none",It="row",Et="rowgroup",At="columnheader",zt="gridcell",Ft=/(\}|\#)/gi,Dt="[\\x20\\t\\r\\n\\f]",Mt=(new RegExp("(\\s*left\\s*:\\s*\\d*px;?)*","ig"),new RegExp("(\\s*right\\s*:\\s*\\d*px;?)*","ig"),new RegExp("(^|"+Dt+")(k-group-cell|k-hierarchy-cell)("+Dt+"|$)")),Lt=new RegExp("(^|"+Dt+")(k-filter-row)("+Dt+"|$)"),qt=({className:e,attr:t,text:o})=>`<button type="button" class="${e}" ${t}>${r.htmlEncode(o)}</button>`,Ot=(e,t)=>`<span class="k-checkbox-wrap"><input tabindex="-1" class="k-select-checkbox ${_e} ${e} k-rounded-md" data-role="checkbox" aria-label="${t}" aria-checked="false" type="checkbox"></span>`,Pt=({size:e})=>Ot(e,"Select row"),Vt=({size:e})=>Ot(e,"Select all rows"),Bt=()=>r.ui.icon("reorder"),Wt=({text:e})=>`<span class="k-cell-inner"><span class="k-link"><span class="k-column-title">${e}</span></span></span>`,Gt=!1,Nt=r.support.browser;var jt,Ut=Nt.msie&&11===Nt.version,Kt=/Mac OS/.test(navigator.userAgent),$t="k-content",Qt="k-scroll-container",Yt="k-cell-inner",Jt=["copySelection","copySelectionNoHeaders","paste","separator","create","edit","destroy","select","separator","reorderRow","exportPDF","exportExcel","separator"],Xt=["sortAsc","sortDesc","separator"],Zt=["moveGroupPrevious","moveGroupNext","separator"];o.Pager&&(jt=o.Pager.extend({init:function(e,t){o.Pager.fn.init.call(this,e,f(!0,{},t)),this.dataSource.options.useRanges=!0,this.dataSource._omitPrefetch=!0},options:{name:"GroupsPager"},totalPages:function(){return Math.ceil((this._collapsedTotal()||0)/(this.pageSize()||1))},_collapsedTotal:function(){var e=this.dataSource;return e&&e.groupsTotal(!0)||0}}));var er=s.extend({init:function(e,t){var r=this;s.fn.init.call(r,e,t),r._refreshHandler=r.refresh.bind(r),r.setDataSource(t.dataSource),r.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(J,t._refreshHandler),t.dataSource=e,t.dataSource.bind(J,t._refreshHandler),t.dataSource.options.useRanges=!0,t.dataSource.options.virtual=!0},options:{name:"VirtualScrollable",itemHeight:e.noop,prefetch:!0,maxScrollHeight:25e4},events:[ie,ae,se,ce,ue],destroy:function(){var e=this;s.fn.destroy.call(e),e.dataSource.unbind(J,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(P),clearTimeout(e._timeout),e._scrollingTimeout&&clearTimeout(e._scrollingTimeout),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,o=this,l=r.support.scrollbar()+1,a=o.element;a.css({width:Ze,overflow:"hidden"}).css(Gt?"padding-left":"padding-right",l),o.content=a.children().first(),t=o.wrapper=o.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().on("DOMMouseScroll"+P+" mousewheel"+P,o._wheelScroll.bind(o)),o._wrapper(),(r.support.kineticScrollNeeded||r.support.touch)&&(o.wrapper.css("touch-action",Rt),o.drag=new r.UserEvents(o.wrapper,{global:!0,allowSelection:!0,start:function(e){e.sender.capture()},move:function(e){o.verticalScrollbar.scrollTop(o.verticalScrollbar.scrollTop()-e.y.delta),r.scrollLeft(t,r.scrollLeft(t)-e.x.delta),e.preventDefault()}})),o.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" tabindex="-1"/>').css({width:l}).appendTo(a).on("scroll"+P,o._scroll.bind(o))},_wrapper:function(){Ut&&(this.wrapper.css({"overflow-y":se}),this.element.css(Gt?"padding-left":"padding-right",0))},_wheelScroll:function(e){if(!e.ctrlKey){var t=this.verticalScrollbar,o=t.scrollTop(),l=r.wheelDeltaY(e);!l||l>0&&0===o||l<0&&o+t[0].clientHeight==t[0].scrollHeight||(e.preventDefault(),this.verticalScrollbar.scrollTop(o+-l))}},_scroll:function(e){var t=this,r=!t.options.prefetch,o=e.currentTarget.scrollTop,l=t.dataSource,a=t.itemHeight,i=l.skip()||0,n=t._rangeStart||i,s=t.element.innerHeight(),d=!!(t._scrollbarTop&&t._scrollbarTop>o),c=S.max(S.floor(o/a),0),u=d?S.ceil(s/a):S.floor(s/a),p=S.max(c+u,0);t._preventScroll?t._preventScroll=!1:(t._prevScrollTop=t._scrollTop,t._scrollTop=o-n*a,t._scrollbarTop=o,t._scrolling=r,t._fetch(c,p,d)||(t.wrapper[0].scrollTop=t._scrollTop),t.trigger(se),r&&(t._scrollingTimeout&&clearTimeout(t._scrollingTimeout),t._scrollingTimeout=setTimeout((function(){t._scrolling=!1,t._page(t._rangeStart,t.dataSource.take())}),100)))},scrollToTop:function(){this._scrollTo(0)},scrollToBottom:function(){var e=this.verticalScrollbar;this._scrollTo(e[0].scrollHeight-e.height())},_scrollWrapperToTop:function(){this.wrapper.scrollTop(0)},_scrollWrapperToBottom:function(){this.wrapper.scrollTop(this.wrapper[0].scrollHeight)},_scrollWrapperOnColumnResize:function(){var e=this,t=this.wrapper,o=t.scrollTop();t[0].scrollWidth>t[0].clientWidth?(!e._wrapperScrolled&&o||e._isScrolledToBottom())&&(t.scrollTop(o+r.support.scrollbar()),e._scrollTop=t.scrollTop(),e._wrapperScrolled=!0):e._wrapperScrolled&&(e._isWrapperScrolledToBottom()||(t.scrollTop(o-r.support.scrollbar()),e._scrollTop=t.scrollTop()),e._wrapperScrolled=!1)},_scrollTo:function(e,t){var r=this,o=r.verticalScrollbar;o.scrollTop()!==e&&(r._preventScroll=!0),r.wrapper.scrollTop(e),r._scrollTop=r.wrapper.scrollTop(),o.scrollTop(t??e),r._scrollbarTop=o.scrollTop()},_isScrolledToTop:function(){return 0===this.verticalScrollbar.scrollTop()},_isScrolledToBottom:function(){var e=this.verticalScrollbar,t=e.scrollTop();return t>0&&t>=parseInt(e[0].scrollHeight-e.height(),10)},_isWrapperScrolledToBottom:function(){var e=this.wrapper;return e.scrollTop()>=parseInt(e[0].scrollHeight-e.height(),10)},itemIndex:function(e){return(this._rangeStart||this.dataSource.skip()||0)+e},position:function(e){var t,r=this._rangeStart||this.dataSource.skip()||0,o=this.dataSource.pageSize();return(t=e>r?e-r:r-e-1)>o?o:t},scrollIntoView:function(e){var t=this.wrapper[0],r=t.clientHeight,o=this._isScrolledToBottom()?t.scrollTop:this._scrollTop||t.scrollTop,l=e[0].offsetTop,a=e[0].offsetHeight;o>l?this.verticalScrollbar[0].scrollTop-=r/2:l+a>=o+r&&(this.verticalScrollbar[0].scrollTop+=r/2)},_fetch:function(t,r,o){var l=this,a=l.dataSource,i=l.itemHeight,n=a.take(),s=l._rangeStart||a.skip()||0,d=S.floor(t/n)*n,c=!1,u=l.verticalScrollbar,p=Nt.webkit?1:0,h=a._isGroupPaged()?a.groupsTotal(!0):a.total();return t<s?(c=!0,l._alwaysScrollTop?(s=S.min(t,h-n),l._scrollTop=0):(s=S.max(0,r-n),l._scrollTop=u.scrollTop()-s*i),l._page(s,n)):r>=s+n&&!o?(c=!0,s=S.min(t,h-n),u.scrollTop()>=u[0].scrollHeight-u[0].offsetHeight-p?l._scrollTop=l.wrapper[0].scrollHeight-l.wrapper[0].offsetHeight:l.dataSource._isGroupPaged()&&t>=h-n?l._scrollTop=l.wrapper[0].scrollHeight-l.wrapper[0].offsetHeight-(l._scrollTop-l._prevScrollTop):l._alwaysScrollTop?l._scrollTop=0:l._scrollTop=i,l._page(s,n)):!l._fetching&&l.options.prefetch&&(t<d+n-.33*n&&t>n&&a.prefetch(d-n,n,e.noop),r>d+.33*n&&a.prefetch(d+n,n,e.noop)),c},fetching:function(){return this._fetching},_page:function(t,r,o){var l=this,a=!l.options.prefetch,i=l.dataSource,n=i._isGroupPaged();o=v(o)?o:e.noop,l.trigger(ie,{skip:t,take:r})||(clearTimeout(l._timeout),l._fetching=!0,l._rangeStart=t,n&&i._groupRangeExists(t,t+r)||!n&&i.inRange(t,r)?(l.trigger(ce),i.range(t,r,(function(){l.trigger(ue),o(),l.trigger(ae)}),"page")):(a||l.trigger(ce),l._timeout=setTimeout((function(){l._scrolling||(a&&l.trigger(ce),i.range(t,r,(function(){l.trigger(ue),o(),l.trigger(ae)})))}),100)))},repaintScrollbar:function(t){var o,l,a=this,i=a.options.maxScrollHeight,n=a.dataSource,s=r.support.kineticScrollNeeded?0:r.support.scrollbar(),d=a.wrapper[0],c=a._isScrolledToBottom();l=a.itemHeight=a.options.itemHeight()||0;var u=d.scrollWidth>d.offsetWidth?s:0;o=(n._isGroupPaged()?n.groupsTotal(!0):n.total())*l+u;var p=e(new Array(S.floor(o/i)+1).join("<div></div>")).css({width:"1px",height:`${i}px`});o%i&&(p=p.add(e("<div></div>").css({width:"1px",height:o%i+"px"}))),a.verticalScrollbar.empty().append(p),!c||a._isScrolledToBottom()||a.dataSource._isGroupPaged()||a.scrollToBottom(),void 0!==a._scrollTop&&t&&(d.scrollTop=a._scrollTop,a._scrollWrapperOnColumnResize())},refresh:function(e){var t=this,r=t.dataSource,o=t._rangeStart,l=(e||{}).action,a=t._isScrolledToBottom()||!l||l!==le&&l!==G&&l!==de;t.trigger(ue),clearTimeout(t._timeout),t.repaintScrollbar(a),t.drag&&t.drag.cancel(),void 0===o||t._fetching||((!l||l!==de&&l!==le&&"expandGroup"!==l)&&(t._rangeStart=r.skip()),1!==r.page()||l&&(l===de||l===le||"expandGroup"===l||"collapseGroup"===l)||(t.verticalScrollbar[0].scrollTop=0)),t._programmaticallyScrolling&&"resolved"!==t._programmaticallyScrolling.state()&&t._programmaticallyScrolling.resolve(),t._alwaysScrollTop&&delete t._alwaysScrollTop,t._fetching=!1}});function tr(e,t){return"["+r.attr(e)+"="+t+"]"}function rr(e){return new Array(e+1).join('<td class="k-group-cell k-table-group-td k-table-td"> </td>')}function or(e){var t,r=" ";if(e){if(typeof e===rt)return e;for(t in e)""!==e[t]&&(r+=t+'="'+e[t]+'"')}return r}var lr={create:{text:"Add new record",className:"k-grid-add",iconClass:"k-i-plus"},cancel:{text:"Cancel changes",className:"k-grid-cancel-changes",iconClass:"k-i-cancel"},save:{text:"Save changes",className:"k-grid-save-changes",iconClass:"k-i-check"},destroy:{text:"Delete",className:"k-grid-remove-command",iconClass:"k-i-x"},edit:{text:"Edit",className:"k-grid-edit-command",iconClass:"k-i-pencil",themeColor:"primary"},update:{text:"Save",className:"k-grid-save-command",iconClass:"k-i-save",themeColor:"primary"},canceledit:{text:"Cancel",className:"k-grid-cancel-command",iconClass:"k-i-cancel"},excel:{text:"Export to Excel",className:"k-grid-excel",iconClass:"k-i-file-excel"},pdf:{text:"Export to PDF",className:"k-grid-pdf",iconClass:"k-i-file-pdf"},search:{text:"Search...",className:"k-grid-search"},columns:{text:"Columns",type:"button",icon:"columns",fillMode:"flat",overflow:"never",className:"k-grid-column-menu",attr:{"aria-haspopup":"menu"}}};function ar(t,r){e("th, th .k-grid-filter-menu, th .k-link",t).add(document.body).css("cursor",r)}function ir(t,r,o,l,a){var i=r;r=e(),a=a||1;for(var n=0;n<a;n++)r=r.add(t.eq(i+n));"number"==typeof o?r[l?"insertBefore":"insertAfter"](t.eq(o)):r.appendTo(o)}function nr(t,r,o){return e(t).add(r).find(o)}function sr(e,t,r){var o,l,a,i;for(o=0,l=(r=b(r)?r:[r]).length;o<l;o++)a=r[o],h(a)&&a.click&&(i=a.name||a.text,t.on(Ne+P,".k-grid-"+(i||"").replace(/\s/g,""),{commandName:i},a.click.bind(e)))}function dr(e,o,l,a,i){return g(e,(function(e){var n;(e=typeof e===rt?{field:e}:e).parentIds=i,e.attributes instanceof Function&&(e._attributesFunction=e.attributes),!_r(e)||l?(e.attributes=io(e.attributes),e.footerAttributes=io(e.footerAttributes),e.headerAttributes=io(e.headerAttributes),n=!0):!_r(e)&&l||(e.attributes=no(e.attributes),e.footerAttributes=no(e.footerAttributes),e.headerAttributes=no(e.headerAttributes),n=t);var s=r.guid();return a&&!e.locked&&(e.locked=a),e.headerAttributes=f({headers:i},e.headerAttributes),e.headerAttributes.id?e.uid=s=e.headerAttributes.id:(e.headerAttributes=f({id:s},e.headerAttributes),e.uid=s),e.columns&&(e.columns=dr(e.columns,o,n,e.locked,i?i+" "+s:s)),f({encoded:o,hidden:n,locked:a},e)}))}function cr(e,t){var r=[];return ur(e,t,r),r[r.length-1]}function ur(e,t,r){r=r||[];for(var o=0;o<t.length;o++){if(e===t[o])return!0;if(t[o].columns){var l=r.length;if(r.push(t[o]),ur(e,t[o].columns,r))return!0;r.splice(l,r.length-l)}}return!1}function pr(e,t){hr(e,t,t)}function hr(e,t,r){var o=r?no:io;e.hidden=!t,e.attributes=o(e.attributes),e.footerAttributes=o(e.footerAttributes),e.headerAttributes=o(e.headerAttributes)}function fr(e,t){gr(e),hr(e,t,e._hideByMedia?e.matchesMedia:t)}function gr(e){e.matchesMedia=mr(e)}function mr(e){return e&&(wr(e.media)||!wr(e.media)&&r.matchesMedia(e.media))}function br(){return this.style.display!==Rt&&!this.classList.contains("k-hidden")}function _r(e){return kr([e]).length>0}function kr(e){return m(e,(function(e){var t=!e.hidden&&!1!==e.matchesMedia;return t&&e.columns&&(t=kr(e.columns).length>0),t}))}function vr(e){for(var t,r=[],o=0;o<e.length;o++){if(!wr((t=e[o]).media)){if(!wr(t.minScreenWidth))throw new Error("Using 'media' and 'minScreenWidth' options at the same time is not supported.");r.push(t)}t.columns&&(r=r.concat(vr(t.columns)))}return r}function wr(e){return void 0===e}function Cr(t){return e(t).map((function(){return this.toArray()}))}function yr(e,t){for(var r=0;r<e.length;r++)if(e[r].field==t)return e[r]}function Sr(t,r,o,l,a,i,n,s){var d=Tr(t),c=Tr([r]);if(d>c){var u=new Array(n+1).join('<th class="k-group-cell k-header k-table-th" scope="col"> </th>'),p=i.children(":not(.k-filter-row)");e(new Array(d-c+1).join("<tr class='k-table-row'>"+u+"</tr>")).insertAfter(p.last())}!function(e,t){for(var r=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)"),o=0;o<r.length;o++)r[o].rowSpan+=t}(i,d-c),Hr(o,l,a,i,s)}function xr(t,o,l){var a;l=l||0;var i=o;o=Zr(o);for(var n={},s=t.find(">tr:not(.k-filter-row)"),d=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},c=0,u=o.length;c<u;c++)n[(a=Rr(o[c],i)).row]||(n[a.row]=s.eq(a.row).find(x+Te).filter(d)),n[a.row].eq(a.cell).attr(r.attr("index"),l+c);return o.length}function Tr(e){for(var t=0,r=0;r<e.length;r++)if(e[r].columns){var o=Tr(e[r].columns);o>t&&(t=o)}return 1+t}function Hr(t,r,o,l,a){var i,n=Ar(t[0],r),s=o.find(">tr:not(.k-filter-row)").eq(n.row).children("th.k-header:not(.k-group-cell)"),d=e(),c=n.cell;for(i=0;i<t.length;i++)d=d.add(s.eq(c+i));l.find(">tr:not(.k-filter-row)").eq(n.row)[a](d);var u=[];for(i=0;i<t.length;i++)t[i].columns&&(u=u.concat(t[i].columns));u.length&&Hr(u,r,o,l,a)}function Rr(e,t,r,o){var l,a;for((o=o||{})[r=r||0]=o[r]||0,a=0;a<t.length;a++){if(t[a]==e){l={cell:o[r],row:r};break}if(t[a].columns&&(l=Rr(e,t[a].columns,r+1,o)))break;o[r]++}return l}function Ir(e){let t=e,r=t.match(/class=["][^"]+/g);if(r){const e=r[0].split('"').pop();t=t.replace(e,e+" k-table-td")}else t=t.replace("<td","<td class='k-table-td'");return t}function Er(e,t,r,o,l){if(t.columns)return(t=t.columns)[o?0:t.length-1];var a,i=cr(t,e);a=i?i.columns:e;var n=_(t,a);0===n&&o?n++:n==a.length-1&&!o||!r.locked&&!t.columns&&!o?n--:(n>0||0===n&&!o)&&n++,t=function(e,t,r,o){var l,a,i=!!r.locked;do{l=e[t],t+=o?1:-1,a=!!l.locked}while(l&&t>-1&&t<e.length&&l!=r&&!l.columns&&a===i);return l}(a,n,r,_(r,a)>n);var s=_(t,l);return(!t.columns||s&&s!==a.length-1)&&t&&t!=r&&t.columns?Er(e,t,r,o,l):null}function Ar(e,t,r,o){var l,a;for((o=o||{})[r=r||0]=o[r]||0,a=0;a<t.length;a++){if(t[a]==e){l={cell:o[r],row:r};break}if(t[a].columns&&(l=Ar(e,t[a].columns,r+1,o)))break;t[a].hidden||o[r]++}return l}function zr(e){return Dr(Nr(e)).concat(Dr(jr(e)))}function Fr(e,t,r,o){var l=e[r],a=e[o],i=cr(l,t);return t=i?i.columns:t,_(a,t)}function Dr(e){for(var t=[],r=[],o=0;o<e.length;o++)t.push(e[o]),e[o].columns&&(r=r.concat(e[o].columns));return r.length&&(t=t.concat(Dr(r))),t}function Mr(e){for(var t,r=0,o=0;o<e.length;o++)(t=e[o]).columns?r+=Mr(t.columns):t.hidden&&r++;return r}function Lr(e){for(var t=0,r=0,o=e.length;r<o;r++)e[r].hidden||(t+=parseInt(e[r].width,10));return t}function qr(e){for(var t,r=0,o=0,l=e.length;o<l;o++)(t=e[o].style.width)&&-1==t.indexOf("%")&&(r+=parseInt(t,10));return r}function Or(t){for(var r=t.find("tr:not(.k-filter-row)"),o=r.filter((function(){return!e(this).children().length})).remove().length,l=r.find("th:not(.k-group-cell,.k-hierarchy-cell)"),a=0;a<l.length;a++)l[a].rowSpan>1&&(l[a].rowSpan-=o);return r.length-o}function Pr(e,t,r,o,l){var a,i,n,s=[];for(a=0,n=e.length;a<n;a++)(i=r[o]||[]).push(t.eq(l+a)),r[o]=i,e[a].columns&&(s=s.concat(e[a].columns));s.length&&Pr(s,t,r,o+1,l+e.length)}function Vr(e,t,r){e.css({left:t,right:r})}function Br(e,t,r){e[t]=e[t]||{},e[t][r]=e[t][r]||""}function Wr(e,t,r,o){Br(e,t,r),""!==e[t][r]?e[t][r]+=" "+o:e[t][r]=o}function Gr(e,t,r,o,l){Br(e,t,r),l?delete e[t][r]:e[t][r]=e[t][r].replace(o,"")}function Nr(e){return m(e,(function(e){return e.locked}))}function jr(e){return m(e,(function(e){return!e.locked}))}function Ur(e){return m(e,(function(e){return e.sticky&&!e.locked}))}function Kr(e){return m(e,(function(e){return!e.locked&&_r(e)}))}function $r(e){return m(e,(function(e){return e.locked&&_r(e)}))}function Qr(e){for(var t=[],r=0;r<e.length;r++)e[r].hidden||(e[r].columns?t=t.concat(Qr(e[r].columns)):t.push(e[r]));return t}function Yr(e){for(var t=[],r=0;r<e.length;r++)e[r].hidden||(e[r].columns?t=t.concat(Qr(e[r].columns)):t.push({field:e[r].field,width:e[r].width,values:e[r].values,title:e[r].title}));return t}function Jr(e){for(var t=[],r=0;r<e.length;r++)e[r].columns&&(t=t.concat(e[r].columns));return t}function Xr(e){var t=Jr(e);return t=t.filter((function(e){return!e.hidden}))}function Zr(e){for(var t=[],r=0;r<e.length;r++)e[r].columns?t=t.concat(Zr(e[r].columns)):t.push(e[r]);return t}function eo(e){var t=[];e=Zr(e);for(var r=0;r<e.length;r++)"string"==typeof e[r]?t.push(e[r]):e[r].field&&t.push(e[r].field);return t}function to(e){return{field:e.field,title:e.title,format:e.format,editor:e.editor,values:e.values,editorOptions:f(!0,{format:e.format},e.editorOptions),label:e.title||e.field||""}}function ro(o){var l=o.find(">tr:not(.k-filter-row)"),a=function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")},i=e();l.length>1&&(i=l.find("th").filter(a).filter((function(){return this.rowSpan>1}))),i=i.add(l.last().find("th").filter(a));var n=r.attr("index");return[].sort.call(i,(function(r,o){r=e(r),o=e(o);var l=r.attr(n),a=o.attr(n);return l===t&&(l=e(r).index()),a===t&&(a=e(o).index()),(l=parseInt(l,10))>(a=parseInt(a,10))?1:l<a?-1:0}))}function oo(t){var r=t.closest("table"),o=e().add(t),l=t.closest(mt),a=r.find("tr:not(.k-filter-row)"),i=a.index(l);if(i>0){for(var n=a.eq(i-1).find("th:not(.k-group-cell,.k-hierarchy-cell)").filter((function(){return!e(this).attr("rowspan")})),s=0,d=l.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(t),c=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter((function(){return this.colSpan>1})),u=0;u<c.length;u++)s+=c[u].colSpan||1;for(d+=Math.max(s-1,0),s=0,u=0;u<n.length;u++){var p=n.eq(u);if(p.attr("data-colspan")?s+=p[0].getAttribute("data-colspan"):s+=1,d>=u&&d<s){o=oo(p).add(o);break}}}return o}function lo(t){var o=t.closest("thead"),l=e().add(t),a=t.closest(mt),i=o.find("tr:not(.k-filter-row)"),n=i.index(a)+t[0].rowSpan,s=r.attr("colspan");if(n<=i.length-1){var d,c=a.next(),u=t.prevAll(":not(.k-group-cell,.k-hierarchy-cell)");u=u.filter((function(){return!this.rowSpan||1===this.rowSpan}));var p=0;for(d=0;d<u.length;d++)p+=parseInt(u.eq(d).attr(s),10)||1;var h=c.find("th:not(.k-group-cell,.k-hierarchy-cell)"),f=parseInt(t.attr(s),10)||1;for(d=0;d<f;){c=h.eq(d+p),l=l.add(lo(c));var g=parseInt(c.attr(s),10);g>1&&(f-=g-1),d++}}return l}function ao(t,o,l,a){var n,s=t;if(i){let o=e(l);r.applyStylesFromKendoAttributes(o,["display","left","right"]),t.empty(),o.each(((e,r)=>t[0].appendChild(r)))}else(n=document.createElement(bt)).innerHTML="<table class='k-grid-table k-table'><tbody class='k-table-tbody'>"+l+"</tbody></table>",e(n).find("table").addClass(r.getValidCssClass("k-table-","size",a)),t=n.firstChild.firstChild,o[0].replaceChild(t,s[0]),t=e(t);return t}function io(e){e=e||{};let t={};return t[r.attr("style-display")]="none",f({},e,t)}function no(e){return delete(e=e||{})[r.attr("style-display")],e}function so(t,o,l,a){var i,n=t.find(">colgroup"),s=g(o,(function(e){return(i=e.width)&&0!==parseInt(i,10)?r.format(`<col ${r.attr("style-width")}="{0}" ${e.draggable?"class=k-drag-col":""} />`,typeof i===rt?i:i+gt):e.draggable?"<col class='k-drag-col' />":"<col />"}));(l||n.find(".k-hierarchy-col").length)&&s.splice(0,0,'<col class="k-hierarchy-col" />'),n.length&&n.remove(),n=e(new Array(a+1).join('<col class="k-group-col">')+s.join("")),r.applyStylesFromKendoAttributes(n,["width"]),n.is("colgroup")||(n=e("<colgroup/>").append(n)),t.prepend(n)}function co(e){var t,r,o,l={};for(r=0,o=e.length;r<o;r++)l[(t=e[r]).value]=t.text;return l}function uo(e,t,o,l){let a=o&&o.length&&h(o[0])&&"value"in o[0]?co(o)[e]:e;a=null!=a?a:"";let i=!1===l?a:r.htmlEncode(a);return t?r.format(t,i):i}function po(e,t,r){for(var o,l=0,a=e[l];a;){if(o=!!r||a.style.display!==Rt,r&&a.classList.contains("k-hidden")&&a.classList.remove("k-hidden"),o&&!Mt.test(a.className)&&--t<0){a.style.display=r?"":Rt;break}a=e[++l]}}function ho(t,r){for(var o,l,a=0,i=t.length;a<i;a+=1)(l=t.eq(a)).is(".k-grouping-row,.k-detail-row")?(o=l.children(":not(.k-group-cell):first,.k-detail-cell").last()).attr("colspan",parseInt(o.attr("colspan"),10)-1):(l.hasClass("k-grid-edit-row")&&(o=l.children(".k-edit-container")[0])&&((o=e(o)).attr("colspan",parseInt(o.attr("colspan"),10)-1),o.find("col").eq(r).remove(),l=o.find(mt).first()),po(l[0].cells,r,!1))}function fo(e){for(var t,r=[],o=0;o<e.length&&("field"in(t=e[o])&&"value"in t&&"items"in t);o++)r.push(t),t.hasSubgroups&&(r=r.concat(fo(t.items)));return r}function go(t,r){for(var o,l,a=0,i=t.length;a<i;a+=1)(l=t.eq(a)).is(".k-grouping-row,.k-detail-row")?(o=l.children(":not(.k-group-cell):first,.k-detail-cell").last()).attr("colspan",parseInt(o.attr("colspan"),10)+1):(l.hasClass("k-grid-edit-row")&&(o=l.children(".k-edit-container")[0])&&((o=e(o)).attr("colspan",parseInt(o.attr("colspan"),10)+1),so(o.find(">form>table"),kr(undefined),!1,0),l=o.find(mt).first()),po(l[0].cells,r,!0))}function mo(e,t,r){var o,l,a;for(r=r||1,l=0,a=e.length;l<a;l++)(o=e.eq(l).children(":not([hidden])").last()).attr("colspan",parseInt(o.attr("colspan"),10)+r),(o=t.eq(l).children(":not([hidden])").last()).attr("colspan",parseInt(o.attr("colspan"),10)-r)}function bo(e){var t,r,o=0,l=e.find(">colgroup>col");for(t=0,r=l.length;t<r;t+=1)o+=parseInt(l[t].style.width,10);return o}var _o=r.ui.DataBoundWidget.extend({init:function(t,o,l){var a=this;o=b(o)?{dataSource:o}:o,s.fn.init.call(a,t,o),l&&(a._events=l),Gt=r.support.isRtl(t),q=Gt?"a[class*='-i-caret-alt-left']":O,a._element(),a._ariaId(),a._columns(e.extend(!0,[],a.options.columns)),a._foreignKeyPromises?e.when.apply(null,a._foreignKeyPromises).then((function(){a._foreignKeyPromises=null,a._continueInit()})):a._continueInit()},_continueInit:function(){var t=this;t._dataSource(),t._stickyColumns(),t._tbody(),t._thead(),t._rowResizing(),t._groupable(),t._toolbar();let o=t.wrapper.find(".k-grid-toolbar .k-toolbar-button.k-grid-column-menu[ref-toolbar-tool]");o.length>0&&t._globalColumnsMenu(o),t._pageable(),t._setContentHeight(),t._templates(),t._navigatable(),t._initSelectableAggregates(),t._selectable(),t._statusBar(),t._clipboard(),t._paste(),t._details(),t._editable(),t._attachCustomCommandsEvent(),t._adaptiveColumns(),t._minScreenSupport(),t.options.autoBind?t.dataSource.fetch():(t._group=t._groups()>0,t._footer()),t._setInitialRtlScrollPosition(),t.options.contextMenu&&t._initContextMenu(),t.lockedContent&&(t.wrapper.addClass("k-grid-lockedcolumns"),t._resizeHandler=function(){t.resize()},e(window).on("resize"+P,t._resizeHandler)),t._initLoader(),r.notify(t),t._showWatermarkOverlay&&t._showWatermarkOverlay(t.wrapper[0])},events:[J,Y,"dataBinding","cancel",te,re,oe,N,j,K,U,$,V,B,W,G,ee,Q,Me,Le,qe,Z,X,Oe,Pe,Ve,Be,We,Ge,ne,"page","sort","filter","group","groupExpand","groupCollapse","kendoKeydown"],setDataSource:function(e){var t,o=this,l=o.options.scrollable;o.options.dataSource=e,o._dataSource(),o._pageable(),o._thead(),o._rowResizing(),l&&(l.virtual?(t=o.content.find(">.k-virtual-scrollable-wrap"),r.scrollLeft(t,To(t,Gt))):(t=o.tbody,r.scrollLeft(o.content,To(t,Gt)))),o.options.groupable&&o._groupable(),o.virtualScrollable&&o.virtualScrollable.setDataSource(o.options.dataSource),o.options.navigatable&&o._navigatable(),o.options.selectable&&o._selectable(),o.options.autoBind?o.dataSource.fetch():o._footer()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,allowCopy:!1,allowPaste:!1,navigatable:!1,pageable:!1,persistSelection:!1,editable:!1,encodeTitles:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",statusBarTemplate:null,search:!1,noRecords:!1,dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,contextMenu:!1,columnResizeHandleWidth:3,size:"medium",mobile:"",loaderType:"loadingPanel",messages:{loader:{loading:"Loading...",exporting:"Exporting..."},editable:{cancelDelete:"Cancel",confirmation:"Are you sure you want to delete this record?",confirmDelete:"Delete"},commands:{create:lr.create.text,cancel:lr.cancel.text,save:lr.save.text,destroy:lr.destroy.text,edit:lr.edit.text,update:lr.update.text,canceledit:lr.canceledit.text,excel:lr.excel.text,pdf:lr.pdf.text,search:lr.search.text,columns:lr.columns.text,select:"Select",selectRow:"Select Row",selectAllRows:"All rows",clearSelection:"Clear selection",copySelection:"Copy selection",copySelectionNoHeaders:"Copy selection (No Headers)",paste:"Paste (use CTRL/⌘ + V)",reorderRow:"Reorder row",reorderRowUp:"Up",reorderRowDown:"Down",reorderRowTop:"Top",reorderRowBottom:"Bottom",exportPdf:"Export to PDF",exportExcel:"Export to Excel",exportToExcelAll:"All",exportToExcelSelection:"Selection",exportToExcelSelectionNoHeaders:"Selection (No Headers)",sortAsc:"Sort Ascending",sortDesc:"Sort Descending",moveGroupPrevious:"Move previous",moveGroupNext:"Move next"},noRecords:"No records available.",expandCollapseColumnHeader:"",groupHeader:"Press ctrl + space to group",ungroupHeader:"Press ctrl + space to ungroup",itemsSelected:"items selected",dragHandleLabel:"Drag row",toolbarLabel:"grid toolbar",groupingHeaderLabel:"grid grouping header",filterCellTitle:"filter cell"},width:null},destroy:function(){var t,o,l=this;if(l._destroyColumnAttachments(),s.fn.destroy.call(l),this._navigatableTables&&(this._navigatableTables.off(P),this._navigatableTables=null,this._headertables=null),l._resizeHandler&&e(window).off("resize"+P,l._resizeHandler),l.pager&&l.pager.element&&l.pager.destroy(),l.timer&&clearTimeout(l.timer),l._progressTimeOut&&clearTimeout(l._progressTimeOut),l._collapseGroupsTimeOut&&clearTimeout(l._collapseGroupsTimeOut),l._endlessFetchTimeOut&&clearTimeout(l._endlessFetchTimeOut),l.pager=null,l._destroyGroupable(),(o=l.wrapper.data("kendoReorderable"))&&o.destroy(),(o=l.tbody?l.tbody.data("kendoReorderable"):null)&&o.destroy(),l.allowPaste){(l.content||l.table).off(ne+P,l.pasteHandler),l.unbind(l.pasteHandler)}l.pasteActionsDropDownList&&(l.pasteActionsDropDownList.destroy(),l.pasteActionsDropDownList=null),l.selectable&&l.selectable.element&&(l.selectable.destroy(),l.clearArea(),l._selectedIds=null,l.copyHandler&&(l.wrapper.off("keydown",l.copyHandler),l.unbind(l.copyHandler)),l.updateClipBoardState&&(l.unbind(l.updateClipBoardState),l.updateClipBoardState=null),l.clearAreaHandler&&l.wrapper.off("keyup",l.clearAreaHandler)),l.selectable=null,l._selectableAggregatesOptions=null,l.resizable&&(l.resizable.destroy(),l._resizeUserEvents&&(l._resizeHandleDocumentClickHandler&&e(document).off("click",l._resizeHandleDocumentClickHandler),l._resizeUserEvents.destroy(),l._resizeUserEvents=null),l.resizable=null),l._destroyRowResizing(),l._destroyVirtualScrollable(),l.editableUserEvents&&(l.editableUserEvents.destroy(),l.editableUserEvents=null),l._lockedContentUserEvents&&(l._lockedContentUserEvents.destroy(),l._lockedContentUserEvents=null),l._destroyEditable(),l.dataSource&&(l.dataSource.unbind(J,l._refreshHandler).unbind(T,l._progressHandler).unbind(H,l._errorHandler).unbind(ct,l._clearSortClasses),l._refreshHandler=l._progressHandler=l._errorHandler=l._sortHandler=null),t=l.element.add(l.wrapper).add(l.table).add(l.thead).add(l.wrapper.find(">.k-grid-toolbar")),l.content&&(t=t.add(l.content).add(l.content.find(">.k-virtual-scrollable-wrap"))),l.scrollables&&l.scrollables.first()&&(t=t.add(l.scrollables.first())),l.lockedHeader&&l._removeLockedContainers(),l.pane&&l.pane.destroy(),l._isMobile&&(l.wrapper.off("transitionend"+P),l.wrapper.off("contextmenu"+P)),l.minScreenResizeHandler&&e(window).off("resize",l.minScreenResizeHandler),l._detachColumnMediaResizeHandler(),l._draggableInstance&&l._draggableInstance.element&&l._draggableInstance.destroy(),l._draggableInstance=null,l._draggableRowsInstance&&l._draggableRowsInstance.element&&l._draggableRowsInstance.destroy(),l.tbodyContextMenu&&l.tbodyContextMenu.destroy(),l.theadContextMenu&&l.theadContextMenu.destroy(),l.loader&&l.loader.destroy(),l._draggableRowsInstance=null,t.off(P),t[0].kendoBindingTarget=null,r.destroy(l.wrapper),l.rowTemplate=l.altRowTemplate=l.lockedRowTemplate=l.lockedAltRowTemplate=l.detailTemplate=l.footerTemplate=l.groupFooterTemplate=l.lockedGroupFooterTemplate=l.noRecordsTemplate=null,l.scrollables=l.thead=l.tbody=l.element=l.table=l.content=l.statusBar=l.footer=l.wrapper=l.lockedTable=l.lockedContent=l.lockedHeader=l.lockedFooter=l._groupableClickHandler=l._groupRows=l._setContentWidthHandler=l.loaderOverlay=l.wrapperClone=null},getOptions:function(){this.options.dataSource=null;var t=f(!0,{},this.options);t.columns=r.deepExtend([],this.columns);var o=this.dataSource,l=o.options.data&&o._data;return o.options.data=null,t.dataSource=e.extend(!0,{},o.options),o.options.data=l,t.dataSource.data=l,t.dataSource.page=o.page(),t.dataSource.filter=e.extend(!0,{},o.filter()),t.dataSource.pageSize=o.pageSize(),t.dataSource.sort=o.sort(),t.dataSource.group=o.group(),t.dataSource.aggregate=o.aggregate(),t.dataSource.transport&&(t.dataSource.transport.dataSource=null),t.pageable&&t.pageable.pageSize&&(t.pageable.pageSize=o.pageSize()),t},setOptions:function(e){var t=this.getOptions();r.deepExtend(t,e),e.dataSource?e.dataSource.filter&&(t.dataSource.filter=e.dataSource.filter):t.dataSource=this.dataSource;var o=this.wrapper,l=this._events,a=this.element;if(this.destroy(),this.options=null,this._isMobile){var i=o.closest(r.roleSelector("pane")).parent();i.after(o),i.remove(),o.removeClass("k-grid-mobile")}o[0]!==a[0]&&(o.before(a),o.remove()),a.empty(),this.init(a,t,l),this._setEvents(t)},items:function(){return this.lockedContent?this._items(this.tbody).add(this._items(this.lockedTable.children("tbody"))):this._items(this.tbody)},_items:function(t,r){return t.children().filter((function(){var t=e(this);return!((r?t.hasClass("k-detail-row"):t.hasClass(Fe))||t.hasClass("k-detail-row")||t.hasClass("k-group-footer"))}))},dataItems:function(){var e=r.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){for(var t=e.length,o=new Array(2*t),l=t;--l>=0;)o[l]=o[l+t]=e[l];e=o}return e},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,t.thead&&t.thead.add(t.lockedHeader).find("th").each((function(){var t=e(this),r=t.data("kendoFilterMenu"),o=t.data("kendoColumnSorter"),l=t.data("kendoColumnMenu");r&&r.destroy(),o&&o.destroy(),l&&l.destroy()}))},_setInitialRtlScrollPosition:function(){const e=this;Gt&&e.scrollables&&r.scrollLeft(e.scrollables,0)},_attachCustomCommandsEvent:function(){var e,t,r,o=this,l=Zr(o.columns||[]);for(t=0,r=l.length;t<r;t++)(e=l[t].command)&&sr(o,o.wrapper,e)},_aria:function(){var e,t,o,l,a,i=this.wrapper,n=this._hasDetails()?"treegrid":this.options.navigatable?"grid":null,s=this.table,d=i.find(".k-grid-toolbar"),c=i.find(".k-grouping-header"),u=this._ariaGridId(),p=s.attr(et),h=this.thead.find(mt).length+this.wrapper.find(".k-grid-footer-wrap table tr").length,f=this._trailingColumns(),g=this.virtualScroll,m=this.options.pageable;s.attr(et,p>=0?p:0),n&&s.attr(Ht,n);const b=s.find("tbody"),_=s.find("thead"),k=s.find("tfoot"),v=s.find(mt);b.find(mt).length>0&&b.attr(Ht,Et),_.find(`${mt} th`).length>0&&_.attr(Ht,Et),k.find(mt).length>0&&k.attr(Ht,Et),v.children().length>0&&v.attr(Ht,It),s.find("th").attr(Ht,At),s.find("td").attr(Ht,zt),m&&this.dataSource.totalPages()>1||g&&g.rows?(a=this._groups()>0?-1:this._hasDetails()?h+2*this.dataSource.total():h+this.dataSource.total(),s.attr(vt,a)):this._hasDetails()&&(a=this._groups()>0?-1:h+2*this.dataSource.total(),s.attr(vt,a)),a&&a>0&&this._ariaRowIndex(),(g&&g.columns||!s.attr(wt)&&(s.find("td:not([group-header-spanned-hidden]):hidden").length>0||i.find(".k-grid-content-locked td:not([group-header-spanned-hidden]):hidden").length>0))&&(s.attr(wt,f+Zr(this.columns).length),this._ariaColumnIndex()),this.pager&&this.pager.element.attr("aria-controls",u),d.attr({role:"toolbar","aria-label":this.options.messages.toolbarLabel,"aria-controls":u}),c.attr({role:"toolbar","aria-label":this.options.messages.groupingHeaderLabel,"aria-controls":u}),t=this._ariaHeaderFooter("header","thead","th, td",At),o=this._ariaHeaderFooter("footer","tfoot","td",zt),i.find(".k-grid-content-locked").length>0&&this._ariaLockedContent(),(t||o)&&(l=[t,e=this.tbody.attr(ft)||r.guid(),o].join(" "),this.tbody.attr(ft,e),s.attr(kt,l)),this.options.groupable&&this._ariaGroupTitles()},_ariaColumnIndex:function(){var t,r,o,l,a=this._trailingColumns(),i=this.tbody.find(">tr").last().find("> td[data-virtual]"),n=this.thead.find(">tr").not(".k-filter-row"),s=this.wrapper.find(".k-grid-header-locked thead > tr").not(".k-filter-row"),d=Number.MAX_VALUE,c=0,u=0,p=0,h=0,f=function(r,o){var l=o.getAttribute("data-index"),a=Number(l),i=e(o).closest(".k-grid-header-locked");0===i.length&&a<d&&(d=a),i.length>0&&u<a&&(u=a),0===i.length&&c<a&&(c=a),null!==l?(o.setAttribute(Ct,Number(a)+1),t=Number(a)+1+o.getAttribute("colspan")):(o.setAttribute(Ct,t+1),t+=o.getAttribute("colspan"))};for(2===i.length?(p=Number(i[0].getAttribute("colspan")),h=Number(i[1].getAttribute("colspan"))):1===i.length&&0===i.prev().length?p=Number(i[0].getAttribute("colspan")):1===i.length&&1===i.prev().length&&(h=Number(i[0].getAttribute("colspan"))),r=0;r<s.length;r++)t=0,s.eq(r).find("th").each(f);for(r=0;r<n.length;r++)t=0,n.eq(r).find("th").each(f);for(r=0;r<=u;r++)o=r+a,this.wrapper.find(".k-grid-content-locked tbody > tr > td:nth-child("+(r+1)+")").attr(Ct,o+1);for(r=p;r<=c-d-h;r++)l=0===p?r+1:r-p+2,o=d+r+a,this.tbody.find("> tr > td:nth-child("+l+")").attr(Ct,o+1)},_ariaGroupTitles:function(){var e=this,t=e.dataSource.group(),o=e.wrapper.find(".k-grid-header th");o.each((function(t,r){r.getAttribute("title")===e.options.messages.ungroupHeader&&r.setAttribute("title",e.options.messages.groupHeader)})),t&&t.length>0&&t.forEach((function(t){var l=t.field,a=o.filter("["+r.attr("field")+"='"+l+"']");a.attr("title")===e.options.messages.groupHeader&&a.attr("title",e.options.messages.ungroupHeader)}))},_ariaHeaderFooter:function(e,t,o,l){var a,i=this.wrapper,n=i.find(".k-grid-"+e+" .k-grid-"+e+"-wrap table"),s=i.find(".k-grid-"+e+" .k-grid-"+e+"-locked table"),d="";if(n.length>0){d=(a=n.find(t+", tbody")).attr(ft)||r.guid(),n.attr(Ht,Rt);const e=n.find(mt);e.children().length>0&&(e.attr(Ht,It),a.attr(Ht,Et)),n.find(o).attr(Ht,l),a.attr({id:d})}return s.length>0&&this._ariaLocked(e,t,o,l),s.find("td").attr(Ht,zt),n.find("td").attr(Ht,zt),d},_ariaId:function(){var e=this.element.attr(ft)||"aria";e&&(this._cellId=e+"_active_cell")},_ariaGridId:function(){var e=this.table,t=e.attr(ft);return t||(t=r.guid(),e.attr(ft,t)),t},_ariaLocked:function(t,r,o,l){var a=this,i=a.wrapper,n=i.find(".k-grid-"+t+" .k-grid-"+t+"-wrap table"),s=i.find(".k-grid-"+t+" .k-grid-"+t+"-locked table"),d=n.find(mt),c=s.find(mt);s.attr(Ht,Rt),s.find(r+", tbody").attr(Ht,Rt),c.attr(Ht,Rt),s.find(o).attr(Ht,l),d.each((function(r,l){var i=[];i=(i=a._cellsIds(c.eq(r).find(o),"locked_"+t,r)).concat(a._cellsIds(e(l).find(o),t,r)),l.setAttribute(kt,i.join(" "))}))},_ariaLockedContent:function(){var t=this,r=t.table.find(mt),o=t.wrapper.find(".k-grid-content-locked table"),l=o.find(mt);o.attr(Ht,Rt),o.find("tbody").attr(Ht,Rt),l.attr(Ht,Rt),o.find("td").attr(Ht,zt),r.each((function(r,o){var a=[];a=(a=t._cellsIds(l.eq(r).find("td"),"locked_datacell",r)).concat(t._cellsIds(e(o).find("td"),"datacell",r)),o.setAttribute(kt,a.join(" "))}))},_ariaAddHiddenColIndex:function(){var e=this.virtualScroll||{},t=this.columns,r=this.table,o=Zr(t).length;e.columns||r.attr(wt)||(this._ariaColumnIndex(),r.attr(wt,o))},_ariaRemoveHiddenColIndex:function(){var e=this.virtualScroll||{},t=Zr(this.columns).length;e.columns||t!==Qr(this.columns).length||(this.wrapper.find("td, th").removeAttr(Ct),this.table.removeAttr(wt))},_ariaRowIndex:function(){var e,t,r=this.thead.find(">tr"),o=r.length,l=this.tbody.find(">tr"),a=this.wrapper.find(".k-grid-footer-wrap tfoot > tr"),i=this.dataSource.total(),n=this.dataSource.skip()||0,s=1,d=!1;for(this._hasDetails()&&(i*=2,n*=2),e=0;e<o;e++)r.eq(e).attr(yt,s+e);for(s=o+n,e=0;e<l.length;e++)t=l.eq(e),this._hasDetails()&&t.hasClass("k-master-row")?(s+=d?2:1,d=!0):(s+=1,d=!1),t.attr(yt,s);for(s=o+i+1,e=0;e<a.length;e++)a.eq(e).attr(yt,s+e)},_cellsIds:function(e,t,r){var o=[],l=this._ariaGridId();return e.each((function(e,a){var i=a.getAttribute(ft)||l+"_"+t+"_"+r+"_"+e;a.setAttribute(ft,i),o.push(i)})),o},_trailingColumns:function(){return this._groups()+(this._hasDetails()?1:0)},_element:function(){const t=this;let o=t.element;o.is("table")||(o=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),o.length||(o=e("<table />").appendTo(t.element))),o.addClass("k-grid-table k-tab