@progress/kendo-react-grid 7.1.1-develop.6 → 7.1.1-develop.7

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.
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- (function(m,J){typeof exports=="object"&&typeof module!="undefined"?J(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-data-query"),require("@progress/kendo-react-animation")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-data-tools","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-inputs","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-react-buttons","@progress/kendo-react-dropdowns","@progress/kendo-data-query","@progress/kendo-react-animation"],J):(m=typeof globalThis!="undefined"?globalThis:m||self,J(m.KendoReactGrid={},m.React,m.PropTypes,m.KendoReactCommon,m.KendoReactDataTools,m.KendoReactIntl,m.KendoSvgIcons,m.KendoReactInputs,m.KendoReactDateinputs,m.KendoReactPopup,m.KendoReactButtons,m.KendoReactDropdowns,m.KendoDataQuery,m.KendoReactAnimation))})(this,function(m,J,p,g,b,w,N,L,ve,ei,K,Z,ce,ti){"use strict";"use client";function ii(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}return t.default=r,Object.freeze(t)}const o=ii(J),V=r=>null;V.displayName="KendoReactGridColumn",V.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0},V.propTypes={field:p.string,title:p.string,editable:p.bool,sortable:p.oneOfType([p.bool,p.shape({allowUnsort:p.bool.isRequired})]),cell:p.any,filterCell:p.any,filterTitle:p.string,filterable:p.bool,filter:p.oneOf(["text","numeric","boolean","date"]),editor:p.oneOf(["text","numeric","boolean","date"]),width:p.oneOfType([p.string,p.number]),minResizableWidth:p.number,headerCell:p.any,footerCell:p.any,headerSelectionValue:p.bool,format:p.string,headerClassName:p.string,className:p.string,reorderable:p.bool,resizable:p.bool,orderIndex:p.number,groupable:p.bool,columnMenu:p.any,locked:p.bool};function O(r,t){const i=(r||"").split(".");let l=t;return i.forEach(e=>{l=l?l[e]:void 0}),l}function Ye(r,t,i,l,e,s,n=0){let a=n;for(let h=0;h<t.length;h++){if(!e||t[h].value===void 0||t[h].items===void 0){r[r.length]={dataIndex:l.index,dataItem:t[h],rowType:"data",level:n,expanded:s===void 0||O(s,t[h])},l.index++;continue}a=Math.max(a,n+1);const c=s===void 0||O(s,t[h])===void 0||O(s,t[h]);r[r.length]={dataIndex:-1,dataItem:t[h],level:n,rowType:"groupHeader",expanded:c},c&&(a=Math.max(Ye(r,t[h].items,i,l,e,s,n+1),a)),(i==="always"||c&&i==="visible")&&(r[r.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:n,expanded:c})}return a}function Je(r,t,i,l=0){let e=[];if(!r)return[];r&&r.length===void 0&&(r=[r]),r.forEach((n,a)=>{n=n.props?n.props:n;const h=t[a]||null,c=Je(n.children,h&&h.children||[],i,l+1);e.push(Object.assign({depth:l},V.defaultProps,c.length?{cell:()=>null,filterCell:()=>null}:{},h?{width:h.width,orderIndex:h.orderIndex}:{},n,{id:n.id?n.id:b.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.idPrefix,"column"),declarationIndex:e.length,children:c,rowSpan:0,colSpan:0,isAccessible:!0,left:h&&Math.floor(h.left),right:h&&Math.floor(h.right)}))});const s=(n,a)=>n.orderIndex===a.orderIndex?n.declarationIndex-a.declarationIndex:(n.orderIndex||0)-(a.orderIndex||0);if(e.sort(s),l===0){let n=[];const a=(h,c)=>h.forEach(d=>{d.parentIndex=c,a(d.children,n.push(d)-1)});return a(e,-1),n}return e}function ri(r,t,i,l){let e=[];Array.isArray(r)?e=r:r&&(e=r.data);const s=[];if(e.length>0){let n=e[0];if(t)for(let h=0;h<t.length;h++)n=n.items&&n.items[0];Object.getOwnPropertyNames(n).forEach(h=>{h!==i&&s.push(Object.assign({id:b.tableKeyboardNavigationTools.generateNavigatableId(`${l.prevId++}`,l.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},V.defaultProps,{field:h}))})}return s}const si=(r,t)=>{let i=r[t.parentIndex];for(;i;){if(i.footerCell)return!0;i=r[i.parentIndex]}return!1},li=r=>r.filter(t=>si(r,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),xe=r=>r.width!==void 0?Math.floor(parseFloat(r.width.toString()))+"px":void 0,Ze=r=>(r.sort((t,i)=>t.declarationIndex-i.declarationIndex),r.map(t=>{const{declarationIndex:i,parentIndex:l,depth:e,colSpan:s,rowSpan:n,index:a,kFirst:h,children:c,...d}=t;return c.length?{children:Ze(c),...d}:d})),Ee=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),Qe=17895697,de=(r,t)=>{if(!(!r&&!t))return t?r?{...r,...t,select:{...r.select||{},...t.select||{}},hierarchy:{...r.hierarchy||{},...t.hierarchy||{}},group:{...r.group||{},...t.group||{}},edit:{...r.edit||{},...t.edit||{}}}:t:r},et=r=>{const t=o.useCallback(d=>{r.selectionChange&&r.selectionChange({syntheticEvent:d})},[r.selectionChange]),i=g.useId(),l=O(r.field,r.dataItem),e=b.useTableKeyboardNavigation(r.id),s={colSpan:r.colSpan,style:r.style,className:r.className,"aria-colindex":r.ariaColumnIndex,role:"gridcell",...e},n=[o.createElement("span",{key:1,className:"k-checkbox-wrap"},o.createElement("input",{checked:typeof l=="boolean"&&l,id:i,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:t})),o.createElement("label",{className:"k-checkbox-label",htmlFor:i,key:2})],a=r.rowType!=="groupHeader"?o.createElement("td",{...s},n):null,h=r.rowType||"data",c=r.cells;if(c&&c.select&&c.select[h]){const d=c.select[h];return o.createElement(d,{...r,tdProps:s},n)}return r.render?r.render.call(void 0,a,r):a},Se="grid.noRecords",tt="grid.pagerInfo",it="grid.pagerFirstPage",rt="grid.pagerPreviousPage",st="grid.pagerNextPage",lt="grid.pagerLastPage",ot="grid.pagerItemsPerPage",oi="grid.pagerPage",ni="grid.pagerPageSizeAriaLabel",ai="grid.pagerOf",hi="grid.pagerTotalPages",Ie="grid.groupPanelEmpty",nt="grid.groupColumn",at="grid.ungroupColumn",we="grid.columnMenu",P="grid.filterClearButton",Q="grid.filterSubmitButton",ee="grid.filterTitle",ke="grid.sortAscending",ye="grid.sortDescending",Ne="grid.searchPlaceholder",Fe="grid.filterCheckAll",Ge="grid.filterChooseOperator",Me="grid.filterSelectedItems",ze="grid.sortAriaLabel",Le="grid.filterAriaLabel",De="grid.groupPanelAriaLabel",ht="grid.groupExpand",ct="grid.groupCollapse",dt="grid.detailExpand",pt="grid.detailCollapse",k={[dt]:"Expand detail row",[pt]:"Collapse detail row",[ht]:"Expand group",[ct]:"Collapse Group",[Se]:"No records available",[Ie]:"Drag a column header and drop it here to group by that column",[P]:"Clear",[Q]:"Filter",[ee]:"Filter",[ke]:"Sort Ascending",[ye]:"Sort Descending",[ze]:"Sortable",[nt]:"Group Column",[at]:"Ungroup Column",[we]:"Column menu",[ot]:"items per page",[tt]:"{0} - {1} of {2} items",[it]:"Go to the first page",[rt]:"Go to the previous page",[st]:"Go to the next page",[lt]:"Go to the last page",[oi]:"Page",[ni]:"Page size",[ai]:"of",[hi]:"{0}",[Ne]:"Search",[Fe]:"Check All",[Ge]:"Choose Operator",[Me]:"selected items",[Le]:"Filter",[De]:"Group panel","grid.filterEqOperator":"Is equal to","grid.filterNotEqOperator":"Is not equal to","grid.filterIsNullOperator":"Is null","grid.filterIsNotNullOperator":"Is not null","grid.filterIsEmptyOperator":"Is empty","grid.filterIsNotEmptyOperator":"Is not empty","grid.filterStartsWithOperator":"Starts with","grid.filterContainsOperator":"Contains","grid.filterNotContainsOperator":"Does not contain","grid.filterEndsWithOperator":"Ends with","grid.filterGteOperator":"Is greater than or equal to","grid.filterGtOperator":"Is greater than","grid.filterLteOperator":"Is less than or equal to","grid.filterLtOperator":"Is less than","grid.filterIsTrue":"Is true","grid.filterIsFalse":"Is false","grid.filterBooleanAll":"(All)","grid.filterAfterOrEqualOperator":"Is after or equal to","grid.filterAfterOperator":"Is after","grid.filterBeforeOperator":"Is before","grid.filterBeforeOrEqualOperator":"Is before or equal to","grid.filterAndLogic":"And","grid.filterOrLogic":"Or"};function ci(r){const t=r.replace(/^pager\.([a-z])/,(i,l)=>"grid.pager"+l.toUpperCase());return{messageKey:t,defaultMessage:k[t]}}const ut=r=>{let t=null,i=null,l=null;const e=O(r.field,r.dataItem),s=b.useTableKeyboardNavigation(r.id),n=w.useLocalization(),a=o.useCallback(d=>{d.isDefaultPrevented()||d.keyCode===g.Keys.enter&&r.onChange&&(d.preventDefault(),r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:d,field:r.field,value:!e}))},[r.dataItem,r.dataIndex,r.field,r.onChange,e]);if(r.rowType==="groupFooter")i={className:"k-table-td k-hierarchy-cell",role:"gridcell",...s},t=o.createElement("td",{...i});else if(r.rowType!=="groupHeader"){const d=e?pt:dt,f=n.toLanguageString(d,k[d]);i={className:"k-table-td k-hierarchy-cell",onKeyDown:a,"aria-expanded":!!e,role:"gridcell","aria-colindex":r.ariaColumnIndex,...s},l=o.createElement("a",{onClick:v=>{v.preventDefault(),r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:v,field:r.field,value:!e})},"aria-label":f,href:"#",tabIndex:-1},o.createElement(g.IconWrap,{name:e?"minus":"plus",icon:e?N.minusIcon:N.plusIcon})),t=o.createElement("td",{...i},l)}const h=r.rowType||"data",c=r.cells;if(c&&c.hierarchy&&c.hierarchy[h]){const d=c.hierarchy[h];return o.createElement(d,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,t,r):t},gt=b.TABLE_ROW_INDEX_ATTRIBUTE,U=b.TABLE_COL_INDEX_ATTRIBUTE,ft=r=>{const t=O(r.field,r.dataItem);let i=null;const l=g.classNames("k-table-td","k-grid-edit-cell",{["k-selected"]:r.isSelected},r.className),e=g.useId(),s=b.useTableKeyboardNavigation(r.id);let n=null,a=null;const h=o.useCallback(u=>{if(r.onChange){const E=u.target.type==="checkbox"?u.target.checked:u.target.value;r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u,value:E})}},[r.onChange,r.dataItem,r.dataIndex,r.field]),c=o.useCallback(u=>{r.onContextMenu&&r.onContextMenu.call(void 0,u,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),d=o.useCallback(u=>{r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u.syntheticEvent,value:u.value})},[r.onChange,r.dataItem,r.dataIndex,r.field]);switch(r.editor){case"numeric":{n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=o.createElement(L.NumericTextBox,{width:"100%",value:t===void 0?null:t,onChange:d}),i=o.createElement("td",{...n},a);break}case"date":n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=o.createElement(ve.DatePicker,{width:"100%",value:t,onChange:d}),i=o.createElement("td",{...n},a);break;case"boolean":n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=[o.createElement("span",{key:1,className:"k-checkbox-wrap"},o.createElement("input",{checked:t||!1,id:e,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:h})),o.createElement("label",{className:"k-checkbox-label",htmlFor:e,key:2})],i=o.createElement("td",{...n},a);break;default:n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=o.createElement("input",{style:{width:"100%"},className:"k-input",value:t||"",onChange:h}),i=o.createElement("td",{...n},a)}const f=r.editor||"text",v=r.cells;if(v&&v.edit&&v.edit[f]){const u=v.edit[f];return o.createElement(u,{...r,tdProps:n},a)}return r.render?r.render.call(void 0,i,r):i};class di extends o.Component{constructor(){super(...arguments),this.headerWrap=null,this.table=null,this.syncScroll=!1,this.scrollbarWidth=g.getScrollbarWidth(),this.onScroll=t=>{if(this.syncScroll){this.syncScroll=!1;return}if(!this.headerWrap)return;const i=this.headerWrap.scrollLeft,l=this.props.scrollableDataElement();l&&l.scrollLeft!==i&&(l.scrollLeft=i)}}get element(){return this.props.elemRef.current}componentDidMount(){const t=b.isRtl(this.element);this.props.columnResize&&this.props.columnResize.setIsRtl(t),this.forceUpdate()}setScrollLeft(t){this.headerWrap&&this.headerWrap.scrollLeft!==t&&(this.syncScroll=!0,this.headerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?o.createElement("div",{ref:this.props.elemRef,className:g.classNames("k-grid-header",{"k-grid-draggable-header":this.props.draggable}),role:"presentation"},o.createElement("div",{ref:t=>{this.headerWrap=t},className:"k-grid-header-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},onScroll:this.onScroll,role:"presentation"},o.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-header-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},o.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupHeader=t}},this.props.cols),o.createElement("thead",{className:"k-table-thead",role:"rowgroup",...b.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)))):o.createElement("thead",{role:"presentation",className:g.classNames("k-table-thead",{"k-grid-draggable-header":this.props.draggable}),...b.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)}}const mt=(...r)=>Object.assign({allowUnsort:!0,mode:"single"},...r);class pi extends o.PureComponent{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.pressHandler&&this.props.pressHandler(t.event,i)},this.onDrag=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.dragHandler&&this.props.dragHandler(t.event,i)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.releaseHandler&&this.props.releaseHandler(t.event)}}render(){return o.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,hint:this.props.dragClue,autoScroll:{boundaryElementRef:this.props.headerRef,direction:{horizontal:!0,vertical:!1}},scrollContainer:this.props.containerRef||void 0,ref:t=>{this.draggable=t}},o.createElement("tr",{className:"k-table-row",style:{touchAction:"none"},role:"row","aria-rowindex":this.props.ariaRowIndex},this.props.children))}}class He extends o.Component{constructor(){super(...arguments),this.state={show:!1},this._anchor=null,this._content=null,this.blurTimeout=void 0,this.willBlur=!1,this.blur=()=>{if(this.willBlur){this.willBlur=!1;return}clearTimeout(this.blurTimeout),this.blurTimeout=window.setTimeout(()=>{this.closeMenu()})},this.focus=()=>{clearTimeout(this.blurTimeout)},this.anchorClick=t=>{t.preventDefault(),this.setState({show:!this.state.show},()=>this.state.show&&this._content&&this._content.focus())},this.closeMenu=()=>{this.setState({show:!1})},this.onAnchorMouseDown=t=>{this.willBlur=this.state.show&&t.currentTarget===this._anchor},this.onAnchorKeyDown=t=>{var i;if(t.keyCode===g.Keys.tab){const l=t.target,e=l&&((i=l.closest(".k-grid"))==null?void 0:i.getElementsByClassName("k-grid-content")[0]);e&&e.scrollWidth>e.clientWidth&&l.scrollIntoView({inline:"center"})}}}render(){const{columnMenu:t,...i}=this.props,{column:l}=this.props,e=w.provideLocalizationService(this),s=l.title||l.field,n=s?`${s} `:"";return o.createElement(o.Fragment,null,o.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:a=>this._anchor=a,onClick:this.anchorClick,onMouseDown:this.onAnchorMouseDown,onKeyDown:this.onAnchorKeyDown,href:"#","aria-label":`${n}${e.toLanguageString(we,k[we])}`},o.createElement(g.IconWrap,{name:"filter",icon:N.filterIcon})),o.createElement(ei.Popup,{anchor:this._anchor,show:this.state.show,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},o.createElement("div",{ref:a=>this._content=a,tabIndex:0,onBlur:this.blur,onFocus:this.focus,style:{outline:"none"}},t&&o.createElement(t,{...i,onCloseMenu:this.closeMenu}))))}}class Ct extends o.Component{render(){const{columnMenuWrapperProps:t}=this.props,i=this.props.onClick?{onClick:this.props.onClick}:{},l=o.createElement("span",{className:"k-cell-inner"},o.createElement("span",{className:g.classNames("k-link",{"!k-cursor-default":!this.props.columnMenuWrapperProps.sortable}),...i},o.createElement("span",{className:"k-column-title"},this.props.title||this.props.field||" "),this.props.children),t.columnMenu&&o.createElement(He,{...t}));return this.props.render?this.props.render.call(void 0,l,this.props):l}}const ui={true:{asc:"desc",desc:"","":"asc"},false:{asc:"desc",desc:"asc","":"asc"}},gi={none:"none",asc:"ascending",desc:"descending"};class bt extends o.Component{constructor(t){super(t),this.serviceIndex=0,this.index=-1,this.cellKeyDown=(i,l)=>{i.isDefaultPrevented()||i.keyCode===g.Keys.enter&&this.cellClick(i,l)},this.cells=i=>i.map(l=>{const e=this.props.columns[l],s=this.props.sortable&&e.sortable,n=this.props.sort?this.props.sort.findIndex(I=>I.field===e.field):-1,a=n>=0&&this.props.sort[n].dir||"none",h=e.columnMenu===null?null:e.columnMenu||this.props.columnMenu,c=g.classNames({"k-first":e.kFirst,"k-filterable":!!h,"k-table-th":!0,"k-header":!0,"k-grid-header-sticky":e.locked,"k-sorted":this.props.sort&&this.props.sort.some(I=>I.field===e.field)},e.headerClassName),d=e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},f=w.provideLocalizationService(this).toLanguageString(ze,k[ze]);let v=e.isAccessible?{ariaSort:gi[a],role:"columnheader",ariaColumnIndex:e.ariaColumnIndex,ariaSelected:!1,ariaDescription:s?f:""}:{role:"presentation"};const u=e.declarationIndex>=0?++this.index:--this.serviceIndex,E=e.headerCell?e.headerCell:Ct,y=o.createElement(E,{key:1,field:e.field,onClick:s&&(I=>this.cellClick(I,e))||void 0,selectionChange:this.props.selectionChange,title:e.title,selectionValue:e.headerSelectionValue,render:this.props.cellRender,children:this.sortIcon(n),columnMenuWrapperProps:{column:{field:e.field,title:e.title,locked:e.locked,filter:e.filter,id:e.id},sortable:s&&this.props.sortable,sort:this.props.sort,onSortChange:this.props.sortChange,filter:this.props.filter,filterable:this.props.filterable&&e.filterable,filterOperators:this.props.filterOperators,onFilterChange:this.props.filterChange,group:this.props.group,groupable:this.props.groupable,onGroupChange:this.props.groupChange,columnMenu:h}}),x={...v,key:u,colSpan:e.colSpan,rowSpan:e.rowSpan,className:c,style:d,columnId:e.id,navigatable:e.navigatable,onKeyDown:s&&(I=>this.cellKeyDown(I,e))||void 0,role:"columnheader"},S=[y,this.props.columnResize&&this.props.columnResize.resizable&&e.resizable&&o.createElement(b.ColumnResizer,{key:2,resize:(I,B,_)=>this.props.columnResize&&this.props.columnResize.dragHandler(I,e,B,_),autofit:I=>this.props.columnResize&&this.props.columnResize.dblClickHandler(I,[e.id])})],F=de(this.props.cells,e.cells);if(F&&F.headerCell){const I=F.headerCell;return o.createElement(I,{key:u,thProps:x,index:l},S)}return o.createElement(b.HeaderThElement,{...x,key:u},S)}),this.cellClick=this.cellClick.bind(this)}cellClick(t,i){if(t.preventDefault(),!this.props.sortChange)return;const{allowUnsort:l,mode:e}=mt(this.props.sortable||!1,i.sortable||!1),s=(this.props.sort||[]).filter(h=>h.field===i.field)[0],n=ui[l][s&&s.dir||""],a=e==="single"?[]:(this.props.sort||[]).filter(h=>h.field!==i.field);n!==""&&i.field&&a.push({field:i.field,dir:n}),this.props.sortChange(a,t)}sortIcon(t){return this.props.sort?t>=0&&[o.createElement("span",{key:1,className:"k-sort-icon"},o.createElement(g.IconWrap,{name:"sort-"+this.props.sort[t].dir+"-small",icon:this.props.sort[t].dir==="asc"?N.sortAscSmallIcon:N.sortDescSmallIcon})),this.props.sort.length>1&&o.createElement("span",{key:2,className:"k-sort-icon"},o.createElement("span",{className:"k-sort-order"},t+1))]:null}render(){return this.serviceIndex=0,this.index=-1,this.props.columnsMap.map((t,i)=>this.props.pressHandler&&o.createElement(pi,{key:i,pressHandler:this.props.pressHandler,dragHandler:this.props.dragHandler,releaseHandler:this.props.releaseHandler,ariaRowIndex:i+1,dragClue:this.props.dragClue,headerRef:this.props.headerRef,containerRef:this.props.containerRef},this.cells(t))||o.createElement("tr",{key:i,className:"k-table-row",role:"row","aria-rowindex":i+1},this.cells(t)))}}w.registerForLocalization(bt);const fi=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],Oe={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},R=r=>r==="isnull"||r==="isnotnull"||r==="isempty"||r==="isnotempty",te=(r,t)=>r.map(i=>({text:t.toLanguageString(i.text,k[i.text]),operator:i.operator})),mi="eq",_e=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],Ci={text:!1,numeric:!1,date:!1,boolean:!0},vt=(r,t,i)=>{const l=xt(i.operators);let e=i.operator;switch(i.filterType){case"numeric":(!e||R(e))&&(e=l),r===null&&e===l&&(e="");break;case"date":(!e||R(e))&&(e=l),r===null&&e===l&&(e="");break;case"text":(!e||R(e))&&(e=l),!r&&e===l&&(e="");break;default:return}i.onChange({value:r,operator:e,syntheticEvent:t})},xt=(r,t)=>t?r[t][0].operator:r[0].operator,Re=r=>r||"text",Et=(r,t)=>{const i=r.target.value;t({value:i.operator,operator:i.operator===""?"":mi,syntheticEvent:r.syntheticEvent})},St=(r,t,i)=>{let l=t;const e=r.target.value;r.target.state.opened&&(R(e.operator)&&(l=null),t===null&&!R(e.operator)&&(l=void 0),i({value:l,operator:e.operator,syntheticEvent:r.syntheticEvent}))};class Ae extends o.Component{constructor(t){super(t),this._inputRef=o.createRef(),this.renderOperatorEditor=i=>{if(this.props.filterType==="boolean")return;const l=this.props.operators.find(e=>e.operator===this.props.operator)||null;return o.createElement(Z.DropDownList,{size:this.props.size,value:l,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:N.filterIcon,data:this.props.operators,textField:"text",title:i.toLanguageString(Ge,k[Ge]),popupSettings:{width:""}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const t=w.provideLocalizationService(this),i=o.createElement("div",{className:"k-filtercell"},o.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),o.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(t)," ",o.createElement(K.Button,{size:this.props.size,icon:"filter-clear",svgIcon:N.filterClearIcon,className:g.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:t.toLanguageString(P,k[P]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,i,this.props):i}inputChange(t,i){vt(t,i,this.props)}operatorChange(t){St(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Et(t,this.props.onChange)}clear(t){t.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:t}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(t,i,l){switch(t){case"numeric":return o.createElement(L.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return o.createElement(ve.DatePicker,{ref:this._inputRef,size:this.props.size,value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"boolean":{const e=s=>s==null;return o.createElement(Z.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:l.find(s=>s.operator===(e(i)?"":i)),data:l,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel})}default:return o.createElement(L.TextBox,{ref:this._inputRef,size:this.props.size,value:i||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}w.registerForLocalization(Ae);const bi="k-table-row k-filter-row";class It extends o.Component{headerCellClassName(t,i){let l=`${i?"k-grid-header-sticky":""}`;return this.props.sort&&this.props.sort.filter(e=>e.field===t).length>0&&(l+=" k-sorted"),l}setFilter(t,i,l,e){if(!this.props.filterChange)return;const s=[];(t!==""&&t!==null||i!=="")&&s.push({field:l,operator:i,value:t}),this.props.filter&&this.props.filter.filters&&(this.props.filter.filters||[]).forEach(h=>{const c=h;c&&c.field!==l&&s.push(c)});const n=this.props.filter&&this.props.filter.logic?this.props.filter.logic:"and";this.props.filterChange(s.length>0?{logic:n,filters:s}:null,e)}render(){const t=w.provideLocalizationService(this),i=this.props.filter&&this.props.filter.filters||[],l=a=>{if(a===void 0)return;const h=i.filter(c=>c.field===a);return h.length?h[0]:void 0};let e=0,s=-1;const n=this.props.columns.filter(a=>a.children.length===0).map(a=>{const h=Re(a.filter),c=l(a.field),d=a.filterable?t.toLanguageString(Le,k[Le]):void 0;let f=c&&c.value;f===void 0&&(f=h==="text"?"":null);const v=a.filterable&&{render:this.props.cellRender,field:a.field,title:a.filterTitle,value:f,operator:c&&c.operator,operators:te(this.props.filterOperators[h]||[],t),booleanValues:te(_e,t),filterType:h,ariaLabel:d,onChange:I=>{this.setFilter(I.value,I.operator,a.field,I.syntheticEvent)}},u=a.declarationIndex>=0?++s:--e,E={ariaLabel:d,ariaColumnIndex:a.ariaColumnIndex},y=a.left!==void 0?this.props.isRtl?{left:a.right,right:a.left}:{left:a.left,right:a.right}:{},x={columnId:b.tableKeyboardNavigationTools.getFilterColumnId(a.id),navigatable:a.navigatable,style:y,className:g.classNames("k-table-th",this.headerCellClassName(a.field,a.locked)||void 0),role:"columnheader",...E},S=v&&(a.filterCell?o.createElement(a.filterCell,{...v}):o.createElement(Ae,{size:this.props.size,...v})),F=de(this.props.cells,a.cells);if(F&&F.filterCell){const I=F.filterCell;return o.createElement(I,{key:u,...v,thProps:x,index:s},S)}return o.createElement(b.HeaderThElement,{key:u,...x},S)});return o.createElement("tr",{className:bi,"aria-rowindex":this.props.ariaRowIndex,role:"row"},n)}}w.registerForLocalization(It);class wt extends o.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.onPress&&this.props.onPress(t.event,i)},this.onDrag=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.onDrag&&this.props.onDrag(t.event,i)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(t.event)},this.sortChange=t=>{if(t.preventDefault(),this.props.onSortChange){const i=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(t,i)}},this.groupRemove=t=>{t.preventDefault(),t.stopPropagation(),this.props.onRemove&&this.props.onRemove(t)},this.onContextMenu=t=>{const i={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,t,{dataItem:{...i}})}}render(){const{dir:t}=this.props;return o.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:i=>{this.draggable=i}},o.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},o.createElement("span",null,o.createElement(g.IconWrap,{name:"sort-"+t+"-small",icon:t==="asc"?N.sortAscSmallIcon:N.sortDescSmallIcon,size:"small"})),o.createElement("span",{className:"k-chip-content"},this.props.title),o.createElement("span",{className:"k-chip-actions"},o.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},o.createElement(g.IconWrap,{name:"x-circle",icon:N.xCircleIcon,size:"small"})))))}}w.registerForLocalization(wt);class kt extends o.Component{constructor(){super(...arguments),this.onGroupRemove=(t,i)=>{const l=this.props.group.slice();l.splice(i,1),this.props.groupChange(l,t)},this.onGroupSortChange=(t,i,l,e)=>{const s=Object.assign({},l,{dir:e}),n=this.props.group.slice();n.splice(i,1,s),this.props.groupChange(n,t)}}render(){const i=(this.props.group||[]).map((l,e)=>o.createElement(wt,{key:e,index:e,dir:l.dir||"asc",title:this.props.resolveTitle(l.field),onRemove:s=>{this.onGroupRemove(s,e)},onSortChange:(s,n)=>{this.onGroupSortChange(s,e,l,n)},onPress:this.props.pressHandler,onDrag:this.props.dragHandler,onRelease:this.props.releaseHandler,onContextMenu:this.props.onContextMenu}));return o.createElement("div",{ref:this.props.refCallback,className:"k-grouping-header",role:"toolbar","aria-label":w.provideLocalizationService(this).toLanguageString(De,k[De]),"aria-controls":this.props.ariaControls||""},o.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},i),o.createElement("div",{className:"k-grouping-drop-container"},!i.length&&w.provideLocalizationService(this).toLanguageString(Ie,k[Ie])," "))}}w.registerForLocalization(kt);class vi extends o.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=g.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(t){this.footerWrap&&(this.footerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?o.createElement("div",{className:"k-grid-footer",role:"presentation"},o.createElement("div",{ref:t=>{this.footerWrap=t},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},o.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},o.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupFooter=t},role:"presentation"},this.props.cols),o.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):o.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}class xi{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=o.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=o.createRef(),this.tableTransform="",this.prevScrollPos=0,this.tableTranslate=0,this.scrollSyncing=!1,this.reactVersion=Number.parseFloat(o.version),this.topItems=(i,l)=>{if(!this.container||l)return{topItemsCount:0,topItemsHeight:0};const e=this.container.clientHeight,s=Math.ceil(e/i[0].line),n=Math.ceil((i.length-s)/2);let a=0;for(let h=0;h<n;h++)a+=i[h].line+i[h].acc;return{topItemsCount:n,topItemsHeight:a,itemsNeededOnScreen:s+s/2}},this.horizontalScrollbarHeight=()=>this.container?this.container.offsetHeight-this.container.clientHeight:0,t&&(this.topCacheCount=4,this.attendedSkip=-this.topCacheCount),this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}get rowHeights(){const t=[],i=this.tableBodyRef.current&&this.tableBodyRef.current.children||[];let l=0;for(let e=0;e<i.length;e++){if(i[e].className.indexOf("k-grouping-row")>-1){l+=i[e].scrollHeight;continue}i[e].className.indexOf("k-detail-row")>-1?t[t.length-1].line+=i[e].scrollHeight:(t.push({line:i[e].scrollHeight,acc:l}),l=0)}return t}changePage(t,i){this.attendedSkip=t-this.topCacheCount,this.PageChange&&this.PageChange({skip:Math.max(0,t-this.topCacheCount),take:this.pageSize},i)}translate(t,i){this.tableTranslate=t,this.scrollableVirtual&&this.table&&(this.reactVersion<=17||i?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}localScrollUp(t){if(!this.container)return;const i=this.rowHeights,l=this.container.scrollTop;let e=this.tableTranslate,s=0;const{topItemsCount:n,topItemsHeight:a,itemsNeededOnScreen:h}=this.topItems(i,!!this.topCacheCount),c=l-e;if(!(c>a||i.length<=h)){for(;s<this.topCacheCount+this.attendedSkip-this.realSkip+n&&this.propsSkip-s>0&&!(e+(i[i.length-1-s].line+i[i.length-1-s].acc)+c<=l);)e-=i[i.length-1-s].line+i[i.length-1-s].acc,s++;if(s===0&&this.topCacheCount===0&&this.attendedSkip>0&&(e=Math.max(e-i[0].line,0),s=1),this.propsSkip-s<=0&&e>l){this.translate(0),this.changePage(0,t),this.container.scrollTop=0;return}if(e>l&&(e=l),e!==this.tableTranslate){this.translate(Math.max(0,e-a));const d=Math.max(0,this.propsSkip-s-n);this.changePage(d,t)}}}localScrollDown(t){if(!this.container)return;const i=this.rowHeights,l=this.container.scrollTop;let e=this.tableTranslate,s=0;const{topItemsCount:n,topItemsHeight:a,itemsNeededOnScreen:h}=this.topItems(i,!!this.topCacheCount);for(;s<i.length-this.topCacheCount&&!(e+i[s].line+i[s].acc>l);)e+=i[s].line+i[s].acc,s++;n>this.propsSkip+s||i.length<=h||(s>=i.length-this.topCacheCount&&this.propsSkip+s>=this.total?(this.translate(e-a),this.changePage(this.total-1-n,t)):e!==this.tableTranslate&&this.propsSkip+s-n!==this.propsSkip&&(this.translate(e-a),this.changePage(this.propsSkip+s-n,t)))}scrollNonStrict(t){const i=this.total*this.prevScrollPos/this.containerHeight;let l=Math.floor(i);l>=this.total&&(l=this.total-1);const e=Math.min(i-l,1);let s=0;const n=l-this.propsSkip,a=this.rowHeights;n>=0&&n<=1?s=-((a[0].line+a[0].acc)*e):n===-1&&(s=-((a[a.length-1].line+a[a.length-1].acc)*e));const{topItemsCount:h,topItemsHeight:c}=this.topItems(a,!!this.topCacheCount);this.translate(Math.max(0,s-c-this.horizontalScrollbarHeight()+this.containerHeight*i/this.total)),this.changePage(l-h,t)}scrollHandler(t){if(!this.scrollableVirtual)return;if(this.scrollSyncing||!this.container||!this.table){this.scrollSyncing=!1;return}const i=this.container.scrollTop,l=this.prevScrollPos;if(this.prevScrollPos=i,this.askedSkip!==void 0){this.translate(this.containerHeight*this.askedSkip/this.total),this.changePage(this.askedSkip,t),this.prevScrollPos=i,this.askedSkip=void 0;return}i-l<0&&i>this.tableTranslate-this.table.scrollHeight/10?this.localScrollUp(t):i-l>0&&i<this.tableTranslate+this.table.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t),this.prevScrollPos=i}}class yt{constructor(t=0,i,l,e){this.total=t,this.offsets=[],this.heights=[];let s=0;for(let n=0;n<t;n++){this.offsets.push(s);const a=e&&e[n].expanded&&e[n].rowType==="data"?l:i;s+=a,this.heights.push(a)}}height(t){return this.heights[t]}index(t){if(t<0)return;const i=this.offsets.reduce((l,e,s)=>{if(l!==void 0)return l;if(e===t)return s;if(e>t)return s-1},void 0);return i===void 0?this.total-1:i}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],i=this.heights[this.heights.length-1];return t+i}}class Nt{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=o.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=o.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(o.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(t,i){this.scrollableVirtual&&this.table&&(Ee||this.reactVersion<=17||i?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}changePage(t,i){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},i)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(t){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const i=this.container.scrollTop,l=this.lastScrollTop>=i,e=!l;this.lastScrollTop=i;let s=this.rowHeightService.index(i),n=this.rowHeightService.offset(s);const{offsetHeight:a}=this.containerRef.current,h=this.rowHeightService.index(i+a);if(e&&h>=this.lastLoaded&&this.lastLoaded<this.total){const c=s+this.pageSize-this.total;c>0&&(s=s-c,n=this.rowHeightService.offset(s)),this.firstLoaded=s,this.translate(n);let d=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(d,this.total),this.changePage(this.firstLoaded,t)}else if(l&&s<this.firstLoaded){const c=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(s-c,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,t)}}}const Ei=1,Si=20;class Ii{constructor(t){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=i=>{this.isRtl=i},this.dragHandler=(i,l,e,s)=>{const n=i.originalEvent;s||(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation());const a=e.closest("th");if(!a||!a)return;const h=a.clientWidth;let c=h;if(this.isRtl?c+=e.getBoundingClientRect().right-e.offsetWidth/2-i.clientX:c+=i.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!s&&Math.abs(c-h)<1)return;this.fixateInitialWidths(a.parentElement.clientWidth),this.setWidths(l,Math.floor(c)/h);const d=this.columns.filter(f=>!f.children.length).findIndex(f=>f.id===l.id);this.onResize(d,h,c,n,s,l.id)},this.dblClickHandler=(i,l)=>{const e=this.columns.filter(v=>l.indexOf(v.id)>-1);if(!this.colGroupMain||!e.length)return;const s={},n=e;for(;n.length>0;){const v=n.pop();if(!v)break;v.children.length?n.push(...v.children):s[v.id]=v}const a=this.columns.filter(v=>!v.children.length),h=[];a.forEach((v,u)=>{s[v.id]&&h.push(u)});const c=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(c.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(c.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),c.forEach(v=>v.classList.add("k-autofitting"));let f=[];d.forEach(v=>{h.forEach(u=>{v.children[u]&&(v.children[u].width="",f[u]=Math.max(f[u]||0,v.children[u].offsetWidth+Ei))})}),d.forEach(v=>{h.forEach(u=>{v.children[u]&&(v.children[u].width=f[u]+"px",a[u].width=f[u])})}),c.forEach(v=>v.classList.remove("k-autofitting")),this.onResize(h[0],0,0,i,!0,l[0])},this.updateColElements=i=>{const l=this.columns.filter(s=>!s.children.length);let e=1e-10;for(let s=0;s<i.length;s++){const n=i[s],a=l.findIndex(f=>f.id===n.id),h=parseFloat((n.width||0).toString()),c=Math.floor(h);e+=h-c;const d=c+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[a]){const f=parseInt(this.colGroupMain.children[a].width,10);this.colGroupMain.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,n,f-d)}if(this.colGroupHeader&&this.colGroupHeader.children[a]){const f=parseInt(this.colGroupHeader.children[a].width,10);this.colGroupHeader.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,n,f-d)}if(this.colGroupFooter&&this.colGroupFooter.children[a]){const f=parseInt(this.colGroupFooter.children[a].width,10);this.colGroupFooter.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,n,f-d)}}},this.onResize=t}fixateInitialWidths(t){const i=this.columns.filter(n=>!n.children.length);let l=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let n=0;n<e.length;n++)e[n].width?t-=parseFloat(e[n].width):l++;if(l===0)return;const s=Math.floor(t/l);for(let n=0;n<e.length;n++){const a=e[n];a.width||(a.width=s,i[n].width=s.toString(),this.colGroupHeader&&(this.colGroupHeader.children[n].width=s),this.colGroupFooter&&(this.colGroupFooter.children[n].width=s))}}setWidths(t,i){const l=this.columns.findIndex(n=>n.id===t.id),e=[];let s=t.children.length;for(let n=l+1;s>0&&n<this.columns.length;n++,s--){const a=this.columns[n];a.children.length?s+=a.children.length:e.push(a)}return e.length===0&&e.push(t),e.forEach(n=>{let a=n.width?parseFloat(n.width.toString())*i:0;const h=n.minResizableWidth===void 0?10:n.minResizableWidth;a<h&&(a=h),n.width=a}),this.updateColElements(e),e}updateNextLockedCol(t,i,l){const e=i.index,s=this.colGroupMain.parentElement.closest(".k-grid"),n=s==null?void 0:s.clientWidth,a=this.columns.filter(h=>h.locked).map(h=>parseInt(h.width+"",10)).reduce((h,c)=>h+c,0);!i.locked||n<=a+Si||this.columns.forEach(h=>{if(h!=null&&h.locked&&l){const c=t==null?void 0:t.querySelectorAll('[aria-colindex="'+h.ariaColumnIndex+'"]');c==null||c.forEach(d=>{const f=d.style;this.isRtl?(h.index>e&&f&&f.right&&(f.right=parseInt(f.right,10)-l+"px"),h.index<e&&f&&f.left&&(f.left=parseInt(f.left,10)-l+"px")):(h.index>e&&f&&f.left&&(f.left=parseInt(f.left,10)-l+"px"),h.index<e&&f&&f.right&&(f.right=parseInt(f.right,10)-l+"px"))})}})}}class Ft{constructor(t,i,l){this.refDragElementClue=o.createRef(),this.refDropElementClue=o.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=e=>{this.groupPanelDivElement=e&&e.children?e.children[0]:e},this.pressHandler=(e,s)=>{const n=this.getColumnIndex(e,s);if(this.startGroup=this.getGroupIndex(e),n>=0){const a=this.columns[n];(a.reorderable&&this.reorderable||a.groupable&&this.groupable)&&(this.startColumn=n)}},this.dragHandler=(e,s)=>{if(e.isTouch||e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(e,s);const n=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(e)?n&&n.length?n.length:0:this.getGroupIndex(e);const a=!this.isValid();a&&(this.currentColumn=-1,this.currentGroup=-1);const h=this.currentColumn>=0?s.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(e)?e.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(e,s,h,a),this.updateDropElementClue(e,s,h,a)},this.releaseHandler=e=>{const s=this.startColumn,n=this.currentColumn,a=this.startGroup,h=this.currentGroup;e.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const c=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,c&&(s>=0&&n>=0?this.columnReorder(s,n,e.originalEvent):a>=0&&h>=0?this.groupReorder(a,h,e.originalEvent):s>=0&&h>=0&&this.columnToGroup(s,h,e.originalEvent))},this.columnReorder=t,this.groupReorder=i,this.columnToGroup=l}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(t,i){if(!i||i.parentElement===this.groupPanelDivElement)return-1;const l=b.getIndex(t,i);if(l===-1)return-1;for(let e=0;e<i.parentNode.children.length;e++)if(i.parentNode.children[e]===i)return this.columns.findIndex(s=>s.index===l&&s.depth===e);return-1}isTargetGroupingContainer(t){const i=t.originalEvent.target;return i.className.indexOf?i.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(t){return b.getIndex(t,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(t,i,l,e){if(!this.dragElementClue)return;const s=this.startColumn>=0?i.children[this.columns[this.startColumn].index].innerText:i.innerText;this.dragElementClue.setState({visible:!0,top:t.pageY+10,left:t.pageX,innerText:s,status:e||!l?"k-i-cancel":"k-i-plus"})}updateDropElementClue(t,i,l,e){if(!this.dropElementClue)return;if(e||!l){this.dropElementClue.setState({visible:!1});return}const s=l.getBoundingClientRect(),a=(l.closest(".k-grouping-header")||l).getBoundingClientRect();let h=s.left+t.pageX-t.clientX-6;!this.isTargetGroupingContainer(t)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(h+=s.width);const c=a.top+t.pageY-t.clientY;this.dropElementClue.setState({visible:!0,top:c,left:h,height:this.currentColumn>=0?i.clientHeight:a.height})}}const Gt=r=>{let t=null;const i=w.useInternationalization(),l=b.useTableKeyboardNavigation(r.id),e=o.useCallback(c=>{r.onContextMenu&&r.onContextMenu.call(void 0,c,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]);let s=null,n=null;if(r.rowType==="groupFooter")s={onContextMenu:e,className:r.className},t=o.createElement("td",{...s});else if(r.rowType!=="groupHeader"){if(r.field!==void 0){const d=O(r.field,r.dataItem);d!=null&&(n=r.format?i.format(r.format,d):d.toString())}const c=g.classNames("k-table-td",r.className,{"k-selected":r.isSelected});s={onContextMenu:e,colSpan:r.colSpan,style:r.style,className:c,role:"gridcell","aria-colindex":r.ariaColumnIndex,"aria-selected":r.isSelected,[U]:r.columnIndex,...l},t=o.createElement("td",{...s},n)}const a=r.rowType||"data",h=r.cells;if(h&&h[a]){const c=h[a];return o.createElement(c,{...r,tdProps:s},n)}return r.render?r.render.call(void 0,t,r):t},Ke=r=>{let t=null;const{columnIndex:i,level:l,columnsCount:e,rowType:s,dataItem:n,field:a,onChange:h,expanded:c,render:d,dataIndex:f,ariaColumnIndex:v,isRtl:u}=r,E=a||"",y=b.useTableKeyboardNavigation(r.id),x=w.useLocalization();let S=null,F=null,I=null;const B=o.useCallback(D=>{D.isDefaultPrevented()||D.keyCode===g.Keys.enter&&h&&(D.preventDefault(),h({dataItem:n,dataIndex:f,syntheticEvent:D,field:void 0,value:!c}))},[c,h,n,f]),_=o.useCallback(D=>{r.onContextMenu&&r.onContextMenu.call(void 0,D,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),fe=(D,Ve)=>{const me=c?ct:ht,Ue=x.toLanguageString(me,k[me]);return S={className:"k-table-td",style:{...r.style,...Ve},colSpan:D,key:"g-colspan",role:"gridcell",["aria-selected"]:!1,["aria-expanded"]:c,["aria-colindex"]:v,onKeyDown:B,onContextMenu:_,...y},I=o.createElement("p",{className:"k-reset"},o.createElement("a",{onClick:le=>{le.preventDefault(),h&&h({dataItem:n,dataIndex:f,syntheticEvent:le,field:void 0,value:!c})},href:"#",tabIndex:-1,"aria-label":Ue},o.createElement(g.IconWrap,{name:c?"caret-alt-down":u?"caret-alt-left":"caret-alt-right",icon:c?N.caretAltDownIcon:u?N.caretAltLeftIcon:N.caretAltRightIcon})),n[E]instanceof Date&&n[E].toString?n[E].toString():n[E]),o.createElement("td",{...S,key:S.key},I)};i===void 0||l===void 0||i<l||e===void 0||s!=="groupHeader"||n[E]===void 0?(S={style:r.style,key:"g"+i,className:g.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":r.locked}),role:"gridcell",onContextMenu:_},t=o.createElement("td",{...S,key:S.key})):i<=l&&!r.locked?t=fe(e-i,{}):i<=l&&r.locked&&(F={className:"k-table-td",role:"gridcell",colSpan:e-i,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:_},t=o.createElement(o.Fragment,null,fe(0,{position:"sticky",zIndex:2}),o.createElement("td",{...F})));const se=r.rowType||"data",X=r.cells;if(X&&X.group&&X.group[se]){const D=X.group[se];return o.createElement(D,{...r,tdProps:S,td2Props:F},I)}return d?d.call(void 0,t,r):t};class Mt extends o.Component{render(){const t=g.classNames("k-table-row",{"k-table-group-row k-grouping-row":this.props.rowType==="groupHeader","k-group-footer":this.props.rowType==="groupFooter","k-master-row":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter","k-table-alt-row k-alt":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter"&&this.props.isAltRow,"k-selected":this.props.isSelected,"k-grid-edit-row":this.props.isInEdit}),i=o.createElement("tr",{id:this.props.id,onClick:this.props.onClick,onDoubleClick:this.props.onDoubleClick,className:t,style:{height:this.props.rowHeight?this.props.rowHeight+"px":"",visibility:this.props.isHidden?"hidden":""},role:"row","aria-rowindex":this.props.ariaRowIndex,"absolute-row-index":this.props.absoluteRowIndex,key:this.props.absoluteRowIndex,[gt]:this.props.rowType==="data"?this.props.dataIndex:void 0},this.props.children);return this.props.render?this.props.render.call(void 0,i,this.props):i}}class wi extends o.Component{get _inputId(){return this.props.id}render(){const{columnMenuWrapperProps:t}=this.props,i=[o.createElement("span",{key:0,className:"k-checkbox-wrap"},o.createElement("input",{checked:this.props.selectionValue,id:this._inputId,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:l=>this.props.selectionChange({field:this.props.field,syntheticEvent:l})})),o.createElement("label",{key:1,className:"k-checkbox-label",htmlFor:this._inputId}),t.columnMenu&&o.createElement(He,{...t})];return this.props.render?this.props.render.call(void 0,i,this.props):i}}const ki=g.withIdHOC(wi);class pe extends o.Component{render(){return this.props.children||w.provideLocalizationService(this).toLanguageString(Se,k[Se])}}pe.displayName="KendoReactGridNoRecords",w.registerForLocalization(pe);class yi extends o.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(t,i)=>{const l={colSpan:t.colSpan!==1?t.colSpan:void 0,style:t.left!==void 0?this.props.isRtl?{left:t.right,right:t.left}:{left:t.left,right:t.right}:{},className:g.classNames("k-table-td",t.locked&&t.left!==void 0?"k-grid-footer-sticky":""),key:i,role:"gridcell",["aria-colindex"]:t.ariaColumnIndex},e={field:t.field,ariaColumnIndex:t.ariaColumnIndex,...l},s=de(this.props.cells,t.cells);if(s&&s.footerCell){const n=s.footerCell;return o.createElement(n,{...e,tdProps:l,index:i})}return t.footerCell&&o.createElement(t.footerCell,{...e,key:i})||o.createElement("td",{...l})}}get element(){return this._element}render(){return o.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},li(this.props.columns).map(this.renderCell))}}const Ni=({buttonCount:r=10,info:t=!0,type:i="numeric",pageSizes:l=void 0,previousNext:e=!0,responsive:s=void 0,pageSizeValue:n=void 0})=>({buttonCount:r,info:t,pageSizes:l===!0?[5,10,20]:l||void 0,previousNext:e,responsive:s!==!1,type:i,pageSizeValue:n}),Fi=r=>Ni(r===!0?{}:r),zt={name:"@progress/kendo-react-grid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Gi=r=>{const{colSpan:t,ariaColIndex:i,dataItem:l,dataIndex:e,id:s}=r,n=b.useTableKeyboardNavigation(s),a=o.useCallback(h=>{r.onContextMenu&&r.onContextMenu.call(void 0,h,r.dataItem)},[r.onContextMenu,r.dataItem]);return o.createElement("td",{onContextMenu:a,className:"k-table-td k-detail-cell",colSpan:t,"aria-colindex":i,role:"gridcell",...n},o.createElement(r.detail,{dataItem:l,dataIndex:e}))},Mi=r=>{const t=b.useTableKeyboardNavigation(r.id);return o.createElement("td",{className:"k-table-td k-hierarchy-cell",...t,role:"gridcell"})};let $=class extends o.Component{constructor(t){super(t),this._columns=[],this._columnsMap=[[]],this._columnsMutations=0,this._resized=!1,this._shouldUpdateLeftRight=!0,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this._data=[],this._slicedData=void 0,this.wrapperScrollTop=0,this.showLicenseWatermark=!1,this.headerRef=o.createRef(),this.headerElementRef=o.createRef(),this._element=null,this.tableElement=null,this.containerRef=o.createRef(),this.tableBodyRef=o.createRef(),this._footer=null,this.forceUpdateTimeout=void 0,this.isRtl=!1,this.observer=null,this.handleIntersection=e=>{const s={rowIndex:this.rowIndex};e.forEach(n=>{n.isIntersecting||this.setCurrentOnTop(s)})},this.setCurrentOnTop=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.observer&&this.observer.disconnect();const{rowIndex:s}=e;if(this.props.scrollable==="virtual")this.vs.askedSkip=s,this.vs.container.scroll(0,Math.round(this.vs.askedSkip/this.vs.total*this.vs.container.scrollHeight));else if(this.element){const n=s<1?this.element.querySelector("tbody > tr:nth-child(1)"):this.element.querySelector(`tbody > tr:nth-child(${s+1})`);n&&this.containerRef.current&&(this.containerRef.current.scrollTop=n.offsetTop)}},this.scrollIntoView=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.rowIndex=e.rowIndex;const{rowIndex:s}=e,n=this.element;if(this.observer&&n){this.observer.disconnect();const a=n.querySelector(`[absolute-row-index="${s}"]`);a?this.observer.observe(a):this.setCurrentOnTop(e)}},this.fitColumns=e=>{this.columnResize.dblClickHandler(null,e)},this.onContextMenu=(e,s,n)=>{if(this.props.onContextMenu){const a={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,dataItem:s,field:n};this.props.onContextMenu.call(void 0,a)}},this.getVirtualScroll=e=>{const{rowHeight:s,detailRowHeight:n,detail:a,expandField:h,groupable:c}=e,d=this.isAllData(),f=s!==void 0&&s>0,v=n!==void 0&&n>0,u=c===!0||typeof c=="object"&&c.enabled!==!1;return!f||u&&!d||!!(a&&h)&&(!v||!d)?xi:Nt},this.isAllData=()=>{const{data:e,total:s}=this.props;return Array.isArray(e)?e.length===s:e?s===e.total:!1},this.initializeVirtualization=(e,s)=>{if(this.reInitVirtualization(this.props.scrollable==="virtual",this.props.total,this.props.filter,this.props.group,this.props.sort,s||this.props.rowHeight===void 0||this.props.rowHeight===0),this.vs.fixedScroll=this.props.fixedScroll||!1,this.vs.PageChange=this.pageChange,this.vs.realSkip=this.props.skip||0,this.vs.pageSize=(this.props.take!==void 0?this.props.take:this.props.pageSize)||0,this.vs.scrollableVirtual=this.props.scrollable==="virtual",this.vs.total=e,this.vs.propsSkip=(this.props.skip||0)+(this.props.scrollable==="virtual"?this.vs.topCacheCount+(this.vs.attendedSkip-(this.props.skip||0)):0),this.props.rowHeight!==void 0&&this.props.rowHeight>0&&!s){const n=this.props.rowHeight*e;this.vs.containerHeight=Ee?Math.min(Qe,n):n}else this.vs.containerHeight=1533915;if(this.vs.containerRef=this.containerRef,this.vs.tableBodyRef=this.tableBodyRef,this.vs.table=this.tableElement,this._slicedData=void 0,this.vs instanceof Nt){const{rowHeight:n=0,detail:a,expandField:h}=this.props;let{detailRowHeight:c=0}=this.props;c=a&&h?c:n,this.isAllData()?(this.vs.total=this._data.length,this._slicedData=this._data.slice(this.vs.realSkip,this.vs.realSkip+this.vs.pageSize),this.vs.rowHeightService=this.rowHeightService(this.vs,this._data.length,n,c,this._data)):this.vs.rowHeightService=new yt(e,n,c);const d=this.vs.rowHeightService.totalHeight();this.vs.containerHeight=Ee?Math.min(Qe,d):d}},this.scrollHandler=e=>{if(e.target!==e.currentTarget)return;clearTimeout(this.forceUpdateTimeout),this.vs.table=this.tableElement;const s=e.currentTarget.scrollLeft,n=e.currentTarget.scrollTop;this.props.columnVirtualization&&(!this.vs.scrollableVirtual||n===this.wrapperScrollTop)&&(this.forceUpdateTimeout=window.setTimeout(()=>{this.forceUpdate()},0)),this._header&&this._header.setScrollLeft(s),this._footer&&this._footer.setScrollLeft(s),this.vs&&n!==this.wrapperScrollTop&&this.vs.scrollHandler(e),g.dispatchEvent(this.props.onScroll,e,this,void 0),this.wrapperScrollTop=n},this.onKeyDown=e=>{if(b.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,onNavigationAction:this.onNavigationAction}),this.props.onKeyDown){const{mode:s,cell:n}=b.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:s,cell:n,componentId:this._gridId,selectedField:this.props.selectedField,...this.getArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{b.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onNavigationAction=e=>{if(this.props.onNavigationAction){const s={focusElement:e.focusElement,...this.getArguments(e.event)};this.props.onNavigationAction.call(void 0,s)}},this.rowClick=(e,s)=>{this.props.onRowClick&&e.target.nodeName==="TD"&&this.props.onRowClick.call(void 0,{dataItem:s.dataItem,...this.getArguments(e)})},this.rowDblClick=(e,s)=>{this.props.onRowDoubleClick&&e.target.nodeName==="TD"&&this.props.onRowDoubleClick.call(void 0,{dataItem:s.dataItem,...this.getArguments(e)})},this.itemChange=e=>{const s=this.props.onItemChange;if(e.field===this.props.expandField||this.props.group&&e.field===void 0){const n=this.props.onExpandChange;n&&n.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,dataIndex:e.dataIndex,value:e.value});return}s&&s.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,field:e.field,value:e.value})},this.onHeaderSelectionChange=e=>{this.props.onHeaderSelectionChange&&this.props.onHeaderSelectionChange.call(void 0,{field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems(),selectedField:this.props.selectedField})},this.selectionRelease=e=>{if(this.props.onSelectionChange){const s={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._gridId,dataItems:this.getLeafDataItems(),dataItem:null,...e};this.props.onSelectionChange.call(void 0,s)}},this.pageChange=(e,s,n)=>{this.raiseDataEvent(this.props.onPageChange,{page:e},{skip:e.skip,take:e.take},s,n)},this.pagerPageChange=e=>{this.pageChange({skip:e.skip,take:e.take},e.syntheticEvent,e.targetEvent)},this.sortChange=(e,s)=>{this.raiseDataEvent(this.props.onSortChange,{sort:e},{sort:e,...this.props.scrollable==="virtual"?{skip:0}:{}},s)},this.filterChange=(e,s)=>{this.raiseDataEvent(this.props.onFilterChange,{filter:e},{filter:e||void 0,skip:0},s)},this.groupChange=(e,s)=>{const n=s.nativeEvent?s:{nativeEvent:s.nativeEvent||s.originalEvent};this.raiseDataEvent(this.props.onGroupChange,{group:e},{group:e,skip:0},n)},this.onClipboard=(e,s)=>{if(this.props.onClipboard){if(!this.inActiveElement()||!e)return;this.props.onClipboard.call(void 0,{type:e,nativeEvent:s,columns:this._columns,dataItemKey:this.props.dataItemKey||"",...typeof this.props.clipboard!="boolean"?this.props.clipboard:{}})}},this.inActiveElement=()=>{var h,c,d;if(!g.canUseDOM)return!1;const e=g.getActiveElement(this.document),s=e?e.matches(".k-table-td")?e:(h=this.document)==null?void 0:h.body:(c=this.document)==null?void 0:c.body,n=s.closest(".k-grid-container"),a=s&&((d=this._element)==null?void 0:d.contains(s));return!!(s&&a&&n)},this.onResize=(e,s,n,a,h,c)=>{this.resetTableWidth(),this._shouldUpdateLeftRight=!0,this._resized=!0,this._columnsMutations++,this.props.onColumnResize&&this.props.onColumnResize.call(void 0,{columns:this.columns,nativeEvent:a,targetColumnId:c,index:e,newWidth:s,oldWidth:n,end:h,target:this})},this.reInitVirtualization=g.memoizeOne((e,s,n,a,h,c)=>{this.vs.reset();const d=this.getVirtualScroll(this.props);this.vs=new d(c)}),this.flatData=g.memoizeOne((e,s,n,a,h,c,d)=>{const f=[],v=Ye(f,e,s,{index:n},a!==void 0,h);return{flattedData:f,resolvedGroupsCount:v}}),this.rowHeightService=g.memoizeOne((e,s,n,a,h)=>new yt(s,n,a,h)),this.childrenToArray=g.memoizeOne(e=>o.Children.toArray(e)),this.readColumns=g.memoizeOne((e,s,n)=>{const a=e.filter(h=>h&&h.type&&h.type.displayName==="KendoReactGridColumn");return Je(a,this.columns,{prevId:0,idPrefix:s})}),this.mapColumns=g.memoizeOne(e=>b.mapColumns(e)),this.configureColumns=g.memoizeOne((e,s,n)=>{this.props.selectedField&&e.filter(c=>c.field===this.props.selectedField).forEach(c=>{c.width=c.width||"50px",c.cell=c.cell||et,c.headerCell=c.headerCell||ki});const a={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let h=0;this.props.expandField&&this.props.onExpandChange&&this.props.detail&&(e.unshift({...a,cell:ut,field:this.props.expandField,headerClassName:"k-hierarchy-cell k-header",id:b.tableKeyboardNavigationTools.generateNavigatableId(`${this._columns.length}`,n,"column")}),h++);for(let c=0;c<s;c++)e.unshift({...a,isAccessible:!1,cell:Ke,field:"value",locked:this.props.lockGroups}),h++;e.slice(h).forEach(c=>c.parentIndex>=0&&(c.parentIndex+=h))}),this.getHeaderRow=g.memoizeOne((e,s,n,a,h,c,d,f,v,u,E,y)=>o.createElement(bt,{cells:this.props.cells,sort:e,sortable:s,sortChange:this.sortChange,group:n||[],groupable:a,groupChange:this.groupChange,filter:h,filterable:c,filterOperators:d,filterChange:this.filterChange,columnMenu:v,selectionChange:this.onHeaderSelectionChange,columns:u,columnResize:this.columnResize,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,columnsMap:E,cellRender:f,isRtl:y,dragClue:this.dragLogic.dragClueRef,headerRef:this.headerElementRef,containerRef:this.containerRef})),this.resolveTitle=e=>{const s=this._columns.find(a=>a.field===e),n=s&&(s.title||s.field);return n===void 0?e:n},this.getLeafDataItems=()=>this._data.filter(e=>e.rowType==="data").map(e=>e.dataItem),g.validatePackage(zt),this.showLicenseWatermark=g.shouldShowValidationUI(zt);const i=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1,l=this.getVirtualScroll(t);this.vs=new l(i||t.rowHeight===void 0||t.rowHeight===0),this.dragLogic=new Ft(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new Ii(this.onResize),this.props.clipboard&&(this.clipboardService=new b.ClipboardService(this.onClipboard)),b.tableKeyboardNavigation.onConstructor({navigatable:!!t.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:this._gridId})}get columns(){const t=this._columns.filter(i=>i.declarationIndex>=0&&i.parentIndex===-1);return Ze(t)}get element(){return this._element}get document(){if(g.canUseDOM)return this.element&&this.element.ownerDocument||document}get _header(){return this.headerRef.current}get _gridId(){return this.props.id+"-role-element-id"}componentDidMount(){this.resetTableWidth(),g.setScrollbarWidth();const t=b.isRtl(this.element);this.isRtl=t,b.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.isRtl&&this.forceUpdate();const i={rootMargin:"0px",threshold:.9};this.clipboardService&&this.clipboardService.addEventListeners(this.document),this.observer=g.canUseDOM&&window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,i)||null}getSnapshotBeforeUpdate(){return b.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(){this.resetTableWidth(),g.setScrollbarWidth(),this.vs.tableTransform&&this.vs.table&&(this.vs.table.style.transform=this.vs.tableTransform,this.vs.tableTransform=""),b.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){clearTimeout(this.forceUpdateTimeout),this.clipboardService&&this.clipboardService.removeEventListeners(this.document)}render(){var Zt;let t=this.props.total||0;const i=b.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);let l=[];Array.isArray(this.props.data)?(l=this.props.data,t=t||this.props.data.length):this.props.data&&(l=this.props.data.data,t=t||this.props.data.total);const e=typeof this.props.groupable=="object"&&this.props.groupable.footer||"none",{resolvedGroupsCount:s,flattedData:n}=this.flatData(l,e,this.props.skip||0,this.props.group,this.props.expandField,this.props.filter,this.props.sort);this._data=n;const a=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1;this.columnResize.resizable=this.props.resizable||!1,this.dragLogic.reorderable=this.props.reorderable||!1,this.dragLogic.groupable=a;const h=this.props.selectable&&this.props.selectable.drag?"none":void 0;this.initializeVirtualization(t,a);const c=this.childrenToArray(this.props.children);this.initColumns(c,s);const d=c.map(C=>C&&C.type&&C.type.displayName==="KendoReactGridToolbar"?o.cloneElement(C,{...C.props,ariaControls:this._gridId}):null),f=c.filter(C=>C&&C.type&&C.type.displayName==="KendoReactGridNoRecords"),v=c.filter(C=>C&&C.type&&C.type.displayName==="KendoReactGridStatusBar"),u=this._columns.filter(C=>C.children.length===0),E=a&&o.createElement(kt,{group:this.props.group||[],groupChange:this.groupChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,refCallback:this.dragLogic.refGroupPanelDiv,resolveTitle:this.resolveTitle,ariaControls:this._gridId,onContextMenu:this.onContextMenu}),{sort:y,sortable:x,group:S,filter:F,filterable:I,filterOperators:B=Oe,headerCellRender:_,columnMenu:fe}=this.props,se=o.createElement(di,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",scrollableDataElement:()=>this.vs.container,draggable:this.props.reorderable||a,ref:this.headerRef,elemRef:this.headerElementRef,headerRow:this.getHeaderRow(y,x,S,a,F,I,B,_,fe,this._columns,this._columnsMap,this.isRtl),filterRow:this.props.filterable&&o.createElement(It,{cells:this.props.cells,size:this.props.size,columns:this._columns,filter:this.props.filter,filterOperators:this.props.filterOperators||Oe,filterChange:this.filterChange,sort:this.props.sort,cellRender:this.props.filterCellRender,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1})||void 0,cols:u.map((C,M)=>o.createElement("col",{key:M.toString(),width:xe(C)}))}),X=this.vs&&this.vs.container&&this.vs.container.scrollLeft||0,D=parseFloat(((this.props.style||{}).width||"").toString()),{colSpans:Ve,hiddenColumns:me}=b.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:u,tableViewPortWidth:D,scrollLeft:X}),Ue=(C,M,z)=>{let Y=!1;const q=this.props.selectedField?O(this.props.selectedField,C.dataItem):void 0;return{row:u.map((G,H)=>{if(me[H])return null;const ne=G.id?G.id:H,ae=`${G.className?G.className+" ":""}${G.locked?"k-grid-content-sticky":""}`,W=G.left!==void 0?this.isRtl?{left:G.right,right:G.left}:{left:G.left,right:G.right}:{};let T=!1;if(G.editable&&this.props.editField){const A=O(this.props.editField,C.dataItem);A&&(A===!0||A===G.field)&&(Y=!0,T=!0)}const Xe=G.cell||T&&ft||Gt;return o.createElement(Xe,{onContextMenu:this.onContextMenu,key:ne,locked:this.props.lockGroups,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${M}-${String(H)}`,i),colSpan:Ve[H],dataItem:C.dataItem,field:G.field,editor:G.editor,format:G.format,className:ae,render:this.props.cellRender,cells:de(this.props.cells,G.cells),onChange:this.itemChange,selectionChange:this.props.onSelectionChange?A=>{this.selectionChange({event:A,dataItem:C.dataItem,dataIndex:z,columnIndex:H})}:void 0,columnIndex:H,columnsCount:u.length,rowType:C.rowType,level:C.level,expanded:C.expanded,dataIndex:C.dataIndex,style:W,ariaColumnIndex:G.ariaColumnIndex,isSelected:Array.isArray(q)&&q.indexOf(H)>-1})}),isInEdit:Y,isSelected:typeof q=="boolean"&&q}};let le=0;if(this.props.scrollable==="virtual")for(let C=0;C<this.vs.topCacheCount+this.vs.attendedSkip-(this.props.skip||0);C++){const M=this._data.shift();if(M)this._data.push(M),le++,M.rowType==="groupHeader"&&C--;else break}const Pt=C=>C>=this._data.length-le;let qt=this.vs.realSkip||0;const Ce=[];let $e=!1;const je=this._columnsMap.length+(this.props.filterable?1:0)+1,Vt=o.createElement("div",{key:"no-records",className:"k-grid-norecords","aria-rowindex":je},o.createElement("div",{className:"k-grid-norecords-template"},f.length?f:o.createElement(pe,null)));let oe=0;if(this._data.length){let C=-1,M=0;(this._slicedData||this._data).forEach((z,Y)=>{z.rowType==="data"&&(qt++,C++);const q=qt%2===0,G=this.props.dataItemKey&&g.getter(this.props.dataItemKey)(z.dataItem),H=Y+(this.vs.realSkip||0),ne=G||"ai"+H,ae=ne+"_1",W=Ue(z,ne,C);if(oe=H+je+M,Ce.push(o.createElement(Mt,{key:ne,dataItem:z.dataItem,isAltRow:q,isInEdit:W.isInEdit,rowType:z.rowType,isHidden:Pt(Y),onClick:T=>this.rowClick(T,z),onDoubleClick:T=>this.rowDblClick(T,z),selectedField:this.props.selectedField,rowHeight:this.props.rowHeight,render:this.props.rowRender,ariaRowIndex:oe,absoluteRowIndex:H,dataIndex:C,isSelected:W.isSelected},W.row)),this.props.detail&&z.rowType==="data"&&z.expanded){const T=u.length-(this.props.expandField?1:0)-(this.props.group?this.props.group.length:0)||1;M++,oe=H+je+M,Ce.push(o.createElement("tr",{key:ae,className:g.classNames("k-table-row",q?"k-detail-row k-table-alt-row k-alt":"k-detail-row"),style:{visibility:Pt(Y)?"hidden":"",height:this.props.detailRowHeight},role:"row","aria-rowindex":oe},this.props.group&&this.props.group.map((Xe,A)=>{var Qt;const he=(Qt=W==null?void 0:W.row[A])==null?void 0:Qt.props.style,Ri=he?this.isRtl?{left:he.right,right:he.left}:{left:he.left,right:he.right}:{};return o.createElement(Ke,{id:"",dataIndex:z.dataIndex,field:Xe.field,dataItem:z.dataItem,key:A,style:Ri,ariaColumnIndex:1+A,isSelected:!1,locked:this.props.lockGroups,isRtl:this.isRtl,cells:this.props.cells})}),this.props.expandField&&o.createElement(Mi,{id:b.tableKeyboardNavigationTools.generateNavigatableId(`${ae}-dhcell`,i)}),o.createElement(Gi,{onContextMenu:this.onContextMenu,dataItem:z.dataItem,dataIndex:z.dataIndex,colSpan:T,ariaColIndex:2+(this.props.group?this.props.group.length:0),detail:this.props.detail,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${ae}-dcell`,i)})))}})}else $e=!0;const Ut={size:this.props.size,onPageChange:this.pagerPageChange,total:t,dir:this.isRtl?"rtl":void 0,skip:this.vs.propsSkip||0,take:(this.props.take!==void 0?this.props.take:this.props.pageSize)||10,messagesMap:ci,...Fi(this.props.pageable||{})},$t=this.props.pager?o.createElement(this.props.pager,{...Ut}):o.createElement(b.Pager,{className:"k-grid-pager",...Ut}),Oi=C=>this.props.sort&&this.props.sort.filter(M=>M.field===C).length>0,_i=(C,M)=>o.createElement("col",{key:M.toString(),width:xe(C)}),jt=(Zt=this.props.cells)!=null&&Zt.footerCell||this._columns.some(C=>{var M;return!!(C.footerCell||(M=C.cells)!=null&&M.footerCell)})?o.createElement(vi,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",ref:C=>this._footer=C,row:o.createElement(yi,{cells:this.props.cells,columns:this._columns,isRtl:this.isRtl,ariaRowIndex:oe+1}),cols:u.map(_i)}):null,Xt=o.createElement("colgroup",{ref:C=>{this.columnResize.colGroupMain=C}},u.map((C,M)=>o.createElement("col",{key:M.toString(),className:Oi(C.field)?"k-sorted":void 0,width:xe(C)}))),Yt=this.dragLogic.reorderable||this.dragLogic.groupable,Jt=this.props.columnVirtualization?"block":"table";if(this.props.scrollable==="none")return o.createElement(b.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},o.createElement("div",{id:this.props.id,style:this.props.style,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),ref:C=>{this._element=C},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...b.tableKeyboardNavigationScopeAttributes},d,E,o.createElement(b.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:C=>{this.tableElement=C}},o.createElement("table",{className:g.classNames("k-table k-grid-table",{[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),style:{userSelect:h,display:Jt}},Xt,se,o.createElement("tbody",{role:"rowgroup",className:"k-table-tbody",...b.tableKeyboardNavigationBodyAttributes},Ce),jt)),$e&&Vt,Yt&&o.createElement(o.Fragment,null,o.createElement(b.DropClue,{ref:this.dragLogic.refDropElementClue}),o.createElement(b.DragClue,{ref:this.dragLogic.refDragElementClue}))),v,this.props.pageable&&$t);let be=this.props.style||{};return this.props.scrollable==="virtual"&&(be.height||(be=Object.assign({},be,{height:"450px"}))),o.createElement(b.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},o.createElement("div",{id:this.props.id,style:be,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size,"k-grid-virtual":this.props.scrollable==="virtual"},this.props.className),ref:C=>{this._element=C},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...b.tableKeyboardNavigationScopeAttributes},d,E,o.createElement("div",{className:"k-grid-aria-root",role:"grid","aria-colcount":u.length,"aria-rowcount":t,id:this._gridId},se,o.createElement("div",{className:"k-grid-container",role:"presentation"},o.createElement("div",{ref:this.containerRef,className:"k-grid-content k-virtual-content",onScroll:this.scrollHandler,role:"presentation"},o.createElement("div",{className:"k-grid-table-wrap",role:"presentation"},o.createElement(b.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:C=>{this.tableElement=C}},o.createElement("table",{className:g.classNames("k-table k-grid-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),role:"presentation",style:{userSelect:h,display:Jt}},Xt,o.createElement("tbody",{className:"k-table-tbody",ref:this.tableBodyRef,role:"rowgroup",...b.tableKeyboardNavigationBodyAttributes},Ce))),$e&&Vt),o.createElement("div",{className:"k-height-container",role:"presentation"},o.createElement("div",{style:this.props.scrollable==="virtual"?{height:this.vs.containerHeight+"px"}:{}})))),jt,Yt&&o.createElement(o.Fragment,null,o.createElement(b.DropClue,{ref:this.dragLogic.refDropElementClue}),o.createElement(b.DragClue,{ref:this.dragLogic.refDragElementClue})),this.showLicenseWatermark&&o.createElement(g.WatermarkOverlay,null)),v,this.props.pageable&&$t))}selectionChange(t){if(this.props.onSelectionChange){const{event:i,dataItem:l,dataIndex:e,columnIndex:s}=t,{mode:n,cell:a}=b.getSelectionOptions(this.props.selectable),h={...this.getArguments(i.syntheticEvent),dataItem:l,startColIndex:s,endColIndex:s,startRowIndex:e,endRowIndex:e,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:n,cell:a,isDrag:!1,componentId:this._gridId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,h)}}raiseDataEvent(t,i,l,e,s){const n=this.props.onDataStateChange;if(t){const a={...this.getArguments(e),...i,targetEvent:s};t.call(void 0,a)}else n&&n.call(void 0,{...this.getArguments(e),targetEvent:s||{},dataState:{...this.getDataState(),...l}})}columnReorder(t,i,l){const e=this._columns[t],s=e.depth,n=d=>{do d++;while(d<this._columns.length&&this._columns[d].depth>s);return d},a=this._columns.splice(t,n(t)-t);this._columns.splice(t<i?n(i-a.length):i,0,...a),this._columns.filter(d=>d.declarationIndex>=0).forEach((d,f)=>d.orderIndex=f),this._columnsMutations++;const h=this._columns[t].locked&&this._columns[i].locked;b.updateLeft(this._columnsMap,this._columns,h||this._shouldUpdateLeftRight),b.updateRight(this._columnsMap,this._columns,h||this._shouldUpdateLeftRight),this._resized&&(this._shouldUpdateLeftRight=!1,this._resized=!1);const c=this.columns;if(this.forceUpdate(),this.props.onColumnReorder){const d={target:this,columns:c,columnId:e.id,nativeEvent:l};this.props.onColumnReorder.call(void 0,d)}}groupReorder(t,i,l){if(this.props.group===void 0)return;const e=this.props.group.slice();e.splice(i,0,...e.splice(t,1)),this.groupChange(e,l)}columnToGroup(t,i,l){const e=this._columns[t].field;if(!e)return;const s=(this.props.group||[]).slice();s.splice(i,0,{field:e}),this.groupChange(s,l)}resetTableWidth(){let t=0;if(!this.columnResize.colGroupMain)return;const i=this.columnResize.colGroupMain.children;for(let l=0;l<i.length;l++){const e=i[l].width;if(!e)return;t+=parseFloat(e.toString())}t=Math.round(t),this._header&&this._header.setWidth(t),this._footer&&this._footer.setWidth(t),this.tableElement&&(this.tableElement.style.width=t+"px")}initColumns(t,i){const l=b.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this._columns=this.readColumns(t,l,this._columnsMutations),this._columns.length===0&&(this._columns=ri(this.props.data,this.props.group,this.props.expandField,{prevId:0,idPrefix:l})),this.configureColumns(this._columns,i,l),this._columnsMap=this.mapColumns(this._columns),this.columnResize.columns=this._columns,this.dragLogic.columns=this._columns}getDataState(){return{filter:this.props.filter,sort:this.props.sort,skip:this.props.skip,take:this.props.take!==void 0?this.props.take:this.props.pageSize,group:this.props.group}}getArguments(t){return{nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:this}}};$.displayName="KendoReactGrid",$.defaultProps={},$.propTypes={data:p.oneOfType([p.array,p.shape({data:p.array,total:p.number})]),sortable:p.oneOfType([p.bool,p.shape({mode:p.oneOf(["single","multiple"]),allowUnsort:p.bool})]),onSortChange:p.func,sort:p.array,filterable:p.bool,filter:p.any,onFilterChange:p.func,pageable:p.oneOfType([p.bool,p.shape({buttonCount:p.number,responsive:p.bool,info:p.bool,type:p.oneOf(["numeric","input"]),pageSizes:p.oneOfType([p.bool,p.arrayOf(p.oneOfType([p.string,p.number]))]),previousNext:p.bool})]),pageSize:p.number,onPageChange:p.func,total:p.number,skip:p.number,take:p.number,fixedScroll:p.bool,onExpandChange:p.func,expandField:p.string,selectedField:p.string,onSelectionChange:p.func,onHeaderSelectionChange:p.func,resizable:p.bool,reorderable:p.bool,group:p.any,groupable:p.oneOfType([p.bool,p.shape({enabled:p.bool,footer:p.oneOf(["always","visible","none"])})]),onGroupChange:p.func,onRowClick:p.func,onRowDoubleClick:p.func,onItemChange:p.func,editField:p.string,scrollable:p.oneOf(["none","scrollable","virtual"]),rowHeight:p.number,detailRowHeight:p.number,detail:p.any,style:p.object,onDataStateChange:p.func,onColumnResize:p.func,onColumnReorder:p.func,dataItemKey:p.string,navigatable:p.bool,size:p.oneOf(["small","medium"])},$.contextType=b.TableKeyboardNavigationContext;class ie extends o.Component{render(){const{children:t}=this.props;return o.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-wrapper",this.props.className),style:this.props.style},t)}}class j extends o.Component{render(){const{title:t,iconClass:i,svgIcon:l,selected:e}=this.props;return o.createElement("div",{onClick:this.props.onClick,className:`k-columnmenu-item ${e?"k-selected":""}`},(i||l)&&o.createElement(g.IconWrap,{name:i&&g.toIconName(i),icon:l}),t)}}class Be extends o.Component{constructor(){super(...arguments),this.onGroupClick=t=>{if(t.preventDefault(),this.props.onGroupChange){const{column:i}=this.props;if(!i.field)return;const l=(this.props.group||[]).slice(),e=l.findIndex(s=>s.field===i.field);e>-1?l.splice(e,1):l.push({field:i.field}),this.props.onGroupChange(l,t)}this.props.onCloseMenu&&this.props.onCloseMenu()}}render(){const{group:t,column:i}=this.props,l=w.provideLocalizationService(this),e=!!(t&&i.field&&t.find(n=>n.field===i.field)),s=e?at:nt;return o.createElement(ie,null,o.createElement(j,{title:l.toLanguageString(s,k[s]),iconClass:e?"k-i-ungroup":"k-i-group",svgIcon:e?N.ungroupIcon:N.groupIcon,onClick:this.onGroupClick}))}}w.registerForIntl(Be),w.registerForLocalization(Be);const Lt="asc",Dt="desc",zi={true:{asc:{asc:"",desc:"desc"},desc:{asc:"asc",desc:""},"":{asc:"asc",desc:"desc"}},false:{asc:{asc:"asc",desc:"desc"},desc:{asc:"asc",desc:"desc"},"":{asc:"asc",desc:"desc"}}},Ht=(r,t)=>t?t.findIndex(i=>i.field===r):-1,Ot=(r,t)=>!!(t&&r>-1&&t[r].dir===Lt),_t=(r,t)=>!!(t&&r>-1&&t[r].dir===Dt);class ue extends o.Component{constructor(){super(...arguments),this.onAscClick=t=>{this.onSort(t,Lt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onDescClick=t=>{this.onSort(t,Dt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onSort=(t,i)=>{if(t.preventDefault(),!this.props.onSortChange)return;const{column:l,sortable:e,sort:s}=this.props,{allowUnsort:n,mode:a}=mt(e||!1,!1),h=(s||[]).filter(f=>f.field===l.field)[0],c=zi[n][h&&h.dir||""][i],d=a==="single"?[]:(this.props.sort||[]).filter(f=>f.field!==l.field);c!==""&&l.field&&d.push({field:l.field,dir:c}),this.props.onSortChange(d,t)}}render(){const{sort:t,column:i}=this.props,l=Ht(i.field,t),e=w.provideLocalizationService(this);return o.createElement(ie,null,o.createElement(j,{title:e.toLanguageString(ke,k[ke]),iconClass:"k-i-sort-asc-sm",svgIcon:N.sortAscSmallIcon,selected:Ot(l,t),onClick:this.onAscClick}),o.createElement(j,{title:e.toLanguageString(ye,k[ye]),iconClass:"k-i-sort-desc-sm",svgIcon:N.sortDescSmallIcon,selected:_t(l,t),onClick:this.onDescClick}))}}ue.active=(r,t)=>{const i=Ht(r,t);return _t(i,t)||Ot(i,t)},w.registerForIntl(ue),w.registerForLocalization(ue);class We extends o.Component{render(){return o.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},o.createElement(ti.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}class Te extends o.Component{constructor(t){super(t),this.renderOperatorEditor=()=>{if(this.props.filterType==="boolean")return;const i=this.props.operators.find(l=>l.operator===this.props.operator)||null;return o.createElement(Z.DropDownList,{value:i,onChange:this.operatorChange,data:this.props.operators,textField:"text"})},this.inputChange=this.inputChange.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){return o.createElement(o.Fragment,null,this.renderOperatorEditor(),this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues))}inputChange(t,i){vt(t,i,this.props)}operatorChange(t){St(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Et(t,this.props.onChange)}filterComponent(t,i,l){switch(t){case"numeric":return o.createElement(L.NumericTextBox,{value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},rangeOnEnter:!1});case"date":return o.createElement(ve.DatePicker,{value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)}});case"boolean":{const e=s=>s==null;return o.createElement(Z.DropDownList,{onChange:this.boolDropdownChange,value:l.find(s=>s.operator===(e(i)?"":i)),data:l,textField:"text"})}default:return o.createElement(L.Input,{value:i||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)}})}}}class Rt extends o.Component{render(){const{firstFilterProps:t,hideSecondFilter:i,secondFilterProps:l,logicData:e,logicValue:s,onLogicChange:n}=this.props;return o.createElement(o.Fragment,null,o.createElement(Te,{...t}),!i&&o.createElement(o.Fragment,null,o.createElement(Z.DropDownList,{data:e,value:s,onChange:n,className:"k-filter-and",textField:"text"}),o.createElement(Te,{...l})))}}const ge=r=>r||{filters:[],logic:"and"},re=(r,t)=>ge(t).filters.filter(e=>ce.isCompositeFilterDescriptor(e)?e.filters&&e.filters.length&&e.filters.length<=2&&!e.filters.find(s=>ce.isCompositeFilterDescriptor(s)||s.field!==r):!1)[0]||null;class Pe extends o.Component{constructor(t){super(t),this.removeGroup=(l,e)=>{const s=[...e.filters],n=s.findIndex(a=>a===l);return n>-1&&s.splice(n,1),{...e,filters:s}},this.insertGroup=(l,e)=>({...e,filters:[l,...e.filters]}),this.isControlled=()=>this.props.expanded!==void 0,this.onFilterExpand=()=>{const l=this.isControlled(),e=!(l?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(e),l||this.setState({expanded:e})},this.firstFilterChange=l=>{this.filterChange(0,l)},this.secondFilterChange=l=>{this.filterChange(1,l)},this.filterChange=(l,e)=>{const s=this.state.filterGroup.filters.map((n,a)=>a===l?{...n,value:e.value,operator:e.operator}:n);this.setState({filterGroup:{...this.state.filterGroup,filters:s}})},this.logicChange=l=>{this.setState({filterGroup:{...this.state.filterGroup,logic:l.target.value.operator}})},this.clear=l=>{if(l.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,s=ge(this.props.filter),n=re(e,this.props.filter),a=s.filters.filter(h=>h!==n);a.length?this.props.onFilterChange({...s,filters:a},l):this.props.onFilterChange(null,l),this.props.onCloseMenu&&this.props.onCloseMenu()},this.currentFilterGroup=()=>({...this.state.filterGroup,filters:this.state.filterGroup.filters.filter(l=>l.value!==void 0&&l.value!==null&&l.value!==""||l.value===null&&l.operator)}),this.submit=l=>{if(l.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,s=ge(this.props.filter),n=re(e,this.props.filter),a=this.currentFilterGroup();let h=null;if(n&&a.filters.length>0){const c=s.filters.map(d=>d===n?a:d);h={...s,filters:c}}else if(a.filters.length===0){const c=s.filters.filter(d=>d!==n);c.length&&(h={...s,filters:c})}else h={...s,filters:[...s.filters,a]};this.props.onFilterChange(h,l),this.props.onCloseMenu&&this.props.onCloseMenu()};let i;if(t.column&&t.column.field){const l=Re(t.column.filter),e=xt(t.filterOperators,l);i=re(t.column.field,t.filter),i=i?{...i,filters:i.filters.map(s=>({...s}))}:{logic:"and",filters:[{field:t.column.field,operator:e,value:R(e)?null:void 0},{field:t.column.field,operator:e,value:R(e)?null:void 0}]},i.filters.filter(s=>s.field===t.column.field).length===1&&i.filters.splice(1,0,{field:t.column.field,operator:e})}this.state={expanded:t.expanded||!1,filterGroup:i}}render(){const{column:t,filterUI:i,hideSecondFilter:l,filterOperators:e}=this.props;if(!t||!t.field)return o.createElement("div",null);const s=Re(t.filter),n=l!==void 0?l:Ci[s],a=w.provideLocalizationService(this),h=this.state.filterGroup.filters,c=te(e[s],a),d=te(_e,a),f={field:t.field,value:h[0].value,operator:h[0].operator,operators:c,booleanValues:d,onChange:this.firstFilterChange,filterType:s},v={field:t.field,value:h[1].value,operator:h[1].operator,operators:c,booleanValues:d,onChange:this.secondFilterChange,filterType:s},u=this.state.filterGroup.logic,E=te(fi,a),y={value:E.find(_=>_.operator===(u===null?"":u)),onChange:this.logicChange,data:E},x=i,S={firstFilterProps:f,secondFilterProps:v,logicData:y.data,logicValue:y.value,onLogicChange:y.onChange,hideSecondFilter:n},F=this.currentFilterGroup().filters.length!==0||R(h[0].operator)||R(h[1].operator),I=this.isControlled()?this.props.expanded:this.state.expanded,B=this.props.alwaysExpand;return o.createElement(ie,null,!B&&o.createElement(j,{title:a.toLanguageString(ee,k[ee]),iconClass:"k-i-filter",svgIcon:N.filterIcon,onClick:this.onFilterExpand}),o.createElement(We,{show:B||!!I},o.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear,onKeyDown:_=>_.stopPropagation()},o.createElement("div",{className:"k-filter-menu-container"},x?o.createElement(x,{...S}):o.createElement(Rt,{...S}),o.createElement("div",{className:"k-actions k-actions-stretched"},o.createElement(K.Button,{themeColor:"primary",disabled:!F},a.toLanguageString(Q,k[Q])),o.createElement(K.Button,{type:"reset"},a.toLanguageString(P,k[P])))))))}}Pe.active=(r,t)=>!!re(r,t),w.registerForLocalization(Pe);const Li=(r,t)=>r.length!==t.length?!1:r.every((i,l)=>i===t[l]);class qe extends o.Component{constructor(t){super(t),this.defaultFilter=()=>this.props.filter?g.clone(this.props.filter):{filters:[],logic:"and"},this.isControlled=()=>this.props.expanded!==void 0,this.parseData=(i,l)=>{const e=this.props.column.field||"",s=i.map(n=>O(e,n));return l?s.filter((n,a)=>s.indexOf(n)===a):s},this.getFilterIndex=()=>{const i=this.props.column.field;return this.defaultFilter().filters.findIndex(s=>s.filters&&s.filters.length>0&&s.filters[0].field===i)},this.onFilterExpand=()=>{const i=this.isControlled(),l=!(i?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(l),i||this.setState({expanded:l})},this.handleSearchChange=i=>{const l=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",e={logic:"and",filters:[{field:this.props.column.field,operator:l,value:i.target.value,ignoreCase:!0}]};this.setState({value:i.target.value,data:this.parseData(ce.filterBy(this.props.data||[],e),this.props.uniqueData)})},this.handleClear=()=>{const i=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",l={logic:"and",filters:[{field:this.props.column.field,operator:i,value:"",ignoreCase:!0}]};this.setState({value:"",data:this.parseData(ce.filterBy(this.props.data||[],l),this.props.uniqueData)})},this.clear=i=>{if(i.preventDefault(),!this.props.onFilterChange)return;const l=this.state.currentFilter||null;l!==null&&l.filters.length>0?(this.compositeFilterIndex>=0&&l.filters.splice(this.compositeFilterIndex,1),this.props.onFilterChange(l,i)):this.props.onFilterChange(null,i),this.props.onCloseMenu&&this.props.onCloseMenu()},this.submit=i=>{if(i.preventDefault(),!this.props.onFilterChange)return;const l=this.state.currentFilter||null;this.props.onFilterChange(l,i),this.props.onCloseMenu&&this.props.onCloseMenu()},this.handleCheckBoxChange=(i,l)=>{const e=this.props.column.field||"",s={...this.state.currentFilter},n=[...this.state.currentFilter.filters];let a=[];if(this.compositeFilterIndex!==-1&&s.filters[this.compositeFilterIndex].filters&&l!=="all"&&(a=s.filters[this.compositeFilterIndex].filters),i.value&&l==="all")this.state.data.forEach(h=>{a.push({field:e,operator:"eq",value:h})});else if(i.value)a.push({field:e,operator:"eq",value:l});else if(this.state.currentFilter){const h=a.findIndex(c=>c.value===l);a.splice(h,1)}s.logic="and",this.compositeFilterIndex!==-1?n[this.compositeFilterIndex]={logic:"or",filters:a}:n.push({logic:"or",filters:a}),(!i.value&&l==="all"||a.length===0)&&n.splice(this.compositeFilterIndex,1),s.filters=n,this.setState({currentFilter:s})},this.isAllSelected=()=>{let i=!1;if(this.state.currentFilter){const l=[...this.state.currentFilter.filters];return this.compositeFilterIndex===-1?!1:(i=this.state.data.every(e=>this.compositeFilterIndex!==-1&&l[this.compositeFilterIndex].filters?l[this.compositeFilterIndex].filters.findIndex(n=>n.value===e)>=0:!1),i)}return i},this.compositeFilterIndex=this.getFilterIndex(),this.state={expanded:t.expanded||!1,value:"",data:this.parseData(this.props.data,this.props.uniqueData)||[],dataFromProps:this.parseData(this.props.data,!1)||[],currentFilter:this.defaultFilter()}}componentDidUpdate(){const t=this.props.column.field||"",i=this.props.data.map(l=>O(t,l));Li(i,this.state.dataFromProps)||this.setState({data:i,dataFromProps:i})}render(){const{column:t}=this.props;if(!t||!t.field)return o.createElement("div",null);const i=w.provideLocalizationService(this),l=this.isControlled()?this.props.expanded:this.state.expanded,e=[];if(this.state.currentFilter){const a=[...this.state.currentFilter.filters];this.compositeFilterIndex=a.findIndex(h=>h.filters&&h.filters.length>0?h.filters[0].field===t.field:!1),this.compositeFilterIndex!==-1&&a[this.compositeFilterIndex].filters.length>0&&a[this.compositeFilterIndex].filters.forEach(h=>{h.field===this.props.column.field&&e.push(h.value)})}const s=this.props.searchBox?o.createElement(this.props.searchBox,{value:this.state.value,onChange:this.handleSearchChange}):o.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},o.createElement(g.IconWrap,{className:"k-input-icon",name:"search",icon:N.searchIcon}),o.createElement(L.Input,{className:"k-input-inner",type:"text",placeholder:i.toLanguageString(Ne,k[Ne]),value:this.state.value,onChange:a=>this.handleSearchChange(a.nativeEvent)}),o.createElement(K.Button,{type:"button",rounded:null,className:"k-input-button",onClick:this.handleClear,icon:"x",svgIcon:N.xIcon})),n=e.filter((a,h)=>e.indexOf(a)===h);return o.createElement(ie,null,o.createElement(j,{title:i.toLanguageString(ee,k[ee]),iconClass:"k-i-filter",svgIcon:N.filterIcon,onClick:this.onFilterExpand}),o.createElement(We,{show:!!l},o.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear},o.createElement("div",{className:"k-filter-menu-container"},s,o.createElement("ul",{className:"k-reset k-multicheck-wrap"},o.createElement("li",{className:"k-item k-check-all-wrap"},o.createElement(L.Checkbox,{label:i.toLanguageString(Fe,k[Fe]),onChange:a=>this.handleCheckBoxChange(a,"all"),checked:this.isAllSelected()})),this.state.data.map((a,h)=>o.createElement("li",{className:"k-item",key:h},o.createElement(L.Checkbox,{label:String(a),onChange:c=>this.handleCheckBoxChange(c,a),checked:n.includes(a)})))),o.createElement("div",{className:"k-filter-selected-items"},n.length+" "+i.toLanguageString(Me,k[Me])),o.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},o.createElement(K.Button,{themeColor:"primary",type:"submit"},i.toLanguageString(Q,k[Q])),o.createElement(K.Button,{className:"k-button",type:"reset"},i.toLanguageString(P,k[P])))))))}}qe.defaultProps={uniqueData:!0},w.registerForLocalization(qe);const At=r=>{const[t,i]=o.useState(""),l=o.useMemo(()=>new Set(r.columnsState.map(u=>u.id)),[r.columnsState]),e=o.useMemo(()=>r.columns.filter(u=>{var E;return(E=u.title||u.field)==null?void 0:E.toLowerCase().includes(t.toLowerCase())}),[r.columns,t]),[s,n]=o.useState(r.columns.map(u=>l.has(u.id))),a=o.useCallback(()=>{const u=r.columns.filter((E,y)=>s[y]);r.onColumnsChange.call(void 0,u),r.onCloseMenu.call(void 0)},[s,r.columns,r.onColumnsChange,r.onCloseMenu]),h=o.useCallback(()=>{n(r.columns.map(u=>l.has(u.id)))},[l,r.columns]),c=s.filter(u=>u).length,d=c===s.length,f=o.useCallback(()=>{n(r.columns.map((u,E)=>d&&E===0?!0:!d))},[r.columns,d]),v=o.useCallback((u,E)=>{const y=s.slice();y[E]=u,n(y)},[s]);return o.createElement("form",{className:"k-filter-menu"},o.createElement("div",{className:"k-filter-menu-container"},o.createElement(L.TextBox,{className:"k-searchbox",value:t,onChange:u=>i(String(u.target.value)),prefix:()=>o.createElement(L.InputPrefix,null,o.createElement(g.IconWrap,{name:"search",icon:N.searchIcon}))}),o.createElement("ul",{className:"k-reset k-multicheck-wrap"},!t&&o.createElement("li",{className:"k-item k-check-all-wrap"},o.createElement(L.Checkbox,{checked:d,onChange:f,label:"(Select all)"})),e.map((u,E)=>o.createElement("li",{key:u.id,className:"k-item"},o.createElement(L.Checkbox,{disabled:s[E]&&c===1,checked:s[E],onChange:y=>{var x;return v(!!((x=y.target.element)!=null&&x.checked),E)},label:u.title||u.field})))),o.createElement("div",{className:"k-filter-selected-items"},c," selected items"),o.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},o.createElement(K.Button,{type:"button",themeColor:"primary",onClick:a},"Apply"),o.createElement(K.Button,{type:"button",onClick:h},"Reset"))))};At.displayName="GridColumnMenuColumnsList";class Di extends o.Component{render(){return null}}class Kt extends o.Component{render(){return o.createElement("div",{className:g.classNames("k-toolbar k-grid-toolbar",{"k-toolbar-md":!this.props.size,[`k-toolbar-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),"aria-label":this.props.ariaLabel,"aria-controls":this.props.ariaControls,role:"toolbar"},this.props.children)}}Kt.displayName="KendoReactGridToolbar";const Bt=r=>{const{data:t=[]}=r;return o.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},t.map((i,l)=>o.createElement("div",{key:l},o.createElement("span",{className:"k-selection-aggregates-item-text"},i.type,": "),o.createElement("span",{className:"k-selection-aggregates-item-value"},i.formattedValue))))};Bt.displayName="KendoReactGridStatusBar";const Wt=r=>{var i;const t=r.slice();for(let l=0;l<t.length;l++)for(;t[l]&&((i=t[l].children)!=null&&i.length);)t.splice(l,1,...t[l].children);return t},Hi=r=>{const{dataItems:t,target:i,selectedField:l}=r,s=Wt(i.columns).map(x=>x.field).filter(x=>x&&typeof x=="string").map(x=>g.getter(x)),n=g.getter(l),a={dates:[],numbers:[],booleans:[],others:[]},h=x=>{typeof x=="number"?a.numbers.push(x):typeof x=="boolean"?a.booleans.push(x):x instanceof Date?a.dates.push(x):a.others.push(x)};t.forEach(x=>{const S=n(x);S&&S.forEach(F=>{h(s[F](x))})});const c=a.dates.map(x=>x.getTime()),d=a.booleans.filter(x=>x).length,f=a.booleans.filter(x=>!x).length,v=a.numbers.length?a.numbers.reduce((x,S)=>x+=S,0):void 0,u={sum:v,average:typeof v=="number"?v/a.numbers.length:void 0,min:a.numbers.length?Math.min(...a.numbers):void 0,max:a.numbers.length?Math.max(...a.numbers):void 0,count:a.numbers.length+a.booleans.length+a.dates.length+a.others.length,isTrue:d>0?d:void 0,isFalse:f>0?f:void 0,earliest:a.dates.length?new Date(Math.min(...c)):void 0,latest:a.dates.length?new Date(Math.max(...c)):void 0},E=(x,S)=>(S==="sum"||S==="average")&&typeof x=="number"?x.toFixed(2):(S==="earliest"||S==="latest")&&x instanceof Date?x.toLocaleDateString():String(x),y=[];return Object.keys(u).forEach(x=>{const S=x,F=u[S];F!==void 0&&y.push({type:S,value:F,formattedValue:E(F,S)})}),y},Tt=g.withIdHOC($);Tt.displayName="KendoReactGrid",Object.defineProperty(m,"getSelectedState",{enumerable:!0,get:()=>b.getSelectedState}),Object.defineProperty(m,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>b.getSelectedStateFromKeyDown}),Object.defineProperty(m,"setSelectedState",{enumerable:!0,get:()=>b.setSelectedState}),m.GRID_COL_INDEX_ATTRIBUTE=U,m.GRID_ROW_INDEX_ATTRIBUTE=gt,m.Grid=Tt,m.GridCell=Gt,m.GridClassComponent=$,m.GridColumn=V,m.GridColumnMenuCheckboxFilter=qe,m.GridColumnMenuColumnsList=At,m.GridColumnMenuFilter=Pe,m.GridColumnMenuFilterCell=Te,m.GridColumnMenuFilterUI=Rt,m.GridColumnMenuGroup=Be,m.GridColumnMenuItem=j,m.GridColumnMenuItemContent=We,m.GridColumnMenuItemGroup=ie,m.GridColumnMenuSort=ue,m.GridColumnMenuWrapper=He,m.GridCommonDragLogic=Ft,m.GridDetailRow=Di,m.GridEditCell=ft,m.GridFilterCell=Ae,m.GridGroupCell=Ke,m.GridHeaderCell=Ct,m.GridHierarchyCell=ut,m.GridNoRecords=pe,m.GridRow=Mt,m.GridSelectionCell=et,m.GridToolbar=Kt,m.StatusBar=Bt,m.booleanFilterValues=_e,m.filterGroupByField=re,m.getStatusData=Hi,m.gridMessages=k,m.leafColumns=Wt,m.operators=Oe,m.pagerFirstPage=it,m.pagerInfo=tt,m.pagerItemPerPage=ot,m.pagerLastPage=lt,m.pagerNextPage=st,m.pagerPreviousPage=rt,m.rootFilterOrDefault=ge,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
5
+ (function(m,J){typeof exports=="object"&&typeof module!="undefined"?J(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-data-query"),require("@progress/kendo-react-animation")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-data-tools","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-inputs","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-react-buttons","@progress/kendo-react-dropdowns","@progress/kendo-data-query","@progress/kendo-react-animation"],J):(m=typeof globalThis!="undefined"?globalThis:m||self,J(m.KendoReactGrid={},m.React,m.PropTypes,m.KendoReactCommon,m.KendoReactDataTools,m.KendoReactIntl,m.KendoSvgIcons,m.KendoReactInputs,m.KendoReactDateinputs,m.KendoReactPopup,m.KendoReactButtons,m.KendoReactDropdowns,m.KendoDataQuery,m.KendoReactAnimation))})(this,function(m,J,p,g,b,w,N,L,ve,ei,K,Z,ce,ti){"use strict";"use client";function ii(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}return t.default=r,Object.freeze(t)}const o=ii(J),V=r=>null;V.displayName="KendoReactGridColumn",V.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0},V.propTypes={field:p.string,title:p.string,editable:p.bool,sortable:p.oneOfType([p.bool,p.shape({allowUnsort:p.bool.isRequired})]),cell:p.any,filterCell:p.any,filterTitle:p.string,filterable:p.bool,filter:p.oneOf(["text","numeric","boolean","date"]),editor:p.oneOf(["text","numeric","boolean","date"]),width:p.oneOfType([p.string,p.number]),minResizableWidth:p.number,headerCell:p.any,footerCell:p.any,headerSelectionValue:p.bool,format:p.string,headerClassName:p.string,className:p.string,reorderable:p.bool,resizable:p.bool,orderIndex:p.number,groupable:p.bool,columnMenu:p.any,locked:p.bool};function H(r,t){const i=(r||"").split(".");let l=t;return i.forEach(e=>{l=l?l[e]:void 0}),l}function Qe(r,t,i,l,e,s,n=0){let a=n;for(let h=0;h<t.length;h++){if(!e||t[h].value===void 0||t[h].items===void 0){r[r.length]={dataIndex:l.index,dataItem:t[h],rowType:"data",level:n,expanded:s===void 0||H(s,t[h])},l.index++;continue}a=Math.max(a,n+1);const c=s===void 0||H(s,t[h])===void 0||H(s,t[h]);r[r.length]={dataIndex:-1,dataItem:t[h],level:n,rowType:"groupHeader",expanded:c},c&&(a=Math.max(Qe(r,t[h].items,i,l,e,s,n+1),a)),(i==="always"||c&&i==="visible")&&(r[r.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:n,expanded:c})}return a}function et(r,t,i,l=0){let e=[];if(!r)return[];r&&r.length===void 0&&(r=[r]),r.forEach((n,a)=>{n=n.props?n.props:n;const h=t[a]||null,c=et(n.children,h&&h.children||[],i,l+1);e.push(Object.assign({depth:l},V.defaultProps,c.length?{cell:()=>null,filterCell:()=>null}:{},h?{width:h.width,orderIndex:h.orderIndex}:{},n,{id:n.id?n.id:b.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.idPrefix,"column"),declarationIndex:e.length,children:c,rowSpan:0,colSpan:0,isAccessible:!0,left:h&&Math.floor(h.left),right:h&&Math.floor(h.right)}))});const s=(n,a)=>n.orderIndex===a.orderIndex?n.declarationIndex-a.declarationIndex:(n.orderIndex||0)-(a.orderIndex||0);if(e.sort(s),l===0){let n=[];const a=(h,c)=>h.forEach(d=>{d.parentIndex=c,a(d.children,n.push(d)-1)});return a(e,-1),n}return e}function ri(r,t,i,l){let e=[];Array.isArray(r)?e=r:r&&(e=r.data);const s=[];if(e.length>0){let n=e[0];if(t)for(let h=0;h<t.length;h++)n=n.items&&n.items[0];Object.getOwnPropertyNames(n).forEach(h=>{h!==i&&s.push(Object.assign({id:b.tableKeyboardNavigationTools.generateNavigatableId(`${l.prevId++}`,l.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},V.defaultProps,{field:h}))})}return s}const si=(r,t)=>{let i=r[t.parentIndex];for(;i;){if(i.footerCell)return!0;i=r[i.parentIndex]}return!1},li=r=>r.filter(t=>si(r,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),xe=r=>r.width!==void 0?Math.floor(parseFloat(r.width.toString()))+"px":void 0,tt=r=>(r.sort((t,i)=>t.declarationIndex-i.declarationIndex),r.map(t=>{const{declarationIndex:i,parentIndex:l,depth:e,colSpan:s,rowSpan:n,index:a,kFirst:h,children:c,...d}=t;return c.length?{children:tt(c),...d}:d})),Ee=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),it=17895697,de=(r,t)=>{if(!(!r&&!t))return t?r?{...r,...t,select:{...r.select||{},...t.select||{}},hierarchy:{...r.hierarchy||{},...t.hierarchy||{}},group:{...r.group||{},...t.group||{}},edit:{...r.edit||{},...t.edit||{}}}:t:r},rt=r=>{const t=o.useCallback(d=>{r.selectionChange&&r.selectionChange({syntheticEvent:d})},[r.selectionChange]),i=g.useId(),l=H(r.field,r.dataItem),e=b.useTableKeyboardNavigation(r.id),s={colSpan:r.colSpan,style:r.style,className:r.className,"aria-colindex":r.ariaColumnIndex,role:"gridcell",...e},n=[o.createElement("span",{key:1,className:"k-checkbox-wrap"},o.createElement("input",{checked:typeof l=="boolean"&&l,id:i,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:t})),o.createElement("label",{className:"k-checkbox-label",htmlFor:i,key:2})],a=r.rowType!=="groupHeader"?o.createElement("td",{...s},n):null,h=r.rowType||"data",c=r.cells;if(c&&c.select&&c.select[h]){const d=c.select[h];return o.createElement(d,{...r,tdProps:s},n)}return r.render?r.render.call(void 0,a,r):a},Se="grid.noRecords",st="grid.pagerInfo",lt="grid.pagerFirstPage",ot="grid.pagerPreviousPage",nt="grid.pagerNextPage",at="grid.pagerLastPage",ht="grid.pagerItemsPerPage",oi="grid.pagerPage",ni="grid.pagerPageSizeAriaLabel",ai="grid.pagerOf",hi="grid.pagerTotalPages",Ie="grid.groupPanelEmpty",ct="grid.groupColumn",dt="grid.ungroupColumn",we="grid.columnMenu",P="grid.filterClearButton",Q="grid.filterSubmitButton",ee="grid.filterTitle",ke="grid.sortAscending",ye="grid.sortDescending",Ne="grid.searchPlaceholder",Fe="grid.filterCheckAll",Ge="grid.filterChooseOperator",Me="grid.filterSelectedItems",ze="grid.sortAriaLabel",Le="grid.filterAriaLabel",De="grid.groupPanelAriaLabel",pt="grid.groupExpand",ut="grid.groupCollapse",gt="grid.detailExpand",ft="grid.detailCollapse",k={[gt]:"Expand detail row",[ft]:"Collapse detail row",[pt]:"Expand group",[ut]:"Collapse Group",[Se]:"No records available",[Ie]:"Drag a column header and drop it here to group by that column",[P]:"Clear",[Q]:"Filter",[ee]:"Filter",[ke]:"Sort Ascending",[ye]:"Sort Descending",[ze]:"Sortable",[ct]:"Group Column",[dt]:"Ungroup Column",[we]:"Column menu",[ht]:"items per page",[st]:"{0} - {1} of {2} items",[lt]:"Go to the first page",[ot]:"Go to the previous page",[nt]:"Go to the next page",[at]:"Go to the last page",[oi]:"Page",[ni]:"Page size",[ai]:"of",[hi]:"{0}",[Ne]:"Search",[Fe]:"Check All",[Ge]:"Choose Operator",[Me]:"selected items",[Le]:"Filter",[De]:"Group panel","grid.filterEqOperator":"Is equal to","grid.filterNotEqOperator":"Is not equal to","grid.filterIsNullOperator":"Is null","grid.filterIsNotNullOperator":"Is not null","grid.filterIsEmptyOperator":"Is empty","grid.filterIsNotEmptyOperator":"Is not empty","grid.filterStartsWithOperator":"Starts with","grid.filterContainsOperator":"Contains","grid.filterNotContainsOperator":"Does not contain","grid.filterEndsWithOperator":"Ends with","grid.filterGteOperator":"Is greater than or equal to","grid.filterGtOperator":"Is greater than","grid.filterLteOperator":"Is less than or equal to","grid.filterLtOperator":"Is less than","grid.filterIsTrue":"Is true","grid.filterIsFalse":"Is false","grid.filterBooleanAll":"(All)","grid.filterAfterOrEqualOperator":"Is after or equal to","grid.filterAfterOperator":"Is after","grid.filterBeforeOperator":"Is before","grid.filterBeforeOrEqualOperator":"Is before or equal to","grid.filterAndLogic":"And","grid.filterOrLogic":"Or"};function ci(r){const t=r.replace(/^pager\.([a-z])/,(i,l)=>"grid.pager"+l.toUpperCase());return{messageKey:t,defaultMessage:k[t]}}const mt=r=>{let t=null,i=null,l=null;const e=H(r.field,r.dataItem),s=b.useTableKeyboardNavigation(r.id),n=w.useLocalization(),a=o.useCallback(d=>{d.isDefaultPrevented()||d.keyCode===g.Keys.enter&&r.onChange&&(d.preventDefault(),r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:d,field:r.field,value:!e}))},[r.dataItem,r.dataIndex,r.field,r.onChange,e]);if(r.rowType==="groupFooter")i={className:"k-table-td k-hierarchy-cell",role:"gridcell",...s},t=o.createElement("td",{...i});else if(r.rowType!=="groupHeader"){const d=e?ft:gt,f=n.toLanguageString(d,k[d]);i={className:"k-table-td k-hierarchy-cell",onKeyDown:a,"aria-expanded":!!e,role:"gridcell","aria-colindex":r.ariaColumnIndex,...s},l=o.createElement("a",{onClick:v=>{v.preventDefault(),r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:v,field:r.field,value:!e})},"aria-label":f,href:"#",tabIndex:-1},o.createElement(g.IconWrap,{name:e?"minus":"plus",icon:e?N.minusIcon:N.plusIcon})),t=o.createElement("td",{...i},l)}const h=r.rowType||"data",c=r.cells;if(c&&c.hierarchy&&c.hierarchy[h]){const d=c.hierarchy[h];return o.createElement(d,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,t,r):t},Ct=b.TABLE_ROW_INDEX_ATTRIBUTE,U=b.TABLE_COL_INDEX_ATTRIBUTE,bt=r=>{const t=H(r.field,r.dataItem);let i=null;const l=g.classNames("k-table-td","k-grid-edit-cell",{["k-selected"]:r.isSelected},r.className),e=g.useId(),s=b.useTableKeyboardNavigation(r.id);let n=null,a=null;const h=o.useCallback(u=>{if(r.onChange){const E=u.target.type==="checkbox"?u.target.checked:u.target.value;r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u,value:E})}},[r.onChange,r.dataItem,r.dataIndex,r.field]),c=o.useCallback(u=>{r.onContextMenu&&r.onContextMenu.call(void 0,u,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),d=o.useCallback(u=>{r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u.syntheticEvent,value:u.value})},[r.onChange,r.dataItem,r.dataIndex,r.field]);switch(r.editor){case"numeric":{n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=o.createElement(L.NumericTextBox,{width:"100%",value:t===void 0?null:t,onChange:d}),i=o.createElement("td",{...n},a);break}case"date":n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=o.createElement(ve.DatePicker,{width:"100%",value:t,onChange:d}),i=o.createElement("td",{...n},a);break;case"boolean":n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=[o.createElement("span",{key:1,className:"k-checkbox-wrap"},o.createElement("input",{checked:t||!1,id:e,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:h})),o.createElement("label",{className:"k-checkbox-label",htmlFor:e,key:2})],i=o.createElement("td",{...n},a);break;default:n={onContextMenu:c,colSpan:r.colSpan,style:r.style,className:l,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...s},a=o.createElement("input",{style:{width:"100%"},className:"k-input",value:t||"",onChange:h}),i=o.createElement("td",{...n},a)}const f=r.editor||"text",v=r.cells;if(v&&v.edit&&v.edit[f]){const u=v.edit[f];return o.createElement(u,{...r,tdProps:n},a)}return r.render?r.render.call(void 0,i,r):i};class di extends o.Component{constructor(){super(...arguments),this.headerWrap=null,this.table=null,this.syncScroll=!1,this.scrollbarWidth=g.getScrollbarWidth(),this.onScroll=t=>{if(this.syncScroll){this.syncScroll=!1;return}if(!this.headerWrap)return;const i=this.headerWrap.scrollLeft,l=this.props.scrollableDataElement();l&&l.scrollLeft!==i&&(l.scrollLeft=i)}}get element(){return this.props.elemRef.current}componentDidMount(){const t=b.isRtl(this.element);this.props.columnResize&&this.props.columnResize.setIsRtl(t),this.forceUpdate()}setScrollLeft(t){this.headerWrap&&this.headerWrap.scrollLeft!==t&&(this.syncScroll=!0,this.headerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?o.createElement("div",{ref:this.props.elemRef,className:g.classNames("k-grid-header",{"k-grid-draggable-header":this.props.draggable}),role:"presentation"},o.createElement("div",{ref:t=>{this.headerWrap=t},className:"k-grid-header-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},onScroll:this.onScroll,role:"presentation"},o.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-header-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},o.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupHeader=t}},this.props.cols),o.createElement("thead",{className:"k-table-thead",role:"rowgroup",...b.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)))):o.createElement("thead",{role:"presentation",className:g.classNames("k-table-thead",{"k-grid-draggable-header":this.props.draggable}),...b.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)}}const vt=(...r)=>Object.assign({allowUnsort:!0,mode:"single"},...r);class pi extends o.PureComponent{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.pressHandler&&this.props.pressHandler(t.event,i)},this.onDrag=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.dragHandler&&this.props.dragHandler(t.event,i)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.releaseHandler&&this.props.releaseHandler(t.event)}}render(){return o.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,hint:this.props.dragClue,autoScroll:{boundaryElementRef:this.props.headerRef,direction:{horizontal:!0,vertical:!1}},scrollContainer:this.props.containerRef||void 0,ref:t=>{this.draggable=t}},o.createElement("tr",{className:"k-table-row",style:{touchAction:"none"},role:"row","aria-rowindex":this.props.ariaRowIndex},this.props.children))}}class Oe extends o.Component{constructor(){super(...arguments),this.state={show:!1},this._anchor=null,this._content=null,this.blurTimeout=void 0,this.willBlur=!1,this.blur=()=>{if(this.willBlur){this.willBlur=!1;return}clearTimeout(this.blurTimeout),this.blurTimeout=window.setTimeout(()=>{this.closeMenu()})},this.focus=()=>{clearTimeout(this.blurTimeout)},this.anchorClick=t=>{t.preventDefault(),this.setState({show:!this.state.show},()=>this.state.show&&this._content&&this._content.focus())},this.closeMenu=()=>{this.setState({show:!1})},this.onAnchorMouseDown=t=>{this.willBlur=this.state.show&&t.currentTarget===this._anchor},this.onAnchorKeyDown=t=>{var i;if(t.keyCode===g.Keys.tab){const l=t.target,e=l&&((i=l.closest(".k-grid"))==null?void 0:i.getElementsByClassName("k-grid-content")[0]);e&&e.scrollWidth>e.clientWidth&&l.scrollIntoView({inline:"center"})}}}render(){const{columnMenu:t,...i}=this.props,{column:l}=this.props,e=w.provideLocalizationService(this),s=l.title||l.field,n=s?`${s} `:"";return o.createElement(o.Fragment,null,o.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:a=>this._anchor=a,onClick:this.anchorClick,onMouseDown:this.onAnchorMouseDown,onKeyDown:this.onAnchorKeyDown,href:"#","aria-label":`${n}${e.toLanguageString(we,k[we])}`},o.createElement(g.IconWrap,{name:"filter",icon:N.filterIcon})),o.createElement(ei.Popup,{anchor:this._anchor,show:this.state.show,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},o.createElement("div",{ref:a=>this._content=a,tabIndex:0,onBlur:this.blur,onFocus:this.focus,style:{outline:"none"}},t&&o.createElement(t,{...i,onCloseMenu:this.closeMenu}))))}}class xt extends o.Component{render(){const{columnMenuWrapperProps:t}=this.props,i=this.props.onClick?{onClick:this.props.onClick}:{},l=o.createElement("span",{className:"k-cell-inner"},o.createElement("span",{className:g.classNames("k-link",{"!k-cursor-default":!this.props.columnMenuWrapperProps.sortable}),...i},o.createElement("span",{className:"k-column-title"},this.props.title||this.props.field||" "),this.props.children),t.columnMenu&&o.createElement(Oe,{...t}));return this.props.render?this.props.render.call(void 0,l,this.props):l}}const ui={true:{asc:"desc",desc:"","":"asc"},false:{asc:"desc",desc:"asc","":"asc"}},gi={none:"none",asc:"ascending",desc:"descending"};class Et extends o.Component{constructor(t){super(t),this.serviceIndex=0,this.index=-1,this.cellKeyDown=(i,l)=>{i.isDefaultPrevented()||i.keyCode===g.Keys.enter&&this.cellClick(i,l)},this.cells=i=>i.map(l=>{const e=this.props.columns[l],s=this.props.sortable&&e.sortable,n=this.props.sort?this.props.sort.findIndex(I=>I.field===e.field):-1,a=n>=0&&this.props.sort[n].dir||"none",h=e.columnMenu===null?null:e.columnMenu||this.props.columnMenu,c=g.classNames({"k-first":e.kFirst,"k-filterable":!!h,"k-table-th":!0,"k-header":!0,"k-grid-header-sticky":e.locked,"k-sorted":this.props.sort&&this.props.sort.some(I=>I.field===e.field)},e.headerClassName),d=e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},f=w.provideLocalizationService(this).toLanguageString(ze,k[ze]);let v=e.isAccessible?{ariaSort:gi[a],role:"columnheader",ariaColumnIndex:e.ariaColumnIndex,ariaSelected:!1,ariaDescription:s?f:""}:{role:"presentation"};const u=e.declarationIndex>=0?++this.index:--this.serviceIndex,E=e.headerCell?e.headerCell:xt,y=o.createElement(E,{key:1,field:e.field,onClick:s&&(I=>this.cellClick(I,e))||void 0,selectionChange:this.props.selectionChange,title:e.title,selectionValue:e.headerSelectionValue,render:this.props.cellRender,children:this.sortIcon(n),columnMenuWrapperProps:{column:{field:e.field,title:e.title,locked:e.locked,filter:e.filter,id:e.id},sortable:s&&this.props.sortable,sort:this.props.sort,onSortChange:this.props.sortChange,filter:this.props.filter,filterable:this.props.filterable&&e.filterable,filterOperators:this.props.filterOperators,onFilterChange:this.props.filterChange,group:this.props.group,groupable:this.props.groupable,onGroupChange:this.props.groupChange,columnMenu:h}}),x={...v,key:u,colSpan:e.colSpan,rowSpan:e.rowSpan,className:c,style:d,columnId:e.id,navigatable:e.navigatable,onKeyDown:s&&(I=>this.cellKeyDown(I,e))||void 0,role:"columnheader"},S=[y,this.props.columnResize&&this.props.columnResize.resizable&&e.resizable&&o.createElement(b.ColumnResizer,{key:2,resize:(I,B,_)=>this.props.columnResize&&this.props.columnResize.dragHandler(I,e,B,_),autofit:I=>this.props.columnResize&&this.props.columnResize.dblClickHandler(I,[e.id])})],F=de(this.props.cells,e.cells);if(F&&F.headerCell){const I=F.headerCell;return o.createElement(I,{key:u,thProps:x,index:l},S)}return o.createElement(b.HeaderThElement,{...x,key:u},S)}),this.cellClick=this.cellClick.bind(this)}cellClick(t,i){if(t.preventDefault(),!this.props.sortChange)return;const{allowUnsort:l,mode:e}=vt(this.props.sortable||!1,i.sortable||!1),s=(this.props.sort||[]).filter(h=>h.field===i.field)[0],n=ui[l][s&&s.dir||""],a=e==="single"?[]:(this.props.sort||[]).filter(h=>h.field!==i.field);n!==""&&i.field&&a.push({field:i.field,dir:n}),this.props.sortChange(a,t)}sortIcon(t){return this.props.sort?t>=0&&[o.createElement("span",{key:1,className:"k-sort-icon"},o.createElement(g.IconWrap,{name:"sort-"+this.props.sort[t].dir+"-small",icon:this.props.sort[t].dir==="asc"?N.sortAscSmallIcon:N.sortDescSmallIcon})),this.props.sort.length>1&&o.createElement("span",{key:2,className:"k-sort-icon"},o.createElement("span",{className:"k-sort-order"},t+1))]:null}render(){return this.serviceIndex=0,this.index=-1,this.props.columnsMap.map((t,i)=>this.props.pressHandler&&o.createElement(pi,{key:i,pressHandler:this.props.pressHandler,dragHandler:this.props.dragHandler,releaseHandler:this.props.releaseHandler,ariaRowIndex:i+1,dragClue:this.props.dragClue,headerRef:this.props.headerRef,containerRef:this.props.containerRef},this.cells(t))||o.createElement("tr",{key:i,className:"k-table-row",role:"row","aria-rowindex":i+1},this.cells(t)))}}w.registerForLocalization(Et);const fi=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],He={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},R=r=>r==="isnull"||r==="isnotnull"||r==="isempty"||r==="isnotempty",te=(r,t)=>r.map(i=>({text:t.toLanguageString(i.text,k[i.text]),operator:i.operator})),mi="eq",_e=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],Ci={text:!1,numeric:!1,date:!1,boolean:!0},Re=(r,t,i)=>{const l=St(i.operators);let e=i.operator;switch(i.filterType){case"numeric":(!e||R(e))&&(e=l),r===null&&e===l&&(e="");break;case"date":(!e||R(e))&&(e=l),r===null&&e===l&&(e="");break;case"text":(!e||R(e))&&(e=l),!r&&e===l&&(e="");break;default:return}i.onChange({value:r,operator:e,syntheticEvent:t})},St=(r,t)=>t?r[t][0].operator:r[0].operator,Ae=r=>r||"text",Ke=(r,t)=>{const i=r.target.value;t({value:i.operator,operator:i.operator===""?"":mi,syntheticEvent:r.syntheticEvent})},Be=(r,t,i)=>{let l=t;const e=r.target.value;r.target.state.opened&&(R(e.operator)&&(l=null),t===null&&!R(e.operator)&&(l=void 0),i({value:l,operator:e.operator,syntheticEvent:r.syntheticEvent}))};class We extends o.Component{constructor(t){super(t),this._inputRef=o.createRef(),this.renderOperatorEditor=i=>{if(this.props.filterType==="boolean")return;const l=this.props.operators.find(e=>e.operator===this.props.operator)||null;return o.createElement(Z.DropDownList,{size:this.props.size,value:l,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:N.filterIcon,data:this.props.operators,textField:"text",title:i.toLanguageString(Ge,k[Ge]),popupSettings:{width:""}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const t=w.provideLocalizationService(this),i=o.createElement("div",{className:"k-filtercell"},o.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),o.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(t)," ",o.createElement(K.Button,{size:this.props.size,icon:"filter-clear",svgIcon:N.filterClearIcon,className:g.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:t.toLanguageString(P,k[P]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,i,this.props):i}inputChange(t,i){Re(t,i,this.props)}operatorChange(t){Be(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Ke(t,this.props.onChange)}clear(t){t.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:t}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(t,i,l){switch(t){case"numeric":return o.createElement(L.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return o.createElement(ve.DatePicker,{ref:this._inputRef,size:this.props.size,value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"boolean":{const e=s=>s==null;return o.createElement(Z.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:l.find(s=>s.operator===(e(i)?"":i)),data:l,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel})}default:return o.createElement(L.TextBox,{ref:this._inputRef,size:this.props.size,value:i||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}w.registerForLocalization(We);const bi="k-table-row k-filter-row";class It extends o.Component{headerCellClassName(t,i){let l=`${i?"k-grid-header-sticky":""}`;return this.props.sort&&this.props.sort.filter(e=>e.field===t).length>0&&(l+=" k-sorted"),l}setFilter(t,i,l,e){if(!this.props.filterChange)return;const s=[];(t!==""&&t!==null||i!=="")&&s.push({field:l,operator:i,value:t}),this.props.filter&&this.props.filter.filters&&(this.props.filter.filters||[]).forEach(h=>{const c=h;c&&c.field!==l&&s.push(c)});const n=this.props.filter&&this.props.filter.logic?this.props.filter.logic:"and";this.props.filterChange(s.length>0?{logic:n,filters:s}:null,e)}render(){const t=w.provideLocalizationService(this),i=this.props.filter&&this.props.filter.filters||[],l=a=>{if(a===void 0)return;const h=i.filter(c=>c.field===a);return h.length?h[0]:void 0};let e=0,s=-1;const n=this.props.columns.filter(a=>a.children.length===0).map(a=>{const h=Ae(a.filter),c=l(a.field),d=a.filterable?t.toLanguageString(Le,k[Le]):void 0;let f=c&&c.value;f===void 0&&(f=h==="text"?"":null);const v=a.filterable&&{render:this.props.cellRender,field:a.field,title:a.filterTitle,value:f,operator:c&&c.operator,operators:te(this.props.filterOperators[h]||[],t),booleanValues:te(_e,t),filterType:h,ariaLabel:d,onChange:I=>{this.setFilter(I.value,I.operator,a.field,I.syntheticEvent)}},u=a.declarationIndex>=0?++s:--e,E={ariaLabel:d,ariaColumnIndex:a.ariaColumnIndex},y=a.left!==void 0?this.props.isRtl?{left:a.right,right:a.left}:{left:a.left,right:a.right}:{},x={columnId:b.tableKeyboardNavigationTools.getFilterColumnId(a.id),navigatable:a.navigatable,style:y,className:g.classNames("k-table-th",this.headerCellClassName(a.field,a.locked)||void 0),role:"columnheader",...E},S=v&&(a.filterCell?o.createElement(a.filterCell,{...v}):o.createElement(We,{size:this.props.size,...v})),F=de(this.props.cells,a.cells);if(F&&F.filterCell){const I=F.filterCell;return o.createElement(I,{key:u,...v,thProps:x,index:s},S)}return o.createElement(b.HeaderThElement,{key:u,...x},S)});return o.createElement("tr",{className:bi,"aria-rowindex":this.props.ariaRowIndex,role:"row"},n)}}w.registerForLocalization(It);class wt extends o.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.onPress&&this.props.onPress(t.event,i)},this.onDrag=t=>{const i=this.draggable&&this.draggable.element;i&&this.props.onDrag&&this.props.onDrag(t.event,i)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(t.event)},this.sortChange=t=>{if(t.preventDefault(),this.props.onSortChange){const i=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(t,i)}},this.groupRemove=t=>{t.preventDefault(),t.stopPropagation(),this.props.onRemove&&this.props.onRemove(t)},this.onContextMenu=t=>{const i={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,t,{dataItem:{...i}})}}render(){const{dir:t}=this.props;return o.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:i=>{this.draggable=i}},o.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},o.createElement("span",null,o.createElement(g.IconWrap,{name:"sort-"+t+"-small",icon:t==="asc"?N.sortAscSmallIcon:N.sortDescSmallIcon,size:"small"})),o.createElement("span",{className:"k-chip-content"},this.props.title),o.createElement("span",{className:"k-chip-actions"},o.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},o.createElement(g.IconWrap,{name:"x-circle",icon:N.xCircleIcon,size:"small"})))))}}w.registerForLocalization(wt);class kt extends o.Component{constructor(){super(...arguments),this.onGroupRemove=(t,i)=>{const l=this.props.group.slice();l.splice(i,1),this.props.groupChange(l,t)},this.onGroupSortChange=(t,i,l,e)=>{const s=Object.assign({},l,{dir:e}),n=this.props.group.slice();n.splice(i,1,s),this.props.groupChange(n,t)}}render(){const i=(this.props.group||[]).map((l,e)=>o.createElement(wt,{key:e,index:e,dir:l.dir||"asc",title:this.props.resolveTitle(l.field),onRemove:s=>{this.onGroupRemove(s,e)},onSortChange:(s,n)=>{this.onGroupSortChange(s,e,l,n)},onPress:this.props.pressHandler,onDrag:this.props.dragHandler,onRelease:this.props.releaseHandler,onContextMenu:this.props.onContextMenu}));return o.createElement("div",{ref:this.props.refCallback,className:"k-grouping-header",role:"toolbar","aria-label":w.provideLocalizationService(this).toLanguageString(De,k[De]),"aria-controls":this.props.ariaControls||""},o.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},i),o.createElement("div",{className:"k-grouping-drop-container"},!i.length&&w.provideLocalizationService(this).toLanguageString(Ie,k[Ie])," "))}}w.registerForLocalization(kt);class vi extends o.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=g.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(t){this.footerWrap&&(this.footerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?o.createElement("div",{className:"k-grid-footer",role:"presentation"},o.createElement("div",{ref:t=>{this.footerWrap=t},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},o.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},o.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupFooter=t},role:"presentation"},this.props.cols),o.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):o.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}class xi{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=o.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=o.createRef(),this.tableTransform="",this.prevScrollPos=0,this.tableTranslate=0,this.scrollSyncing=!1,this.reactVersion=Number.parseFloat(o.version),this.topItems=(i,l)=>{if(!this.container||l)return{topItemsCount:0,topItemsHeight:0};const e=this.container.clientHeight,s=Math.ceil(e/i[0].line),n=Math.ceil((i.length-s)/2);let a=0;for(let h=0;h<n;h++)a+=i[h].line+i[h].acc;return{topItemsCount:n,topItemsHeight:a,itemsNeededOnScreen:s+s/2}},this.horizontalScrollbarHeight=()=>this.container?this.container.offsetHeight-this.container.clientHeight:0,t&&(this.topCacheCount=4,this.attendedSkip=-this.topCacheCount),this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}get rowHeights(){const t=[],i=this.tableBodyRef.current&&this.tableBodyRef.current.children||[];let l=0;for(let e=0;e<i.length;e++){if(i[e].className.indexOf("k-grouping-row")>-1){l+=i[e].scrollHeight;continue}i[e].className.indexOf("k-detail-row")>-1?t[t.length-1].line+=i[e].scrollHeight:(t.push({line:i[e].scrollHeight,acc:l}),l=0)}return t}changePage(t,i){this.attendedSkip=t-this.topCacheCount,this.PageChange&&this.PageChange({skip:Math.max(0,t-this.topCacheCount),take:this.pageSize},i)}translate(t,i){this.tableTranslate=t,this.scrollableVirtual&&this.table&&(this.reactVersion<=17||i?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}localScrollUp(t){if(!this.container)return;const i=this.rowHeights,l=this.container.scrollTop;let e=this.tableTranslate,s=0;const{topItemsCount:n,topItemsHeight:a,itemsNeededOnScreen:h}=this.topItems(i,!!this.topCacheCount),c=l-e;if(!(c>a||i.length<=h)){for(;s<this.topCacheCount+this.attendedSkip-this.realSkip+n&&this.propsSkip-s>0&&!(e+(i[i.length-1-s].line+i[i.length-1-s].acc)+c<=l);)e-=i[i.length-1-s].line+i[i.length-1-s].acc,s++;if(s===0&&this.topCacheCount===0&&this.attendedSkip>0&&(e=Math.max(e-i[0].line,0),s=1),this.propsSkip-s<=0&&e>l){this.translate(0),this.changePage(0,t),this.container.scrollTop=0;return}if(e>l&&(e=l),e!==this.tableTranslate){this.translate(Math.max(0,e-a));const d=Math.max(0,this.propsSkip-s-n);this.changePage(d,t)}}}localScrollDown(t){if(!this.container)return;const i=this.rowHeights,l=this.container.scrollTop;let e=this.tableTranslate,s=0;const{topItemsCount:n,topItemsHeight:a,itemsNeededOnScreen:h}=this.topItems(i,!!this.topCacheCount);for(;s<i.length-this.topCacheCount&&!(e+i[s].line+i[s].acc>l);)e+=i[s].line+i[s].acc,s++;n>this.propsSkip+s||i.length<=h||(s>=i.length-this.topCacheCount&&this.propsSkip+s>=this.total?(this.translate(e-a),this.changePage(this.total-1-n,t)):e!==this.tableTranslate&&this.propsSkip+s-n!==this.propsSkip&&(this.translate(e-a),this.changePage(this.propsSkip+s-n,t)))}scrollNonStrict(t){const i=this.total*this.prevScrollPos/this.containerHeight;let l=Math.floor(i);l>=this.total&&(l=this.total-1);const e=Math.min(i-l,1);let s=0;const n=l-this.propsSkip,a=this.rowHeights;n>=0&&n<=1?s=-((a[0].line+a[0].acc)*e):n===-1&&(s=-((a[a.length-1].line+a[a.length-1].acc)*e));const{topItemsCount:h,topItemsHeight:c}=this.topItems(a,!!this.topCacheCount);this.translate(Math.max(0,s-c-this.horizontalScrollbarHeight()+this.containerHeight*i/this.total)),this.changePage(l-h,t)}scrollHandler(t){if(!this.scrollableVirtual)return;if(this.scrollSyncing||!this.container||!this.table){this.scrollSyncing=!1;return}const i=this.container.scrollTop,l=this.prevScrollPos;if(this.prevScrollPos=i,this.askedSkip!==void 0){this.translate(this.containerHeight*this.askedSkip/this.total),this.changePage(this.askedSkip,t),this.prevScrollPos=i,this.askedSkip=void 0;return}i-l<0&&i>this.tableTranslate-this.table.scrollHeight/10?this.localScrollUp(t):i-l>0&&i<this.tableTranslate+this.table.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t),this.prevScrollPos=i}}class yt{constructor(t=0,i,l,e){this.total=t,this.offsets=[],this.heights=[];let s=0;for(let n=0;n<t;n++){this.offsets.push(s);const a=e&&e[n].expanded&&e[n].rowType==="data"?l:i;s+=a,this.heights.push(a)}}height(t){return this.heights[t]}index(t){if(t<0)return;const i=this.offsets.reduce((l,e,s)=>{if(l!==void 0)return l;if(e===t)return s;if(e>t)return s-1},void 0);return i===void 0?this.total-1:i}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],i=this.heights[this.heights.length-1];return t+i}}class Nt{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=o.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=o.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(o.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(t,i){this.scrollableVirtual&&this.table&&(Ee||this.reactVersion<=17||i?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}changePage(t,i){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},i)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(t){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const i=this.container.scrollTop,l=this.lastScrollTop>=i,e=!l;this.lastScrollTop=i;let s=this.rowHeightService.index(i),n=this.rowHeightService.offset(s);const{offsetHeight:a}=this.containerRef.current,h=this.rowHeightService.index(i+a);if(e&&h>=this.lastLoaded&&this.lastLoaded<this.total){const c=s+this.pageSize-this.total;c>0&&(s=s-c,n=this.rowHeightService.offset(s)),this.firstLoaded=s,this.translate(n);let d=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(d,this.total),this.changePage(this.firstLoaded,t)}else if(l&&s<this.firstLoaded){const c=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(s-c,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,t)}}}const Ei=1,Si=20;class Ii{constructor(t){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=i=>{this.isRtl=i},this.dragHandler=(i,l,e,s)=>{const n=i.originalEvent;s||(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation());const a=e.closest("th");if(!a||!a)return;const h=a.clientWidth;let c=h;if(this.isRtl?c+=e.getBoundingClientRect().right-e.offsetWidth/2-i.clientX:c+=i.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!s&&Math.abs(c-h)<1)return;this.fixateInitialWidths(a.parentElement.clientWidth),this.setWidths(l,Math.floor(c)/h);const d=this.columns.filter(f=>!f.children.length).findIndex(f=>f.id===l.id);this.onResize(d,h,c,n,s,l.id)},this.dblClickHandler=(i,l)=>{const e=this.columns.filter(v=>l.indexOf(v.id)>-1);if(!this.colGroupMain||!e.length)return;const s={},n=e;for(;n.length>0;){const v=n.pop();if(!v)break;v.children.length?n.push(...v.children):s[v.id]=v}const a=this.columns.filter(v=>!v.children.length),h=[];a.forEach((v,u)=>{s[v.id]&&h.push(u)});const c=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(c.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(c.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),c.forEach(v=>v.classList.add("k-autofitting"));let f=[];d.forEach(v=>{h.forEach(u=>{v.children[u]&&(v.children[u].width="",f[u]=Math.max(f[u]||0,v.children[u].offsetWidth+Ei))})}),d.forEach(v=>{h.forEach(u=>{v.children[u]&&(v.children[u].width=f[u]+"px",a[u].width=f[u])})}),c.forEach(v=>v.classList.remove("k-autofitting")),this.onResize(h[0],0,0,i,!0,l[0])},this.updateColElements=i=>{const l=this.columns.filter(s=>!s.children.length);let e=1e-10;for(let s=0;s<i.length;s++){const n=i[s],a=l.findIndex(f=>f.id===n.id),h=parseFloat((n.width||0).toString()),c=Math.floor(h);e+=h-c;const d=c+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[a]){const f=parseInt(this.colGroupMain.children[a].width,10);this.colGroupMain.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,n,f-d)}if(this.colGroupHeader&&this.colGroupHeader.children[a]){const f=parseInt(this.colGroupHeader.children[a].width,10);this.colGroupHeader.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,n,f-d)}if(this.colGroupFooter&&this.colGroupFooter.children[a]){const f=parseInt(this.colGroupFooter.children[a].width,10);this.colGroupFooter.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,n,f-d)}}},this.onResize=t}fixateInitialWidths(t){const i=this.columns.filter(n=>!n.children.length);let l=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let n=0;n<e.length;n++)e[n].width?t-=parseFloat(e[n].width):l++;if(l===0)return;const s=Math.floor(t/l);for(let n=0;n<e.length;n++){const a=e[n];a.width||(a.width=s,i[n].width=s.toString(),this.colGroupHeader&&(this.colGroupHeader.children[n].width=s),this.colGroupFooter&&(this.colGroupFooter.children[n].width=s))}}setWidths(t,i){const l=this.columns.findIndex(n=>n.id===t.id),e=[];let s=t.children.length;for(let n=l+1;s>0&&n<this.columns.length;n++,s--){const a=this.columns[n];a.children.length?s+=a.children.length:e.push(a)}return e.length===0&&e.push(t),e.forEach(n=>{let a=n.width?parseFloat(n.width.toString())*i:0;const h=n.minResizableWidth===void 0?10:n.minResizableWidth;a<h&&(a=h),n.width=a}),this.updateColElements(e),e}updateNextLockedCol(t,i,l){const e=i.index,s=this.colGroupMain.parentElement.closest(".k-grid"),n=s==null?void 0:s.clientWidth,a=this.columns.filter(h=>h.locked).map(h=>parseInt(h.width+"",10)).reduce((h,c)=>h+c,0);!i.locked||n<=a+Si||this.columns.forEach(h=>{if(h!=null&&h.locked&&l){const c=t==null?void 0:t.querySelectorAll('[aria-colindex="'+h.ariaColumnIndex+'"]');c==null||c.forEach(d=>{const f=d.style;this.isRtl?(h.index>e&&f&&f.right&&(f.right=parseInt(f.right,10)-l+"px"),h.index<e&&f&&f.left&&(f.left=parseInt(f.left,10)-l+"px")):(h.index>e&&f&&f.left&&(f.left=parseInt(f.left,10)-l+"px"),h.index<e&&f&&f.right&&(f.right=parseInt(f.right,10)-l+"px"))})}})}}class Ft{constructor(t,i,l){this.refDragElementClue=o.createRef(),this.refDropElementClue=o.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=e=>{this.groupPanelDivElement=e&&e.children?e.children[0]:e},this.pressHandler=(e,s)=>{const n=this.getColumnIndex(e,s);if(this.startGroup=this.getGroupIndex(e),n>=0){const a=this.columns[n];(a.reorderable&&this.reorderable||a.groupable&&this.groupable)&&(this.startColumn=n)}},this.dragHandler=(e,s)=>{if(e.isTouch||e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(e,s);const n=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(e)?n&&n.length?n.length:0:this.getGroupIndex(e);const a=!this.isValid();a&&(this.currentColumn=-1,this.currentGroup=-1);const h=this.currentColumn>=0?s.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(e)?e.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(e,s,h,a),this.updateDropElementClue(e,s,h,a)},this.releaseHandler=e=>{const s=this.startColumn,n=this.currentColumn,a=this.startGroup,h=this.currentGroup;e.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const c=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,c&&(s>=0&&n>=0?this.columnReorder(s,n,e.originalEvent):a>=0&&h>=0?this.groupReorder(a,h,e.originalEvent):s>=0&&h>=0&&this.columnToGroup(s,h,e.originalEvent))},this.columnReorder=t,this.groupReorder=i,this.columnToGroup=l}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(t,i){if(!i||i.parentElement===this.groupPanelDivElement)return-1;const l=b.getIndex(t,i);if(l===-1)return-1;for(let e=0;e<i.parentNode.children.length;e++)if(i.parentNode.children[e]===i)return this.columns.findIndex(s=>s.index===l&&s.depth===e);return-1}isTargetGroupingContainer(t){const i=t.originalEvent.target;return i.className.indexOf?i.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(t){return b.getIndex(t,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(t,i,l,e){if(!this.dragElementClue)return;const s=this.startColumn>=0?i.children[this.columns[this.startColumn].index].innerText:i.innerText;this.dragElementClue.setState({visible:!0,top:t.pageY+10,left:t.pageX,innerText:s,status:e||!l?"k-i-cancel":"k-i-plus"})}updateDropElementClue(t,i,l,e){if(!this.dropElementClue)return;if(e||!l){this.dropElementClue.setState({visible:!1});return}const s=l.getBoundingClientRect(),a=(l.closest(".k-grouping-header")||l).getBoundingClientRect();let h=s.left+t.pageX-t.clientX-6;!this.isTargetGroupingContainer(t)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(h+=s.width);const c=a.top+t.pageY-t.clientY;this.dropElementClue.setState({visible:!0,top:c,left:h,height:this.currentColumn>=0?i.clientHeight:a.height})}}const Gt=r=>{let t=null;const i=w.useInternationalization(),l=b.useTableKeyboardNavigation(r.id),e=o.useCallback(c=>{r.onContextMenu&&r.onContextMenu.call(void 0,c,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]);let s=null,n=null;if(r.rowType==="groupFooter")s={onContextMenu:e,className:r.className},t=o.createElement("td",{...s});else if(r.rowType!=="groupHeader"){if(r.field!==void 0){const d=H(r.field,r.dataItem);d!=null&&(n=r.format?i.format(r.format,d):d.toString())}const c=g.classNames("k-table-td",r.className,{"k-selected":r.isSelected});s={onContextMenu:e,colSpan:r.colSpan,style:r.style,className:c,role:"gridcell","aria-colindex":r.ariaColumnIndex,"aria-selected":r.isSelected,[U]:r.columnIndex,...l},t=o.createElement("td",{...s},n)}const a=r.rowType||"data",h=r.cells;if(h&&h[a]){const c=h[a];return o.createElement(c,{...r,tdProps:s},n)}return r.render?r.render.call(void 0,t,r):t},Te=r=>{let t=null;const{columnIndex:i,level:l,columnsCount:e,rowType:s,dataItem:n,field:a,onChange:h,expanded:c,render:d,dataIndex:f,ariaColumnIndex:v,isRtl:u}=r,E=a||"",y=b.useTableKeyboardNavigation(r.id),x=w.useLocalization();let S=null,F=null,I=null;const B=o.useCallback(D=>{D.isDefaultPrevented()||D.keyCode===g.Keys.enter&&h&&(D.preventDefault(),h({dataItem:n,dataIndex:f,syntheticEvent:D,field:void 0,value:!c}))},[c,h,n,f]),_=o.useCallback(D=>{r.onContextMenu&&r.onContextMenu.call(void 0,D,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),fe=(D,je)=>{const me=c?ut:pt,Xe=x.toLanguageString(me,k[me]);return S={className:"k-table-td",style:{...r.style,...je},colSpan:D,key:"g-colspan",role:"gridcell",["aria-selected"]:!1,["aria-expanded"]:c,["aria-colindex"]:v,onKeyDown:B,onContextMenu:_,...y},I=o.createElement("p",{className:"k-reset"},o.createElement("a",{onClick:le=>{le.preventDefault(),h&&h({dataItem:n,dataIndex:f,syntheticEvent:le,field:void 0,value:!c})},href:"#",tabIndex:-1,"aria-label":Xe},o.createElement(g.IconWrap,{name:c?"caret-alt-down":u?"caret-alt-left":"caret-alt-right",icon:c?N.caretAltDownIcon:u?N.caretAltLeftIcon:N.caretAltRightIcon})),n[E]instanceof Date&&n[E].toString?n[E].toString():n[E]),o.createElement("td",{...S,key:S.key},I)};i===void 0||l===void 0||i<l||e===void 0||s!=="groupHeader"||n[E]===void 0?(S={style:r.style,key:"g"+i,className:g.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":r.locked}),role:"gridcell",onContextMenu:_},t=o.createElement("td",{...S,key:S.key})):i<=l&&!r.locked?t=fe(e-i,{}):i<=l&&r.locked&&(F={className:"k-table-td",role:"gridcell",colSpan:e-i,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:_},t=o.createElement(o.Fragment,null,fe(0,{position:"sticky",zIndex:2}),o.createElement("td",{...F})));const se=r.rowType||"data",X=r.cells;if(X&&X.group&&X.group[se]){const D=X.group[se];return o.createElement(D,{...r,tdProps:S,td2Props:F},I)}return d?d.call(void 0,t,r):t};class Mt extends o.Component{render(){const t=g.classNames("k-table-row",{"k-table-group-row k-grouping-row":this.props.rowType==="groupHeader","k-group-footer":this.props.rowType==="groupFooter","k-master-row":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter","k-table-alt-row k-alt":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter"&&this.props.isAltRow,"k-selected":this.props.isSelected,"k-grid-edit-row":this.props.isInEdit}),i=o.createElement("tr",{id:this.props.id,onClick:this.props.onClick,onDoubleClick:this.props.onDoubleClick,className:t,style:{height:this.props.rowHeight?this.props.rowHeight+"px":"",visibility:this.props.isHidden?"hidden":""},role:"row","aria-rowindex":this.props.ariaRowIndex,"absolute-row-index":this.props.absoluteRowIndex,key:this.props.absoluteRowIndex,[Ct]:this.props.rowType==="data"?this.props.dataIndex:void 0},this.props.children);return this.props.render?this.props.render.call(void 0,i,this.props):i}}class wi extends o.Component{get _inputId(){return this.props.id}render(){const{columnMenuWrapperProps:t}=this.props,i=[o.createElement("span",{key:0,className:"k-checkbox-wrap"},o.createElement("input",{checked:this.props.selectionValue,id:this._inputId,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:l=>this.props.selectionChange({field:this.props.field,syntheticEvent:l})})),o.createElement("label",{key:1,className:"k-checkbox-label",htmlFor:this._inputId}),t.columnMenu&&o.createElement(Oe,{...t})];return this.props.render?this.props.render.call(void 0,i,this.props):i}}const ki=g.withIdHOC(wi);class pe extends o.Component{render(){return this.props.children||w.provideLocalizationService(this).toLanguageString(Se,k[Se])}}pe.displayName="KendoReactGridNoRecords",w.registerForLocalization(pe);class yi extends o.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(t,i)=>{const l={colSpan:t.colSpan!==1?t.colSpan:void 0,style:t.left!==void 0?this.props.isRtl?{left:t.right,right:t.left}:{left:t.left,right:t.right}:{},className:g.classNames("k-table-td",t.locked&&t.left!==void 0?"k-grid-footer-sticky":""),key:i,role:"gridcell",["aria-colindex"]:t.ariaColumnIndex},e={field:t.field,ariaColumnIndex:t.ariaColumnIndex,...l},s=de(this.props.cells,t.cells);if(s&&s.footerCell){const n=s.footerCell;return o.createElement(n,{...e,tdProps:l,index:i})}return t.footerCell&&o.createElement(t.footerCell,{...e,key:i})||o.createElement("td",{...l})}}get element(){return this._element}render(){return o.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},li(this.props.columns).map(this.renderCell))}}const Ni=({buttonCount:r=10,info:t=!0,type:i="numeric",pageSizes:l=void 0,previousNext:e=!0,responsive:s=void 0,pageSizeValue:n=void 0})=>({buttonCount:r,info:t,pageSizes:l===!0?[5,10,20]:l||void 0,previousNext:e,responsive:s!==!1,type:i,pageSizeValue:n}),Fi=r=>Ni(r===!0?{}:r),zt={name:"@progress/kendo-react-grid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Gi=r=>{const{colSpan:t,ariaColIndex:i,dataItem:l,dataIndex:e,id:s}=r,n=b.useTableKeyboardNavigation(s),a=o.useCallback(h=>{r.onContextMenu&&r.onContextMenu.call(void 0,h,r.dataItem)},[r.onContextMenu,r.dataItem]);return o.createElement("td",{onContextMenu:a,className:"k-table-td k-detail-cell",colSpan:t,"aria-colindex":i,role:"gridcell",...n},o.createElement(r.detail,{dataItem:l,dataIndex:e}))},Mi=r=>{const t=b.useTableKeyboardNavigation(r.id);return o.createElement("td",{className:"k-table-td k-hierarchy-cell",...t,role:"gridcell"})};let $=class extends o.Component{constructor(t){super(t),this._columns=[],this._columnsMap=[[]],this._columnsMutations=0,this._resized=!1,this._shouldUpdateLeftRight=!0,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this._data=[],this._slicedData=void 0,this.wrapperScrollTop=0,this.showLicenseWatermark=!1,this.headerRef=o.createRef(),this.headerElementRef=o.createRef(),this._element=null,this.tableElement=null,this.containerRef=o.createRef(),this.tableBodyRef=o.createRef(),this._footer=null,this.forceUpdateTimeout=void 0,this.isRtl=!1,this.observer=null,this.handleIntersection=e=>{const s={rowIndex:this.rowIndex};e.forEach(n=>{n.isIntersecting||this.setCurrentOnTop(s)})},this.setCurrentOnTop=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.observer&&this.observer.disconnect();const{rowIndex:s}=e;if(this.props.scrollable==="virtual")this.vs.askedSkip=s,this.vs.container.scroll(0,Math.round(this.vs.askedSkip/this.vs.total*this.vs.container.scrollHeight));else if(this.element){const n=s<1?this.element.querySelector("tbody > tr:nth-child(1)"):this.element.querySelector(`tbody > tr:nth-child(${s+1})`);n&&this.containerRef.current&&(this.containerRef.current.scrollTop=n.offsetTop)}},this.scrollIntoView=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.rowIndex=e.rowIndex;const{rowIndex:s}=e,n=this.element;if(this.observer&&n){this.observer.disconnect();const a=n.querySelector(`[absolute-row-index="${s}"]`);a?this.observer.observe(a):this.setCurrentOnTop(e)}},this.fitColumns=e=>{this.columnResize.dblClickHandler(null,e)},this.onContextMenu=(e,s,n)=>{if(this.props.onContextMenu){const a={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,dataItem:s,field:n};this.props.onContextMenu.call(void 0,a)}},this.getVirtualScroll=e=>{const{rowHeight:s,detailRowHeight:n,detail:a,expandField:h,groupable:c}=e,d=this.isAllData(),f=s!==void 0&&s>0,v=n!==void 0&&n>0,u=c===!0||typeof c=="object"&&c.enabled!==!1;return!f||u&&!d||!!(a&&h)&&(!v||!d)?xi:Nt},this.isAllData=()=>{const{data:e,total:s}=this.props;return Array.isArray(e)?e.length===s:e?s===e.total:!1},this.initializeVirtualization=(e,s)=>{if(this.reInitVirtualization(this.props.scrollable==="virtual",this.props.total,this.props.filter,this.props.group,this.props.sort,s||this.props.rowHeight===void 0||this.props.rowHeight===0),this.vs.fixedScroll=this.props.fixedScroll||!1,this.vs.PageChange=this.pageChange,this.vs.realSkip=this.props.skip||0,this.vs.pageSize=(this.props.take!==void 0?this.props.take:this.props.pageSize)||0,this.vs.scrollableVirtual=this.props.scrollable==="virtual",this.vs.total=e,this.vs.propsSkip=(this.props.skip||0)+(this.props.scrollable==="virtual"?this.vs.topCacheCount+(this.vs.attendedSkip-(this.props.skip||0)):0),this.props.rowHeight!==void 0&&this.props.rowHeight>0&&!s){const n=this.props.rowHeight*e;this.vs.containerHeight=Ee?Math.min(it,n):n}else this.vs.containerHeight=1533915;if(this.vs.containerRef=this.containerRef,this.vs.tableBodyRef=this.tableBodyRef,this.vs.table=this.tableElement,this._slicedData=void 0,this.vs instanceof Nt){const{rowHeight:n=0,detail:a,expandField:h}=this.props;let{detailRowHeight:c=0}=this.props;c=a&&h?c:n,this.isAllData()?(this.vs.total=this._data.length,this._slicedData=this._data.slice(this.vs.realSkip,this.vs.realSkip+this.vs.pageSize),this.vs.rowHeightService=this.rowHeightService(this.vs,this._data.length,n,c,this._data)):this.vs.rowHeightService=new yt(e,n,c);const d=this.vs.rowHeightService.totalHeight();this.vs.containerHeight=Ee?Math.min(it,d):d}},this.scrollHandler=e=>{if(e.target!==e.currentTarget)return;clearTimeout(this.forceUpdateTimeout),this.vs.table=this.tableElement;const s=e.currentTarget.scrollLeft,n=e.currentTarget.scrollTop;this.props.columnVirtualization&&(!this.vs.scrollableVirtual||n===this.wrapperScrollTop)&&(this.forceUpdateTimeout=window.setTimeout(()=>{this.forceUpdate()},0)),this._header&&this._header.setScrollLeft(s),this._footer&&this._footer.setScrollLeft(s),this.vs&&n!==this.wrapperScrollTop&&this.vs.scrollHandler(e),g.dispatchEvent(this.props.onScroll,e,this,void 0),this.wrapperScrollTop=n},this.onKeyDown=e=>{if(b.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,onNavigationAction:this.onNavigationAction}),this.props.onKeyDown){const{mode:s,cell:n}=b.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:s,cell:n,componentId:this._gridId,selectedField:this.props.selectedField,...this.getArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{b.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onNavigationAction=e=>{if(this.props.onNavigationAction){const s={focusElement:e.focusElement,...this.getArguments(e.event)};this.props.onNavigationAction.call(void 0,s)}},this.rowClick=(e,s)=>{this.props.onRowClick&&e.target.nodeName==="TD"&&this.props.onRowClick.call(void 0,{dataItem:s.dataItem,...this.getArguments(e)})},this.rowDblClick=(e,s)=>{this.props.onRowDoubleClick&&e.target.nodeName==="TD"&&this.props.onRowDoubleClick.call(void 0,{dataItem:s.dataItem,...this.getArguments(e)})},this.itemChange=e=>{const s=this.props.onItemChange;if(e.field===this.props.expandField||this.props.group&&e.field===void 0){const n=this.props.onExpandChange;n&&n.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,dataIndex:e.dataIndex,value:e.value});return}s&&s.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,field:e.field,value:e.value})},this.onHeaderSelectionChange=e=>{this.props.onHeaderSelectionChange&&this.props.onHeaderSelectionChange.call(void 0,{field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems(),selectedField:this.props.selectedField})},this.selectionRelease=e=>{if(this.props.onSelectionChange){const s={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._gridId,dataItems:this.getLeafDataItems(),dataItem:null,...e};this.props.onSelectionChange.call(void 0,s)}},this.pageChange=(e,s,n)=>{this.raiseDataEvent(this.props.onPageChange,{page:e},{skip:e.skip,take:e.take},s,n)},this.pagerPageChange=e=>{this.pageChange({skip:e.skip,take:e.take},e.syntheticEvent,e.targetEvent)},this.sortChange=(e,s)=>{this.raiseDataEvent(this.props.onSortChange,{sort:e},{sort:e,...this.props.scrollable==="virtual"?{skip:0}:{}},s)},this.filterChange=(e,s)=>{this.raiseDataEvent(this.props.onFilterChange,{filter:e},{filter:e||void 0,skip:0},s)},this.groupChange=(e,s)=>{const n=s.nativeEvent?s:{nativeEvent:s.nativeEvent||s.originalEvent};this.raiseDataEvent(this.props.onGroupChange,{group:e},{group:e,skip:0},n)},this.onClipboard=(e,s)=>{if(this.props.onClipboard){if(!this.inActiveElement()||!e)return;this.props.onClipboard.call(void 0,{type:e,nativeEvent:s,columns:this._columns,dataItemKey:this.props.dataItemKey||"",...typeof this.props.clipboard!="boolean"?this.props.clipboard:{}})}},this.inActiveElement=()=>{var h,c,d;if(!g.canUseDOM)return!1;const e=g.getActiveElement(this.document),s=e?e.matches(".k-table-td")?e:(h=this.document)==null?void 0:h.body:(c=this.document)==null?void 0:c.body,n=s.closest(".k-grid-container"),a=s&&((d=this._element)==null?void 0:d.contains(s));return!!(s&&a&&n)},this.onResize=(e,s,n,a,h,c)=>{this.resetTableWidth(),this._shouldUpdateLeftRight=!0,this._resized=!0,this._columnsMutations++,this.props.onColumnResize&&this.props.onColumnResize.call(void 0,{columns:this.columns,nativeEvent:a,targetColumnId:c,index:e,newWidth:s,oldWidth:n,end:h,target:this})},this.reInitVirtualization=g.memoizeOne((e,s,n,a,h,c)=>{this.vs.reset();const d=this.getVirtualScroll(this.props);this.vs=new d(c)}),this.flatData=g.memoizeOne((e,s,n,a,h,c,d)=>{const f=[],v=Qe(f,e,s,{index:n},a!==void 0,h);return{flattedData:f,resolvedGroupsCount:v}}),this.rowHeightService=g.memoizeOne((e,s,n,a,h)=>new yt(s,n,a,h)),this.childrenToArray=g.memoizeOne(e=>o.Children.toArray(e)),this.readColumns=g.memoizeOne((e,s,n)=>{const a=e.filter(h=>h&&h.type&&h.type.displayName==="KendoReactGridColumn");return et(a,this.columns,{prevId:0,idPrefix:s})}),this.mapColumns=g.memoizeOne(e=>b.mapColumns(e)),this.configureColumns=g.memoizeOne((e,s,n)=>{this.props.selectedField&&e.filter(c=>c.field===this.props.selectedField).forEach(c=>{c.width=c.width||"50px",c.cell=c.cell||rt,c.headerCell=c.headerCell||ki});const a={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let h=0;this.props.expandField&&this.props.onExpandChange&&this.props.detail&&(e.unshift({...a,cell:mt,field:this.props.expandField,headerClassName:"k-hierarchy-cell k-header",id:b.tableKeyboardNavigationTools.generateNavigatableId(`${this._columns.length}`,n,"column")}),h++);for(let c=0;c<s;c++)e.unshift({...a,isAccessible:!1,cell:Te,field:"value",locked:this.props.lockGroups}),h++;e.slice(h).forEach(c=>c.parentIndex>=0&&(c.parentIndex+=h))}),this.getHeaderRow=g.memoizeOne((e,s,n,a,h,c,d,f,v,u,E,y)=>o.createElement(Et,{cells:this.props.cells,sort:e,sortable:s,sortChange:this.sortChange,group:n||[],groupable:a,groupChange:this.groupChange,filter:h,filterable:c,filterOperators:d,filterChange:this.filterChange,columnMenu:v,selectionChange:this.onHeaderSelectionChange,columns:u,columnResize:this.columnResize,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,columnsMap:E,cellRender:f,isRtl:y,dragClue:this.dragLogic.dragClueRef,headerRef:this.headerElementRef,containerRef:this.containerRef})),this.resolveTitle=e=>{const s=this._columns.find(a=>a.field===e),n=s&&(s.title||s.field);return n===void 0?e:n},this.getLeafDataItems=()=>this._data.filter(e=>e.rowType==="data").map(e=>e.dataItem),g.validatePackage(zt),this.showLicenseWatermark=g.shouldShowValidationUI(zt);const i=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1,l=this.getVirtualScroll(t);this.vs=new l(i||t.rowHeight===void 0||t.rowHeight===0),this.dragLogic=new Ft(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new Ii(this.onResize),this.props.clipboard&&(this.clipboardService=new b.ClipboardService(this.onClipboard)),b.tableKeyboardNavigation.onConstructor({navigatable:!!t.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:this._gridId})}get columns(){const t=this._columns.filter(i=>i.declarationIndex>=0&&i.parentIndex===-1);return tt(t)}get element(){return this._element}get document(){if(g.canUseDOM)return this.element&&this.element.ownerDocument||document}get _header(){return this.headerRef.current}get _gridId(){return this.props.id+"-role-element-id"}componentDidMount(){this.resetTableWidth(),g.setScrollbarWidth();const t=b.isRtl(this.element);this.isRtl=t,b.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.isRtl&&this.forceUpdate();const i={rootMargin:"0px",threshold:.9};this.clipboardService&&this.clipboardService.addEventListeners(this.document),this.observer=g.canUseDOM&&window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,i)||null}getSnapshotBeforeUpdate(){return b.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(){this.resetTableWidth(),g.setScrollbarWidth(),this.vs.tableTransform&&this.vs.table&&(this.vs.table.style.transform=this.vs.tableTransform,this.vs.tableTransform=""),b.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){clearTimeout(this.forceUpdateTimeout),this.clipboardService&&this.clipboardService.removeEventListeners(this.document)}render(){var Zt;let t=this.props.total||0;const i=b.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);let l=[];Array.isArray(this.props.data)?(l=this.props.data,t=t||this.props.data.length):this.props.data&&(l=this.props.data.data,t=t||this.props.data.total);const e=typeof this.props.groupable=="object"&&this.props.groupable.footer||"none",{resolvedGroupsCount:s,flattedData:n}=this.flatData(l,e,this.props.skip||0,this.props.group,this.props.expandField,this.props.filter,this.props.sort);this._data=n;const a=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1;this.columnResize.resizable=this.props.resizable||!1,this.dragLogic.reorderable=this.props.reorderable||!1,this.dragLogic.groupable=a;const h=this.props.selectable&&this.props.selectable.drag?"none":void 0;this.initializeVirtualization(t,a);const c=this.childrenToArray(this.props.children);this.initColumns(c,s);const d=c.map(C=>C&&C.type&&C.type.displayName==="KendoReactGridToolbar"?o.cloneElement(C,{...C.props,ariaControls:this._gridId}):null),f=c.filter(C=>C&&C.type&&C.type.displayName==="KendoReactGridNoRecords"),v=c.filter(C=>C&&C.type&&C.type.displayName==="KendoReactGridStatusBar"),u=this._columns.filter(C=>C.children.length===0),E=a&&o.createElement(kt,{group:this.props.group||[],groupChange:this.groupChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,refCallback:this.dragLogic.refGroupPanelDiv,resolveTitle:this.resolveTitle,ariaControls:this._gridId,onContextMenu:this.onContextMenu}),{sort:y,sortable:x,group:S,filter:F,filterable:I,filterOperators:B=He,headerCellRender:_,columnMenu:fe}=this.props,se=o.createElement(di,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",scrollableDataElement:()=>this.vs.container,draggable:this.props.reorderable||a,ref:this.headerRef,elemRef:this.headerElementRef,headerRow:this.getHeaderRow(y,x,S,a,F,I,B,_,fe,this._columns,this._columnsMap,this.isRtl),filterRow:this.props.filterable&&o.createElement(It,{cells:this.props.cells,size:this.props.size,columns:this._columns,filter:this.props.filter,filterOperators:this.props.filterOperators||He,filterChange:this.filterChange,sort:this.props.sort,cellRender:this.props.filterCellRender,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1})||void 0,cols:u.map((C,M)=>o.createElement("col",{key:M.toString(),width:xe(C)}))}),X=this.vs&&this.vs.container&&this.vs.container.scrollLeft||0,D=parseFloat(((this.props.style||{}).width||"").toString()),{colSpans:je,hiddenColumns:me}=b.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:u,tableViewPortWidth:D,scrollLeft:X}),Xe=(C,M,z)=>{let Y=!1;const q=this.props.selectedField?H(this.props.selectedField,C.dataItem):void 0;return{row:u.map((G,O)=>{if(me[O])return null;const ne=G.id?G.id:O,ae=`${G.className?G.className+" ":""}${G.locked?"k-grid-content-sticky":""}`,W=G.left!==void 0?this.isRtl?{left:G.right,right:G.left}:{left:G.left,right:G.right}:{};let T=!1;if(G.editable&&this.props.editField){const A=H(this.props.editField,C.dataItem);A&&(A===!0||A===G.field)&&(Y=!0,T=!0)}const Ze=G.cell||T&&bt||Gt;return o.createElement(Ze,{onContextMenu:this.onContextMenu,key:ne,locked:this.props.lockGroups,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${M}-${String(O)}`,i),colSpan:je[O],dataItem:C.dataItem,field:G.field,editor:G.editor,format:G.format,className:ae,render:this.props.cellRender,cells:de(this.props.cells,G.cells),onChange:this.itemChange,selectionChange:this.props.onSelectionChange?A=>{this.selectionChange({event:A,dataItem:C.dataItem,dataIndex:z,columnIndex:O})}:void 0,columnIndex:O,columnsCount:u.length,rowType:C.rowType,level:C.level,expanded:C.expanded,dataIndex:C.dataIndex,style:W,ariaColumnIndex:G.ariaColumnIndex,isSelected:Array.isArray(q)&&q.indexOf(O)>-1})}),isInEdit:Y,isSelected:typeof q=="boolean"&&q}};let le=0;if(this.props.scrollable==="virtual")for(let C=0;C<this.vs.topCacheCount+this.vs.attendedSkip-(this.props.skip||0);C++){const M=this._data.shift();if(M)this._data.push(M),le++,M.rowType==="groupHeader"&&C--;else break}const Pt=C=>C>=this._data.length-le;let qt=this.vs.realSkip||0;const Ce=[];let Ye=!1;const Je=this._columnsMap.length+(this.props.filterable?1:0)+1,Vt=o.createElement("div",{key:"no-records",className:"k-grid-norecords","aria-rowindex":Je},o.createElement("div",{className:"k-grid-norecords-template"},f.length?f:o.createElement(pe,null)));let oe=0;if(this._data.length){let C=-1,M=0;(this._slicedData||this._data).forEach((z,Y)=>{z.rowType==="data"&&(qt++,C++);const q=qt%2===0,G=this.props.dataItemKey&&g.getter(this.props.dataItemKey)(z.dataItem),O=Y+(this.vs.realSkip||0),ne=G||"ai"+O,ae=ne+"_1",W=Xe(z,ne,C);if(oe=O+Je+M,Ce.push(o.createElement(Mt,{key:ne,dataItem:z.dataItem,isAltRow:q,isInEdit:W.isInEdit,rowType:z.rowType,isHidden:Pt(Y),onClick:T=>this.rowClick(T,z),onDoubleClick:T=>this.rowDblClick(T,z),selectedField:this.props.selectedField,rowHeight:this.props.rowHeight,render:this.props.rowRender,ariaRowIndex:oe,absoluteRowIndex:O,dataIndex:C,isSelected:W.isSelected},W.row)),this.props.detail&&z.rowType==="data"&&z.expanded){const T=u.length-(this.props.expandField?1:0)-(this.props.group?this.props.group.length:0)||1;M++,oe=O+Je+M,Ce.push(o.createElement("tr",{key:ae,className:g.classNames("k-table-row",q?"k-detail-row k-table-alt-row k-alt":"k-detail-row"),style:{visibility:Pt(Y)?"hidden":"",height:this.props.detailRowHeight},role:"row","aria-rowindex":oe},this.props.group&&this.props.group.map((Ze,A)=>{var Qt;const he=(Qt=W==null?void 0:W.row[A])==null?void 0:Qt.props.style,Ri=he?this.isRtl?{left:he.right,right:he.left}:{left:he.left,right:he.right}:{};return o.createElement(Te,{id:"",dataIndex:z.dataIndex,field:Ze.field,dataItem:z.dataItem,key:A,style:Ri,ariaColumnIndex:1+A,isSelected:!1,locked:this.props.lockGroups,isRtl:this.isRtl,cells:this.props.cells})}),this.props.expandField&&o.createElement(Mi,{id:b.tableKeyboardNavigationTools.generateNavigatableId(`${ae}-dhcell`,i)}),o.createElement(Gi,{onContextMenu:this.onContextMenu,dataItem:z.dataItem,dataIndex:z.dataIndex,colSpan:T,ariaColIndex:2+(this.props.group?this.props.group.length:0),detail:this.props.detail,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${ae}-dcell`,i)})))}})}else Ye=!0;const Ut={size:this.props.size,onPageChange:this.pagerPageChange,total:t,dir:this.isRtl?"rtl":void 0,skip:this.vs.propsSkip||0,take:(this.props.take!==void 0?this.props.take:this.props.pageSize)||10,messagesMap:ci,...Fi(this.props.pageable||{})},$t=this.props.pager?o.createElement(this.props.pager,{...Ut}):o.createElement(b.Pager,{className:"k-grid-pager",...Ut}),Hi=C=>this.props.sort&&this.props.sort.filter(M=>M.field===C).length>0,_i=(C,M)=>o.createElement("col",{key:M.toString(),width:xe(C)}),jt=(Zt=this.props.cells)!=null&&Zt.footerCell||this._columns.some(C=>{var M;return!!(C.footerCell||(M=C.cells)!=null&&M.footerCell)})?o.createElement(vi,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",ref:C=>this._footer=C,row:o.createElement(yi,{cells:this.props.cells,columns:this._columns,isRtl:this.isRtl,ariaRowIndex:oe+1}),cols:u.map(_i)}):null,Xt=o.createElement("colgroup",{ref:C=>{this.columnResize.colGroupMain=C}},u.map((C,M)=>o.createElement("col",{key:M.toString(),className:Hi(C.field)?"k-sorted":void 0,width:xe(C)}))),Yt=this.dragLogic.reorderable||this.dragLogic.groupable,Jt=this.props.columnVirtualization?"block":"table";if(this.props.scrollable==="none")return o.createElement(b.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},o.createElement("div",{id:this.props.id,style:this.props.style,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),ref:C=>{this._element=C},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...b.tableKeyboardNavigationScopeAttributes},d,E,o.createElement(b.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:C=>{this.tableElement=C}},o.createElement("table",{className:g.classNames("k-table k-grid-table",{[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),style:{userSelect:h,display:Jt}},Xt,se,o.createElement("tbody",{role:"rowgroup",className:"k-table-tbody",...b.tableKeyboardNavigationBodyAttributes},Ce),jt)),Ye&&Vt,Yt&&o.createElement(o.Fragment,null,o.createElement(b.DropClue,{ref:this.dragLogic.refDropElementClue}),o.createElement(b.DragClue,{ref:this.dragLogic.refDragElementClue}))),v,this.props.pageable&&$t);let be=this.props.style||{};return this.props.scrollable==="virtual"&&(be.height||(be=Object.assign({},be,{height:"450px"}))),o.createElement(b.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},o.createElement("div",{id:this.props.id,style:be,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size,"k-grid-virtual":this.props.scrollable==="virtual"},this.props.className),ref:C=>{this._element=C},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...b.tableKeyboardNavigationScopeAttributes},d,E,o.createElement("div",{className:"k-grid-aria-root",role:"grid","aria-colcount":u.length,"aria-rowcount":t,id:this._gridId},se,o.createElement("div",{className:"k-grid-container",role:"presentation"},o.createElement("div",{ref:this.containerRef,className:"k-grid-content k-virtual-content",onScroll:this.scrollHandler,role:"presentation"},o.createElement("div",{className:"k-grid-table-wrap",role:"presentation"},o.createElement(b.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:C=>{this.tableElement=C}},o.createElement("table",{className:g.classNames("k-table k-grid-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),role:"presentation",style:{userSelect:h,display:Jt}},Xt,o.createElement("tbody",{className:"k-table-tbody",ref:this.tableBodyRef,role:"rowgroup",...b.tableKeyboardNavigationBodyAttributes},Ce))),Ye&&Vt),o.createElement("div",{className:"k-height-container",role:"presentation"},o.createElement("div",{style:this.props.scrollable==="virtual"?{height:this.vs.containerHeight+"px"}:{}})))),jt,Yt&&o.createElement(o.Fragment,null,o.createElement(b.DropClue,{ref:this.dragLogic.refDropElementClue}),o.createElement(b.DragClue,{ref:this.dragLogic.refDragElementClue})),this.showLicenseWatermark&&o.createElement(g.WatermarkOverlay,null)),v,this.props.pageable&&$t))}selectionChange(t){if(this.props.onSelectionChange){const{event:i,dataItem:l,dataIndex:e,columnIndex:s}=t,{mode:n,cell:a}=b.getSelectionOptions(this.props.selectable),h={...this.getArguments(i.syntheticEvent),dataItem:l,startColIndex:s,endColIndex:s,startRowIndex:e,endRowIndex:e,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:n,cell:a,isDrag:!1,componentId:this._gridId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,h)}}raiseDataEvent(t,i,l,e,s){const n=this.props.onDataStateChange;if(t){const a={...this.getArguments(e),...i,targetEvent:s};t.call(void 0,a)}else n&&n.call(void 0,{...this.getArguments(e),targetEvent:s||{},dataState:{...this.getDataState(),...l}})}columnReorder(t,i,l){const e=this._columns[t],s=e.depth,n=d=>{do d++;while(d<this._columns.length&&this._columns[d].depth>s);return d},a=this._columns.splice(t,n(t)-t);this._columns.splice(t<i?n(i-a.length):i,0,...a),this._columns.filter(d=>d.declarationIndex>=0).forEach((d,f)=>d.orderIndex=f),this._columnsMutations++;const h=this._columns[t].locked&&this._columns[i].locked;b.updateLeft(this._columnsMap,this._columns,h||this._shouldUpdateLeftRight),b.updateRight(this._columnsMap,this._columns,h||this._shouldUpdateLeftRight),this._resized&&(this._shouldUpdateLeftRight=!1,this._resized=!1);const c=this.columns;if(this.forceUpdate(),this.props.onColumnReorder){const d={target:this,columns:c,columnId:e.id,nativeEvent:l};this.props.onColumnReorder.call(void 0,d)}}groupReorder(t,i,l){if(this.props.group===void 0)return;const e=this.props.group.slice();e.splice(i,0,...e.splice(t,1)),this.groupChange(e,l)}columnToGroup(t,i,l){const e=this._columns[t].field;if(!e)return;const s=(this.props.group||[]).slice();s.splice(i,0,{field:e}),this.groupChange(s,l)}resetTableWidth(){let t=0;if(!this.columnResize.colGroupMain)return;const i=this.columnResize.colGroupMain.children;for(let l=0;l<i.length;l++){const e=i[l].width;if(!e)return;t+=parseFloat(e.toString())}t=Math.round(t),this._header&&this._header.setWidth(t),this._footer&&this._footer.setWidth(t),this.tableElement&&(this.tableElement.style.width=t+"px")}initColumns(t,i){const l=b.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this._columns=this.readColumns(t,l,this._columnsMutations),this._columns.length===0&&(this._columns=ri(this.props.data,this.props.group,this.props.expandField,{prevId:0,idPrefix:l})),this.configureColumns(this._columns,i,l),this._columnsMap=this.mapColumns(this._columns),this.columnResize.columns=this._columns,this.dragLogic.columns=this._columns}getDataState(){return{filter:this.props.filter,sort:this.props.sort,skip:this.props.skip,take:this.props.take!==void 0?this.props.take:this.props.pageSize,group:this.props.group}}getArguments(t){return{nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:this}}};$.displayName="KendoReactGrid",$.defaultProps={},$.propTypes={data:p.oneOfType([p.array,p.shape({data:p.array,total:p.number})]),sortable:p.oneOfType([p.bool,p.shape({mode:p.oneOf(["single","multiple"]),allowUnsort:p.bool})]),onSortChange:p.func,sort:p.array,filterable:p.bool,filter:p.any,onFilterChange:p.func,pageable:p.oneOfType([p.bool,p.shape({buttonCount:p.number,responsive:p.bool,info:p.bool,type:p.oneOf(["numeric","input"]),pageSizes:p.oneOfType([p.bool,p.arrayOf(p.oneOfType([p.string,p.number]))]),previousNext:p.bool})]),pageSize:p.number,onPageChange:p.func,total:p.number,skip:p.number,take:p.number,fixedScroll:p.bool,onExpandChange:p.func,expandField:p.string,selectedField:p.string,onSelectionChange:p.func,onHeaderSelectionChange:p.func,resizable:p.bool,reorderable:p.bool,group:p.any,groupable:p.oneOfType([p.bool,p.shape({enabled:p.bool,footer:p.oneOf(["always","visible","none"])})]),onGroupChange:p.func,onRowClick:p.func,onRowDoubleClick:p.func,onItemChange:p.func,editField:p.string,scrollable:p.oneOf(["none","scrollable","virtual"]),rowHeight:p.number,detailRowHeight:p.number,detail:p.any,style:p.object,onDataStateChange:p.func,onColumnResize:p.func,onColumnReorder:p.func,dataItemKey:p.string,navigatable:p.bool,size:p.oneOf(["small","medium"])},$.contextType=b.TableKeyboardNavigationContext;class ie extends o.Component{render(){const{children:t}=this.props;return o.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-wrapper",this.props.className),style:this.props.style},t)}}class j extends o.Component{render(){const{title:t,iconClass:i,svgIcon:l,selected:e}=this.props;return o.createElement("div",{onClick:this.props.onClick,className:`k-columnmenu-item ${e?"k-selected":""}`},(i||l)&&o.createElement(g.IconWrap,{name:i&&g.toIconName(i),icon:l}),t)}}class Pe extends o.Component{constructor(){super(...arguments),this.onGroupClick=t=>{if(t.preventDefault(),this.props.onGroupChange){const{column:i}=this.props;if(!i.field)return;const l=(this.props.group||[]).slice(),e=l.findIndex(s=>s.field===i.field);e>-1?l.splice(e,1):l.push({field:i.field}),this.props.onGroupChange(l,t)}this.props.onCloseMenu&&this.props.onCloseMenu()}}render(){const{group:t,column:i}=this.props,l=w.provideLocalizationService(this),e=!!(t&&i.field&&t.find(n=>n.field===i.field)),s=e?dt:ct;return o.createElement(ie,null,o.createElement(j,{title:l.toLanguageString(s,k[s]),iconClass:e?"k-i-ungroup":"k-i-group",svgIcon:e?N.ungroupIcon:N.groupIcon,onClick:this.onGroupClick}))}}w.registerForIntl(Pe),w.registerForLocalization(Pe);const Lt="asc",Dt="desc",zi={true:{asc:{asc:"",desc:"desc"},desc:{asc:"asc",desc:""},"":{asc:"asc",desc:"desc"}},false:{asc:{asc:"asc",desc:"desc"},desc:{asc:"asc",desc:"desc"},"":{asc:"asc",desc:"desc"}}},Ot=(r,t)=>t?t.findIndex(i=>i.field===r):-1,Ht=(r,t)=>!!(t&&r>-1&&t[r].dir===Lt),_t=(r,t)=>!!(t&&r>-1&&t[r].dir===Dt);class ue extends o.Component{constructor(){super(...arguments),this.onAscClick=t=>{this.onSort(t,Lt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onDescClick=t=>{this.onSort(t,Dt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onSort=(t,i)=>{if(t.preventDefault(),!this.props.onSortChange)return;const{column:l,sortable:e,sort:s}=this.props,{allowUnsort:n,mode:a}=vt(e||!1,!1),h=(s||[]).filter(f=>f.field===l.field)[0],c=zi[n][h&&h.dir||""][i],d=a==="single"?[]:(this.props.sort||[]).filter(f=>f.field!==l.field);c!==""&&l.field&&d.push({field:l.field,dir:c}),this.props.onSortChange(d,t)}}render(){const{sort:t,column:i}=this.props,l=Ot(i.field,t),e=w.provideLocalizationService(this);return o.createElement(ie,null,o.createElement(j,{title:e.toLanguageString(ke,k[ke]),iconClass:"k-i-sort-asc-sm",svgIcon:N.sortAscSmallIcon,selected:Ht(l,t),onClick:this.onAscClick}),o.createElement(j,{title:e.toLanguageString(ye,k[ye]),iconClass:"k-i-sort-desc-sm",svgIcon:N.sortDescSmallIcon,selected:_t(l,t),onClick:this.onDescClick}))}}ue.active=(r,t)=>{const i=Ot(r,t);return _t(i,t)||Ht(i,t)},w.registerForIntl(ue),w.registerForLocalization(ue);class qe extends o.Component{render(){return o.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},o.createElement(ti.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}class Ve extends o.Component{constructor(t){super(t),this.renderOperatorEditor=()=>{if(this.props.filterType==="boolean")return;const i=this.props.operators.find(l=>l.operator===this.props.operator)||null;return o.createElement(Z.DropDownList,{value:i,onChange:this.operatorChange,data:this.props.operators,textField:"text"})},this.inputChange=this.inputChange.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){return o.createElement(o.Fragment,null,this.renderOperatorEditor(),this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues))}inputChange(t,i){Re(t,i,this.props)}operatorChange(t){Be(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Ke(t,this.props.onChange)}filterComponent(t,i,l){switch(t){case"numeric":return o.createElement(L.NumericTextBox,{value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},rangeOnEnter:!1});case"date":return o.createElement(ve.DatePicker,{value:i,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)}});case"boolean":{const e=s=>s==null;return o.createElement(Z.DropDownList,{onChange:this.boolDropdownChange,value:l.find(s=>s.operator===(e(i)?"":i)),data:l,textField:"text"})}default:return o.createElement(L.Input,{value:i||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)}})}}}class Rt extends o.Component{render(){const{firstFilterProps:t,hideSecondFilter:i,secondFilterProps:l,logicData:e,logicValue:s,onLogicChange:n}=this.props;return o.createElement(o.Fragment,null,o.createElement(Ve,{...t}),!i&&o.createElement(o.Fragment,null,o.createElement(Z.DropDownList,{data:e,value:s,onChange:n,className:"k-filter-and",textField:"text"}),o.createElement(Ve,{...l})))}}const ge=r=>r||{filters:[],logic:"and"},re=(r,t)=>ge(t).filters.filter(e=>ce.isCompositeFilterDescriptor(e)?e.filters&&e.filters.length&&e.filters.length<=2&&!e.filters.find(s=>ce.isCompositeFilterDescriptor(s)||s.field!==r):!1)[0]||null;class Ue extends o.Component{constructor(t){super(t),this.removeGroup=(l,e)=>{const s=[...e.filters],n=s.findIndex(a=>a===l);return n>-1&&s.splice(n,1),{...e,filters:s}},this.insertGroup=(l,e)=>({...e,filters:[l,...e.filters]}),this.isControlled=()=>this.props.expanded!==void 0,this.onFilterExpand=()=>{const l=this.isControlled(),e=!(l?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(e),l||this.setState({expanded:e})},this.firstFilterChange=l=>{this.filterChange(0,l)},this.secondFilterChange=l=>{this.filterChange(1,l)},this.filterChange=(l,e)=>{const s=this.state.filterGroup.filters.map((n,a)=>a===l?{...n,value:e.value,operator:e.operator}:n);this.setState({filterGroup:{...this.state.filterGroup,filters:s}})},this.logicChange=l=>{this.setState({filterGroup:{...this.state.filterGroup,logic:l.target.value.operator}})},this.clear=l=>{if(l.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,s=ge(this.props.filter),n=re(e,this.props.filter),a=s.filters.filter(h=>h!==n);a.length?this.props.onFilterChange({...s,filters:a},l):this.props.onFilterChange(null,l),this.props.onCloseMenu&&this.props.onCloseMenu()},this.currentFilterGroup=()=>({...this.state.filterGroup,filters:this.state.filterGroup.filters.filter(l=>l.value!==void 0&&l.value!==null&&l.value!==""||l.value===null&&l.operator)}),this.submit=l=>{if(l.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,s=ge(this.props.filter),n=re(e,this.props.filter),a=this.currentFilterGroup();let h=null;if(n&&a.filters.length>0){const c=s.filters.map(d=>d===n?a:d);h={...s,filters:c}}else if(a.filters.length===0){const c=s.filters.filter(d=>d!==n);c.length&&(h={...s,filters:c})}else h={...s,filters:[...s.filters,a]};this.props.onFilterChange(h,l),this.props.onCloseMenu&&this.props.onCloseMenu()};let i;if(t.column&&t.column.field){const l=Ae(t.column.filter),e=St(t.filterOperators,l);i=re(t.column.field,t.filter),i=i?{...i,filters:i.filters.map(s=>({...s}))}:{logic:"and",filters:[{field:t.column.field,operator:e,value:R(e)?null:void 0},{field:t.column.field,operator:e,value:R(e)?null:void 0}]},i.filters.filter(s=>s.field===t.column.field).length===1&&i.filters.splice(1,0,{field:t.column.field,operator:e})}this.state={expanded:t.expanded||!1,filterGroup:i}}render(){const{column:t,filterUI:i,hideSecondFilter:l,filterOperators:e}=this.props;if(!t||!t.field)return o.createElement("div",null);const s=Ae(t.filter),n=l!==void 0?l:Ci[s],a=w.provideLocalizationService(this),h=this.state.filterGroup.filters,c=te(e[s],a),d=te(_e,a),f={field:t.field,value:h[0].value,operator:h[0].operator,operators:c,booleanValues:d,onChange:this.firstFilterChange,filterType:s},v={field:t.field,value:h[1].value,operator:h[1].operator,operators:c,booleanValues:d,onChange:this.secondFilterChange,filterType:s},u=this.state.filterGroup.logic,E=te(fi,a),y={value:E.find(_=>_.operator===(u===null?"":u)),onChange:this.logicChange,data:E},x=i,S={firstFilterProps:f,secondFilterProps:v,logicData:y.data,logicValue:y.value,onLogicChange:y.onChange,hideSecondFilter:n},F=this.currentFilterGroup().filters.length!==0||R(h[0].operator)||R(h[1].operator),I=this.isControlled()?this.props.expanded:this.state.expanded,B=this.props.alwaysExpand;return o.createElement(ie,null,!B&&o.createElement(j,{title:a.toLanguageString(ee,k[ee]),iconClass:"k-i-filter",svgIcon:N.filterIcon,onClick:this.onFilterExpand}),o.createElement(qe,{show:B||!!I},o.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear,onKeyDown:_=>_.stopPropagation()},o.createElement("div",{className:"k-filter-menu-container"},x?o.createElement(x,{...S}):o.createElement(Rt,{...S}),o.createElement("div",{className:"k-actions k-actions-stretched"},o.createElement(K.Button,{themeColor:"primary",disabled:!F},a.toLanguageString(Q,k[Q])),o.createElement(K.Button,{type:"reset"},a.toLanguageString(P,k[P])))))))}}Ue.active=(r,t)=>!!re(r,t),w.registerForLocalization(Ue);const Li=(r,t)=>r.length!==t.length?!1:r.every((i,l)=>i===t[l]);class $e extends o.Component{constructor(t){super(t),this.defaultFilter=()=>this.props.filter?g.clone(this.props.filter):{filters:[],logic:"and"},this.isControlled=()=>this.props.expanded!==void 0,this.parseData=(i,l)=>{const e=this.props.column.field||"",s=i.map(n=>H(e,n));return l?s.filter((n,a)=>s.indexOf(n)===a):s},this.getFilterIndex=()=>{const i=this.props.column.field;return this.defaultFilter().filters.findIndex(s=>s.filters&&s.filters.length>0&&s.filters[0].field===i)},this.onFilterExpand=()=>{const i=this.isControlled(),l=!(i?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(l),i||this.setState({expanded:l})},this.handleSearchChange=i=>{const l=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",e={logic:"and",filters:[{field:this.props.column.field,operator:l,value:i.target.value,ignoreCase:!0}]};this.setState({value:i.target.value,data:this.parseData(ce.filterBy(this.props.data||[],e),this.props.uniqueData)})},this.handleClear=()=>{const i=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",l={logic:"and",filters:[{field:this.props.column.field,operator:i,value:"",ignoreCase:!0}]};this.setState({value:"",data:this.parseData(ce.filterBy(this.props.data||[],l),this.props.uniqueData)})},this.clear=i=>{if(i.preventDefault(),!this.props.onFilterChange)return;const l=this.state.currentFilter||null;l!==null&&l.filters.length>0?(this.compositeFilterIndex>=0&&l.filters.splice(this.compositeFilterIndex,1),this.props.onFilterChange(l,i)):this.props.onFilterChange(null,i),this.props.onCloseMenu&&this.props.onCloseMenu()},this.submit=i=>{if(i.preventDefault(),!this.props.onFilterChange)return;const l=this.state.currentFilter||null;this.props.onFilterChange(l,i),this.props.onCloseMenu&&this.props.onCloseMenu()},this.handleCheckBoxChange=(i,l)=>{const e=this.props.column.field||"",s={...this.state.currentFilter},n=[...this.state.currentFilter.filters];let a=[];if(this.compositeFilterIndex!==-1&&s.filters[this.compositeFilterIndex].filters&&l!=="all"&&(a=s.filters[this.compositeFilterIndex].filters),i.value&&l==="all")this.state.data.forEach(h=>{a.push({field:e,operator:"eq",value:h})});else if(i.value)a.push({field:e,operator:"eq",value:l});else if(this.state.currentFilter){const h=a.findIndex(c=>c.value===l);a.splice(h,1)}s.logic="and",this.compositeFilterIndex!==-1?n[this.compositeFilterIndex]={logic:"or",filters:a}:n.push({logic:"or",filters:a}),(!i.value&&l==="all"||a.length===0)&&n.splice(this.compositeFilterIndex,1),s.filters=n,this.setState({currentFilter:s})},this.isAllSelected=()=>{let i=!1;if(this.state.currentFilter){const l=[...this.state.currentFilter.filters];return this.compositeFilterIndex===-1?!1:(i=this.state.data.every(e=>this.compositeFilterIndex!==-1&&l[this.compositeFilterIndex].filters?l[this.compositeFilterIndex].filters.findIndex(n=>n.value===e)>=0:!1),i)}return i},this.compositeFilterIndex=this.getFilterIndex(),this.state={expanded:t.expanded||!1,value:"",data:this.parseData(this.props.data,this.props.uniqueData)||[],dataFromProps:this.parseData(this.props.data,!1)||[],currentFilter:this.defaultFilter()}}componentDidUpdate(){const t=this.props.column.field||"",i=this.props.data.map(l=>H(t,l));Li(i,this.state.dataFromProps)||this.setState({data:i,dataFromProps:i})}render(){const{column:t}=this.props;if(!t||!t.field)return o.createElement("div",null);const i=w.provideLocalizationService(this),l=this.isControlled()?this.props.expanded:this.state.expanded,e=[];if(this.state.currentFilter){const a=[...this.state.currentFilter.filters];this.compositeFilterIndex=a.findIndex(h=>h.filters&&h.filters.length>0?h.filters[0].field===t.field:!1),this.compositeFilterIndex!==-1&&a[this.compositeFilterIndex].filters.length>0&&a[this.compositeFilterIndex].filters.forEach(h=>{h.field===this.props.column.field&&e.push(h.value)})}const s=this.props.searchBox?o.createElement(this.props.searchBox,{value:this.state.value,onChange:this.handleSearchChange}):o.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},o.createElement(g.IconWrap,{className:"k-input-icon",name:"search",icon:N.searchIcon}),o.createElement(L.Input,{className:"k-input-inner",type:"text",placeholder:i.toLanguageString(Ne,k[Ne]),value:this.state.value,onChange:a=>this.handleSearchChange(a.nativeEvent)}),o.createElement(K.Button,{type:"button",rounded:null,className:"k-input-button",onClick:this.handleClear,icon:"x",svgIcon:N.xIcon})),n=e.filter((a,h)=>e.indexOf(a)===h);return o.createElement(ie,null,o.createElement(j,{title:i.toLanguageString(ee,k[ee]),iconClass:"k-i-filter",svgIcon:N.filterIcon,onClick:this.onFilterExpand}),o.createElement(qe,{show:!!l},o.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear},o.createElement("div",{className:"k-filter-menu-container"},s,o.createElement("ul",{className:"k-reset k-multicheck-wrap"},o.createElement("li",{className:"k-item k-check-all-wrap"},o.createElement(L.Checkbox,{label:i.toLanguageString(Fe,k[Fe]),onChange:a=>this.handleCheckBoxChange(a,"all"),checked:this.isAllSelected()})),this.state.data.map((a,h)=>o.createElement("li",{className:"k-item",key:h},o.createElement(L.Checkbox,{label:String(a),onChange:c=>this.handleCheckBoxChange(c,a),checked:n.includes(a)})))),o.createElement("div",{className:"k-filter-selected-items"},n.length+" "+i.toLanguageString(Me,k[Me])),o.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},o.createElement(K.Button,{themeColor:"primary",type:"submit"},i.toLanguageString(Q,k[Q])),o.createElement(K.Button,{className:"k-button",type:"reset"},i.toLanguageString(P,k[P])))))))}}$e.defaultProps={uniqueData:!0},w.registerForLocalization($e);const At=r=>{const[t,i]=o.useState(""),l=o.useMemo(()=>new Set(r.columnsState.map(u=>u.id)),[r.columnsState]),e=o.useMemo(()=>r.columns.filter(u=>{var E;return(E=u.title||u.field)==null?void 0:E.toLowerCase().includes(t.toLowerCase())}),[r.columns,t]),[s,n]=o.useState(r.columns.map(u=>l.has(u.id))),a=o.useCallback(()=>{const u=r.columns.filter((E,y)=>s[y]);r.onColumnsChange.call(void 0,u),r.onCloseMenu.call(void 0)},[s,r.columns,r.onColumnsChange,r.onCloseMenu]),h=o.useCallback(()=>{n(r.columns.map(u=>l.has(u.id)))},[l,r.columns]),c=s.filter(u=>u).length,d=c===s.length,f=o.useCallback(()=>{n(r.columns.map((u,E)=>d&&E===0?!0:!d))},[r.columns,d]),v=o.useCallback((u,E)=>{const y=s.slice();y[E]=u,n(y)},[s]);return o.createElement("form",{className:"k-filter-menu"},o.createElement("div",{className:"k-filter-menu-container"},o.createElement(L.TextBox,{className:"k-searchbox",value:t,onChange:u=>i(String(u.target.value)),prefix:()=>o.createElement(L.InputPrefix,null,o.createElement(g.IconWrap,{name:"search",icon:N.searchIcon}))}),o.createElement("ul",{className:"k-reset k-multicheck-wrap"},!t&&o.createElement("li",{className:"k-item k-check-all-wrap"},o.createElement(L.Checkbox,{checked:d,onChange:f,label:"(Select all)"})),e.map((u,E)=>o.createElement("li",{key:u.id,className:"k-item"},o.createElement(L.Checkbox,{disabled:s[E]&&c===1,checked:s[E],onChange:y=>{var x;return v(!!((x=y.target.element)!=null&&x.checked),E)},label:u.title||u.field})))),o.createElement("div",{className:"k-filter-selected-items"},c," selected items"),o.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},o.createElement(K.Button,{type:"button",themeColor:"primary",onClick:a},"Apply"),o.createElement(K.Button,{type:"button",onClick:h},"Reset"))))};At.displayName="GridColumnMenuColumnsList";class Di extends o.Component{render(){return null}}class Kt extends o.Component{render(){return o.createElement("div",{className:g.classNames("k-toolbar k-grid-toolbar",{"k-toolbar-md":!this.props.size,[`k-toolbar-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),"aria-label":this.props.ariaLabel,"aria-controls":this.props.ariaControls,role:"toolbar"},this.props.children)}}Kt.displayName="KendoReactGridToolbar";const Bt=r=>{const{data:t=[]}=r;return o.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},t.map((i,l)=>o.createElement("div",{key:l},o.createElement("span",{className:"k-selection-aggregates-item-text"},i.type,": "),o.createElement("span",{className:"k-selection-aggregates-item-value"},i.formattedValue))))};Bt.displayName="KendoReactGridStatusBar";const Wt=r=>{var i;const t=r.slice();for(let l=0;l<t.length;l++)for(;t[l]&&((i=t[l].children)!=null&&i.length);)t.splice(l,1,...t[l].children);return t},Oi=r=>{const{dataItems:t,target:i,selectedField:l}=r,s=Wt(i.columns).map(x=>x.field).filter(x=>x&&typeof x=="string").map(x=>g.getter(x)),n=g.getter(l),a={dates:[],numbers:[],booleans:[],others:[]},h=x=>{typeof x=="number"?a.numbers.push(x):typeof x=="boolean"?a.booleans.push(x):x instanceof Date?a.dates.push(x):a.others.push(x)};t.forEach(x=>{const S=n(x);S&&S.forEach(F=>{h(s[F](x))})});const c=a.dates.map(x=>x.getTime()),d=a.booleans.filter(x=>x).length,f=a.booleans.filter(x=>!x).length,v=a.numbers.length?a.numbers.reduce((x,S)=>x+=S,0):void 0,u={sum:v,average:typeof v=="number"?v/a.numbers.length:void 0,min:a.numbers.length?Math.min(...a.numbers):void 0,max:a.numbers.length?Math.max(...a.numbers):void 0,count:a.numbers.length+a.booleans.length+a.dates.length+a.others.length,isTrue:d>0?d:void 0,isFalse:f>0?f:void 0,earliest:a.dates.length?new Date(Math.min(...c)):void 0,latest:a.dates.length?new Date(Math.max(...c)):void 0},E=(x,S)=>(S==="sum"||S==="average")&&typeof x=="number"?x.toFixed(2):(S==="earliest"||S==="latest")&&x instanceof Date?x.toLocaleDateString():String(x),y=[];return Object.keys(u).forEach(x=>{const S=x,F=u[S];F!==void 0&&y.push({type:S,value:F,formattedValue:E(F,S)})}),y},Tt=g.withIdHOC($);Tt.displayName="KendoReactGrid",Object.defineProperty(m,"getSelectedState",{enumerable:!0,get:()=>b.getSelectedState}),Object.defineProperty(m,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>b.getSelectedStateFromKeyDown}),Object.defineProperty(m,"setSelectedState",{enumerable:!0,get:()=>b.setSelectedState}),m.GRID_COL_INDEX_ATTRIBUTE=U,m.GRID_ROW_INDEX_ATTRIBUTE=Ct,m.Grid=Tt,m.GridCell=Gt,m.GridClassComponent=$,m.GridColumn=V,m.GridColumnMenuCheckboxFilter=$e,m.GridColumnMenuColumnsList=At,m.GridColumnMenuFilter=Ue,m.GridColumnMenuFilterCell=Ve,m.GridColumnMenuFilterUI=Rt,m.GridColumnMenuGroup=Pe,m.GridColumnMenuItem=j,m.GridColumnMenuItemContent=qe,m.GridColumnMenuItemGroup=ie,m.GridColumnMenuSort=ue,m.GridColumnMenuWrapper=Oe,m.GridCommonDragLogic=Ft,m.GridDetailRow=Di,m.GridEditCell=bt,m.GridFilterCell=We,m.GridGroupCell=Te,m.GridHeaderCell=xt,m.GridHierarchyCell=mt,m.GridNoRecords=pe,m.GridRow=Mt,m.GridSelectionCell=rt,m.GridToolbar=Kt,m.StatusBar=Bt,m.booleanFilterValues=_e,m.cellBoolDropdownChange=Ke,m.cellInputChange=Re,m.cellOperatorChange=Be,m.filterGroupByField=re,m.getStatusData=Oi,m.gridMessages=k,m.leafColumns=Wt,m.operators=He,m.pagerFirstPage=lt,m.pagerInfo=st,m.pagerItemPerPage=ht,m.pagerLastPage=at,m.pagerNextPage=nt,m.pagerPreviousPage=ot,m.rootFilterOrDefault=ge,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
package/filterCommon.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare const filterLogicList: {
14
14
  operator: string;
15
15
  }[];
16
16
  /**
17
- * @hidden
17
+ * The text of the filter operators displayed in the filter menu.
18
18
  */
19
19
  export declare const operators: GridFilterOperators;
20
20
  /**
@@ -33,7 +33,7 @@ export declare const operatorMap: (iterable: Array<any>, service: LocalizationSe
33
33
  */
34
34
  export declare const defaultBooleanOperator: string;
35
35
  /**
36
- * @hidden
36
+ * The value of the filter operators displayed in the boolean filter menu.
37
37
  */
38
38
  export declare const booleanFilterValues: ({
39
39
  text: string;
@@ -52,7 +52,7 @@ export declare const defaultHideSecondFilter: {
52
52
  boolean: boolean;
53
53
  };
54
54
  /**
55
- * @hidden
55
+ * Normalize data for calling onChange.
56
56
  */
57
57
  export declare const cellInputChange: (value: any, e: React.SyntheticEvent<any>, props: any) => void;
58
58
  /**
@@ -64,10 +64,10 @@ export declare const getDefaultOperator: (filterOperators: GridFilterOperators |
64
64
  */
65
65
  export declare const getFilterType: (filterType: 'text' | 'numeric' | 'boolean' | 'date' | undefined) => "boolean" | "text" | "numeric" | "date";
66
66
  /**
67
- * @hidden
67
+ * Normalize data for calling onChange.
68
68
  */
69
69
  export declare const cellBoolDropdownChange: (event: any, onChange: Function) => void;
70
70
  /**
71
- * @hidden
71
+ * Normalize data for calling onChange.
72
72
  */
73
73
  export declare const cellOperatorChange: (event: any, currentValue: any, onChange: Function) => void;
package/index.d.ts CHANGED
@@ -47,11 +47,11 @@ import { type GridColumnMenuFilterUIProps } from './interfaces/GridColumnMenuFil
47
47
  import { GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE } from './constants';
48
48
  import { getSelectedState, getSelectedStateFromKeyDown, setSelectedState } from '@progress/kendo-react-data-tools';
49
49
  import { CommonDragLogic as GridCommonDragLogic } from './drag/CommonDragLogic';
50
- import { booleanFilterValues, operators } from './filterCommon';
50
+ import { cellBoolDropdownChange, cellInputChange, cellOperatorChange, booleanFilterValues, operators } from './filterCommon';
51
51
  export * from './interfaces/events';
52
52
  export * from './interfaces/GridCellsSettings';
53
53
  export { messages as gridMessages, pagerInfo, pagerFirstPage, pagerPreviousPage, pagerNextPage, pagerLastPage, pagerItemPerPage } from './messages';
54
54
  export * from './StatusBar';
55
55
  /** @hidden */
56
56
  declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<any>>;
57
- export { Grid, GridClassComponent, GridHandle, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridSelectionCell, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuFilterCellProps, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridColumnMenuColumnsList, GridColumnMenuColumnsListProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridSelectableSettings, GridFilterOperators, GridFilterOperator, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE, GridCommonDragLogic, rootFilterOrDefault, filterGroupByField, GridColumnMenuFilterProps, booleanFilterValues, operators };
57
+ export { Grid, GridClassComponent, GridHandle, GridProps, GridColumn, GridColumnProps, GridCellProps, GridCell, GridEditCell, GridGroupCell, GridHierarchyCell, GridDetailRow, GridDetailRowProps, GridRow, GridRowProps, GridFilterCell, GridFilterCellProps, GridHeaderCell, GridHeaderCellProps, GridSelectionCell, GridColumnMenuProps, GridColumnMenuSort, GridColumnMenuFilter, GridColumnMenuGroup, GridColumnMenuItem, GridColumnMenuItemContent, GridColumnMenuItemGroup, GridColumnMenuFilterUI, GridColumnMenuFilterUIProps, GridColumnMenuFilterCell, GridColumnMenuFilterCellProps, GridColumnMenuCheckboxFilter, GridColumnMenuCheckboxFilterProps, GridColumnMenuColumnsList, GridColumnMenuColumnsListProps, GridToolbar, GridToolbarProps, GridNoRecords, GridNoRecordsProps, GridSortSettings, GridPagerSettings, GridGroupableSettings, GridFooterCellProps, GridSelectableMode, GridSelectableSettings, GridFilterOperators, GridFilterOperator, GridColumnMenuWrapper, GridColumnMenuWrapperProps, getSelectedState, setSelectedState, getSelectedStateFromKeyDown, GRID_COL_INDEX_ATTRIBUTE, GRID_ROW_INDEX_ATTRIBUTE, GridCommonDragLogic, rootFilterOrDefault, filterGroupByField, GridColumnMenuFilterProps, cellBoolDropdownChange, cellInputChange, cellOperatorChange, booleanFilterValues, operators };
package/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ts=require("react"),p=require("prop-types"),g=require("@progress/kendo-react-common"),C=require("@progress/kendo-react-data-tools"),I=require("@progress/kendo-react-intl"),w=require("@progress/kendo-svg-icons"),M=require("@progress/kendo-react-inputs"),Ae=require("@progress/kendo-react-dateinputs"),ss=require("@progress/kendo-react-popup"),B=require("@progress/kendo-react-buttons"),ie=require("@progress/kendo-react-dropdowns"),pe=require("@progress/kendo-data-query"),rs=require("@progress/kendo-react-animation");function is(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const n=is(ts),j=r=>null;j.displayName="KendoReactGridColumn";j.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};j.propTypes={field:p.string,title:p.string,editable:p.bool,sortable:p.oneOfType([p.bool,p.shape({allowUnsort:p.bool.isRequired})]),cell:p.any,filterCell:p.any,filterTitle:p.string,filterable:p.bool,filter:p.oneOf(["text","numeric","boolean","date"]),editor:p.oneOf(["text","numeric","boolean","date"]),width:p.oneOfType([p.string,p.number]),minResizableWidth:p.number,headerCell:p.any,footerCell:p.any,headerSelectionValue:p.bool,format:p.string,headerClassName:p.string,className:p.string,reorderable:p.bool,resizable:p.bool,orderIndex:p.number,groupable:p.bool,columnMenu:p.any,locked:p.bool};function L(r,t){const s=(r||"").split(".");let o=t;return s.forEach(e=>{o=o?o[e]:void 0}),o}function ct(r,t,s,o,e,i,l=0){let a=l;for(let c=0;c<t.length;c++){if(!e||t[c].value===void 0||t[c].items===void 0){r[r.length]={dataIndex:o.index,dataItem:t[c],rowType:"data",level:l,expanded:i===void 0||L(i,t[c])},o.index++;continue}a=Math.max(a,l+1);const h=i===void 0||L(i,t[c])===void 0||L(i,t[c]);r[r.length]={dataIndex:-1,dataItem:t[c],level:l,rowType:"groupHeader",expanded:h},h&&(a=Math.max(ct(r,t[c].items,s,o,e,i,l+1),a)),(s==="always"||h&&s==="visible")&&(r[r.length]={dataIndex:-1,dataItem:t[c],rowType:"groupFooter",level:l,expanded:h})}return a}function ht(r,t,s,o=0){let e=[];if(!r)return[];r&&r.length===void 0&&(r=[r]),r.forEach((l,a)=>{l=l.props?l.props:l;const c=t[a]||null,h=ht(l.children,c&&c.children||[],s,o+1);e.push(Object.assign({depth:o},j.defaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},c?{width:c.width,orderIndex:c.orderIndex}:{},l,{id:l.id?l.id:C.tableKeyboardNavigationTools.generateNavigatableId(`${s.prevId++}`,s.idPrefix,"column"),declarationIndex:e.length,children:h,rowSpan:0,colSpan:0,isAccessible:!0,left:c&&Math.floor(c.left),right:c&&Math.floor(c.right)}))});const i=(l,a)=>l.orderIndex===a.orderIndex?l.declarationIndex-a.declarationIndex:(l.orderIndex||0)-(a.orderIndex||0);if(e.sort(i),o===0){let l=[];const a=(c,h)=>c.forEach(d=>{d.parentIndex=h,a(d.children,l.push(d)-1)});return a(e,-1),l}return e}function os(r,t,s,o){let e=[];Array.isArray(r)?e=r:r&&(e=r.data);const i=[];if(e.length>0){let l=e[0];if(t)for(let c=0;c<t.length;c++)l=l.items&&l.items[0];Object.getOwnPropertyNames(l).forEach(c=>{c!==s&&i.push(Object.assign({id:C.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},j.defaultProps,{field:c}))})}return i}const ns=(r,t)=>{let s=r[t.parentIndex];for(;s;){if(s.footerCell)return!0;s=r[s.parentIndex]}return!1},ls=r=>r.filter(t=>ns(r,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),Ee=r=>r.width!==void 0?Math.floor(parseFloat(r.width.toString()))+"px":void 0,dt=r=>(r.sort((t,s)=>t.declarationIndex-s.declarationIndex),r.map(t=>{const{declarationIndex:s,parentIndex:o,depth:e,colSpan:i,rowSpan:l,index:a,kFirst:c,children:h,...d}=t;return h.length?{children:dt(h),...d}:d})),Ie=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),ot=17895697,ge=(r,t)=>{if(!(!r&&!t))return t?r?{...r,...t,select:{...r.select||{},...t.select||{}},hierarchy:{...r.hierarchy||{},...t.hierarchy||{}},group:{...r.group||{},...t.group||{}},edit:{...r.edit||{},...t.edit||{}}}:t:r},pt=r=>{const t=n.useCallback(d=>{r.selectionChange&&r.selectionChange({syntheticEvent:d})},[r.selectionChange]),s=g.useId(),o=L(r.field,r.dataItem),e=C.useTableKeyboardNavigation(r.id),i={colSpan:r.colSpan,style:r.style,className:r.className,"aria-colindex":r.ariaColumnIndex,role:"gridcell",...e},l=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:typeof o=="boolean"&&o,id:s,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:t})),n.createElement("label",{className:"k-checkbox-label",htmlFor:s,key:2})],a=r.rowType!=="groupHeader"?n.createElement("td",{...i},l):null,c=r.rowType||"data",h=r.cells;if(h&&h.select&&h.select[c]){const d=h.select[c];return n.createElement(d,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,a,r):a},Se="grid.noRecords",ut="grid.pagerInfo",gt="grid.pagerFirstPage",ft="grid.pagerPreviousPage",mt="grid.pagerNextPage",Ct="grid.pagerLastPage",bt="grid.pagerItemsPerPage",as="grid.pagerPage",cs="grid.pagerPageSizeAriaLabel",hs="grid.pagerOf",ds="grid.pagerTotalPages",ye="grid.groupPanelEmpty",vt="grid.groupColumn",xt="grid.ungroupColumn",we="grid.columnMenu",K="grid.filterClearButton",oe="grid.filterSubmitButton",ne="grid.filterTitle",Re="grid.sortAscending",Ne="grid.sortDescending",Fe="grid.searchPlaceholder",De="grid.filterCheckAll",Te="grid.filterChooseOperator",Ge="grid.filterSelectedItems",Me="grid.sortAriaLabel",ze="grid.filterAriaLabel",Le="grid.groupPanelAriaLabel",kt="grid.groupExpand",Et="grid.groupCollapse",It="grid.detailExpand",St="grid.detailCollapse",S={[It]:"Expand detail row",[St]:"Collapse detail row",[kt]:"Expand group",[Et]:"Collapse Group",[Se]:"No records available",[ye]:"Drag a column header and drop it here to group by that column",[K]:"Clear",[oe]:"Filter",[ne]:"Filter",[Re]:"Sort Ascending",[Ne]:"Sort Descending",[Me]:"Sortable",[vt]:"Group Column",[xt]:"Ungroup Column",[we]:"Column menu",[bt]:"items per page",[ut]:"{0} - {1} of {2} items",[gt]:"Go to the first page",[ft]:"Go to the previous page",[mt]:"Go to the next page",[Ct]:"Go to the last page",[as]:"Page",[cs]:"Page size",[hs]:"of",[ds]:"{0}",[Fe]:"Search",[De]:"Check All",[Te]:"Choose Operator",[Ge]:"selected items",[ze]:"Filter",[Le]:"Group panel","grid.filterEqOperator":"Is equal to","grid.filterNotEqOperator":"Is not equal to","grid.filterIsNullOperator":"Is null","grid.filterIsNotNullOperator":"Is not null","grid.filterIsEmptyOperator":"Is empty","grid.filterIsNotEmptyOperator":"Is not empty","grid.filterStartsWithOperator":"Starts with","grid.filterContainsOperator":"Contains","grid.filterNotContainsOperator":"Does not contain","grid.filterEndsWithOperator":"Ends with","grid.filterGteOperator":"Is greater than or equal to","grid.filterGtOperator":"Is greater than","grid.filterLteOperator":"Is less than or equal to","grid.filterLtOperator":"Is less than","grid.filterIsTrue":"Is true","grid.filterIsFalse":"Is false","grid.filterBooleanAll":"(All)","grid.filterAfterOrEqualOperator":"Is after or equal to","grid.filterAfterOperator":"Is after","grid.filterBeforeOperator":"Is before","grid.filterBeforeOrEqualOperator":"Is before or equal to","grid.filterAndLogic":"And","grid.filterOrLogic":"Or"};function ps(r){const t=r.replace(/^pager\.([a-z])/,(s,o)=>"grid.pager"+o.toUpperCase());return{messageKey:t,defaultMessage:S[t]}}const yt=r=>{let t=null,s=null,o=null;const e=L(r.field,r.dataItem),i=C.useTableKeyboardNavigation(r.id),l=I.useLocalization(),a=n.useCallback(d=>{d.isDefaultPrevented()||d.keyCode===g.Keys.enter&&r.onChange&&(d.preventDefault(),r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:d,field:r.field,value:!e}))},[r.dataItem,r.dataIndex,r.field,r.onChange,e]);if(r.rowType==="groupFooter")s={className:"k-table-td k-hierarchy-cell",role:"gridcell",...i},t=n.createElement("td",{...s});else if(r.rowType!=="groupHeader"){const d=e?St:It,f=l.toLanguageString(d,S[d]);s={className:"k-table-td k-hierarchy-cell",onKeyDown:a,"aria-expanded":!!e,role:"gridcell","aria-colindex":r.ariaColumnIndex,...i},o=n.createElement("a",{onClick:b=>{b.preventDefault(),r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:b,field:r.field,value:!e})},"aria-label":f,href:"#",tabIndex:-1},n.createElement(g.IconWrap,{name:e?"minus":"plus",icon:e?w.minusIcon:w.plusIcon})),t=n.createElement("td",{...s},o)}const c=r.rowType||"data",h=r.cells;if(h&&h.hierarchy&&h.hierarchy[c]){const d=h.hierarchy[c];return n.createElement(d,{...r,tdProps:s},o)}return r.render?r.render.call(void 0,t,r):t},wt=C.TABLE_ROW_INDEX_ATTRIBUTE,U=C.TABLE_COL_INDEX_ATTRIBUTE,Rt=r=>{const t=L(r.field,r.dataItem);let s=null;const o=g.classNames("k-table-td","k-grid-edit-cell",{["k-selected"]:r.isSelected},r.className),e=g.useId(),i=C.useTableKeyboardNavigation(r.id);let l=null,a=null;const c=n.useCallback(u=>{if(r.onChange){const x=u.target.type==="checkbox"?u.target.checked:u.target.value;r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u,value:x})}},[r.onChange,r.dataItem,r.dataIndex,r.field]),h=n.useCallback(u=>{r.onContextMenu&&r.onContextMenu.call(void 0,u,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),d=n.useCallback(u=>{r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u.syntheticEvent,value:u.value})},[r.onChange,r.dataItem,r.dataIndex,r.field]);switch(r.editor){case"numeric":{l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(M.NumericTextBox,{width:"100%",value:t===void 0?null:t,onChange:d}),s=n.createElement("td",{...l},a);break}case"date":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(Ae.DatePicker,{width:"100%",value:t,onChange:d}),s=n.createElement("td",{...l},a);break;case"boolean":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:t||!1,id:e,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:c})),n.createElement("label",{className:"k-checkbox-label",htmlFor:e,key:2})],s=n.createElement("td",{...l},a);break;default:l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement("input",{style:{width:"100%"},className:"k-input",value:t||"",onChange:c}),s=n.createElement("td",{...l},a)}const f=r.editor||"text",b=r.cells;if(b&&b.edit&&b.edit[f]){const u=b.edit[f];return n.createElement(u,{...r,tdProps:l},a)}return r.render?r.render.call(void 0,s,r):s};class us extends n.Component{constructor(){super(...arguments),this.headerWrap=null,this.table=null,this.syncScroll=!1,this.scrollbarWidth=g.getScrollbarWidth(),this.onScroll=t=>{if(this.syncScroll){this.syncScroll=!1;return}if(!this.headerWrap)return;const s=this.headerWrap.scrollLeft,o=this.props.scrollableDataElement();o&&o.scrollLeft!==s&&(o.scrollLeft=s)}}get element(){return this.props.elemRef.current}componentDidMount(){const t=C.isRtl(this.element);this.props.columnResize&&this.props.columnResize.setIsRtl(t),this.forceUpdate()}setScrollLeft(t){this.headerWrap&&this.headerWrap.scrollLeft!==t&&(this.syncScroll=!0,this.headerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{ref:this.props.elemRef,className:g.classNames("k-grid-header",{"k-grid-draggable-header":this.props.draggable}),role:"presentation"},n.createElement("div",{ref:t=>{this.headerWrap=t},className:"k-grid-header-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},onScroll:this.onScroll,role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-header-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupHeader=t}},this.props.cols),n.createElement("thead",{className:"k-table-thead",role:"rowgroup",...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)))):n.createElement("thead",{role:"presentation",className:g.classNames("k-table-thead",{"k-grid-draggable-header":this.props.draggable}),...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)}}const Nt=(...r)=>Object.assign({allowUnsort:!0,mode:"single"},...r);class gs extends n.PureComponent{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.pressHandler&&this.props.pressHandler(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.dragHandler&&this.props.dragHandler(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.releaseHandler&&this.props.releaseHandler(t.event)}}render(){return n.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,hint:this.props.dragClue,autoScroll:{boundaryElementRef:this.props.headerRef,direction:{horizontal:!0,vertical:!1}},scrollContainer:this.props.containerRef||void 0,ref:t=>{this.draggable=t}},n.createElement("tr",{className:"k-table-row",style:{touchAction:"none"},role:"row","aria-rowindex":this.props.ariaRowIndex},this.props.children))}}class Be extends n.Component{constructor(){super(...arguments),this.state={show:!1},this._anchor=null,this._content=null,this.blurTimeout=void 0,this.willBlur=!1,this.blur=()=>{if(this.willBlur){this.willBlur=!1;return}clearTimeout(this.blurTimeout),this.blurTimeout=window.setTimeout(()=>{this.closeMenu()})},this.focus=()=>{clearTimeout(this.blurTimeout)},this.anchorClick=t=>{t.preventDefault(),this.setState({show:!this.state.show},()=>this.state.show&&this._content&&this._content.focus())},this.closeMenu=()=>{this.setState({show:!1})},this.onAnchorMouseDown=t=>{this.willBlur=this.state.show&&t.currentTarget===this._anchor},this.onAnchorKeyDown=t=>{var s;if(t.keyCode===g.Keys.tab){const o=t.target,e=o&&((s=o.closest(".k-grid"))==null?void 0:s.getElementsByClassName("k-grid-content")[0]);e&&e.scrollWidth>e.clientWidth&&o.scrollIntoView({inline:"center"})}}}render(){const{columnMenu:t,...s}=this.props,{column:o}=this.props,e=I.provideLocalizationService(this),i=o.title||o.field,l=i?`${i} `:"";return n.createElement(n.Fragment,null,n.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:a=>this._anchor=a,onClick:this.anchorClick,onMouseDown:this.onAnchorMouseDown,onKeyDown:this.onAnchorKeyDown,href:"#","aria-label":`${l}${e.toLanguageString(we,S[we])}`},n.createElement(g.IconWrap,{name:"filter",icon:w.filterIcon})),n.createElement(ss.Popup,{anchor:this._anchor,show:this.state.show,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},n.createElement("div",{ref:a=>this._content=a,tabIndex:0,onBlur:this.blur,onFocus:this.focus,style:{outline:"none"}},t&&n.createElement(t,{...s,onCloseMenu:this.closeMenu}))))}}class Ft extends n.Component{render(){const{columnMenuWrapperProps:t}=this.props,s=this.props.onClick?{onClick:this.props.onClick}:{},o=n.createElement("span",{className:"k-cell-inner"},n.createElement("span",{className:g.classNames("k-link",{"!k-cursor-default":!this.props.columnMenuWrapperProps.sortable}),...s},n.createElement("span",{className:"k-column-title"},this.props.title||this.props.field||" "),this.props.children),t.columnMenu&&n.createElement(Be,{...t}));return this.props.render?this.props.render.call(void 0,o,this.props):o}}const fs={true:{asc:"desc",desc:"","":"asc"},false:{asc:"desc",desc:"asc","":"asc"}},ms={none:"none",asc:"ascending",desc:"descending"};class Dt extends n.Component{constructor(t){super(t),this.serviceIndex=0,this.index=-1,this.cellKeyDown=(s,o)=>{s.isDefaultPrevented()||s.keyCode===g.Keys.enter&&this.cellClick(s,o)},this.cells=s=>s.map(o=>{const e=this.props.columns[o],i=this.props.sortable&&e.sortable,l=this.props.sort?this.props.sort.findIndex(E=>E.field===e.field):-1,a=l>=0&&this.props.sort[l].dir||"none",c=e.columnMenu===null?null:e.columnMenu||this.props.columnMenu,h=g.classNames({"k-first":e.kFirst,"k-filterable":!!c,"k-table-th":!0,"k-header":!0,"k-grid-header-sticky":e.locked,"k-sorted":this.props.sort&&this.props.sort.some(E=>E.field===e.field)},e.headerClassName),d=e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},f=I.provideLocalizationService(this).toLanguageString(Me,S[Me]);let b=e.isAccessible?{ariaSort:ms[a],role:"columnheader",ariaColumnIndex:e.ariaColumnIndex,ariaSelected:!1,ariaDescription:i?f:""}:{role:"presentation"};const u=e.declarationIndex>=0?++this.index:--this.serviceIndex,x=e.headerCell?e.headerCell:Ft,y=n.createElement(x,{key:1,field:e.field,onClick:i&&(E=>this.cellClick(E,e))||void 0,selectionChange:this.props.selectionChange,title:e.title,selectionValue:e.headerSelectionValue,render:this.props.cellRender,children:this.sortIcon(l),columnMenuWrapperProps:{column:{field:e.field,title:e.title,locked:e.locked,filter:e.filter,id:e.id},sortable:i&&this.props.sortable,sort:this.props.sort,onSortChange:this.props.sortChange,filter:this.props.filter,filterable:this.props.filterable&&e.filterable,filterOperators:this.props.filterOperators,onFilterChange:this.props.filterChange,group:this.props.group,groupable:this.props.groupable,onGroupChange:this.props.groupChange,columnMenu:c}}),v={...b,key:u,colSpan:e.colSpan,rowSpan:e.rowSpan,className:h,style:d,columnId:e.id,navigatable:e.navigatable,onKeyDown:i&&(E=>this.cellKeyDown(E,e))||void 0,role:"columnheader"},k=[y,this.props.columnResize&&this.props.columnResize.resizable&&e.resizable&&n.createElement(C.ColumnResizer,{key:2,resize:(E,P,z)=>this.props.columnResize&&this.props.columnResize.dragHandler(E,e,P,z),autofit:E=>this.props.columnResize&&this.props.columnResize.dblClickHandler(E,[e.id])})],R=ge(this.props.cells,e.cells);if(R&&R.headerCell){const E=R.headerCell;return n.createElement(E,{key:u,thProps:v,index:o},k)}return n.createElement(C.HeaderThElement,{...v,key:u},k)}),this.cellClick=this.cellClick.bind(this)}cellClick(t,s){if(t.preventDefault(),!this.props.sortChange)return;const{allowUnsort:o,mode:e}=Nt(this.props.sortable||!1,s.sortable||!1),i=(this.props.sort||[]).filter(c=>c.field===s.field)[0],l=fs[o][i&&i.dir||""],a=e==="single"?[]:(this.props.sort||[]).filter(c=>c.field!==s.field);l!==""&&s.field&&a.push({field:s.field,dir:l}),this.props.sortChange(a,t)}sortIcon(t){return this.props.sort?t>=0&&[n.createElement("span",{key:1,className:"k-sort-icon"},n.createElement(g.IconWrap,{name:"sort-"+this.props.sort[t].dir+"-small",icon:this.props.sort[t].dir==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon})),this.props.sort.length>1&&n.createElement("span",{key:2,className:"k-sort-icon"},n.createElement("span",{className:"k-sort-order"},t+1))]:null}render(){return this.serviceIndex=0,this.index=-1,this.props.columnsMap.map((t,s)=>this.props.pressHandler&&n.createElement(gs,{key:s,pressHandler:this.props.pressHandler,dragHandler:this.props.dragHandler,releaseHandler:this.props.releaseHandler,ariaRowIndex:s+1,dragClue:this.props.dragClue,headerRef:this.props.headerRef,containerRef:this.props.containerRef},this.cells(t))||n.createElement("tr",{key:s,className:"k-table-row",role:"row","aria-rowindex":s+1},this.cells(t)))}}I.registerForLocalization(Dt);const Cs=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],He={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},O=r=>r==="isnull"||r==="isnotnull"||r==="isempty"||r==="isnotempty",se=(r,t)=>r.map(s=>({text:t.toLanguageString(s.text,S[s.text]),operator:s.operator})),bs="eq",We=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],vs={text:!1,numeric:!1,date:!1,boolean:!0},Tt=(r,t,s)=>{const o=Gt(s.operators);let e=s.operator;switch(s.filterType){case"numeric":(!e||O(e))&&(e=o),r===null&&e===o&&(e="");break;case"date":(!e||O(e))&&(e=o),r===null&&e===o&&(e="");break;case"text":(!e||O(e))&&(e=o),!r&&e===o&&(e="");break;default:return}s.onChange({value:r,operator:e,syntheticEvent:t})},Gt=(r,t)=>t?r[t][0].operator:r[0].operator,Oe=r=>r||"text",Mt=(r,t)=>{const s=r.target.value;t({value:s.operator,operator:s.operator===""?"":bs,syntheticEvent:r.syntheticEvent})},zt=(r,t,s)=>{let o=t;const e=r.target.value;r.target.state.opened&&(O(e.operator)&&(o=null),t===null&&!O(e.operator)&&(o=void 0),s({value:o,operator:e.operator,syntheticEvent:r.syntheticEvent}))};class Ke extends n.Component{constructor(t){super(t),this._inputRef=n.createRef(),this.renderOperatorEditor=s=>{if(this.props.filterType==="boolean")return;const o=this.props.operators.find(e=>e.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{size:this.props.size,value:o,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:w.filterIcon,data:this.props.operators,textField:"text",title:s.toLanguageString(Te,S[Te]),popupSettings:{width:""}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const t=I.provideLocalizationService(this),s=n.createElement("div",{className:"k-filtercell"},n.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),n.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(t)," ",n.createElement(B.Button,{size:this.props.size,icon:"filter-clear",svgIcon:w.filterClearIcon,className:g.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:t.toLanguageString(K,S[K]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,s,this.props):s}inputChange(t,s){Tt(t,s,this.props)}operatorChange(t){zt(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Mt(t,this.props.onChange)}clear(t){t.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:t}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(M.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return n.createElement(Ae.DatePicker,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel})}default:return n.createElement(M.TextBox,{ref:this._inputRef,size:this.props.size,value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}I.registerForLocalization(Ke);const xs="k-table-row k-filter-row";class Lt extends n.Component{headerCellClassName(t,s){let o=`${s?"k-grid-header-sticky":""}`;return this.props.sort&&this.props.sort.filter(e=>e.field===t).length>0&&(o+=" k-sorted"),o}setFilter(t,s,o,e){if(!this.props.filterChange)return;const i=[];(t!==""&&t!==null||s!=="")&&i.push({field:o,operator:s,value:t}),this.props.filter&&this.props.filter.filters&&(this.props.filter.filters||[]).forEach(c=>{const h=c;h&&h.field!==o&&i.push(h)});const l=this.props.filter&&this.props.filter.logic?this.props.filter.logic:"and";this.props.filterChange(i.length>0?{logic:l,filters:i}:null,e)}render(){const t=I.provideLocalizationService(this),s=this.props.filter&&this.props.filter.filters||[],o=a=>{if(a===void 0)return;const c=s.filter(h=>h.field===a);return c.length?c[0]:void 0};let e=0,i=-1;const l=this.props.columns.filter(a=>a.children.length===0).map(a=>{const c=Oe(a.filter),h=o(a.field),d=a.filterable?t.toLanguageString(ze,S[ze]):void 0;let f=h&&h.value;f===void 0&&(f=c==="text"?"":null);const b=a.filterable&&{render:this.props.cellRender,field:a.field,title:a.filterTitle,value:f,operator:h&&h.operator,operators:se(this.props.filterOperators[c]||[],t),booleanValues:se(We,t),filterType:c,ariaLabel:d,onChange:E=>{this.setFilter(E.value,E.operator,a.field,E.syntheticEvent)}},u=a.declarationIndex>=0?++i:--e,x={ariaLabel:d,ariaColumnIndex:a.ariaColumnIndex},y=a.left!==void 0?this.props.isRtl?{left:a.right,right:a.left}:{left:a.left,right:a.right}:{},v={columnId:C.tableKeyboardNavigationTools.getFilterColumnId(a.id),navigatable:a.navigatable,style:y,className:g.classNames("k-table-th",this.headerCellClassName(a.field,a.locked)||void 0),role:"columnheader",...x},k=b&&(a.filterCell?n.createElement(a.filterCell,{...b}):n.createElement(Ke,{size:this.props.size,...b})),R=ge(this.props.cells,a.cells);if(R&&R.filterCell){const E=R.filterCell;return n.createElement(E,{key:u,...b,thProps:v,index:i},k)}return n.createElement(C.HeaderThElement,{key:u,...v},k)});return n.createElement("tr",{className:xs,"aria-rowindex":this.props.ariaRowIndex,role:"row"},l)}}I.registerForLocalization(Lt);class Ht extends n.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onPress&&this.props.onPress(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onDrag&&this.props.onDrag(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(t.event)},this.sortChange=t=>{if(t.preventDefault(),this.props.onSortChange){const s=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(t,s)}},this.groupRemove=t=>{t.preventDefault(),t.stopPropagation(),this.props.onRemove&&this.props.onRemove(t)},this.onContextMenu=t=>{const s={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,t,{dataItem:{...s}})}}render(){const{dir:t}=this.props;return n.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:s=>{this.draggable=s}},n.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},n.createElement("span",null,n.createElement(g.IconWrap,{name:"sort-"+t+"-small",icon:t==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon,size:"small"})),n.createElement("span",{className:"k-chip-content"},this.props.title),n.createElement("span",{className:"k-chip-actions"},n.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},n.createElement(g.IconWrap,{name:"x-circle",icon:w.xCircleIcon,size:"small"})))))}}I.registerForLocalization(Ht);class Ot extends n.Component{constructor(){super(...arguments),this.onGroupRemove=(t,s)=>{const o=this.props.group.slice();o.splice(s,1),this.props.groupChange(o,t)},this.onGroupSortChange=(t,s,o,e)=>{const i=Object.assign({},o,{dir:e}),l=this.props.group.slice();l.splice(s,1,i),this.props.groupChange(l,t)}}render(){const s=(this.props.group||[]).map((o,e)=>n.createElement(Ht,{key:e,index:e,dir:o.dir||"asc",title:this.props.resolveTitle(o.field),onRemove:i=>{this.onGroupRemove(i,e)},onSortChange:(i,l)=>{this.onGroupSortChange(i,e,o,l)},onPress:this.props.pressHandler,onDrag:this.props.dragHandler,onRelease:this.props.releaseHandler,onContextMenu:this.props.onContextMenu}));return n.createElement("div",{ref:this.props.refCallback,className:"k-grouping-header",role:"toolbar","aria-label":I.provideLocalizationService(this).toLanguageString(Le,S[Le]),"aria-controls":this.props.ariaControls||""},n.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},s),n.createElement("div",{className:"k-grouping-drop-container"},!s.length&&I.provideLocalizationService(this).toLanguageString(ye,S[ye])," "))}}I.registerForLocalization(Ot);class ks extends n.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=g.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(t){this.footerWrap&&(this.footerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{className:"k-grid-footer",role:"presentation"},n.createElement("div",{ref:t=>{this.footerWrap=t},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupFooter=t},role:"presentation"},this.props.cols),n.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):n.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}class Es{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.prevScrollPos=0,this.tableTranslate=0,this.scrollSyncing=!1,this.reactVersion=Number.parseFloat(n.version),this.topItems=(s,o)=>{if(!this.container||o)return{topItemsCount:0,topItemsHeight:0};const e=this.container.clientHeight,i=Math.ceil(e/s[0].line),l=Math.ceil((s.length-i)/2);let a=0;for(let c=0;c<l;c++)a+=s[c].line+s[c].acc;return{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:i+i/2}},this.horizontalScrollbarHeight=()=>this.container?this.container.offsetHeight-this.container.clientHeight:0,t&&(this.topCacheCount=4,this.attendedSkip=-this.topCacheCount),this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}get rowHeights(){const t=[],s=this.tableBodyRef.current&&this.tableBodyRef.current.children||[];let o=0;for(let e=0;e<s.length;e++){if(s[e].className.indexOf("k-grouping-row")>-1){o+=s[e].scrollHeight;continue}s[e].className.indexOf("k-detail-row")>-1?t[t.length-1].line+=s[e].scrollHeight:(t.push({line:s[e].scrollHeight,acc:o}),o=0)}return t}changePage(t,s){this.attendedSkip=t-this.topCacheCount,this.PageChange&&this.PageChange({skip:Math.max(0,t-this.topCacheCount),take:this.pageSize},s)}translate(t,s){this.tableTranslate=t,this.scrollableVirtual&&this.table&&(this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}localScrollUp(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount),h=o-e;if(!(h>a||s.length<=c)){for(;i<this.topCacheCount+this.attendedSkip-this.realSkip+l&&this.propsSkip-i>0&&!(e+(s[s.length-1-i].line+s[s.length-1-i].acc)+h<=o);)e-=s[s.length-1-i].line+s[s.length-1-i].acc,i++;if(i===0&&this.topCacheCount===0&&this.attendedSkip>0&&(e=Math.max(e-s[0].line,0),i=1),this.propsSkip-i<=0&&e>o){this.translate(0),this.changePage(0,t),this.container.scrollTop=0;return}if(e>o&&(e=o),e!==this.tableTranslate){this.translate(Math.max(0,e-a));const d=Math.max(0,this.propsSkip-i-l);this.changePage(d,t)}}}localScrollDown(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount);for(;i<s.length-this.topCacheCount&&!(e+s[i].line+s[i].acc>o);)e+=s[i].line+s[i].acc,i++;l>this.propsSkip+i||s.length<=c||(i>=s.length-this.topCacheCount&&this.propsSkip+i>=this.total?(this.translate(e-a),this.changePage(this.total-1-l,t)):e!==this.tableTranslate&&this.propsSkip+i-l!==this.propsSkip&&(this.translate(e-a),this.changePage(this.propsSkip+i-l,t)))}scrollNonStrict(t){const s=this.total*this.prevScrollPos/this.containerHeight;let o=Math.floor(s);o>=this.total&&(o=this.total-1);const e=Math.min(s-o,1);let i=0;const l=o-this.propsSkip,a=this.rowHeights;l>=0&&l<=1?i=-((a[0].line+a[0].acc)*e):l===-1&&(i=-((a[a.length-1].line+a[a.length-1].acc)*e));const{topItemsCount:c,topItemsHeight:h}=this.topItems(a,!!this.topCacheCount);this.translate(Math.max(0,i-h-this.horizontalScrollbarHeight()+this.containerHeight*s/this.total)),this.changePage(o-c,t)}scrollHandler(t){if(!this.scrollableVirtual)return;if(this.scrollSyncing||!this.container||!this.table){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.prevScrollPos;if(this.prevScrollPos=s,this.askedSkip!==void 0){this.translate(this.containerHeight*this.askedSkip/this.total),this.changePage(this.askedSkip,t),this.prevScrollPos=s,this.askedSkip=void 0;return}s-o<0&&s>this.tableTranslate-this.table.scrollHeight/10?this.localScrollUp(t):s-o>0&&s<this.tableTranslate+this.table.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t),this.prevScrollPos=s}}class nt{constructor(t=0,s,o,e){this.total=t,this.offsets=[],this.heights=[];let i=0;for(let l=0;l<t;l++){this.offsets.push(i);const a=e&&e[l].expanded&&e[l].rowType==="data"?o:s;i+=a,this.heights.push(a)}}height(t){return this.heights[t]}index(t){if(t<0)return;const s=this.offsets.reduce((o,e,i)=>{if(o!==void 0)return o;if(e===t)return i;if(e>t)return i-1},void 0);return s===void 0?this.total-1:s}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],s=this.heights[this.heights.length-1];return t+s}}class lt{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(n.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(t,s){this.scrollableVirtual&&this.table&&(Ie||this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}changePage(t,s){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},s)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(t){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.lastScrollTop>=s,e=!o;this.lastScrollTop=s;let i=this.rowHeightService.index(s),l=this.rowHeightService.offset(i);const{offsetHeight:a}=this.containerRef.current,c=this.rowHeightService.index(s+a);if(e&&c>=this.lastLoaded&&this.lastLoaded<this.total){const h=i+this.pageSize-this.total;h>0&&(i=i-h,l=this.rowHeightService.offset(i)),this.firstLoaded=i,this.translate(l);let d=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(d,this.total),this.changePage(this.firstLoaded,t)}else if(o&&i<this.firstLoaded){const h=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(i-h,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,t)}}}const Is=1,Ss=20;class ys{constructor(t){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=s=>{this.isRtl=s},this.dragHandler=(s,o,e,i)=>{const l=s.originalEvent;i||(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation());const a=e.closest("th");if(!a||!a)return;const c=a.clientWidth;let h=c;if(this.isRtl?h+=e.getBoundingClientRect().right-e.offsetWidth/2-s.clientX:h+=s.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!i&&Math.abs(h-c)<1)return;this.fixateInitialWidths(a.parentElement.clientWidth),this.setWidths(o,Math.floor(h)/c);const d=this.columns.filter(f=>!f.children.length).findIndex(f=>f.id===o.id);this.onResize(d,c,h,l,i,o.id)},this.dblClickHandler=(s,o)=>{const e=this.columns.filter(b=>o.indexOf(b.id)>-1);if(!this.colGroupMain||!e.length)return;const i={},l=e;for(;l.length>0;){const b=l.pop();if(!b)break;b.children.length?l.push(...b.children):i[b.id]=b}const a=this.columns.filter(b=>!b.children.length),c=[];a.forEach((b,u)=>{i[b.id]&&c.push(u)});const h=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),h.forEach(b=>b.classList.add("k-autofitting"));let f=[];d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width="",f[u]=Math.max(f[u]||0,b.children[u].offsetWidth+Is))})}),d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width=f[u]+"px",a[u].width=f[u])})}),h.forEach(b=>b.classList.remove("k-autofitting")),this.onResize(c[0],0,0,s,!0,o[0])},this.updateColElements=s=>{const o=this.columns.filter(i=>!i.children.length);let e=1e-10;for(let i=0;i<s.length;i++){const l=s[i],a=o.findIndex(f=>f.id===l.id),c=parseFloat((l.width||0).toString()),h=Math.floor(c);e+=c-h;const d=h+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[a]){const f=parseInt(this.colGroupMain.children[a].width,10);this.colGroupMain.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,l,f-d)}if(this.colGroupHeader&&this.colGroupHeader.children[a]){const f=parseInt(this.colGroupHeader.children[a].width,10);this.colGroupHeader.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,l,f-d)}if(this.colGroupFooter&&this.colGroupFooter.children[a]){const f=parseInt(this.colGroupFooter.children[a].width,10);this.colGroupFooter.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,l,f-d)}}},this.onResize=t}fixateInitialWidths(t){const s=this.columns.filter(l=>!l.children.length);let o=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let l=0;l<e.length;l++)e[l].width?t-=parseFloat(e[l].width):o++;if(o===0)return;const i=Math.floor(t/o);for(let l=0;l<e.length;l++){const a=e[l];a.width||(a.width=i,s[l].width=i.toString(),this.colGroupHeader&&(this.colGroupHeader.children[l].width=i),this.colGroupFooter&&(this.colGroupFooter.children[l].width=i))}}setWidths(t,s){const o=this.columns.findIndex(l=>l.id===t.id),e=[];let i=t.children.length;for(let l=o+1;i>0&&l<this.columns.length;l++,i--){const a=this.columns[l];a.children.length?i+=a.children.length:e.push(a)}return e.length===0&&e.push(t),e.forEach(l=>{let a=l.width?parseFloat(l.width.toString())*s:0;const c=l.minResizableWidth===void 0?10:l.minResizableWidth;a<c&&(a=c),l.width=a}),this.updateColElements(e),e}updateNextLockedCol(t,s,o){const e=s.index,i=this.colGroupMain.parentElement.closest(".k-grid"),l=i==null?void 0:i.clientWidth,a=this.columns.filter(c=>c.locked).map(c=>parseInt(c.width+"",10)).reduce((c,h)=>c+h,0);!s.locked||l<=a+Ss||this.columns.forEach(c=>{if(c!=null&&c.locked&&o){const h=t==null?void 0:t.querySelectorAll('[aria-colindex="'+c.ariaColumnIndex+'"]');h==null||h.forEach(d=>{const f=d.style;this.isRtl?(c.index>e&&f&&f.right&&(f.right=parseInt(f.right,10)-o+"px"),c.index<e&&f&&f.left&&(f.left=parseInt(f.left,10)-o+"px")):(c.index>e&&f&&f.left&&(f.left=parseInt(f.left,10)-o+"px"),c.index<e&&f&&f.right&&(f.right=parseInt(f.right,10)-o+"px"))})}})}}class Pt{constructor(t,s,o){this.refDragElementClue=n.createRef(),this.refDropElementClue=n.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=e=>{this.groupPanelDivElement=e&&e.children?e.children[0]:e},this.pressHandler=(e,i)=>{const l=this.getColumnIndex(e,i);if(this.startGroup=this.getGroupIndex(e),l>=0){const a=this.columns[l];(a.reorderable&&this.reorderable||a.groupable&&this.groupable)&&(this.startColumn=l)}},this.dragHandler=(e,i)=>{if(e.isTouch||e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(e,i);const l=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(e)?l&&l.length?l.length:0:this.getGroupIndex(e);const a=!this.isValid();a&&(this.currentColumn=-1,this.currentGroup=-1);const c=this.currentColumn>=0?i.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(e)?e.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(e,i,c,a),this.updateDropElementClue(e,i,c,a)},this.releaseHandler=e=>{const i=this.startColumn,l=this.currentColumn,a=this.startGroup,c=this.currentGroup;e.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const h=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,h&&(i>=0&&l>=0?this.columnReorder(i,l,e.originalEvent):a>=0&&c>=0?this.groupReorder(a,c,e.originalEvent):i>=0&&c>=0&&this.columnToGroup(i,c,e.originalEvent))},this.columnReorder=t,this.groupReorder=s,this.columnToGroup=o}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(t,s){if(!s||s.parentElement===this.groupPanelDivElement)return-1;const o=C.getIndex(t,s);if(o===-1)return-1;for(let e=0;e<s.parentNode.children.length;e++)if(s.parentNode.children[e]===s)return this.columns.findIndex(i=>i.index===o&&i.depth===e);return-1}isTargetGroupingContainer(t){const s=t.originalEvent.target;return s.className.indexOf?s.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(t){return C.getIndex(t,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(t,s,o,e){if(!this.dragElementClue)return;const i=this.startColumn>=0?s.children[this.columns[this.startColumn].index].innerText:s.innerText;this.dragElementClue.setState({visible:!0,top:t.pageY+10,left:t.pageX,innerText:i,status:e||!o?"k-i-cancel":"k-i-plus"})}updateDropElementClue(t,s,o,e){if(!this.dropElementClue)return;if(e||!o){this.dropElementClue.setState({visible:!1});return}const i=o.getBoundingClientRect(),a=(o.closest(".k-grouping-header")||o).getBoundingClientRect();let c=i.left+t.pageX-t.clientX-6;!this.isTargetGroupingContainer(t)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(c+=i.width);const h=a.top+t.pageY-t.clientY;this.dropElementClue.setState({visible:!0,top:h,left:c,height:this.currentColumn>=0?s.clientHeight:a.height})}}const _t=r=>{let t=null;const s=I.useInternationalization(),o=C.useTableKeyboardNavigation(r.id),e=n.useCallback(h=>{r.onContextMenu&&r.onContextMenu.call(void 0,h,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]);let i=null,l=null;if(r.rowType==="groupFooter")i={onContextMenu:e,className:r.className},t=n.createElement("td",{...i});else if(r.rowType!=="groupHeader"){if(r.field!==void 0){const d=L(r.field,r.dataItem);d!=null&&(l=r.format?s.format(r.format,d):d.toString())}const h=g.classNames("k-table-td",r.className,{"k-selected":r.isSelected});i={onContextMenu:e,colSpan:r.colSpan,style:r.style,className:h,role:"gridcell","aria-colindex":r.ariaColumnIndex,"aria-selected":r.isSelected,[U]:r.columnIndex,...o},t=n.createElement("td",{...i},l)}const a=r.rowType||"data",c=r.cells;if(c&&c[a]){const h=c[a];return n.createElement(h,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,t,r):t},Pe=r=>{let t=null;const{columnIndex:s,level:o,columnsCount:e,rowType:i,dataItem:l,field:a,onChange:c,expanded:h,render:d,dataIndex:f,ariaColumnIndex:b,isRtl:u}=r,x=a||"",y=C.useTableKeyboardNavigation(r.id),v=I.useLocalization();let k=null,R=null,E=null;const P=n.useCallback(T=>{T.isDefaultPrevented()||T.keyCode===g.Keys.enter&&c&&(T.preventDefault(),c({dataItem:l,dataIndex:f,syntheticEvent:T,field:void 0,value:!h}))},[h,c,l,f]),z=n.useCallback(T=>{r.onContextMenu&&r.onContextMenu.call(void 0,T,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),ae=(T,Ce)=>{const ce=h?Et:kt,be=v.toLanguageString(ce,S[ce]);return k={className:"k-table-td",style:{...r.style,...Ce},colSpan:T,key:"g-colspan",role:"gridcell",["aria-selected"]:!1,["aria-expanded"]:h,["aria-colindex"]:b,onKeyDown:P,onContextMenu:z,...y},E=n.createElement("p",{className:"k-reset"},n.createElement("a",{onClick:Q=>{Q.preventDefault(),c&&c({dataItem:l,dataIndex:f,syntheticEvent:Q,field:void 0,value:!h})},href:"#",tabIndex:-1,"aria-label":be},n.createElement(g.IconWrap,{name:h?"caret-alt-down":u?"caret-alt-left":"caret-alt-right",icon:h?w.caretAltDownIcon:u?w.caretAltLeftIcon:w.caretAltRightIcon})),l[x]instanceof Date&&l[x].toString?l[x].toString():l[x]),n.createElement("td",{...k,key:k.key},E)};s===void 0||o===void 0||s<o||e===void 0||i!=="groupHeader"||l[x]===void 0?(k={style:r.style,key:"g"+s,className:g.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":r.locked}),role:"gridcell",onContextMenu:z},t=n.createElement("td",{...k,key:k.key})):s<=o&&!r.locked?t=ae(e-s,{}):s<=o&&r.locked&&(R={className:"k-table-td",role:"gridcell",colSpan:e-s,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:z},t=n.createElement(n.Fragment,null,ae(0,{position:"sticky",zIndex:2}),n.createElement("td",{...R})));const Y=r.rowType||"data",V=r.cells;if(V&&V.group&&V.group[Y]){const T=V.group[Y];return n.createElement(T,{...r,tdProps:k,td2Props:R},E)}return d?d.call(void 0,t,r):t};class At extends n.Component{render(){const t=g.classNames("k-table-row",{"k-table-group-row k-grouping-row":this.props.rowType==="groupHeader","k-group-footer":this.props.rowType==="groupFooter","k-master-row":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter","k-table-alt-row k-alt":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter"&&this.props.isAltRow,"k-selected":this.props.isSelected,"k-grid-edit-row":this.props.isInEdit}),s=n.createElement("tr",{id:this.props.id,onClick:this.props.onClick,onDoubleClick:this.props.onDoubleClick,className:t,style:{height:this.props.rowHeight?this.props.rowHeight+"px":"",visibility:this.props.isHidden?"hidden":""},role:"row","aria-rowindex":this.props.ariaRowIndex,"absolute-row-index":this.props.absoluteRowIndex,key:this.props.absoluteRowIndex,[wt]:this.props.rowType==="data"?this.props.dataIndex:void 0},this.props.children);return this.props.render?this.props.render.call(void 0,s,this.props):s}}class ws extends n.Component{get _inputId(){return this.props.id}render(){const{columnMenuWrapperProps:t}=this.props,s=[n.createElement("span",{key:0,className:"k-checkbox-wrap"},n.createElement("input",{checked:this.props.selectionValue,id:this._inputId,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:o=>this.props.selectionChange({field:this.props.field,syntheticEvent:o})})),n.createElement("label",{key:1,className:"k-checkbox-label",htmlFor:this._inputId}),t.columnMenu&&n.createElement(Be,{...t})];return this.props.render?this.props.render.call(void 0,s,this.props):s}}const Rs=g.withIdHOC(ws);class fe extends n.Component{render(){return this.props.children||I.provideLocalizationService(this).toLanguageString(Se,S[Se])}}fe.displayName="KendoReactGridNoRecords";I.registerForLocalization(fe);class Ns extends n.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(t,s)=>{const o={colSpan:t.colSpan!==1?t.colSpan:void 0,style:t.left!==void 0?this.props.isRtl?{left:t.right,right:t.left}:{left:t.left,right:t.right}:{},className:g.classNames("k-table-td",t.locked&&t.left!==void 0?"k-grid-footer-sticky":""),key:s,role:"gridcell",["aria-colindex"]:t.ariaColumnIndex},e={field:t.field,ariaColumnIndex:t.ariaColumnIndex,...o},i=ge(this.props.cells,t.cells);if(i&&i.footerCell){const l=i.footerCell;return n.createElement(l,{...e,tdProps:o,index:s})}return t.footerCell&&n.createElement(t.footerCell,{...e,key:s})||n.createElement("td",{...o})}}get element(){return this._element}render(){return n.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},ls(this.props.columns).map(this.renderCell))}}const Fs=({buttonCount:r=10,info:t=!0,type:s="numeric",pageSizes:o=void 0,previousNext:e=!0,responsive:i=void 0,pageSizeValue:l=void 0})=>({buttonCount:r,info:t,pageSizes:o===!0?[5,10,20]:o||void 0,previousNext:e,responsive:i!==!1,type:s,pageSizeValue:l}),Ds=r=>Fs(r===!0?{}:r),at={name:"@progress/kendo-react-grid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Ts=r=>{const{colSpan:t,ariaColIndex:s,dataItem:o,dataIndex:e,id:i}=r,l=C.useTableKeyboardNavigation(i),a=n.useCallback(c=>{r.onContextMenu&&r.onContextMenu.call(void 0,c,r.dataItem)},[r.onContextMenu,r.dataItem]);return n.createElement("td",{onContextMenu:a,className:"k-table-td k-detail-cell",colSpan:t,"aria-colindex":s,role:"gridcell",...l},n.createElement(r.detail,{dataItem:o,dataIndex:e}))},Gs=r=>{const t=C.useTableKeyboardNavigation(r.id);return n.createElement("td",{className:"k-table-td k-hierarchy-cell",...t,role:"gridcell"})};let X=class extends n.Component{constructor(t){super(t),this._columns=[],this._columnsMap=[[]],this._columnsMutations=0,this._resized=!1,this._shouldUpdateLeftRight=!0,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this._data=[],this._slicedData=void 0,this.wrapperScrollTop=0,this.showLicenseWatermark=!1,this.headerRef=n.createRef(),this.headerElementRef=n.createRef(),this._element=null,this.tableElement=null,this.containerRef=n.createRef(),this.tableBodyRef=n.createRef(),this._footer=null,this.forceUpdateTimeout=void 0,this.isRtl=!1,this.observer=null,this.handleIntersection=e=>{const i={rowIndex:this.rowIndex};e.forEach(l=>{l.isIntersecting||this.setCurrentOnTop(i)})},this.setCurrentOnTop=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.observer&&this.observer.disconnect();const{rowIndex:i}=e;if(this.props.scrollable==="virtual")this.vs.askedSkip=i,this.vs.container.scroll(0,Math.round(this.vs.askedSkip/this.vs.total*this.vs.container.scrollHeight));else if(this.element){const l=i<1?this.element.querySelector("tbody > tr:nth-child(1)"):this.element.querySelector(`tbody > tr:nth-child(${i+1})`);l&&this.containerRef.current&&(this.containerRef.current.scrollTop=l.offsetTop)}},this.scrollIntoView=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.rowIndex=e.rowIndex;const{rowIndex:i}=e,l=this.element;if(this.observer&&l){this.observer.disconnect();const a=l.querySelector(`[absolute-row-index="${i}"]`);a?this.observer.observe(a):this.setCurrentOnTop(e)}},this.fitColumns=e=>{this.columnResize.dblClickHandler(null,e)},this.onContextMenu=(e,i,l)=>{if(this.props.onContextMenu){const a={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,dataItem:i,field:l};this.props.onContextMenu.call(void 0,a)}},this.getVirtualScroll=e=>{const{rowHeight:i,detailRowHeight:l,detail:a,expandField:c,groupable:h}=e,d=this.isAllData(),f=i!==void 0&&i>0,b=l!==void 0&&l>0,u=h===!0||typeof h=="object"&&h.enabled!==!1;return!f||u&&!d||!!(a&&c)&&(!b||!d)?Es:lt},this.isAllData=()=>{const{data:e,total:i}=this.props;return Array.isArray(e)?e.length===i:e?i===e.total:!1},this.initializeVirtualization=(e,i)=>{if(this.reInitVirtualization(this.props.scrollable==="virtual",this.props.total,this.props.filter,this.props.group,this.props.sort,i||this.props.rowHeight===void 0||this.props.rowHeight===0),this.vs.fixedScroll=this.props.fixedScroll||!1,this.vs.PageChange=this.pageChange,this.vs.realSkip=this.props.skip||0,this.vs.pageSize=(this.props.take!==void 0?this.props.take:this.props.pageSize)||0,this.vs.scrollableVirtual=this.props.scrollable==="virtual",this.vs.total=e,this.vs.propsSkip=(this.props.skip||0)+(this.props.scrollable==="virtual"?this.vs.topCacheCount+(this.vs.attendedSkip-(this.props.skip||0)):0),this.props.rowHeight!==void 0&&this.props.rowHeight>0&&!i){const l=this.props.rowHeight*e;this.vs.containerHeight=Ie?Math.min(ot,l):l}else this.vs.containerHeight=1533915;if(this.vs.containerRef=this.containerRef,this.vs.tableBodyRef=this.tableBodyRef,this.vs.table=this.tableElement,this._slicedData=void 0,this.vs instanceof lt){const{rowHeight:l=0,detail:a,expandField:c}=this.props;let{detailRowHeight:h=0}=this.props;h=a&&c?h:l,this.isAllData()?(this.vs.total=this._data.length,this._slicedData=this._data.slice(this.vs.realSkip,this.vs.realSkip+this.vs.pageSize),this.vs.rowHeightService=this.rowHeightService(this.vs,this._data.length,l,h,this._data)):this.vs.rowHeightService=new nt(e,l,h);const d=this.vs.rowHeightService.totalHeight();this.vs.containerHeight=Ie?Math.min(ot,d):d}},this.scrollHandler=e=>{if(e.target!==e.currentTarget)return;clearTimeout(this.forceUpdateTimeout),this.vs.table=this.tableElement;const i=e.currentTarget.scrollLeft,l=e.currentTarget.scrollTop;this.props.columnVirtualization&&(!this.vs.scrollableVirtual||l===this.wrapperScrollTop)&&(this.forceUpdateTimeout=window.setTimeout(()=>{this.forceUpdate()},0)),this._header&&this._header.setScrollLeft(i),this._footer&&this._footer.setScrollLeft(i),this.vs&&l!==this.wrapperScrollTop&&this.vs.scrollHandler(e),g.dispatchEvent(this.props.onScroll,e,this,void 0),this.wrapperScrollTop=l},this.onKeyDown=e=>{if(C.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,onNavigationAction:this.onNavigationAction}),this.props.onKeyDown){const{mode:i,cell:l}=C.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:i,cell:l,componentId:this._gridId,selectedField:this.props.selectedField,...this.getArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{C.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onNavigationAction=e=>{if(this.props.onNavigationAction){const i={focusElement:e.focusElement,...this.getArguments(e.event)};this.props.onNavigationAction.call(void 0,i)}},this.rowClick=(e,i)=>{this.props.onRowClick&&e.target.nodeName==="TD"&&this.props.onRowClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.rowDblClick=(e,i)=>{this.props.onRowDoubleClick&&e.target.nodeName==="TD"&&this.props.onRowDoubleClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.itemChange=e=>{const i=this.props.onItemChange;if(e.field===this.props.expandField||this.props.group&&e.field===void 0){const l=this.props.onExpandChange;l&&l.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,dataIndex:e.dataIndex,value:e.value});return}i&&i.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,field:e.field,value:e.value})},this.onHeaderSelectionChange=e=>{this.props.onHeaderSelectionChange&&this.props.onHeaderSelectionChange.call(void 0,{field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems(),selectedField:this.props.selectedField})},this.selectionRelease=e=>{if(this.props.onSelectionChange){const i={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._gridId,dataItems:this.getLeafDataItems(),dataItem:null,...e};this.props.onSelectionChange.call(void 0,i)}},this.pageChange=(e,i,l)=>{this.raiseDataEvent(this.props.onPageChange,{page:e},{skip:e.skip,take:e.take},i,l)},this.pagerPageChange=e=>{this.pageChange({skip:e.skip,take:e.take},e.syntheticEvent,e.targetEvent)},this.sortChange=(e,i)=>{this.raiseDataEvent(this.props.onSortChange,{sort:e},{sort:e,...this.props.scrollable==="virtual"?{skip:0}:{}},i)},this.filterChange=(e,i)=>{this.raiseDataEvent(this.props.onFilterChange,{filter:e},{filter:e||void 0,skip:0},i)},this.groupChange=(e,i)=>{const l=i.nativeEvent?i:{nativeEvent:i.nativeEvent||i.originalEvent};this.raiseDataEvent(this.props.onGroupChange,{group:e},{group:e,skip:0},l)},this.onClipboard=(e,i)=>{if(this.props.onClipboard){if(!this.inActiveElement()||!e)return;this.props.onClipboard.call(void 0,{type:e,nativeEvent:i,columns:this._columns,dataItemKey:this.props.dataItemKey||"",...typeof this.props.clipboard!="boolean"?this.props.clipboard:{}})}},this.inActiveElement=()=>{var c,h,d;if(!g.canUseDOM)return!1;const e=g.getActiveElement(this.document),i=e?e.matches(".k-table-td")?e:(c=this.document)==null?void 0:c.body:(h=this.document)==null?void 0:h.body,l=i.closest(".k-grid-container"),a=i&&((d=this._element)==null?void 0:d.contains(i));return!!(i&&a&&l)},this.onResize=(e,i,l,a,c,h)=>{this.resetTableWidth(),this._shouldUpdateLeftRight=!0,this._resized=!0,this._columnsMutations++,this.props.onColumnResize&&this.props.onColumnResize.call(void 0,{columns:this.columns,nativeEvent:a,targetColumnId:h,index:e,newWidth:i,oldWidth:l,end:c,target:this})},this.reInitVirtualization=g.memoizeOne((e,i,l,a,c,h)=>{this.vs.reset();const d=this.getVirtualScroll(this.props);this.vs=new d(h)}),this.flatData=g.memoizeOne((e,i,l,a,c,h,d)=>{const f=[],b=ct(f,e,i,{index:l},a!==void 0,c);return{flattedData:f,resolvedGroupsCount:b}}),this.rowHeightService=g.memoizeOne((e,i,l,a,c)=>new nt(i,l,a,c)),this.childrenToArray=g.memoizeOne(e=>n.Children.toArray(e)),this.readColumns=g.memoizeOne((e,i,l)=>{const a=e.filter(c=>c&&c.type&&c.type.displayName==="KendoReactGridColumn");return ht(a,this.columns,{prevId:0,idPrefix:i})}),this.mapColumns=g.memoizeOne(e=>C.mapColumns(e)),this.configureColumns=g.memoizeOne((e,i,l)=>{this.props.selectedField&&e.filter(h=>h.field===this.props.selectedField).forEach(h=>{h.width=h.width||"50px",h.cell=h.cell||pt,h.headerCell=h.headerCell||Rs});const a={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let c=0;this.props.expandField&&this.props.onExpandChange&&this.props.detail&&(e.unshift({...a,cell:yt,field:this.props.expandField,headerClassName:"k-hierarchy-cell k-header",id:C.tableKeyboardNavigationTools.generateNavigatableId(`${this._columns.length}`,l,"column")}),c++);for(let h=0;h<i;h++)e.unshift({...a,isAccessible:!1,cell:Pe,field:"value",locked:this.props.lockGroups}),c++;e.slice(c).forEach(h=>h.parentIndex>=0&&(h.parentIndex+=c))}),this.getHeaderRow=g.memoizeOne((e,i,l,a,c,h,d,f,b,u,x,y)=>n.createElement(Dt,{cells:this.props.cells,sort:e,sortable:i,sortChange:this.sortChange,group:l||[],groupable:a,groupChange:this.groupChange,filter:c,filterable:h,filterOperators:d,filterChange:this.filterChange,columnMenu:b,selectionChange:this.onHeaderSelectionChange,columns:u,columnResize:this.columnResize,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,columnsMap:x,cellRender:f,isRtl:y,dragClue:this.dragLogic.dragClueRef,headerRef:this.headerElementRef,containerRef:this.containerRef})),this.resolveTitle=e=>{const i=this._columns.find(a=>a.field===e),l=i&&(i.title||i.field);return l===void 0?e:l},this.getLeafDataItems=()=>this._data.filter(e=>e.rowType==="data").map(e=>e.dataItem),g.validatePackage(at),this.showLicenseWatermark=g.shouldShowValidationUI(at);const s=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1,o=this.getVirtualScroll(t);this.vs=new o(s||t.rowHeight===void 0||t.rowHeight===0),this.dragLogic=new Pt(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ys(this.onResize),this.props.clipboard&&(this.clipboardService=new C.ClipboardService(this.onClipboard)),C.tableKeyboardNavigation.onConstructor({navigatable:!!t.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:this._gridId})}get columns(){const t=this._columns.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1);return dt(t)}get element(){return this._element}get document(){if(g.canUseDOM)return this.element&&this.element.ownerDocument||document}get _header(){return this.headerRef.current}get _gridId(){return this.props.id+"-role-element-id"}componentDidMount(){this.resetTableWidth(),g.setScrollbarWidth();const t=C.isRtl(this.element);this.isRtl=t,C.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.isRtl&&this.forceUpdate();const s={rootMargin:"0px",threshold:.9};this.clipboardService&&this.clipboardService.addEventListeners(this.document),this.observer=g.canUseDOM&&window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,s)||null}getSnapshotBeforeUpdate(){return C.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(){this.resetTableWidth(),g.setScrollbarWidth(),this.vs.tableTransform&&this.vs.table&&(this.vs.table.style.transform=this.vs.tableTransform,this.vs.tableTransform=""),C.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){clearTimeout(this.forceUpdateTimeout),this.clipboardService&&this.clipboardService.removeEventListeners(this.document)}render(){var rt;let t=this.props.total||0;const s=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);let o=[];Array.isArray(this.props.data)?(o=this.props.data,t=t||this.props.data.length):this.props.data&&(o=this.props.data.data,t=t||this.props.data.total);const e=typeof this.props.groupable=="object"&&this.props.groupable.footer||"none",{resolvedGroupsCount:i,flattedData:l}=this.flatData(o,e,this.props.skip||0,this.props.group,this.props.expandField,this.props.filter,this.props.sort);this._data=l;const a=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1;this.columnResize.resizable=this.props.resizable||!1,this.dragLogic.reorderable=this.props.reorderable||!1,this.dragLogic.groupable=a;const c=this.props.selectable&&this.props.selectable.drag?"none":void 0;this.initializeVirtualization(t,a);const h=this.childrenToArray(this.props.children);this.initColumns(h,i);const d=h.map(m=>m&&m.type&&m.type.displayName==="KendoReactGridToolbar"?n.cloneElement(m,{...m.props,ariaControls:this._gridId}):null),f=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridNoRecords"),b=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridStatusBar"),u=this._columns.filter(m=>m.children.length===0),x=a&&n.createElement(Ot,{group:this.props.group||[],groupChange:this.groupChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,refCallback:this.dragLogic.refGroupPanelDiv,resolveTitle:this.resolveTitle,ariaControls:this._gridId,onContextMenu:this.onContextMenu}),{sort:y,sortable:v,group:k,filter:R,filterable:E,filterOperators:P=He,headerCellRender:z,columnMenu:ae}=this.props,Y=n.createElement(us,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",scrollableDataElement:()=>this.vs.container,draggable:this.props.reorderable||a,ref:this.headerRef,elemRef:this.headerElementRef,headerRow:this.getHeaderRow(y,v,k,a,R,E,P,z,ae,this._columns,this._columnsMap,this.isRtl),filterRow:this.props.filterable&&n.createElement(Lt,{cells:this.props.cells,size:this.props.size,columns:this._columns,filter:this.props.filter,filterOperators:this.props.filterOperators||He,filterChange:this.filterChange,sort:this.props.sort,cellRender:this.props.filterCellRender,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1})||void 0,cols:u.map((m,F)=>n.createElement("col",{key:F.toString(),width:Ee(m)}))}),V=this.vs&&this.vs.container&&this.vs.container.scrollLeft||0,T=parseFloat(((this.props.style||{}).width||"").toString()),{colSpans:Ce,hiddenColumns:ce}=C.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:u,tableViewPortWidth:T,scrollLeft:V}),be=(m,F,D)=>{let q=!1;const W=this.props.selectedField?L(this.props.selectedField,m.dataItem):void 0;return{row:u.map((N,G)=>{if(ce[G])return null;const Z=N.id?N.id:G,ee=`${N.className?N.className+" ":""}${N.locked?"k-grid-content-sticky":""}`,_=N.left!==void 0?this.isRtl?{left:N.right,right:N.left}:{left:N.left,right:N.right}:{};let A=!1;if(N.editable&&this.props.editField){const H=L(this.props.editField,m.dataItem);H&&(H===!0||H===N.field)&&(q=!0,A=!0)}const ke=N.cell||A&&Rt||_t;return n.createElement(ke,{onContextMenu:this.onContextMenu,key:Z,locked:this.props.lockGroups,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${F}-${String(G)}`,s),colSpan:Ce[G],dataItem:m.dataItem,field:N.field,editor:N.editor,format:N.format,className:ee,render:this.props.cellRender,cells:ge(this.props.cells,N.cells),onChange:this.itemChange,selectionChange:this.props.onSelectionChange?H=>{this.selectionChange({event:H,dataItem:m.dataItem,dataIndex:D,columnIndex:G})}:void 0,columnIndex:G,columnsCount:u.length,rowType:m.rowType,level:m.level,expanded:m.expanded,dataIndex:m.dataIndex,style:_,ariaColumnIndex:N.ariaColumnIndex,isSelected:Array.isArray(W)&&W.indexOf(G)>-1})}),isInEdit:q,isSelected:typeof W=="boolean"&&W}};let Q=0;if(this.props.scrollable==="virtual")for(let m=0;m<this.vs.topCacheCount+this.vs.attendedSkip-(this.props.skip||0);m++){const F=this._data.shift();if(F)this._data.push(F),Q++,F.rowType==="groupHeader"&&m--;else break}const je=m=>m>=this._data.length-Q;let Xe=this.vs.realSkip||0;const he=[];let ve=!1;const xe=this._columnsMap.length+(this.props.filterable?1:0)+1,Ye=n.createElement("div",{key:"no-records",className:"k-grid-norecords","aria-rowindex":xe},n.createElement("div",{className:"k-grid-norecords-template"},f.length?f:n.createElement(fe,null)));let J=0;if(this._data.length){let m=-1,F=0;(this._slicedData||this._data).forEach((D,q)=>{D.rowType==="data"&&(Xe++,m++);const W=Xe%2===0,N=this.props.dataItemKey&&g.getter(this.props.dataItemKey)(D.dataItem),G=q+(this.vs.realSkip||0),Z=N||"ai"+G,ee=Z+"_1",_=be(D,Z,m);if(J=G+xe+F,he.push(n.createElement(At,{key:Z,dataItem:D.dataItem,isAltRow:W,isInEdit:_.isInEdit,rowType:D.rowType,isHidden:je(q),onClick:A=>this.rowClick(A,D),onDoubleClick:A=>this.rowDblClick(A,D),selectedField:this.props.selectedField,rowHeight:this.props.rowHeight,render:this.props.rowRender,ariaRowIndex:J,absoluteRowIndex:G,dataIndex:m,isSelected:_.isSelected},_.row)),this.props.detail&&D.rowType==="data"&&D.expanded){const A=u.length-(this.props.expandField?1:0)-(this.props.group?this.props.group.length:0)||1;F++,J=G+xe+F,he.push(n.createElement("tr",{key:ee,className:g.classNames("k-table-row",W?"k-detail-row k-table-alt-row k-alt":"k-detail-row"),style:{visibility:je(q)?"hidden":"",height:this.props.detailRowHeight},role:"row","aria-rowindex":J},this.props.group&&this.props.group.map((ke,H)=>{var it;const te=(it=_==null?void 0:_.row[H])==null?void 0:it.props.style,es=te?this.isRtl?{left:te.right,right:te.left}:{left:te.left,right:te.right}:{};return n.createElement(Pe,{id:"",dataIndex:D.dataIndex,field:ke.field,dataItem:D.dataItem,key:H,style:es,ariaColumnIndex:1+H,isSelected:!1,locked:this.props.lockGroups,isRtl:this.isRtl,cells:this.props.cells})}),this.props.expandField&&n.createElement(Gs,{id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dhcell`,s)}),n.createElement(Ts,{onContextMenu:this.onContextMenu,dataItem:D.dataItem,dataIndex:D.dataIndex,colSpan:A,ariaColIndex:2+(this.props.group?this.props.group.length:0),detail:this.props.detail,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dcell`,s)})))}})}else ve=!0;const Qe={size:this.props.size,onPageChange:this.pagerPageChange,total:t,dir:this.isRtl?"rtl":void 0,skip:this.vs.propsSkip||0,take:(this.props.take!==void 0?this.props.take:this.props.pageSize)||10,messagesMap:ps,...Ds(this.props.pageable||{})},Je=this.props.pager?n.createElement(this.props.pager,{...Qe}):n.createElement(C.Pager,{className:"k-grid-pager",...Qe}),Jt=m=>this.props.sort&&this.props.sort.filter(F=>F.field===m).length>0,Zt=(m,F)=>n.createElement("col",{key:F.toString(),width:Ee(m)}),Ze=(rt=this.props.cells)!=null&&rt.footerCell||this._columns.some(m=>{var F;return!!(m.footerCell||(F=m.cells)!=null&&F.footerCell)})?n.createElement(ks,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",ref:m=>this._footer=m,row:n.createElement(Ns,{cells:this.props.cells,columns:this._columns,isRtl:this.isRtl,ariaRowIndex:J+1}),cols:u.map(Zt)}):null,et=n.createElement("colgroup",{ref:m=>{this.columnResize.colGroupMain=m}},u.map((m,F)=>n.createElement("col",{key:F.toString(),className:Jt(m.field)?"k-sorted":void 0,width:Ee(m)}))),tt=this.dragLogic.reorderable||this.dragLogic.groupable,st=this.props.columnVirtualization?"block":"table";if(this.props.scrollable==="none")return n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:this.props.style,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:g.classNames("k-table k-grid-table",{[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),style:{userSelect:c,display:st}},et,Y,n.createElement("tbody",{role:"rowgroup",className:"k-table-tbody",...C.tableKeyboardNavigationBodyAttributes},he),Ze)),ve&&Ye,tt&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue}))),b,this.props.pageable&&Je);let de=this.props.style||{};return this.props.scrollable==="virtual"&&(de.height||(de=Object.assign({},de,{height:"450px"}))),n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:de,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size,"k-grid-virtual":this.props.scrollable==="virtual"},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement("div",{className:"k-grid-aria-root",role:"grid","aria-colcount":u.length,"aria-rowcount":t,id:this._gridId},Y,n.createElement("div",{className:"k-grid-container",role:"presentation"},n.createElement("div",{ref:this.containerRef,className:"k-grid-content k-virtual-content",onScroll:this.scrollHandler,role:"presentation"},n.createElement("div",{className:"k-grid-table-wrap",role:"presentation"},n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:g.classNames("k-table k-grid-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),role:"presentation",style:{userSelect:c,display:st}},et,n.createElement("tbody",{className:"k-table-tbody",ref:this.tableBodyRef,role:"rowgroup",...C.tableKeyboardNavigationBodyAttributes},he))),ve&&Ye),n.createElement("div",{className:"k-height-container",role:"presentation"},n.createElement("div",{style:this.props.scrollable==="virtual"?{height:this.vs.containerHeight+"px"}:{}})))),Ze,tt&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue})),this.showLicenseWatermark&&n.createElement(g.WatermarkOverlay,null)),b,this.props.pageable&&Je))}selectionChange(t){if(this.props.onSelectionChange){const{event:s,dataItem:o,dataIndex:e,columnIndex:i}=t,{mode:l,cell:a}=C.getSelectionOptions(this.props.selectable),c={...this.getArguments(s.syntheticEvent),dataItem:o,startColIndex:i,endColIndex:i,startRowIndex:e,endRowIndex:e,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:a,isDrag:!1,componentId:this._gridId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,c)}}raiseDataEvent(t,s,o,e,i){const l=this.props.onDataStateChange;if(t){const a={...this.getArguments(e),...s,targetEvent:i};t.call(void 0,a)}else l&&l.call(void 0,{...this.getArguments(e),targetEvent:i||{},dataState:{...this.getDataState(),...o}})}columnReorder(t,s,o){const e=this._columns[t],i=e.depth,l=d=>{do d++;while(d<this._columns.length&&this._columns[d].depth>i);return d},a=this._columns.splice(t,l(t)-t);this._columns.splice(t<s?l(s-a.length):s,0,...a),this._columns.filter(d=>d.declarationIndex>=0).forEach((d,f)=>d.orderIndex=f),this._columnsMutations++;const c=this._columns[t].locked&&this._columns[s].locked;C.updateLeft(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),C.updateRight(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),this._resized&&(this._shouldUpdateLeftRight=!1,this._resized=!1);const h=this.columns;if(this.forceUpdate(),this.props.onColumnReorder){const d={target:this,columns:h,columnId:e.id,nativeEvent:o};this.props.onColumnReorder.call(void 0,d)}}groupReorder(t,s,o){if(this.props.group===void 0)return;const e=this.props.group.slice();e.splice(s,0,...e.splice(t,1)),this.groupChange(e,o)}columnToGroup(t,s,o){const e=this._columns[t].field;if(!e)return;const i=(this.props.group||[]).slice();i.splice(s,0,{field:e}),this.groupChange(i,o)}resetTableWidth(){let t=0;if(!this.columnResize.colGroupMain)return;const s=this.columnResize.colGroupMain.children;for(let o=0;o<s.length;o++){const e=s[o].width;if(!e)return;t+=parseFloat(e.toString())}t=Math.round(t),this._header&&this._header.setWidth(t),this._footer&&this._footer.setWidth(t),this.tableElement&&(this.tableElement.style.width=t+"px")}initColumns(t,s){const o=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this._columns=this.readColumns(t,o,this._columnsMutations),this._columns.length===0&&(this._columns=os(this.props.data,this.props.group,this.props.expandField,{prevId:0,idPrefix:o})),this.configureColumns(this._columns,s,o),this._columnsMap=this.mapColumns(this._columns),this.columnResize.columns=this._columns,this.dragLogic.columns=this._columns}getDataState(){return{filter:this.props.filter,sort:this.props.sort,skip:this.props.skip,take:this.props.take!==void 0?this.props.take:this.props.pageSize,group:this.props.group}}getArguments(t){return{nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:this}}};X.displayName="KendoReactGrid";X.defaultProps={};X.propTypes={data:p.oneOfType([p.array,p.shape({data:p.array,total:p.number})]),sortable:p.oneOfType([p.bool,p.shape({mode:p.oneOf(["single","multiple"]),allowUnsort:p.bool})]),onSortChange:p.func,sort:p.array,filterable:p.bool,filter:p.any,onFilterChange:p.func,pageable:p.oneOfType([p.bool,p.shape({buttonCount:p.number,responsive:p.bool,info:p.bool,type:p.oneOf(["numeric","input"]),pageSizes:p.oneOfType([p.bool,p.arrayOf(p.oneOfType([p.string,p.number]))]),previousNext:p.bool})]),pageSize:p.number,onPageChange:p.func,total:p.number,skip:p.number,take:p.number,fixedScroll:p.bool,onExpandChange:p.func,expandField:p.string,selectedField:p.string,onSelectionChange:p.func,onHeaderSelectionChange:p.func,resizable:p.bool,reorderable:p.bool,group:p.any,groupable:p.oneOfType([p.bool,p.shape({enabled:p.bool,footer:p.oneOf(["always","visible","none"])})]),onGroupChange:p.func,onRowClick:p.func,onRowDoubleClick:p.func,onItemChange:p.func,editField:p.string,scrollable:p.oneOf(["none","scrollable","virtual"]),rowHeight:p.number,detailRowHeight:p.number,detail:p.any,style:p.object,onDataStateChange:p.func,onColumnResize:p.func,onColumnReorder:p.func,dataItemKey:p.string,navigatable:p.bool,size:p.oneOf(["small","medium"])};X.contextType=C.TableKeyboardNavigationContext;class le extends n.Component{render(){const{children:t}=this.props;return n.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-wrapper",this.props.className),style:this.props.style},t)}}class $ extends n.Component{render(){const{title:t,iconClass:s,svgIcon:o,selected:e}=this.props;return n.createElement("div",{onClick:this.props.onClick,className:`k-columnmenu-item ${e?"k-selected":""}`},(s||o)&&n.createElement(g.IconWrap,{name:s&&g.toIconName(s),icon:o}),t)}}class Ve extends n.Component{constructor(){super(...arguments),this.onGroupClick=t=>{if(t.preventDefault(),this.props.onGroupChange){const{column:s}=this.props;if(!s.field)return;const o=(this.props.group||[]).slice(),e=o.findIndex(i=>i.field===s.field);e>-1?o.splice(e,1):o.push({field:s.field}),this.props.onGroupChange(o,t)}this.props.onCloseMenu&&this.props.onCloseMenu()}}render(){const{group:t,column:s}=this.props,o=I.provideLocalizationService(this),e=!!(t&&s.field&&t.find(l=>l.field===s.field)),i=e?xt:vt;return n.createElement(le,null,n.createElement($,{title:o.toLanguageString(i,S[i]),iconClass:e?"k-i-ungroup":"k-i-group",svgIcon:e?w.ungroupIcon:w.groupIcon,onClick:this.onGroupClick}))}}I.registerForIntl(Ve);I.registerForLocalization(Ve);const Bt="asc",Wt="desc",Ms={true:{asc:{asc:"",desc:"desc"},desc:{asc:"asc",desc:""},"":{asc:"asc",desc:"desc"}},false:{asc:{asc:"asc",desc:"desc"},desc:{asc:"asc",desc:"desc"},"":{asc:"asc",desc:"desc"}}},Kt=(r,t)=>t?t.findIndex(s=>s.field===r):-1,Vt=(r,t)=>!!(t&&r>-1&&t[r].dir===Bt),qt=(r,t)=>!!(t&&r>-1&&t[r].dir===Wt);class me extends n.Component{constructor(){super(...arguments),this.onAscClick=t=>{this.onSort(t,Bt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onDescClick=t=>{this.onSort(t,Wt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onSort=(t,s)=>{if(t.preventDefault(),!this.props.onSortChange)return;const{column:o,sortable:e,sort:i}=this.props,{allowUnsort:l,mode:a}=Nt(e||!1,!1),c=(i||[]).filter(f=>f.field===o.field)[0],h=Ms[l][c&&c.dir||""][s],d=a==="single"?[]:(this.props.sort||[]).filter(f=>f.field!==o.field);h!==""&&o.field&&d.push({field:o.field,dir:h}),this.props.onSortChange(d,t)}}render(){const{sort:t,column:s}=this.props,o=Kt(s.field,t),e=I.provideLocalizationService(this);return n.createElement(le,null,n.createElement($,{title:e.toLanguageString(Re,S[Re]),iconClass:"k-i-sort-asc-sm",svgIcon:w.sortAscSmallIcon,selected:Vt(o,t),onClick:this.onAscClick}),n.createElement($,{title:e.toLanguageString(Ne,S[Ne]),iconClass:"k-i-sort-desc-sm",svgIcon:w.sortDescSmallIcon,selected:qt(o,t),onClick:this.onDescClick}))}}me.active=(r,t)=>{const s=Kt(r,t);return qt(s,t)||Vt(s,t)};I.registerForIntl(me);I.registerForLocalization(me);class qe extends n.Component{render(){return n.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},n.createElement(rs.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}class _e extends n.Component{constructor(t){super(t),this.renderOperatorEditor=()=>{if(this.props.filterType==="boolean")return;const s=this.props.operators.find(o=>o.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{value:s,onChange:this.operatorChange,data:this.props.operators,textField:"text"})},this.inputChange=this.inputChange.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){return n.createElement(n.Fragment,null,this.renderOperatorEditor(),this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues))}inputChange(t,s){Tt(t,s,this.props)}operatorChange(t){zt(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Mt(t,this.props.onChange)}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(M.NumericTextBox,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},rangeOnEnter:!1});case"date":return n.createElement(Ae.DatePicker,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)}});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text"})}default:return n.createElement(M.Input,{value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)}})}}}class Ut extends n.Component{render(){const{firstFilterProps:t,hideSecondFilter:s,secondFilterProps:o,logicData:e,logicValue:i,onLogicChange:l}=this.props;return n.createElement(n.Fragment,null,n.createElement(_e,{...t}),!s&&n.createElement(n.Fragment,null,n.createElement(ie.DropDownList,{data:e,value:i,onChange:l,className:"k-filter-and",textField:"text"}),n.createElement(_e,{...o})))}}const ue=r=>r||{filters:[],logic:"and"},re=(r,t)=>ue(t).filters.filter(e=>pe.isCompositeFilterDescriptor(e)?e.filters&&e.filters.length&&e.filters.length<=2&&!e.filters.find(i=>pe.isCompositeFilterDescriptor(i)||i.field!==r):!1)[0]||null;class Ue extends n.Component{constructor(t){super(t),this.removeGroup=(o,e)=>{const i=[...e.filters],l=i.findIndex(a=>a===o);return l>-1&&i.splice(l,1),{...e,filters:i}},this.insertGroup=(o,e)=>({...e,filters:[o,...e.filters]}),this.isControlled=()=>this.props.expanded!==void 0,this.onFilterExpand=()=>{const o=this.isControlled(),e=!(o?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(e),o||this.setState({expanded:e})},this.firstFilterChange=o=>{this.filterChange(0,o)},this.secondFilterChange=o=>{this.filterChange(1,o)},this.filterChange=(o,e)=>{const i=this.state.filterGroup.filters.map((l,a)=>a===o?{...l,value:e.value,operator:e.operator}:l);this.setState({filterGroup:{...this.state.filterGroup,filters:i}})},this.logicChange=o=>{this.setState({filterGroup:{...this.state.filterGroup,logic:o.target.value.operator}})},this.clear=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ue(this.props.filter),l=re(e,this.props.filter),a=i.filters.filter(c=>c!==l);a.length?this.props.onFilterChange({...i,filters:a},o):this.props.onFilterChange(null,o),this.props.onCloseMenu&&this.props.onCloseMenu()},this.currentFilterGroup=()=>({...this.state.filterGroup,filters:this.state.filterGroup.filters.filter(o=>o.value!==void 0&&o.value!==null&&o.value!==""||o.value===null&&o.operator)}),this.submit=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ue(this.props.filter),l=re(e,this.props.filter),a=this.currentFilterGroup();let c=null;if(l&&a.filters.length>0){const h=i.filters.map(d=>d===l?a:d);c={...i,filters:h}}else if(a.filters.length===0){const h=i.filters.filter(d=>d!==l);h.length&&(c={...i,filters:h})}else c={...i,filters:[...i.filters,a]};this.props.onFilterChange(c,o),this.props.onCloseMenu&&this.props.onCloseMenu()};let s;if(t.column&&t.column.field){const o=Oe(t.column.filter),e=Gt(t.filterOperators,o);s=re(t.column.field,t.filter),s=s?{...s,filters:s.filters.map(i=>({...i}))}:{logic:"and",filters:[{field:t.column.field,operator:e,value:O(e)?null:void 0},{field:t.column.field,operator:e,value:O(e)?null:void 0}]},s.filters.filter(i=>i.field===t.column.field).length===1&&s.filters.splice(1,0,{field:t.column.field,operator:e})}this.state={expanded:t.expanded||!1,filterGroup:s}}render(){const{column:t,filterUI:s,hideSecondFilter:o,filterOperators:e}=this.props;if(!t||!t.field)return n.createElement("div",null);const i=Oe(t.filter),l=o!==void 0?o:vs[i],a=I.provideLocalizationService(this),c=this.state.filterGroup.filters,h=se(e[i],a),d=se(We,a),f={field:t.field,value:c[0].value,operator:c[0].operator,operators:h,booleanValues:d,onChange:this.firstFilterChange,filterType:i},b={field:t.field,value:c[1].value,operator:c[1].operator,operators:h,booleanValues:d,onChange:this.secondFilterChange,filterType:i},u=this.state.filterGroup.logic,x=se(Cs,a),y={value:x.find(z=>z.operator===(u===null?"":u)),onChange:this.logicChange,data:x},v=s,k={firstFilterProps:f,secondFilterProps:b,logicData:y.data,logicValue:y.value,onLogicChange:y.onChange,hideSecondFilter:l},R=this.currentFilterGroup().filters.length!==0||O(c[0].operator)||O(c[1].operator),E=this.isControlled()?this.props.expanded:this.state.expanded,P=this.props.alwaysExpand;return n.createElement(le,null,!P&&n.createElement($,{title:a.toLanguageString(ne,S[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(qe,{show:P||!!E},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear,onKeyDown:z=>z.stopPropagation()},n.createElement("div",{className:"k-filter-menu-container"},v?n.createElement(v,{...k}):n.createElement(Ut,{...k}),n.createElement("div",{className:"k-actions k-actions-stretched"},n.createElement(B.Button,{themeColor:"primary",disabled:!R},a.toLanguageString(oe,S[oe])),n.createElement(B.Button,{type:"reset"},a.toLanguageString(K,S[K])))))))}}Ue.active=(r,t)=>!!re(r,t);I.registerForLocalization(Ue);const zs=(r,t)=>r.length!==t.length?!1:r.every((s,o)=>s===t[o]);class $e extends n.Component{constructor(t){super(t),this.defaultFilter=()=>this.props.filter?g.clone(this.props.filter):{filters:[],logic:"and"},this.isControlled=()=>this.props.expanded!==void 0,this.parseData=(s,o)=>{const e=this.props.column.field||"",i=s.map(l=>L(e,l));return o?i.filter((l,a)=>i.indexOf(l)===a):i},this.getFilterIndex=()=>{const s=this.props.column.field;return this.defaultFilter().filters.findIndex(i=>i.filters&&i.filters.length>0&&i.filters[0].field===s)},this.onFilterExpand=()=>{const s=this.isControlled(),o=!(s?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(o),s||this.setState({expanded:o})},this.handleSearchChange=s=>{const o=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",e={logic:"and",filters:[{field:this.props.column.field,operator:o,value:s.target.value,ignoreCase:!0}]};this.setState({value:s.target.value,data:this.parseData(pe.filterBy(this.props.data||[],e),this.props.uniqueData)})},this.handleClear=()=>{const s=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",o={logic:"and",filters:[{field:this.props.column.field,operator:s,value:"",ignoreCase:!0}]};this.setState({value:"",data:this.parseData(pe.filterBy(this.props.data||[],o),this.props.uniqueData)})},this.clear=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;o!==null&&o.filters.length>0?(this.compositeFilterIndex>=0&&o.filters.splice(this.compositeFilterIndex,1),this.props.onFilterChange(o,s)):this.props.onFilterChange(null,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.submit=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;this.props.onFilterChange(o,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.handleCheckBoxChange=(s,o)=>{const e=this.props.column.field||"",i={...this.state.currentFilter},l=[...this.state.currentFilter.filters];let a=[];if(this.compositeFilterIndex!==-1&&i.filters[this.compositeFilterIndex].filters&&o!=="all"&&(a=i.filters[this.compositeFilterIndex].filters),s.value&&o==="all")this.state.data.forEach(c=>{a.push({field:e,operator:"eq",value:c})});else if(s.value)a.push({field:e,operator:"eq",value:o});else if(this.state.currentFilter){const c=a.findIndex(h=>h.value===o);a.splice(c,1)}i.logic="and",this.compositeFilterIndex!==-1?l[this.compositeFilterIndex]={logic:"or",filters:a}:l.push({logic:"or",filters:a}),(!s.value&&o==="all"||a.length===0)&&l.splice(this.compositeFilterIndex,1),i.filters=l,this.setState({currentFilter:i})},this.isAllSelected=()=>{let s=!1;if(this.state.currentFilter){const o=[...this.state.currentFilter.filters];return this.compositeFilterIndex===-1?!1:(s=this.state.data.every(e=>this.compositeFilterIndex!==-1&&o[this.compositeFilterIndex].filters?o[this.compositeFilterIndex].filters.findIndex(l=>l.value===e)>=0:!1),s)}return s},this.compositeFilterIndex=this.getFilterIndex(),this.state={expanded:t.expanded||!1,value:"",data:this.parseData(this.props.data,this.props.uniqueData)||[],dataFromProps:this.parseData(this.props.data,!1)||[],currentFilter:this.defaultFilter()}}componentDidUpdate(){const t=this.props.column.field||"",s=this.props.data.map(o=>L(t,o));zs(s,this.state.dataFromProps)||this.setState({data:s,dataFromProps:s})}render(){const{column:t}=this.props;if(!t||!t.field)return n.createElement("div",null);const s=I.provideLocalizationService(this),o=this.isControlled()?this.props.expanded:this.state.expanded,e=[];if(this.state.currentFilter){const a=[...this.state.currentFilter.filters];this.compositeFilterIndex=a.findIndex(c=>c.filters&&c.filters.length>0?c.filters[0].field===t.field:!1),this.compositeFilterIndex!==-1&&a[this.compositeFilterIndex].filters.length>0&&a[this.compositeFilterIndex].filters.forEach(c=>{c.field===this.props.column.field&&e.push(c.value)})}const i=this.props.searchBox?n.createElement(this.props.searchBox,{value:this.state.value,onChange:this.handleSearchChange}):n.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},n.createElement(g.IconWrap,{className:"k-input-icon",name:"search",icon:w.searchIcon}),n.createElement(M.Input,{className:"k-input-inner",type:"text",placeholder:s.toLanguageString(Fe,S[Fe]),value:this.state.value,onChange:a=>this.handleSearchChange(a.nativeEvent)}),n.createElement(B.Button,{type:"button",rounded:null,className:"k-input-button",onClick:this.handleClear,icon:"x",svgIcon:w.xIcon})),l=e.filter((a,c)=>e.indexOf(a)===c);return n.createElement(le,null,n.createElement($,{title:s.toLanguageString(ne,S[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(qe,{show:!!o},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear},n.createElement("div",{className:"k-filter-menu-container"},i,n.createElement("ul",{className:"k-reset k-multicheck-wrap"},n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(M.Checkbox,{label:s.toLanguageString(De,S[De]),onChange:a=>this.handleCheckBoxChange(a,"all"),checked:this.isAllSelected()})),this.state.data.map((a,c)=>n.createElement("li",{className:"k-item",key:c},n.createElement(M.Checkbox,{label:String(a),onChange:h=>this.handleCheckBoxChange(h,a),checked:l.includes(a)})))),n.createElement("div",{className:"k-filter-selected-items"},l.length+" "+s.toLanguageString(Ge,S[Ge])),n.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},n.createElement(B.Button,{themeColor:"primary",type:"submit"},s.toLanguageString(oe,S[oe])),n.createElement(B.Button,{className:"k-button",type:"reset"},s.toLanguageString(K,S[K])))))))}}$e.defaultProps={uniqueData:!0};I.registerForLocalization($e);const $t=r=>{const[t,s]=n.useState(""),o=n.useMemo(()=>new Set(r.columnsState.map(u=>u.id)),[r.columnsState]),e=n.useMemo(()=>r.columns.filter(u=>{var x;return(x=u.title||u.field)==null?void 0:x.toLowerCase().includes(t.toLowerCase())}),[r.columns,t]),[i,l]=n.useState(r.columns.map(u=>o.has(u.id))),a=n.useCallback(()=>{const u=r.columns.filter((x,y)=>i[y]);r.onColumnsChange.call(void 0,u),r.onCloseMenu.call(void 0)},[i,r.columns,r.onColumnsChange,r.onCloseMenu]),c=n.useCallback(()=>{l(r.columns.map(u=>o.has(u.id)))},[o,r.columns]),h=i.filter(u=>u).length,d=h===i.length,f=n.useCallback(()=>{l(r.columns.map((u,x)=>d&&x===0?!0:!d))},[r.columns,d]),b=n.useCallback((u,x)=>{const y=i.slice();y[x]=u,l(y)},[i]);return n.createElement("form",{className:"k-filter-menu"},n.createElement("div",{className:"k-filter-menu-container"},n.createElement(M.TextBox,{className:"k-searchbox",value:t,onChange:u=>s(String(u.target.value)),prefix:()=>n.createElement(M.InputPrefix,null,n.createElement(g.IconWrap,{name:"search",icon:w.searchIcon}))}),n.createElement("ul",{className:"k-reset k-multicheck-wrap"},!t&&n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(M.Checkbox,{checked:d,onChange:f,label:"(Select all)"})),e.map((u,x)=>n.createElement("li",{key:u.id,className:"k-item"},n.createElement(M.Checkbox,{disabled:i[x]&&h===1,checked:i[x],onChange:y=>{var v;return b(!!((v=y.target.element)!=null&&v.checked),x)},label:u.title||u.field})))),n.createElement("div",{className:"k-filter-selected-items"},h," selected items"),n.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},n.createElement(B.Button,{type:"button",themeColor:"primary",onClick:a},"Apply"),n.createElement(B.Button,{type:"button",onClick:c},"Reset"))))};$t.displayName="GridColumnMenuColumnsList";class Ls extends n.Component{render(){return null}}class jt extends n.Component{render(){return n.createElement("div",{className:g.classNames("k-toolbar k-grid-toolbar",{"k-toolbar-md":!this.props.size,[`k-toolbar-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),"aria-label":this.props.ariaLabel,"aria-controls":this.props.ariaControls,role:"toolbar"},this.props.children)}}jt.displayName="KendoReactGridToolbar";const Xt=r=>{const{data:t=[]}=r;return n.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},t.map((s,o)=>n.createElement("div",{key:o},n.createElement("span",{className:"k-selection-aggregates-item-text"},s.type,": "),n.createElement("span",{className:"k-selection-aggregates-item-value"},s.formattedValue))))};Xt.displayName="KendoReactGridStatusBar";const Yt=r=>{var s;const t=r.slice();for(let o=0;o<t.length;o++)for(;t[o]&&((s=t[o].children)!=null&&s.length);)t.splice(o,1,...t[o].children);return t},Hs=r=>{const{dataItems:t,target:s,selectedField:o}=r,i=Yt(s.columns).map(v=>v.field).filter(v=>v&&typeof v=="string").map(v=>g.getter(v)),l=g.getter(o),a={dates:[],numbers:[],booleans:[],others:[]},c=v=>{typeof v=="number"?a.numbers.push(v):typeof v=="boolean"?a.booleans.push(v):v instanceof Date?a.dates.push(v):a.others.push(v)};t.forEach(v=>{const k=l(v);k&&k.forEach(R=>{c(i[R](v))})});const h=a.dates.map(v=>v.getTime()),d=a.booleans.filter(v=>v).length,f=a.booleans.filter(v=>!v).length,b=a.numbers.length?a.numbers.reduce((v,k)=>v+=k,0):void 0,u={sum:b,average:typeof b=="number"?b/a.numbers.length:void 0,min:a.numbers.length?Math.min(...a.numbers):void 0,max:a.numbers.length?Math.max(...a.numbers):void 0,count:a.numbers.length+a.booleans.length+a.dates.length+a.others.length,isTrue:d>0?d:void 0,isFalse:f>0?f:void 0,earliest:a.dates.length?new Date(Math.min(...h)):void 0,latest:a.dates.length?new Date(Math.max(...h)):void 0},x=(v,k)=>(k==="sum"||k==="average")&&typeof v=="number"?v.toFixed(2):(k==="earliest"||k==="latest")&&v instanceof Date?v.toLocaleDateString():String(v),y=[];return Object.keys(u).forEach(v=>{const k=v,R=u[k];R!==void 0&&y.push({type:k,value:R,formattedValue:x(R,k)})}),y},Qt=g.withIdHOC(X);Qt.displayName="KendoReactGrid";Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>C.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>C.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>C.setSelectedState});exports.GRID_COL_INDEX_ATTRIBUTE=U;exports.GRID_ROW_INDEX_ATTRIBUTE=wt;exports.Grid=Qt;exports.GridCell=_t;exports.GridClassComponent=X;exports.GridColumn=j;exports.GridColumnMenuCheckboxFilter=$e;exports.GridColumnMenuColumnsList=$t;exports.GridColumnMenuFilter=Ue;exports.GridColumnMenuFilterCell=_e;exports.GridColumnMenuFilterUI=Ut;exports.GridColumnMenuGroup=Ve;exports.GridColumnMenuItem=$;exports.GridColumnMenuItemContent=qe;exports.GridColumnMenuItemGroup=le;exports.GridColumnMenuSort=me;exports.GridColumnMenuWrapper=Be;exports.GridCommonDragLogic=Pt;exports.GridDetailRow=Ls;exports.GridEditCell=Rt;exports.GridFilterCell=Ke;exports.GridGroupCell=Pe;exports.GridHeaderCell=Ft;exports.GridHierarchyCell=yt;exports.GridNoRecords=fe;exports.GridRow=At;exports.GridSelectionCell=pt;exports.GridToolbar=jt;exports.StatusBar=Xt;exports.booleanFilterValues=We;exports.filterGroupByField=re;exports.getStatusData=Hs;exports.gridMessages=S;exports.leafColumns=Yt;exports.operators=He;exports.pagerFirstPage=gt;exports.pagerInfo=ut;exports.pagerItemPerPage=bt;exports.pagerLastPage=Ct;exports.pagerNextPage=mt;exports.pagerPreviousPage=ft;exports.rootFilterOrDefault=ue;
5
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ts=require("react"),p=require("prop-types"),g=require("@progress/kendo-react-common"),C=require("@progress/kendo-react-data-tools"),I=require("@progress/kendo-react-intl"),w=require("@progress/kendo-svg-icons"),M=require("@progress/kendo-react-inputs"),Ae=require("@progress/kendo-react-dateinputs"),ss=require("@progress/kendo-react-popup"),B=require("@progress/kendo-react-buttons"),ie=require("@progress/kendo-react-dropdowns"),pe=require("@progress/kendo-data-query"),rs=require("@progress/kendo-react-animation");function is(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const n=is(ts),j=r=>null;j.displayName="KendoReactGridColumn";j.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};j.propTypes={field:p.string,title:p.string,editable:p.bool,sortable:p.oneOfType([p.bool,p.shape({allowUnsort:p.bool.isRequired})]),cell:p.any,filterCell:p.any,filterTitle:p.string,filterable:p.bool,filter:p.oneOf(["text","numeric","boolean","date"]),editor:p.oneOf(["text","numeric","boolean","date"]),width:p.oneOfType([p.string,p.number]),minResizableWidth:p.number,headerCell:p.any,footerCell:p.any,headerSelectionValue:p.bool,format:p.string,headerClassName:p.string,className:p.string,reorderable:p.bool,resizable:p.bool,orderIndex:p.number,groupable:p.bool,columnMenu:p.any,locked:p.bool};function L(r,t){const s=(r||"").split(".");let o=t;return s.forEach(e=>{o=o?o[e]:void 0}),o}function pt(r,t,s,o,e,i,l=0){let a=l;for(let c=0;c<t.length;c++){if(!e||t[c].value===void 0||t[c].items===void 0){r[r.length]={dataIndex:o.index,dataItem:t[c],rowType:"data",level:l,expanded:i===void 0||L(i,t[c])},o.index++;continue}a=Math.max(a,l+1);const h=i===void 0||L(i,t[c])===void 0||L(i,t[c]);r[r.length]={dataIndex:-1,dataItem:t[c],level:l,rowType:"groupHeader",expanded:h},h&&(a=Math.max(pt(r,t[c].items,s,o,e,i,l+1),a)),(s==="always"||h&&s==="visible")&&(r[r.length]={dataIndex:-1,dataItem:t[c],rowType:"groupFooter",level:l,expanded:h})}return a}function ut(r,t,s,o=0){let e=[];if(!r)return[];r&&r.length===void 0&&(r=[r]),r.forEach((l,a)=>{l=l.props?l.props:l;const c=t[a]||null,h=ut(l.children,c&&c.children||[],s,o+1);e.push(Object.assign({depth:o},j.defaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},c?{width:c.width,orderIndex:c.orderIndex}:{},l,{id:l.id?l.id:C.tableKeyboardNavigationTools.generateNavigatableId(`${s.prevId++}`,s.idPrefix,"column"),declarationIndex:e.length,children:h,rowSpan:0,colSpan:0,isAccessible:!0,left:c&&Math.floor(c.left),right:c&&Math.floor(c.right)}))});const i=(l,a)=>l.orderIndex===a.orderIndex?l.declarationIndex-a.declarationIndex:(l.orderIndex||0)-(a.orderIndex||0);if(e.sort(i),o===0){let l=[];const a=(c,h)=>c.forEach(d=>{d.parentIndex=h,a(d.children,l.push(d)-1)});return a(e,-1),l}return e}function os(r,t,s,o){let e=[];Array.isArray(r)?e=r:r&&(e=r.data);const i=[];if(e.length>0){let l=e[0];if(t)for(let c=0;c<t.length;c++)l=l.items&&l.items[0];Object.getOwnPropertyNames(l).forEach(c=>{c!==s&&i.push(Object.assign({id:C.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},j.defaultProps,{field:c}))})}return i}const ns=(r,t)=>{let s=r[t.parentIndex];for(;s;){if(s.footerCell)return!0;s=r[s.parentIndex]}return!1},ls=r=>r.filter(t=>ns(r,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),Ee=r=>r.width!==void 0?Math.floor(parseFloat(r.width.toString()))+"px":void 0,gt=r=>(r.sort((t,s)=>t.declarationIndex-s.declarationIndex),r.map(t=>{const{declarationIndex:s,parentIndex:o,depth:e,colSpan:i,rowSpan:l,index:a,kFirst:c,children:h,...d}=t;return h.length?{children:gt(h),...d}:d})),Ie=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),at=17895697,ge=(r,t)=>{if(!(!r&&!t))return t?r?{...r,...t,select:{...r.select||{},...t.select||{}},hierarchy:{...r.hierarchy||{},...t.hierarchy||{}},group:{...r.group||{},...t.group||{}},edit:{...r.edit||{},...t.edit||{}}}:t:r},ft=r=>{const t=n.useCallback(d=>{r.selectionChange&&r.selectionChange({syntheticEvent:d})},[r.selectionChange]),s=g.useId(),o=L(r.field,r.dataItem),e=C.useTableKeyboardNavigation(r.id),i={colSpan:r.colSpan,style:r.style,className:r.className,"aria-colindex":r.ariaColumnIndex,role:"gridcell",...e},l=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:typeof o=="boolean"&&o,id:s,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:t})),n.createElement("label",{className:"k-checkbox-label",htmlFor:s,key:2})],a=r.rowType!=="groupHeader"?n.createElement("td",{...i},l):null,c=r.rowType||"data",h=r.cells;if(h&&h.select&&h.select[c]){const d=h.select[c];return n.createElement(d,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,a,r):a},Se="grid.noRecords",mt="grid.pagerInfo",Ct="grid.pagerFirstPage",bt="grid.pagerPreviousPage",vt="grid.pagerNextPage",xt="grid.pagerLastPage",kt="grid.pagerItemsPerPage",as="grid.pagerPage",cs="grid.pagerPageSizeAriaLabel",hs="grid.pagerOf",ds="grid.pagerTotalPages",ye="grid.groupPanelEmpty",Et="grid.groupColumn",It="grid.ungroupColumn",we="grid.columnMenu",K="grid.filterClearButton",oe="grid.filterSubmitButton",ne="grid.filterTitle",Re="grid.sortAscending",Ne="grid.sortDescending",Fe="grid.searchPlaceholder",De="grid.filterCheckAll",Te="grid.filterChooseOperator",Ge="grid.filterSelectedItems",Me="grid.sortAriaLabel",ze="grid.filterAriaLabel",Le="grid.groupPanelAriaLabel",St="grid.groupExpand",yt="grid.groupCollapse",wt="grid.detailExpand",Rt="grid.detailCollapse",S={[wt]:"Expand detail row",[Rt]:"Collapse detail row",[St]:"Expand group",[yt]:"Collapse Group",[Se]:"No records available",[ye]:"Drag a column header and drop it here to group by that column",[K]:"Clear",[oe]:"Filter",[ne]:"Filter",[Re]:"Sort Ascending",[Ne]:"Sort Descending",[Me]:"Sortable",[Et]:"Group Column",[It]:"Ungroup Column",[we]:"Column menu",[kt]:"items per page",[mt]:"{0} - {1} of {2} items",[Ct]:"Go to the first page",[bt]:"Go to the previous page",[vt]:"Go to the next page",[xt]:"Go to the last page",[as]:"Page",[cs]:"Page size",[hs]:"of",[ds]:"{0}",[Fe]:"Search",[De]:"Check All",[Te]:"Choose Operator",[Ge]:"selected items",[ze]:"Filter",[Le]:"Group panel","grid.filterEqOperator":"Is equal to","grid.filterNotEqOperator":"Is not equal to","grid.filterIsNullOperator":"Is null","grid.filterIsNotNullOperator":"Is not null","grid.filterIsEmptyOperator":"Is empty","grid.filterIsNotEmptyOperator":"Is not empty","grid.filterStartsWithOperator":"Starts with","grid.filterContainsOperator":"Contains","grid.filterNotContainsOperator":"Does not contain","grid.filterEndsWithOperator":"Ends with","grid.filterGteOperator":"Is greater than or equal to","grid.filterGtOperator":"Is greater than","grid.filterLteOperator":"Is less than or equal to","grid.filterLtOperator":"Is less than","grid.filterIsTrue":"Is true","grid.filterIsFalse":"Is false","grid.filterBooleanAll":"(All)","grid.filterAfterOrEqualOperator":"Is after or equal to","grid.filterAfterOperator":"Is after","grid.filterBeforeOperator":"Is before","grid.filterBeforeOrEqualOperator":"Is before or equal to","grid.filterAndLogic":"And","grid.filterOrLogic":"Or"};function ps(r){const t=r.replace(/^pager\.([a-z])/,(s,o)=>"grid.pager"+o.toUpperCase());return{messageKey:t,defaultMessage:S[t]}}const Nt=r=>{let t=null,s=null,o=null;const e=L(r.field,r.dataItem),i=C.useTableKeyboardNavigation(r.id),l=I.useLocalization(),a=n.useCallback(d=>{d.isDefaultPrevented()||d.keyCode===g.Keys.enter&&r.onChange&&(d.preventDefault(),r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:d,field:r.field,value:!e}))},[r.dataItem,r.dataIndex,r.field,r.onChange,e]);if(r.rowType==="groupFooter")s={className:"k-table-td k-hierarchy-cell",role:"gridcell",...i},t=n.createElement("td",{...s});else if(r.rowType!=="groupHeader"){const d=e?Rt:wt,f=l.toLanguageString(d,S[d]);s={className:"k-table-td k-hierarchy-cell",onKeyDown:a,"aria-expanded":!!e,role:"gridcell","aria-colindex":r.ariaColumnIndex,...i},o=n.createElement("a",{onClick:b=>{b.preventDefault(),r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:b,field:r.field,value:!e})},"aria-label":f,href:"#",tabIndex:-1},n.createElement(g.IconWrap,{name:e?"minus":"plus",icon:e?w.minusIcon:w.plusIcon})),t=n.createElement("td",{...s},o)}const c=r.rowType||"data",h=r.cells;if(h&&h.hierarchy&&h.hierarchy[c]){const d=h.hierarchy[c];return n.createElement(d,{...r,tdProps:s},o)}return r.render?r.render.call(void 0,t,r):t},Ft=C.TABLE_ROW_INDEX_ATTRIBUTE,U=C.TABLE_COL_INDEX_ATTRIBUTE,Dt=r=>{const t=L(r.field,r.dataItem);let s=null;const o=g.classNames("k-table-td","k-grid-edit-cell",{["k-selected"]:r.isSelected},r.className),e=g.useId(),i=C.useTableKeyboardNavigation(r.id);let l=null,a=null;const c=n.useCallback(u=>{if(r.onChange){const x=u.target.type==="checkbox"?u.target.checked:u.target.value;r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u,value:x})}},[r.onChange,r.dataItem,r.dataIndex,r.field]),h=n.useCallback(u=>{r.onContextMenu&&r.onContextMenu.call(void 0,u,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),d=n.useCallback(u=>{r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u.syntheticEvent,value:u.value})},[r.onChange,r.dataItem,r.dataIndex,r.field]);switch(r.editor){case"numeric":{l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(M.NumericTextBox,{width:"100%",value:t===void 0?null:t,onChange:d}),s=n.createElement("td",{...l},a);break}case"date":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(Ae.DatePicker,{width:"100%",value:t,onChange:d}),s=n.createElement("td",{...l},a);break;case"boolean":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:t||!1,id:e,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:c})),n.createElement("label",{className:"k-checkbox-label",htmlFor:e,key:2})],s=n.createElement("td",{...l},a);break;default:l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement("input",{style:{width:"100%"},className:"k-input",value:t||"",onChange:c}),s=n.createElement("td",{...l},a)}const f=r.editor||"text",b=r.cells;if(b&&b.edit&&b.edit[f]){const u=b.edit[f];return n.createElement(u,{...r,tdProps:l},a)}return r.render?r.render.call(void 0,s,r):s};class us extends n.Component{constructor(){super(...arguments),this.headerWrap=null,this.table=null,this.syncScroll=!1,this.scrollbarWidth=g.getScrollbarWidth(),this.onScroll=t=>{if(this.syncScroll){this.syncScroll=!1;return}if(!this.headerWrap)return;const s=this.headerWrap.scrollLeft,o=this.props.scrollableDataElement();o&&o.scrollLeft!==s&&(o.scrollLeft=s)}}get element(){return this.props.elemRef.current}componentDidMount(){const t=C.isRtl(this.element);this.props.columnResize&&this.props.columnResize.setIsRtl(t),this.forceUpdate()}setScrollLeft(t){this.headerWrap&&this.headerWrap.scrollLeft!==t&&(this.syncScroll=!0,this.headerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{ref:this.props.elemRef,className:g.classNames("k-grid-header",{"k-grid-draggable-header":this.props.draggable}),role:"presentation"},n.createElement("div",{ref:t=>{this.headerWrap=t},className:"k-grid-header-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},onScroll:this.onScroll,role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-header-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupHeader=t}},this.props.cols),n.createElement("thead",{className:"k-table-thead",role:"rowgroup",...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)))):n.createElement("thead",{role:"presentation",className:g.classNames("k-table-thead",{"k-grid-draggable-header":this.props.draggable}),...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)}}const Tt=(...r)=>Object.assign({allowUnsort:!0,mode:"single"},...r);class gs extends n.PureComponent{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.pressHandler&&this.props.pressHandler(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.dragHandler&&this.props.dragHandler(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.releaseHandler&&this.props.releaseHandler(t.event)}}render(){return n.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,hint:this.props.dragClue,autoScroll:{boundaryElementRef:this.props.headerRef,direction:{horizontal:!0,vertical:!1}},scrollContainer:this.props.containerRef||void 0,ref:t=>{this.draggable=t}},n.createElement("tr",{className:"k-table-row",style:{touchAction:"none"},role:"row","aria-rowindex":this.props.ariaRowIndex},this.props.children))}}class Be extends n.Component{constructor(){super(...arguments),this.state={show:!1},this._anchor=null,this._content=null,this.blurTimeout=void 0,this.willBlur=!1,this.blur=()=>{if(this.willBlur){this.willBlur=!1;return}clearTimeout(this.blurTimeout),this.blurTimeout=window.setTimeout(()=>{this.closeMenu()})},this.focus=()=>{clearTimeout(this.blurTimeout)},this.anchorClick=t=>{t.preventDefault(),this.setState({show:!this.state.show},()=>this.state.show&&this._content&&this._content.focus())},this.closeMenu=()=>{this.setState({show:!1})},this.onAnchorMouseDown=t=>{this.willBlur=this.state.show&&t.currentTarget===this._anchor},this.onAnchorKeyDown=t=>{var s;if(t.keyCode===g.Keys.tab){const o=t.target,e=o&&((s=o.closest(".k-grid"))==null?void 0:s.getElementsByClassName("k-grid-content")[0]);e&&e.scrollWidth>e.clientWidth&&o.scrollIntoView({inline:"center"})}}}render(){const{columnMenu:t,...s}=this.props,{column:o}=this.props,e=I.provideLocalizationService(this),i=o.title||o.field,l=i?`${i} `:"";return n.createElement(n.Fragment,null,n.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:a=>this._anchor=a,onClick:this.anchorClick,onMouseDown:this.onAnchorMouseDown,onKeyDown:this.onAnchorKeyDown,href:"#","aria-label":`${l}${e.toLanguageString(we,S[we])}`},n.createElement(g.IconWrap,{name:"filter",icon:w.filterIcon})),n.createElement(ss.Popup,{anchor:this._anchor,show:this.state.show,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},n.createElement("div",{ref:a=>this._content=a,tabIndex:0,onBlur:this.blur,onFocus:this.focus,style:{outline:"none"}},t&&n.createElement(t,{...s,onCloseMenu:this.closeMenu}))))}}class Gt extends n.Component{render(){const{columnMenuWrapperProps:t}=this.props,s=this.props.onClick?{onClick:this.props.onClick}:{},o=n.createElement("span",{className:"k-cell-inner"},n.createElement("span",{className:g.classNames("k-link",{"!k-cursor-default":!this.props.columnMenuWrapperProps.sortable}),...s},n.createElement("span",{className:"k-column-title"},this.props.title||this.props.field||" "),this.props.children),t.columnMenu&&n.createElement(Be,{...t}));return this.props.render?this.props.render.call(void 0,o,this.props):o}}const fs={true:{asc:"desc",desc:"","":"asc"},false:{asc:"desc",desc:"asc","":"asc"}},ms={none:"none",asc:"ascending",desc:"descending"};class Mt extends n.Component{constructor(t){super(t),this.serviceIndex=0,this.index=-1,this.cellKeyDown=(s,o)=>{s.isDefaultPrevented()||s.keyCode===g.Keys.enter&&this.cellClick(s,o)},this.cells=s=>s.map(o=>{const e=this.props.columns[o],i=this.props.sortable&&e.sortable,l=this.props.sort?this.props.sort.findIndex(E=>E.field===e.field):-1,a=l>=0&&this.props.sort[l].dir||"none",c=e.columnMenu===null?null:e.columnMenu||this.props.columnMenu,h=g.classNames({"k-first":e.kFirst,"k-filterable":!!c,"k-table-th":!0,"k-header":!0,"k-grid-header-sticky":e.locked,"k-sorted":this.props.sort&&this.props.sort.some(E=>E.field===e.field)},e.headerClassName),d=e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},f=I.provideLocalizationService(this).toLanguageString(Me,S[Me]);let b=e.isAccessible?{ariaSort:ms[a],role:"columnheader",ariaColumnIndex:e.ariaColumnIndex,ariaSelected:!1,ariaDescription:i?f:""}:{role:"presentation"};const u=e.declarationIndex>=0?++this.index:--this.serviceIndex,x=e.headerCell?e.headerCell:Gt,y=n.createElement(x,{key:1,field:e.field,onClick:i&&(E=>this.cellClick(E,e))||void 0,selectionChange:this.props.selectionChange,title:e.title,selectionValue:e.headerSelectionValue,render:this.props.cellRender,children:this.sortIcon(l),columnMenuWrapperProps:{column:{field:e.field,title:e.title,locked:e.locked,filter:e.filter,id:e.id},sortable:i&&this.props.sortable,sort:this.props.sort,onSortChange:this.props.sortChange,filter:this.props.filter,filterable:this.props.filterable&&e.filterable,filterOperators:this.props.filterOperators,onFilterChange:this.props.filterChange,group:this.props.group,groupable:this.props.groupable,onGroupChange:this.props.groupChange,columnMenu:c}}),v={...b,key:u,colSpan:e.colSpan,rowSpan:e.rowSpan,className:h,style:d,columnId:e.id,navigatable:e.navigatable,onKeyDown:i&&(E=>this.cellKeyDown(E,e))||void 0,role:"columnheader"},k=[y,this.props.columnResize&&this.props.columnResize.resizable&&e.resizable&&n.createElement(C.ColumnResizer,{key:2,resize:(E,P,z)=>this.props.columnResize&&this.props.columnResize.dragHandler(E,e,P,z),autofit:E=>this.props.columnResize&&this.props.columnResize.dblClickHandler(E,[e.id])})],R=ge(this.props.cells,e.cells);if(R&&R.headerCell){const E=R.headerCell;return n.createElement(E,{key:u,thProps:v,index:o},k)}return n.createElement(C.HeaderThElement,{...v,key:u},k)}),this.cellClick=this.cellClick.bind(this)}cellClick(t,s){if(t.preventDefault(),!this.props.sortChange)return;const{allowUnsort:o,mode:e}=Tt(this.props.sortable||!1,s.sortable||!1),i=(this.props.sort||[]).filter(c=>c.field===s.field)[0],l=fs[o][i&&i.dir||""],a=e==="single"?[]:(this.props.sort||[]).filter(c=>c.field!==s.field);l!==""&&s.field&&a.push({field:s.field,dir:l}),this.props.sortChange(a,t)}sortIcon(t){return this.props.sort?t>=0&&[n.createElement("span",{key:1,className:"k-sort-icon"},n.createElement(g.IconWrap,{name:"sort-"+this.props.sort[t].dir+"-small",icon:this.props.sort[t].dir==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon})),this.props.sort.length>1&&n.createElement("span",{key:2,className:"k-sort-icon"},n.createElement("span",{className:"k-sort-order"},t+1))]:null}render(){return this.serviceIndex=0,this.index=-1,this.props.columnsMap.map((t,s)=>this.props.pressHandler&&n.createElement(gs,{key:s,pressHandler:this.props.pressHandler,dragHandler:this.props.dragHandler,releaseHandler:this.props.releaseHandler,ariaRowIndex:s+1,dragClue:this.props.dragClue,headerRef:this.props.headerRef,containerRef:this.props.containerRef},this.cells(t))||n.createElement("tr",{key:s,className:"k-table-row",role:"row","aria-rowindex":s+1},this.cells(t)))}}I.registerForLocalization(Mt);const Cs=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],Oe={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},H=r=>r==="isnull"||r==="isnotnull"||r==="isempty"||r==="isnotempty",se=(r,t)=>r.map(s=>({text:t.toLanguageString(s.text,S[s.text]),operator:s.operator})),bs="eq",We=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],vs={text:!1,numeric:!1,date:!1,boolean:!0},Ke=(r,t,s)=>{const o=zt(s.operators);let e=s.operator;switch(s.filterType){case"numeric":(!e||H(e))&&(e=o),r===null&&e===o&&(e="");break;case"date":(!e||H(e))&&(e=o),r===null&&e===o&&(e="");break;case"text":(!e||H(e))&&(e=o),!r&&e===o&&(e="");break;default:return}s.onChange({value:r,operator:e,syntheticEvent:t})},zt=(r,t)=>t?r[t][0].operator:r[0].operator,He=r=>r||"text",Ve=(r,t)=>{const s=r.target.value;t({value:s.operator,operator:s.operator===""?"":bs,syntheticEvent:r.syntheticEvent})},qe=(r,t,s)=>{let o=t;const e=r.target.value;r.target.state.opened&&(H(e.operator)&&(o=null),t===null&&!H(e.operator)&&(o=void 0),s({value:o,operator:e.operator,syntheticEvent:r.syntheticEvent}))};class Ue extends n.Component{constructor(t){super(t),this._inputRef=n.createRef(),this.renderOperatorEditor=s=>{if(this.props.filterType==="boolean")return;const o=this.props.operators.find(e=>e.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{size:this.props.size,value:o,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:w.filterIcon,data:this.props.operators,textField:"text",title:s.toLanguageString(Te,S[Te]),popupSettings:{width:""}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const t=I.provideLocalizationService(this),s=n.createElement("div",{className:"k-filtercell"},n.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),n.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(t)," ",n.createElement(B.Button,{size:this.props.size,icon:"filter-clear",svgIcon:w.filterClearIcon,className:g.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:t.toLanguageString(K,S[K]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,s,this.props):s}inputChange(t,s){Ke(t,s,this.props)}operatorChange(t){qe(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Ve(t,this.props.onChange)}clear(t){t.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:t}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(M.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return n.createElement(Ae.DatePicker,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel})}default:return n.createElement(M.TextBox,{ref:this._inputRef,size:this.props.size,value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}I.registerForLocalization(Ue);const xs="k-table-row k-filter-row";class Lt extends n.Component{headerCellClassName(t,s){let o=`${s?"k-grid-header-sticky":""}`;return this.props.sort&&this.props.sort.filter(e=>e.field===t).length>0&&(o+=" k-sorted"),o}setFilter(t,s,o,e){if(!this.props.filterChange)return;const i=[];(t!==""&&t!==null||s!=="")&&i.push({field:o,operator:s,value:t}),this.props.filter&&this.props.filter.filters&&(this.props.filter.filters||[]).forEach(c=>{const h=c;h&&h.field!==o&&i.push(h)});const l=this.props.filter&&this.props.filter.logic?this.props.filter.logic:"and";this.props.filterChange(i.length>0?{logic:l,filters:i}:null,e)}render(){const t=I.provideLocalizationService(this),s=this.props.filter&&this.props.filter.filters||[],o=a=>{if(a===void 0)return;const c=s.filter(h=>h.field===a);return c.length?c[0]:void 0};let e=0,i=-1;const l=this.props.columns.filter(a=>a.children.length===0).map(a=>{const c=He(a.filter),h=o(a.field),d=a.filterable?t.toLanguageString(ze,S[ze]):void 0;let f=h&&h.value;f===void 0&&(f=c==="text"?"":null);const b=a.filterable&&{render:this.props.cellRender,field:a.field,title:a.filterTitle,value:f,operator:h&&h.operator,operators:se(this.props.filterOperators[c]||[],t),booleanValues:se(We,t),filterType:c,ariaLabel:d,onChange:E=>{this.setFilter(E.value,E.operator,a.field,E.syntheticEvent)}},u=a.declarationIndex>=0?++i:--e,x={ariaLabel:d,ariaColumnIndex:a.ariaColumnIndex},y=a.left!==void 0?this.props.isRtl?{left:a.right,right:a.left}:{left:a.left,right:a.right}:{},v={columnId:C.tableKeyboardNavigationTools.getFilterColumnId(a.id),navigatable:a.navigatable,style:y,className:g.classNames("k-table-th",this.headerCellClassName(a.field,a.locked)||void 0),role:"columnheader",...x},k=b&&(a.filterCell?n.createElement(a.filterCell,{...b}):n.createElement(Ue,{size:this.props.size,...b})),R=ge(this.props.cells,a.cells);if(R&&R.filterCell){const E=R.filterCell;return n.createElement(E,{key:u,...b,thProps:v,index:i},k)}return n.createElement(C.HeaderThElement,{key:u,...v},k)});return n.createElement("tr",{className:xs,"aria-rowindex":this.props.ariaRowIndex,role:"row"},l)}}I.registerForLocalization(Lt);class Ot extends n.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onPress&&this.props.onPress(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onDrag&&this.props.onDrag(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(t.event)},this.sortChange=t=>{if(t.preventDefault(),this.props.onSortChange){const s=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(t,s)}},this.groupRemove=t=>{t.preventDefault(),t.stopPropagation(),this.props.onRemove&&this.props.onRemove(t)},this.onContextMenu=t=>{const s={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,t,{dataItem:{...s}})}}render(){const{dir:t}=this.props;return n.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:s=>{this.draggable=s}},n.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},n.createElement("span",null,n.createElement(g.IconWrap,{name:"sort-"+t+"-small",icon:t==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon,size:"small"})),n.createElement("span",{className:"k-chip-content"},this.props.title),n.createElement("span",{className:"k-chip-actions"},n.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},n.createElement(g.IconWrap,{name:"x-circle",icon:w.xCircleIcon,size:"small"})))))}}I.registerForLocalization(Ot);class Ht extends n.Component{constructor(){super(...arguments),this.onGroupRemove=(t,s)=>{const o=this.props.group.slice();o.splice(s,1),this.props.groupChange(o,t)},this.onGroupSortChange=(t,s,o,e)=>{const i=Object.assign({},o,{dir:e}),l=this.props.group.slice();l.splice(s,1,i),this.props.groupChange(l,t)}}render(){const s=(this.props.group||[]).map((o,e)=>n.createElement(Ot,{key:e,index:e,dir:o.dir||"asc",title:this.props.resolveTitle(o.field),onRemove:i=>{this.onGroupRemove(i,e)},onSortChange:(i,l)=>{this.onGroupSortChange(i,e,o,l)},onPress:this.props.pressHandler,onDrag:this.props.dragHandler,onRelease:this.props.releaseHandler,onContextMenu:this.props.onContextMenu}));return n.createElement("div",{ref:this.props.refCallback,className:"k-grouping-header",role:"toolbar","aria-label":I.provideLocalizationService(this).toLanguageString(Le,S[Le]),"aria-controls":this.props.ariaControls||""},n.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},s),n.createElement("div",{className:"k-grouping-drop-container"},!s.length&&I.provideLocalizationService(this).toLanguageString(ye,S[ye])," "))}}I.registerForLocalization(Ht);class ks extends n.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=g.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(t){this.footerWrap&&(this.footerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{className:"k-grid-footer",role:"presentation"},n.createElement("div",{ref:t=>{this.footerWrap=t},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupFooter=t},role:"presentation"},this.props.cols),n.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):n.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}class Es{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.prevScrollPos=0,this.tableTranslate=0,this.scrollSyncing=!1,this.reactVersion=Number.parseFloat(n.version),this.topItems=(s,o)=>{if(!this.container||o)return{topItemsCount:0,topItemsHeight:0};const e=this.container.clientHeight,i=Math.ceil(e/s[0].line),l=Math.ceil((s.length-i)/2);let a=0;for(let c=0;c<l;c++)a+=s[c].line+s[c].acc;return{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:i+i/2}},this.horizontalScrollbarHeight=()=>this.container?this.container.offsetHeight-this.container.clientHeight:0,t&&(this.topCacheCount=4,this.attendedSkip=-this.topCacheCount),this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}get rowHeights(){const t=[],s=this.tableBodyRef.current&&this.tableBodyRef.current.children||[];let o=0;for(let e=0;e<s.length;e++){if(s[e].className.indexOf("k-grouping-row")>-1){o+=s[e].scrollHeight;continue}s[e].className.indexOf("k-detail-row")>-1?t[t.length-1].line+=s[e].scrollHeight:(t.push({line:s[e].scrollHeight,acc:o}),o=0)}return t}changePage(t,s){this.attendedSkip=t-this.topCacheCount,this.PageChange&&this.PageChange({skip:Math.max(0,t-this.topCacheCount),take:this.pageSize},s)}translate(t,s){this.tableTranslate=t,this.scrollableVirtual&&this.table&&(this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}localScrollUp(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount),h=o-e;if(!(h>a||s.length<=c)){for(;i<this.topCacheCount+this.attendedSkip-this.realSkip+l&&this.propsSkip-i>0&&!(e+(s[s.length-1-i].line+s[s.length-1-i].acc)+h<=o);)e-=s[s.length-1-i].line+s[s.length-1-i].acc,i++;if(i===0&&this.topCacheCount===0&&this.attendedSkip>0&&(e=Math.max(e-s[0].line,0),i=1),this.propsSkip-i<=0&&e>o){this.translate(0),this.changePage(0,t),this.container.scrollTop=0;return}if(e>o&&(e=o),e!==this.tableTranslate){this.translate(Math.max(0,e-a));const d=Math.max(0,this.propsSkip-i-l);this.changePage(d,t)}}}localScrollDown(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount);for(;i<s.length-this.topCacheCount&&!(e+s[i].line+s[i].acc>o);)e+=s[i].line+s[i].acc,i++;l>this.propsSkip+i||s.length<=c||(i>=s.length-this.topCacheCount&&this.propsSkip+i>=this.total?(this.translate(e-a),this.changePage(this.total-1-l,t)):e!==this.tableTranslate&&this.propsSkip+i-l!==this.propsSkip&&(this.translate(e-a),this.changePage(this.propsSkip+i-l,t)))}scrollNonStrict(t){const s=this.total*this.prevScrollPos/this.containerHeight;let o=Math.floor(s);o>=this.total&&(o=this.total-1);const e=Math.min(s-o,1);let i=0;const l=o-this.propsSkip,a=this.rowHeights;l>=0&&l<=1?i=-((a[0].line+a[0].acc)*e):l===-1&&(i=-((a[a.length-1].line+a[a.length-1].acc)*e));const{topItemsCount:c,topItemsHeight:h}=this.topItems(a,!!this.topCacheCount);this.translate(Math.max(0,i-h-this.horizontalScrollbarHeight()+this.containerHeight*s/this.total)),this.changePage(o-c,t)}scrollHandler(t){if(!this.scrollableVirtual)return;if(this.scrollSyncing||!this.container||!this.table){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.prevScrollPos;if(this.prevScrollPos=s,this.askedSkip!==void 0){this.translate(this.containerHeight*this.askedSkip/this.total),this.changePage(this.askedSkip,t),this.prevScrollPos=s,this.askedSkip=void 0;return}s-o<0&&s>this.tableTranslate-this.table.scrollHeight/10?this.localScrollUp(t):s-o>0&&s<this.tableTranslate+this.table.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t),this.prevScrollPos=s}}class ct{constructor(t=0,s,o,e){this.total=t,this.offsets=[],this.heights=[];let i=0;for(let l=0;l<t;l++){this.offsets.push(i);const a=e&&e[l].expanded&&e[l].rowType==="data"?o:s;i+=a,this.heights.push(a)}}height(t){return this.heights[t]}index(t){if(t<0)return;const s=this.offsets.reduce((o,e,i)=>{if(o!==void 0)return o;if(e===t)return i;if(e>t)return i-1},void 0);return s===void 0?this.total-1:s}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],s=this.heights[this.heights.length-1];return t+s}}class ht{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(n.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(t,s){this.scrollableVirtual&&this.table&&(Ie||this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}changePage(t,s){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},s)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(t){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.lastScrollTop>=s,e=!o;this.lastScrollTop=s;let i=this.rowHeightService.index(s),l=this.rowHeightService.offset(i);const{offsetHeight:a}=this.containerRef.current,c=this.rowHeightService.index(s+a);if(e&&c>=this.lastLoaded&&this.lastLoaded<this.total){const h=i+this.pageSize-this.total;h>0&&(i=i-h,l=this.rowHeightService.offset(i)),this.firstLoaded=i,this.translate(l);let d=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(d,this.total),this.changePage(this.firstLoaded,t)}else if(o&&i<this.firstLoaded){const h=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(i-h,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,t)}}}const Is=1,Ss=20;class ys{constructor(t){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=s=>{this.isRtl=s},this.dragHandler=(s,o,e,i)=>{const l=s.originalEvent;i||(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation());const a=e.closest("th");if(!a||!a)return;const c=a.clientWidth;let h=c;if(this.isRtl?h+=e.getBoundingClientRect().right-e.offsetWidth/2-s.clientX:h+=s.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!i&&Math.abs(h-c)<1)return;this.fixateInitialWidths(a.parentElement.clientWidth),this.setWidths(o,Math.floor(h)/c);const d=this.columns.filter(f=>!f.children.length).findIndex(f=>f.id===o.id);this.onResize(d,c,h,l,i,o.id)},this.dblClickHandler=(s,o)=>{const e=this.columns.filter(b=>o.indexOf(b.id)>-1);if(!this.colGroupMain||!e.length)return;const i={},l=e;for(;l.length>0;){const b=l.pop();if(!b)break;b.children.length?l.push(...b.children):i[b.id]=b}const a=this.columns.filter(b=>!b.children.length),c=[];a.forEach((b,u)=>{i[b.id]&&c.push(u)});const h=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),h.forEach(b=>b.classList.add("k-autofitting"));let f=[];d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width="",f[u]=Math.max(f[u]||0,b.children[u].offsetWidth+Is))})}),d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width=f[u]+"px",a[u].width=f[u])})}),h.forEach(b=>b.classList.remove("k-autofitting")),this.onResize(c[0],0,0,s,!0,o[0])},this.updateColElements=s=>{const o=this.columns.filter(i=>!i.children.length);let e=1e-10;for(let i=0;i<s.length;i++){const l=s[i],a=o.findIndex(f=>f.id===l.id),c=parseFloat((l.width||0).toString()),h=Math.floor(c);e+=c-h;const d=h+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[a]){const f=parseInt(this.colGroupMain.children[a].width,10);this.colGroupMain.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,l,f-d)}if(this.colGroupHeader&&this.colGroupHeader.children[a]){const f=parseInt(this.colGroupHeader.children[a].width,10);this.colGroupHeader.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,l,f-d)}if(this.colGroupFooter&&this.colGroupFooter.children[a]){const f=parseInt(this.colGroupFooter.children[a].width,10);this.colGroupFooter.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,l,f-d)}}},this.onResize=t}fixateInitialWidths(t){const s=this.columns.filter(l=>!l.children.length);let o=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let l=0;l<e.length;l++)e[l].width?t-=parseFloat(e[l].width):o++;if(o===0)return;const i=Math.floor(t/o);for(let l=0;l<e.length;l++){const a=e[l];a.width||(a.width=i,s[l].width=i.toString(),this.colGroupHeader&&(this.colGroupHeader.children[l].width=i),this.colGroupFooter&&(this.colGroupFooter.children[l].width=i))}}setWidths(t,s){const o=this.columns.findIndex(l=>l.id===t.id),e=[];let i=t.children.length;for(let l=o+1;i>0&&l<this.columns.length;l++,i--){const a=this.columns[l];a.children.length?i+=a.children.length:e.push(a)}return e.length===0&&e.push(t),e.forEach(l=>{let a=l.width?parseFloat(l.width.toString())*s:0;const c=l.minResizableWidth===void 0?10:l.minResizableWidth;a<c&&(a=c),l.width=a}),this.updateColElements(e),e}updateNextLockedCol(t,s,o){const e=s.index,i=this.colGroupMain.parentElement.closest(".k-grid"),l=i==null?void 0:i.clientWidth,a=this.columns.filter(c=>c.locked).map(c=>parseInt(c.width+"",10)).reduce((c,h)=>c+h,0);!s.locked||l<=a+Ss||this.columns.forEach(c=>{if(c!=null&&c.locked&&o){const h=t==null?void 0:t.querySelectorAll('[aria-colindex="'+c.ariaColumnIndex+'"]');h==null||h.forEach(d=>{const f=d.style;this.isRtl?(c.index>e&&f&&f.right&&(f.right=parseInt(f.right,10)-o+"px"),c.index<e&&f&&f.left&&(f.left=parseInt(f.left,10)-o+"px")):(c.index>e&&f&&f.left&&(f.left=parseInt(f.left,10)-o+"px"),c.index<e&&f&&f.right&&(f.right=parseInt(f.right,10)-o+"px"))})}})}}class Pt{constructor(t,s,o){this.refDragElementClue=n.createRef(),this.refDropElementClue=n.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=e=>{this.groupPanelDivElement=e&&e.children?e.children[0]:e},this.pressHandler=(e,i)=>{const l=this.getColumnIndex(e,i);if(this.startGroup=this.getGroupIndex(e),l>=0){const a=this.columns[l];(a.reorderable&&this.reorderable||a.groupable&&this.groupable)&&(this.startColumn=l)}},this.dragHandler=(e,i)=>{if(e.isTouch||e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(e,i);const l=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(e)?l&&l.length?l.length:0:this.getGroupIndex(e);const a=!this.isValid();a&&(this.currentColumn=-1,this.currentGroup=-1);const c=this.currentColumn>=0?i.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(e)?e.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(e,i,c,a),this.updateDropElementClue(e,i,c,a)},this.releaseHandler=e=>{const i=this.startColumn,l=this.currentColumn,a=this.startGroup,c=this.currentGroup;e.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const h=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,h&&(i>=0&&l>=0?this.columnReorder(i,l,e.originalEvent):a>=0&&c>=0?this.groupReorder(a,c,e.originalEvent):i>=0&&c>=0&&this.columnToGroup(i,c,e.originalEvent))},this.columnReorder=t,this.groupReorder=s,this.columnToGroup=o}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(t,s){if(!s||s.parentElement===this.groupPanelDivElement)return-1;const o=C.getIndex(t,s);if(o===-1)return-1;for(let e=0;e<s.parentNode.children.length;e++)if(s.parentNode.children[e]===s)return this.columns.findIndex(i=>i.index===o&&i.depth===e);return-1}isTargetGroupingContainer(t){const s=t.originalEvent.target;return s.className.indexOf?s.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(t){return C.getIndex(t,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(t,s,o,e){if(!this.dragElementClue)return;const i=this.startColumn>=0?s.children[this.columns[this.startColumn].index].innerText:s.innerText;this.dragElementClue.setState({visible:!0,top:t.pageY+10,left:t.pageX,innerText:i,status:e||!o?"k-i-cancel":"k-i-plus"})}updateDropElementClue(t,s,o,e){if(!this.dropElementClue)return;if(e||!o){this.dropElementClue.setState({visible:!1});return}const i=o.getBoundingClientRect(),a=(o.closest(".k-grouping-header")||o).getBoundingClientRect();let c=i.left+t.pageX-t.clientX-6;!this.isTargetGroupingContainer(t)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(c+=i.width);const h=a.top+t.pageY-t.clientY;this.dropElementClue.setState({visible:!0,top:h,left:c,height:this.currentColumn>=0?s.clientHeight:a.height})}}const _t=r=>{let t=null;const s=I.useInternationalization(),o=C.useTableKeyboardNavigation(r.id),e=n.useCallback(h=>{r.onContextMenu&&r.onContextMenu.call(void 0,h,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]);let i=null,l=null;if(r.rowType==="groupFooter")i={onContextMenu:e,className:r.className},t=n.createElement("td",{...i});else if(r.rowType!=="groupHeader"){if(r.field!==void 0){const d=L(r.field,r.dataItem);d!=null&&(l=r.format?s.format(r.format,d):d.toString())}const h=g.classNames("k-table-td",r.className,{"k-selected":r.isSelected});i={onContextMenu:e,colSpan:r.colSpan,style:r.style,className:h,role:"gridcell","aria-colindex":r.ariaColumnIndex,"aria-selected":r.isSelected,[U]:r.columnIndex,...o},t=n.createElement("td",{...i},l)}const a=r.rowType||"data",c=r.cells;if(c&&c[a]){const h=c[a];return n.createElement(h,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,t,r):t},Pe=r=>{let t=null;const{columnIndex:s,level:o,columnsCount:e,rowType:i,dataItem:l,field:a,onChange:c,expanded:h,render:d,dataIndex:f,ariaColumnIndex:b,isRtl:u}=r,x=a||"",y=C.useTableKeyboardNavigation(r.id),v=I.useLocalization();let k=null,R=null,E=null;const P=n.useCallback(T=>{T.isDefaultPrevented()||T.keyCode===g.Keys.enter&&c&&(T.preventDefault(),c({dataItem:l,dataIndex:f,syntheticEvent:T,field:void 0,value:!h}))},[h,c,l,f]),z=n.useCallback(T=>{r.onContextMenu&&r.onContextMenu.call(void 0,T,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),ae=(T,Ce)=>{const ce=h?yt:St,be=v.toLanguageString(ce,S[ce]);return k={className:"k-table-td",style:{...r.style,...Ce},colSpan:T,key:"g-colspan",role:"gridcell",["aria-selected"]:!1,["aria-expanded"]:h,["aria-colindex"]:b,onKeyDown:P,onContextMenu:z,...y},E=n.createElement("p",{className:"k-reset"},n.createElement("a",{onClick:Q=>{Q.preventDefault(),c&&c({dataItem:l,dataIndex:f,syntheticEvent:Q,field:void 0,value:!h})},href:"#",tabIndex:-1,"aria-label":be},n.createElement(g.IconWrap,{name:h?"caret-alt-down":u?"caret-alt-left":"caret-alt-right",icon:h?w.caretAltDownIcon:u?w.caretAltLeftIcon:w.caretAltRightIcon})),l[x]instanceof Date&&l[x].toString?l[x].toString():l[x]),n.createElement("td",{...k,key:k.key},E)};s===void 0||o===void 0||s<o||e===void 0||i!=="groupHeader"||l[x]===void 0?(k={style:r.style,key:"g"+s,className:g.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":r.locked}),role:"gridcell",onContextMenu:z},t=n.createElement("td",{...k,key:k.key})):s<=o&&!r.locked?t=ae(e-s,{}):s<=o&&r.locked&&(R={className:"k-table-td",role:"gridcell",colSpan:e-s,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:z},t=n.createElement(n.Fragment,null,ae(0,{position:"sticky",zIndex:2}),n.createElement("td",{...R})));const Y=r.rowType||"data",V=r.cells;if(V&&V.group&&V.group[Y]){const T=V.group[Y];return n.createElement(T,{...r,tdProps:k,td2Props:R},E)}return d?d.call(void 0,t,r):t};class At extends n.Component{render(){const t=g.classNames("k-table-row",{"k-table-group-row k-grouping-row":this.props.rowType==="groupHeader","k-group-footer":this.props.rowType==="groupFooter","k-master-row":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter","k-table-alt-row k-alt":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter"&&this.props.isAltRow,"k-selected":this.props.isSelected,"k-grid-edit-row":this.props.isInEdit}),s=n.createElement("tr",{id:this.props.id,onClick:this.props.onClick,onDoubleClick:this.props.onDoubleClick,className:t,style:{height:this.props.rowHeight?this.props.rowHeight+"px":"",visibility:this.props.isHidden?"hidden":""},role:"row","aria-rowindex":this.props.ariaRowIndex,"absolute-row-index":this.props.absoluteRowIndex,key:this.props.absoluteRowIndex,[Ft]:this.props.rowType==="data"?this.props.dataIndex:void 0},this.props.children);return this.props.render?this.props.render.call(void 0,s,this.props):s}}class ws extends n.Component{get _inputId(){return this.props.id}render(){const{columnMenuWrapperProps:t}=this.props,s=[n.createElement("span",{key:0,className:"k-checkbox-wrap"},n.createElement("input",{checked:this.props.selectionValue,id:this._inputId,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:o=>this.props.selectionChange({field:this.props.field,syntheticEvent:o})})),n.createElement("label",{key:1,className:"k-checkbox-label",htmlFor:this._inputId}),t.columnMenu&&n.createElement(Be,{...t})];return this.props.render?this.props.render.call(void 0,s,this.props):s}}const Rs=g.withIdHOC(ws);class fe extends n.Component{render(){return this.props.children||I.provideLocalizationService(this).toLanguageString(Se,S[Se])}}fe.displayName="KendoReactGridNoRecords";I.registerForLocalization(fe);class Ns extends n.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(t,s)=>{const o={colSpan:t.colSpan!==1?t.colSpan:void 0,style:t.left!==void 0?this.props.isRtl?{left:t.right,right:t.left}:{left:t.left,right:t.right}:{},className:g.classNames("k-table-td",t.locked&&t.left!==void 0?"k-grid-footer-sticky":""),key:s,role:"gridcell",["aria-colindex"]:t.ariaColumnIndex},e={field:t.field,ariaColumnIndex:t.ariaColumnIndex,...o},i=ge(this.props.cells,t.cells);if(i&&i.footerCell){const l=i.footerCell;return n.createElement(l,{...e,tdProps:o,index:s})}return t.footerCell&&n.createElement(t.footerCell,{...e,key:s})||n.createElement("td",{...o})}}get element(){return this._element}render(){return n.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},ls(this.props.columns).map(this.renderCell))}}const Fs=({buttonCount:r=10,info:t=!0,type:s="numeric",pageSizes:o=void 0,previousNext:e=!0,responsive:i=void 0,pageSizeValue:l=void 0})=>({buttonCount:r,info:t,pageSizes:o===!0?[5,10,20]:o||void 0,previousNext:e,responsive:i!==!1,type:s,pageSizeValue:l}),Ds=r=>Fs(r===!0?{}:r),dt={name:"@progress/kendo-react-grid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Ts=r=>{const{colSpan:t,ariaColIndex:s,dataItem:o,dataIndex:e,id:i}=r,l=C.useTableKeyboardNavigation(i),a=n.useCallback(c=>{r.onContextMenu&&r.onContextMenu.call(void 0,c,r.dataItem)},[r.onContextMenu,r.dataItem]);return n.createElement("td",{onContextMenu:a,className:"k-table-td k-detail-cell",colSpan:t,"aria-colindex":s,role:"gridcell",...l},n.createElement(r.detail,{dataItem:o,dataIndex:e}))},Gs=r=>{const t=C.useTableKeyboardNavigation(r.id);return n.createElement("td",{className:"k-table-td k-hierarchy-cell",...t,role:"gridcell"})};let X=class extends n.Component{constructor(t){super(t),this._columns=[],this._columnsMap=[[]],this._columnsMutations=0,this._resized=!1,this._shouldUpdateLeftRight=!0,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this._data=[],this._slicedData=void 0,this.wrapperScrollTop=0,this.showLicenseWatermark=!1,this.headerRef=n.createRef(),this.headerElementRef=n.createRef(),this._element=null,this.tableElement=null,this.containerRef=n.createRef(),this.tableBodyRef=n.createRef(),this._footer=null,this.forceUpdateTimeout=void 0,this.isRtl=!1,this.observer=null,this.handleIntersection=e=>{const i={rowIndex:this.rowIndex};e.forEach(l=>{l.isIntersecting||this.setCurrentOnTop(i)})},this.setCurrentOnTop=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.observer&&this.observer.disconnect();const{rowIndex:i}=e;if(this.props.scrollable==="virtual")this.vs.askedSkip=i,this.vs.container.scroll(0,Math.round(this.vs.askedSkip/this.vs.total*this.vs.container.scrollHeight));else if(this.element){const l=i<1?this.element.querySelector("tbody > tr:nth-child(1)"):this.element.querySelector(`tbody > tr:nth-child(${i+1})`);l&&this.containerRef.current&&(this.containerRef.current.scrollTop=l.offsetTop)}},this.scrollIntoView=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.rowIndex=e.rowIndex;const{rowIndex:i}=e,l=this.element;if(this.observer&&l){this.observer.disconnect();const a=l.querySelector(`[absolute-row-index="${i}"]`);a?this.observer.observe(a):this.setCurrentOnTop(e)}},this.fitColumns=e=>{this.columnResize.dblClickHandler(null,e)},this.onContextMenu=(e,i,l)=>{if(this.props.onContextMenu){const a={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,dataItem:i,field:l};this.props.onContextMenu.call(void 0,a)}},this.getVirtualScroll=e=>{const{rowHeight:i,detailRowHeight:l,detail:a,expandField:c,groupable:h}=e,d=this.isAllData(),f=i!==void 0&&i>0,b=l!==void 0&&l>0,u=h===!0||typeof h=="object"&&h.enabled!==!1;return!f||u&&!d||!!(a&&c)&&(!b||!d)?Es:ht},this.isAllData=()=>{const{data:e,total:i}=this.props;return Array.isArray(e)?e.length===i:e?i===e.total:!1},this.initializeVirtualization=(e,i)=>{if(this.reInitVirtualization(this.props.scrollable==="virtual",this.props.total,this.props.filter,this.props.group,this.props.sort,i||this.props.rowHeight===void 0||this.props.rowHeight===0),this.vs.fixedScroll=this.props.fixedScroll||!1,this.vs.PageChange=this.pageChange,this.vs.realSkip=this.props.skip||0,this.vs.pageSize=(this.props.take!==void 0?this.props.take:this.props.pageSize)||0,this.vs.scrollableVirtual=this.props.scrollable==="virtual",this.vs.total=e,this.vs.propsSkip=(this.props.skip||0)+(this.props.scrollable==="virtual"?this.vs.topCacheCount+(this.vs.attendedSkip-(this.props.skip||0)):0),this.props.rowHeight!==void 0&&this.props.rowHeight>0&&!i){const l=this.props.rowHeight*e;this.vs.containerHeight=Ie?Math.min(at,l):l}else this.vs.containerHeight=1533915;if(this.vs.containerRef=this.containerRef,this.vs.tableBodyRef=this.tableBodyRef,this.vs.table=this.tableElement,this._slicedData=void 0,this.vs instanceof ht){const{rowHeight:l=0,detail:a,expandField:c}=this.props;let{detailRowHeight:h=0}=this.props;h=a&&c?h:l,this.isAllData()?(this.vs.total=this._data.length,this._slicedData=this._data.slice(this.vs.realSkip,this.vs.realSkip+this.vs.pageSize),this.vs.rowHeightService=this.rowHeightService(this.vs,this._data.length,l,h,this._data)):this.vs.rowHeightService=new ct(e,l,h);const d=this.vs.rowHeightService.totalHeight();this.vs.containerHeight=Ie?Math.min(at,d):d}},this.scrollHandler=e=>{if(e.target!==e.currentTarget)return;clearTimeout(this.forceUpdateTimeout),this.vs.table=this.tableElement;const i=e.currentTarget.scrollLeft,l=e.currentTarget.scrollTop;this.props.columnVirtualization&&(!this.vs.scrollableVirtual||l===this.wrapperScrollTop)&&(this.forceUpdateTimeout=window.setTimeout(()=>{this.forceUpdate()},0)),this._header&&this._header.setScrollLeft(i),this._footer&&this._footer.setScrollLeft(i),this.vs&&l!==this.wrapperScrollTop&&this.vs.scrollHandler(e),g.dispatchEvent(this.props.onScroll,e,this,void 0),this.wrapperScrollTop=l},this.onKeyDown=e=>{if(C.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,onNavigationAction:this.onNavigationAction}),this.props.onKeyDown){const{mode:i,cell:l}=C.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:i,cell:l,componentId:this._gridId,selectedField:this.props.selectedField,...this.getArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{C.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onNavigationAction=e=>{if(this.props.onNavigationAction){const i={focusElement:e.focusElement,...this.getArguments(e.event)};this.props.onNavigationAction.call(void 0,i)}},this.rowClick=(e,i)=>{this.props.onRowClick&&e.target.nodeName==="TD"&&this.props.onRowClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.rowDblClick=(e,i)=>{this.props.onRowDoubleClick&&e.target.nodeName==="TD"&&this.props.onRowDoubleClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.itemChange=e=>{const i=this.props.onItemChange;if(e.field===this.props.expandField||this.props.group&&e.field===void 0){const l=this.props.onExpandChange;l&&l.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,dataIndex:e.dataIndex,value:e.value});return}i&&i.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,field:e.field,value:e.value})},this.onHeaderSelectionChange=e=>{this.props.onHeaderSelectionChange&&this.props.onHeaderSelectionChange.call(void 0,{field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems(),selectedField:this.props.selectedField})},this.selectionRelease=e=>{if(this.props.onSelectionChange){const i={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._gridId,dataItems:this.getLeafDataItems(),dataItem:null,...e};this.props.onSelectionChange.call(void 0,i)}},this.pageChange=(e,i,l)=>{this.raiseDataEvent(this.props.onPageChange,{page:e},{skip:e.skip,take:e.take},i,l)},this.pagerPageChange=e=>{this.pageChange({skip:e.skip,take:e.take},e.syntheticEvent,e.targetEvent)},this.sortChange=(e,i)=>{this.raiseDataEvent(this.props.onSortChange,{sort:e},{sort:e,...this.props.scrollable==="virtual"?{skip:0}:{}},i)},this.filterChange=(e,i)=>{this.raiseDataEvent(this.props.onFilterChange,{filter:e},{filter:e||void 0,skip:0},i)},this.groupChange=(e,i)=>{const l=i.nativeEvent?i:{nativeEvent:i.nativeEvent||i.originalEvent};this.raiseDataEvent(this.props.onGroupChange,{group:e},{group:e,skip:0},l)},this.onClipboard=(e,i)=>{if(this.props.onClipboard){if(!this.inActiveElement()||!e)return;this.props.onClipboard.call(void 0,{type:e,nativeEvent:i,columns:this._columns,dataItemKey:this.props.dataItemKey||"",...typeof this.props.clipboard!="boolean"?this.props.clipboard:{}})}},this.inActiveElement=()=>{var c,h,d;if(!g.canUseDOM)return!1;const e=g.getActiveElement(this.document),i=e?e.matches(".k-table-td")?e:(c=this.document)==null?void 0:c.body:(h=this.document)==null?void 0:h.body,l=i.closest(".k-grid-container"),a=i&&((d=this._element)==null?void 0:d.contains(i));return!!(i&&a&&l)},this.onResize=(e,i,l,a,c,h)=>{this.resetTableWidth(),this._shouldUpdateLeftRight=!0,this._resized=!0,this._columnsMutations++,this.props.onColumnResize&&this.props.onColumnResize.call(void 0,{columns:this.columns,nativeEvent:a,targetColumnId:h,index:e,newWidth:i,oldWidth:l,end:c,target:this})},this.reInitVirtualization=g.memoizeOne((e,i,l,a,c,h)=>{this.vs.reset();const d=this.getVirtualScroll(this.props);this.vs=new d(h)}),this.flatData=g.memoizeOne((e,i,l,a,c,h,d)=>{const f=[],b=pt(f,e,i,{index:l},a!==void 0,c);return{flattedData:f,resolvedGroupsCount:b}}),this.rowHeightService=g.memoizeOne((e,i,l,a,c)=>new ct(i,l,a,c)),this.childrenToArray=g.memoizeOne(e=>n.Children.toArray(e)),this.readColumns=g.memoizeOne((e,i,l)=>{const a=e.filter(c=>c&&c.type&&c.type.displayName==="KendoReactGridColumn");return ut(a,this.columns,{prevId:0,idPrefix:i})}),this.mapColumns=g.memoizeOne(e=>C.mapColumns(e)),this.configureColumns=g.memoizeOne((e,i,l)=>{this.props.selectedField&&e.filter(h=>h.field===this.props.selectedField).forEach(h=>{h.width=h.width||"50px",h.cell=h.cell||ft,h.headerCell=h.headerCell||Rs});const a={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let c=0;this.props.expandField&&this.props.onExpandChange&&this.props.detail&&(e.unshift({...a,cell:Nt,field:this.props.expandField,headerClassName:"k-hierarchy-cell k-header",id:C.tableKeyboardNavigationTools.generateNavigatableId(`${this._columns.length}`,l,"column")}),c++);for(let h=0;h<i;h++)e.unshift({...a,isAccessible:!1,cell:Pe,field:"value",locked:this.props.lockGroups}),c++;e.slice(c).forEach(h=>h.parentIndex>=0&&(h.parentIndex+=c))}),this.getHeaderRow=g.memoizeOne((e,i,l,a,c,h,d,f,b,u,x,y)=>n.createElement(Mt,{cells:this.props.cells,sort:e,sortable:i,sortChange:this.sortChange,group:l||[],groupable:a,groupChange:this.groupChange,filter:c,filterable:h,filterOperators:d,filterChange:this.filterChange,columnMenu:b,selectionChange:this.onHeaderSelectionChange,columns:u,columnResize:this.columnResize,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,columnsMap:x,cellRender:f,isRtl:y,dragClue:this.dragLogic.dragClueRef,headerRef:this.headerElementRef,containerRef:this.containerRef})),this.resolveTitle=e=>{const i=this._columns.find(a=>a.field===e),l=i&&(i.title||i.field);return l===void 0?e:l},this.getLeafDataItems=()=>this._data.filter(e=>e.rowType==="data").map(e=>e.dataItem),g.validatePackage(dt),this.showLicenseWatermark=g.shouldShowValidationUI(dt);const s=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1,o=this.getVirtualScroll(t);this.vs=new o(s||t.rowHeight===void 0||t.rowHeight===0),this.dragLogic=new Pt(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ys(this.onResize),this.props.clipboard&&(this.clipboardService=new C.ClipboardService(this.onClipboard)),C.tableKeyboardNavigation.onConstructor({navigatable:!!t.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:this._gridId})}get columns(){const t=this._columns.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1);return gt(t)}get element(){return this._element}get document(){if(g.canUseDOM)return this.element&&this.element.ownerDocument||document}get _header(){return this.headerRef.current}get _gridId(){return this.props.id+"-role-element-id"}componentDidMount(){this.resetTableWidth(),g.setScrollbarWidth();const t=C.isRtl(this.element);this.isRtl=t,C.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.isRtl&&this.forceUpdate();const s={rootMargin:"0px",threshold:.9};this.clipboardService&&this.clipboardService.addEventListeners(this.document),this.observer=g.canUseDOM&&window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,s)||null}getSnapshotBeforeUpdate(){return C.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(){this.resetTableWidth(),g.setScrollbarWidth(),this.vs.tableTransform&&this.vs.table&&(this.vs.table.style.transform=this.vs.tableTransform,this.vs.tableTransform=""),C.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){clearTimeout(this.forceUpdateTimeout),this.clipboardService&&this.clipboardService.removeEventListeners(this.document)}render(){var nt;let t=this.props.total||0;const s=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);let o=[];Array.isArray(this.props.data)?(o=this.props.data,t=t||this.props.data.length):this.props.data&&(o=this.props.data.data,t=t||this.props.data.total);const e=typeof this.props.groupable=="object"&&this.props.groupable.footer||"none",{resolvedGroupsCount:i,flattedData:l}=this.flatData(o,e,this.props.skip||0,this.props.group,this.props.expandField,this.props.filter,this.props.sort);this._data=l;const a=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1;this.columnResize.resizable=this.props.resizable||!1,this.dragLogic.reorderable=this.props.reorderable||!1,this.dragLogic.groupable=a;const c=this.props.selectable&&this.props.selectable.drag?"none":void 0;this.initializeVirtualization(t,a);const h=this.childrenToArray(this.props.children);this.initColumns(h,i);const d=h.map(m=>m&&m.type&&m.type.displayName==="KendoReactGridToolbar"?n.cloneElement(m,{...m.props,ariaControls:this._gridId}):null),f=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridNoRecords"),b=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridStatusBar"),u=this._columns.filter(m=>m.children.length===0),x=a&&n.createElement(Ht,{group:this.props.group||[],groupChange:this.groupChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,refCallback:this.dragLogic.refGroupPanelDiv,resolveTitle:this.resolveTitle,ariaControls:this._gridId,onContextMenu:this.onContextMenu}),{sort:y,sortable:v,group:k,filter:R,filterable:E,filterOperators:P=Oe,headerCellRender:z,columnMenu:ae}=this.props,Y=n.createElement(us,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",scrollableDataElement:()=>this.vs.container,draggable:this.props.reorderable||a,ref:this.headerRef,elemRef:this.headerElementRef,headerRow:this.getHeaderRow(y,v,k,a,R,E,P,z,ae,this._columns,this._columnsMap,this.isRtl),filterRow:this.props.filterable&&n.createElement(Lt,{cells:this.props.cells,size:this.props.size,columns:this._columns,filter:this.props.filter,filterOperators:this.props.filterOperators||Oe,filterChange:this.filterChange,sort:this.props.sort,cellRender:this.props.filterCellRender,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1})||void 0,cols:u.map((m,F)=>n.createElement("col",{key:F.toString(),width:Ee(m)}))}),V=this.vs&&this.vs.container&&this.vs.container.scrollLeft||0,T=parseFloat(((this.props.style||{}).width||"").toString()),{colSpans:Ce,hiddenColumns:ce}=C.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:u,tableViewPortWidth:T,scrollLeft:V}),be=(m,F,D)=>{let q=!1;const W=this.props.selectedField?L(this.props.selectedField,m.dataItem):void 0;return{row:u.map((N,G)=>{if(ce[G])return null;const Z=N.id?N.id:G,ee=`${N.className?N.className+" ":""}${N.locked?"k-grid-content-sticky":""}`,_=N.left!==void 0?this.isRtl?{left:N.right,right:N.left}:{left:N.left,right:N.right}:{};let A=!1;if(N.editable&&this.props.editField){const O=L(this.props.editField,m.dataItem);O&&(O===!0||O===N.field)&&(q=!0,A=!0)}const ke=N.cell||A&&Dt||_t;return n.createElement(ke,{onContextMenu:this.onContextMenu,key:Z,locked:this.props.lockGroups,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${F}-${String(G)}`,s),colSpan:Ce[G],dataItem:m.dataItem,field:N.field,editor:N.editor,format:N.format,className:ee,render:this.props.cellRender,cells:ge(this.props.cells,N.cells),onChange:this.itemChange,selectionChange:this.props.onSelectionChange?O=>{this.selectionChange({event:O,dataItem:m.dataItem,dataIndex:D,columnIndex:G})}:void 0,columnIndex:G,columnsCount:u.length,rowType:m.rowType,level:m.level,expanded:m.expanded,dataIndex:m.dataIndex,style:_,ariaColumnIndex:N.ariaColumnIndex,isSelected:Array.isArray(W)&&W.indexOf(G)>-1})}),isInEdit:q,isSelected:typeof W=="boolean"&&W}};let Q=0;if(this.props.scrollable==="virtual")for(let m=0;m<this.vs.topCacheCount+this.vs.attendedSkip-(this.props.skip||0);m++){const F=this._data.shift();if(F)this._data.push(F),Q++,F.rowType==="groupHeader"&&m--;else break}const Qe=m=>m>=this._data.length-Q;let Je=this.vs.realSkip||0;const he=[];let ve=!1;const xe=this._columnsMap.length+(this.props.filterable?1:0)+1,Ze=n.createElement("div",{key:"no-records",className:"k-grid-norecords","aria-rowindex":xe},n.createElement("div",{className:"k-grid-norecords-template"},f.length?f:n.createElement(fe,null)));let J=0;if(this._data.length){let m=-1,F=0;(this._slicedData||this._data).forEach((D,q)=>{D.rowType==="data"&&(Je++,m++);const W=Je%2===0,N=this.props.dataItemKey&&g.getter(this.props.dataItemKey)(D.dataItem),G=q+(this.vs.realSkip||0),Z=N||"ai"+G,ee=Z+"_1",_=be(D,Z,m);if(J=G+xe+F,he.push(n.createElement(At,{key:Z,dataItem:D.dataItem,isAltRow:W,isInEdit:_.isInEdit,rowType:D.rowType,isHidden:Qe(q),onClick:A=>this.rowClick(A,D),onDoubleClick:A=>this.rowDblClick(A,D),selectedField:this.props.selectedField,rowHeight:this.props.rowHeight,render:this.props.rowRender,ariaRowIndex:J,absoluteRowIndex:G,dataIndex:m,isSelected:_.isSelected},_.row)),this.props.detail&&D.rowType==="data"&&D.expanded){const A=u.length-(this.props.expandField?1:0)-(this.props.group?this.props.group.length:0)||1;F++,J=G+xe+F,he.push(n.createElement("tr",{key:ee,className:g.classNames("k-table-row",W?"k-detail-row k-table-alt-row k-alt":"k-detail-row"),style:{visibility:Qe(q)?"hidden":"",height:this.props.detailRowHeight},role:"row","aria-rowindex":J},this.props.group&&this.props.group.map((ke,O)=>{var lt;const te=(lt=_==null?void 0:_.row[O])==null?void 0:lt.props.style,es=te?this.isRtl?{left:te.right,right:te.left}:{left:te.left,right:te.right}:{};return n.createElement(Pe,{id:"",dataIndex:D.dataIndex,field:ke.field,dataItem:D.dataItem,key:O,style:es,ariaColumnIndex:1+O,isSelected:!1,locked:this.props.lockGroups,isRtl:this.isRtl,cells:this.props.cells})}),this.props.expandField&&n.createElement(Gs,{id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dhcell`,s)}),n.createElement(Ts,{onContextMenu:this.onContextMenu,dataItem:D.dataItem,dataIndex:D.dataIndex,colSpan:A,ariaColIndex:2+(this.props.group?this.props.group.length:0),detail:this.props.detail,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dcell`,s)})))}})}else ve=!0;const et={size:this.props.size,onPageChange:this.pagerPageChange,total:t,dir:this.isRtl?"rtl":void 0,skip:this.vs.propsSkip||0,take:(this.props.take!==void 0?this.props.take:this.props.pageSize)||10,messagesMap:ps,...Ds(this.props.pageable||{})},tt=this.props.pager?n.createElement(this.props.pager,{...et}):n.createElement(C.Pager,{className:"k-grid-pager",...et}),Jt=m=>this.props.sort&&this.props.sort.filter(F=>F.field===m).length>0,Zt=(m,F)=>n.createElement("col",{key:F.toString(),width:Ee(m)}),st=(nt=this.props.cells)!=null&&nt.footerCell||this._columns.some(m=>{var F;return!!(m.footerCell||(F=m.cells)!=null&&F.footerCell)})?n.createElement(ks,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",ref:m=>this._footer=m,row:n.createElement(Ns,{cells:this.props.cells,columns:this._columns,isRtl:this.isRtl,ariaRowIndex:J+1}),cols:u.map(Zt)}):null,rt=n.createElement("colgroup",{ref:m=>{this.columnResize.colGroupMain=m}},u.map((m,F)=>n.createElement("col",{key:F.toString(),className:Jt(m.field)?"k-sorted":void 0,width:Ee(m)}))),it=this.dragLogic.reorderable||this.dragLogic.groupable,ot=this.props.columnVirtualization?"block":"table";if(this.props.scrollable==="none")return n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:this.props.style,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:g.classNames("k-table k-grid-table",{[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),style:{userSelect:c,display:ot}},rt,Y,n.createElement("tbody",{role:"rowgroup",className:"k-table-tbody",...C.tableKeyboardNavigationBodyAttributes},he),st)),ve&&Ze,it&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue}))),b,this.props.pageable&&tt);let de=this.props.style||{};return this.props.scrollable==="virtual"&&(de.height||(de=Object.assign({},de,{height:"450px"}))),n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:de,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size,"k-grid-virtual":this.props.scrollable==="virtual"},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement("div",{className:"k-grid-aria-root",role:"grid","aria-colcount":u.length,"aria-rowcount":t,id:this._gridId},Y,n.createElement("div",{className:"k-grid-container",role:"presentation"},n.createElement("div",{ref:this.containerRef,className:"k-grid-content k-virtual-content",onScroll:this.scrollHandler,role:"presentation"},n.createElement("div",{className:"k-grid-table-wrap",role:"presentation"},n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:g.classNames("k-table k-grid-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),role:"presentation",style:{userSelect:c,display:ot}},rt,n.createElement("tbody",{className:"k-table-tbody",ref:this.tableBodyRef,role:"rowgroup",...C.tableKeyboardNavigationBodyAttributes},he))),ve&&Ze),n.createElement("div",{className:"k-height-container",role:"presentation"},n.createElement("div",{style:this.props.scrollable==="virtual"?{height:this.vs.containerHeight+"px"}:{}})))),st,it&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue})),this.showLicenseWatermark&&n.createElement(g.WatermarkOverlay,null)),b,this.props.pageable&&tt))}selectionChange(t){if(this.props.onSelectionChange){const{event:s,dataItem:o,dataIndex:e,columnIndex:i}=t,{mode:l,cell:a}=C.getSelectionOptions(this.props.selectable),c={...this.getArguments(s.syntheticEvent),dataItem:o,startColIndex:i,endColIndex:i,startRowIndex:e,endRowIndex:e,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:a,isDrag:!1,componentId:this._gridId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,c)}}raiseDataEvent(t,s,o,e,i){const l=this.props.onDataStateChange;if(t){const a={...this.getArguments(e),...s,targetEvent:i};t.call(void 0,a)}else l&&l.call(void 0,{...this.getArguments(e),targetEvent:i||{},dataState:{...this.getDataState(),...o}})}columnReorder(t,s,o){const e=this._columns[t],i=e.depth,l=d=>{do d++;while(d<this._columns.length&&this._columns[d].depth>i);return d},a=this._columns.splice(t,l(t)-t);this._columns.splice(t<s?l(s-a.length):s,0,...a),this._columns.filter(d=>d.declarationIndex>=0).forEach((d,f)=>d.orderIndex=f),this._columnsMutations++;const c=this._columns[t].locked&&this._columns[s].locked;C.updateLeft(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),C.updateRight(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),this._resized&&(this._shouldUpdateLeftRight=!1,this._resized=!1);const h=this.columns;if(this.forceUpdate(),this.props.onColumnReorder){const d={target:this,columns:h,columnId:e.id,nativeEvent:o};this.props.onColumnReorder.call(void 0,d)}}groupReorder(t,s,o){if(this.props.group===void 0)return;const e=this.props.group.slice();e.splice(s,0,...e.splice(t,1)),this.groupChange(e,o)}columnToGroup(t,s,o){const e=this._columns[t].field;if(!e)return;const i=(this.props.group||[]).slice();i.splice(s,0,{field:e}),this.groupChange(i,o)}resetTableWidth(){let t=0;if(!this.columnResize.colGroupMain)return;const s=this.columnResize.colGroupMain.children;for(let o=0;o<s.length;o++){const e=s[o].width;if(!e)return;t+=parseFloat(e.toString())}t=Math.round(t),this._header&&this._header.setWidth(t),this._footer&&this._footer.setWidth(t),this.tableElement&&(this.tableElement.style.width=t+"px")}initColumns(t,s){const o=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this._columns=this.readColumns(t,o,this._columnsMutations),this._columns.length===0&&(this._columns=os(this.props.data,this.props.group,this.props.expandField,{prevId:0,idPrefix:o})),this.configureColumns(this._columns,s,o),this._columnsMap=this.mapColumns(this._columns),this.columnResize.columns=this._columns,this.dragLogic.columns=this._columns}getDataState(){return{filter:this.props.filter,sort:this.props.sort,skip:this.props.skip,take:this.props.take!==void 0?this.props.take:this.props.pageSize,group:this.props.group}}getArguments(t){return{nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:this}}};X.displayName="KendoReactGrid";X.defaultProps={};X.propTypes={data:p.oneOfType([p.array,p.shape({data:p.array,total:p.number})]),sortable:p.oneOfType([p.bool,p.shape({mode:p.oneOf(["single","multiple"]),allowUnsort:p.bool})]),onSortChange:p.func,sort:p.array,filterable:p.bool,filter:p.any,onFilterChange:p.func,pageable:p.oneOfType([p.bool,p.shape({buttonCount:p.number,responsive:p.bool,info:p.bool,type:p.oneOf(["numeric","input"]),pageSizes:p.oneOfType([p.bool,p.arrayOf(p.oneOfType([p.string,p.number]))]),previousNext:p.bool})]),pageSize:p.number,onPageChange:p.func,total:p.number,skip:p.number,take:p.number,fixedScroll:p.bool,onExpandChange:p.func,expandField:p.string,selectedField:p.string,onSelectionChange:p.func,onHeaderSelectionChange:p.func,resizable:p.bool,reorderable:p.bool,group:p.any,groupable:p.oneOfType([p.bool,p.shape({enabled:p.bool,footer:p.oneOf(["always","visible","none"])})]),onGroupChange:p.func,onRowClick:p.func,onRowDoubleClick:p.func,onItemChange:p.func,editField:p.string,scrollable:p.oneOf(["none","scrollable","virtual"]),rowHeight:p.number,detailRowHeight:p.number,detail:p.any,style:p.object,onDataStateChange:p.func,onColumnResize:p.func,onColumnReorder:p.func,dataItemKey:p.string,navigatable:p.bool,size:p.oneOf(["small","medium"])};X.contextType=C.TableKeyboardNavigationContext;class le extends n.Component{render(){const{children:t}=this.props;return n.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-wrapper",this.props.className),style:this.props.style},t)}}class $ extends n.Component{render(){const{title:t,iconClass:s,svgIcon:o,selected:e}=this.props;return n.createElement("div",{onClick:this.props.onClick,className:`k-columnmenu-item ${e?"k-selected":""}`},(s||o)&&n.createElement(g.IconWrap,{name:s&&g.toIconName(s),icon:o}),t)}}class $e extends n.Component{constructor(){super(...arguments),this.onGroupClick=t=>{if(t.preventDefault(),this.props.onGroupChange){const{column:s}=this.props;if(!s.field)return;const o=(this.props.group||[]).slice(),e=o.findIndex(i=>i.field===s.field);e>-1?o.splice(e,1):o.push({field:s.field}),this.props.onGroupChange(o,t)}this.props.onCloseMenu&&this.props.onCloseMenu()}}render(){const{group:t,column:s}=this.props,o=I.provideLocalizationService(this),e=!!(t&&s.field&&t.find(l=>l.field===s.field)),i=e?It:Et;return n.createElement(le,null,n.createElement($,{title:o.toLanguageString(i,S[i]),iconClass:e?"k-i-ungroup":"k-i-group",svgIcon:e?w.ungroupIcon:w.groupIcon,onClick:this.onGroupClick}))}}I.registerForIntl($e);I.registerForLocalization($e);const Bt="asc",Wt="desc",Ms={true:{asc:{asc:"",desc:"desc"},desc:{asc:"asc",desc:""},"":{asc:"asc",desc:"desc"}},false:{asc:{asc:"asc",desc:"desc"},desc:{asc:"asc",desc:"desc"},"":{asc:"asc",desc:"desc"}}},Kt=(r,t)=>t?t.findIndex(s=>s.field===r):-1,Vt=(r,t)=>!!(t&&r>-1&&t[r].dir===Bt),qt=(r,t)=>!!(t&&r>-1&&t[r].dir===Wt);class me extends n.Component{constructor(){super(...arguments),this.onAscClick=t=>{this.onSort(t,Bt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onDescClick=t=>{this.onSort(t,Wt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onSort=(t,s)=>{if(t.preventDefault(),!this.props.onSortChange)return;const{column:o,sortable:e,sort:i}=this.props,{allowUnsort:l,mode:a}=Tt(e||!1,!1),c=(i||[]).filter(f=>f.field===o.field)[0],h=Ms[l][c&&c.dir||""][s],d=a==="single"?[]:(this.props.sort||[]).filter(f=>f.field!==o.field);h!==""&&o.field&&d.push({field:o.field,dir:h}),this.props.onSortChange(d,t)}}render(){const{sort:t,column:s}=this.props,o=Kt(s.field,t),e=I.provideLocalizationService(this);return n.createElement(le,null,n.createElement($,{title:e.toLanguageString(Re,S[Re]),iconClass:"k-i-sort-asc-sm",svgIcon:w.sortAscSmallIcon,selected:Vt(o,t),onClick:this.onAscClick}),n.createElement($,{title:e.toLanguageString(Ne,S[Ne]),iconClass:"k-i-sort-desc-sm",svgIcon:w.sortDescSmallIcon,selected:qt(o,t),onClick:this.onDescClick}))}}me.active=(r,t)=>{const s=Kt(r,t);return qt(s,t)||Vt(s,t)};I.registerForIntl(me);I.registerForLocalization(me);class je extends n.Component{render(){return n.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},n.createElement(rs.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}class _e extends n.Component{constructor(t){super(t),this.renderOperatorEditor=()=>{if(this.props.filterType==="boolean")return;const s=this.props.operators.find(o=>o.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{value:s,onChange:this.operatorChange,data:this.props.operators,textField:"text"})},this.inputChange=this.inputChange.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){return n.createElement(n.Fragment,null,this.renderOperatorEditor(),this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues))}inputChange(t,s){Ke(t,s,this.props)}operatorChange(t){qe(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Ve(t,this.props.onChange)}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(M.NumericTextBox,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},rangeOnEnter:!1});case"date":return n.createElement(Ae.DatePicker,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)}});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text"})}default:return n.createElement(M.Input,{value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)}})}}}class Ut extends n.Component{render(){const{firstFilterProps:t,hideSecondFilter:s,secondFilterProps:o,logicData:e,logicValue:i,onLogicChange:l}=this.props;return n.createElement(n.Fragment,null,n.createElement(_e,{...t}),!s&&n.createElement(n.Fragment,null,n.createElement(ie.DropDownList,{data:e,value:i,onChange:l,className:"k-filter-and",textField:"text"}),n.createElement(_e,{...o})))}}const ue=r=>r||{filters:[],logic:"and"},re=(r,t)=>ue(t).filters.filter(e=>pe.isCompositeFilterDescriptor(e)?e.filters&&e.filters.length&&e.filters.length<=2&&!e.filters.find(i=>pe.isCompositeFilterDescriptor(i)||i.field!==r):!1)[0]||null;class Xe extends n.Component{constructor(t){super(t),this.removeGroup=(o,e)=>{const i=[...e.filters],l=i.findIndex(a=>a===o);return l>-1&&i.splice(l,1),{...e,filters:i}},this.insertGroup=(o,e)=>({...e,filters:[o,...e.filters]}),this.isControlled=()=>this.props.expanded!==void 0,this.onFilterExpand=()=>{const o=this.isControlled(),e=!(o?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(e),o||this.setState({expanded:e})},this.firstFilterChange=o=>{this.filterChange(0,o)},this.secondFilterChange=o=>{this.filterChange(1,o)},this.filterChange=(o,e)=>{const i=this.state.filterGroup.filters.map((l,a)=>a===o?{...l,value:e.value,operator:e.operator}:l);this.setState({filterGroup:{...this.state.filterGroup,filters:i}})},this.logicChange=o=>{this.setState({filterGroup:{...this.state.filterGroup,logic:o.target.value.operator}})},this.clear=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ue(this.props.filter),l=re(e,this.props.filter),a=i.filters.filter(c=>c!==l);a.length?this.props.onFilterChange({...i,filters:a},o):this.props.onFilterChange(null,o),this.props.onCloseMenu&&this.props.onCloseMenu()},this.currentFilterGroup=()=>({...this.state.filterGroup,filters:this.state.filterGroup.filters.filter(o=>o.value!==void 0&&o.value!==null&&o.value!==""||o.value===null&&o.operator)}),this.submit=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ue(this.props.filter),l=re(e,this.props.filter),a=this.currentFilterGroup();let c=null;if(l&&a.filters.length>0){const h=i.filters.map(d=>d===l?a:d);c={...i,filters:h}}else if(a.filters.length===0){const h=i.filters.filter(d=>d!==l);h.length&&(c={...i,filters:h})}else c={...i,filters:[...i.filters,a]};this.props.onFilterChange(c,o),this.props.onCloseMenu&&this.props.onCloseMenu()};let s;if(t.column&&t.column.field){const o=He(t.column.filter),e=zt(t.filterOperators,o);s=re(t.column.field,t.filter),s=s?{...s,filters:s.filters.map(i=>({...i}))}:{logic:"and",filters:[{field:t.column.field,operator:e,value:H(e)?null:void 0},{field:t.column.field,operator:e,value:H(e)?null:void 0}]},s.filters.filter(i=>i.field===t.column.field).length===1&&s.filters.splice(1,0,{field:t.column.field,operator:e})}this.state={expanded:t.expanded||!1,filterGroup:s}}render(){const{column:t,filterUI:s,hideSecondFilter:o,filterOperators:e}=this.props;if(!t||!t.field)return n.createElement("div",null);const i=He(t.filter),l=o!==void 0?o:vs[i],a=I.provideLocalizationService(this),c=this.state.filterGroup.filters,h=se(e[i],a),d=se(We,a),f={field:t.field,value:c[0].value,operator:c[0].operator,operators:h,booleanValues:d,onChange:this.firstFilterChange,filterType:i},b={field:t.field,value:c[1].value,operator:c[1].operator,operators:h,booleanValues:d,onChange:this.secondFilterChange,filterType:i},u=this.state.filterGroup.logic,x=se(Cs,a),y={value:x.find(z=>z.operator===(u===null?"":u)),onChange:this.logicChange,data:x},v=s,k={firstFilterProps:f,secondFilterProps:b,logicData:y.data,logicValue:y.value,onLogicChange:y.onChange,hideSecondFilter:l},R=this.currentFilterGroup().filters.length!==0||H(c[0].operator)||H(c[1].operator),E=this.isControlled()?this.props.expanded:this.state.expanded,P=this.props.alwaysExpand;return n.createElement(le,null,!P&&n.createElement($,{title:a.toLanguageString(ne,S[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(je,{show:P||!!E},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear,onKeyDown:z=>z.stopPropagation()},n.createElement("div",{className:"k-filter-menu-container"},v?n.createElement(v,{...k}):n.createElement(Ut,{...k}),n.createElement("div",{className:"k-actions k-actions-stretched"},n.createElement(B.Button,{themeColor:"primary",disabled:!R},a.toLanguageString(oe,S[oe])),n.createElement(B.Button,{type:"reset"},a.toLanguageString(K,S[K])))))))}}Xe.active=(r,t)=>!!re(r,t);I.registerForLocalization(Xe);const zs=(r,t)=>r.length!==t.length?!1:r.every((s,o)=>s===t[o]);class Ye extends n.Component{constructor(t){super(t),this.defaultFilter=()=>this.props.filter?g.clone(this.props.filter):{filters:[],logic:"and"},this.isControlled=()=>this.props.expanded!==void 0,this.parseData=(s,o)=>{const e=this.props.column.field||"",i=s.map(l=>L(e,l));return o?i.filter((l,a)=>i.indexOf(l)===a):i},this.getFilterIndex=()=>{const s=this.props.column.field;return this.defaultFilter().filters.findIndex(i=>i.filters&&i.filters.length>0&&i.filters[0].field===s)},this.onFilterExpand=()=>{const s=this.isControlled(),o=!(s?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(o),s||this.setState({expanded:o})},this.handleSearchChange=s=>{const o=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",e={logic:"and",filters:[{field:this.props.column.field,operator:o,value:s.target.value,ignoreCase:!0}]};this.setState({value:s.target.value,data:this.parseData(pe.filterBy(this.props.data||[],e),this.props.uniqueData)})},this.handleClear=()=>{const s=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",o={logic:"and",filters:[{field:this.props.column.field,operator:s,value:"",ignoreCase:!0}]};this.setState({value:"",data:this.parseData(pe.filterBy(this.props.data||[],o),this.props.uniqueData)})},this.clear=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;o!==null&&o.filters.length>0?(this.compositeFilterIndex>=0&&o.filters.splice(this.compositeFilterIndex,1),this.props.onFilterChange(o,s)):this.props.onFilterChange(null,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.submit=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;this.props.onFilterChange(o,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.handleCheckBoxChange=(s,o)=>{const e=this.props.column.field||"",i={...this.state.currentFilter},l=[...this.state.currentFilter.filters];let a=[];if(this.compositeFilterIndex!==-1&&i.filters[this.compositeFilterIndex].filters&&o!=="all"&&(a=i.filters[this.compositeFilterIndex].filters),s.value&&o==="all")this.state.data.forEach(c=>{a.push({field:e,operator:"eq",value:c})});else if(s.value)a.push({field:e,operator:"eq",value:o});else if(this.state.currentFilter){const c=a.findIndex(h=>h.value===o);a.splice(c,1)}i.logic="and",this.compositeFilterIndex!==-1?l[this.compositeFilterIndex]={logic:"or",filters:a}:l.push({logic:"or",filters:a}),(!s.value&&o==="all"||a.length===0)&&l.splice(this.compositeFilterIndex,1),i.filters=l,this.setState({currentFilter:i})},this.isAllSelected=()=>{let s=!1;if(this.state.currentFilter){const o=[...this.state.currentFilter.filters];return this.compositeFilterIndex===-1?!1:(s=this.state.data.every(e=>this.compositeFilterIndex!==-1&&o[this.compositeFilterIndex].filters?o[this.compositeFilterIndex].filters.findIndex(l=>l.value===e)>=0:!1),s)}return s},this.compositeFilterIndex=this.getFilterIndex(),this.state={expanded:t.expanded||!1,value:"",data:this.parseData(this.props.data,this.props.uniqueData)||[],dataFromProps:this.parseData(this.props.data,!1)||[],currentFilter:this.defaultFilter()}}componentDidUpdate(){const t=this.props.column.field||"",s=this.props.data.map(o=>L(t,o));zs(s,this.state.dataFromProps)||this.setState({data:s,dataFromProps:s})}render(){const{column:t}=this.props;if(!t||!t.field)return n.createElement("div",null);const s=I.provideLocalizationService(this),o=this.isControlled()?this.props.expanded:this.state.expanded,e=[];if(this.state.currentFilter){const a=[...this.state.currentFilter.filters];this.compositeFilterIndex=a.findIndex(c=>c.filters&&c.filters.length>0?c.filters[0].field===t.field:!1),this.compositeFilterIndex!==-1&&a[this.compositeFilterIndex].filters.length>0&&a[this.compositeFilterIndex].filters.forEach(c=>{c.field===this.props.column.field&&e.push(c.value)})}const i=this.props.searchBox?n.createElement(this.props.searchBox,{value:this.state.value,onChange:this.handleSearchChange}):n.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},n.createElement(g.IconWrap,{className:"k-input-icon",name:"search",icon:w.searchIcon}),n.createElement(M.Input,{className:"k-input-inner",type:"text",placeholder:s.toLanguageString(Fe,S[Fe]),value:this.state.value,onChange:a=>this.handleSearchChange(a.nativeEvent)}),n.createElement(B.Button,{type:"button",rounded:null,className:"k-input-button",onClick:this.handleClear,icon:"x",svgIcon:w.xIcon})),l=e.filter((a,c)=>e.indexOf(a)===c);return n.createElement(le,null,n.createElement($,{title:s.toLanguageString(ne,S[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(je,{show:!!o},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear},n.createElement("div",{className:"k-filter-menu-container"},i,n.createElement("ul",{className:"k-reset k-multicheck-wrap"},n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(M.Checkbox,{label:s.toLanguageString(De,S[De]),onChange:a=>this.handleCheckBoxChange(a,"all"),checked:this.isAllSelected()})),this.state.data.map((a,c)=>n.createElement("li",{className:"k-item",key:c},n.createElement(M.Checkbox,{label:String(a),onChange:h=>this.handleCheckBoxChange(h,a),checked:l.includes(a)})))),n.createElement("div",{className:"k-filter-selected-items"},l.length+" "+s.toLanguageString(Ge,S[Ge])),n.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},n.createElement(B.Button,{themeColor:"primary",type:"submit"},s.toLanguageString(oe,S[oe])),n.createElement(B.Button,{className:"k-button",type:"reset"},s.toLanguageString(K,S[K])))))))}}Ye.defaultProps={uniqueData:!0};I.registerForLocalization(Ye);const $t=r=>{const[t,s]=n.useState(""),o=n.useMemo(()=>new Set(r.columnsState.map(u=>u.id)),[r.columnsState]),e=n.useMemo(()=>r.columns.filter(u=>{var x;return(x=u.title||u.field)==null?void 0:x.toLowerCase().includes(t.toLowerCase())}),[r.columns,t]),[i,l]=n.useState(r.columns.map(u=>o.has(u.id))),a=n.useCallback(()=>{const u=r.columns.filter((x,y)=>i[y]);r.onColumnsChange.call(void 0,u),r.onCloseMenu.call(void 0)},[i,r.columns,r.onColumnsChange,r.onCloseMenu]),c=n.useCallback(()=>{l(r.columns.map(u=>o.has(u.id)))},[o,r.columns]),h=i.filter(u=>u).length,d=h===i.length,f=n.useCallback(()=>{l(r.columns.map((u,x)=>d&&x===0?!0:!d))},[r.columns,d]),b=n.useCallback((u,x)=>{const y=i.slice();y[x]=u,l(y)},[i]);return n.createElement("form",{className:"k-filter-menu"},n.createElement("div",{className:"k-filter-menu-container"},n.createElement(M.TextBox,{className:"k-searchbox",value:t,onChange:u=>s(String(u.target.value)),prefix:()=>n.createElement(M.InputPrefix,null,n.createElement(g.IconWrap,{name:"search",icon:w.searchIcon}))}),n.createElement("ul",{className:"k-reset k-multicheck-wrap"},!t&&n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(M.Checkbox,{checked:d,onChange:f,label:"(Select all)"})),e.map((u,x)=>n.createElement("li",{key:u.id,className:"k-item"},n.createElement(M.Checkbox,{disabled:i[x]&&h===1,checked:i[x],onChange:y=>{var v;return b(!!((v=y.target.element)!=null&&v.checked),x)},label:u.title||u.field})))),n.createElement("div",{className:"k-filter-selected-items"},h," selected items"),n.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},n.createElement(B.Button,{type:"button",themeColor:"primary",onClick:a},"Apply"),n.createElement(B.Button,{type:"button",onClick:c},"Reset"))))};$t.displayName="GridColumnMenuColumnsList";class Ls extends n.Component{render(){return null}}class jt extends n.Component{render(){return n.createElement("div",{className:g.classNames("k-toolbar k-grid-toolbar",{"k-toolbar-md":!this.props.size,[`k-toolbar-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),"aria-label":this.props.ariaLabel,"aria-controls":this.props.ariaControls,role:"toolbar"},this.props.children)}}jt.displayName="KendoReactGridToolbar";const Xt=r=>{const{data:t=[]}=r;return n.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},t.map((s,o)=>n.createElement("div",{key:o},n.createElement("span",{className:"k-selection-aggregates-item-text"},s.type,": "),n.createElement("span",{className:"k-selection-aggregates-item-value"},s.formattedValue))))};Xt.displayName="KendoReactGridStatusBar";const Yt=r=>{var s;const t=r.slice();for(let o=0;o<t.length;o++)for(;t[o]&&((s=t[o].children)!=null&&s.length);)t.splice(o,1,...t[o].children);return t},Os=r=>{const{dataItems:t,target:s,selectedField:o}=r,i=Yt(s.columns).map(v=>v.field).filter(v=>v&&typeof v=="string").map(v=>g.getter(v)),l=g.getter(o),a={dates:[],numbers:[],booleans:[],others:[]},c=v=>{typeof v=="number"?a.numbers.push(v):typeof v=="boolean"?a.booleans.push(v):v instanceof Date?a.dates.push(v):a.others.push(v)};t.forEach(v=>{const k=l(v);k&&k.forEach(R=>{c(i[R](v))})});const h=a.dates.map(v=>v.getTime()),d=a.booleans.filter(v=>v).length,f=a.booleans.filter(v=>!v).length,b=a.numbers.length?a.numbers.reduce((v,k)=>v+=k,0):void 0,u={sum:b,average:typeof b=="number"?b/a.numbers.length:void 0,min:a.numbers.length?Math.min(...a.numbers):void 0,max:a.numbers.length?Math.max(...a.numbers):void 0,count:a.numbers.length+a.booleans.length+a.dates.length+a.others.length,isTrue:d>0?d:void 0,isFalse:f>0?f:void 0,earliest:a.dates.length?new Date(Math.min(...h)):void 0,latest:a.dates.length?new Date(Math.max(...h)):void 0},x=(v,k)=>(k==="sum"||k==="average")&&typeof v=="number"?v.toFixed(2):(k==="earliest"||k==="latest")&&v instanceof Date?v.toLocaleDateString():String(v),y=[];return Object.keys(u).forEach(v=>{const k=v,R=u[k];R!==void 0&&y.push({type:k,value:R,formattedValue:x(R,k)})}),y},Qt=g.withIdHOC(X);Qt.displayName="KendoReactGrid";Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>C.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>C.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>C.setSelectedState});exports.GRID_COL_INDEX_ATTRIBUTE=U;exports.GRID_ROW_INDEX_ATTRIBUTE=Ft;exports.Grid=Qt;exports.GridCell=_t;exports.GridClassComponent=X;exports.GridColumn=j;exports.GridColumnMenuCheckboxFilter=Ye;exports.GridColumnMenuColumnsList=$t;exports.GridColumnMenuFilter=Xe;exports.GridColumnMenuFilterCell=_e;exports.GridColumnMenuFilterUI=Ut;exports.GridColumnMenuGroup=$e;exports.GridColumnMenuItem=$;exports.GridColumnMenuItemContent=je;exports.GridColumnMenuItemGroup=le;exports.GridColumnMenuSort=me;exports.GridColumnMenuWrapper=Be;exports.GridCommonDragLogic=Pt;exports.GridDetailRow=Ls;exports.GridEditCell=Dt;exports.GridFilterCell=Ue;exports.GridGroupCell=Pe;exports.GridHeaderCell=Gt;exports.GridHierarchyCell=Nt;exports.GridNoRecords=fe;exports.GridRow=At;exports.GridSelectionCell=ft;exports.GridToolbar=jt;exports.StatusBar=Xt;exports.booleanFilterValues=We;exports.cellBoolDropdownChange=Ve;exports.cellInputChange=Ke;exports.cellOperatorChange=qe;exports.filterGroupByField=re;exports.getStatusData=Os;exports.gridMessages=S;exports.leafColumns=Yt;exports.operators=Oe;exports.pagerFirstPage=Ct;exports.pagerInfo=mt;exports.pagerItemPerPage=kt;exports.pagerLastPage=xt;exports.pagerNextPage=vt;exports.pagerPreviousPage=bt;exports.rootFilterOrDefault=ue;
package/index.mjs CHANGED
@@ -2010,7 +2010,7 @@ const Nr = ({
2010
2010
  name: "@progress/kendo-react-grid",
2011
2011
  productName: "KendoReact",
2012
2012
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
2013
- publishDate: 1707462677,
2013
+ publishDate: 1707742872,
2014
2014
  version: "",
2015
2015
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
2016
2016
  }, Tr = (i) => {
@@ -3824,6 +3824,9 @@ export {
3824
3824
  Or as GridToolbar,
3825
3825
  _r as StatusBar,
3826
3826
  jt as booleanFilterValues,
3827
+ Jt as cellBoolDropdownChange,
3828
+ Xt as cellInputChange,
3829
+ Qt as cellOperatorChange,
3827
3830
  ge as filterGroupByField,
3828
3831
  ii as getSelectedState,
3829
3832
  oi as getSelectedStateFromKeyDown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-grid",
3
- "version": "7.1.1-develop.6",
3
+ "version": "7.1.1-develop.7",
4
4
  "description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -25,15 +25,15 @@
25
25
  "@progress/kendo-data-query": "^1.0.0",
26
26
  "@progress/kendo-drawing": "^1.19.0",
27
27
  "@progress/kendo-licensing": "^1.3.4",
28
- "@progress/kendo-react-animation": "7.1.1-develop.6",
29
- "@progress/kendo-react-buttons": "7.1.1-develop.6",
30
- "@progress/kendo-react-common": "7.1.1-develop.6",
31
- "@progress/kendo-react-data-tools": "7.1.1-develop.6",
32
- "@progress/kendo-react-dateinputs": "7.1.1-develop.6",
33
- "@progress/kendo-react-dropdowns": "7.1.1-develop.6",
34
- "@progress/kendo-react-inputs": "7.1.1-develop.6",
35
- "@progress/kendo-react-intl": "7.1.1-develop.6",
36
- "@progress/kendo-react-popup": "7.1.1-develop.6",
28
+ "@progress/kendo-react-animation": "7.1.1-develop.7",
29
+ "@progress/kendo-react-buttons": "7.1.1-develop.7",
30
+ "@progress/kendo-react-common": "7.1.1-develop.7",
31
+ "@progress/kendo-react-data-tools": "7.1.1-develop.7",
32
+ "@progress/kendo-react-dateinputs": "7.1.1-develop.7",
33
+ "@progress/kendo-react-dropdowns": "7.1.1-develop.7",
34
+ "@progress/kendo-react-inputs": "7.1.1-develop.7",
35
+ "@progress/kendo-react-intl": "7.1.1-develop.7",
36
+ "@progress/kendo-react-popup": "7.1.1-develop.7",
37
37
  "@progress/kendo-svg-icons": "^2.1.0",
38
38
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
39
39
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"