@progress/kendo-react-dropdowns 9.0.0-develop.2 → 9.0.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComboBox/ComboBox.mjs +67 -29
- package/DropDownTree/useDropdownWidth.mjs +3 -6
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +144 -141
- package/MultiSelectTree/utils.js +1 -1
- package/MultiSelectTree/utils.mjs +12 -19
- package/README.md +44 -43
- package/common/GroupStickyHeader.mjs +1 -5
- package/common/List.js +1 -1
- package/common/List.mjs +63 -71
- package/common/ListContainer.mjs +1 -7
- package/common/ListDefaultItem.mjs +1 -5
- package/common/ListFilter.mjs +9 -5
- package/common/ListGroupItem.mjs +8 -8
- package/common/ListItem.mjs +10 -18
- package/common/MultiColumnList.mjs +3 -6
- package/common/Navigation.mjs +12 -2
- package/common/utils.mjs +3 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +0 -2
- package/index.d.ts +0 -2
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-labels"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-treeview")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-labels","@progress/kendo-svg-icons","@progress/kendo-react-popup","@progress/kendo-react-inputs","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-treeview"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDropdowns={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactLabels,e.KendoSvgIcons,e.KendoReactPopup,e.KendoReactInputs,e.KendoReactIntl,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactTreeview)}(this,(function(e,t,s,i,a,n,o,l,r,d,p,h){"use strict";function u(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var c=u(t);const g=e=>{const{children:t,width:s,dir:i,itemsCount:a,popupSettings:n}=e;return c.createElement(o.Popup,{style:{width:s,direction:i},contentKey:a&&a.join(),...n},t)},m=c.forwardRef(((e,t)=>{const s=c.useRef(null),{renderListFilterWrapper:a=!1,renderPrefixSeparator:o=!1,...r}=e,d=i.useUnstyled(),p=d&&d.uDropDownsBase;c.useImperativeHandle(t,(()=>s.current));const h=c.createElement(l.TextBox,{...r,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:p})),value:e.value||"",onChange:e.onChange,onKeyDown:e.onKeyDown,tabIndex:e.tabIndex,onClick:e=>e.stopPropagation(),size:e.size,fillMode:e.fillMode,rounded:e.rounded,prefix:()=>c.createElement(c.Fragment,null,c.createElement(l.InputPrefix,null,c.createElement(i.IconWrap,{name:"search",icon:n.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:p}))})),o&&c.createElement(l.InputSeparator,null))});return a?c.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:p}))}," ",h," "):h}));m.propTypes={value:s.oneOfType([s.string,s.number,s.array]),tabIndex:s.number,onChange:s.func,onKeyDown:s.func,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),renderListFilterWrapper:s.bool,renderPrefixSeparator:s.bool},m.displayName="KendoReactListFilter";const v=e=>{const{group:t,groupMode:s,render:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase,l=c.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:o}))},"classic"===s?t:c.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:o}))},t));return void 0!==a?a.call(void 0,l,e):l},f=e=>null!=e,b=(e,t,s)=>{if(!f(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},y=(e,t,s,i,a)=>{const n=e.offsetHeight,o=t.children.item(s),l=o.offsetTop+(a?i-e.scrollTop:0),r=o.offsetHeight;if(a){let t=0;l+r>n?t=l+r-n:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>n+e.scrollTop?e.scrollTop=l+r-n:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},C=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let a=0;a<e.length;a++){const n=(I(e[a],s)||"")+"";if(n&&n.toLowerCase().startsWith(t)){i=a;break}}}return i},x=(e,t,s,i=!1)=>{const a=e=>i?e:e.toLowerCase();return e.findIndex((e=>s?a(I(e,s))===a(t):a(t)===a(e.toString())))},I=(e,t)=>{if(t&&f(e)){const s=t.split(".");let i=e;return s.forEach((e=>{i=i?i[e]:void 0})),i}return e},k=(e,t,s)=>{t.forEach((t=>{const i=e.findIndex((e=>S(e,t,s)));-1!==i&&e.splice(i,1)}))},S=(e,t,s)=>e===t||f(e)===f(t)&&I(e,s)===I(t,s),w=(e,t,s)=>{if(t){const i=x(e,t,s,!0);return-1!==i?e[i]:e[C(e,t,s)]}return e[0]},E=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},D=(e,t,s)=>!!e==!!t&&e.text===t.text&&(e===t||((e=[],t=[],s)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!S(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),F=e=>{const{data:t=[],groupField:s}=e;return s?t.filter((e=>s&&void 0!==e[s])):t},K=e=>e.preventDefault(),N=e=>{const{selected:t,defaultItem:s,textField:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase;return c.createElement("div",{onClick:e.onClick,onMouseDown:K,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionLabel({c:o,selected:t}))},I(s,a)||"")},M=e=>{const{selected:t,group:s,dataItem:a,virtual:n,groupMode:o,disabled:l,id:r,focused:d,render:p}=e,h=i.useUnstyled(),u=h&&h.uDropDownsBase,g=c.createElement("li",{id:r,role:"option","aria-selected":t,"aria-disabled":!!l||void 0,className:i.classNames(i.uDropDownsBase.li({c:u,selected:t,focused:d,first:!!s&&"classic"===o,disabled:l})),onClick:t=>e.onClick(e.index,t),style:{position:n?"relative":"unset"}},c.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:u}))},I(a,e.textField).toString()),void 0!==s&&"classic"===o?c.createElement("div",{className:i.classNames(i.uDropDownsBase.itemGroupLabel({c:u}))},s):null);return void 0!==p?p.call(void 0,g,e):g},T=e=>{const{group:t,virtual:s,render:a,isMultiColumn:n=!1,id:o}=e,l=i.useUnstyled(),r=l&&l.uDropDownsBase,d=c.createElement("li",{id:o,role:"group",className:i.classNames(i.uDropDownsBase.groupLi({c:r,isMultiColumn:n})),style:n?{boxSizing:"inherit"}:{position:s?"relative":"unset"}},c.createElement("span",{className:a?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:r,isMultiColumn:n}))},t));return void 0!==a?a.call(void 0,d,e):d},P="dropdowns.nodata",O="dropdowns.clear",B="dropdowns.comboArrowBtnAriaLabelExpand",_="dropdowns.comboArrowBtnAriaLabelCollapse",R="dropdowns.dropDownListArrowBtnAriaLabel",L="dropdowns.apply",z="dropdowns.cancel",H={[O]:"clear",[P]:"NO DATA FOUND.",[B]:"expand combobox",[_]:"collapse combobox",[R]:"select",[L]:"Apply",[z]:"Cancel"},V=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,{id:n,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:p,listRef:h,wrapperRef:u,listClassName:g,ariaSetSize:m}=e,v=(()=>{const{textField:t,valueField:s,groupField:i,groupMode:a,isMultiColumn:n,optionsGuid:o,skip:l=0,virtual:r,focusedIndex:d,hasDuplicates:p,highlightSelected:h=!0,value:u,data:g,itemRender:m,groupHeaderItemRender:v}=e,f=Array.isArray(u);let b=0;return g.map(((y,C)=>{const x=l+C,k=l+C+b,w=p?!!u&&d===C:!y.disabled&&(h&&(!f&&S(y,u,s)||f&&-1!==u.findIndex((e=>S(e,y,s)))));let E,D,F;return C>0&&void 0!==i&&(D=I(y,i),F=I(g[C-1],i),D&&F&&D!==F&&(E=D)),void 0!==E&&"modern"===a&&(b+=1),[void 0!==E&&"modern"===a&&c.createElement(T,{id:`option-${o}-${k}`,virtual:r,key:x+"-group-item",group:E,isMultiColumn:n,render:v}),c.createElement(M,{id:`option-${o}-${void 0!==E&&"modern"===a?k+1:k}`,virtual:r,dataItem:y,groupMode:a,selected:w,focused:d===C,index:x,key:x,onClick:e.onClick,textField:t,group:E,render:m,disabled:y.disabled})]}))})();return v.length?c.createElement("div",{className:l,style:d,ref:u,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},c.createElement("ul",{id:n,role:"listbox","aria-hidden":!o||void 0,"aria-setsize":m,className:g||i.classNames(i.uDropDownsBase.ul({c:a})),ref:h,style:p},v),e.scroller&&c.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:a}))},e.scroller)):(()=>{const s=e.noDataRender,n=c.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:a}))},c.createElement("div",null,t.toLanguageString(P,H[P])));return s?s.call(void 0,n):n})()},q="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);let A=class{constructor(){this.table=null,this.total=0,this.enabled=!1,this.skip=0,this.pageSize=0,this.PageChange=null,this.scrollElement=null,this.listTransform="",this.itemHeight=0,this.containerHeight=0,this.reactVersion=Number.parseFloat(c.version),this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.listTranslate=0,this.list=null,this.container=null,this.calcScrollElementHeight=()=>{var e;this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight;const s=this.itemHeight*this.total-((null==(e=this.list)?void 0:e.offsetHeight)||0);this.containerHeight=q?Math.min(17895697,s):s;const i=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==i+"px",t&&(this.scrollElement.style.height=i+"px")),this.scrollSyncing=!1,t},this.scrollerRef=e=>{this.container=e,e&&(e.setAttribute("unselectable","on"),window.setTimeout(this.calcScrollElementHeight.bind(this),0))},this.getRowHeightService=i.memoizeOne(((e,t)=>new i.RowHeightService(t,e,0))),this.firstLoaded=this.pageSize,this.lastLoaded=this.skip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}translateTo(e,t){this.listTranslate=e,this.enabled&&this.list&&(q||this.reactVersion<=17||t?this.list.style.transform="translateY("+e+"px)":this.listTransform="translateY("+e+"px)")}changePage(e,t){const s=Math.min(Math.max(0,e),this.total-this.pageSize);s!==this.skip&&this.PageChange&&this.PageChange({skip:s,take:this.pageSize},t)}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0,!0))}scrollToEnd(){if(this.container&&this.list){this.calcScrollElementHeight();const{scrollHeight:e,offsetHeight:t}=this.container;this.container.scrollTop=e,this.translateTo(e-t,!0)}}scrollHandler(e){if(!this.enabled||!this.container||!this.list)return;if(this.scrollSyncing)return void(this.scrollSyncing=!1);this.rowHeightService=this.getRowHeightService(this.itemHeight,this.total);const t=this.container.scrollTop,s=this.lastScrollTop>=t,i=!s,a=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let n=this.rowHeightService.index(t),o=this.rowHeightService.offset(n);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=n+this.pageSize-this.total;t>0&&(n-=t,o=this.rowHeightService.offset(n)),this.firstLoaded=n,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&n-1<=this.firstLoaded){const t=a===this.itemHeight;if(0===this.skip&&t)this.lastScrollTop=0,this.firstLoaded=0,this.lastLoaded=this.pageSize,this.container.scrollTop=0,this.translateTo(0,!0);else{const t=Math.floor(.3*this.pageSize);this.firstLoaded=Math.max(n-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}},W=class{navigate(e){const t=e.keyCode;return t===i.Keys.up||t===i.Keys.left?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:-1}):t===i.Keys.down||t===i.Keys.right?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:1}):t===i.Keys.home?0:t===i.Keys.end?e.max:void 0}next(e){return f(e.current)?Math.min(e.max,Math.max(e.current+e.step,e.min)):e.min}};const U=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new A,this.navigation=new W,this.handleItemClick=(e,t)=>{const s=this.initState();s.syntheticEvent=t,t.stopPropagation(),this.component.handleItemSelect(e,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=e=>{if(!this.component.state.focused){const t=this.initState();t.data.focused=!0,t.events.push({type:"onFocus"}),t.syntheticEvent=e,this.applyState(t)}},this.filterChanged=(e,t)=>{const{textField:s,filterable:i}=this.component.props;i&&t.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:e}})},this.togglePopup=e=>{const t=this.component.props,s=void 0!==t.opened?t.opened:this.component.state.opened;void 0===t.opened&&(e.data.opened=!s),s?e.events.push({type:"onClose"}):(e.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(e,t)=>{const s=this.initState();s.syntheticEvent=t,this.triggerOnPageChange(s,e.skip,e.take),this.applyState(s)},this.scrollToVirtualItem=(e,t)=>{const s=this.vs;if(0===e.skip)s.reset();else{let i=s.translate;0===i&&(s.calcScrollElementHeight(),i=s.itemHeight*e.skip,s.translateTo(i,!0)),t<0&&i>0&&(i+=s.itemHeight*(e.pageSize/4)),s.container&&(s.container.scrollTop=i),this.scrollToItem(t,!0)}},this.scrollPopupByPageSize=e=>{var t,s,i,a,n,o;const l=this.vs,r=null==(s=null==(t=this.list)?void 0:t.parentElement)?void 0:s.scrollTop,d=l.enabled&&l.itemHeight?l.itemHeight:this.list?this.list.children[0].offsetHeight:0,p=null==(a=null==(i=this.list)?void 0:i.parentElement)?void 0:a.offsetHeight;void 0!==r&&void 0!==p&&(null==(o=null==(n=this.list)?void 0:n.parentElement)||o.scroll({top:r+e*Math.floor(p/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&c.createElement("div",{ref:t=>e.scrollElement=t,key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({...t.state,group:e})},this.listBoxId=e.props.id+"list",this.guid=e.props.id,this.component=e,this.vs.PageChange=this.pageChange}didUpdate(){this.vs.listTransform&&this.vs.list&&(this.vs.list.style.transform=this.vs.listTransform,this.vs.listTransform="")}didMount(){const e=this.component.props,t=e.popupSettings||{},s=e.style||{},i=t.width;let a=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),a=!0),a&&this.component.forceUpdate()}calculateDir(){const e=this.component.element;e&&e.ownerDocument&&e.ownerDocument.defaultView&&(this.dirCalculated=e.ownerDocument.defaultView.getComputedStyle(e).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(e,t,s){const i=this.list||this.vs.list;if(!i&&!s&&setTimeout((()=>{this.scrollToItem(e,t,!0)}),10),0===e&&t&&0===this.vs.skip)this.vs.reset();else if(i&&e>=0){const s=this.vs,a=s.container||i.parentNode,n=void 0!==t?t:s.enabled;y(a,i,e,s.translate,n)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(e){Object.keys(e.data).length>0&&this.component.setState(e.data);const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.syntheticEvent?e.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};e.events.forEach((e=>{const s=e.type;delete e.type;const i=s&&this.component.props[s];i&&i.call(void 0,{...t,...e})}))}triggerOnPageChange(e,t,s){const i=this.component.props.virtual;if(i){const a=Math.min(Math.max(0,t),Math.max(0,i.total-s));a!==i.skip&&e.events.push({type:"onPageChange",page:{skip:a,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:a,virtual:n}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&n&&this.vs.enabled&&(n.skip>0&&S(e,i[0],a)?this.triggerOnPageChange(t,n.skip-1,n.pageSize):!o&&n.skip+n.pageSize<n.total&&S(e,i[i.length-1],a)&&this.triggerOnPageChange(t,n.skip+1,n.pageSize))}getPopupSettings(){return Object.assign({},e.defaultProps.popupSettings,this.component.props.popupSettings)}getAdaptiveAnimation(){const e=this.getPopupSettings();return void 0===e.animate||e.animate}getGroupedDataModernMode(e,t){const s=[];return e.forEach(((i,a)=>{e[a-1]&&i[t]!==e[a-1][t]&&s.push({[t]:i[t]}),s.push(e[a])})),s}};U.basicPropTypes={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,textField:s.string,className:s.string,label:s.string,loading:s.bool,popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,itemRender:s.func,listNoDataRender:s.func,focusedItemIndex:s.func,header:s.node,footer:s.node},U.propTypes={...U.basicPropTypes,value:s.any,defaultValue:s.any,filterable:s.bool,filter:s.string,virtual:s.shape({pageSize:s.number.isRequired,skip:s.number.isRequired,total:s.number.isRequired}),onFilterChange:s.func,onPageChange:s.func},U.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let $=U;const G={name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654528156,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},j=500,Y=768,J=class e extends c.Component{constructor(e){super(e),this.state={},this._element=null,this.base=new $(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus({preventScroll:!0})},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i,defaultItem:a}=this.props,n=F(this.props),o=s?s.skip:0,l=-1===e&&void 0!==a?a:n[e-o],r=!S(l,this.value,i);this.triggerOnChange(l,t),r&&this.base.triggerPageChangeCornerItems(l,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.dummySelect=e=>c.createElement("select",{name:this.props.name,ref:e=>{this._select=e},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},c.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,e):e})),this.renderListContainer=()=>{const{header:e,footer:t,dir:s,size:a,groupField:n,groupStickyHeaderItemRender:o,list:l,unstyled:r}=this.props,d=F(this.props),p=this.base,h=p.getPopupSettings(),u=void 0!==this.props.opened?this.props.opened:this.state.opened,m=void 0!==h.width?h.width:p.popupWidth,f=r&&r.uDropDownList,b={dir:void 0!==s?s:p.dirCalculated,width:m,popupSettings:{...h,popupClass:i.classNames(h.popupClass,i.uDropDownList.listContainer({c:f})),anchor:h.anchor||this.element,show:u,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,onMouseDownOutside:this.onPopupMouseDown},itemsCount:[d.length]};let{group:y}=this.state;return void 0===y&&void 0!==n&&(y=I(d[0],n)),c.createElement(g,{...b},this.renderListFilter(),e&&c.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:f}))},e),c.createElement("div",{className:i.classNames(i.uDropDownList.list({c:f,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!l&&y&&0!==d.length&&c.createElement(v,{group:y,groupMode:"modern",render:o}),this.renderList()),t&&c.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:f}))},t))},this.renderList=()=>{const{textField:e,dataItemKey:t,virtual:s={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:n,itemRender:o,unstyled:l}=this.props,r=F(this.props),d=l&&l.uDropDownList,p=this.base.vs,h=s.skip,u=void 0!==this.props.opened?this.props.opened:this.state.opened,g=this.base.getPopupSettings(),m=`translateY(${p.translate}px)`;return c.createElement(V,{id:this._listboxId,show:u,data:r.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:t,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>p.list=this.base.list=e,wrapperStyle:{maxHeight:g.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:d})),listStyle:p.enabled?{transform:m}:void 0,key:"listkey",skip:h,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:a,noDataRender:n,onScroll:this.onScroll,wrapperRef:p.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:s.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=F(this.props);if(i&&a.length&&i){const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;a=this.base.getGroupedDataModernMode(a,i);let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&this.setState({group:l})}},this.renderListFilter=()=>{const e=void 0!==this.props.filter?this.props.filter:this.state.text;return this.props.filterable&&c.createElement(m,{value:e,ref:e=>this._filterInput=e&&e.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,renderListFilterWrapper:!0})},this.renderDefaultItem=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=this.props;return void 0!==t&&c.createElement(N,{defaultItem:t,textField:e,selected:S(this.value,t,s),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=e=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout((()=>this.searchState.word=""),this.props.delay),this.selectNext(e))},this.selectNext=e=>{const{dataItemKey:t}=this.props,s=F(this.props);let i=s.map(((e,t)=>({item:e,itemIndex:t})));const a=this.searchState.word,n=this.searchState.last,o=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(a,n);let l,r=i.length,d=Math.max(0,s.findIndex((e=>S(e,this.value,t))));this.props.defaultItem&&(l={item:this.props.defaultItem,itemIndex:-1},r+=1,d+=1),d+=o?1:0,i=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(i,d,l);let p,h,u,c=0;const{textField:g,ignoreCase:m}=this.props;for(;c<r;c++)if(p=I(i[c].item,g),h=o&&b(p,n,m),u=b(p,a,m),h||u){c=i[c].itemIndex;break}if(c!==r){const t=this.base.initState();t.syntheticEvent=e,this.handleItemSelect(c,t),this.applyState(t),this._valueDuringOnChange=void 0}},this.handleKeyDown=e=>{e&&e.target instanceof Element&&"INPUT"===e.target.nodeName&&e.stopPropagation&&e.stopPropagation();const{filterable:t,disabled:s,defaultItem:a,leftRightKeysNavigation:n=!0,virtual:o={skip:0,total:0,pageSize:0},dataItemKey:l,groupField:r="",textField:d,skipDisabledItems:p=!0}=this.props,h=F(this.props),u=this.value,c=h.findIndex((e=>S(e,u,l))),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=e.keyCode,v=m===i.Keys.home||m===i.Keys.end,f=m===i.Keys.up||m===i.Keys.down,b=!g&&(e.altKey&&m===i.Keys.down||m===i.Keys.enter||m===i.Keys.space),y=g&&(e.altKey&&m===i.Keys.up||m===i.Keys.esc),C=n&&(m===i.Keys.left||m===i.Keys.right),x=f||C&&!t||v,I=this.base.initState();if(I.syntheticEvent=e,!s){if(v&&this.base.vs.enabled)m===i.Keys.home?0!==o.skip?(this.base.triggerOnPageChange(I,0,o.pageSize),this._navigated=!0):this.triggerOnChange(h[0],I):o.skip<o.total-o.pageSize?(this.base.triggerOnPageChange(I,o.total-o.pageSize,o.pageSize),this._navigated=!0):this.triggerOnChange(h[h.length-1],I);else if(g&&m===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(g&&m===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if(g&&m===i.Keys.enter){const t=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(h,t)?(this.triggerOnChange(null,I),this.applyState(I)):this.handleItemSelect(t,I),this.base.togglePopup(I),e.preventDefault()}else if(b||y)y&&this.resetValueIfDisabledItem(),this.base.togglePopup(I),e.preventDefault();else if(x){if(this._lastKeypressIsFilter=!1,""!==r&&d)if(!p&&g)this.onNavigate(I,m);else{let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(c+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===c&&a)e=-1;else if(-1===c)t=h,e=h.findIndex((e=>!e.disabled&&e[d]));else{t=h.slice(0,c);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-c;this.onNavigate(I,m,t)}else void 0===e&&h.findIndex((e=>e[d]===u[d]))===h.length-1&&this.onNavigate(I,m)}else if(!p&&g||v)this.onNavigate(I,m);else if(d){let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(c+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===c&&a)e=-1;else if(-1===c)t=h,e=h.find((e=>!e.disabled&&e[d]));else{t=h.slice(0,c);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-c;this.onNavigate(I,m,t)}else void 0===e&&h.findIndex((e=>e[d]===u[d]))===h.length-1&&this.onNavigate(I,m)}else this.onNavigate(I,m);e.preventDefault()}this.applyState(I)}},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{if(this._skipFocusEvent||!this.state.focused)return;const t=void 0!==this.props.opened?this.props.opened:this.state.opened,{adaptive:s}=this.props,{windowWidth:i=0}=this.state,a=i<=Y&&s,n=this.base.initState();n.syntheticEvent=e,n.data.focused=!1,n.events.push({type:"onBlur"}),t&&this.resetValueIfDisabledItem(),t&&!a&&this.base.togglePopup(n),this.applyState(n)},this.handleDefaultItemClick=e=>{const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.triggerOnChange(this.props.defaultItem,t),this.applyState(t)},this.handleWrapperClick=e=>{if(e.isPropagationStopped())return;const t=this.base.initState();t.syntheticEvent=e,this.state.focused||(t.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(t),this.applyState(t)},this.handleKeyPress=e=>{if(this.props.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);this.props.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),this.searchState={word:this.searchState.word+t,last:this.searchState.last+t},this.search(e)},this.handleListFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,void 0===this.props.filter&&(t.data.text=e.target.value),this.base.filterChanged(e.target.value,t),this._lastKeypressIsFilter=!0,this.applyState(t),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout((()=>{this._filterInput&&this.focusElement(this._filterInput)}),300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout((()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)}))},this.onPopupMouseDown=e=>{var t;null!=(t=this.props.popupSettings)&&t.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,e)},this.togglePopup=()=>{const e=this.base.initState();e.data.opened=this.state.opened,this.base.togglePopup(e),this.applyState(e)},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please select a value from the list!")},i.validatePackage(G)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let e;return void 0!==this._valueDuringOnChange?e=this._valueDuringOnChange:void 0!==this.props.value?e=this.props.value:void 0!==this.state.value?e=this.state.value:void 0!==this.props.defaultValue&&(e=this.props.defaultValue),!f(e)&&void 0!==this.props.defaultItem&&(e=this.props.defaultItem),e}get index(){const{dataItemKey:e}=this.props,t=F(this.props),s=this.value;return t.findIndex((t=>S(t,s,e)))}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&""!==this.value&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{dataItemKey:i,virtual:a,groupField:n="",textField:o}=this.props,l=F(this.props),r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,h=!p&&d;if(this.base.didUpdate(),this.base.getPopupSettings().animate||h&&this.onPopupOpened(),a&&a.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=this.value,u=void 0!==e.value?e.value:t.value;let c=l.findIndex((e=>S(e,r,i)));""!==n&&r&&o&&(c=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(r[o]));const g=!S(u,r,i);h&&a?this.base.scrollToVirtualItem(a,c):h&&!a?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(c)):d&&p&&r&&g&&!this._navigated?this.base.scrollToItem(c,this.base.vs.enabled):d&&p&&this._navigated&&(this._navigated&&a&&0===a.skip?this.base.vs.reset():this._navigated&&a&&a.skip===a.total-a.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const e=r.provideLocalizationService(this).toLanguageString(R,H[R]),{style:t,className:s,label:o,dir:l,virtual:p,size:h,rounded:u,fillMode:g,adaptive:m,unstyled:v}=this.props,{windowWidth:f=0}=this.state,b=void 0!==this.props.opened?this.props.opened:this.state.opened,y=this.value,C=I(y,this.props.textField),x=!this.validityStyles||this.validity.valid,k=this.base,w=k.vs,E=f<=Y&&m,D=v&&v.uDropDownList;w.enabled=void 0!==p,void 0!==p&&(k.vs.skip=p.skip,k.vs.total=p.total,k.vs.pageSize=p.pageSize);const{dataItemKey:K,disabled:N,tabIndex:M,loading:T,iconClassName:P,svgIcon:O,valueRender:B}=this.props,_=F(this.props),{focused:L}=this.state,z=_.findIndex((e=>S(e,y,K))),V=c.createElement("span",{id:this._inputId,className:i.classNames(i.uDropDownList.inputInner({c:D}))},C&&c.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:D}))},C)),q=void 0!==B?B.call(void 0,V,y):V,A=c.createElement(c.Fragment,null,c.createElement("span",{ref:this.componentRef,className:i.classNames(i.uDropDownList.wrapper({c:D,size:h,rounded:u,fillMode:g,focused:L,disabled:N,invalid:!x,loading:T,required:this.required}),s),style:o?{...t,width:void 0}:t,dir:l,onMouseDown:b?e=>{"INPUT"!==e.target.nodeName&&(this.focusElement(this.base.wrapper),e.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:i.getTabIndex(M,N),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:N?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":N||void 0,"aria-haspopup":"listbox","aria-expanded":b||!1,"aria-owns":this._listboxId,"aria-activedescendant":b?"option-"+this._guid+"-"+(z+(p?p.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,"aria-controls":this._listboxId,id:this.props.id,title:this.props.title},q,T&&c.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:D})),name:"loading"}),c.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":e,size:h,fillMode:g,iconClass:P,className:i.classNames(i.uDropDownList.inputButton({c:D})),rounded:null,themeColor:"base",icon:P?void 0:"caret-alt-down",svgIcon:O||n.caretAltDownIcon,onMouseDown:e=>this.state.focused&&e.preventDefault()}),this.dummySelect(y),!E&&this.renderListContainer()),E&&this.renderAdaptiveListContainer());return o?c.createElement(a.FloatingLabel,{label:o,editorValue:C,editorValid:x,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:A}):A}onNavigate(e,t,s){const{defaultItem:i,dataItemKey:a,virtual:n={skip:0,total:0,pageSize:0}}=this.props,o=F(this.props),l=this.base.vs,r=this.value,d=o.findIndex((e=>S(e,r,a))),p=this.base.navigation.navigate({current:n.skip+d,max:(l.enabled?n.total:o.length)-1,min:void 0!==i?-1:0,keyCode:t,skipItems:s||void 0});void 0!==p&&this.handleItemSelect(p,e),this.applyState(e)}renderAdaptiveListContainer(){const{windowWidth:e=0}=this.state,{header:t,footer:s,size:a,adaptiveTitle:o,groupField:l,groupStickyHeaderItemRender:r,list:h,unstyled:u}=this.props,g=F(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=u&&u.uDropDownList,b=u&&u.uDropDownsActionSheet,y={navigatable:!1,navigatableElements:[],expand:m,animation:!0,onClose:e=>this.handleWrapperClick(e),animationStyles:e<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:b,isFullScreen:e<=j}))};let{group:C}=this.state;return void 0===C&&void 0!==l&&(C=I(g[0],l)),c.createElement(p.ActionSheet,{...y},c.createElement(p.ActionSheetHeader,{className:i.classNames(i.uDropDownsActionSheet.header({c:b}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:b}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:b}))},c.createElement("div",null,o)),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:b}))},c.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:n.xIcon}))),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:b}))},this.renderListFilter())),c.createElement(p.ActionSheetContent,{overflowHidden:!0},t&&c.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:f}))},t),c.createElement("div",{className:i.classNames(i.uDropDownList.list({c:f,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!h&&C&&0!==g.length&&c.createElement(v,{group:C,groupMode:"modern",render:r}),this.renderList()),s&&c.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:f}))},s)))}getFocusedIndex(){const e=this.value,{textField:t,dataItemKey:s,virtual:i={skip:0},focusedItemIndex:a=C,filterable:n,skipDisabledItems:o=!0}=this.props,l=F(this.props),r=this.props.filter?this.props.filter:this.state.text;return o&&t&&!r&&!e?l.findIndex((e=>!e.disabled&&e[t])):f(e)&&void 0===r||n&&""===r?l.findIndex((t=>S(t,e,s))):r?this._lastKeypressIsFilter?a(l,r,t):l.findIndex((t=>S(t,e,s))):0===i.skip?0:-1}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),30)}triggerOnChange(e,t){S(this.value,e,this.props.dataItemKey)||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}resetValueIfDisabledItem(){const e=F(this.props),t=this.base.initState(),s=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(e,s)&&(this.triggerOnChange(null,t),this.applyState(t))}haveFocusedItemAndDataNotEmpty(e,t){return void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled}};J.displayName="DropDownList",J.propTypes={delay:s.number,ignoreCase:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,defaultItem:s.any,valueRender:s.func,valueMap:s.func,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,leftRightKeysNavigation:s.bool,title:s.string,groupField:s.string,list:s.any,skipDisabledItems:s.bool,renderListFilterWrapper:s.bool,...$.propTypes},J.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...$.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};let Q=J;const X=i.createPropsContext(),Z=i.withIdHOC(i.withPropsContext(X,i.withUnstyledHOC(Q)));Z.displayName="KendoReactDropDownList";let ee=class extends c.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:a,suggestedText:n,focused:o}=this.props,l=this.input,r=t!==a||n!==s,d=r&&t.startsWith(a)&&!(s&&n&&s.endsWith(n)),p=i.getActiveElement(document);o&&l&&p!==l&&l.focus(),n&&r&&!d&&l&&l.setSelectionRange(a.length-n.length,a.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:a,tabIndex:n,accessKey:o,unstyled:l}=this.props,r=l&&l.uDropDownsBase,d={tabIndex:n,accessKey:o},p=c.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:i.classNames(i.uDropDownsBase.inputInner({c:r})),role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:e=>this._input=e,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":t||void 0,disabled:t||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":e,"aria-owns":this.props.owns,"aria-activedescendant":e?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.ariaRequired,"aria-controls":this.props.ariaControls,...d});return a?a.call(void 0,p):p}};const te=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,o=t.toLanguageString(O,H[O]);return c.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:a})),role:"button",onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},c.createElement(i.IconWrap,{name:"x",icon:n.xIcon}))},se=i.useCustomComponent,ie=class e extends c.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.focus=()=>{this._input&&this._input.focus()},this.checkForDuplicatePlainTextRecords=()=>{const e=void 0!==this.props.textField,t=void 0!==this.props.dataItemKey;if(this.props.data&&this.props.data.length>0&&!e&&!t){const e=this.props.data;this.duplicates=(e=>{const t=e.filter(((t,s)=>e.some(((e,i)=>e===t&&i!==s))));return Array.from(new Set(t))})(e),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i}=this.props,a=F(this.props)[e-(s?s.skip:0)],n=this.hasDuplicates||!S(a,this.value,i);this.triggerOnChange(a,t),void 0!==this.state.text&&(t.data.text=void 0),n&&this.base.triggerPageChangeCornerItems(a,t)},this.onPopupOpened=()=>{setTimeout((()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)}),300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{skipDisabledItems:t,textField:s}=this.props,i=F(this.props),a=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(s,i,a),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&n&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(l),!o&&this.mobileMode){const e=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(e,l)}this.applyState(l)},this.closeOpenedApplyStateNonMobileMode=(e,t)=>{t&&!this.mobileMode&&this.base.togglePopup(e)},this.renderMobileListFilter=()=>{const e=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text,t=I(this.value,this.props.textField),s=f(e)?e:t;return c.createElement(m,{value:s,ref:e=>this._adaptiveFilterInput=e&&e.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:"large",rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,t.data.text=e.target.value,this.base.filterChanged(e.target.value,t),this.applyState(t)},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=F(this.props);if(!i||!a.length)return;const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;"modern"===this.props.groupMode&&(a=this.base.getGroupedDataModernMode(a,i));let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&(this.setState({group:l}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:l}))},this.handleItemClick=(e,t)=>{this.navigationIndex=e,this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleBlur=e=>{if(this.state.focused&&!this._skipBlur){const t=this.base.initState(),{textField:s}=this.props,i=F(this.props),a=this.getFocusedIndex(),n=!(-1===a)&&this.getCurrentValueDisabledStatus(s,i,a);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&n&&this.clearValueOnBlur(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,t)}},this.onInputClick=e=>{const t=void 0!==this.props.opened?this.props.opened:this.state.opened,s=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text||null;if(!t&&this.mobileMode){const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.base.filterChanged(s,t),this.applyState(t)}},this.onInputKeyDown=e=>{const{skipDisabledItems:t,textField:s,dataItemKey:a,groupField:n}=this.props,o=F(this.props),l=this.value,r=Math.max(0,o.findIndex((e=>S(e,l,a)))),d=e.keyCode,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=this.base.initState();if(h.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==n&&s)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=0;if(d===i.Keys.down||d===i.Keys.right){const t=o.slice(r+1<o.length?r+1:r).find((e=>!e.disabled&&e[s]));e=t&&o.findIndex((e=>e[s]===t[s]))}else if(d===i.Keys.up||d===i.Keys.left){let t;if(0===r)t=o,e=o.findIndex((e=>!e.disabled&&e[s]));else{t=o.slice(0,r);let i=t.pop();for(;i&&i.disabled;)i=t.pop();e=i&&o.findIndex((e=>e[s]===i[s]))}}if(void 0!==e){const t=e-r;this.onNavigate(h,d,t)}else void 0===e&&o.findIndex((e=>e[s]===l[s]))===o.length-1&&this.onNavigate(h,d)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=null;if(d===i.Keys.down||d===i.Keys.right)e=o.slice(r+1).find((e=>!e.disabled));else if(d===i.Keys.up||d===i.Keys.left){const t=o.slice(0,r);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-r-1;this.onNavigate(h,d,t)}else this.onNavigate(h,d)}this.applyState(h)}const u=()=>{e.preventDefault(),this.base.togglePopup(h),this.applyState(h)},c=this.getFocusedIndex(),g=-1===c,m=!g&&this.getCurrentValueDisabledStatus(s,o,c);p?d===i.Keys.pageUp?(e.preventDefault(),this.base.scrollPopupByPageSize(-1)):d===i.Keys.pageDown?(e.preventDefault(),this.base.scrollPopupByPageSize(1)):e.altKey&&d===i.Keys.up?u():d===i.Keys.enter?(e.preventDefault(),(s&&!g&&e.currentTarget.value?o[c][s]:void 0)?!t&&s&&m?this.clearValueOnEnterOrEsc(e):m||this.applyValueOnEnter(e.currentTarget.value,h):this.applyValueOnEnter(e.currentTarget.value,h)):d===i.Keys.esc&&(!t&&s&&m&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,h)):p||d!==i.Keys.esc?e.altKey&&d===i.Keys.down&&u():this.clearValueOnEnterOrEsc(e)},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const s=void 0!==this.props.opened?this.props.opened:this.state.opened,i=e.currentTarget,a=i.value;if(this.props.suggest){const e=i.selectionEnd===a.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;f(t)||(t=I(this.value,this.props.textField)||"");const s=t&&t===a,n=t&&t.length>a.length;s||n||!e?this._suggested="":this.suggestValue(a)}void 0===this.props.filter&&(t.data.text=a),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s||this.base.togglePopup(t),this.base.filterChanged(a,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnBlur=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},i.validatePackage(G)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Y&&this.props.adaptive)}get value(){return void 0!==this._valueDuringOnChange?this._valueDuringOnChange:void 0!==this.props.value?this.props.value:void 0!==this.state.value?this.state.value:void 0!==this.props.defaultValue?this.props.defaultValue:void 0}get index(){const{dataItemKey:e}=this.props,t=F(this.props),s=this.value;return t.findIndex((t=>S(t,s,e)))}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&""!==this.value&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{dataItemKey:i,virtual:a,groupField:n="",textField:o}=this.props,l=F(this.props),r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened;e.data!==l&&this.checkForDuplicatePlainTextRecords();const h=!p&&d,u=this.value;if(this._valueOnDidUpdate=u,this.base.didUpdate(),a&&a.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=void 0!==e.value?e.value:t.value;let c=this.hasDuplicates?this.navigationIndex||0:l.findIndex((e=>S(e,u,i)));"modern"===this.props.groupMode&&o&&u&&(c=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(u[o]));const g=!S(r,u,i);h&&a?this.base.scrollToVirtualItem(a,c):h&&!a?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(c)):(this.hasDuplicates||d&&p&&u&&g)&&this.base.scrollToItem(c)}h&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body),this.checkForDuplicatePlainTextRecords()}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const t=r.provideLocalizationService(this).toLanguageString(B,H[B]),s=r.provideLocalizationService(this).toLanguageString(_,H[_]),{dir:o,disabled:l,clearButton:p=e.defaultProps.clearButton,label:h,textField:u,className:g,style:m,loading:v,iconClassName:b,virtual:y,size:C,rounded:x,fillMode:k,opened:S=this.state.opened,placeholder:w,svgIcon:E,unstyled:D}=this.props,F=!this.validityStyles||this.validity.valid,K=void 0!==this.props.filter?this.props.filter:this.state.text,N=I(this.value,u),M=f(K)?K:N,T=p&&(!!M||f(this.value)),P=this.base.vs,O=this.props.id||this._inputId,R=this.mobileMode,L=D&&D.uComboBox;P.enabled=void 0!==y,void 0!==y&&(P.skip=y.skip,P.total=y.total,P.pageSize=y.pageSize);const[z,V]=se(this.props.prefix||c.Fragment),[q,A]=se(this.props.suffix||c.Fragment),W=c.createElement(c.Fragment,null,c.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:L,size:C,rounded:x,fillMode:k,disabled:l,invalid:!F,loading:v,required:this.required}),g),ref:this.componentRef,style:h?{...m,width:void 0}:m,dir:o},this.props.prefix&&c.createElement(z,{...V}),this.renderSearchBar(M||"",O,w),T&&!v&&c.createElement(te,{onClick:this.clearButtonClick,key:"clearbutton"}),v&&c.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:L})),name:"loading",key:"loading"}),this.props.suffix&&c.createElement(q,{...A}),c.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":S?s:t,icon:b?void 0:"caret-alt-down",svgIcon:E||n.caretAltDownIcon,iconClass:b,size:C,fillMode:k,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:L})),onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!R&&this.renderListContainer()),R&&this.renderAdaptiveListContainer());return h?c.createElement(a.FloatingLabel,{label:h,editorId:O,editorValue:M,editorValid:F,editorDisabled:l,style:{width:m?m.width:void 0},children:W,unstyled:D}):W}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,a=F(this.props),n=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const p=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(p),-1===l||f(d))if(""===n)this.handleItemSelect(0,e);else{const n=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:n,max:(r.enabled?r.total:a.length)-1,min:0,skipItems:s||void 0}),void 0!==o&&this.handleItemSelect(o,e)}else this.handleItemSelect(l,e);this.navigationIndex=o}getCurrentValueDisabledStatus(e,t,s){return e&&t&&t[s]&&t[s].disabled}applyValueOnEnter(e,t){const{textField:s,allowCustom:i}=this.props,a=F(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s)===e?this.index:x(a,e,s),l=-1!==o;let r;if(this._suggested="",l)r=a[o];else{if(!i)return this.selectFocusedItem(e,t);r=void 0!==s?{[s]:e}:e}this.triggerOnChange(r,t),n&&this.base.togglePopup(t),void 0===this.props.filter&&void 0!==this.state.text&&(t.data.text=void 0),this.applyState(t)}applyValueOnRejectSuggestions(e,t){const{textField:s,allowCustom:i}=this.props,a=F(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s);if(this._suggested="",e===o||""===e&&!f(o))return this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t);const l=x(a,e,s,!0);let r=null;-1!==l?r=a[l]:i&&(r=e?s?{[s]:e}:e:null),this.triggerOnChange(r,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:a={skip:0},focusedItemIndex:n=C}=this.props,o=F(this.props),l=a.skip,r=""===e&&0===l?0:n(o,e,i);return-1!==r?this.handleItemSelect(r+l,t):(this.triggerOnChange(null,t),void 0!==this.state.text&&(t.data.text=void 0)),s&&this.base.togglePopup(t),this.applyState(t)}renderAdaptiveListContainer(){const{windowWidth:e=0}=this.state,{header:t,footer:s,size:a,groupField:o,groupMode:l,list:r,virtual:h,adaptiveTitle:u,groupStickyHeaderItemRender:g,unstyled:m}=this.props,f=F(this.props),b=void 0!==this.props.opened?this.props.opened:this.state.opened,y=this.base.getAdaptiveAnimation(),C=m&&m.uComboBox,x=m&&m.uDropDownsActionSheet;let{group:k}=this.state;void 0===k&&void 0!==o&&(k=I(f[0],o));const S={navigatable:!1,navigatableElements:[],expand:b,animation:y,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:x,isFullScreen:e<=j}))};return c.createElement(p.ActionSheet,{...S},c.createElement(p.ActionSheetHeader,null,c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:x}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:x}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:x}))},u),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:x}))})),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:x}))},c.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",themeColor:"base",size:"large",onClick:this.toggleBtnClick,icon:"x",svgIcon:n.xIcon}))),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:x}))},this.renderMobileListFilter())),c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:C}))},c.createElement("div",{className:i.classNames(i.uComboBox.list({c:C,list:r,size:"large",tableSize:a,virtual:h}))},t&&c.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:C}))},t),!r&&k&&0!==f.length&&c.createElement(v,{group:k,groupMode:l,render:g}),this.renderList(),s&&c.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:C}),this.props.footerClassName)},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,groupField:n,groupMode:o,size:l,list:r,virtual:d,groupStickyHeaderItemRender:p,unstyled:h}=this.props,u=F(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=e.getPopupSettings(),b=void 0!==f.width?f.width:e.popupWidth,y=h&&h.uComboBox;let{group:C}=this.state;return void 0===C&&void 0!==n&&(C=I(u[0],n)),c.createElement(g,{width:b,popupSettings:{...f,anchor:f.anchor||this.element,show:m,popupClass:i.classNames(f.popupClass,i.uComboBox.listContainer({c:y,popup:!0}))},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[u.length]},c.createElement("div",{className:i.classNames(i.uComboBox.list({c:y,list:r,size:l,tableSize:l,virtual:d}))},s&&c.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:y}))},s),!r&&C&&0!==u.length&&c.createElement(v,{group:C,groupMode:o,render:p}),this.renderList(),a&&c.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:y}),this.props.footerClassName)},a)))}renderList(){const e=this.base,{textField:t,dataItemKey:s,listNoDataRender:a,itemRender:n,groupHeaderItemRender:o,virtual:l={skip:0,total:void 0},unstyled:r}=this.props,d=F(this.props),p=e.getPopupSettings(),h=e.vs,u=l.skip,g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=`translateY(${h.translate}px)`,v=g?this.getFocusedIndex(this.hasDuplicates):void 0,b=void 0!==this.props.filter?this.props.filter:this.state.text,y=I(this.value,t),C=f(b)&&b!==y?null:this.value,x=this.props.list||V,k=r&&r.uComboBox;return c.createElement(x,{id:e.listBoxId,virtual:!!l,show:g,data:d,focusedIndex:v,value:C,textField:t,valueField:s,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,hasDuplicates:this.hasDuplicates,listRef:e=>{h.list=this.base.list=e,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>Y?{maxHeight:p.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:k,virtual:l})),listStyle:h.enabled?{transform:m}:void 0,key:"listkey",skip:u,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:o,noDataRender:a,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll,wrapperRef:h.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:l.total})}renderSearchBar(e,t,s){const{tabIndex:i,disabled:a,title:n,ariaLabelledBy:o,ariaDescribedBy:l,dataItemKey:r,virtual:d={skip:0},accessKey:p,unstyled:h}=this.props,u=F(this.props),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=this.value,v=Math.max(0,u.findIndex((e=>S(e,m,r))));this._suggested&&!S(this._valueOnDidUpdate,m,r)&&(this._suggested="");const f={accessKey:p};return c.createElement(ee,{id:t,readOnly:g&&this.mobileMode,placeholder:s,tabIndex:i,title:n,value:e+this._suggested,suggestedText:this._suggested,ref:e=>this._input=e&&e.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:a,expanded:g,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${v+d.skip}`,role:"combobox",ariaLabelledBy:o,ariaLabel:this.props.ariaLabel,ariaDescribedBy:l,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,unstyled:h,...f})}clearValue(){const e=this.base.initState();this._suggested="",this.navigationIndex=void 0,this.base.filterChanged("",e),void 0===this.props.filter&&void 0!==this.state.text&&(e.data.text=void 0),this.triggerOnChange(null,e);const t=void 0!==this.props.opened?this.props.opened:this.state.opened,s=this.mobileMode;t&&!s&&this.base.togglePopup(e),this.applyState(e)}triggerOnChange(e,t){const s=this.value;!this.hasDuplicates&&(!f(s)&&!f(e)||S(s,e,this.props.dataItemKey))||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}getFocusedIndex(e){const t=this.value,{textField:s,dataItemKey:i,virtual:a={skip:0},focusedItemIndex:n=C,skipDisabledItems:o}=this.props,l=F(this.props),r=this.props.filter?this.props.filter:this.state.text;return e&&void 0!==this.navigationIndex?this.navigationIndex:f(t)&&void 0===r?l.findIndex((e=>S(e,t,i))):r?n(l,r,s):o&&s&&!r&&0===a.skip?l.findIndex((e=>!e.disabled&&e[s])):0===a.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const a=t[C(t,e,s)];if(a){const t=I(a,s);e.toLowerCase()!==t.toLowerCase()&&(i=t.substring(e.length))}}return i})(e,t,s)}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ie.displayName="ComboBox",ie.propTypes={...$.propTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,groupMode:s.oneOf([void 0,"classic","modern"]),isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,clearButton:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},ie.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ae=ie;const ne=i.createPropsContext(),oe=i.withIdHOC(i.withPropsContext(ne,i.withUnstyledHOC(ae)));oe.displayName="KendoReactComboBox";const{sizeMap:le,roundedMap:re}=i.kendoThemeMaps,de=class e extends c.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const s=F(this.props),i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=F(this.props)[e];S(this.state.focusedItem,i,s)||(t.data.focusedItem=i)},this.togglePopup=e=>{this.base.togglePopup(e)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let i=F(this.props);if(!s||!i.length)return;const a=this.itemHeight||(t?t.children[0].offsetHeight:0),n=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(a*e>n);e++)i[e]&&i[e][s]&&(o=i[e][s]);o!==this.state.group&&this.setState({group:o})},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.onChangeHandler=e=>{const t=this.base.initState(),s=e.currentTarget,i=s.value,a=s.selectionEnd===i.length;t.syntheticEvent=e;const n=this._suggested,o=this.value,l=o&&o.substring(0,o.length-n.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:p}=this.props,h=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==p&&!1!==p){r||d||!a?this._suggested="":this.suggestValue(i);const e=i+this._suggested,s={userInput:i,value:this._suggested};this.triggerOnChange(e,t,{suggestion:s})}else this._suggested="",this.triggerOnChange(i,t);(!h&&i||h&&!i)&&this.togglePopup(t),t.data.focusedItem=void 0,this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState(),s=void 0!==this.props.opened?this.props.opened:this.state.opened;t.syntheticEvent=e;this._suggested="",this.triggerOnChange("",t),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s&&this.togglePopup(t),this.applyState(t)},this.onInputKeyDown=e=>{const{skipDisabledItems:t,groupField:s,textField:a}=this.props,n=F(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=n[o],r=e.keyCode,d=e.altKey,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=this.base.initState();h.syntheticEvent=e;const u=()=>{p&&e.preventDefault()};if(d&&r===i.Keys.down)this.setState({opened:!0});else if(d&&r===i.Keys.up)this.setState({opened:!1});else if(p&&r===i.Keys.pageUp)u(),this.base.scrollPopupByPageSize(-1);else if(p&&r===i.Keys.pageDown)u(),this.base.scrollPopupByPageSize(1);else if(!p||r!==i.Keys.enter&&r!==i.Keys.esc)if(p||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==s&&a)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=n.slice(o+1).find((e=>!e.disabled&&e[a]));e=t&&n.findIndex((e=>e[a]===t[a]))}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=n,e=n.findIndex((e=>!e.disabled&&e[a]));else{t=n.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&n.findIndex((e=>e[a]===s[a]))}}if(void 0!==e){const t=e-o;this.onNavigate(h,r,t)}else void 0===e&&n.findIndex((e=>e[a]))===n.length-1&&this.onNavigate(h,r)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=n.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const t=n.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-o-1;this.onNavigate(h,r,t)}else this.onNavigate(h,r)}this.applyState(h),u()}}else{const e="";this._suggested="",this.triggerOnChange(e,h),void 0!==this.state.focusedItem&&(h.data.focusedItem=void 0),this.applyState(h)}else u(),!1===t&&l&&l.disabled?(p&&this.togglePopup(h),this.applyState(h)):this.applyInputValue(e.currentTarget.value,h,e.keyCode)},this.handleBlur=e=>{if(this.state.focused){const t=this.base.initState();t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,this.applyInputValue(e.currentTarget.value,t)}},i.validatePackage(G)}get _inputId(){return this.props.id+"-accessibility-id"}get element(){return this._element}get value(){return void 0!==this._valueDuringOnChange?this._valueDuringOnChange:void 0!==this.props.value?this.props.value:void 0!==this.state.value?this.state.value:void 0!==this.props.defaultValue?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||""!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{groupField:i=""}=this.props,a=F(this.props),{data:n=[]}=e,o=this.focusedIndex(),l=a[o],r=n!==a,d=void 0!==l&&t.focusedItem!==l,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=void 0!==e.opened?e.opened:t.opened,u=!h&&p;if(""===i)(p&&(d||r)||u)&&this.base.scrollToItem(o);else if(!this._isScrolling){const e=null==(s=this.base.getGroupedDataModernMode(a,i))?void 0:s.indexOf(l);u&&(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][i],this),this.base.scrollToItem(e)),p&&h&&d&&this.base.scrollToItem(e)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:e,disabled:t,label:s,className:n,style:o,loading:l,suggest:r,size:d,rounded:p,fillMode:h}=this.props,u=!this.validityStyles||this.validity.valid,g=this.base,m=this.value,v=!1!==this.props.clearButton&&!l&&!!m,f=this.props.id||this._inputId,b=this.state.focused;"string"==typeof r&&(this._suggested=r);const[y,C]=se(this.props.prefix||c.Fragment),[x,I]=se(this.props.suffix||c.Fragment),k=c.createElement("span",{className:i.classNames("k-autocomplete k-input",n,{[`k-input-${le[d]||d}`]:d,[`k-rounded-${re[p]||p}`]:p,[`k-input-${h}`]:h,"k-invalid":!u,"k-focus":b&&!t,"k-loading":l,"k-required":this.required,"k-disabled":t}),ref:e=>{this._element=e,g.wrapper=e},style:s?{...o,width:void 0}:o,dir:e},this.props.prefix&&c.createElement(y,{...C}),this.renderSearchBar(m||"",f),l&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&c.createElement(te,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&c.createElement(x,{...I}),this.renderListContainer());return s?c.createElement(a.FloatingLabel,{label:s,editorId:f,editorValue:m,editorValid:u,editorDisabled:t,style:{width:o?o.width:void 0},children:k}):k}onNavigate(e,t,s){const i=this.value,{textField:a,focusedItemIndex:n}=this.props,o=F(this.props),l=void 0!==this.state.focusedItem?o.findIndex((e=>S(e,this.state.focusedItem,a))):n?n(o,i,a):o.indexOf(w(o,i,a)),r=this.base.navigation.navigate({keyCode:t,current:l,max:o.length-1,min:0,skipItems:s||void 0});void 0!==r&&this.itemFocus(r,e),this.applyState(e)}applyInputValue(e,t,s){const a=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:n}=this.props,o=F(this.props),l=o[this.focusedIndex()];if(this._suggested="",a&&s===i.Keys.enter&&l&&!l.disabled){const s=I(o[this.focusedIndex(e)],n);this.triggerOnChange(s,t)}a&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:a,disabled:n,readonly:o}=this.props,{focused:l}=this.state,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return c.createElement(ee,{id:t,placeholder:i,tabIndex:a,accessKey:this.props.accessKey,value:e,suggestedText:this._suggested,focused:l,name:this.props.name,ref:e=>this._input=e&&e.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:s.handleFocus,onBlur:this.handleBlur,disabled:n,readOnly:o,expanded:r,owns:s.listBoxId,activedescendant:"option-"+s.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,size:n,groupField:o,list:l,groupStickyHeaderItemRender:r}=this.props,d=F(this.props),p=e.getPopupSettings(),h=void 0!==this.props.opened?this.props.opened:this.state.opened,u=void 0!==p.width?p.width:e.popupWidth;let{group:m}=this.state;return void 0===m&&void 0!==o&&(m=I(d[0],o)),c.createElement(g,{width:u,popupSettings:{...p,anchor:p.anchor||this.element,show:h,popupClass:i.classNames(p.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[d.length]},s&&c.createElement("div",{className:"k-list-header"},s),c.createElement("div",{className:i.classNames("k-list",{[`k-list-${le[n]||n}`]:n})},!l&&m&&0!==d.length&&c.createElement(v,{group:m,groupMode:"modern",render:r}),this.renderList()),a&&c.createElement("div",{className:"k-list-footer"},a))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:a,groupHeaderItemRender:n}=this.props,o=F(this.props),l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return c.createElement(V,{id:e.listBoxId,show:r,data:o.slice(),focusedIndex:this.focusedIndex(),value:l,textField:s,valueField:s,highlightSelected:!1,optionsGuid:e.guid,groupField:this.props.groupField,groupMode:"modern",listRef:t=>e.list=t,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:n,noDataRender:i,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll})}triggerOnChange(e,t,s){this.value===e&&!s||(t.data.value=e,this._valueDuringOnChange=e,t.events.push({type:"onChange",...s||{}}))}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}suggestValue(e){if(this._suggested="",e){const{textField:t}=this.props,s=F(this.props),i=s[C(s,e,t)];if(i){const s=I(i,t);e.toLowerCase()!==s.toLowerCase()&&(this._suggested=s.substring(e.length))}}}focusedIndex(e){const{textField:t,focusedItemIndex:s,skipDisabledItems:i}=this.props,a=F(this.props),n=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return a.findIndex((e=>S(e,this.state.focusedItem,t)));if(s)return s(a,n,t);const o=a.indexOf(w(a,n,t));return i&&t&&-1===o?a.findIndex((e=>!e.disabled&&e[t])):Math.max(0,o)}};de.displayName="AutoComplete",de.propTypes={...$.basicPropTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),groupField:s.string,suggest:s.oneOfType([s.bool,s.string]),placeholder:s.string,value:s.string,defaultValue:s.string,validationMessage:s.string,required:s.bool,readonly:s.bool,clearButton:s.bool,valueRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,list:s.any,skipDisabledItems:s.bool},de.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let pe=de;const he=i.createPropsContext(),ue=i.withIdHOC(i.withPropsContext(he,pe));ue.displayName="KendoReactAutoComplete";const ce=e=>e.syntheticEvent.preventDefault(),ge=e=>e.syntheticEvent.stopPropagation();class me extends c.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:a,onTagDelete:n,size:o}=this.props;return c.createElement(c.Fragment,null,e.map(((l,r)=>{const p=a?c.createElement(a,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:n}):c.createElement(d.Chip,{id:`tag-${t}-${l.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":e.length,key:l.text+r,text:l.text,removable:!0,onRemove:e=>n.call(void 0,l.data,e.syntheticEvent),onMouseDown:ce,onClick:ge,className:l===s?"k-focus":void 0,size:o});return i?i(l,p):p})),this.props.children)}}var ve=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(ve||{});const fe=e=>{const{footer:t,children:s,windowWidth:a=0,navigatable:o,navigatableElements:l,expand:r,animation:h,onClose:u,adaptiveTitle:g,mobileFilter:m}=e,v={navigatable:o||!1,navigatableElements:l||[],expand:r,animation:!1!==h,onClose:u,animationStyles:a<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames("k-actionsheet","k-adaptive-actionsheet",a<=500?"k-actionsheet-fullscreen":"k-actionsheet-bottom")};return c.createElement(p.ActionSheet,{...v},c.createElement(p.ActionSheetHeader,{className:"k-text-center"},c.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},c.createElement("div",{className:"k-actionsheet-title"},c.createElement("div",{className:"k-text-center"},g),c.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),c.createElement("div",{className:"k-actionsheet-actions"},c.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:n.xIcon,onClick:u}))),m&&c.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),s,t&&c.createElement(p.ActionSheetFooter,{className:"k-actions k-actions-stretched"},c.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),c.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:be,roundedMap:ye}=i.kendoThemeMaps,Ce=e=>e.preventDefault(),xe=e=>2===e,Ie=class e extends c.Component{constructor(e){super(e),this.state={activedescendant:ve.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new $(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{dataItemKey:s,virtual:i}=this.props,a=F(this.props),n=a[e-(i?i.skip:0)],o=this.value.findIndex((e=>S(e,n,s)));this._lastSelectedOrDeslectedItemIndex=a.findIndex((e=>S(e,n,s)));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,n],(void 0!==this.props.filter?this.props.filter:this.state.text)&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.triggerOnChange(l,t),this.base.triggerPageChangeCornerItems(n,t)},this.onTagDelete=(e,t)=>{const s=this.base.initState();s.syntheticEvent=t,this.opened&&this.base.togglePopup(s),!this.state.focused&&!this.mobileMode&&(s.data.focused=!0,this.focus());const i=this.value;k(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{allowCustom:s,virtual:i}=this.props,a=F(this.props),n=i?i.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=s&&o,d=a[e-n];d&&l!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=ve.PopupList):r&&-1===e&&void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(d,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.searchbarRef=e=>{const t=this._input=e&&e.input;t&&this.state.focused&&window.setTimeout((()=>t.focus()),0)},this.onChangeHandler=e=>{const t=this.base.initState(),s=e.target.value;t.syntheticEvent=e,void 0===this.props.filter&&(t.data.text=s),t.data.focusedIndex=void 0,this.opened||(this.base.togglePopup(t),this.setState({currentValue:this.value})),this.base.filterChanged(s,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.value.length>0&&this.triggerOnChange([],t),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t);const s=void 0!==this.props.filter?this.props.filter:this.state.text;f(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this._lastSelectedOrDeslectedItemIndex=null,this.applyState(t)},this.onInputKeyDown=e=>{const{textField:t,groupField:s}=this.props,a=F(this.props),n=e.keyCode,o=void 0!==this.props.filter?this.props.filter:this.state.text,l=void 0!==this.props.opened?this.props.opened:this.state.opened,{focusedItem:r,focusedIndex:d}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=e,!o&&this.value.length>0&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete||n===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,p);const h=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(n===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(n===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if((e.ctrlKey||e.metaKey)&&"KeyA"===e.code){const e=(this.state.value&&this.state.value.length)===a.length?[]:a;this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=a.slice(this.getFocusedState().focusedIndex);this.itemFocus(a.length-1,p),this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=a.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,p),this.updateStateOnKeyboardNavigation(e,p)}else if(e.shiftKey&&e.keyCode===i.Keys.up){let e;const t=this.getLastSelectedOrDeselectedIndex(1,d);null===t?e=0!==d?a.slice(d-1,d):[a[d]]:t===d?e=[a[t-1]]:d>=0&&(e=t>d?a.slice(d-1,t):a.slice(t-1,d)),e&&e.length>0&&(d>=1&&this.itemFocus(d-1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const t=this.getLastSelectedOrDeselectedIndex(0,d);null===t?e=d!==a.length-1?a.slice(d,d+1):[a[d]]:t===d?e=a.slice(d,d+2):d>=0&&(e=t>d?a.slice(d+1,t+1):a.slice(t,d+2)),e&&e.length>=1&&(this.itemFocus(d+1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.altKey&&n===i.Keys.up)h();else if(n===i.Keys.up||n===i.Keys.down){if(""!==s&&t)if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=0;if(n===i.Keys.down||n===i.Keys.right){const s=a.slice(d+1).find((e=>!e.disabled&&e[t]));e=s&&a.findIndex((e=>e[t]===s[t]))}else if(n===i.Keys.up||n===i.Keys.left){let s;if(-1===d)s=a,e=a.findIndex((e=>!e.disabled&&e[t]));else{s=a.slice(0,d);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&a.findIndex((e=>e[t]===i[t]))}}if(e){const t=e-d;this.onNavigate(p,n,t)}else void 0!==e&&this.onNavigate(p,n)}else if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=null;if(n===i.Keys.down||n===i.Keys.right)e=a.slice(d+1).find((e=>!e.disabled));else if(n===i.Keys.up||n===i.Keys.left){const t=a.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-d-1;this.onNavigate(p,n,t)}else this.onNavigate(p,n)}this.applyState(p),e.preventDefault()}else n===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&o&&null===r?this.customItemSelect(e):r&&r.disabled?h():this.selectFocusedItem(e)):n===i.Keys.esc&&h();else e.altKey&&n===i.Keys.down?h():n===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:a,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=F(this.props),p=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:h}=this.getFocusedState(),u=s&&p&&c.createElement("div",{className:i.classNames("k-list",{[`k-list-${be[a]||a}`]:a}),key:"customitem",onClick:this.customItemSelect,onMouseDown:Ce},c.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":xe(h)}),style:{fontStyle:"italic"}},p,c.createElement(i.IconWrap,{name:"plus",icon:n.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==l&&(g=I(d[0],l)),c.createElement(c.Fragment,null,e&&c.createElement("div",{className:"k-list-header"},e),u,c.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":be[a]||a}`]:a,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&c.createElement(v,{group:g,groupMode:"modern",render:o}),this.renderList()),t&&c.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=F(this.props),a=this.base.getPopupSettings(),n=void 0!==a.width?a.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:n,popupSettings:{...a,popupClass:i.classNames(a.popupClass,"k-list-container","k-multiselect-popup"),anchor:a.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return c.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,filterable:t,filter:s}=this.props,{windowWidth:i=0}=this.state,a=void 0!==s?s:this.state.text;this.localization=r.provideLocalizationService(this);const n=t?c.createElement(m,{value:a,ref:e=>this._adaptiveInput=e&&e.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}):null,o={adaptiveTitle:e,expand:this.opened,onClose:e=>this.onCancel(e),windowWidth:i,mobileFilter:n,footer:{cancelText:this.localization.toLanguageString(z,H[z]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(L,H[L]),onApply:this.closePopup}};return c.createElement(fe,{...o},c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.closePopup=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t),t.events.push({type:"onClose"});const s=void 0!==this.props.filter?this.props.filter:this.state.text;f(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=void 0!==this.props.filter?this.props.filter:this.state.text;f(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.renderList=()=>{const{textField:e,listNoDataRender:t,itemRender:s,groupHeaderItemRender:i,dataItemKey:a,virtual:n={skip:0,total:void 0}}=this.props,o=F(this.props),l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),p=`translateY(${l.translate}px)`;return c.createElement(V,{id:this.base.listBoxId,show:this.opened,data:o.slice(),focusedIndex:r-n.skip,value:this.value,textField:e,valueField:a,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>{l.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:d.height},wrapperCssClass:"k-list-content",listStyle:l.enabled?{transform:p}:void 0,key:"listKey",skip:n.skip,onClick:this.handleItemClick,itemRender:s,groupHeaderItemRender:i,noDataRender:t,onMouseDown:Ce,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=F(this.props);if(i&&a.length&&i){const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;a=this.base.getGroupedDataModernMode(a,i);let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&this.setState({group:l})}},this.customItemSelect=e=>{const t=void 0!==this.props.filter?this.props.filter:this.state.text,{textField:s}=this.props;if(!t)return;const i=this.base.initState();i.syntheticEvent=e;const a=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const n=[...this.value,a];this.triggerOnChange(n,i),this.base.togglePopup(i),this.applyState(i)},this.handleWrapperClick=e=>{const t=this._input;!this.opened&&t&&this.focusElement(t);const s=this.base.initState();s.syntheticEvent=e,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&(this.setState({currentValue:this.tagsToRender}),this.mobileMode&&window.setTimeout((()=>this._adaptiveInput&&this._adaptiveInput.focus()),300)),this.base.togglePopup(s),this.applyState(s)},this.handleItemClick=(e,t)=>{const s=this.base.initState();s.syntheticEvent=t,this.handleItemSelect(e,s),this.props.autoClose&&!this.mobileMode&&this.base.togglePopup(s),t.stopPropagation(),this.applyState(s)},this.handleBlur=e=>{if(!this.state.focused||this._skipFocusEvent)return;const t=this.base.initState(),{allowCustom:s,filterable:i}=this.props;t.syntheticEvent=e,t.data.focused=!1,t.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(t.data.opened=!1),t.events.push({type:"onClose"})),!s&&!i&&this.state.text&&(t.data.text=""),this.applyState(t)},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.onPopupOpened=()=>{this._input&&this.state.focused&&!this.mobileMode&&this.focusElement(this._input)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout((()=>{this.state.focused&&this.focusElement(this._input)}),0)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},i.validatePackage(G)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get opened(){return!!(void 0!==this.props.opened?this.props.opened:this.state.opened)}get tagsToRender(){const{tags:e,textField:t}=this.props,s=[];return void 0===e?this.value.forEach((e=>{s.push({text:I(e,t),data:[e]})})):s.push(...e),s}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Y&&this.props.adaptive)}get value(){const e=[];return this._valueItemsDuringOnChange?e.push(...this._valueItemsDuringOnChange):this.props.value?e.push(...this.props.value):this.state.value?e.push(...this.state.value):this.props.defaultValue&&e.push(...this.props.defaultValue),e}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&this.value.length>0&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}componentDidUpdate(e,t){var s;const{virtual:i,groupField:a=""}=this.props,n=F(this.props),o=i?i.skip:0,l=e.virtual?e.virtual.total:0,r=void 0!==e.opened?e.opened:t.opened,d=!r&&this.opened,p=r&&!this.opened,h=this.base.getPopupSettings();if(this.base.didUpdate(),!h.animate&&p&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==a&&(t=null==(s=this.base.getGroupedDataModernMode(n,a))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][a],this),this.base.scrollToItem(t)):this.opened&&r&&e&&this.scrollToFocused&&this.base.scrollToItem(t-o)}this.scrollToFocused=!1,this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}onNavigate(e,t,s){const{allowCustom:a}=this.props,n=F(this.props),o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=a&&o,p=xe(l),h=this.base,u=h.vs;if(this.opened&&t===i.Keys.up&&p)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=h.navigation.navigate({keyCode:t,current:r,max:(u.enabled?u.total:n.length)-1,min:d?-1:0,skipItems:s||void 0});void 0!==i&&(this.itemFocus(i,e),this.scrollToFocused=!0)}this.applyState(e)}render(){const{style:e,className:t,label:s,dir:n,disabled:o,textField:l,dataItemKey:r,virtual:d,size:p,rounded:h,fillMode:u,loading:g,filter:m}=this.props,{text:v,focused:f,focusedTag:b,currentValue:y}=this.state,C=this.base.vs,x=this.props.id||this._inputId;C.enabled=void 0!==d,void 0!==d&&(C.skip=d.skip,C.total=d.total,C.pageSize=d.pageSize);const k=this.mobileMode&&this.opened?y:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const S=!this.validityStyles||this.validity.valid,w=!!(void 0!==m?m:v)||k&&k.length>0,[F,K]=se(this.props.prefix||c.Fragment),[N,M]=se(this.props.suffix||c.Fragment),T=c.createElement(c.Fragment,null,c.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${be[p]||p}`]:p,[`k-rounded-${ye[h]||h}`]:h,[`k-input-${u}`]:u,"k-focus":f&&!o,"k-invalid":!S,"k-disabled":o,"k-loading":g,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:n,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:E},this.props.prefix&&c.createElement(F,{...K}),c.createElement("div",{className:i.classNames("k-input-values")},c.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${be[p]||p}`]:p}),role:"listbox",id:"tagslist-"+this.base.guid},k&&k.length>0&&c.createElement(me,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:k,guid:this.base.guid,focused:b?k.find((e=>D(e,b,r))):void 0,size:p})),this.renderSearchBar(x)),g&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&c.createElement(N,{...M}),w&&c.createElement(te,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?c.createElement(a.FloatingLabel,{label:s,editorId:x,editorValue:v||I(this.value[0],l),editorValid:S,editorDisabled:o,style:{width:e?e.width:void 0},children:T}):T}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:a,placeholder:n,ariaDescribedBy:o,ariaLabelledBy:l,ariaLabel:r}=this.props,d=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:p}=this.getFocusedState(),h=0!==this.value.length||d?void 0:n,u=i&&i.length>0?void 0:n,g=t===ve.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${p}`,m={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return c.createElement(ee,{id:e,size:Math.max((h||"").length,d.length,1),placeholder:this.mobileMode&&this.opened?u:h,value:d,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:a,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:g,ariaDescribedBy:`tagslist-${this.base.guid}${o?" "+o:""}`,ariaLabelledBy:l,ariaRequired:this.required,ariaLabel:r,...m})}onTagsNavigate(e,t){const s=e.keyCode,{focusedTag:a}=this.state,n=this._tags,o=this.props.dataItemKey;let l,r=a?n.findIndex((e=>D(e,a,o))):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):n.length-1,l=n[r];else if(s===i.Keys.right)r===n.length-1?l=void 0:d&&(r=Math.min(n.length-1,r+1),l=n[r]);else if(s!==i.Keys.home||e.shiftKey)if(s!==i.Keys.end||e.shiftKey){if(s===i.Keys.delete){if(d){const e=this.value;k(e,n[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)k(e,n[r].data,o),this.triggerOnChange(e,t);else if(!d&&n.length){const s=n.pop();k(e,s.data,o),this.triggerOnChange(e,t)}}}else l=n[n.length-1];else l=n[0];l!==a&&(t.data.focusedTag=l,t.data.activedescendant=ve.TagsList),this.applyState(t)}triggerOnChange(e,t){void 0===this.props.value&&(t.data.value=[...e]),this._valueItemsDuringOnChange=[],this.setItems(e,this._valueItemsDuringOnChange),t.events.push({type:"onChange"})}selectFocusedItem(e,t){const{virtual:s}=this.props,i=F(this.props),{focusedIndex:a}=t||this.getFocusedState();void 0!==i[a-(s?s.skip:0)]&&this.handleItemClick(a,e)}setItems(e,t){t.length=0,t.push(...e)}getFocusedState(){const{focusedIndex:e}=this.state,t=void 0!==this.props.filter?this.props.filter:this.state.text,{allowCustom:s,dataItemKey:i,virtual:a,textField:n,focusedItemIndex:o=C,skipDisabledItems:l}=this.props,r=F(this.props),d=a&&a.skip||0;let p;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const h=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=o(r,t,n),{focusedItem:r[p],focusedIndex:p+d,focusedType:1};if(h.length){const e=h[h.length-1];return p=r.findIndex((t=>S(t,e,i))),void 0!==r[p]?{focusedIndex:p+d,focusedItem:r[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&n&&!t&&0===d){const e=r.findIndex((e=>!e.disabled&&e[n]));return{focusedIndex:e,focusedItem:r[e-d],focusedType:1}}return 0===d?{focusedItem:r[0],focusedIndex:0,focusedType:1}:{focusedType:0,focusedIndex:-1}}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),0)}applyState(e){this.base.applyState(e),this._valueItemsDuringOnChange=null}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}updateStateOnKeyboardNavigation(e,t){this.setState({value:e}),this.triggerOnChange(e,t),this.applyState(t)}getLastSelectedOrDeselectedIndex(e,t){return null===this._lastSelectedOrDeslectedItemIndex&&(this._lastSelectedOrDeslectedItemIndex=t),null!==this._lastSelectedOrDeslectedItemIndex?this._lastSelectedOrDeslectedItemIndex+e:null}};Ie.displayName="MultiSelect",Ie.propTypes={...$.propTypes,autoClose:s.bool,value:s.arrayOf(s.any),defaultValue:s.arrayOf(s.any),dataItemKey:s.string,placeholder:s.string,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),tagRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,groupField:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,onCancel:s.func,skipDisabledItems:s.bool},Ie.defaultProps={...$.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ke=Ie;const Se=i.createPropsContext(),we=i.withIdHOC(i.withPropsContext(Se,ke));we.displayName="KendoReactMultiSelect";const Ee=e=>c.createElement(V,{...e,wrapperCssClass:"k-table-body k-table-scroller",listClassName:i.classNames("k-table k-table-list",{"k-virtual-table":void 0!==e.virtual}),listStyle:{...e.listStyle}}),De=i.createPropsContext(),Fe=c.forwardRef(((e,t)=>{const s=i.usePropsContext(De,e),a=c.useRef(null),n=c.useRef(null),o=i.getScrollbarWidth(),{columns:l=Ne.columns,popupSettings:r=Ne.popupSettings,size:d=Ne.size,rounded:p=Ne.rounded,fillMode:h=Ne.fillMode,className:u,prefix:g,suffix:m,onOpen:v,onClose:f,onFocus:b,onBlur:y,onChange:C,onFilterChange:x,onPageChange:k,...S}=s;c.useImperativeHandle(a,(()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:s}))),c.useImperativeHandle(t,(()=>a.current));const w=c.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,D]=c.useState(w),[F,K]=c.useState(!0),[N]=g?se(s.prefix||c.Fragment):[],[M]=m?se(s.suffix||c.Fragment):[],T=c.useMemo((()=>{const e=c.createElement("th",{className:"k-table-th",colSpan:l.length},E);return c.createElement(c.Fragment,null,s.header,c.createElement("div",{className:"k-table-header-wrap"},c.createElement("table",{className:"k-table",role:"presentation"},c.createElement("colgroup",null,l.map(((e,t)=>c.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Ne.width}})))),c.createElement("thead",{className:"k-table-thead"},c.createElement("tr",{className:"k-table-row"},l.map(((e,t)=>c.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" ")))),E&&F&&c.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))}),[s.header,l,E,F]),P=c.useMemo((()=>`calc(${l.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Ne.width))).filter(Boolean).join(" + ")} + ${o}px + 4px)`),[l,o]),O=s.virtual?s.virtual.skip:0,B=c.useCallback(((e,t)=>{const a=l.map(((e,a)=>c.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Ne.width},key:e.uniqueKey?e.uniqueKey:a},e.field?String(i.getter(e.field)(t.dataItem)):"")));let n,o,r,d,p=s.data||[];const h=t.index-O;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(p[h]),r=d(p[h-1]),o&&r&&o!==r&&(n=o)),n&&"classic"===s.groupMode&&a.push(c.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},c.createElement("span",null,n)));const u=c.cloneElement(e,{...e.props,className:i.classNames("k-table-row",{"k-table-alt-row":t.index%2!=0,"k-focus":t.focused,"k-selected":t.selected,"k-first":!!n,"k-disabled":t.dataItem.disabled})},a);return s.itemRender?s.itemRender.call(void 0,u,t):u}),[l,s.groupField,s.itemRender,s.data,O]),_=c.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:a.current})}),[]),R=c.useCallback((e=>(s.virtual||D(w),_(v,e))),[_,v,s.virtual,w]),L=c.useCallback((e=>_(f,e)),[f]),z=c.useCallback((e=>_(b,e)),[b]),H=c.useCallback((e=>_(y,e)),[y]),V=c.useCallback((e=>_(C,e)),[C]),q=c.useCallback((e=>_(k,e)),[k]),A=c.useCallback((e=>(D(w),_(x,{...e,mobileMode:e.target.mobileMode}))),[x]),W=c.useCallback((e=>{D(e.group)}),[]);c.useEffect((()=>{i.setScrollbarWidth()})),c.useEffect((()=>{const e=s.data;D(w),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const U=c.useCallback((e=>c.createElement(Ee,{...e})),[]);return c.createElement(oe,{...S,list:U,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||P,className:r.className},ref:n,header:T,itemRender:B,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:p,fillMode:h,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:R,onClose:L,onFocus:z,onBlur:H,onChange:V,onFilterChange:A,onPageChange:q,onGroupScroll:W,className:i.classNames("k-dropdowngrid",u),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,footer:s.footer,footerClassName:"k-table-footer",prefix:N,suffix:M})})),Ke={...ae.propTypes,columns:s.any.isRequired},Ne={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Me(e){return"string"==typeof e?Number(e.replace("px","")):e||void 0}function Te(e,t,s,i){const a=Me(t.popupSettings.width),n=(void 0!==s.width&&Me(s.width))!==a,o=void 0!==i.width,l=n?s.width:o?i.width:a,r=Me(function(e,t,s){const[i,a]=c.useState(t);return c.useEffect((()=>{void 0!==i&&e.current&&a(e.current.offsetWidth)}),s),i}(e,l));return n||o?l:r&&a&&r>a?r:a}Fe.displayName="KendoMultiColumnComboBox",Fe.propTypes=Ke;const Pe=e=>c.createElement("div",{className:"k-nodata"},c.createElement("div",null,e.children)),{sizeMap:Oe,roundedMap:Be}=i.kendoThemeMaps,_e=e=>c.createElement("span",{className:"k-input-value-text"},e.children),Re=e=>e.split("_").map((e=>parseInt(e,10))),Le={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},ze=i.createPropsContext(),He=c.forwardRef(((e,t)=>{i.validatePackage(G);const s=i.usePropsContext(ze,e),l={...Le,...s},u=i.useId(),g=l.id||u,{data:v,dataItemKey:b,popupSettings:y={},style:C,opened:x,disabled:k,onOpen:w=i.noop,onClose:E=i.noop,placeholder:D,label:F,name:K,selectField:N,subItemsField:M,validationMessage:T,valid:B,required:_,validityStyles:R}=l,L=i.getTabIndex(l.tabIndex,k),z=c.useRef(null),V=c.useRef(null),q=c.useRef(null),A=c.useRef(null),W=c.useRef(null),U=c.useRef(null),$=c.useRef(!1),[j,J]=c.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==j?j:l.defaultValue,Z=f(X),ee=Z?I(X,l.textField):"",te=((e,t)=>{const{validationMessage:s,valid:i,required:a}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!a||t),valueMissing:!t}})({validationMessage:T,valid:B,required:_},Z),se=c.useCallback((()=>V.current&&V.current.focus()),[]);c.useImperativeHandle(z,(()=>({props:l,element:V.current,focus:se}))),c.useImperativeHandle(t,(()=>z.current));const ie=i.useRtl(V,l.dir),ae={width:Te(V,Le,{...Le.popupSettings,...y},C),...void 0!==ie?{direction:ie}:{}},[ne,oe]=c.useState(!1),le=void 0!==x?x:ne,[re,de]=c.useState(!1),[pe,he]=c.useState(),ue=!!(pe&&pe<=Y&&l.adaptive),[ce,ge]=c.useState(""),me=c.useCallback((()=>{W.current&&W.current.setCustomValidity&&W.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);c.useEffect(me),c.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const ve=c.useCallback((e=>{if(!le){if(w){const t={...e};w.call(void 0,t)}void 0===x&&oe(!0)}}),[le,x,w]),be=c.useCallback((e=>{if(le){if(E){const t={...e};E.call(void 0,t)}void 0===x&&(oe(!1),ue&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300))}}),[le,x,E,ue]),ye=c.useCallback((e=>{if(!e.isDefaultPrevented()&&z.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};(le?be:ve)(t)}}),[le,x,w,E]),Ce=c.useCallback((e=>{$.current=!0,e(),window.setTimeout((()=>$.current=!1),0)}),[]),xe=c.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=U.current&&U.current.element;if(!z.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};if(le)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),be(l);else if(o&&o.querySelector(".k-focus")&&(a===i.Keys.up||a===i.Keys.down||a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end)){if(a===i.Keys.up&&null!=(s=q.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find((e=>!(!e||!e.querySelector(".k-focus"))));if(t&&0===e.indexOf(t))return Ce((()=>{var e;ke(null==(e=q.current)?void 0:e.element)}))}Ce(i.noop)}else a===i.Keys.down&&Ce((()=>{var e;ke((null==(e=q.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down?(e.preventDefault(),ve(l)):le||a===i.Keys.esc&&Me(e)}),[le,x,w,E]),Ie=c.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Ce(t===i.Keys.up?()=>{ke(V.current)}:()=>{ke(U.current&&U.current.element)}))}),[]),ke=c.useCallback((e=>{e&&Ce((()=>e.focus()))}),[]),Se=c.useCallback((()=>{var e;re||!le||x?s.filterable?ke(null==(e=q.current)?void 0:e.element):ke(U.current&&U.current.element):be({target:z.current})}),[E,s.filterable,re,x,le]),we=c.useCallback((()=>{re&&ke(V.current)}),[re]),Ee=c.useCallback((e=>{if(!re&&!$.current&&(de(!0),s.onFocus&&z.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),De=c.useCallback((e=>{if(re&&!$.current&&z.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ue||be(t)}}),[re,s.onBlur,le,x,E]),Fe=c.useCallback((()=>{re&&Ce(i.noop),ue&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300)}),[re,ue]),Ke=c.useCallback(((e,t,i)=>{if(s.onChange){const a={value:t,level:i?Re(i):[],...e};s.onChange.call(void 0,a)}Q||J(t)}),[s.onChange,Q]),Ne=c.useCallback((e=>{if(S(e.item,X,b)||!z.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:a}=e,n={syntheticEvent:a,nativeEvent:i,target:z.current};Ke(n,t,s),be(n)}),[Q,X,s.onChange,b,le,x,E]),Me=c.useCallback((e=>{if(!z.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};Ke(t,null),be(t),e.preventDefault()}),[Q,s.onChange,le,x,E]),He=c.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&z.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:Re(i),item:t,nativeEvent:a,syntheticEvent:n,target:z.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Ve=c.useCallback((e=>{if(s.onFilterChange&&z.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:z.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),qe=c.useCallback((e=>{for(const t of e)he(t.target.clientWidth)}),[]),Ae=c.useMemo((()=>Q||!Z?v:i.mapTree(v,M,(e=>i.extendDataItem(e,M,{[N]:S(e,X,b)})))),[v,X,Q,Z,N,M]),We=l.listNoData||Pe,Ue=l.valueHolder||_e,$e=r.useLocalization(),Ge=!R||te.valid,{size:je,rounded:Ye,fillMode:Je}=l,Qe=c.createElement(c.Fragment,null,c.createElement("span",{className:i.classNames("k-dropdowntree k-picker",l.className,{[`k-picker-${Oe[je]||je}`]:je,[`k-rounded-${Be[Ye]||Ye}`]:Ye,[`k-picker-${Je}`]:Je,"k-focus":re,"k-invalid":!Ge,"k-loading":l.loading,"k-required":_,"k-disabled":l.disabled}),tabIndex:L,accessKey:l.accessKey,id:g,style:F?{...C,width:void 0}:C,dir:ie,ref:V,onKeyDown:k?void 0:xe,onMouseDown:Fe,onClick:k?void 0:ye,onFocus:Ee,onBlur:De,role:"combobox","aria-haspopup":"tree","aria-expanded":le,"aria-disabled":k,"aria-label":F,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-required":_},c.createElement("span",{className:"k-input-inner"},(ee||D)&&c.createElement(Ue,{item:X},ee||D)),l.loading&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!k&&c.createElement("span",{onClick:Me,className:"k-clear-value",title:$e.toLanguageString(O,H[O]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},c.createElement(i.IconWrap,{name:"x",icon:n.xIcon})),c.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:je,fillMode:Je,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:n.caretAltDownIcon}),c.createElement("select",{name:K,ref:W,tabIndex:-1,"aria-hidden":!0,title:F,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},c.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,X):X})),!ue&&c.createElement(o.Popup,{...y,className:i.classNames(y.className,{"k-rtl":"rtl"===ie}),popupClass:i.classNames(y.popupClass,"k-dropdowntree-popup k-list-container"),style:ae,anchor:y.anchor||V.current,show:le,onOpen:Se,onClose:we},l.filterable&&c.createElement(m,{value:void 0===l.filter?ce:l.filter,ref:q,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),v.length>0?c.createElement(h.TreeView,{style:{height:y.height},ref:U,tabIndex:L,data:Ae,focusIdField:b,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:He,size:je,item:l.item,dir:ie,animate:y.animate}):c.createElement(We,null,$e.toLanguageString(P,H[P])))),ue&&(()=>{const e=l.filterable?c.createElement(m,{value:void 0===l.filter?ce:l.filter,ref:A,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>be(e),windowWidth:pe,mobileFilter:e};return c.createElement(fe,{...t},c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:"k-list-container"},c.createElement("div",{className:"k-list k-list-lg"},v.length>0?c.createElement(h.TreeView,{ref:U,tabIndex:L,data:Ae,focusIdField:b,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:He,size:je,item:l.item,dir:ie,animate:y.animate}):c.createElement(We,null,$e.toLanguageString(P,H[P]))))))})());return F?c.createElement(a.FloatingLabel,{label:F,editorValue:ee,editorPlaceholder:D,editorValid:Ge,editorDisabled:k,editorId:g,style:{width:C?C.width:void 0},children:Qe,dir:ie}):Qe})),Ve={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,value:s.any,valueMap:s.func,placeholder:s.string,dataItemKey:s.string.isRequired,textField:s.string.isRequired,selectField:s.string,expandField:s.string,subItemsField:s.string,className:s.string,style:s.object,label:s.string,validationMessage:s.string,validityStyles:s.bool,valid:s.bool,required:s.bool,name:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,filterable:s.bool,filter:s.string,loading:s.bool,popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onFilterChange:s.func,onExpandChange:s.func,item:s.func,valueHolder:s.func,listNoData:s.func,adaptiveTitle:s.string,adaptive:s.bool};He.displayName="KendoReactDropDownTree",He.propTypes=Ve;const{sizeMap:qe,roundedMap:Ae}=i.kendoThemeMaps,We=e=>e.split("_").map((e=>parseInt(e,10))),Ue={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},$e=i.createPropsContext(),Ge=c.forwardRef(((e,t)=>{const s=i.usePropsContext($e,e);i.validatePackage(G);const n=i.useId(),l=s.id||n,{data:d=[],dataItemKey:u,style:g={},placeholder:v,label:f,name:b,validationMessage:y,valid:C,tags:x,value:k,opened:w,disabled:E,popupSettings:F=Ue.popupSettings,checkField:K=Ue.checkField,checkIndeterminateField:N=Ue.checkIndeterminateField,subItemsField:M=Ue.subItemsField,size:T=Ue.size,rounded:O=Ue.rounded,fillMode:B=Ue.fillMode,required:_=Ue.required,validityStyles:R=Ue.validityStyles,onOpen:V=i.noop,onClose:q=i.noop}=s,A=i.getTabIndex(s.tabIndex,E),W=c.useRef(null),U=c.useRef(null),$=c.useRef(null),j=c.useRef(null),J=c.useRef(null),Q=c.useRef(null),X=c.useRef(!1),Z=c.useRef([]),ee=c.useRef(null),[se,ie]=c.useState(),[ae,ne]=c.useState(!1),[oe,le]=c.useState(!1),[re,de]=c.useState(),[pe,he]=c.useState([]),[ue,ce]=c.useState(""),ge=!!(re&&re<=Y&&s.adaptive),ve=void 0!==w?w:ae,be=!(!Array.isArray(k)||!k.length),ye=((e,t)=>{const{validationMessage:s,valid:i,required:a}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!a||t),valueMissing:!t}})({validationMessage:y,valid:C,required:_},be),Ce=i.useRtl(U,s.dir),xe={width:Te(U,Ue,F,g),...void 0!==Ce?{direction:Ce}:{}},Ie=c.useCallback((()=>U.current&&U.current.focus()),[]);Z.current=void 0===x?(k||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...x],c.useImperativeHandle(W,(()=>({props:s,element:U.current,focus:Ie}))),c.useImperativeHandle(t,(()=>W.current));const ke=c.useCallback((()=>{J.current&&J.current.setCustomValidity&&J.current.setCustomValidity(ye.valid?"":void 0===y?"Please select a value from the list!":y)}),[y,ye]);c.useEffect(ke),c.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Je.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}}),[]),c.useEffect((()=>{ee.current&&ve&&ee.current.setPosition(ee.current._popup)}),[k,ve]);const Se=c.useCallback(((e,t,i)=>{if(s.onChange){const a={items:t,operation:i,...e};s.onChange.call(void 0,a)}}),[s.onChange]),we=c.useCallback((e=>{if(S(e.item,k,u)||!W.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,a={syntheticEvent:i,nativeEvent:s,target:W.current};Se(a,[t],"toggle")}),[k,u,Se]),Ee=c.useCallback((e=>{if(!ve){if(V){const t={...e};V.call(void 0,t)}void 0===w&&(ne(!0),he(k||[]),ge&&setTimeout((()=>{var e;Ke(null==(e=j.current)?void 0:e.element)}),300))}}),[ve,w,V,ge,j]),De=c.useCallback((e=>{if(ve){if(q){const t={...e};q.call(void 0,t)}void 0===w&&ne(!1)}}),[ve,w,q]),Fe=c.useCallback((e=>{X.current=!0,e(),window.setTimeout((()=>X.current=!1),0)}),[]),Ke=c.useCallback((e=>{e&&Fe((()=>e.focus()))}),[Fe]),Ne=c.useCallback((()=>{var e;!oe&&ve?De({target:W.current}):s.filterable?Ke(null==(e=$.current)?void 0:e.element):Ke(Q.current&&Q.current.element)}),[oe,ve,Ke,De,s.filterable]),Me=c.useCallback((()=>{oe&&Ke(U.current)}),[oe,Ke]),Oe=c.useCallback((e=>{if(!oe&&!X.current&&(le(!0),s.onFocus&&W.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onFocus.call(void 0,t)}}),[oe,s.onFocus]),Be=c.useCallback((e=>{if(oe&&!X.current&&W.current){le(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ge||De(t)}}),[oe,s.onBlur,ve,w,q]),_e=c.useCallback((()=>{oe&&Fe(i.noop)}),[oe,Fe]),Re=c.useCallback((e=>{if(!e.isDefaultPrevented()&&W.current){le(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};ve||Ee(t)}}),[ve,Ee]),Le=c.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=Q.current&&Q.current.element;if(!W.current||e.isDefaultPrevented()&&(null==(t=$.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(k&&k.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete)){const e=Z.current;let t,s=se?e.findIndex((e=>D(e,se,u))):-1;const n=-1!==s;a===i.Keys.left?(s=n?Math.max(0,s-1):e.length-1,t=e[s]):a===i.Keys.right?s===e.length-1?t=void 0:n&&(s=Math.min(e.length-1,s+1),t=e[s]):a===i.Keys.home?t=e[0]:a===i.Keys.end?t=e[e.length-1]:a===i.Keys.delete&&n&&Se(l,e[s].data,"delete"),t!==se&&ie(t)}if(ve)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),De(l);else if(o&&o.querySelector(".k-focus")&&(a===i.Keys.up||a===i.Keys.down||a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end)){if(a===i.Keys.up&&null!=(s=$.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find((e=>!(!e||!e.querySelector(".k-focus"))));if(t&&0===e.indexOf(t))return Fe((()=>{var e;Ke(null==(e=$.current)?void 0:e.element)}))}Fe(i.noop)}else a===i.Keys.down&&Fe((()=>{var e;Ke((null==(e=$.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down&&(e.preventDefault(),Ee(l))}),[ve,De,Ke,Fe,Ee,se,u,k,Se]),ze=c.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Fe(t===i.Keys.up?()=>{Ke(U.current)}:()=>{Ke(Q.current&&Q.current.element)}))}),[Ke,Fe]),He=c.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};Se(t,[],"clear"),De(t),e.preventDefault()}),[Se,De]),Ve=c.useCallback(((e,t)=>{var s;De({target:W.current}),oe||Ke(null==(s=$.current)?void 0:s.element),Se({syntheticEvent:t,nativeEvent:t.nativeEvent,target:W.current},e,"delete")}),[Se,De,Ke,oe]),Ge=c.useCallback((e=>{if(s.onExpandChange&&W.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:We(i),item:t,nativeEvent:a,syntheticEvent:n,target:W.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),je=c.useCallback((e=>{if(s.onFilterChange&&W.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:W.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ce(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Ye=c.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onCancel&&s.onCancel.call(void 0,t),De(t),e.preventDefault()}),[s.onCancel,De]),Je=c.useCallback((e=>{for(const t of e)de(t.target.clientWidth)}),[]),Qe=s.listNoData||Pe,Xe=r.useLocalization(),Ze=!R||ye.valid,et=ge&&ve?pe:Z.current,tt=c.createElement(c.Fragment,null,c.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${qe[T]||T}`]:T,[`k-rounded-${Ae[O]||O}`]:O,[`k-input-${B}`]:B,"k-focus":oe&&!E,"k-invalid":!Ze,"k-disabled":E,"k-loading":s.loading,"k-required":_}),tabIndex:A,accessKey:s.accessKey,id:l,style:f?{...g,width:void 0}:g,dir:Ce,ref:U,onKeyDown:E?void 0:Le,onMouseDown:_e,onFocus:Oe,onBlur:Be,role:"combobox","aria-haspopup":"tree","aria-expanded":ve,"aria-disabled":E,"aria-label":f,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy?s.ariaDescribedBy:"tagslist-"+l,"aria-required":s.required,onClick:E?void 0:Re},c.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${qe[T]||T}`]:T})},et.length>0&&c.createElement(me,{tag:s.tag,onTagDelete:Ve,data:et,guid:l,focused:se?Z.current.find((e=>D(e,se,u))):void 0,size:T})),c.createElement("span",{className:"k-input-inner"},0===et.length&&c.createElement("span",{className:"k-input-value-text"},v)),s.loading&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),be&&!E&&et.length>0&&c.createElement(te,{onClick:He}),c.createElement("select",{name:b,ref:J,tabIndex:-1,"aria-hidden":!0,title:f,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},c.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,k):k})),!ge&&c.createElement(o.Popup,{...F,popupClass:i.classNames(F.popupClass,"k-multiselecttree-popup"),className:i.classNames(F.className,{"k-rtl":"rtl"===Ce}),style:xe,anchor:F.anchor||U.current,show:ve,onOpen:Ne,onClose:Me,ref:ee},s.filterable&&c.createElement(m,{value:void 0===s.filter?ue:s.filter,ref:$,onChange:je,onKeyDown:ze,tabIndex:A,size:T,rounded:O,fillMode:B,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),d.length>0?c.createElement(h.TreeView,{style:{height:F.height},ref:Q,tabIndex:A,data:d,focusIdField:u,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:Ce}):c.createElement(Qe,null,Xe.toLanguageString(P,H[P])))),ge&&(()=>{const e=s.filterable?c.createElement(m,{value:void 0===s.filter?ue:s.filter,ref:j,onChange:je,onKeyDown:ze,size:T,rounded:O,fillMode:B}):null,t={adaptiveTitle:s.adaptiveTitle,expand:ve,onClose:e=>s.onCancel?Ye(e):He(e),windowWidth:re,mobileFilter:e,footer:{cancelText:Xe.toLanguageString(z,H[z]),onCancel:e=>s.onCancel?Ye(e):He(e),applyText:Xe.toLanguageString(L,H[L]),onApply:e=>De(e)}};return c.createElement(fe,{...t},c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:"k-list-container"},c.createElement("div",{className:"k-list k-list-lg"},d.length>0?c.createElement(h.TreeView,{ref:Q,tabIndex:A,data:d,focusIdField:u,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:Ce}):c.createElement(Qe,null,Xe.toLanguageString(P,H[P]))))))})());return f?c.createElement(a.FloatingLabel,{label:f,editorValue:be,editorPlaceholder:v,editorValid:Ze,editorDisabled:E,editorId:l,style:{width:g?g.width:void 0},children:tt,dir:Ce}):tt})),je={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,value:s.any,valueMap:s.func,placeholder:s.string,dataItemKey:s.string.isRequired,textField:s.string.isRequired,checkField:s.string,checkIndeterminateField:s.string,expandField:s.string,subItemsField:s.string,className:s.string,style:s.object,label:s.string,validationMessage:s.string,validityStyles:s.bool,valid:s.bool,required:s.bool,name:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,filterable:s.bool,filter:s.string,loading:s.bool,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onFilterChange:s.func,onExpandChange:s.func,onCancel:s.func,item:s.func,listNoData:s.func,adaptiveTitle:s.string,adaptive:s.bool};Ge.displayName="KendoReactMultiSelectTree",Ge.propTypes=je;const Ye=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=ue,e.AutoCompletePropsContext=he,e.AutoCompleteWithoutContext=pe,e.ComboBox=oe,e.ComboBoxPropsContext=ne,e.ComboBoxWithoutContext=ae,e.DropDownList=Z,e.DropDownListClassComponent=Q,e.DropDownListPropsContext=X,e.DropDownListWithoutContext=Q,e.DropDownTree=He,e.DropDownTreePropsContext=ze,e.List=V,e.ListContainer=g,e.ListFilter=m,e.ListItem=M,e.MultiColumnComboBox=Fe,e.MultiColumnComboBoxPropsContext=De,e.MultiSelect=we,e.MultiSelectPropsContext=Se,e.MultiSelectTree=Ge,e.MultiSelectTreePropsContext=$e,e.MultiSelectWithoutContext=ke,e.SearchBar=ee,e.TagList=me,e.dropdownsMessages=H,e.findByFieldValue=(e,t,s)=>{if(!e)return;const i=e.findIndex((e=>I(e,t)===s));return e[i]},e.getItemValue=I,e.getMultiSelectTreeValue=(e,t)=>{const{items:s,dataItemKey:a,value:n,subItemsField:o="items",operation:l}=t,r=i.getter(a),d=Ye(n,r);if("clear"===l)return[];if("delete"===l){const e=Ye(s,r);return n.filter((t=>!e[r(t)]))}const p=s[0],h=r(p),u=i.getter(o),c=[...e],g=[];let m,v=[];for(;c.length;){const e=c.pop();if(h===r(e)){v=g.map((e=>e.item)),m=e;break}{g&&g.length&&g[g.length-1].parentPosition===c.length&&g.pop();const t=u(e);t&&t.length&&(g.push({item:e,parentPosition:c.length}),c.push(...t))}}const f=[...u(m)||[]];let b=[];for(;f.length;){const e=f.pop();b.push(e);const t=u(e);t&&t.length&&f.push(...t)}const y=[];if(!d[h]){y.push(...n),y.push(m),y.push(...b.filter((e=>!d[r(e)])));const e=v.filter((e=>!d[r(e)])),t=Ye(y,r);for(let s=e.length-1;s>-1;s--){const i=e[s],a=u(i);if(a.filter((e=>t[r(e)])).length<a.length)break;y.push(i),t[r(i)]=!0}}else{const e=r(m),t=Ye(b,r),s=Ye(v,r);y.push(...n.filter((i=>{const a=r(i);return!t[a]&&e!==a&&!s[a]})))}return y},e.getValueMap=Ye,e.nodata=P,e.scrollToItem=y}));
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-labels"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-treeview")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-labels","@progress/kendo-svg-icons","@progress/kendo-react-popup","@progress/kendo-react-inputs","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-treeview"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDropdowns={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactLabels,e.KendoSvgIcons,e.KendoReactPopup,e.KendoReactInputs,e.KendoReactIntl,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactTreeview)}(this,(function(e,t,s,i,a,n,o,l,r,d,p,h){"use strict";function u(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var c=u(t);const g=e=>{const{children:t,width:s,dir:i,itemsCount:a,popupSettings:n}=e;return c.createElement(o.Popup,{style:{width:s,direction:i},contentKey:a&&a.join(),...n},t)},m=c.forwardRef(((e,t)=>{const s=c.useRef(null),{renderListFilterWrapper:a=!1,renderPrefixSeparator:o=!1,...r}=e,d=i.useUnstyled(),p=d&&d.uDropDownsBase;c.useImperativeHandle(t,(()=>s.current));const h=c.createElement(l.TextBox,{...r,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:p})),value:e.value||"",onChange:e.onChange,onKeyDown:e.onKeyDown,tabIndex:e.tabIndex,onClick:e=>e.stopPropagation(),size:e.size,fillMode:e.fillMode,rounded:e.rounded,prefix:()=>c.createElement(c.Fragment,null,c.createElement(l.InputPrefix,null,c.createElement(i.IconWrap,{name:"search",icon:n.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:p}))})),o&&c.createElement(l.InputSeparator,null))});return a?c.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:p}))}," ",h," "):h}));m.propTypes={value:s.oneOfType([s.string,s.number,s.array]),tabIndex:s.number,onChange:s.func,onKeyDown:s.func,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),renderListFilterWrapper:s.bool,renderPrefixSeparator:s.bool},m.displayName="KendoReactListFilter";const v=e=>{const{group:t,groupMode:s,render:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase,l=c.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:o}))},"classic"===s?t:c.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:o}))},t));return void 0!==a?a.call(void 0,l,e):l},f=e=>null!=e,b=(e,t,s)=>{if(!f(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},y=(e,t,s,i,a)=>{const n=e.offsetHeight,o=t.children.item(s),l=o.offsetTop+(a?i-e.scrollTop:0),r=o.offsetHeight;if(a){let t=0;l+r>n?t=l+r-n:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>n+e.scrollTop?e.scrollTop=l+r-n:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},C=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let a=0;a<e.length;a++){const n=(I(e[a],s)||"")+"";if(n&&n.toLowerCase().startsWith(t)){i=a;break}}}return i},x=(e,t,s,i=!1)=>{const a=e=>i?e:e.toLowerCase();return e.findIndex((e=>s?a(I(e,s))===a(t):a(t)===a(e.toString())))},I=(e,t)=>{if(t&&f(e)){const s=t.split(".");let i=e;return s.forEach((e=>{i=i?i[e]:void 0})),i}return e},k=(e,t,s)=>{t.forEach((t=>{const i=e.findIndex((e=>S(e,t,s)));-1!==i&&e.splice(i,1)}))},S=(e,t,s)=>e===t||f(e)===f(t)&&I(e,s)===I(t,s),w=(e,t,s)=>{if(t){const i=x(e,t,s,!0);return-1!==i?e[i]:e[C(e,t,s)]}return e[0]},E=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},D=(e,t,s)=>!!e==!!t&&e.text===t.text&&(e===t||((e=[],t=[],s)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!S(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),F=e=>{const{data:t=[],groupField:s}=e;return s?t.filter((e=>s&&void 0!==e[s])):t},K=e=>e.preventDefault(),N=e=>{const{selected:t,defaultItem:s,textField:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase;return c.createElement("div",{onClick:e.onClick,onMouseDown:K,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionLabel({c:o,selected:t}))},I(s,a)||"")},M=e=>{const{selected:t,group:s,dataItem:a,virtual:n,groupMode:o,disabled:l,id:r,focused:d,render:p}=e,h=i.useUnstyled(),u=h&&h.uDropDownsBase,g=c.createElement("li",{id:r,role:"option","aria-selected":t,"aria-disabled":!!l||void 0,className:i.classNames(i.uDropDownsBase.li({c:u,selected:t,focused:d,first:!!s&&"classic"===o,disabled:l})),onClick:t=>e.onClick(e.index,t),style:{position:n?"relative":"unset"}},c.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:u}))},I(a,e.textField).toString()),void 0!==s&&"classic"===o?c.createElement("div",{className:i.classNames(i.uDropDownsBase.itemGroupLabel({c:u}))},s):null);return void 0!==p?p.call(void 0,g,e):g},T=e=>{const{group:t,virtual:s,render:a,isMultiColumn:n=!1,id:o}=e,l=i.useUnstyled(),r=l&&l.uDropDownsBase,d=c.createElement("li",{id:o,role:"group",className:i.classNames(i.uDropDownsBase.groupLi({c:r,isMultiColumn:n})),style:n?{boxSizing:"inherit"}:{position:s?"relative":"unset"}},c.createElement("span",{className:a?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:r,isMultiColumn:n}))},t));return void 0!==a?a.call(void 0,d,e):d},P="dropdowns.nodata",O="dropdowns.clear",B="dropdowns.comboArrowBtnAriaLabelExpand",_="dropdowns.comboArrowBtnAriaLabelCollapse",R="dropdowns.dropDownListArrowBtnAriaLabel",L="dropdowns.apply",z="dropdowns.cancel",H={[O]:"clear",[P]:"NO DATA FOUND.",[B]:"expand combobox",[_]:"collapse combobox",[R]:"select",[L]:"Apply",[z]:"Cancel"},V=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,{id:n,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:p,listRef:h,wrapperRef:u,listClassName:g,ariaSetSize:m}=e,v=(()=>{const{textField:t,valueField:s,groupField:i,groupMode:a,isMultiColumn:n,optionsGuid:o,skip:l=0,virtual:r,focusedIndex:d,hasDuplicates:p,highlightSelected:h=!0,value:u,data:g,itemRender:m,groupHeaderItemRender:v}=e,f=Array.isArray(u);let b=0;return g.map(((y,C)=>{const x=l+C,k=l+C+b,w=p?!!u&&d===C:!y.disabled&&(h&&(!f&&S(y,u,s)||f&&-1!==u.findIndex((e=>S(e,y,s)))));let E,D,F;C>0&&void 0!==i&&(D=I(y,i),F=I(g[C-1],i),D&&F&&D!==F&&(E=D));const K=void 0!==E&&"modern"===a;return K?b+=1:b=0,[K&&c.createElement(T,{id:`option-${o}-${k}`,virtual:r,key:x+"-group-item",group:E,isMultiColumn:n,render:v}),c.createElement(M,{id:`option-${o}-${K?k+1:k}`,virtual:r,dataItem:y,groupMode:a,selected:w,focused:d===C,index:x,key:x,onClick:e.onClick,textField:t,group:E,render:m,disabled:y.disabled})]}))})();return v.length?c.createElement("div",{className:l,style:d,ref:u,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},c.createElement("ul",{id:n,role:"listbox","aria-hidden":!o||void 0,"aria-setsize":m,className:g||i.classNames(i.uDropDownsBase.ul({c:a})),ref:h,style:p},v),e.scroller&&c.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:a}))},e.scroller)):(()=>{const s=e.noDataRender,n=c.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:a}))},c.createElement("div",null,t.toLanguageString(P,H[P])));return s?s.call(void 0,n):n})()},q="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);let A=class{constructor(){this.table=null,this.total=0,this.enabled=!1,this.skip=0,this.pageSize=0,this.PageChange=null,this.scrollElement=null,this.listTransform="",this.itemHeight=0,this.containerHeight=0,this.reactVersion=Number.parseFloat(c.version),this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.listTranslate=0,this.list=null,this.container=null,this.calcScrollElementHeight=()=>{var e;this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight;const s=this.itemHeight*this.total-((null==(e=this.list)?void 0:e.offsetHeight)||0);this.containerHeight=q?Math.min(17895697,s):s;const i=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==i+"px",t&&(this.scrollElement.style.height=i+"px")),this.scrollSyncing=!1,t},this.scrollerRef=e=>{this.container=e,e&&(e.setAttribute("unselectable","on"),window.setTimeout(this.calcScrollElementHeight.bind(this),0))},this.getRowHeightService=i.memoizeOne(((e,t)=>new i.RowHeightService(t,e,0))),this.firstLoaded=this.pageSize,this.lastLoaded=this.skip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}translateTo(e,t){this.listTranslate=e,this.enabled&&this.list&&(q||this.reactVersion<=17||t?this.list.style.transform="translateY("+e+"px)":this.listTransform="translateY("+e+"px)")}changePage(e,t){const s=Math.min(Math.max(0,e),this.total-this.pageSize);s!==this.skip&&this.PageChange&&this.PageChange({skip:s,take:this.pageSize},t)}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0,!0))}scrollToEnd(){if(this.container&&this.list){this.calcScrollElementHeight();const{scrollHeight:e,offsetHeight:t}=this.container;this.container.scrollTop=e,this.translateTo(e-t,!0)}}scrollHandler(e){if(!this.enabled||!this.container||!this.list)return;if(this.scrollSyncing)return void(this.scrollSyncing=!1);this.rowHeightService=this.getRowHeightService(this.itemHeight,this.total);const t=this.container.scrollTop,s=this.lastScrollTop>=t,i=!s,a=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let n=this.rowHeightService.index(t),o=this.rowHeightService.offset(n);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=n+this.pageSize-this.total;t>0&&(n-=t,o=this.rowHeightService.offset(n)),this.firstLoaded=n,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&n-1<=this.firstLoaded){const t=a===this.itemHeight;if(0===this.skip&&t)this.lastScrollTop=0,this.firstLoaded=0,this.lastLoaded=this.pageSize,this.container.scrollTop=0,this.translateTo(0,!0);else{const t=Math.floor(.3*this.pageSize);this.firstLoaded=Math.max(n-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}},W=class{navigate(e){const t=e.keyCode;return t===i.Keys.up||t===i.Keys.left?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:-1}):t===i.Keys.down||t===i.Keys.right?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:1}):t===i.Keys.home?0:t===i.Keys.end?e.max:void 0}next(e){return f(e.current)?Math.min(e.max,Math.max(e.current+e.step,e.min)):e.min}};const U=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new A,this.navigation=new W,this.handleItemClick=(e,t)=>{const s=this.initState();s.syntheticEvent=t,t.stopPropagation(),this.component.handleItemSelect(e,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=e=>{if(!this.component.state.focused){const t=this.initState();t.data.focused=!0,t.events.push({type:"onFocus"}),t.syntheticEvent=e,this.applyState(t)}},this.filterChanged=(e,t)=>{const{textField:s,filterable:i}=this.component.props;i&&t.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:e}})},this.togglePopup=e=>{const t=this.component.props,s=void 0!==t.opened?t.opened:this.component.state.opened;void 0===t.opened&&(e.data.opened=!s),s?e.events.push({type:"onClose"}):(e.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(e,t)=>{const s=this.initState();s.syntheticEvent=t,this.triggerOnPageChange(s,e.skip,e.take),this.applyState(s)},this.scrollToVirtualItem=(e,t)=>{const s=this.vs;if(0===e.skip)s.reset();else{let i=s.translate;0===i&&(s.calcScrollElementHeight(),i=s.itemHeight*e.skip,s.translateTo(i,!0)),t<0&&i>0&&(i+=s.itemHeight*(e.pageSize/4)),s.container&&(s.container.scrollTop=i),this.scrollToItem(t,!0)}},this.scrollPopupByPageSize=e=>{var t,s,i,a,n,o;const l=this.vs,r=null==(s=null==(t=this.list)?void 0:t.parentElement)?void 0:s.scrollTop,d=l.enabled&&l.itemHeight?l.itemHeight:this.list?this.list.children[0].offsetHeight:0,p=null==(a=null==(i=this.list)?void 0:i.parentElement)?void 0:a.offsetHeight;void 0!==r&&void 0!==p&&(null==(o=null==(n=this.list)?void 0:n.parentElement)||o.scroll({top:r+e*Math.floor(p/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&c.createElement("div",{ref:t=>e.scrollElement=t,key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({...t.state,group:e})},this.listBoxId=e.props.id+"list",this.guid=e.props.id,this.component=e,this.vs.PageChange=this.pageChange}didUpdate(){this.vs.listTransform&&this.vs.list&&(this.vs.list.style.transform=this.vs.listTransform,this.vs.listTransform="")}didMount(){const e=this.component.props,t=e.popupSettings||{},s=e.style||{},i=t.width;let a=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),a=!0),a&&this.component.forceUpdate()}calculateDir(){const e=this.component.element;e&&e.ownerDocument&&e.ownerDocument.defaultView&&(this.dirCalculated=e.ownerDocument.defaultView.getComputedStyle(e).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(e,t,s){const i=this.list||this.vs.list;if(!i&&!s&&setTimeout((()=>{this.scrollToItem(e,t,!0)}),10),0===e&&t&&0===this.vs.skip)this.vs.reset();else if(i&&e>=0){const s=this.vs,a=s.container||i.parentNode,n=void 0!==t?t:s.enabled;y(a,i,e,s.translate,n)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(e){Object.keys(e.data).length>0&&this.component.setState(e.data);const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.syntheticEvent?e.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};e.events.forEach((e=>{const s=e.type;delete e.type;const i=s&&this.component.props[s];i&&i.call(void 0,{...t,...e})}))}triggerOnPageChange(e,t,s){const i=this.component.props.virtual;if(i){const a=Math.min(Math.max(0,t),Math.max(0,i.total-s));a!==i.skip&&e.events.push({type:"onPageChange",page:{skip:a,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:a,virtual:n}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&n&&this.vs.enabled&&(n.skip>0&&S(e,i[0],a)?this.triggerOnPageChange(t,n.skip-1,n.pageSize):!o&&n.skip+n.pageSize<n.total&&S(e,i[i.length-1],a)&&this.triggerOnPageChange(t,n.skip+1,n.pageSize))}getPopupSettings(){return Object.assign({},e.defaultProps.popupSettings,this.component.props.popupSettings)}getAdaptiveAnimation(){const e=this.getPopupSettings();return void 0===e.animate||e.animate}getGroupedDataModernMode(e,t){const s=[];return e.forEach(((i,a)=>{e[a-1]&&i[t]!==e[a-1][t]&&s.push({[t]:i[t]}),s.push(e[a])})),s}};U.basicPropTypes={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,textField:s.string,className:s.string,label:s.string,loading:s.bool,popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,itemRender:s.func,listNoDataRender:s.func,focusedItemIndex:s.func,header:s.node,footer:s.node},U.propTypes={...U.basicPropTypes,value:s.any,defaultValue:s.any,filterable:s.bool,filter:s.string,virtual:s.shape({pageSize:s.number.isRequired,skip:s.number.isRequired,total:s.number.isRequired}),onFilterChange:s.func,onPageChange:s.func},U.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let $=U;const G={name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654528156,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},j=500,Y=768,J=class e extends c.Component{constructor(e){super(e),this.state={},this._element=null,this.base=new $(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus({preventScroll:!0})},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i,defaultItem:a}=this.props,n=F(this.props),o=s?s.skip:0,l=-1===e&&void 0!==a?a:n[e-o],r=!S(l,this.value,i);this.triggerOnChange(l,t),r&&this.base.triggerPageChangeCornerItems(l,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.dummySelect=e=>c.createElement("select",{name:this.props.name,ref:e=>{this._select=e},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},c.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,e):e})),this.renderListContainer=()=>{const{header:e,footer:t,dir:s,size:a,groupField:n,groupStickyHeaderItemRender:o,list:l,unstyled:r}=this.props,d=F(this.props),p=this.base,h=p.getPopupSettings(),u=void 0!==this.props.opened?this.props.opened:this.state.opened,m=void 0!==h.width?h.width:p.popupWidth,f=r&&r.uDropDownList,b={dir:void 0!==s?s:p.dirCalculated,width:m,popupSettings:{...h,popupClass:i.classNames(h.popupClass,i.uDropDownList.listContainer({c:f})),anchor:h.anchor||this.element,show:u,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,onMouseDownOutside:this.onPopupMouseDown},itemsCount:[d.length]};let{group:y}=this.state;return void 0===y&&void 0!==n&&(y=I(d[0],n)),c.createElement(g,{...b},this.renderListFilter(),e&&c.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:f}))},e),c.createElement("div",{className:i.classNames(i.uDropDownList.list({c:f,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!l&&y&&0!==d.length&&c.createElement(v,{group:y,groupMode:"modern",render:o}),this.renderList()),t&&c.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:f}))},t))},this.renderList=()=>{const{textField:e,dataItemKey:t,virtual:s={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:n,itemRender:o,unstyled:l}=this.props,r=F(this.props),d=l&&l.uDropDownList,p=this.base.vs,h=s.skip,u=void 0!==this.props.opened?this.props.opened:this.state.opened,g=this.base.getPopupSettings(),m=`translateY(${p.translate}px)`;return c.createElement(V,{id:this._listboxId,show:u,data:r.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:t,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>p.list=this.base.list=e,wrapperStyle:{maxHeight:g.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:d})),listStyle:p.enabled?{transform:m}:void 0,key:"listkey",skip:h,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:a,noDataRender:n,onScroll:this.onScroll,wrapperRef:p.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:s.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=F(this.props);if(i&&a.length&&i){const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;a=this.base.getGroupedDataModernMode(a,i);let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&this.setState({group:l})}},this.renderListFilter=()=>{const e=void 0!==this.props.filter?this.props.filter:this.state.text;return this.props.filterable&&c.createElement(m,{value:e,ref:e=>this._filterInput=e&&e.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,renderListFilterWrapper:!0})},this.renderDefaultItem=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=this.props;return void 0!==t&&c.createElement(N,{defaultItem:t,textField:e,selected:S(this.value,t,s),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=e=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout((()=>this.searchState.word=""),this.props.delay),this.selectNext(e))},this.selectNext=e=>{const{dataItemKey:t}=this.props,s=F(this.props);let i=s.map(((e,t)=>({item:e,itemIndex:t})));const a=this.searchState.word,n=this.searchState.last,o=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(a,n);let l,r=i.length,d=Math.max(0,s.findIndex((e=>S(e,this.value,t))));this.props.defaultItem&&(l={item:this.props.defaultItem,itemIndex:-1},r+=1,d+=1),d+=o?1:0,i=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(i,d,l);let p,h,u,c=0;const{textField:g,ignoreCase:m}=this.props;for(;c<r;c++)if(p=I(i[c].item,g),h=o&&b(p,n,m),u=b(p,a,m),h||u){c=i[c].itemIndex;break}if(c!==r){const t=this.base.initState();t.syntheticEvent=e,this.handleItemSelect(c,t),this.applyState(t),this._valueDuringOnChange=void 0}},this.handleKeyDown=e=>{e&&e.target instanceof Element&&"INPUT"===e.target.nodeName&&e.stopPropagation&&e.stopPropagation();const{filterable:t,disabled:s,defaultItem:a,leftRightKeysNavigation:n=!0,virtual:o={skip:0,total:0,pageSize:0},dataItemKey:l,groupField:r="",textField:d,skipDisabledItems:p=!0}=this.props,h=F(this.props),u=this.value,c=h.findIndex((e=>S(e,u,l))),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=e.keyCode,v=m===i.Keys.home||m===i.Keys.end,f=m===i.Keys.up||m===i.Keys.down,b=!g&&(e.altKey&&m===i.Keys.down||m===i.Keys.enter||m===i.Keys.space),y=g&&(e.altKey&&m===i.Keys.up||m===i.Keys.esc),C=n&&(m===i.Keys.left||m===i.Keys.right),x=f||C&&!t||v,I=this.base.initState();if(I.syntheticEvent=e,!s){if(v&&this.base.vs.enabled)m===i.Keys.home?0!==o.skip?(this.base.triggerOnPageChange(I,0,o.pageSize),this._navigated=!0):this.triggerOnChange(h[0],I):o.skip<o.total-o.pageSize?(this.base.triggerOnPageChange(I,o.total-o.pageSize,o.pageSize),this._navigated=!0):this.triggerOnChange(h[h.length-1],I);else if(g&&m===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(g&&m===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if(g&&m===i.Keys.enter){const t=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(h,t)?(this.triggerOnChange(null,I),this.applyState(I)):this.handleItemSelect(t,I),this.base.togglePopup(I),e.preventDefault()}else if(b||y)y&&this.resetValueIfDisabledItem(),this.base.togglePopup(I),e.preventDefault();else if(x){if(this._lastKeypressIsFilter=!1,""!==r&&d)if(!p&&g)this.onNavigate(I,m);else{let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(c+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===c&&a)e=-1;else if(-1===c)t=h,e=h.findIndex((e=>!e.disabled&&e[d]));else{t=h.slice(0,c);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-c;this.onNavigate(I,m,t)}else void 0===e&&h.findIndex((e=>e[d]===u[d]))===h.length-1&&this.onNavigate(I,m)}else if(!p&&g||v)this.onNavigate(I,m);else if(d){let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(c+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===c&&a)e=-1;else if(-1===c)t=h,e=h.find((e=>!e.disabled&&e[d]));else{t=h.slice(0,c);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-c;this.onNavigate(I,m,t)}else void 0===e&&h.findIndex((e=>e[d]===u[d]))===h.length-1&&this.onNavigate(I,m)}else this.onNavigate(I,m);e.preventDefault()}this.applyState(I)}},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{if(this._skipFocusEvent||!this.state.focused)return;const t=void 0!==this.props.opened?this.props.opened:this.state.opened,{adaptive:s}=this.props,{windowWidth:i=0}=this.state,a=i<=Y&&s,n=this.base.initState();n.syntheticEvent=e,n.data.focused=!1,n.events.push({type:"onBlur"}),t&&this.resetValueIfDisabledItem(),t&&!a&&this.base.togglePopup(n),this.applyState(n)},this.handleDefaultItemClick=e=>{const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.triggerOnChange(this.props.defaultItem,t),this.applyState(t)},this.handleWrapperClick=e=>{if(e.isPropagationStopped())return;const t=this.base.initState();t.syntheticEvent=e,this.state.focused||(t.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(t),this.applyState(t)},this.handleKeyPress=e=>{if(this.props.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);this.props.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),this.searchState={word:this.searchState.word+t,last:this.searchState.last+t},this.search(e)},this.handleListFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,void 0===this.props.filter&&(t.data.text=e.target.value),this.base.filterChanged(e.target.value,t),this._lastKeypressIsFilter=!0,this.applyState(t),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout((()=>{this._filterInput&&this.focusElement(this._filterInput)}),300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout((()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)}))},this.onPopupMouseDown=e=>{var t;null!=(t=this.props.popupSettings)&&t.onMouseDownOutside&&this.props.popupSettings.onMouseDownOutside.call(void 0,e)},this.togglePopup=()=>{const e=this.base.initState();e.data.opened=this.state.opened,this.base.togglePopup(e),this.applyState(e)},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please select a value from the list!")},i.validatePackage(G)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let e;return void 0!==this._valueDuringOnChange?e=this._valueDuringOnChange:void 0!==this.props.value?e=this.props.value:void 0!==this.state.value?e=this.state.value:void 0!==this.props.defaultValue&&(e=this.props.defaultValue),!f(e)&&void 0!==this.props.defaultItem&&(e=this.props.defaultItem),e}get index(){const{dataItemKey:e}=this.props,t=F(this.props),s=this.value;return t.findIndex((t=>S(t,s,e)))}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&""!==this.value&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{dataItemKey:i,virtual:a,groupField:n="",textField:o}=this.props,l=F(this.props),r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,h=!p&&d;if(this.base.didUpdate(),this.base.getPopupSettings().animate||h&&this.onPopupOpened(),a&&a.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=this.value,u=void 0!==e.value?e.value:t.value;let c=l.findIndex((e=>S(e,r,i)));""!==n&&r&&o&&(c=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(r[o]));const g=!S(u,r,i);h&&a?this.base.scrollToVirtualItem(a,c):h&&!a?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(c)):d&&p&&r&&g&&!this._navigated?this.base.scrollToItem(c,this.base.vs.enabled):d&&p&&this._navigated&&(this._navigated&&a&&0===a.skip?this.base.vs.reset():this._navigated&&a&&a.skip===a.total-a.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const e=r.provideLocalizationService(this).toLanguageString(R,H[R]),{style:t,className:s,label:o,dir:l,virtual:p,size:h,rounded:u,fillMode:g,adaptive:m,unstyled:v}=this.props,{windowWidth:f=0}=this.state,b=void 0!==this.props.opened?this.props.opened:this.state.opened,y=this.value,C=I(y,this.props.textField),x=!this.validityStyles||this.validity.valid,k=this.base,w=k.vs,E=f<=Y&&m,D=v&&v.uDropDownList;w.enabled=void 0!==p,void 0!==p&&(k.vs.skip=p.skip,k.vs.total=p.total,k.vs.pageSize=p.pageSize);const{dataItemKey:K,disabled:N,tabIndex:M,loading:T,iconClassName:P,svgIcon:O,valueRender:B}=this.props,_=F(this.props),{focused:L}=this.state,z=_.findIndex((e=>S(e,y,K))),V=c.createElement("span",{id:this._inputId,className:i.classNames(i.uDropDownList.inputInner({c:D}))},C&&c.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:D}))},C)),q=void 0!==B?B.call(void 0,V,y):V,A=c.createElement(c.Fragment,null,c.createElement("span",{ref:this.componentRef,className:i.classNames(i.uDropDownList.wrapper({c:D,size:h,rounded:u,fillMode:g,focused:L,disabled:N,invalid:!x,loading:T,required:this.required}),s),style:o?{...t,width:void 0}:t,dir:l,onMouseDown:b?e=>{"INPUT"!==e.target.nodeName&&(this.focusElement(this.base.wrapper),e.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:i.getTabIndex(M,N),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:N?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":N||void 0,"aria-haspopup":"listbox","aria-expanded":b||!1,"aria-owns":this._listboxId,"aria-activedescendant":b?"option-"+this._guid+"-"+(z+(p?p.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,"aria-controls":this._listboxId,id:this.props.id,title:this.props.title},q,T&&c.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:D})),name:"loading"}),c.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":e,size:h,fillMode:g,iconClass:P,className:i.classNames(i.uDropDownList.inputButton({c:D})),rounded:null,themeColor:"base",icon:P?void 0:"caret-alt-down",svgIcon:O||n.caretAltDownIcon,onMouseDown:e=>this.state.focused&&e.preventDefault()}),this.dummySelect(y),!E&&this.renderListContainer()),E&&this.renderAdaptiveListContainer());return o?c.createElement(a.FloatingLabel,{label:o,editorValue:C,editorValid:x,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:A}):A}onNavigate(e,t,s){const{defaultItem:i,dataItemKey:a,virtual:n={skip:0,total:0,pageSize:0}}=this.props,o=F(this.props),l=this.base.vs,r=this.value,d=o.findIndex((e=>S(e,r,a))),p=this.base.navigation.navigate({current:n.skip+d,max:(l.enabled?n.total:o.length)-1,min:void 0!==i?-1:0,keyCode:t,skipItems:s||void 0});void 0!==p&&this.handleItemSelect(p,e),this.applyState(e)}renderAdaptiveListContainer(){const{windowWidth:e=0}=this.state,{header:t,footer:s,size:a,adaptiveTitle:o,groupField:l,groupStickyHeaderItemRender:r,list:h,unstyled:u}=this.props,g=F(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=u&&u.uDropDownList,b=u&&u.uDropDownsActionSheet,y={navigatable:!1,navigatableElements:[],expand:m,animation:!0,onClose:e=>this.handleWrapperClick(e),animationStyles:e<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:b,isFullScreen:e<=j}))};let{group:C}=this.state;return void 0===C&&void 0!==l&&(C=I(g[0],l)),c.createElement(p.ActionSheet,{...y},c.createElement(p.ActionSheetHeader,{className:i.classNames(i.uDropDownsActionSheet.header({c:b}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:b}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:b}))},c.createElement("div",null,o)),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:b}))},c.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:n.xIcon}))),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:b}))},this.renderListFilter())),c.createElement(p.ActionSheetContent,{overflowHidden:!0},t&&c.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:f}))},t),c.createElement("div",{className:i.classNames(i.uDropDownList.list({c:f,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!h&&C&&0!==g.length&&c.createElement(v,{group:C,groupMode:"modern",render:r}),this.renderList()),s&&c.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:f}))},s)))}getFocusedIndex(){const e=this.value,{textField:t,dataItemKey:s,virtual:i={skip:0},focusedItemIndex:a=C,filterable:n,skipDisabledItems:o=!0}=this.props,l=F(this.props),r=this.props.filter?this.props.filter:this.state.text;return o&&t&&!r&&!e?l.findIndex((e=>!e.disabled&&e[t])):f(e)&&void 0===r||n&&""===r?l.findIndex((t=>S(t,e,s))):r?this._lastKeypressIsFilter?a(l,r,t):l.findIndex((t=>S(t,e,s))):0===i.skip?0:-1}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),30)}triggerOnChange(e,t){S(this.value,e,this.props.dataItemKey)||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}resetValueIfDisabledItem(){const e=F(this.props),t=this.base.initState(),s=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(e,s)&&(this.triggerOnChange(null,t),this.applyState(t))}haveFocusedItemAndDataNotEmpty(e,t){return void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled}};J.displayName="DropDownList",J.propTypes={delay:s.number,ignoreCase:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,defaultItem:s.any,valueRender:s.func,valueMap:s.func,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,leftRightKeysNavigation:s.bool,title:s.string,groupField:s.string,list:s.any,skipDisabledItems:s.bool,renderListFilterWrapper:s.bool,...$.propTypes},J.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...$.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};let Q=J;const X=i.createPropsContext(),Z=i.withIdHOC(i.withPropsContext(X,i.withUnstyledHOC(Q)));Z.displayName="KendoReactDropDownList";let ee=class extends c.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:a,suggestedText:n,focused:o}=this.props,l=this.input,r=t!==a||n!==s,d=r&&t.startsWith(a)&&!(s&&n&&s.endsWith(n)),p=i.getActiveElement(document);o&&l&&p!==l&&l.focus(),n&&r&&!d&&l&&l.setSelectionRange(a.length-n.length,a.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:a,tabIndex:n,accessKey:o,unstyled:l}=this.props,r=l&&l.uDropDownsBase,d={tabIndex:n,accessKey:o},p=c.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:i.classNames(i.uDropDownsBase.inputInner({c:r})),role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:e=>this._input=e,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":t||void 0,disabled:t||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":e,"aria-owns":this.props.owns,"aria-activedescendant":e?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.ariaRequired,"aria-controls":this.props.ariaControls,...d});return a?a.call(void 0,p):p}};const te=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,o=t.toLanguageString(O,H[O]);return c.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:a})),role:"button",onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},c.createElement(i.IconWrap,{name:"x",icon:n.xIcon}))},se=i.useCustomComponent,ie=class e extends c.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.focus=()=>{this._input&&this._input.focus()},this.checkForDuplicatePlainTextRecords=()=>{const e=void 0!==this.props.textField,t=void 0!==this.props.dataItemKey;if(this.props.data&&this.props.data.length>0&&!e&&!t){const e=this.props.data;this.duplicates=(e=>{const t=e.filter(((t,s)=>e.some(((e,i)=>e===t&&i!==s))));return Array.from(new Set(t))})(e),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i}=this.props,a=F(this.props)[e-(s?s.skip:0)],n=this.hasDuplicates||!S(a,this.value,i);this.triggerOnChange(a,t),void 0!==this.state.text&&(t.data.text=void 0),n&&this.base.triggerPageChangeCornerItems(a,t)},this.onPopupOpened=()=>{setTimeout((()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)}),300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{skipDisabledItems:t,textField:s}=this.props,i=F(this.props),a=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(s,i,a),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&n&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(l),!o&&this.mobileMode){const e=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(e,l)}this.applyState(l)},this.closeOpenedApplyStateNonMobileMode=(e,t)=>{t&&!this.mobileMode&&this.base.togglePopup(e)},this.renderMobileListFilter=()=>{const e=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text,t=I(this.value,this.props.textField),s=f(e)?e:t;return c.createElement(m,{value:s,ref:e=>this._adaptiveFilterInput=e&&e.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:"large",rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,t.data.text=e.target.value,this.base.filterChanged(e.target.value,t),this.applyState(t)},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=F(this.props);if(!i||!a.length)return;const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;"modern"===this.props.groupMode&&(a=this.base.getGroupedDataModernMode(a,i));let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&(this.setState({group:l}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:l}))},this.handleItemClick=(e,t)=>{this.navigationIndex=e,this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleBlur=e=>{if(this.state.focused&&!this._skipBlur){const t=this.base.initState(),{textField:s}=this.props,i=F(this.props),a=this.getFocusedIndex(),n=!(-1===a)&&this.getCurrentValueDisabledStatus(s,i,a);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&n&&this.clearValueOnBlur(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,t)}},this.onInputClick=e=>{const t=void 0!==this.props.opened?this.props.opened:this.state.opened,s=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text||null;if(!t&&this.mobileMode){const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.base.filterChanged(s,t),this.applyState(t)}},this.onInputKeyDown=e=>{const{skipDisabledItems:t,textField:s,dataItemKey:a,groupField:n}=this.props,o=F(this.props),l=this.value,r=Math.max(0,o.findIndex((e=>S(e,l,a)))),d=e.keyCode,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=this.base.initState();if(h.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==n&&s)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=0;if(d===i.Keys.down||d===i.Keys.right){const t=o.slice(r+1<o.length?r+1:r).find((e=>!e.disabled&&e[s]));e=t&&o.findIndex((e=>e[s]===t[s]))}else if(d===i.Keys.up||d===i.Keys.left){let t;if(0===r)t=o,e=o.findIndex((e=>!e.disabled&&e[s]));else{t=o.slice(0,r);let i=t.pop();for(;i&&i.disabled;)i=t.pop();e=i&&o.findIndex((e=>e[s]===i[s]))}}if(void 0!==e){const t=e-r;this.onNavigate(h,d,t)}else void 0===e&&o.findIndex((e=>e[s]===l[s]))===o.length-1&&this.onNavigate(h,d)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=null;if(d===i.Keys.down||d===i.Keys.right)e=o.slice(r+1).find((e=>!e.disabled));else if(d===i.Keys.up||d===i.Keys.left){const t=o.slice(0,r);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-r-1;this.onNavigate(h,d,t)}else this.onNavigate(h,d)}this.applyState(h)}const u=()=>{e.preventDefault(),this.base.togglePopup(h),this.applyState(h)},c=this.getFocusedIndex(),g=-1===c,m=!g&&this.getCurrentValueDisabledStatus(s,o,c);p?d===i.Keys.pageUp?(e.preventDefault(),this.base.scrollPopupByPageSize(-1)):d===i.Keys.pageDown?(e.preventDefault(),this.base.scrollPopupByPageSize(1)):e.altKey&&d===i.Keys.up?u():d===i.Keys.enter?(e.preventDefault(),(s&&!g&&e.currentTarget.value?o[c][s]:void 0)?!t&&s&&m?this.clearValueOnEnterOrEsc(e):m||this.applyValueOnEnter(e.currentTarget.value,h):this.applyValueOnEnter(e.currentTarget.value,h)):d===i.Keys.esc&&(!t&&s&&m&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,h)):p||d!==i.Keys.esc?e.altKey&&d===i.Keys.down&&u():this.clearValueOnEnterOrEsc(e)},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const s=void 0!==this.props.opened?this.props.opened:this.state.opened,i=e.currentTarget,a=i.value;if(this.props.suggest){const e=i.selectionEnd===a.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;f(t)||(t=I(this.value,this.props.textField)||"");const s=t&&t===a,n=t&&t.length>a.length;s||n||!e?this._suggested="":this.suggestValue(a)}void 0===this.props.filter&&(t.data.text=a),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s||this.base.togglePopup(t),this.base.filterChanged(a,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnBlur=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},i.validatePackage(G)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Y&&this.props.adaptive)}get value(){return void 0!==this._valueDuringOnChange?this._valueDuringOnChange:void 0!==this.props.value?this.props.value:void 0!==this.state.value?this.state.value:void 0!==this.props.defaultValue?this.props.defaultValue:void 0}get index(){const{dataItemKey:e}=this.props,t=F(this.props),s=this.value;return t.findIndex((t=>S(t,s,e)))}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&""!==this.value&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{dataItemKey:i,virtual:a,groupField:n="",textField:o}=this.props,l=F(this.props),r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened;e.data!==l&&this.checkForDuplicatePlainTextRecords();const h=!p&&d,u=this.value;if(this._valueOnDidUpdate=u,this.base.didUpdate(),a&&a.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=void 0!==e.value?e.value:t.value;let c=this.hasDuplicates?this.navigationIndex||0:l.findIndex((e=>S(e,u,i)));"modern"===this.props.groupMode&&o&&u&&(c=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(u[o]));const g=!S(r,u,i);h&&a?this.base.scrollToVirtualItem(a,c):h&&!a?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(c)):(this.hasDuplicates||d&&p&&u&&g)&&this.base.scrollToItem(c)}h&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body),this.checkForDuplicatePlainTextRecords()}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const t=r.provideLocalizationService(this).toLanguageString(B,H[B]),s=r.provideLocalizationService(this).toLanguageString(_,H[_]),{dir:o,disabled:l,clearButton:p=e.defaultProps.clearButton,label:h,textField:u,className:g,style:m,loading:v,iconClassName:b,virtual:y,size:C,rounded:x,fillMode:k,opened:S=this.state.opened,placeholder:w,svgIcon:E,unstyled:D}=this.props,F=!this.validityStyles||this.validity.valid,K=void 0!==this.props.filter?this.props.filter:this.state.text,N=I(this.value,u),M=f(K)?K:N,T=p&&(!!M||f(this.value)),P=this.base.vs,O=this.props.id||this._inputId,R=this.mobileMode,L=D&&D.uComboBox;P.enabled=void 0!==y,void 0!==y&&(P.skip=y.skip,P.total=y.total,P.pageSize=y.pageSize);const[z,V]=se(this.props.prefix||c.Fragment),[q,A]=se(this.props.suffix||c.Fragment),W=c.createElement(c.Fragment,null,c.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:L,size:C,rounded:x,fillMode:k,disabled:l,invalid:!F,loading:v,required:this.required}),g),ref:this.componentRef,style:h?{...m,width:void 0}:m,dir:o},this.props.prefix&&c.createElement(z,{...V}),this.renderSearchBar(M||"",O,w),T&&!v&&c.createElement(te,{onClick:this.clearButtonClick,key:"clearbutton"}),v&&c.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:L})),name:"loading",key:"loading"}),this.props.suffix&&c.createElement(q,{...A}),c.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":S?s:t,icon:b?void 0:"caret-alt-down",svgIcon:E||n.caretAltDownIcon,iconClass:b,size:C,fillMode:k,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:L})),onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!R&&this.renderListContainer()),R&&this.renderAdaptiveListContainer());return h?c.createElement(a.FloatingLabel,{label:h,editorId:O,editorValue:M,editorValid:F,editorDisabled:l,style:{width:m?m.width:void 0},children:W,unstyled:D}):W}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,a=F(this.props),n=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const p=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(p),-1===l||f(d))if(""===n)this.handleItemSelect(0,e);else{const n=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:n,max:(r.enabled?r.total:a.length)-1,min:0,skipItems:s||void 0}),void 0!==o&&this.handleItemSelect(o,e)}else this.handleItemSelect(l,e);this.navigationIndex=o}getCurrentValueDisabledStatus(e,t,s){return e&&t&&t[s]&&t[s].disabled}applyValueOnEnter(e,t){const{textField:s,allowCustom:i}=this.props,a=F(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s)===e?this.index:x(a,e,s),l=-1!==o;let r;if(this._suggested="",l)r=a[o];else{if(!i)return this.selectFocusedItem(e,t);r=void 0!==s?{[s]:e}:e}this.triggerOnChange(r,t),n&&this.base.togglePopup(t),void 0===this.props.filter&&void 0!==this.state.text&&(t.data.text=void 0),this.applyState(t)}applyValueOnRejectSuggestions(e,t){const{textField:s,allowCustom:i}=this.props,a=F(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s);if(this._suggested="",e===o||""===e&&!f(o))return this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t);const l=x(a,e,s,!0);let r=null;-1!==l?r=a[l]:i&&(r=e?s?{[s]:e}:e:null),this.triggerOnChange(r,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:a={skip:0},focusedItemIndex:n=C}=this.props,o=F(this.props),l=a.skip,r=""===e&&0===l?0:n(o,e,i);return-1!==r?this.handleItemSelect(r+l,t):(this.triggerOnChange(null,t),void 0!==this.state.text&&(t.data.text=void 0)),s&&this.base.togglePopup(t),this.applyState(t)}renderAdaptiveListContainer(){const{windowWidth:e=0}=this.state,{header:t,footer:s,size:a,groupField:o,groupMode:l,list:r,virtual:h,adaptiveTitle:u,groupStickyHeaderItemRender:g,unstyled:m}=this.props,f=F(this.props),b=void 0!==this.props.opened?this.props.opened:this.state.opened,y=this.base.getAdaptiveAnimation(),C=m&&m.uComboBox,x=m&&m.uDropDownsActionSheet;let{group:k}=this.state;void 0===k&&void 0!==o&&(k=I(f[0],o));const S={navigatable:!1,navigatableElements:[],expand:b,animation:y,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:x,isFullScreen:e<=j}))};return c.createElement(p.ActionSheet,{...S},c.createElement(p.ActionSheetHeader,null,c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:x}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:x}))},c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:x}))},u),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:x}))})),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:x}))},c.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",themeColor:"base",size:"large",onClick:this.toggleBtnClick,icon:"x",svgIcon:n.xIcon}))),c.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:x}))},this.renderMobileListFilter())),c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:C}))},c.createElement("div",{className:i.classNames(i.uComboBox.list({c:C,list:r,size:"large",tableSize:a,virtual:h}))},t&&c.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:C}))},t),!r&&k&&0!==f.length&&c.createElement(v,{group:k,groupMode:l,render:g}),this.renderList(),s&&c.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:C}),this.props.footerClassName)},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,groupField:n,groupMode:o,size:l,list:r,virtual:d,groupStickyHeaderItemRender:p,unstyled:h}=this.props,u=F(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=e.getPopupSettings(),b=void 0!==f.width?f.width:e.popupWidth,y=h&&h.uComboBox;let{group:C}=this.state;return void 0===C&&void 0!==n&&(C=I(u[0],n)),c.createElement(g,{width:b,popupSettings:{...f,anchor:f.anchor||this.element,show:m,popupClass:i.classNames(f.popupClass,i.uComboBox.listContainer({c:y,popup:!0}))},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[u.length]},c.createElement("div",{className:i.classNames(i.uComboBox.list({c:y,list:r,size:l,tableSize:l,virtual:d}))},s&&c.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:y}))},s),!r&&C&&0!==u.length&&c.createElement(v,{group:C,groupMode:o,render:p}),this.renderList(),a&&c.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:y}),this.props.footerClassName)},a)))}renderList(){const e=this.base,{textField:t,dataItemKey:s,listNoDataRender:a,itemRender:n,groupHeaderItemRender:o,virtual:l={skip:0,total:void 0},unstyled:r}=this.props,d=F(this.props),p=e.getPopupSettings(),h=e.vs,u=l.skip,g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=`translateY(${h.translate}px)`,v=g?this.getFocusedIndex(this.hasDuplicates):void 0,b=void 0!==this.props.filter?this.props.filter:this.state.text,y=I(this.value,t),C=f(b)&&b!==y?null:this.value,x=this.props.list||V,k=r&&r.uComboBox;return c.createElement(x,{id:e.listBoxId,virtual:!!l,show:g,data:d,focusedIndex:v,value:C,textField:t,valueField:s,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,hasDuplicates:this.hasDuplicates,listRef:e=>{h.list=this.base.list=e,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>Y?{maxHeight:p.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:k,virtual:l})),listStyle:h.enabled?{transform:m}:void 0,key:"listkey",skip:u,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:o,noDataRender:a,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll,wrapperRef:h.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:l.total})}renderSearchBar(e,t,s){const{tabIndex:i,disabled:a,title:n,ariaLabelledBy:o,ariaDescribedBy:l,dataItemKey:r,virtual:d={skip:0},accessKey:p,unstyled:h}=this.props,u=F(this.props),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=this.value,v=Math.max(0,u.findIndex((e=>S(e,m,r))));this._suggested&&!S(this._valueOnDidUpdate,m,r)&&(this._suggested="");const f={accessKey:p};return c.createElement(ee,{id:t,readOnly:g&&this.mobileMode,placeholder:s,tabIndex:i,title:n,value:e+this._suggested,suggestedText:this._suggested,ref:e=>this._input=e&&e.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:a,expanded:g,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${v+d.skip}`,role:"combobox",ariaLabelledBy:o,ariaLabel:this.props.ariaLabel,ariaDescribedBy:l,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,unstyled:h,...f})}clearValue(){const e=this.base.initState();this._suggested="",this.navigationIndex=void 0,this.base.filterChanged("",e),void 0===this.props.filter&&void 0!==this.state.text&&(e.data.text=void 0),this.triggerOnChange(null,e);const t=void 0!==this.props.opened?this.props.opened:this.state.opened,s=this.mobileMode;t&&!s&&this.base.togglePopup(e),this.applyState(e)}triggerOnChange(e,t){const s=this.value;!this.hasDuplicates&&(!f(s)&&!f(e)||S(s,e,this.props.dataItemKey))||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}getFocusedIndex(e){const t=this.value,{textField:s,dataItemKey:i,virtual:a={skip:0},focusedItemIndex:n=C,skipDisabledItems:o}=this.props,l=F(this.props),r=this.props.filter?this.props.filter:this.state.text;return e&&void 0!==this.navigationIndex?this.navigationIndex:f(t)&&void 0===r?l.findIndex((e=>S(e,t,i))):r?n(l,r,s):o&&s&&!r&&0===a.skip?l.findIndex((e=>!e.disabled&&e[s])):0===a.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const a=t[C(t,e,s)];if(a){const t=I(a,s);e.toLowerCase()!==t.toLowerCase()&&(i=t.substring(e.length))}}return i})(e,t,s)}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ie.displayName="ComboBox",ie.propTypes={...$.propTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,groupMode:s.oneOf([void 0,"classic","modern"]),isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,clearButton:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},ie.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ae=ie;const ne=i.createPropsContext(),oe=i.withIdHOC(i.withPropsContext(ne,i.withUnstyledHOC(ae)));oe.displayName="KendoReactComboBox";const{sizeMap:le,roundedMap:re}=i.kendoThemeMaps,de=class e extends c.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const s=F(this.props),i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=F(this.props)[e];S(this.state.focusedItem,i,s)||(t.data.focusedItem=i)},this.togglePopup=e=>{this.base.togglePopup(e)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let i=F(this.props);if(!s||!i.length)return;const a=this.itemHeight||(t?t.children[0].offsetHeight:0),n=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(a*e>n);e++)i[e]&&i[e][s]&&(o=i[e][s]);o!==this.state.group&&this.setState({group:o})},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.onChangeHandler=e=>{const t=this.base.initState(),s=e.currentTarget,i=s.value,a=s.selectionEnd===i.length;t.syntheticEvent=e;const n=this._suggested,o=this.value,l=o&&o.substring(0,o.length-n.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:p}=this.props,h=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==p&&!1!==p){r||d||!a?this._suggested="":this.suggestValue(i);const e=i+this._suggested,s={userInput:i,value:this._suggested};this.triggerOnChange(e,t,{suggestion:s})}else this._suggested="",this.triggerOnChange(i,t);(!h&&i||h&&!i)&&this.togglePopup(t),t.data.focusedItem=void 0,this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState(),s=void 0!==this.props.opened?this.props.opened:this.state.opened;t.syntheticEvent=e;this._suggested="",this.triggerOnChange("",t),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s&&this.togglePopup(t),this.applyState(t)},this.onInputKeyDown=e=>{const{skipDisabledItems:t,groupField:s,textField:a}=this.props,n=F(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=n[o],r=e.keyCode,d=e.altKey,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=this.base.initState();h.syntheticEvent=e;const u=()=>{p&&e.preventDefault()};if(d&&r===i.Keys.down)this.setState({opened:!0});else if(d&&r===i.Keys.up)this.setState({opened:!1});else if(p&&r===i.Keys.pageUp)u(),this.base.scrollPopupByPageSize(-1);else if(p&&r===i.Keys.pageDown)u(),this.base.scrollPopupByPageSize(1);else if(!p||r!==i.Keys.enter&&r!==i.Keys.esc)if(p||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==s&&a)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=n.slice(o+1).find((e=>!e.disabled&&e[a]));e=t&&n.findIndex((e=>e[a]===t[a]))}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=n,e=n.findIndex((e=>!e.disabled&&e[a]));else{t=n.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&n.findIndex((e=>e[a]===s[a]))}}if(void 0!==e){const t=e-o;this.onNavigate(h,r,t)}else void 0===e&&n.findIndex((e=>e[a]))===n.length-1&&this.onNavigate(h,r)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=n.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const t=n.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-o-1;this.onNavigate(h,r,t)}else this.onNavigate(h,r)}this.applyState(h),u()}}else{const e="";this._suggested="",this.triggerOnChange(e,h),void 0!==this.state.focusedItem&&(h.data.focusedItem=void 0),this.applyState(h)}else u(),!1===t&&l&&l.disabled?(p&&this.togglePopup(h),this.applyState(h)):this.applyInputValue(e.currentTarget.value,h,e.keyCode)},this.handleBlur=e=>{if(this.state.focused){const t=this.base.initState();t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,this.applyInputValue(e.currentTarget.value,t)}},i.validatePackage(G)}get _inputId(){return this.props.id+"-accessibility-id"}get element(){return this._element}get value(){return void 0!==this._valueDuringOnChange?this._valueDuringOnChange:void 0!==this.props.value?this.props.value:void 0!==this.state.value?this.state.value:void 0!==this.props.defaultValue?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||""!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{groupField:i=""}=this.props,a=F(this.props),{data:n=[]}=e,o=this.focusedIndex(),l=a[o],r=n!==a,d=void 0!==l&&t.focusedItem!==l,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=void 0!==e.opened?e.opened:t.opened,u=!h&&p;if(""===i)(p&&(d||r)||u)&&this.base.scrollToItem(o);else if(!this._isScrolling){const e=null==(s=this.base.getGroupedDataModernMode(a,i))?void 0:s.indexOf(l);u&&(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][i],this),this.base.scrollToItem(e)),p&&h&&d&&this.base.scrollToItem(e)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:e,disabled:t,label:s,className:n,style:o,loading:l,suggest:r,size:d,rounded:p,fillMode:h}=this.props,u=!this.validityStyles||this.validity.valid,g=this.base,m=this.value,v=!1!==this.props.clearButton&&!l&&!!m,f=this.props.id||this._inputId,b=this.state.focused;"string"==typeof r&&(this._suggested=r);const[y,C]=se(this.props.prefix||c.Fragment),[x,I]=se(this.props.suffix||c.Fragment),k=c.createElement("span",{className:i.classNames("k-autocomplete k-input",n,{[`k-input-${le[d]||d}`]:d,[`k-rounded-${re[p]||p}`]:p,[`k-input-${h}`]:h,"k-invalid":!u,"k-focus":b&&!t,"k-loading":l,"k-required":this.required,"k-disabled":t}),ref:e=>{this._element=e,g.wrapper=e},style:s?{...o,width:void 0}:o,dir:e},this.props.prefix&&c.createElement(y,{...C}),this.renderSearchBar(m||"",f),l&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&c.createElement(te,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&c.createElement(x,{...I}),this.renderListContainer());return s?c.createElement(a.FloatingLabel,{label:s,editorId:f,editorValue:m,editorValid:u,editorDisabled:t,style:{width:o?o.width:void 0},children:k}):k}onNavigate(e,t,s){const i=this.value,{textField:a,focusedItemIndex:n}=this.props,o=F(this.props),l=void 0!==this.state.focusedItem?o.findIndex((e=>S(e,this.state.focusedItem,a))):n?n(o,i,a):o.indexOf(w(o,i,a)),r=this.base.navigation.navigate({keyCode:t,current:l,max:o.length-1,min:0,skipItems:s||void 0});void 0!==r&&this.itemFocus(r,e),this.applyState(e)}applyInputValue(e,t,s){const a=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:n}=this.props,o=F(this.props),l=o[this.focusedIndex()];if(this._suggested="",a&&s===i.Keys.enter&&l&&!l.disabled){const s=I(o[this.focusedIndex(e)],n);this.triggerOnChange(s,t)}a&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:a,disabled:n,readonly:o}=this.props,{focused:l}=this.state,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return c.createElement(ee,{id:t,placeholder:i,tabIndex:a,accessKey:this.props.accessKey,value:e,suggestedText:this._suggested,focused:l,name:this.props.name,ref:e=>this._input=e&&e.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:s.handleFocus,onBlur:this.handleBlur,disabled:n,readOnly:o,expanded:r,owns:s.listBoxId,activedescendant:"option-"+s.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,size:n,groupField:o,list:l,groupStickyHeaderItemRender:r}=this.props,d=F(this.props),p=e.getPopupSettings(),h=void 0!==this.props.opened?this.props.opened:this.state.opened,u=void 0!==p.width?p.width:e.popupWidth;let{group:m}=this.state;return void 0===m&&void 0!==o&&(m=I(d[0],o)),c.createElement(g,{width:u,popupSettings:{...p,anchor:p.anchor||this.element,show:h,popupClass:i.classNames(p.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[d.length]},s&&c.createElement("div",{className:"k-list-header"},s),c.createElement("div",{className:i.classNames("k-list",{[`k-list-${le[n]||n}`]:n})},!l&&m&&0!==d.length&&c.createElement(v,{group:m,groupMode:"modern",render:r}),this.renderList()),a&&c.createElement("div",{className:"k-list-footer"},a))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:a,groupHeaderItemRender:n}=this.props,o=F(this.props),l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return c.createElement(V,{id:e.listBoxId,show:r,data:o.slice(),focusedIndex:this.focusedIndex(),value:l,textField:s,valueField:s,highlightSelected:!1,optionsGuid:e.guid,groupField:this.props.groupField,groupMode:"modern",listRef:t=>e.list=t,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:n,noDataRender:i,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll})}triggerOnChange(e,t,s){this.value===e&&!s||(t.data.value=e,this._valueDuringOnChange=e,t.events.push({type:"onChange",...s||{}}))}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}suggestValue(e){if(this._suggested="",e){const{textField:t}=this.props,s=F(this.props),i=s[C(s,e,t)];if(i){const s=I(i,t);e.toLowerCase()!==s.toLowerCase()&&(this._suggested=s.substring(e.length))}}}focusedIndex(e){const{textField:t,focusedItemIndex:s,skipDisabledItems:i}=this.props,a=F(this.props),n=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return a.findIndex((e=>S(e,this.state.focusedItem,t)));if(s)return s(a,n,t);const o=a.indexOf(w(a,n,t));return i&&t&&-1===o?a.findIndex((e=>!e.disabled&&e[t])):Math.max(0,o)}};de.displayName="AutoComplete",de.propTypes={...$.basicPropTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),groupField:s.string,suggest:s.oneOfType([s.bool,s.string]),placeholder:s.string,value:s.string,defaultValue:s.string,validationMessage:s.string,required:s.bool,readonly:s.bool,clearButton:s.bool,valueRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,list:s.any,skipDisabledItems:s.bool},de.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let pe=de;const he=i.createPropsContext(),ue=i.withIdHOC(i.withPropsContext(he,pe));ue.displayName="KendoReactAutoComplete";const ce=e=>e.syntheticEvent.preventDefault(),ge=e=>e.syntheticEvent.stopPropagation();class me extends c.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:a,onTagDelete:n,size:o}=this.props;return c.createElement(c.Fragment,null,e.map(((l,r)=>{const p=a?c.createElement(a,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:n}):c.createElement(d.Chip,{id:`tag-${t}-${l.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":e.length,key:l.text+r,text:l.text,removable:!0,onRemove:e=>n.call(void 0,l.data,e.syntheticEvent),onMouseDown:ce,onClick:ge,className:l===s?"k-focus":void 0,size:o});return i?i(l,p):p})),this.props.children)}}var ve=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(ve||{});const fe=e=>{const{footer:t,children:s,windowWidth:a=0,navigatable:o,navigatableElements:l,expand:r,animation:h,onClose:u,adaptiveTitle:g,mobileFilter:m}=e,v={navigatable:o||!1,navigatableElements:l||[],expand:r,animation:!1!==h,onClose:u,animationStyles:a<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames("k-actionsheet","k-adaptive-actionsheet",a<=500?"k-actionsheet-fullscreen":"k-actionsheet-bottom")};return c.createElement(p.ActionSheet,{...v},c.createElement(p.ActionSheetHeader,{className:"k-text-center"},c.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},c.createElement("div",{className:"k-actionsheet-title"},c.createElement("div",{className:"k-text-center"},g),c.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),c.createElement("div",{className:"k-actionsheet-actions"},c.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:n.xIcon,onClick:u}))),m&&c.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),s,t&&c.createElement(p.ActionSheetFooter,{className:"k-actions k-actions-stretched"},c.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),c.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:be,roundedMap:ye}=i.kendoThemeMaps,Ce=e=>e.preventDefault(),xe=e=>2===e,Ie=class e extends c.Component{constructor(e){super(e),this.state={activedescendant:ve.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new $(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{dataItemKey:s,virtual:i}=this.props,a=F(this.props),n=a[e-(i?i.skip:0)],o=this.value.findIndex((e=>S(e,n,s)));this._lastSelectedOrDeslectedItemIndex=a.findIndex((e=>S(e,n,s)));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,n],(void 0!==this.props.filter?this.props.filter:this.state.text)&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.triggerOnChange(l,t),this.base.triggerPageChangeCornerItems(n,t)},this.onTagDelete=(e,t)=>{const s=this.base.initState();s.syntheticEvent=t,this.opened&&this.base.togglePopup(s),!this.state.focused&&!this.mobileMode&&(s.data.focused=!0,this.focus());const i=this.value;k(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{allowCustom:s,virtual:i}=this.props,a=F(this.props),n=i?i.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=s&&o,d=a[e-n];d&&l!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=ve.PopupList):r&&-1===e&&void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(d,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.searchbarRef=e=>{const t=this._input=e&&e.input;t&&this.state.focused&&window.setTimeout((()=>t.focus()),0)},this.onChangeHandler=e=>{const t=this.base.initState(),s=e.target.value;t.syntheticEvent=e,void 0===this.props.filter&&(t.data.text=s),t.data.focusedIndex=void 0,this.opened||(this.base.togglePopup(t),this.setState({currentValue:this.value})),this.base.filterChanged(s,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.value.length>0&&this.triggerOnChange([],t),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t);const s=void 0!==this.props.filter?this.props.filter:this.state.text;f(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this._lastSelectedOrDeslectedItemIndex=null,this.applyState(t)},this.onInputKeyDown=e=>{const{textField:t,groupField:s}=this.props,a=F(this.props),n=e.keyCode,o=void 0!==this.props.filter?this.props.filter:this.state.text,l=void 0!==this.props.opened?this.props.opened:this.state.opened,{focusedItem:r,focusedIndex:d}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=e,!o&&this.value.length>0&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete||n===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,p);const h=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(n===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(n===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if((e.ctrlKey||e.metaKey)&&"KeyA"===e.code){const e=(this.state.value&&this.state.value.length)===a.length?[]:a;this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=a.slice(this.getFocusedState().focusedIndex);this.itemFocus(a.length-1,p),this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=a.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,p),this.updateStateOnKeyboardNavigation(e,p)}else if(e.shiftKey&&e.keyCode===i.Keys.up){let e;const t=this.getLastSelectedOrDeselectedIndex(1,d);null===t?e=0!==d?a.slice(d-1,d):[a[d]]:t===d?e=[a[t-1]]:d>=0&&(e=t>d?a.slice(d-1,t):a.slice(t-1,d)),e&&e.length>0&&(d>=1&&this.itemFocus(d-1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const t=this.getLastSelectedOrDeselectedIndex(0,d);null===t?e=d!==a.length-1?a.slice(d,d+1):[a[d]]:t===d?e=a.slice(d,d+2):d>=0&&(e=t>d?a.slice(d+1,t+1):a.slice(t,d+2)),e&&e.length>=1&&(this.itemFocus(d+1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.altKey&&n===i.Keys.up)h();else if(n===i.Keys.up||n===i.Keys.down){if(""!==s&&t)if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=0;if(n===i.Keys.down||n===i.Keys.right){const s=a.slice(d+1).find((e=>!e.disabled&&e[t]));e=s&&a.findIndex((e=>e[t]===s[t]))}else if(n===i.Keys.up||n===i.Keys.left){let s;if(-1===d)s=a,e=a.findIndex((e=>!e.disabled&&e[t]));else{s=a.slice(0,d);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&a.findIndex((e=>e[t]===i[t]))}}if(e){const t=e-d;this.onNavigate(p,n,t)}else void 0!==e&&this.onNavigate(p,n)}else if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=null;if(n===i.Keys.down||n===i.Keys.right)e=a.slice(d+1).find((e=>!e.disabled));else if(n===i.Keys.up||n===i.Keys.left){const t=a.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-d-1;this.onNavigate(p,n,t)}else this.onNavigate(p,n)}this.applyState(p),e.preventDefault()}else n===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&o&&null===r?this.customItemSelect(e):r&&r.disabled?h():this.selectFocusedItem(e)):n===i.Keys.esc&&h();else e.altKey&&n===i.Keys.down?h():n===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:a,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=F(this.props),p=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:h}=this.getFocusedState(),u=s&&p&&c.createElement("div",{className:i.classNames("k-list",{[`k-list-${be[a]||a}`]:a}),key:"customitem",onClick:this.customItemSelect,onMouseDown:Ce},c.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":xe(h)}),style:{fontStyle:"italic"}},p,c.createElement(i.IconWrap,{name:"plus",icon:n.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==l&&(g=I(d[0],l)),c.createElement(c.Fragment,null,e&&c.createElement("div",{className:"k-list-header"},e),u,c.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":be[a]||a}`]:a,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&c.createElement(v,{group:g,groupMode:"modern",render:o}),this.renderList()),t&&c.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=F(this.props),a=this.base.getPopupSettings(),n=void 0!==a.width?a.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:n,popupSettings:{...a,popupClass:i.classNames(a.popupClass,"k-list-container","k-multiselect-popup"),anchor:a.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return c.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,filterable:t,filter:s}=this.props,{windowWidth:i=0}=this.state,a=void 0!==s?s:this.state.text;this.localization=r.provideLocalizationService(this);const n=t?c.createElement(m,{value:a,ref:e=>this._adaptiveInput=e&&e.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}):null,o={adaptiveTitle:e,expand:this.opened,onClose:e=>this.onCancel(e),windowWidth:i,mobileFilter:n,footer:{cancelText:this.localization.toLanguageString(z,H[z]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(L,H[L]),onApply:this.closePopup}};return c.createElement(fe,{...o},c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.closePopup=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t),t.events.push({type:"onClose"});const s=void 0!==this.props.filter?this.props.filter:this.state.text;f(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=void 0!==this.props.filter?this.props.filter:this.state.text;f(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.renderList=()=>{const{textField:e,listNoDataRender:t,itemRender:s,groupHeaderItemRender:i,dataItemKey:a,virtual:n={skip:0,total:void 0}}=this.props,o=F(this.props),l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),p=`translateY(${l.translate}px)`;return c.createElement(V,{id:this.base.listBoxId,show:this.opened,data:o.slice(),focusedIndex:r-n.skip,value:this.value,textField:e,valueField:a,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>{l.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:d.height},wrapperCssClass:"k-list-content",listStyle:l.enabled?{transform:p}:void 0,key:"listKey",skip:n.skip,onClick:this.handleItemClick,itemRender:s,groupHeaderItemRender:i,noDataRender:t,onMouseDown:Ce,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=F(this.props);if(i&&a.length&&i){const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;a=this.base.getGroupedDataModernMode(a,i);let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&this.setState({group:l})}},this.customItemSelect=e=>{const t=void 0!==this.props.filter?this.props.filter:this.state.text,{textField:s}=this.props;if(!t)return;const i=this.base.initState();i.syntheticEvent=e;const a=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const n=[...this.value,a];this.triggerOnChange(n,i),this.base.togglePopup(i),this.applyState(i)},this.handleWrapperClick=e=>{const t=this._input;!this.opened&&t&&this.focusElement(t);const s=this.base.initState();s.syntheticEvent=e,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&(this.setState({currentValue:this.tagsToRender}),this.mobileMode&&window.setTimeout((()=>this._adaptiveInput&&this._adaptiveInput.focus()),300)),this.base.togglePopup(s),this.applyState(s)},this.handleItemClick=(e,t)=>{const s=this.base.initState();s.syntheticEvent=t,this.handleItemSelect(e,s),this.props.autoClose&&!this.mobileMode&&this.base.togglePopup(s),t.stopPropagation(),this.applyState(s)},this.handleBlur=e=>{if(!this.state.focused||this._skipFocusEvent)return;const t=this.base.initState(),{allowCustom:s,filterable:i}=this.props;t.syntheticEvent=e,t.data.focused=!1,t.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(t.data.opened=!1),t.events.push({type:"onClose"})),!s&&!i&&this.state.text&&(t.data.text=""),this.applyState(t)},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.onPopupOpened=()=>{this._input&&this.state.focused&&!this.mobileMode&&this.focusElement(this._input)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout((()=>{this.state.focused&&this.focusElement(this._input)}),0)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},i.validatePackage(G)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get opened(){return!!(void 0!==this.props.opened?this.props.opened:this.state.opened)}get tagsToRender(){const{tags:e,textField:t}=this.props,s=[];return void 0===e?this.value.forEach((e=>{s.push({text:I(e,t),data:[e]})})):s.push(...e),s}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Y&&this.props.adaptive)}get value(){const e=[];return this._valueItemsDuringOnChange?e.push(...this._valueItemsDuringOnChange):this.props.value?e.push(...this.props.value):this.state.value?e.push(...this.state.value):this.props.defaultValue&&e.push(...this.props.defaultValue),e}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&this.value.length>0&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}componentDidUpdate(e,t){var s;const{virtual:i,groupField:a=""}=this.props,n=F(this.props),o=i?i.skip:0,l=e.virtual?e.virtual.total:0,r=void 0!==e.opened?e.opened:t.opened,d=!r&&this.opened,p=r&&!this.opened,h=this.base.getPopupSettings();if(this.base.didUpdate(),!h.animate&&p&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==a&&(t=null==(s=this.base.getGroupedDataModernMode(n,a))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][a],this),this.base.scrollToItem(t)):this.opened&&r&&e&&this.scrollToFocused&&this.base.scrollToItem(t-o)}this.scrollToFocused=!1,this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}onNavigate(e,t,s){const{allowCustom:a}=this.props,n=F(this.props),o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=a&&o,p=xe(l),h=this.base,u=h.vs;if(this.opened&&t===i.Keys.up&&p)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=h.navigation.navigate({keyCode:t,current:r,max:(u.enabled?u.total:n.length)-1,min:d?-1:0,skipItems:s||void 0});void 0!==i&&(this.itemFocus(i,e),this.scrollToFocused=!0)}this.applyState(e)}render(){const{style:e,className:t,label:s,dir:n,disabled:o,textField:l,dataItemKey:r,virtual:d,size:p,rounded:h,fillMode:u,loading:g,filter:m}=this.props,{text:v,focused:f,focusedTag:b,currentValue:y}=this.state,C=this.base.vs,x=this.props.id||this._inputId;C.enabled=void 0!==d,void 0!==d&&(C.skip=d.skip,C.total=d.total,C.pageSize=d.pageSize);const k=this.mobileMode&&this.opened?y:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const S=!this.validityStyles||this.validity.valid,w=!!(void 0!==m?m:v)||k&&k.length>0,[F,K]=se(this.props.prefix||c.Fragment),[N,M]=se(this.props.suffix||c.Fragment),T=c.createElement(c.Fragment,null,c.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${be[p]||p}`]:p,[`k-rounded-${ye[h]||h}`]:h,[`k-input-${u}`]:u,"k-focus":f&&!o,"k-invalid":!S,"k-disabled":o,"k-loading":g,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:n,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:E},this.props.prefix&&c.createElement(F,{...K}),c.createElement("div",{className:i.classNames("k-input-values")},c.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${be[p]||p}`]:p}),role:"listbox",id:"tagslist-"+this.base.guid},k&&k.length>0&&c.createElement(me,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:k,guid:this.base.guid,focused:b?k.find((e=>D(e,b,r))):void 0,size:p})),this.renderSearchBar(x)),g&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&c.createElement(N,{...M}),w&&c.createElement(te,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?c.createElement(a.FloatingLabel,{label:s,editorId:x,editorValue:v||I(this.value[0],l),editorValid:S,editorDisabled:o,style:{width:e?e.width:void 0},children:T}):T}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:a,placeholder:n,ariaDescribedBy:o,ariaLabelledBy:l,ariaLabel:r}=this.props,d=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:p}=this.getFocusedState(),h=0!==this.value.length||d?void 0:n,u=i&&i.length>0?void 0:n,g=t===ve.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${p}`,m={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return c.createElement(ee,{id:e,size:Math.max((h||"").length,d.length,1),placeholder:this.mobileMode&&this.opened?u:h,value:d,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:a,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:g,ariaDescribedBy:`tagslist-${this.base.guid}${o?" "+o:""}`,ariaLabelledBy:l,ariaRequired:this.required,ariaLabel:r,...m})}onTagsNavigate(e,t){const s=e.keyCode,{focusedTag:a}=this.state,n=this._tags,o=this.props.dataItemKey;let l,r=a?n.findIndex((e=>D(e,a,o))):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):n.length-1,l=n[r];else if(s===i.Keys.right)r===n.length-1?l=void 0:d&&(r=Math.min(n.length-1,r+1),l=n[r]);else if(s!==i.Keys.home||e.shiftKey)if(s!==i.Keys.end||e.shiftKey){if(s===i.Keys.delete){if(d){const e=this.value;k(e,n[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)k(e,n[r].data,o),this.triggerOnChange(e,t);else if(!d&&n.length){const s=n.pop();k(e,s.data,o),this.triggerOnChange(e,t)}}}else l=n[n.length-1];else l=n[0];l!==a&&(t.data.focusedTag=l,t.data.activedescendant=ve.TagsList),this.applyState(t)}triggerOnChange(e,t){void 0===this.props.value&&(t.data.value=[...e]),this._valueItemsDuringOnChange=[],this.setItems(e,this._valueItemsDuringOnChange),t.events.push({type:"onChange"})}selectFocusedItem(e,t){const{virtual:s}=this.props,i=F(this.props),{focusedIndex:a}=t||this.getFocusedState();void 0!==i[a-(s?s.skip:0)]&&this.handleItemClick(a,e)}setItems(e,t){t.length=0,t.push(...e)}getFocusedState(){const{focusedIndex:e}=this.state,t=void 0!==this.props.filter?this.props.filter:this.state.text,{allowCustom:s,dataItemKey:i,virtual:a,textField:n,focusedItemIndex:o=C,skipDisabledItems:l}=this.props,r=F(this.props),d=a&&a.skip||0;let p;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const h=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=o(r,t,n),{focusedItem:r[p],focusedIndex:p+d,focusedType:1};if(h.length){const e=h[h.length-1];return p=r.findIndex((t=>S(t,e,i))),void 0!==r[p]?{focusedIndex:p+d,focusedItem:r[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&n&&!t&&0===d){const e=r.findIndex((e=>!e.disabled&&e[n]));return{focusedIndex:e,focusedItem:r[e-d],focusedType:1}}return 0===d?{focusedItem:r[0],focusedIndex:0,focusedType:1}:{focusedType:0,focusedIndex:-1}}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),0)}applyState(e){this.base.applyState(e),this._valueItemsDuringOnChange=null}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}updateStateOnKeyboardNavigation(e,t){this.setState({value:e}),this.triggerOnChange(e,t),this.applyState(t)}getLastSelectedOrDeselectedIndex(e,t){return null===this._lastSelectedOrDeslectedItemIndex&&(this._lastSelectedOrDeslectedItemIndex=t),null!==this._lastSelectedOrDeslectedItemIndex?this._lastSelectedOrDeslectedItemIndex+e:null}};Ie.displayName="MultiSelect",Ie.propTypes={...$.propTypes,autoClose:s.bool,value:s.arrayOf(s.any),defaultValue:s.arrayOf(s.any),dataItemKey:s.string,placeholder:s.string,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),tagRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,groupField:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,onCancel:s.func,skipDisabledItems:s.bool},Ie.defaultProps={...$.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ke=Ie;const Se=i.createPropsContext(),we=i.withIdHOC(i.withPropsContext(Se,ke));we.displayName="KendoReactMultiSelect";const Ee=e=>c.createElement(V,{...e,wrapperCssClass:"k-table-body k-table-scroller",listClassName:i.classNames("k-table k-table-list",{"k-virtual-table":void 0!==e.virtual}),listStyle:{...e.listStyle}}),De=i.createPropsContext(),Fe=c.forwardRef(((e,t)=>{const s=i.usePropsContext(De,e),a=c.useRef(null),n=c.useRef(null),o=i.getScrollbarWidth(),{columns:l=Ne.columns,popupSettings:r=Ne.popupSettings,size:d=Ne.size,rounded:p=Ne.rounded,fillMode:h=Ne.fillMode,className:u,prefix:g,suffix:m,onOpen:v,onClose:f,onFocus:b,onBlur:y,onChange:C,onFilterChange:x,onPageChange:k,...S}=s;c.useImperativeHandle(a,(()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:s}))),c.useImperativeHandle(t,(()=>a.current));const w=c.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,D]=c.useState(w),[F,K]=c.useState(!0),[N]=g?se(s.prefix||c.Fragment):[],[M]=m?se(s.suffix||c.Fragment):[],T=c.useMemo((()=>{const e=c.createElement("th",{className:"k-table-th",colSpan:l.length},E);return c.createElement(c.Fragment,null,s.header,c.createElement("div",{className:"k-table-header-wrap"},c.createElement("table",{className:"k-table",role:"presentation"},c.createElement("colgroup",null,l.map(((e,t)=>c.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Ne.width}})))),c.createElement("thead",{className:"k-table-thead"},c.createElement("tr",{className:"k-table-row"},l.map(((e,t)=>c.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" ")))),E&&F&&c.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))}),[s.header,l,E,F]),P=c.useMemo((()=>`calc(${l.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Ne.width))).filter(Boolean).join(" + ")} + ${o}px + 4px)`),[l,o]),O=s.virtual?s.virtual.skip:0,B=c.useCallback(((e,t)=>{const a=l.map(((e,a)=>c.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Ne.width},key:e.uniqueKey?e.uniqueKey:a},e.field?String(i.getter(e.field)(t.dataItem)):"")));let n,o,r,d,p=s.data||[];const h=t.index-O;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(p[h]),r=d(p[h-1]),o&&r&&o!==r&&(n=o)),n&&"classic"===s.groupMode&&a.push(c.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},c.createElement("span",null,n)));const u=c.cloneElement(e,{...e.props,className:i.classNames("k-table-row",{"k-table-alt-row":t.index%2!=0,"k-focus":t.focused,"k-selected":t.selected,"k-first":!!n,"k-disabled":t.dataItem.disabled})},a);return s.itemRender?s.itemRender.call(void 0,u,t):u}),[l,s.groupField,s.itemRender,s.data,O]),_=c.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:a.current})}),[]),R=c.useCallback((e=>(s.virtual||D(w),_(v,e))),[_,v,s.virtual,w]),L=c.useCallback((e=>_(f,e)),[f]),z=c.useCallback((e=>_(b,e)),[b]),H=c.useCallback((e=>_(y,e)),[y]),V=c.useCallback((e=>_(C,e)),[C]),q=c.useCallback((e=>_(k,e)),[k]),A=c.useCallback((e=>(D(w),_(x,{...e,mobileMode:e.target.mobileMode}))),[x]),W=c.useCallback((e=>{D(e.group)}),[]);c.useEffect((()=>{i.setScrollbarWidth()})),c.useEffect((()=>{const e=s.data;D(w),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const U=c.useCallback((e=>c.createElement(Ee,{...e})),[]);return c.createElement(oe,{...S,list:U,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||P,className:r.className},ref:n,header:T,itemRender:B,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:p,fillMode:h,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:R,onClose:L,onFocus:z,onBlur:H,onChange:V,onFilterChange:A,onPageChange:q,onGroupScroll:W,className:i.classNames("k-dropdowngrid",u),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,footer:s.footer,footerClassName:"k-table-footer",prefix:N,suffix:M})})),Ke={...ae.propTypes,columns:s.any.isRequired},Ne={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Me(e){return"string"==typeof e?Number(e.replace("px","")):e||void 0}function Te(e,t,s,i){const a=Me(t.popupSettings.width),n=(void 0!==s.width&&Me(s.width))!==a,o=void 0!==i.width,l=n?s.width:o?i.width:a,r=Me(function(e,t,s){const[i,a]=c.useState(t);return c.useEffect((()=>{void 0!==i&&e.current&&a(e.current.offsetWidth)}),s),i}(e,l));return n||o?l:r&&a&&r>a?r:a}Fe.displayName="KendoMultiColumnComboBox",Fe.propTypes=Ke;const Pe=e=>c.createElement("div",{className:"k-nodata"},c.createElement("div",null,e.children)),{sizeMap:Oe,roundedMap:Be}=i.kendoThemeMaps,_e=e=>c.createElement("span",{className:"k-input-value-text"},e.children),Re=e=>e.split("_").map((e=>parseInt(e,10))),Le={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},ze=i.createPropsContext(),He=c.forwardRef(((e,t)=>{i.validatePackage(G);const s=i.usePropsContext(ze,e),l={...Le,...s},u=i.useId(),g=l.id||u,{data:v,dataItemKey:b,popupSettings:y={},style:C,opened:x,disabled:k,onOpen:w=i.noop,onClose:E=i.noop,placeholder:D,label:F,name:K,selectField:N,subItemsField:M,validationMessage:T,valid:B,required:_,validityStyles:R}=l,L=i.getTabIndex(l.tabIndex,k),z=c.useRef(null),V=c.useRef(null),q=c.useRef(null),A=c.useRef(null),W=c.useRef(null),U=c.useRef(null),$=c.useRef(!1),[j,J]=c.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==j?j:l.defaultValue,Z=f(X),ee=Z?I(X,l.textField):"",te=((e,t)=>{const{validationMessage:s,valid:i,required:a}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!a||t),valueMissing:!t}})({validationMessage:T,valid:B,required:_},Z),se=c.useCallback((()=>V.current&&V.current.focus()),[]);c.useImperativeHandle(z,(()=>({props:l,element:V.current,focus:se}))),c.useImperativeHandle(t,(()=>z.current));const ie=i.useRtl(V,l.dir),ae={width:Te(V,Le,{...Le.popupSettings,...y},C),...void 0!==ie?{direction:ie}:{}},[ne,oe]=c.useState(!1),le=void 0!==x?x:ne,[re,de]=c.useState(!1),[pe,he]=c.useState(),ue=!!(pe&&pe<=Y&&l.adaptive),[ce,ge]=c.useState(""),me=c.useCallback((()=>{W.current&&W.current.setCustomValidity&&W.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);c.useEffect(me),c.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const ve=c.useCallback((e=>{if(!le){if(w){const t={...e};w.call(void 0,t)}void 0===x&&oe(!0)}}),[le,x,w]),be=c.useCallback((e=>{if(le){if(E){const t={...e};E.call(void 0,t)}void 0===x&&(oe(!1),ue&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300))}}),[le,x,E,ue]),ye=c.useCallback((e=>{if(!e.isDefaultPrevented()&&z.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};(le?be:ve)(t)}}),[le,x,w,E]),Ce=c.useCallback((e=>{$.current=!0,e(),window.setTimeout((()=>$.current=!1),0)}),[]),xe=c.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=U.current&&U.current.element;if(!z.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};if(le)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),be(l);else if(o&&o.querySelector(".k-focus")&&(a===i.Keys.up||a===i.Keys.down||a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end)){if(a===i.Keys.up&&null!=(s=q.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find((e=>!(!e||!e.querySelector(".k-focus"))));if(t&&0===e.indexOf(t))return Ce((()=>{var e;ke(null==(e=q.current)?void 0:e.element)}))}Ce(i.noop)}else a===i.Keys.down&&Ce((()=>{var e;ke((null==(e=q.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down?(e.preventDefault(),ve(l)):le||a===i.Keys.esc&&Me(e)}),[le,x,w,E]),Ie=c.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Ce(t===i.Keys.up?()=>{ke(V.current)}:()=>{ke(U.current&&U.current.element)}))}),[]),ke=c.useCallback((e=>{e&&Ce((()=>e.focus()))}),[]),Se=c.useCallback((()=>{var e;re||!le||x?s.filterable?ke(null==(e=q.current)?void 0:e.element):ke(U.current&&U.current.element):be({target:z.current})}),[E,s.filterable,re,x,le]),we=c.useCallback((()=>{re&&ke(V.current)}),[re]),Ee=c.useCallback((e=>{if(!re&&!$.current&&(de(!0),s.onFocus&&z.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),De=c.useCallback((e=>{if(re&&!$.current&&z.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ue||be(t)}}),[re,s.onBlur,le,x,E]),Fe=c.useCallback((()=>{re&&Ce(i.noop),ue&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300)}),[re,ue]),Ke=c.useCallback(((e,t,i)=>{if(s.onChange){const a={value:t,level:i?Re(i):[],...e};s.onChange.call(void 0,a)}Q||J(t)}),[s.onChange,Q]),Ne=c.useCallback((e=>{if(S(e.item,X,b)||!z.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:a}=e,n={syntheticEvent:a,nativeEvent:i,target:z.current};Ke(n,t,s),be(n)}),[Q,X,s.onChange,b,le,x,E]),Me=c.useCallback((e=>{if(!z.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};Ke(t,null),be(t),e.preventDefault()}),[Q,s.onChange,le,x,E]),He=c.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&z.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:Re(i),item:t,nativeEvent:a,syntheticEvent:n,target:z.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Ve=c.useCallback((e=>{if(s.onFilterChange&&z.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:z.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),qe=c.useCallback((e=>{for(const t of e)he(t.target.clientWidth)}),[]),Ae=c.useMemo((()=>Q||!Z?v:i.mapTree(v,M,(e=>i.extendDataItem(e,M,{[N]:S(e,X,b)})))),[v,X,Q,Z,N,M]),We=l.listNoData||Pe,Ue=l.valueHolder||_e,$e=r.useLocalization(),Ge=!R||te.valid,{size:je,rounded:Ye,fillMode:Je}=l,Qe=c.createElement(c.Fragment,null,c.createElement("span",{className:i.classNames("k-dropdowntree k-picker",l.className,{[`k-picker-${Oe[je]||je}`]:je,[`k-rounded-${Be[Ye]||Ye}`]:Ye,[`k-picker-${Je}`]:Je,"k-focus":re,"k-invalid":!Ge,"k-loading":l.loading,"k-required":_,"k-disabled":l.disabled}),tabIndex:L,accessKey:l.accessKey,id:g,style:F?{...C,width:void 0}:C,dir:ie,ref:V,onKeyDown:k?void 0:xe,onMouseDown:Fe,onClick:k?void 0:ye,onFocus:Ee,onBlur:De,role:"combobox","aria-haspopup":"tree","aria-expanded":le,"aria-disabled":k,"aria-label":F,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-required":_},c.createElement("span",{className:"k-input-inner"},(ee||D)&&c.createElement(Ue,{item:X},ee||D)),l.loading&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!k&&c.createElement("span",{onClick:Me,className:"k-clear-value",title:$e.toLanguageString(O,H[O]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},c.createElement(i.IconWrap,{name:"x",icon:n.xIcon})),c.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:je,fillMode:Je,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:n.caretAltDownIcon}),c.createElement("select",{name:K,ref:W,tabIndex:-1,"aria-hidden":!0,title:F,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},c.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,X):X})),!ue&&c.createElement(o.Popup,{...y,className:i.classNames(y.className,{"k-rtl":"rtl"===ie}),popupClass:i.classNames(y.popupClass,"k-dropdowntree-popup k-list-container"),style:ae,anchor:y.anchor||V.current,show:le,onOpen:Se,onClose:we},l.filterable&&c.createElement(m,{value:void 0===l.filter?ce:l.filter,ref:q,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),v.length>0?c.createElement(h.TreeView,{style:{height:y.height},ref:U,tabIndex:L,data:Ae,focusIdField:b,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:He,size:je,item:l.item,dir:ie,animate:y.animate}):c.createElement(We,null,$e.toLanguageString(P,H[P])))),ue&&(()=>{const e=l.filterable?c.createElement(m,{value:void 0===l.filter?ce:l.filter,ref:A,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>be(e),windowWidth:pe,mobileFilter:e};return c.createElement(fe,{...t},c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:"k-list-container"},c.createElement("div",{className:"k-list k-list-lg"},v.length>0?c.createElement(h.TreeView,{ref:U,tabIndex:L,data:Ae,focusIdField:b,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:He,size:je,item:l.item,dir:ie,animate:y.animate}):c.createElement(We,null,$e.toLanguageString(P,H[P]))))))})());return F?c.createElement(a.FloatingLabel,{label:F,editorValue:ee,editorPlaceholder:D,editorValid:Ge,editorDisabled:k,editorId:g,style:{width:C?C.width:void 0},children:Qe,dir:ie}):Qe})),Ve={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,value:s.any,valueMap:s.func,placeholder:s.string,dataItemKey:s.string.isRequired,textField:s.string.isRequired,selectField:s.string,expandField:s.string,subItemsField:s.string,className:s.string,style:s.object,label:s.string,validationMessage:s.string,validityStyles:s.bool,valid:s.bool,required:s.bool,name:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,filterable:s.bool,filter:s.string,loading:s.bool,popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onFilterChange:s.func,onExpandChange:s.func,item:s.func,valueHolder:s.func,listNoData:s.func,adaptiveTitle:s.string,adaptive:s.bool};He.displayName="KendoReactDropDownTree",He.propTypes=Ve;const{sizeMap:qe,roundedMap:Ae}=i.kendoThemeMaps,We=e=>e.split("_").map((e=>parseInt(e,10))),Ue={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},$e=i.createPropsContext(),Ge=c.forwardRef(((e,t)=>{const s=i.usePropsContext($e,e);i.validatePackage(G);const n=i.useId(),l=s.id||n,{data:d=[],dataItemKey:u,style:g={},placeholder:v,label:f,name:b,validationMessage:y,valid:C,tags:x,value:k,opened:w,disabled:E,popupSettings:F=Ue.popupSettings,checkField:K=Ue.checkField,checkIndeterminateField:N=Ue.checkIndeterminateField,subItemsField:M=Ue.subItemsField,size:T=Ue.size,rounded:O=Ue.rounded,fillMode:B=Ue.fillMode,required:_=Ue.required,validityStyles:R=Ue.validityStyles,onOpen:V=i.noop,onClose:q=i.noop}=s,A=i.getTabIndex(s.tabIndex,E),W=c.useRef(null),U=c.useRef(null),$=c.useRef(null),j=c.useRef(null),J=c.useRef(null),Q=c.useRef(null),X=c.useRef(!1),Z=c.useRef([]),ee=c.useRef(null),[se,ie]=c.useState(),[ae,ne]=c.useState(!1),[oe,le]=c.useState(!1),[re,de]=c.useState(),[pe,he]=c.useState([]),[ue,ce]=c.useState(""),ge=!!(re&&re<=Y&&s.adaptive),ve=void 0!==w?w:ae,be=!(!Array.isArray(k)||!k.length),ye=((e,t)=>{const{validationMessage:s,valid:i,required:a}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!a||t),valueMissing:!t}})({validationMessage:y,valid:C,required:_},be),Ce=i.useRtl(U,s.dir),xe={width:Te(U,Ue,F,g),...void 0!==Ce?{direction:Ce}:{}},Ie=c.useCallback((()=>U.current&&U.current.focus()),[]);Z.current=void 0===x?(k||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...x],c.useImperativeHandle(W,(()=>({props:s,element:U.current,focus:Ie}))),c.useImperativeHandle(t,(()=>W.current));const ke=c.useCallback((()=>{J.current&&J.current.setCustomValidity&&J.current.setCustomValidity(ye.valid?"":void 0===y?"Please select a value from the list!":y)}),[y,ye]);c.useEffect(ke),c.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Je.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}}),[]),c.useEffect((()=>{ee.current&&ve&&ee.current.setPosition(ee.current._popup)}),[k,ve]);const Se=c.useCallback(((e,t,i)=>{if(s.onChange){const a={items:t,operation:i,...e};s.onChange.call(void 0,a)}}),[s.onChange]),we=c.useCallback((e=>{if(S(e.item,k,u)||!W.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,a={syntheticEvent:i,nativeEvent:s,target:W.current};Se(a,[t],"toggle")}),[k,u,Se]),Ee=c.useCallback((e=>{if(!ve){if(V){const t={...e};V.call(void 0,t)}void 0===w&&(ne(!0),he(k||[]),ge&&setTimeout((()=>{var e;Ke(null==(e=j.current)?void 0:e.element)}),300))}}),[ve,w,V,ge,j]),De=c.useCallback((e=>{if(ve){if(q){const t={...e};q.call(void 0,t)}void 0===w&&ne(!1)}}),[ve,w,q]),Fe=c.useCallback((e=>{X.current=!0,e(),window.setTimeout((()=>X.current=!1),0)}),[]),Ke=c.useCallback((e=>{e&&Fe((()=>e.focus()))}),[Fe]),Ne=c.useCallback((()=>{var e;!oe&&ve?De({target:W.current}):s.filterable?Ke(null==(e=$.current)?void 0:e.element):Ke(Q.current&&Q.current.element)}),[oe,ve,Ke,De,s.filterable]),Me=c.useCallback((()=>{oe&&Ke(U.current)}),[oe,Ke]),Oe=c.useCallback((e=>{if(!oe&&!X.current&&(le(!0),s.onFocus&&W.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onFocus.call(void 0,t)}}),[oe,s.onFocus]),Be=c.useCallback((e=>{if(oe&&!X.current&&W.current){le(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ge||De(t)}}),[oe,s.onBlur,ve,w,q]),_e=c.useCallback((()=>{oe&&Fe(i.noop)}),[oe,Fe]),Re=c.useCallback((e=>{if(!e.isDefaultPrevented()&&W.current){le(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};ve||Ee(t)}}),[ve,Ee]),Le=c.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=Q.current&&Q.current.element;if(!W.current||e.isDefaultPrevented()&&(null==(t=$.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(k&&k.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete)){const e=Z.current;let t,s=se?e.findIndex((e=>D(e,se,u))):-1;const n=-1!==s;a===i.Keys.left?(s=n?Math.max(0,s-1):e.length-1,t=e[s]):a===i.Keys.right?s===e.length-1?t=void 0:n&&(s=Math.min(e.length-1,s+1),t=e[s]):a===i.Keys.home?t=e[0]:a===i.Keys.end?t=e[e.length-1]:a===i.Keys.delete&&n&&Se(l,e[s].data,"delete"),t!==se&&ie(t)}if(ve)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),De(l);else if(o&&o.querySelector(".k-focus")&&(a===i.Keys.up||a===i.Keys.down||a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end)){if(a===i.Keys.up&&null!=(s=$.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find((e=>!(!e||!e.querySelector(".k-focus"))));if(t&&0===e.indexOf(t))return Fe((()=>{var e;Ke(null==(e=$.current)?void 0:e.element)}))}Fe(i.noop)}else a===i.Keys.down&&Fe((()=>{var e;Ke((null==(e=$.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down&&(e.preventDefault(),Ee(l))}),[ve,De,Ke,Fe,Ee,se,u,k,Se]),ze=c.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Fe(t===i.Keys.up?()=>{Ke(U.current)}:()=>{Ke(Q.current&&Q.current.element)}))}),[Ke,Fe]),He=c.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};Se(t,[],"clear"),De(t),e.preventDefault()}),[Se,De]),Ve=c.useCallback(((e,t)=>{var s;De({target:W.current}),oe||Ke(null==(s=$.current)?void 0:s.element),Se({syntheticEvent:t,nativeEvent:t.nativeEvent,target:W.current},e,"delete")}),[Se,De,Ke,oe]),Ge=c.useCallback((e=>{if(s.onExpandChange&&W.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:We(i),item:t,nativeEvent:a,syntheticEvent:n,target:W.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),je=c.useCallback((e=>{if(s.onFilterChange&&W.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:W.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ce(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Ye=c.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onCancel&&s.onCancel.call(void 0,t),De(t),e.preventDefault()}),[s.onCancel,De]),Je=c.useCallback((e=>{for(const t of e)de(t.target.clientWidth)}),[]),Qe=s.listNoData||Pe,Xe=r.useLocalization(),Ze=!R||ye.valid,et=ge&&ve?pe:Z.current,tt=c.createElement(c.Fragment,null,c.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${qe[T]||T}`]:T,[`k-rounded-${Ae[O]||O}`]:O,[`k-input-${B}`]:B,"k-focus":oe&&!E,"k-invalid":!Ze,"k-disabled":E,"k-loading":s.loading,"k-required":_}),tabIndex:A,accessKey:s.accessKey,id:l,style:f?{...g,width:void 0}:g,dir:Ce,ref:U,onKeyDown:E?void 0:Le,onMouseDown:_e,onFocus:Oe,onBlur:Be,role:"combobox","aria-haspopup":"tree","aria-expanded":ve,"aria-disabled":E,"aria-label":f,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy?s.ariaDescribedBy:"tagslist-"+l,"aria-required":s.required,onClick:E?void 0:Re},c.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${qe[T]||T}`]:T})},et.length>0&&c.createElement(me,{tag:s.tag,onTagDelete:Ve,data:et,guid:l,focused:se?Z.current.find((e=>D(e,se,u))):void 0,size:T})),c.createElement("span",{className:"k-input-inner"},0===et.length&&c.createElement("span",{className:"k-input-value-text"},v)),s.loading&&c.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),be&&!E&&et.length>0&&c.createElement(te,{onClick:He}),c.createElement("select",{name:b,ref:J,tabIndex:-1,"aria-hidden":!0,title:f,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},c.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,k):k})),!ge&&c.createElement(o.Popup,{...F,popupClass:i.classNames(F.popupClass,"k-multiselecttree-popup"),className:i.classNames(F.className,{"k-rtl":"rtl"===Ce}),style:xe,anchor:F.anchor||U.current,show:ve,onOpen:Ne,onClose:Me,ref:ee},s.filterable&&c.createElement(m,{value:void 0===s.filter?ue:s.filter,ref:$,onChange:je,onKeyDown:ze,tabIndex:A,size:T,rounded:O,fillMode:B,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),d.length>0?c.createElement(h.TreeView,{style:{height:F.height},ref:Q,tabIndex:A,data:d,focusIdField:u,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:Ce}):c.createElement(Qe,null,Xe.toLanguageString(P,H[P])))),ge&&(()=>{const e=s.filterable?c.createElement(m,{value:void 0===s.filter?ue:s.filter,ref:j,onChange:je,onKeyDown:ze,size:T,rounded:O,fillMode:B}):null,t={adaptiveTitle:s.adaptiveTitle,expand:ve,onClose:e=>s.onCancel?Ye(e):He(e),windowWidth:re,mobileFilter:e,footer:{cancelText:Xe.toLanguageString(z,H[z]),onCancel:e=>s.onCancel?Ye(e):He(e),applyText:Xe.toLanguageString(L,H[L]),onApply:e=>De(e)}};return c.createElement(fe,{...t},c.createElement(p.ActionSheetContent,{overflowHidden:!0},c.createElement("div",{className:"k-list-container"},c.createElement("div",{className:"k-list k-list-lg"},d.length>0?c.createElement(h.TreeView,{ref:Q,tabIndex:A,data:d,focusIdField:u,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:Ce}):c.createElement(Qe,null,Xe.toLanguageString(P,H[P]))))))})());return f?c.createElement(a.FloatingLabel,{label:f,editorValue:be,editorPlaceholder:v,editorValid:Ze,editorDisabled:E,editorId:l,style:{width:g?g.width:void 0},children:tt,dir:Ce}):tt})),je={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,value:s.any,valueMap:s.func,placeholder:s.string,dataItemKey:s.string.isRequired,textField:s.string.isRequired,checkField:s.string,checkIndeterminateField:s.string,expandField:s.string,subItemsField:s.string,className:s.string,style:s.object,label:s.string,validationMessage:s.string,validityStyles:s.bool,valid:s.bool,required:s.bool,name:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,filterable:s.bool,filter:s.string,loading:s.bool,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onFilterChange:s.func,onExpandChange:s.func,onCancel:s.func,item:s.func,listNoData:s.func,adaptiveTitle:s.string,adaptive:s.bool};Ge.displayName="KendoReactMultiSelectTree",Ge.propTypes=je;const Ye=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=ue,e.AutoCompletePropsContext=he,e.AutoCompleteWithoutContext=pe,e.ComboBox=oe,e.ComboBoxPropsContext=ne,e.ComboBoxWithoutContext=ae,e.DropDownList=Z,e.DropDownListClassComponent=Q,e.DropDownListPropsContext=X,e.DropDownListWithoutContext=Q,e.DropDownTree=He,e.DropDownTreePropsContext=ze,e.List=V,e.ListContainer=g,e.ListFilter=m,e.ListItem=M,e.MultiColumnComboBox=Fe,e.MultiColumnComboBoxPropsContext=De,e.MultiSelect=we,e.MultiSelectPropsContext=Se,e.MultiSelectTree=Ge,e.MultiSelectTreePropsContext=$e,e.MultiSelectWithoutContext=ke,e.SearchBar=ee,e.TagList=me,e.dropdownsMessages=H,e.findByFieldValue=(e,t,s)=>{if(!e)return;const i=e.findIndex((e=>I(e,t)===s));return e[i]},e.getItemValue=I,e.getMultiSelectTreeValue=(e,t)=>{const{items:s,dataItemKey:a,value:n,subItemsField:o="items",operation:l}=t,r=i.getter(a),d=Ye(n,r);if("clear"===l)return[];if("delete"===l){const e=Ye(s,r);return n.filter((t=>!e[r(t)]))}const p=s[0],h=r(p),u=i.getter(o),c=[...e],g=[];let m,v=[];for(;c.length;){const e=c.pop();if(h===r(e)){v=g.map((e=>e.item)),m=e;break}{g&&g.length&&g[g.length-1].parentPosition===c.length&&g.pop();const t=u(e);t&&t.length&&(g.push({item:e,parentPosition:c.length}),c.push(...t))}}const f=[...u(m)||[]],b=[];for(;f.length;){const e=f.pop();b.push(e);const t=u(e);t&&t.length&&f.push(...t)}const y=[];if(!d[h]){y.push(...n),y.push(m),y.push(...b.filter((e=>!d[r(e)])));const e=v.filter((e=>!d[r(e)])),t=Ye(y,r);for(let s=e.length-1;s>-1;s--){const i=e[s],a=u(i);if(a.filter((e=>t[r(e)])).length<a.length)break;y.push(i),t[r(i)]=!0}}else{const e=r(m),t=Ye(b,r),s=Ye(v,r);y.push(...n.filter((i=>{const a=r(i);return!t[a]&&e!==a&&!s[a]})))}return y},e.getValueMap=Ye,e.nodata=P,e.scrollToItem=y}));
|