@progress/kendo-react-dropdowns 14.5.0-develop.15 → 14.5.0-develop.16

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.
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !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,n,a,o,l,r,d,u,p){"use strict";function c(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 h=c(t);const g=e=>{const{children:t,width:s,dir:n,itemsCount:a,popupSettings:l}=e,r=h.useContext(i.ZIndexContext),d=r?r+2e3:12e3;return h.createElement(i.ZIndexContext.Provider,{value:d},h.createElement(o.Popup,{style:{width:s,direction:n},contentKey:a&&a.join(),...l},t))},v="dropdowns.nodata",m="dropdowns.clear",f="dropdowns.comboArrowBtnAriaLabelExpand",b="dropdowns.comboArrowBtnAriaLabelCollapse",y="dropdowns.dropDownListArrowBtnAriaLabel",C="dropdowns.dropDownListAdaptiveFilterPlaceholder",x="dropdowns.listFilterAriaLabel",I="dropdowns.chipListAriaLabel",k="dropdowns.autoCompleteListAriaLabel",S="dropdowns.listAriaLabel",w={[m]:"clear",[v]:"NO DATA FOUND.",[f]:"expand combobox",[b]:"collapse combobox",[y]:"select",[C]:"Filter",[x]:"Search",[I]:"chip list",[k]:"Suggestions",[S]:"Options"},E=h.forwardRef((e,t)=>{const s=h.useRef(null),{renderListFilterWrapper:n=!1,renderPrefixSeparator:o=!1,placeholder:d,...u}=e,p=r.useLocalization(),c=i.useUnstyled(),g=c&&c.uDropDownsBase;h.useImperativeHandle(t,()=>s.current);const v=h.createElement(l.TextBox,{...u,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:g})),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:()=>h.createElement(h.Fragment,null,h.createElement(l.InputPrefix,null,h.createElement(i.IconWrap,{name:"search",icon:a.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:g}))})),o&&h.createElement(l.InputSeparator,null)),placeholder:d,"aria-label":p.toLanguageString(x,w[x])});return n?h.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:g}))}," ",v," "):v});E.propTypes={value:s.oneOfType([s.string,s.number,s.array]),tabIndex:s.number,onChange:s.func,onKeyDown:s.func,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","full","none"]),fillMode:s.oneOf(["solid","flat","outline"]),renderListFilterWrapper:s.bool,placeholder:s.string,renderPrefixSeparator:s.bool},E.displayName="KendoReactListFilter";const D=e=>{const{group:t,render:s}=e,n=i.useUnstyled(),a=n&&n.uDropDownsBase,o=h.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:a}))},h.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:a}))},t));return void 0!==s?s(o,e):o},F=e=>null!=e,K=(e,t,s)=>{if(!F(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},M=(e,t,s,i,n)=>{const a=e.offsetHeight,o=e.querySelectorAll('[role="option"]')[s]||t.children.item(s);if(!o)return;const l=o.offsetTop+(n?i-e.scrollTop:0),r=o.offsetHeight;if(n){let t=0;l+r>a?t=l+r-a:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>a+e.scrollTop?e.scrollTop=l+r-a:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},N=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let n=0;n<e.length;n++){const a=(P(e[n],s)||"")+"";if(a&&a.toLowerCase().startsWith(t)){i=n;break}}}return i},T=(e,t,s,i=!1,n=!1)=>{const a=e=>n||!i?e.toLowerCase():e;return e.findIndex(e=>s?a(P(e,s))===a(t):a(t)===a(e.toString()))},P=(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},O=(e,t,s)=>{t.forEach(t=>{const i=e.findIndex(e=>R(e,t,s));-1!==i&&e.splice(i,1)})},R=(e,t,s)=>e===t||F(e)===F(t)&&P(e,s)===P(t,s),L=(e,t,s)=>{if(t){const i=T(e,t,s,!0);return-1!==i?e[i]:e[N(e,t,s)]}return e[0]},B=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},z=(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(!R(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),_=e=>{const{data:t=[],groupField:s}=e;return s?t.filter(e=>s&&void 0!==e[s]):t},H=e=>e.preventDefault(),V=e=>{const{selected:t,defaultItem:s,textField:n}=e,a=i.useUnstyled(),o=a&&a.uDropDownsBase;return h.createElement("div",{onClick:e.onClick,onMouseDown:H,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionLabel({c:o,selected:t}))},P(s,n)||"")},q=({icon:e,svgIcon:t})=>t||e?h.createElement("span",{className:"k-list-item-icon-wrapper",role:"presentation"},h.createElement(i.IconWrap,{className:"k-list-item-icon",name:e?i.toIconName(e):void 0,icon:t,"aria-hidden":"true"})):null,W=e=>{const{selected:t,dataItem:s,virtual:n,disabled:a,id:o,focused:r,render:d,actionsField:u,descriptionField:p,iconField:c,svgIconField:g,checkboxField:v}=e,m=i.useUnstyled(),f=m&&m.uDropDownsBase,b=h.createElement("li",{id:o,role:"option","aria-selected":t,"aria-disabled":!!a||void 0,className:i.classNames(i.uDropDownsBase.li({c:f,selected:t,focused:r,disabled:a})),onClick:t=>e.onClick(e.index,t),style:{position:n?"relative":"unset"}},(()=>{if(!v)return null;const e=P(s,v)||!1;return h.createElement("span",{className:"k-checkbox-wrap"},h.createElement(l.Checkbox,{checked:e,onChange:e=>{s.onCheckboxChange&&s.onCheckboxChange(s,e.value)}}))})(),(g||c)&&h.createElement(q,{icon:c?P(s,c):void 0,svgIcon:g?P(s,g):void 0}),h.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:f}))},P(s,e.textField).toString()),u?P(s,u):null,(()=>{if(!p)return null;const e=P(s,p);return e?h.createElement("span",{className:"k-list-item-description"},e):null})());return void 0!==d?d(b,e):b},A=e=>{const{group:t,virtual:s,render:n,isMultiColumn:a=!1,id:o,iconField:l,svgIconField:r,groupItem:d}=e,u=i.useUnstyled(),p=u&&u.uDropDownsBase,c=h.createElement("li",{id:o,role:"presentation",className:i.classNames(i.uDropDownsBase.groupLi({c:p,isMultiColumn:a})),style:a?{boxSizing:"inherit",position:s?"relative":"unset"}:{position:s?"relative":"unset"}},(r||l)&&h.createElement(q,{icon:l?null==d?void 0:d.groupIcon:void 0,svgIcon:r?null==d?void 0:d.groupSvgIcon:void 0}),h.createElement("span",{className:n?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:p,isMultiColumn:a}))},t));return void 0!==n?n(c,e):c},U=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,{id:a,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:u,listRef:p,wrapperRef:c,listClassName:g,ariaLabel:m,ariaSetSize:f,actionsField:b,descriptionField:y,iconField:C,svgIconField:x,checkboxField:I}=e,k=(()=>{const{textField:t,valueField:s,groupField:i,isMultiColumn:n,optionsGuid:a,skip:o=0,virtual:l,focusedIndex:r,hasDuplicates:d,highlightSelected:u=!0,value:p,data:c,itemRender:g,groupHeaderItemRender:v}=e,m=Array.isArray(p);let f=0;return c.map((k,S)=>{const w=o+S,E=o+S+f,D=d?!!p&&r===S:!k.disabled&&(u&&(!m&&R(k,p,s)||m&&-1!==p.findIndex(e=>R(e,k,s))));let F,K,M;void 0!==i&&(K=P(k,i),0===S&&e.showFirstGroupHeader&&K?F=K:S>0&&(M=P(c[S-1],i),K&&M&&K!==M&&(F=K)));const N=void 0!==F;return void 0!==F&&(f+=1),[N&&h.createElement(A,{id:`k-${a}-item-${E+1}`,virtual:l,key:w+"-group-item",group:F,isMultiColumn:n,render:v,iconField:C,svgIconField:x,groupItem:k}),h.createElement(W,{id:`k-${a}-item-${(N?E+1:E)+1}`,virtual:l,dataItem:k,selected:D,focused:r===S,index:w,key:w,onClick:e.onClick,textField:t,group:F,render:g,disabled:k.disabled,actionsField:b,descriptionField:y,iconField:C,svgIconField:x,checkboxField:I})]})})();return k.length?h.createElement("div",{className:l,style:d,ref:c,role:e.groupField?"listbox":void 0,"aria-label":e.groupField?m:void 0,"aria-hidden":!(!e.groupField||o)||void 0,"aria-setsize":e.groupField?f:void 0,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},(()=>{if(!e.groupField)return h.createElement("ul",{id:a,role:"listbox","aria-label":m,"aria-hidden":!o||void 0,"aria-setsize":f,className:g||i.classNames(i.uDropDownsBase.ul({c:n})),ref:p,style:u},k);const t=[];let s=[];return k.forEach(e=>{Array.isArray(e)&&e.forEach(e=>{e&&e.type===A?(s.length>0&&t.push(s),s=[e]):e&&s.push(e)})}),s.length>0&&t.push(s),t.map(e=>{var t;const s=e.find(e=>h.isValidElement(e)&&e.type===A),o=null==(t=null==s?void 0:s.props)?void 0:t.id;return h.createElement("ul",{id:o?void 0:a,key:o||"first-group",role:"group","aria-labelledby":o,className:g||i.classNames(i.uDropDownsBase.ul({c:n})),ref:o?void 0:p,style:u},e)})})(),e.scroller&&h.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:n}))},e.scroller)):(()=>{const s=e.noDataRender,a=h.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:n})),"aria-live":"polite"},h.createElement("div",null,t.toLanguageString(v,w[v])));return s?s(a):a})()},$="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);class G{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(h.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=$?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)),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&&($||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,n=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let a=this.rowHeightService.index(t),o=this.rowHeightService.offset(a);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=a+this.pageSize-this.total;t>0&&(a-=t,o=this.rowHeightService.offset(a)),this.firstLoaded=a,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&a-1<=this.firstLoaded){const t=n===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(a-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}}let j=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 Y=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new G,this.navigation=new j,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,n,a,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,u=null==(n=null==(i=this.list)?void 0:i.parentElement)?void 0:n.offsetHeight;void 0!==r&&void 0!==u&&(null==(o=null==(a=this.list)?void 0:a.parentElement)||o.scroll({top:r+e*Math.floor(u/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&h.createElement("div",{ref:t=>{e.scrollElement=t},key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({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 n=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),n=!0),n&&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,n=s.container||i.parentNode,a=void 0!==t?t:s.enabled;M(n,i,e,s.translate,a)}}updateComponentArgs(e){for(const t in e)Object.hasOwnProperty.call(e,t)&&(this.component[t]=e[t])}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 n=Math.min(Math.max(0,t),Math.max(0,i.total-s));n!==i.skip&&e.events.push({type:"onPageChange",page:{skip:n,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:n,virtual:a}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&a&&this.vs.enabled&&(a.skip>0&&R(e,i[0],n)?this.triggerOnPageChange(t,a.skip-1,a.pageSize):!o&&a.skip+a.pageSize<a.total&&R(e,i[i.length-1],n)&&this.triggerOnPageChange(t,a.skip+1,a.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,n)=>{e[n-1]&&i[t]!==e[n-1][t]&&s.push({[t]:i[t]}),s.push(e[n])}),s}};Y.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},Y.propTypes={...Y.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},Y.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let Z=Y;const J=Object.freeze({name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1654528156,version:"14.5.0-develop.15",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"}),Q=e=>{const{footer:t,windowWidth:s=0,mobileFilter:n,children:o,navigatable:l,navigatableElements:r,expand:p,animation:c,title:g,subTitle:v,onClose:m}=e,f=i.useAdaptiveModeContext(),b={navigatable:l||!1,navigatableElements:r||[],expand:p,animation:!1!==c,suffixActions:h.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:a.checkIcon,onClick:m}),filter:n,onClose:m,animationStyles:f&&s<=f.small?{top:0,width:"100%",height:"100%"}:void 0,title:g,subTitle:v,className:"k-adaptive-actionsheet",position:f&&s<=f.small?"fullscreen":void 0,appendTo:i.canUseDOM?document.body:null};return h.createElement(u.ActionSheet,{...b},o,t&&h.createElement(u.ActionSheetFooter,{className:"k-actions k-actions-stretched"},h.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),h.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},X=h.forwardRef((e,t)=>{var s;let o=!1;const l=i.getLicenseMessage(J),p=i.usePropsContext(te,e),{delay:c=ee.delay,tabIndex:v=ee.tabIndex,ignoreCase:m=ee.ignoreCase,size:f=ee.size,rounded:b=ee.rounded,fillMode:x=ee.fillMode}=p;if(p.filterable||p.virtual){const e=[];p.filterable&&e.push("filterable"),p.virtual&&e.push("virtualization"),o=!i.validatePackage(J,{component:"DropDownList",features:e})}const I=i.useUnstyled(),k=i.useId(p.id),M=()=>{var e;if(i.canUseDOM)return(null==(e=ye.current)?void 0:e.ownerDocument)||window.document},O=()=>{var e,t;null!=(e=null==Me?void 0:Me.current)&&e.wrapper&&(null==(t=null==Me?void 0:Me.current)||t.wrapper.focus({preventScroll:!0}))},L=()=>{let e;return void 0!==we.current&&null!==we.current?e=we.current:void 0!==p.value?e=p.value:void 0!==Pe.value&&null!==Pe.value?e=Pe.value:void 0!==p.defaultValue&&null!==p.defaultValue&&(e=p.defaultValue),!F(e)&&void 0!==p.defaultItem&&null!==p.defaultItem&&(e=p.defaultItem),e},B=()=>void 0!==p.required?p.required:ee.required,z=()=>{const e=void 0!==p.validationMessage,t=L(),s=!B()||null!==t&&""!==t&&void 0!==t;return{customError:e,valid:void 0!==p.valid?p.valid:s,valueMissing:null===t}},H=e=>{Se.current=!0,e.focus(),window.setTimeout(()=>Se.current=!1,30)},q=()=>{xe.current&&H(xe.current),p.adaptive&&setTimeout(()=>{xe.current&&H(xe.current)},300)},W=h.useCallback(e=>{for(const t of e)Le(t.target.clientWidth)},[]),A=()=>{var e;null!=(e=Ce.current)&&e.setCustomValidity&&Ce.current.setCustomValidity(z().valid?"":p.validationMessage||"Please select a value from the list!")},$=(e,t)=>{const s=L();R(s,e,p.dataItemKey)||(void 0===p.value&&(t.data.value=e),Me.current.updateComponentArgs({value:e}),we.current=e,t.events.push({type:"onChange"}))},G=e=>{var t;null==(t=null==Me?void 0:Me.current)||t.applyState(e),we.current=void 0},j=(e,t)=>{var s;const{virtual:i,dataItemKey:n,defaultItem:a}=p,o=_(p),l=i?i.skip:0,r=L(),d=-1===e&&void 0!==a?a:o[e-l],u=!R(d,r,n);$(d,t),u&&(null==(s=null==Me?void 0:Me.current)||s.triggerPageChangeCornerItems(d,t))},Y=(e,t,s)=>{var i,n;const{defaultItem:a,dataItemKey:o,virtual:l={skip:0,total:0,pageSize:0}}=p,r=L(),d=_(p),u=null==(i=null==Me?void 0:Me.current)?void 0:i.vs,c=d.findIndex(e=>R(e,r,o)),h=null==(n=null==Me?void 0:Me.current)?void 0:n.navigation.navigate({current:l.skip+c,max:(null!=u&&u.enabled?l.total:d.length)-1,min:void 0!==a?-1:0,keyCode:t,skipItems:s||void 0});void 0!==h&&j(h,e),G(e)},X=()=>{const{textField:e,dataItemKey:t,virtual:s={skip:0},focusedItemIndex:i=N,filterable:n,skipDisabledItems:a=!0}=p,o=L(),l=_(p),r=p.filter?p.filter:Pe.text;return a&&e&&!r&&!o?l.findIndex(e=>!e.disabled):F(o)&&void 0===r||n&&""===r?l.findIndex(e=>R(e,o,t)):r?De.current?i(l,r,e):l.findIndex(e=>R(e,o,t)):0===s.skip?0:-1},se=(e,t)=>void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled,ie=()=>{const e=_(p),t=Me.current.initState(),s=X();se(e,s)&&($(null,t),G(t))},ne=e=>{if(e.isPropagationStopped())return;const t=Me.current.initState();t.syntheticEvent=e,Pe.focused||(t.data.focused=!0),ie(),Me.current.togglePopup(t),G(t)},ae=e=>{var t,s,n,a,o,l,r;e&&e.target instanceof Element&&"INPUT"===e.target.nodeName&&e.stopPropagation&&e.stopPropagation();const{filterable:d,disabled:u,defaultItem:c,leftRightKeysNavigation:h=!0,virtual:g={skip:0,total:0,pageSize:0},dataItemKey:v,groupField:m="",textField:f,skipDisabledItems:b=!0}=p,y=_(p),C=L(),x=y.findIndex(e=>R(e,C,v)),I=void 0!==p.opened?p.opened:Pe.opened,k=e.keyCode,S=k===i.Keys.home||k===i.Keys.end,w=k===i.Keys.up||k===i.Keys.down,E=!I&&(e.altKey&&k===i.Keys.down||k===i.Keys.enter||k===i.Keys.space),D=I&&(e.altKey&&k===i.Keys.up||k===i.Keys.esc),F=h&&(k===i.Keys.left||k===i.Keys.right),K=w||F&&!d||S,M=Me.current.initState();if(M.syntheticEvent=e,!u){if(S&&null!=(t=null==Me?void 0:Me.current)&&t.vs.enabled)k===i.Keys.home?0!==g.skip?(null==(s=null==Me?void 0:Me.current)||s.triggerOnPageChange(M,0,g.pageSize),Ee.current=!0):$(y[0],M):g.skip<g.total-g.pageSize?(null==(n=null==Me?void 0:Me.current)||n.triggerOnPageChange(M,g.total-g.pageSize,g.pageSize),Ee.current=!0):$(y[y.length-1],M);else if(I&&k===i.Keys.pageUp)e.preventDefault(),null==(a=null==Me?void 0:Me.current)||a.scrollPopupByPageSize(-1);else if(I&&k===i.Keys.pageDown)e.preventDefault(),null==(o=null==Me?void 0:Me.current)||o.scrollPopupByPageSize(1);else if(I&&k===i.Keys.enter){const t=X();se(y,t)?($(null,M),G(M)):j(t,M),null==(l=null==Me?void 0:Me.current)||l.togglePopup(M),e.preventDefault()}else if(E||D)D&&ie(),null==(r=null==Me?void 0:Me.current)||r.togglePopup(M),e.preventDefault();else if(K){if(De.current=!1,""!==m&&f)if(!b&&I)Y(M,k);else{let e;if(k===i.Keys.down||k===i.Keys.right){const t=y.slice(x+1).find(e=>!e.disabled);e=t&&y.indexOf(t)}else if(k===i.Keys.up||k===i.Keys.left){let t;if(0===x&&c)e=-1;else if(-1===x)t=y,e=y.findIndex(e=>!e.disabled);else{t=y.slice(0,x);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&y.indexOf(s)}}if(void 0!==e){Y(M,k,e-x)}else void 0===e&&x===y.length-1&&Y(M,k)}else if(!b&&I||S)Y(M,k);else if(f){let e;if(k===i.Keys.down||k===i.Keys.right){const t=y.slice(x+1).find(e=>!e.disabled);e=t&&y.indexOf(t)}else if(k===i.Keys.up||k===i.Keys.left){let t;if(0===x&&c)e=-1;else if(-1===x)t=y,e=y.findIndex(e=>!e.disabled);else{t=y.slice(0,x);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&y.indexOf(s)}}if(void 0!==e){Y(M,k,e-x)}else void 0===e&&x===y.length-1&&Y(M,k)}else Y(M,k);e.preventDefault()}G(M)}},oe=e=>{const t=Me.current.initState();t.syntheticEvent=e.syntheticEvent,void 0===p.filter&&(t.data.text=e.target.value),Me.current.filterChanged(e.target.value,t),De.current=!0,G(t),Ve({group:void 0,text:String(e.target.value)})},le=e=>{const t=void 0!==p.filter?p.filter:Pe.text;return p.filterable&&h.createElement(E,{value:t,ref:e=>{xe.current=e&&e.element},onChange:oe,onKeyDown:ae,size:e?"large":f,rounded:b,fillMode:x,renderListFilterWrapper:!0,placeholder:ze.toLanguageString(C,w[C])})},re=e=>{var t;const s=Me.current.initState();s.syntheticEvent=e,null==(t=null==Me?void 0:Me.current)||t.togglePopup(s),$(p.defaultItem,s),G(s)},de=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=p,i=L();return void 0!==t&&h.createElement(V,{defaultItem:t,textField:e,selected:R(i,t,s),key:"defaultitemkey",onClick:re})},ue=(e,t)=>{var s;null==(s=null==Me?void 0:Me.current)||s.handleItemClick(e,t),we.current=void 0},pe=e=>{const{vs:t,list:s}=Me.current;t.scrollHandler(e);const{groupField:i}=p;let n=_(p);if(i&&n.length&&i){const a=Ne.current=Ne.current||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=Me.current.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[e][i]);l!==Pe.group&&Ve({group:l})}},ce=()=>{var e;const{textField:t,dataItemKey:s,virtual:n={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:o,itemRender:l}=p,r=_(p),d=I&&I.uDropDownList,u=Me.current.vs,c=n.skip,g=void 0!==p.opened?p.opened:Pe.opened,v=Me.current.getPopupSettings(),m=`translateY(${u.translate}px)`,f=L();return h.createElement(U,{id:We,show:g,data:r.slice(),focusedIndex:X(),value:f,textField:t,valueField:s,optionsGuid:Ae,groupField:p.groupField,ariaLabel:ze.toLanguageString(S,w[S]),listRef:e=>{u.list=Me.current.list=e},wrapperStyle:{maxHeight:ct?void 0:v.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:d})),listStyle:u.enabled?{transform:m}:void 0,key:"listkey",skip:c,onClick:ue,itemRender:l,groupHeaderItemRender:a,noDataRender:o,onScroll:pe,wrapperRef:u.scrollerRef,scroller:null==(e=null==Me?void 0:Me.current)?void 0:e.renderScrollElement(),ariaSetSize:n.total})},he=()=>{Pe.focused&&window.setTimeout(()=>{Pe.focused&&Me.current.wrapper&&H(Me.current.wrapper)})},ge=e=>{"onMouseDownOutside"in(p.popupSettings||{})&&p.popupSettings.onMouseDownOutside.call(void 0,e)},ve=()=>{const{header:e,footer:t,groupStickyHeaderItemRender:s,groupField:n,list:a}=p,o=_(p),l=I&&I.uDropDownList;let{group:r}=Pe;return void 0===r&&void 0!==n&&(r=P(o[0],n)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:l}))},e),h.createElement("div",{className:i.classNames("k-list",{[`k-list-${ct?"lg":i.sizeMap[f]||f}`]:ct||f})},!a&&r&&0!==o.length&&h.createElement(D,{group:r,render:s}),ce()),t&&h.createElement("div",{className:"k-list-footer"},t))},me=e=>{clearTimeout(Ie.current),p.filterable||(Ie.current=window.setTimeout(()=>ke.current.word="",c),(e=>{const{dataItemKey:t}=p,s=_(p),i=L();let n=s.map((e,t)=>({item:e,itemIndex:t}));const a=ke.current.word,o=ke.current.last,l=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(a,o);let r,d=n.length,u=Math.max(0,s.findIndex(e=>R(e,i,t)));p.defaultItem&&(r={item:p.defaultItem,itemIndex:-1},d+=1,u+=1),u+=l?1:0,n=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(n,u,r);let c,h,g,v=0;const{textField:f}=p;for(;v<d;){if(c=P(n[v].item,f),h=l&&K(c,o,m),g=K(c,a,m),h||g){v=n[v].itemIndex;break}v++}if(v!==d){const t=Me.current.initState();t.syntheticEvent=e,j(v,t),G(t),we.current=void 0}})(e))},fe=()=>{const e=Me.current.initState();e.data.opened=Pe.opened,Me.current.togglePopup(e),G(e)},be=h.useRef(null),ye=h.useRef(null),Ce=h.useRef(null),xe=h.useRef(null);h.useImperativeHandle(be,()=>({get element(){return ye.current},get index(){return(()=>{const{dataItemKey:e}=p,t=_(p),s=L();return t.findIndex(t=>R(t,s,e))})()},get name(){return p.name},get validity(){return z()},get value(){return L()},get focused(){return Pe.focused},get opened(){return Pe.opened},focus:O,props:p,togglePopup:fe})),h.useImperativeHandle(t,()=>be.current),i.useWebMcpRegister("dropdownlist",be,p,p.webMcp);const Ie=h.useRef(null),ke=h.useRef({word:"",last:""}),Se=h.useRef(!1),we=h.useRef(null),Ee=h.useRef(!1),De=h.useRef(!1),Fe=h.useRef({}),Ke=h.useRef({}),Me=h.useRef(new Z({props:p,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Ne=h.useRef(0),Te=h.useRef(null),[Pe,Oe]=h.useState({}),[Re,Le]=h.useState(),[,Be]=h.useReducer(e=>e,!0),ze=r.useLocalization(),_e=p.name||p.id,He=h.useCallback(e=>{if(null==e||!Me.current)return;const t=_(p),{textField:s}=p,i=String(e),n=T(t,i,s,!1,m),a=-1!==n?t[n]:void 0;if(void 0!==a){const e=Me.current.initState();e.syntheticEvent={target:ye.current},$(a,e),G(e)}},[p,m]);i.useKendoPaste(ye,{fieldName:_e,onValueChange:He,enabled:!!_e});const Ve=e=>{Oe({...Pe,...e})};h.useEffect(()=>{Me.current.updateComponentArgs({props:p,setState:Ve,state:Pe,forceUpdate:Be,element:ye.current,handleItemSelect:j,value:L()})},[Ve,Pe,Be,j,L]),h.useEffect(()=>{var e,t,s,i,n,a,o,l,r,d,u,c,h;const{dataItemKey:g,virtual:v,groupField:m="",textField:f}=p,b=_(p),y=Fe.current.virtual?Fe.current.virtual.total:0,C=void 0!==p.opened?p.opened:Pe.opened,x=void 0!==Fe.current.opened?Fe.current.opened:Ke.current.opened,I=!x&&C;if(null==(e=null==Me?void 0:Me.current)||e.didUpdate(),null!=(t=null==Me?void 0:Me.current)&&t.getPopupSettings().animate||I&&q(),v&&v.total!==y)null==(s=null==Me?void 0:Me.current)||s.vs.calcScrollElementHeight(),null==(i=null==Me?void 0:Me.current)||i.vs.reset();else{const e=L(),t=void 0!==Fe.current.value?Fe.current.value:Ke.current.value;let s=b.findIndex(t=>R(t,e,g));""!==m&&e&&f&&(s=null==(a=null==(n=null==Me?void 0:Me.current)?void 0:n.getGroupedDataModernMode(b,m))?void 0:a.map(e=>e[f]).indexOf(e[f]));const i=!R(t,e,g);I&&v?null==(o=null==Me?void 0:Me.current)||o.scrollToVirtualItem(v,s):I&&!v?(q(),b&&0!==b.length&&(null==(l=null==Me?void 0:Me.current)||l.resetGroupStickyHeader(b[0][m],{setState:Ve,group:Pe.group,state:Pe})),null==(r=null==Me?void 0:Me.current)||r.scrollToItem(s)):C&&x&&e&&i&&!Ee.current?null==(u=null==Me?void 0:Me.current)||u.scrollToItem(s,null==(d=null==Me?void 0:Me.current)?void 0:d.vs.enabled):C&&x&&Ee.current&&(Ee.current&&v&&0===v.skip?null==(c=null==Me?void 0:Me.current)||c.vs.reset():Ee.current&&v&&v.skip===v.total-v.pageSize&&(null==(h=null==Me?void 0:Me.current)||h.vs.scrollToEnd()))}Ee.current=!1,Ke.current=Pe,Fe.current=p,A()}),h.useEffect(()=>{var e,t;return Te.current=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(W.bind(void 0)),null==(e=null==Me?void 0:Me.current)||e.didMount(),A(),null!=(t=M())&&t.body&&Te.current&&Te.current.observe(M().body),()=>{var e;null!=(e=M())&&e.body&&Te.current&&Te.current.disconnect()}},[]);const qe=k+"-accessibility-id",We=k+"-listbox-id",Ae=k+"-guid",Ue=ze.toLanguageString(y,w[y]),{style:$e,className:Ge,label:je,dir:Ye,virtual:Ze,adaptive:Je,dataItemKey:Qe,disabled:Xe,loading:et,iconClassName:tt,svgIcon:st,valueRender:it}=p,nt=void 0!==p.opened?p.opened:Pe.opened,at=L(),ot=P(at,p.textField),lt=!(void 0!==p.validityStyles?p.validityStyles:ee.validityStyles)||z().valid,rt=Me.current,dt=rt.vs,ut=I&&I.uDropDownList;dt.enabled=void 0!==Ze;const pt=i.useAdaptiveModeContext(),ct=!!(Re&&pt&&Re<=pt.medium&&p.adaptive);void 0!==Ze&&(rt.vs.skip=Ze.skip,rt.vs.total=Ze.total,rt.vs.pageSize=Ze.pageSize);const ht=_(p),{focused:gt}=Pe,vt=ht.findIndex(e=>R(e,at,Qe)),mt=null!=(s=null==Ze?void 0:Ze.skip)?s:0,ft=nt&&vt>=0?`k-${Ae}-item-${vt+mt+1}`:void 0,bt=h.createElement("span",{id:qe,className:i.classNames(i.uDropDownList.inputInner({c:ut}))},ot&&h.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:ut}))},ot)),yt=void 0!==it?it.call(void 0,bt,at):bt,Ct=h.createElement(h.Fragment,null,h.createElement("span",{ref:e=>{ye.current=e,Me.current.wrapper=e},className:i.classNames(i.uDropDownList.wrapper({c:ut,size:f,rounded:b,fillMode:x,focused:gt,disabled:Xe,invalid:!lt,loading:et,required:B()}),Ge),style:je?{...$e,width:void 0}:$e,dir:Ye,onMouseDown:nt?e=>{"INPUT"!==e.target.nodeName&&(H(Me.current.wrapper),e.preventDefault())}:void 0,onFocus:ct?e=>ne(e):e=>{Se.current||Me.current.handleFocus(e)},onBlur:e=>{if(Se.current||!Pe.focused)return;const t=void 0!==p.opened?p.opened:Pe.opened,s=Me.current.initState();s.syntheticEvent=e,s.data.focused=!1,s.events.push({type:"onBlur"}),t&&ie(),t&&!ct&&Me.current.togglePopup(s),G(s)},tabIndex:i.getTabIndex(v,Xe),accessKey:p.accessKey,onKeyDown:ae,onKeyPress:e=>{if(p.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);m&&(t=t.toLowerCase())," "===t&&e.preventDefault(),ke.current={word:ke.current.word+t,last:ke.current.last+t},me(e)},onClick:Xe?void 0:ne,role:"combobox","aria-required":B()||void 0,"aria-disabled":Xe||void 0,"aria-haspopup":"listbox","aria-expanded":nt||!1,"aria-activedescendant":ft,"aria-label":p.ariaLabel||p.label,"aria-labelledby":p.ariaLabelledBy,"aria-describedby":p.ariaDescribedBy||(nt?qe:void 0),"aria-controls":nt?We:void 0,id:p.id,title:p.title},yt,et&&h.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:ut})),name:"loading"}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":Ue,size:f,fillMode:x,className:i.classNames(i.uDropDownList.inputButton({c:ut})),iconClass:tt,svgIcon:tt?void 0:st||a.chevronDownIcon,onMouseDown:e=>Pe.focused&&e.preventDefault()}),(e=>h.createElement("select",{name:p.name,ref:e=>{Ce.current=e},tabIndex:-1,"aria-hidden":!0,title:p.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:p.valueMap?p.valueMap.call(void 0,e):e})))(at),!ct&&(()=>{const{header:e,footer:t,dir:s,groupField:n,groupStickyHeaderItemRender:a,list:r}=p,d=_(p),u=Me.current,c=u.getPopupSettings(),v=void 0!==p.opened?p.opened:Pe.opened,m=void 0!==c.width?c.width:u.popupWidth,b=I&&I.uDropDownList,y={dir:void 0!==s?s:u.dirCalculated,width:m,popupSettings:{...c,popupClass:i.classNames(c.popupClass,i.uDropDownList.listContainer({c:b,popup:!0})),anchor:c.anchor||ye.current,show:v,onOpen:q,onClose:he,onMouseDownOutside:ge},itemsCount:[d.length]};let{group:C}=Pe;return void 0===C&&void 0!==n&&(C=P(d[0],n)),h.createElement(g,{...y},le(!1),e&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:b}))},e),h.createElement("div",{className:i.classNames(i.uDropDownList.list({c:b,size:f,virtual:Me.current.vs.enabled}))},de(),!r&&C&&0!==d.length&&h.createElement(D,{group:C,render:a}),ce()),t&&h.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:b}))},t),o&&h.createElement(i.WatermarkOverlay,{message:l}))})()),ct&&(()=>{const{groupField:e}=p,t=_(p),s=void 0!==p.opened?p.opened:Pe.opened,n=I&&I.uDropDownList,a={title:p.adaptiveTitle||p.label,subTitle:p.adaptiveSubtitle,expand:s,onClose:e=>ne(e),windowWidth:Re,mobileFilter:le(!0)};let{group:o}=Pe;return void 0===o&&void 0!==e&&(o=P(t[0],e)),h.createElement(Q,{...a},h.createElement(u.ActionSheetContent,null,h.createElement("div",{className:i.classNames(i.uDropDownList.listContainer({c:n,popup:!1}))},ve())))})());return je?h.createElement(n.FloatingLabel,{label:je,editorValue:ot,editorValid:lt,editorDisabled:p.disabled,style:{width:$e?$e.width:void 0},children:Ct}):Ct});X.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};const ee={delay:500,tabIndex:0,ignoreCase:!0,...Z.defaultProps,required:!1,size:void 0,rounded:void 0,fillMode:void 0};X.displayName="KendoReactDropDownList";const te=i.createPropsContext();X.displayName="KendoReactDropDownList";let se=class extends h.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:n,suggestedText:a,focused:o}=this.props,l=this.input,r=t!==n||a!==s,d=r&&t.startsWith(n)&&!(s&&a&&s.endsWith(a)),u=i.getActiveElement(document);o&&l&&u!==l&&l.focus(),a&&r&&!d&&l&&l.setSelectionRange(n.length-a.length,n.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:n,tabIndex:a,accessKey:o,unstyled:l,inputAttributes:r}=this.props,d=l&&l.uDropDownsBase,u={tabIndex:a,accessKey:o},p=h.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:d})),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-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||void 0,"aria-controls":e?this.props.ariaControls:void 0,"aria-autocomplete":this.props.ariaAutoComplete,...Object.assign({},u,r)});return n?n(p):p}};const ie=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,o=t.toLanguageString(m,w[m]);return h.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:n})),onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon}))},ne=i.useCustomComponent,ae=class e extends h.Component{constructor(e){super(e),this.state={},this.base=new Z(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this._skipFocus=!1,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.scrollToFocused=!1,this.showLicenseWatermark=!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.handleKendoPasteValue=e=>{const{data:t,textField:s,allowCustom:i}=this.props;if(!t)return;const n=null!=e?String(e):"",a=T(t,n,s,!1,!0);let o=null;if(-1!==a?o=t[a]:i&&(o=s?{[s]:n}:n),null===o)return;const l=this.base.initState();l.syntheticEvent={target:this._element,currentTarget:this._element,nativeEvent:new Event("change",{bubbles:!0})},void 0!==this.state.text&&(l.data.text=void 0),this.triggerOnChange(o,l),this.applyState(l)},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i}=this.props,n=_(this.props)[e-(s?s.skip:0)],a=this.hasDuplicates||!R(n,this.value,i);this.triggerOnChange(n,t),void 0!==this.state.text&&(t.data.text=void 0),a&&this.base.triggerPageChangeCornerItems(n,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=>{this._skipFocus=!0;const{skipDisabledItems:t,textField:s}=this.props,i=_(this.props),n=this.getFocusedIndex(),a=this.getCurrentValueDisabledStatus(s,i,n),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&a&&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),setTimeout(()=>{this._skipFocus=!1},300)},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=P(this.value,this.props.textField),s=F(e)?e:t;return h.createElement(E,{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,placeholder:this.props.placeholder})},this.listContainerContent=()=>{const{header:e,footer:t,size:s,groupStickyHeaderItemRender:n,groupField:a,list:o,unstyled:l,virtual:r}=this.props,d=_(this.props),u=l&&l.uComboBox;let{group:p}=this.state;return void 0===p&&void 0!==a&&(p=P(d[0],a)),h.createElement("div",{className:i.classNames(i.uComboBox.list({c:u,list:o,size:"large",tableSize:s,virtual:r}))},e&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:u}))},e),!o&&p&&0!==d.length&&h.createElement(D,{group:p,render:n}),this.renderList(),t&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:u}),this.props.footerClassName)},t))},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;this.props.onListScroll&&this.props.onListScroll(e);let n=_(this.props);if(!i||!n.length)return;const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=this.base.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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=_(this.props),n=this.getFocusedIndex(),a=!(-1===n)&&this.getCurrentValueDisabledStatus(s,i,n);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&a&&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:n,groupField:a}=this.props,o=_(this.props),l=this.value,r=Math.max(0,o.findIndex(e=>R(e,l,n))),d=e.keyCode,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();if(p.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==a&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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=t&&o.indexOf(t)}else if(d===i.Keys.up||d===i.Keys.left){let t;if(0===r)t=o,e=o.findIndex(e=>!e.disabled);else{t=o.slice(0,r);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&o.indexOf(s)}}if(void 0!==e){const t=e-r;this.onNavigate(p,d,t)}else void 0===e&&r===o.length-1&&this.onNavigate(p,d)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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(p,d,t)}else this.onNavigate(p,d)}this.applyState(p)}const c=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)},h=this.getFocusedIndex(),g=-1===h,v=!g&&this.getCurrentValueDisabledStatus(s,o,h);u?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?c():d===i.Keys.enter?(e.preventDefault(),(s&&!g&&e.currentTarget.value?o[h][s]:void 0)?!t&&s&&v?this.clearValueOnEnterOrEsc(e):v||this.applyValueOnEnter(e.currentTarget.value,p):this.applyValueOnEnter(e.currentTarget.value,p)):d===i.Keys.esc&&(!t&&s&&v&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,p)):u||d!==i.Keys.esc?e.altKey&&d===i.Keys.down&&c():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,n=i.value;if(this.props.suggest){const e=i.selectionEnd===n.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;F(t)||(t=P(this.value,this.props.textField)||"");const s=t&&t===n,a=t&&t.length>n.length;s||a||!e?this._suggested="":this.suggestValue(n)}void 0===this.props.filter&&(t.data.text=n),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s?this.scrollToFocused=!0:this.base.togglePopup(t),this.base.filterChanged(n,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!")},this.handleFocus=e=>{if(this._skipFocus)return;const t=this.base.initState();t.syntheticEvent=e,this.mobileMode&&!this._skipFocus&&(this._skipFocus=!0,this.base.togglePopup(t),this.applyState(t),setTimeout(()=>{this._skipFocus=!1},300)),this.base.handleFocus(e)},this.showLicenseWatermark=!i.validatePackage(J,{component:"ComboBox"}),this.licenseMessage=i.getLicenseMessage(J)}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(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=(null==(e=this.props._adaptiveMode)?void 0:e.medium)&&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=_(this.props),s=this.value;return t.findIndex(t=>R(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,i;const{dataItemKey:n,virtual:a,groupField:o="",textField:l}=this.props,r=_(this.props),d=e.virtual?e.virtual.total:0,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened;e.data!==r&&this.checkForDuplicatePlainTextRecords();const c=!p&&u,h=this.value;if(this._valueOnDidUpdate=h,this.base.didUpdate(),a&&a.total!==d)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const d=void 0!==e.value?e.value:t.value;let g=this.hasDuplicates?this.navigationIndex||0:r.findIndex(e=>R(e,h,n));l&&h&&(g=null==(s=this.base.getGroupedDataModernMode(r,o))?void 0:s.map(e=>e[l]).indexOf(h[l]));const v=!R(d,h,n);if(c&&a?this.base.scrollToVirtualItem(a,g):c&&!a?(this.onPopupOpened(),r&&0!==r.length&&this.base.resetGroupStickyHeader(r[0][o],this),this.base.scrollToItem(g)):(this.hasDuplicates||u&&p&&h&&v)&&this.base.scrollToItem(g),u&&p&&this.scrollToFocused){const e=null!=(i=this.props.filter?this.props.filter:this.state.text)?i:"";if(e){const{focusedItemIndex:t=N}=this.props,s=t(r,e,l);this.base.scrollToItem(s)}else this.base.scrollToItem(0)}}this.scrollToFocused=!1,c&&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();const t=this.props.name||this.props.id;this.KendoPasteSubscription=i.subscribeToKendoPaste(this._element,{fieldName:t,onValueChange:e=>{this.handleKendoPasteValue(e)}})}componentWillUnmount(){var e,t;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect(),null==(t=this.KendoPasteSubscription)||t.unsubscribe()}render(){const t=r.provideLocalizationService(this),s=t.toLanguageString(f,w[f]),o=t.toLanguageString(b,w[b]),{dir:l,disabled:u,clearButton:p=e.defaultProps.clearButton,label:c,textField:g,className:v,style:m,loading:y,iconClassName:C,virtual:x,size:I,rounded:k,fillMode:S,opened:E=this.state.opened,placeholder:D,svgIcon:K,unstyled:M}=this.props,N=!this.validityStyles||this.validity.valid,T=void 0!==this.props.filter?this.props.filter:this.state.text,O=P(this.value,g),R=F(T)?T:O,L=p&&(!!R||F(this.value)),B=this.base.vs,z=this.props.id||this._inputId,_=M&&M.uComboBox;B.enabled=void 0!==x,void 0!==x&&(B.skip=x.skip,B.total=x.total,B.pageSize=x.pageSize);const[H,V]=ne(this.props.prefix||h.Fragment),[q,W]=ne(this.props.suffix||h.Fragment),A=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:_,size:I,rounded:k,fillMode:S,disabled:u,invalid:!N,loading:y,required:this.required}),v),ref:this.componentRef,style:c?{...m,width:void 0}:m,dir:l,onFocus:this.handleFocus},this.props.prefix&&h.createElement(H,{...V}),this.renderSearchBar(R||"",z,D),L&&!y&&h.createElement(ie,{onClick:this.clearButtonClick,key:"clearbutton"}),y&&h.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:_})),name:"loading",key:"loading"}),this.props.suffix&&h.createElement(q,{...W}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":E?o:s,svgIcon:K||(C?void 0:a.chevronDownIcon),iconClass:C,size:I,fillMode:S,className:i.classNames(i.uComboBox.inputButton({c:_})),onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return c?h.createElement(n.FloatingLabel,{label:c,editorId:z,editorValue:R,editorValid:N,editorDisabled:u,style:{width:m?m.width:void 0},children:A,unstyled:M}):A}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,n=_(this.props),a=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const u=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(u),-1===l||F(d))if(""===a)this.handleItemSelect(0,e);else{const a=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:a,max:(r.enabled?r.total:n.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,ignoreCase:n}=this.props,a=_(this.props),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=P(this.value,s)===e?this.index:T(a,e,s,!1,n),r=-1!==l;let d;if(this._suggested="",r)d=a[l];else{if(!i)return this.selectFocusedItem(e,t);d=void 0!==s?{[s]:e}:e}this.triggerOnChange(d,t),o&&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,ignoreCase:n}=this.props,a=_(this.props),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=P(this.value,s);if(this._suggested="",e===l||""===e&&!F(l))return this.closeOpenedApplyStateNonMobileMode(t,o),this.applyState(t);const r=T(a,e,s,!0,n);let d=null;-1!==r?d=a[r]:i&&(d=e?s?{[s]:e}:e:null),this.triggerOnChange(d,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),this.closeOpenedApplyStateNonMobileMode(t,o),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:n={skip:0},focusedItemIndex:a=N}=this.props,o=_(this.props),l=n.skip,r=""===e&&0===l?0:a(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,{groupField:t,adaptiveTitle:s=this.props.label,adaptiveSubtitle:i}=this.props,n=_(this.props),a=void 0!==this.props.opened?this.props.opened:this.state.opened;let{group:o}=this.state;void 0===o&&void 0!==t&&(o=P(n[0],t));const l={title:s||this.props.label,subTitle:i,expand:a,onClose:e=>this.toggleBtnClick(e),windowWidth:e,mobileFilter:this.renderMobileListFilter()};return h.createElement(Q,{...l},h.createElement(u.ActionSheetContent,null,h.createElement("div",{className:"k-list-container"},this.listContainerContent())))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:n,groupField:a,size:o,list:l,virtual:r,groupStickyHeaderItemRender:d,unstyled:u}=this.props,p=_(this.props),c=void 0!==this.props.opened?this.props.opened:this.state.opened,v=e.getPopupSettings(),m=void 0!==v.width?v.width:e.popupWidth,f=u&&u.uComboBox;let{group:b}=this.state;return void 0===b&&void 0!==a&&(b=P(p[0],a)),h.createElement(g,{width:m,popupSettings:{...v,anchor:v.anchor||this.element,show:c,popupClass:i.classNames(v.popupClass,i.uComboBox.listContainer({c:f,popup:!0}))},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[p.length]},h.createElement("div",{className:i.classNames(i.uComboBox.list({c:f,list:l,size:o,tableSize:o,virtual:r}))},s&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:f}))},s),!l&&b&&0!==p.length&&h.createElement(D,{group:b,render:d}),this.renderList(),n&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:f}),this.props.footerClassName)},n)),this.showLicenseWatermark&&h.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}renderList(){const e=this.base,t=r.provideLocalizationService(this),{textField:s,dataItemKey:n,listNoDataRender:a,itemRender:o,groupHeaderItemRender:l,virtual:d={skip:0,total:void 0},unstyled:u}=this.props,p=_(this.props),c=e.getPopupSettings(),g=e.vs,v=d.skip,m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=`translateY(${g.translate}px)`,b=m?this.getFocusedIndex(this.hasDuplicates):void 0,y=void 0!==this.props.filter?this.props.filter:this.state.text,C=P(this.value,s),x=F(y)&&y!==C?null:this.value,I=this.props.list||U,k=u&&u.uComboBox;return h.createElement(I,{id:e.listBoxId,virtual:!!d,show:m,data:p,focusedIndex:b,value:x,textField:s,valueField:n,groupField:this.props.groupField,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,hasDuplicates:this.hasDuplicates,ariaLabel:t.toLanguageString(S,w[S]),listRef:e=>{g.list=this.base.list=e,this.itemHeight=0},wrapperStyle:this.mobileMode?{}:{maxHeight:c.height},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:k,virtual:d})),listStyle:g.enabled?{transform:f}:void 0,key:"listkey",skip:v,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:l,noDataRender:a,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll,wrapperRef:g.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:d.total})}renderSearchBar(e,t,s){const{tabIndex:i,accessKey:n,disabled:a,title:o,ariaLabelledBy:l,ariaDescribedBy:r,dataItemKey:d,virtual:u={skip:0},unstyled:p,inputAttributes:c}=this.props;_(this.props);const g=void 0!==this.props.opened?this.props.opened:this.state.opened,v=g?this.getFocusedIndex(this.hasDuplicates):-1;return this._suggested&&!R(this._valueOnDidUpdate,this.value,d)&&(this._suggested=""),h.createElement(se,{id:t,readOnly:g&&this.mobileMode,placeholder:s,tabIndex:i,accessKey:n,title:o,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:g&&v>=0?`k-${this.base.guid}-item-${v+u.skip+1}`:void 0,role:"combobox",ariaLabelledBy:l,ariaLabel:this.props.ariaLabel,ariaDescribedBy:r,ariaRequired:this.required,render:this.props.valueRender,ariaControls:g?this.base.listBoxId:void 0,unstyled:p,inputAttributes:c})}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)||R(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:n={skip:0},focusedItemIndex:a=N,skipDisabledItems:o}=this.props,l=_(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=>R(e,t,i)):r?a(l,r,s):o&&s&&!r&&0===n.skip?l.findIndex(e=>!e.disabled):0===n.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const n=t[N(t,e,s)];if(n){const t=P(n,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})}};ae.displayName="ComboBox",ae.propTypes={...Z.propTypes,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","full","none"]),fillMode:s.oneOf(["solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,ignoreCase: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,inputAttributes:s.object},ae.defaultProps={...Z.defaultProps,size:void 0,rounded:void 0,fillMode:void 0,allowCustom:!1,ignoreCase:!1,clearButton:!0,required:!1,isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let oe=ae;const le=i.createPropsContext(),re=i.withIdHOC(i.withPropsContext(le,i.withUnstyledHOC(i.withAdaptiveModeContext(oe))));re.displayName="KendoReactComboBox";const de=h.forwardRef((e,t)=>{const[s,n]=i.useMergedRef(t);return i.useWebMcpRegister("combobox",s,e,e.webMcp),h.createElement(re,{...e,ref:n})});de.displayName="KendoReactComboBox";const{sizeMap:ue,roundedMap:pe}=i.kendoThemeMaps,ce=class e extends h.Component{constructor(){super(...arguments),this.state={},this.base=new Z(this),this._element=null,this._suggested="",this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleKendoPasteValue=e=>{const t=null!=e?String(e):"",s=this.base.initState();s.syntheticEvent={target:this._element,currentTarget:this._element,nativeEvent:new Event("change",{bubbles:!0})},this.triggerOnChange(t,s),this.applyState(s)},this.handleItemSelect=(e,t)=>{const s=_(this.props),i=P(s[e],this.props.textField);this.state.text&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=_(this.props)[e];R(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.renderAdaptiveListContainer=()=>{const{windowWidth:e=0}=this.state,t=h.createElement(E,{value:this.value,ref:e=>{this._adaptiveInput=e&&e.element},onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:"large",rounded:this.props.rounded,fillMode:this.props.fillMode,placeholder:this.props.placeholder}),s={title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,expand:this.opened,onClose:e=>this.onCancel(e),windowWidth:e,mobileFilter:t};return h.createElement(Q,{...s},h.createElement(u.ActionSheetContent,null,h.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=this.state.text;F(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.listContainerContent=()=>{const{header:e,footer:t,size:s,groupStickyHeaderItemRender:n,groupField:a,list:o}=this.props,l=_(this.props);let{group:r}=this.state;return void 0===r&&void 0!==a&&(r=P(l[0],a)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:"k-list-header"},e),h.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":ue[s]||s}`]:this.mobileMode||s})},!o&&r&&0!==l.length&&h.createElement(D,{group:r,render:n}),this.renderList()),t&&h.createElement("div",{className:"k-list-footer"},t))},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let i=_(this.props);if(!s||!i.length)return;const n=this.itemHeight||(t?t.children[0].offsetHeight:0),a=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(n*e>a);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=this.mobileMode?e.target.element:e.currentTarget,i=s.value,n=s.selectionEnd===i.length;t.syntheticEvent=e;const a=this._suggested,o=this.value,l=o&&o.substring(0,o.length-a.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:u}=this.props,p=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==u&&!1!==u){r||d||!n?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);(!p&&i||p&&!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:n}=this.props,a=_(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=a[o],r=e.keyCode,d=e.altKey,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();p.syntheticEvent=e;const c=()=>{u&&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(u&&r===i.Keys.pageUp)c(),this.base.scrollPopupByPageSize(-1);else if(u&&r===i.Keys.pageDown)c(),this.base.scrollPopupByPageSize(1);else if(!u||r!==i.Keys.enter&&r!==i.Keys.esc)if(u||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==s&&n)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=a.slice(o+1).find(e=>!e.disabled);e=t&&a.indexOf(t)}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=a,e=a.findIndex(e=>!e.disabled);else{t=a.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&a.indexOf(s)}}if(void 0!==e){const t=e-o;this.onNavigate(p,r,t)}else void 0===e&&o===a.length-1&&this.onNavigate(p,r)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=a.slice(o+1).find(e=>!e.disabled);else if(r===i.Keys.up||r===i.Keys.left){const t=a.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-o-1;this.onNavigate(p,r,t)}else this.onNavigate(p,r)}this.applyState(p),c()}}else this._suggested="",this.triggerOnChange("",p),void 0!==this.state.focusedItem&&(p.data.focusedItem=void 0),this.applyState(p);else c(),!1===t&&l&&l.disabled?(u&&this.togglePopup(p),this.applyState(p)):this.applyInputValue(e.currentTarget.value,p,e.keyCode)},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{const t=this.base.initState();!this.state.focused||this._skipFocusEvent||(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"})),this.applyState(t))},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&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300),this.base.togglePopup(s),this.applyState(s)}}get _inputId(){return this.props.id+"-accessibility-id"}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}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 opened(){return!!(void 0!==this.props.opened?this.props.opened:this.state.opened)}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=(null==(e=this.props._adaptiveMode)?void 0:e.medium)&&this.props.adaptive)}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,n=_(this.props),{data:a=[]}=e,o=this.focusedIndex(),l=n[o],r=a!==n,d=void 0!==l&&t.focusedItem!==l,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,c=!p&&u;if(""===i)(u&&(d||r)||c)&&this.base.scrollToItem(o);else if(!this._isScrolling){const e=null==(s=this.base.getGroupedDataModernMode(n,i))?void 0:s.indexOf(l);c&&(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][i],this),this.base.scrollToItem(e)),u&&p&&d&&this.base.scrollToItem(e)}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);const t=this.props.name||this.props.id;this.KendoPasteSubscription=i.subscribeToKendoPaste(this._element,{fieldName:t,onValueChange:e=>{this.handleKendoPasteValue(e)}})}componentWillUnmount(){var e;this.observerResize&&this.observerResize.disconnect(),null==(e=this.KendoPasteSubscription)||e.unsubscribe()}render(){const{dir:e,disabled:t,label:s,className:a,style:o,loading:l,suggest:r,size:d,rounded:u,fillMode:p}=this.props,c=!this.validityStyles||this.validity.valid,g=this.base,v=this.value,m=!1!==this.props.clearButton&&!l&&!!v,f=this.props.id||this._inputId,b=this.state.focused;"string"==typeof r&&(this._suggested=r);const[y,C]=ne(this.props.prefix||h.Fragment),[x,I]=ne(this.props.suffix||h.Fragment),k=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-autocomplete k-input",a,{[`k-input-${ue[d]||d}`]:d,[`k-rounded-${pe[u]||u}`]:u,[`k-input-${p}`]:p,"k-invalid":!c,"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,onFocus:this.mobileMode?e=>this.handleWrapperClick(e):this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick},this.props.prefix&&h.createElement(y,{...C}),this.renderSearchBar(v||"",f),l&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),m&&!l&&h.createElement(ie,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&h.createElement(x,{...I}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:f,editorValue:v,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:k}):k}onNavigate(e,t,s){const i=this.value,{textField:n,focusedItemIndex:a}=this.props,o=_(this.props),l=void 0!==this.state.focusedItem?o.findIndex(e=>R(e,this.state.focusedItem,n)):a?a(o,i,n):o.indexOf(L(o,i,n)),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 n=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:a}=this.props,o=_(this.props),l=o[this.focusedIndex()];if(this._suggested="",n&&s===i.Keys.enter&&l&&!l.disabled){const s=P(o[this.focusedIndex(e)],a);this.triggerOnChange(s,t)}n&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:n,disabled:a,readonly:o,inputAttributes:l}=this.props,{focused:r}=this.state,d=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(se,{id:t,placeholder:i,tabIndex:n,accessKey:this.props.accessKey,value:e,suggestedText:this._suggested,focused:r,name:this.props.name,ref:e=>{this._input=e&&e.input},onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:s.handleFocus,onBlur:this.handleBlur,disabled:a,readOnly:o,expanded:d,ariaControls:d?s.listBoxId:void 0,activedescendant:`k-${s.guid}-item-${this.focusedIndex()+1}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaLabel:this.props.ariaLabel,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender,inputAttributes:l})}renderListContainer(){const e=this.base,{dir:t,groupField:s}=this.props,n=_(this.props),a=e.getPopupSettings(),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=void 0!==a.width?a.width:e.popupWidth;let{group:r}=this.state;return void 0===r&&void 0!==s&&(r=P(n[0],s)),h.createElement(g,{width:l,popupSettings:{...a,anchor:a.anchor||this.element,show:o,popupClass:i.classNames(a.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[n.length]},this.listContainerContent())}renderList(){const e=this.base,t=r.provideLocalizationService(this),s=e.getPopupSettings(),{textField:i,listNoDataRender:n,itemRender:a,groupHeaderItemRender:o}=this.props,l=_(this.props),d=this.value,u=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(U,{id:e.listBoxId,show:u,data:l.slice(),focusedIndex:this.focusedIndex(),value:d,textField:i,valueField:i,highlightSelected:!0,optionsGuid:e.guid,groupField:this.props.groupField,ariaLabel:t.toLanguageString(k,w[k]),listRef:t=>{e.list=t},wrapperStyle:this.mobileMode?{}:{maxHeight:s.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:o,noDataRender:n,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||{}}))}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}suggestValue(e){if(this._suggested="",e){const{textField:t}=this.props,s=_(this.props),i=s[N(s,e,t)];if(i){const s=P(i,t);e.toLowerCase()!==s.toLowerCase()&&(this._suggested=s.substring(e.length))}}}focusedIndex(e){const{textField:t,focusedItemIndex:s,skipDisabledItems:i}=this.props,n=_(this.props),a=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return n.findIndex(e=>R(e,this.state.focusedItem,t));if(s)return s(n,a,t);const o=n.indexOf(L(n,a,t));return i&&t&&-1===o?n.findIndex(e=>!e.disabled):Math.max(0,o)}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ce.displayName="AutoComplete",ce.propTypes={...Z.basicPropTypes,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","full","none"]),fillMode:s.oneOf(["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,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,adaptiveSubtitle:s.string,onCancel:s.func,skipDisabledItems:s.bool,inputAttributes:s.object},ce.defaultProps={...Z.defaultProps,size:void 0,rounded:void 0,fillMode:void 0,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let he=ce;const ge=i.createPropsContext();r.registerForLocalization(he);const ve=i.withIdHOC(i.withPropsContext(ge,i.withAdaptiveModeContext(he)));ve.displayName="KendoReactAutoComplete";const me=h.forwardRef((e,t)=>{const[s,n]=i.useMergedRef(t);return i.useWebMcpRegister("autocomplete",s,e,e.webMcp),h.createElement(ve,{...e,ref:n})});me.displayName="KendoReactAutoComplete";const fe=e=>e.syntheticEvent.preventDefault(),be=e=>e.syntheticEvent.stopPropagation();class ye extends h.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:n,onTagDelete:a,size:o}=this.props;return h.createElement(h.Fragment,null,e.map((l,r)=>{const u=n?h.createElement(n,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:a}):h.createElement(d.Chip,{id:`tag-${t}-${l.text?l.text.replace(/\s+/g,"-"):r}`,ariaSelected:!0,role:"option","aria-setsize":e.length,key:l.text+r,text:l.text,removable:!0,onRemove:e=>a.call(void 0,l.data,e.syntheticEvent),onMouseDown:fe,onClick:be,className:l===s?"k-focus":void 0,size:o});return i?i(l,u):u}),this.props.children)}}var Ce=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(Ce||{});const{sizeMap:xe,roundedMap:Ie}=i.kendoThemeMaps,ke=e=>e.preventDefault(),Se=e=>2===e,we=class e extends h.Component{constructor(e){super(e),this.state={activedescendant:Ce.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new Z(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.showLicenseWatermark=!1,this.focus=()=>{this._input&&this._input.focus()},this.handleKendoPasteValue=e=>{if(null==e)return;const t=_(this.props),{textField:s,dataItemKey:i}=this.props,n=String(e).split(",").map(e=>e.trim()).filter(e=>e).reduce((e,n)=>{const a=T(t,n,s,!1,!0);if(-1!==a){const s=t[a];e.some(e=>R(e,s,i))||e.push(s)}return e},[]);if(0===n.length)return;const a=this.base.initState();a.syntheticEvent={target:this._element},this.triggerOnChange(n,a),this.applyState(a)},this.handleItemSelect=(e,t)=>{const{dataItemKey:s,virtual:i}=this.props,n=_(this.props),a=n[e-(i?i.skip:0)],o=this.value.findIndex(e=>R(e,a,s));this._lastSelectedOrDeslectedItemIndex=n.findIndex(e=>R(e,a,s));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,a],(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(a,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;O(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{allowCustom:s,virtual:i}=this.props,n=_(this.props),a=i?i.skip:0,o=i?i.pageSize:0,l=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:r}=this.getFocusedState(),d=s&&l,u=n[e-a];if(i&&!u&&e>=0&&r!==e){const s=Math.floor(e/o)*o;if(s!==a)return this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=Ce.PopupList),void this.base.triggerOnPageChange(t,s,o)}u&&r!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=Ce.PopupList):d&&-1===e&&void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(u,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.scrollToFocused=!0:(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,virtual:n}=this.props,a=_(this.props),o=e.keyCode,l=void 0!==this.props.filter?this.props.filter:this.state.text,r=void 0!==this.props.opened?this.props.opened:this.state.opened,{focusedItem:d,focusedIndex:u}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=e,!l&&this.value.length>0&&(o===i.Keys.left||o===i.Keys.right||o===i.Keys.home||o===i.Keys.end||o===i.Keys.delete||o===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,p);const c=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(o===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(o===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,u);null===t?e=0!==u?a.slice(u-1,u):[a[u]]:t===u?e=[a[t-1]]:u>=0&&(e=t>u?a.slice(u-1,t):a.slice(t-1,u)),e&&e.length>0&&(u>=1&&this.itemFocus(u-1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const t=this.getLastSelectedOrDeselectedIndex(0,u);null===t?e=u!==a.length-1?a.slice(u,u+1):[a[u]]:t===u?e=a.slice(u,u+2):u>=0&&(e=t>u?a.slice(u+1,t+1):a.slice(t,u+2)),e&&e.length>=1&&(this.itemFocus(u+1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.altKey&&o===i.Keys.up)c();else if(o===i.Keys.up||o===i.Keys.down){const l=n?n.skip:0,d=u-l;if(""!==s&&t)if(!this.props.skipDisabledItems&&r)this.onNavigate(p,o);else{let e=0;if(o===i.Keys.down||o===i.Keys.right){const t=a.slice(d+1).find(e=>!e.disabled);e=t&&a.indexOf(t),e&&-1!==e&&(e+=l)}else if(o===i.Keys.up||o===i.Keys.left){let t;if(-1===u)t=a,e=a.findIndex(e=>!e.disabled),-1!==e&&(e+=l);else{t=a.slice(0,d);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&a.indexOf(s),e&&-1!==e&&(e+=l)}}if(e){const t=e-u;this.onNavigate(p,o,t)}else this.onNavigate(p,o)}else if(!this.props.skipDisabledItems&&r)this.onNavigate(p,o);else{let e=null;if(o===i.Keys.down||o===i.Keys.right)e=a.slice(d+1).find(e=>!e.disabled);else if(o===i.Keys.up||o===i.Keys.left){const t=a.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=a.indexOf(e);if(-1!==t){const e=l+t-u;this.onNavigate(p,o,e)}else this.onNavigate(p,o)}else this.onNavigate(p,o)}this.applyState(p),e.preventDefault()}else o===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&l&&null===d?this.customItemSelect(e):d&&d.disabled?c():this.selectFocusedItem(e)):o===i.Keys.esc&&c();else e.altKey&&o===i.Keys.down?c():o===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:n,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=_(this.props),u=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),c=s&&u&&h.createElement("div",{className:i.classNames("k-list",{[`k-list-${xe[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:ke},h.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":Se(p)}),style:{fontStyle:"italic"}},u,h.createElement(i.IconWrap,{name:"plus",icon:a.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==l&&(g=P(d[0],l)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:"k-list-header"},e),c,h.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":xe[n]||n}`]:this.mobileMode||n,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&h.createElement(D,{group:g,render:o}),this.renderList()),this.showLicenseWatermark&&h.createElement(i.WatermarkOverlay,{message:this.licenseMessage}),t&&h.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=_(this.props),n=this.base.getPopupSettings(),a=void 0!==n.width?n.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:a,popupSettings:{...n,popupClass:i.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),anchor:n.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return h.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,adaptiveSubtitle:t,filterable:s,filter:i}=this.props,{windowWidth:n=0}=this.state,a=void 0!==i?i:this.state.text,o=s?h.createElement(E,{value:a,ref:e=>{this._adaptiveInput=e&&e.element},onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:"large",rounded:this.props.rounded,fillMode:this.props.fillMode,placeholder:this.props.placeholder}):null,l={title:e||this.props.label,subTitle:t,expand:this.opened,onClose:e=>this.closePopup(e),windowWidth:n,mobileFilter:o};return h.createElement(Q,{...l},h.createElement(u.ActionSheetContent,null,h.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 e=r.provideLocalizationService(this),{textField:t,listNoDataRender:s,itemRender:i,groupHeaderItemRender:n,dataItemKey:a,virtual:o={skip:0,total:void 0}}=this.props,l=_(this.props),d=this.base.vs,{focusedIndex:u}=this.getFocusedState(),p=this.base.getPopupSettings(),c=`translateY(${d.translate}px)`;return h.createElement(U,{id:this.base.listBoxId,show:this.opened,data:l.slice(),focusedIndex:u-o.skip,value:this.value,textField:t,valueField:a,optionsGuid:this.base.guid,groupField:this.props.groupField,ariaLabel:e.toLanguageString(S,w[S]),listRef:e=>{d.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:p.height},wrapperCssClass:"k-list-content",listStyle:d.enabled?{transform:c}:void 0,key:"listKey",skip:o.skip,onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:n,noDataRender:s,onMouseDown:ke,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:d.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:o.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let n=_(this.props);if(i&&n.length&&i){const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=this.base.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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 n=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const a=[...this.value,n];this.triggerOnChange(a,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.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!")},this.validate(e),this.licenseMessage=i.getLicenseMessage(J)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}validate(e){if(e.filterable||e.virtual){const t=[];e.filterable&&t.push("filterable"),e.virtual&&t.push("virtualization"),this.showLicenseWatermark=!i.validatePackage(J,{component:"MultiSelect",features:t})}}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:P(e,t),data:[e]})}):s.push(...e),s}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=(null==(e=this.props._adaptiveMode)?void 0:e.medium)&&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:n=""}=this.props,a=_(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,u=r&&!this.opened,p=this.base.getPopupSettings();if(this.validate(this.props),this.base.didUpdate(),!p.animate&&u&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==n&&(t=null==(s=this.base.getGroupedDataModernMode(a,n))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][n],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);const t=this.props.name||this.props.id;this.KendoPasteSubscription=i.subscribeToKendoPaste(this._element,{fieldName:t,onValueChange:e=>{this.handleKendoPasteValue(e)}})}componentWillUnmount(){var e,t;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect(),null==(t=this.KendoPasteSubscription)||t.unsubscribe()}onNavigate(e,t,s){const{allowCustom:n}=this.props,a=_(this.props),o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=n&&o,u=Se(l),p=this.base,c=p.vs;if(this.opened&&t===i.Keys.up&&u)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=p.navigation.navigate({keyCode:t,current:r,max:(c.enabled?c.total:a.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:a,disabled:o,textField:l,dataItemKey:d,virtual:u,size:p,rounded:c,fillMode:g,loading:v,filter:m}=this.props,{text:f,focused:b,focusedTag:y,currentValue:C}=this.state,x=this.base.vs,k=this.props.id||this._inputId;x.enabled=void 0!==u,void 0!==u&&(x.skip=u.skip,x.total=u.total,x.pageSize=u.pageSize);const S=this.mobileMode&&this.opened?C:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const E=!this.validityStyles||this.validity.valid,D=r.provideLocalizationService(this),F=!!(void 0!==m?m:f)||S&&S.length>0,[K,M]=ne(this.props.prefix||h.Fragment),[N,T]=ne(this.props.suffix||h.Fragment),O=h.createElement(h.Fragment,null,h.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${xe[p]||p}`]:p,[`k-rounded-${Ie[c]||c}`]:c,[`k-input-${g}`]:g,"k-focus":b&&!o,"k-invalid":!E,"k-disabled":o,"k-loading":v,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:a,onFocus:e=>{this.mobileMode?this.handleWrapperClick(e):this.handleFocus(e)},onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:B},this.props.prefix&&h.createElement(K,{...M}),h.createElement("div",{className:i.classNames("k-input-values")},h.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${xe[p]||p}`]:p}),role:"listbox","aria-label":D.toLanguageString(I,w[I]),"aria-orientation":"horizontal",id:"tagslist-"+this.base.guid},S&&S.length>0&&h.createElement(ye,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:S,guid:this.base.guid,focused:y?S.find(e=>z(e,y,d)):void 0,size:p})),this.renderSearchBar(k)),v&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&h.createElement(N,{...T}),F&&h.createElement(ie,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:k,editorValue:f||P(this.value[0],l),editorValid:E,editorDisabled:o,style:{width:e?e.width:void 0},children:O}):O}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:n,placeholder:a,ariaDescribedBy:o,ariaLabelledBy:l,ariaLabel:r,inputAttributes:d}=this.props,u=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:p}=this.getFocusedState(),c=0!==this.value.length||u?void 0:a,g=i&&i.length>0?void 0:a,v=t===Ce.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`k-${this.base.guid}-item-${p+1}`,m=o?` ${o}`:"",f=this.value.length>0?`tagslist-${this.base.guid}${m}`:o,b={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return h.createElement(se,{id:e,name:this.props.name,size:Math.max((c||"").length,u.length,1),placeholder:this.mobileMode&&this.opened?g:c,value:u,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,expanded:this.opened,ariaControls:this.base.listBoxId,role:"combobox",activedescendant:v,ariaDescribedBy:f,ariaLabelledBy:l,ariaRequired:this.required,ariaLabel:r,ariaAutoComplete:"list",inputAttributes:d,...b})}onTagsNavigate(e,t){const s=e.keyCode,{focusedTag:n}=this.state,a=this._tags,o=this.props.dataItemKey;let l,r=n?a.findIndex(e=>z(e,n,o)):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):a.length-1,l=a[r];else if(s===i.Keys.right)r===a.length-1?l=void 0:d&&(r=Math.min(a.length-1,r+1),l=a[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;O(e,a[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)O(e,a[r].data,o),this.triggerOnChange(e,t);else if(!d&&a.length){const s=a.pop();O(e,s.data,o),this.triggerOnChange(e,t)}}}else l=a[a.length-1];else l=a[0];l!==n&&(t.data.focusedTag=l,t.data.activedescendant=Ce.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=_(this.props),{focusedIndex:n}=t||this.getFocusedState();void 0!==i[n-(s?s.skip:0)]&&this.handleItemClick(n,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:n,textField:a,focusedItemIndex:o=N,skipDisabledItems:l}=this.props,r=_(this.props),d=n&&n.skip||0;let u;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const p=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return u=o(r,t,a),{focusedItem:r[u],focusedIndex:u+d,focusedType:1};if(p.length){const e=p[p.length-1];return u=r.findIndex(t=>R(t,e,i)),void 0!==r[u]?{focusedIndex:u+d,focusedItem:r[u],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&a&&!t&&0===d){const e=r.findIndex(e=>!e.disabled);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}};we.displayName="MultiSelect",we.propTypes={...Z.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,adaptiveSubtitle:s.string,onCancel:s.func,skipDisabledItems:s.bool,inputAttributes:s.object},we.defaultProps={...Z.defaultProps,autoClose:!0,required:!1,size:void 0,rounded:void 0,fillMode:void 0,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let Ee=we;const De=i.createPropsContext(),Fe=i.withIdHOC(i.withPropsContext(De,i.withAdaptiveModeContext(Ee)));Fe.displayName="KendoReactMultiSelect",r.registerForLocalization(Ee);const Ke=h.forwardRef((e,t)=>{const[s,n]=i.useMergedRef(t);return i.useWebMcpRegister("multiselect",s,e,e.webMcp),h.createElement(Fe,{...e,ref:n})});Ke.displayName="KendoReactMultiSelect";const Me=e=>h.createElement(U,{...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}}),Ne=i.createPropsContext(),Te=h.forwardRef((e,t)=>{const s=i.usePropsContext(Ne,e),n=h.useRef(null),a=h.useRef(null),o=i.getScrollbarWidth(),{columns:l=Oe.columns,popupSettings:r=Oe.popupSettings,size:d=Oe.size,rounded:u=Oe.rounded,fillMode:p=Oe.fillMode,className:c,prefix:g,suffix:v,onOpen:m,onClose:f,onFocus:b,onBlur:y,onChange:C,onFilterChange:x,onPageChange:I,...k}=s;h.useImperativeHandle(n,()=>{var e;return{element:(null==(e=a.current)?void 0:e.element)||null,focus(){a.current&&a.current.focus()},get value(){var e;return null==(e=a.current)?void 0:e.value},get name(){var e;return null==(e=a.current)?void 0:e.name},props:s}}),h.useImperativeHandle(t,()=>n.current);const S=h.useMemo(()=>{if(void 0!==s.groupField&&s.data)return P(s.data[0],s.groupField)},[s.data,s.groupField]),[w,E]=h.useState(S),[D,F]=h.useState(!0),K=h.useRef(null),[M]=g?ne(s.prefix||h.Fragment):[],[N]=v?ne(s.suffix||h.Fragment):[],T=h.useMemo(()=>{const e=h.createElement("th",{className:"k-table-th",colSpan:l.length},w);return h.createElement(h.Fragment,null,s.header,h.createElement("div",{ref:K,className:"k-table-header-wrap"},h.createElement("table",{className:"k-table",role:"presentation"},h.createElement("colgroup",null,l.map((e,t)=>h.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Oe.width}}))),h.createElement("thead",{className:"k-table-thead"},h.createElement("tr",{className:"k-table-row"},l.map((e,t)=>h.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" "))),w&&D&&h.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))},[s.header,l,w,D]),O=h.useMemo(()=>`calc(${l.map(e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Oe.width)).filter(Boolean).join(" + ")} + ${o}px + 4px)`,[l,o]),R=s.virtual?s.virtual.skip:0,L=h.useCallback((e,t)=>{const n=l.map((e,n)=>h.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Oe.width},key:e.uniqueKey?e.uniqueKey:n},e.field?String(i.getter(e.field)(t.dataItem)):""));let a,o,r,d,u=s.data||[];const p=t.index-R;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(u[p]),r=d(u[p-1]),o&&r&&o!==r&&(a=o));const c=h.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":!!a,"k-disabled":t.dataItem.disabled})},n);return s.itemRender?s.itemRender.call(void 0,c,t):c},[l,s.groupField,s.itemRender,s.data,R]),B=h.useCallback((e,t)=>{e&&e.call(void 0,{...t,target:n.current})},[]),z=h.useCallback(e=>(s.virtual||E(S),B(m,e)),[B,m,s.virtual,S]),_=h.useCallback(e=>B(f,e),[f]),H=h.useCallback(e=>B(b,e),[b]),V=h.useCallback(e=>B(y,e),[y]),q=h.useCallback(e=>B(C,e),[C]),W=h.useCallback(e=>B(I,e),[I]),A=h.useCallback(e=>(E(S),B(x,{...e,mobileMode:e.target.mobileMode})),[x]),U=h.useCallback(e=>{E(e.group)},[]),$=h.useCallback(e=>{K.current&&(K.current.scrollLeft=e.target.scrollLeft)},[]);h.useEffect(()=>{i.setScrollbarWidth()}),h.useEffect(()=>{const e=s.data;E(S),e&&0!==e.length?F(!0):F(!1)},[s.data]);const G=h.useCallback(e=>h.createElement(Me,{...e}),[]);return h.createElement(re,{...k,list:G,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||O,className:r.className},ref:a,header:T,itemRender:L,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:u,fillMode:p,groupField:s.groupField,isMultiColumn:!0,onOpen:z,onClose:_,onFocus:H,onBlur:V,onChange:q,onFilterChange:A,onPageChange:W,onGroupScroll:U,onListScroll:$,className:i.classNames("k-dropdowngrid",c),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,adaptiveSubtitle:s.adaptiveSubtitle,footer:s.footer,footerClassName:"k-table-footer",prefix:M,suffix:N})}),Pe={...oe.propTypes,columns:s.any.isRequired},Oe={columns:[],popupSettings:{},width:"200px",size:void 0,rounded:void 0,fillMode:void 0};function Re(e){return"string"==typeof e?Number(e.replace("px","")):e}function Le(e,t,s,i){const n=Re(t.popupSettings.width),a=(void 0!==s.width&&Re(s.width))!==n,o=void 0!==i.width,l=a?s.width:o?i.width:n,r=Re(function(e,t,s){const[i,n]=h.useState(t);return h.useEffect(()=>{void 0!==i&&e.current&&n(e.current.offsetWidth)},s),i}(e,l));return a||o?l:r&&n&&r>n?r:n}Te.displayName="KendoMultiColumnComboBox",Te.propTypes=Pe;const Be=e=>h.createElement("div",{className:"k-nodata"},h.createElement("div",null,e.children)),{sizeMap:ze,roundedMap:_e}=i.kendoThemeMaps,He=e=>h.createElement("span",{className:"k-input-value-text"},e.children),Ve=e=>e.split("_").map(e=>parseInt(e,10)),qe={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:void 0,rounded:void 0,fillMode:void 0},We=i.createPropsContext(),Ae=h.forwardRef((e,t)=>{const s=!i.validatePackage(J,{component:"DropDownTree"}),l=i.getLicenseMessage(J),c=i.usePropsContext(We,e),g={...qe,...c},f=i.useId(),b=g.id||f,C=`${b}-treeview`,x=`${b}-value`,{data:I,dataItemKey:k,popupSettings:S={},style:D,opened:K,disabled:M,onOpen:N=i.noop,onClose:T=i.noop,placeholder:O,label:L,name:B,selectField:z,subItemsField:_,validationMessage:H,valid:V,required:q,validityStyles:W}=g,A=i.getTabIndex(g.tabIndex,M),U=h.useRef(null),$=h.useRef(null),G=h.useRef(null),j=h.useRef(null),Y=h.useRef(null),Z=h.useRef(null),X=h.useRef(!1),[ee,te]=h.useState(void 0),se=void 0!==g.value,ie=se?g.value:void 0!==ee?ee:g.defaultValue,ne=F(ie),ae=ne?P(ie,g.textField):"",oe=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:H,valid:V,required:q},ne),le=h.useContext(i.ZIndexContext),re=le?le+2e3:12e3,de=h.useCallback(()=>$.current&&$.current.focus(),[]);h.useImperativeHandle(U,()=>({props:g,element:$.current,focus:de})),h.useImperativeHandle(t,()=>U.current),i.useWebMcpRegister("dropdowntree",U,g,g.webMcp);const ue=i.useRtl($,g.dir),pe={width:Le($,qe,{...qe.popupSettings,...S},D),...void 0!==ue?{direction:ue}:{}},[ce,he]=h.useState(!1),ge=void 0!==K?K:ce,[ve,me]=h.useState(!1),[fe,be]=h.useState(),[ye,Ce]=h.useState(""),xe=i.useAdaptiveModeContext(),Ie=!!(fe&&xe&&fe<=xe.medium&&g.adaptive),ke=h.useCallback(()=>{Y.current&&Y.current.setCustomValidity&&Y.current.setCustomValidity(oe.valid?"":void 0===H?"Please select a value from the list!":H)},[H,oe]);h.useEffect(ke),h.useEffect(()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ye.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}},[]);const Se=h.useCallback(e=>{if(!ge){if(N){const t={...e};N.call(void 0,t)}void 0===K&&he(!0)}},[ge,K,N]),we=h.useCallback(e=>{if(ge){if(T){const t={...e};T.call(void 0,t)}void 0===K&&(he(!1),Ie&&setTimeout(()=>{var e;Me(null==(e=j.current)?void 0:e.element)},300))}},[ge,K,T,Ie]),Ee=h.useCallback(e=>{if(!e.isDefaultPrevented()&&U.current){me(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};(ge?we:Se)(t)}},[ge,K,N,T]),De=h.useCallback(e=>{X.current=!0,e(),window.setTimeout(()=>X.current=!1,0)},[]),Fe=h.useCallback(e=>{var t,s;const{keyCode:n,altKey:a}=e,o=Z.current&&Z.current.element;if(!U.current||e.isDefaultPrevented()&&(null==(t=G.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};if(ge)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),we(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===i.Keys.up&&null!=(s=G.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find(e=>null==e?void 0:e.querySelector(".k-focus"));if(t&&0===e.indexOf(t))return De(()=>{var e;Me(null==(e=G.current)?void 0:e.element)})}De(i.noop)}else n===i.Keys.down&&De(()=>{var e;Me((null==(e=G.current)?void 0:e.element)||o)});else a&&n===i.Keys.down?(e.preventDefault(),Se(l)):ge||n===i.Keys.esc&&$e(e)},[ge,K,N,T]),Ke=h.useCallback(e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),De(t===i.Keys.up?()=>{Me($.current)}:()=>{var e;Me(null==(e=Z.current)?void 0:e.element)}))},[]),Me=h.useCallback(e=>{e&&De(()=>e.focus())},[]),Ne=h.useCallback(e=>{var t;S.onOpen&&S.onOpen(e),ve||!ge||K?c.filterable?Me(null==(t=G.current)?void 0:t.element):Me(Z.current&&Z.current.element):we({target:U.current})},[T,c.filterable,ve,K,ge]),Te=h.useCallback(e=>{S.onClose&&S.onClose(e),ve&&Me($.current)},[ve]),Pe=h.useCallback(e=>{if(!ve&&!X.current&&(me(!0),c.onFocus&&U.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};c.onFocus.call(void 0,t)}},[ve,c.onFocus]),Oe=h.useCallback(e=>{if(ve&&!X.current&&U.current){me(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};if(c.onBlur){const e={...t};c.onBlur.call(void 0,e)}Ie||we(t)}},[ve,c.onBlur,ge,K,T]),Re=h.useCallback(()=>{ve&&De(i.noop),Ie&&setTimeout(()=>{var e;Me(null==(e=j.current)?void 0:e.element)},300)},[ve,Ie]),Ae=h.useCallback((e,t,s)=>{if(c.onChange){const i={value:t,level:s?Ve(s):[],...e};c.onChange.call(void 0,i)}se||te(t)},[c.onChange,se]),Ue=h.useCallback(e=>{if(R(e.item,ie,k)||!U.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,a={syntheticEvent:n,nativeEvent:i,target:U.current};Ae(a,t,s),we(a)},[se,ie,c.onChange,k,ge,K,T]),$e=h.useCallback(e=>{if(!U.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};Ae(t,null),we(t),e.preventDefault()},[se,c.onChange,ge,K,T]),Ge=h.useCallback(e=>{if(e.syntheticEvent.stopPropagation(),c.onExpandChange&&U.current){const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,a={level:Ve(s),item:t,nativeEvent:i,syntheticEvent:n,target:U.current};c.onExpandChange.call(void 0,a)}},[c.onExpandChange]),je=h.useCallback(e=>{if(c.onFilterChange&&U.current){const t={filter:{field:c.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:U.current};c.onFilterChange.call(void 0,t),void 0===c.filter&&Ce(e.target.value)}},[c.onFilterChange,c.filter,c.textField]),Ye=h.useCallback(e=>{for(const t of e)be(t.target.clientWidth)},[]),Ze=h.useMemo(()=>se||!ne?I:i.mapTree(I,_,e=>i.extendDataItem(e,_,{[z]:R(e,ie,k)})),[I,ie,se,ne,z,_]),Je=g.listNoData||Be,Qe=g.valueHolder||He,Xe=r.useLocalization(),et=!W||oe.valid,{size:tt,rounded:st,fillMode:it}=g,nt=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-dropdowntree k-picker",g.className,{[`k-picker-${ze[tt]||tt}`]:tt,[`k-rounded-${_e[st]||st}`]:st,[`k-picker-${it}`]:it,"k-focus":ve,"k-invalid":!et,"k-loading":g.loading,"k-required":q,"k-disabled":g.disabled}),tabIndex:A,accessKey:g.accessKey,id:b,style:L?{...D,width:void 0}:D,dir:ue,ref:$,onKeyDown:M?void 0:Fe,onMouseDown:Re,onClick:M?void 0:Ee,onFocus:Ie?e=>Ee(e):Pe,onBlur:Oe,role:"combobox","aria-haspopup":"tree","aria-expanded":ge,"aria-disabled":M,"aria-label":g.ariaLabel||L,"aria-labelledby":g.ariaLabelledBy,"aria-controls":ge?C:void 0,"aria-describedby":g.ariaDescribedBy||(ge?x:void 0),"aria-required":q||void 0},h.createElement("span",{className:"k-input-inner",id:x},(ae||O)&&h.createElement(Qe,{item:ie},ae||O)),g.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ne&&!M&&h.createElement("span",{onClick:$e,className:"k-clear-value",title:Xe.toLanguageString(m,w[m]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon})),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":Xe.toLanguageString(y,w[y]),className:"k-input-button",size:tt,fillMode:it,icon:"chevron-down",svgIcon:a.chevronDownIcon}),h.createElement("select",{name:B,ref:Y,tabIndex:-1,"aria-hidden":!0,title:L,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:g.valueMap?g.valueMap.call(void 0,ie):ie})),!Ie&&h.createElement(i.ZIndexContext.Provider,{value:re},h.createElement(o.Popup,{...S,className:i.classNames(S.className,{"k-rtl":"rtl"===ue}),popupClass:i.classNames(S.popupClass,"k-dropdowntree-popup k-list-container"),style:pe,anchor:S.anchor||$.current,show:ge,onOpen:Ne,onClose:Te},g.filterable&&h.createElement(E,{value:void 0===g.filter?ye:g.filter,ref:G,onChange:je,onKeyDown:Ke,size:tt,rounded:st,fillMode:it,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),I.length>0?h.createElement(p.TreeView,{id:C,style:{height:S.height},ref:Z,tabIndex:A,data:Ze,focusIdField:k,textField:g.textField,selectField:z,expandField:g.expandField,childrenField:_,expandIcons:!0,onItemClick:Ue,onExpandChange:Ge,size:tt,item:g.item,dir:ue,animate:!1}):h.createElement(Je,null,Xe.toLanguageString(v,w[v])),s&&h.createElement(i.WatermarkOverlay,{message:l})))),Ie&&(()=>{const e=g.filterable?h.createElement(E,{value:void 0===g.filter?ye:g.filter,ref:j,onChange:je,onKeyDown:Ke,size:"large",rounded:st,fillMode:it,placeholder:O}):null,t={title:g.adaptiveTitle||L,subTitle:g.adaptiveSubtitle,expand:ge,onClose:e=>we(e),windowWidth:fe,mobileFilter:e};return h.createElement(Q,{...t},h.createElement(u.ActionSheetContent,null,I.length>0?h.createElement(p.TreeView,{id:C,ref:Z,tabIndex:A,data:Ze,focusIdField:k,textField:g.textField,selectField:z,expandField:g.expandField,childrenField:_,expandIcons:!0,onItemClick:Ue,onExpandChange:Ge,size:"large",item:g.item,dir:ue,animate:!1}):h.createElement(Je,null,Xe.toLanguageString(v,w[v]))))})());return L?h.createElement(n.FloatingLabel,{label:L,editorValue:ae,editorPlaceholder:O,editorValid:et,editorDisabled:M,editorId:b,style:{width:D?D.width:void 0},children:nt,dir:ue}):nt}),Ue={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,adaptiveSubtitle:s.string,adaptive:s.bool};Ae.displayName="KendoReactDropDownTree",Ae.propTypes=Ue;const{sizeMap:$e,roundedMap:Ge}=i.kendoThemeMaps,je=e=>e.split("_").map(e=>parseInt(e,10)),Ye={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:void 0,rounded:void 0,fillMode:void 0,required:!1,validityStyles:!0},Ze=i.createPropsContext(),Je=h.forwardRef((e,t)=>{var s;const a=i.usePropsContext(Ze,e),l=!i.validatePackage(J,{component:"MultiSelectTree"}),d=i.getLicenseMessage(J),c=i.useId(),g=a.id||c,m=`${g}-treeview`,{data:f=[],dataItemKey:b,style:y={},placeholder:C,label:x,name:k,validationMessage:S,valid:D,tags:F,value:K,opened:M,disabled:N,popupSettings:T=Ye.popupSettings,checkField:O=Ye.checkField,checkIndeterminateField:L=Ye.checkIndeterminateField,subItemsField:B=Ye.subItemsField,size:_=Ye.size,rounded:H=Ye.rounded,fillMode:V=Ye.fillMode,required:q=Ye.required,validityStyles:W=Ye.validityStyles,onOpen:A=i.noop,onClose:U=i.noop}=a,$=i.getTabIndex(a.tabIndex,N),G=h.useRef(null),j=h.useRef(null),Y=h.useRef(null),Z=h.useRef(null),X=h.useRef(null),ee=h.useRef(null),te=h.useRef(!1),se=h.useRef([]),ne=h.useRef(null),[ae,oe]=h.useState(),[le,re]=h.useState(!1),[de,ue]=h.useState(!1),[pe,ce]=h.useState(),[he,ge]=h.useState([]),[ve,me]=h.useState(""),fe=void 0!==M?M:le,be=!(!Array.isArray(K)||!K.length),Ce=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:S,valid:D,required:q},be),xe=i.useRtl(j,a.dir),Ie={width:Le(j,Ye,T,y),...void 0!==xe?{direction:xe}:{}},ke=h.useCallback(()=>j.current&&j.current.focus(),[]),Se=i.useAdaptiveModeContext(),we=!!(pe&&Se&&pe<=Se.medium&&a.adaptive);se.current=void 0===F?(K||[]).map(e=>({text:P(e,a.textField),data:[e]})):[...F],h.useImperativeHandle(G,()=>({props:a,element:j.current,focus:ke})),h.useImperativeHandle(t,()=>G.current);const Ee=h.useCallback(()=>{X.current&&X.current.setCustomValidity&&X.current.setCustomValidity(Ce.valid?"":void 0===S?"Please select a value from the list!":S)},[S,Ce]);h.useEffect(Ee),h.useEffect(()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}},[]),h.useEffect(()=>{ne.current&&fe&&ne.current.setPosition(ne.current.element)},[K,fe]);const De=h.useCallback((e,t,s)=>{if(a.onChange){const i={items:t,operation:s,...e};a.onChange.call(void 0,i)}},[a.onChange]),Fe=h.useCallback(e=>{if(R(e.item,K,b)||!G.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,n={syntheticEvent:i,nativeEvent:s,target:G.current};De(n,[t],"toggle")},[K,b,De]),Ke=h.useCallback(e=>{if(!fe){if(A){const t={...e};A.call(void 0,t)}void 0===M&&(re(!0),ge(K||[]),we&&setTimeout(()=>{var e;Te(null==(e=Z.current)?void 0:e.element)},300))}},[fe,M,A,we,Z]),Me=h.useCallback(e=>{if(fe){if(U){const t={...e};U.call(void 0,t)}void 0===M&&re(!1)}},[fe,M,U]),Ne=h.useCallback(e=>{te.current=!0,e(),window.setTimeout(()=>te.current=!1,0)},[]),Te=h.useCallback(e=>{e&&Ne(()=>e.focus())},[Ne]),Pe=h.useCallback(()=>{var e;!de&&fe?Me({target:G.current}):a.filterable?Te(null==(e=Y.current)?void 0:e.element):Te(ee.current&&ee.current.element)},[de,fe,Te,Me,a.filterable]),Oe=h.useCallback(()=>{de&&Te(j.current)},[de,Te]),Re=h.useCallback(e=>{if(!de&&!te.current&&(ue(!0),a.onFocus&&G.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};a.onFocus.call(void 0,t)}},[de,a.onFocus]),ze=h.useCallback(e=>{if(de&&!te.current&&G.current){ue(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};if(a.onBlur){const e={...t};a.onBlur.call(void 0,e)}we||Me(t)}},[de,a.onBlur,fe,M,U]),_e=h.useCallback(()=>{de&&Ne(i.noop)},[de,Ne]),He=h.useCallback(e=>{if(!e.isDefaultPrevented()&&G.current){ue(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};fe||Ke(t)}},[fe,Ke]),Ve=h.useCallback(e=>{var t,s;const{keyCode:n,altKey:a}=e,o=ee.current&&ee.current.element;if(!G.current||e.isDefaultPrevented()&&(null==(t=Y.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};if(K&&K.length>0&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete)){const e=se.current;let t,s=ae?e.findIndex(e=>z(e,ae,b)):-1;const a=-1!==s;n===i.Keys.left?(s=a?Math.max(0,s-1):e.length-1,t=e[s]):n===i.Keys.right?s===e.length-1?t=void 0:a&&(s=Math.min(e.length-1,s+1),t=e[s]):n===i.Keys.home?t=e[0]:n===i.Keys.end?t=e[e.length-1]:n===i.Keys.delete&&a&&De(l,e[s].data,"delete"),t!==ae&&oe(t)}if(fe)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),Me(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===i.Keys.up&&null!=(s=Y.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 Ne(()=>{var e;Te(null==(e=Y.current)?void 0:e.element)})}Ne(i.noop)}else n===i.Keys.down&&Ne(()=>{var e;Te((null==(e=Y.current)?void 0:e.element)||o)});else a&&n===i.Keys.down&&(e.preventDefault(),Ke(l))},[fe,Me,Te,Ne,Ke,ae,b,K,De]),qe=h.useCallback(e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Ne(t===i.Keys.up?()=>{Te(j.current)}:()=>{Te(ee.current&&ee.current.element)}))},[Te,Ne]),We=h.useCallback(e=>{if(!G.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};De(t,[],"clear"),Me(t),e.preventDefault()},[De,Me]),Ae=h.useCallback((e,t)=>{var s;Me({target:G.current}),de||Te(null==(s=Y.current)?void 0:s.element),De({syntheticEvent:t,nativeEvent:t.nativeEvent,target:G.current},e,"delete")},[De,Me,Te,de]),Ue=h.useCallback(e=>{if(a.onExpandChange&&G.current){const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,o={level:je(s),item:t,nativeEvent:i,syntheticEvent:n,target:G.current};a.onExpandChange.call(void 0,o)}},[a.onExpandChange]),Je=h.useCallback(e=>{if(a.onFilterChange&&G.current){const t={filter:{field:a.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:G.current};a.onFilterChange.call(void 0,t),void 0===a.filter&&me(e.target.value)}},[a.onFilterChange,a.filter,a.textField]);h.useCallback(e=>{if(!G.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};a.onCancel&&a.onCancel.call(void 0,t),Me(t),e.preventDefault()},[a.onCancel,Me]);const Qe=h.useCallback(e=>{for(const t of e)ce(t.target.clientWidth)},[]),Xe=a.listNoData||Be,et=r.useLocalization(),tt=!W||Ce.valid,st=we&&fe?he:se.current,it=null!=(s=a.ariaDescribedBy)?s:st.length>0?"tagslist-"+g:void 0,nt=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-multiselecttree k-input",a.className,{[`k-input-${$e[_]||_}`]:_,[`k-rounded-${Ge[H]||H}`]:H,[`k-input-${V}`]:V,"k-focus":de&&!N,"k-invalid":!tt,"k-disabled":N,"k-loading":a.loading,"k-required":q}),tabIndex:$,accessKey:a.accessKey,id:g,style:x?{...y,width:void 0}:y,dir:xe,ref:j,onKeyDown:N?void 0:Ve,onMouseDown:_e,onFocus:e=>{we?He(e):Re(e)},onBlur:ze,"aria-disabled":N||void 0,"aria-labelledby":a.ariaLabelledBy,onClick:N?void 0:He},h.createElement("div",{id:"tagslist-"+g,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${$e[_]||_}`]:_}),role:"listbox","aria-label":et.toLanguageString(I,w[I]),"aria-orientation":"horizontal"},st.length>0&&h.createElement(ye,{tag:a.tag,onTagDelete:Ae,data:st,guid:g,focused:ae?se.current.find(e=>z(e,ae,b)):void 0,size:_})),h.createElement("span",{className:"k-input-inner",role:"combobox","aria-haspopup":"tree","aria-expanded":fe,"aria-autocomplete":"list","aria-label":a.ariaLabel||x,"aria-controls":fe?m:void 0,"aria-describedby":it,"aria-disabled":!!N||void 0,"aria-required":q||void 0,tabIndex:0},0===st.length&&h.createElement("span",{className:"k-input-value-text"},C)),a.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),be&&!N&&st.length>0&&h.createElement(ie,{onClick:We}),h.createElement("select",{name:k,ref:X,tabIndex:-1,"aria-hidden":!0,title:x,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:a.valueMap?a.valueMap.call(void 0,K):K})),!we&&h.createElement(o.Popup,{...T,popupClass:i.classNames(T.popupClass,"k-multiselecttree-popup"),className:i.classNames(T.className,{"k-rtl":"rtl"===xe}),style:Ie,anchor:T.anchor||j.current,show:fe,onOpen:Pe,onClose:Oe,ref:ne},a.filterable&&h.createElement(E,{value:void 0===a.filter?ve:a.filter,ref:Y,onChange:Je,onKeyDown:qe,tabIndex:$,size:_,rounded:H,fillMode:V,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),f.length>0?h.createElement(p.TreeView,{id:m,style:{height:T.height},animate:!1,ref:ee,tabIndex:$,data:f,focusIdField:b,textField:a.textField,checkField:O,checkIndeterminateField:L,expandField:a.expandField,childrenField:B,expandIcons:!0,onItemClick:Fe,onCheckChange:Fe,onExpandChange:Ue,checkboxes:!0,size:_,item:a.item,dir:xe}):h.createElement(Xe,null,et.toLanguageString(v,w[v])),l&&h.createElement(i.WatermarkOverlay,{message:d}))),we&&(()=>{const e=a.filterable?h.createElement(E,{value:void 0===a.filter?ve:a.filter,ref:Z,onChange:Je,onKeyDown:qe,size:"large",rounded:H,fillMode:V,placeholder:C}):null,t={title:a.adaptiveTitle||a.label,subTitle:a.adaptiveSubtitle,expand:fe,onClose:e=>Me(e),windowWidth:pe,mobileFilter:e};return h.createElement(Q,{...t},h.createElement(u.ActionSheetContent,null,f.length>0?h.createElement(p.TreeView,{id:m,ref:ee,animate:!1,tabIndex:$,data:f,focusIdField:b,textField:a.textField,checkField:O,checkIndeterminateField:L,expandField:a.expandField,childrenField:B,expandIcons:!0,onItemClick:Fe,onCheckChange:Fe,onExpandChange:Ue,checkboxes:!0,size:"large",item:a.item,dir:xe}):h.createElement(Xe,null,et.toLanguageString(v,w[v]))))})());return x?h.createElement(n.FloatingLabel,{label:x,editorValue:be,editorPlaceholder:C,editorValid:tt,editorDisabled:N,editorId:g,style:{width:y?y.width:void 0},children:nt,dir:xe}):nt}),Qe={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,adaptiveSubtitle:s.string,adaptive:s.bool};Je.displayName="KendoReactMultiSelectTree",Je.propTypes=Qe;const Xe=(e,t)=>{const s={};return e&&e.length&&e.forEach(e=>{s[t(e)]=!0}),s},et=de,tt=me,st=Ke;e.AutoComplete=tt,e.AutoCompletePropsContext=ge,e.AutoCompleteWithoutContext=he,e.ComboBox=et,e.ComboBoxPropsContext=le,e.ComboBoxWithoutContext=oe,e.DropDownList=X,e.DropDownListPropsContext=te,e.DropDownTree=Ae,e.DropDownTreePropsContext=We,e.List=U,e.ListContainer=g,e.ListFilter=E,e.ListItem=W,e.MultiColumnComboBox=Te,e.MultiColumnComboBoxPropsContext=Ne,e.MultiSelect=st,e.MultiSelectPropsContext=De,e.MultiSelectTree=Je,e.MultiSelectTreePropsContext=Ze,e.MultiSelectWithoutContext=Ee,e.SearchBar=se,e.TagList=ye,e.dropDownListDefaultProps=ee,e.dropdownsMessages=w,e.findByFieldValue=(e,t,s)=>{if(!e)return;const i=e.findIndex(e=>P(e,t)===s);return e[i]},e.getItemValue=P,e.getMultiSelectTreeValue=(e,t)=>{const{items:s,dataItemKey:n,value:a,subItemsField:o="items",operation:l}=t,r=i.getter(n),d=Xe(a,r);if("clear"===l)return[];if("delete"===l){const e=Xe(s,r);return a.filter(t=>!e[r(t)])}const u=s[0],p=r(u),c=i.getter(o),h=[...e],g=[];let v,m=[];for(;h.length;){const e=h.pop();if(p===r(e)){m=g.map(e=>e.item),v=e;break}{g&&g.length&&g[g.length-1].parentPosition===h.length&&g.pop();const t=c(e);t&&t.length&&(g.push({item:e,parentPosition:h.length}),h.push(...t))}}const f=[...c(v)||[]],b=[];for(;f.length;){const e=f.pop();b.push(e);const t=c(e);t&&t.length&&f.push(...t)}const y=[];if(!d[p]){y.push(...a),y.push(v),y.push(...b.filter(e=>!d[r(e)]));const e=m.filter(e=>!d[r(e)]),t=Xe(y,r);for(let s=e.length-1;s>-1;s--){const i=e[s],n=c(i);if(n.filter(e=>t[r(e)]).length<n.length)break;y.push(i),t[r(i)]=!0}}else{const e=r(v),t=Xe(b,r),s=Xe(m,r);y.push(...a.filter(i=>{const n=r(i);return!t[n]&&e!==n&&!s[n]}))}return y},e.getValueMap=Xe,e.nodata=v,e.scrollToItem=M});
15
+ !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,n,a,o,l,r,d,u,p){"use strict";function c(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 h=c(t);const g=e=>{const{children:t,width:s,dir:n,itemsCount:a,popupSettings:l}=e,r=h.useContext(i.ZIndexContext),d=r?r+2e3:12e3;return h.createElement(i.ZIndexContext.Provider,{value:d},h.createElement(o.Popup,{style:{width:s,direction:n},contentKey:a&&a.join(),...l},t))},v="dropdowns.nodata",m="dropdowns.clear",f="dropdowns.comboArrowBtnAriaLabelExpand",b="dropdowns.comboArrowBtnAriaLabelCollapse",y="dropdowns.dropDownListArrowBtnAriaLabel",C="dropdowns.dropDownListAdaptiveFilterPlaceholder",x="dropdowns.listFilterAriaLabel",I="dropdowns.chipListAriaLabel",k="dropdowns.autoCompleteListAriaLabel",S="dropdowns.listAriaLabel",w={[m]:"clear",[v]:"NO DATA FOUND.",[f]:"expand combobox",[b]:"collapse combobox",[y]:"select",[C]:"Filter",[x]:"Search",[I]:"chip list",[k]:"Suggestions",[S]:"Options"},E=h.forwardRef((e,t)=>{const s=h.useRef(null),{renderListFilterWrapper:n=!1,renderPrefixSeparator:o=!1,placeholder:d,...u}=e,p=r.useLocalization(),c=i.useUnstyled(),g=c&&c.uDropDownsBase;h.useImperativeHandle(t,()=>s.current);const v=h.createElement(l.TextBox,{...u,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:g})),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:()=>h.createElement(h.Fragment,null,h.createElement(l.InputPrefix,null,h.createElement(i.IconWrap,{name:"search",icon:a.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:g}))})),o&&h.createElement(l.InputSeparator,null)),placeholder:d,"aria-label":p.toLanguageString(x,w[x])});return n?h.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:g}))}," ",v," "):v});E.propTypes={value:s.oneOfType([s.string,s.number,s.array]),tabIndex:s.number,onChange:s.func,onKeyDown:s.func,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","full","none"]),fillMode:s.oneOf(["solid","flat","outline"]),renderListFilterWrapper:s.bool,placeholder:s.string,renderPrefixSeparator:s.bool},E.displayName="KendoReactListFilter";const D=e=>{const{group:t,render:s}=e,n=i.useUnstyled(),a=n&&n.uDropDownsBase,o=h.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:a}))},h.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:a}))},t));return void 0!==s?s(o,e):o},F=e=>null!=e,K=(e,t,s)=>{if(!F(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},M=(e,t,s,i,n)=>{const a=e.offsetHeight,o=e.querySelectorAll('[role="option"]')[s]||t.children.item(s);if(!o)return;const l=o.offsetTop+(n?i-e.scrollTop:0),r=o.offsetHeight;if(n){let t=0;l+r>a?t=l+r-a:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>a+e.scrollTop?e.scrollTop=l+r-a:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},N=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let n=0;n<e.length;n++){const a=(P(e[n],s)||"")+"";if(a&&a.toLowerCase().startsWith(t)){i=n;break}}}return i},T=(e,t,s,i=!1,n=!1)=>{const a=e=>n||!i?e.toLowerCase():e;return e.findIndex(e=>s?a(P(e,s))===a(t):a(t)===a(e.toString()))},P=(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},O=(e,t,s)=>{t.forEach(t=>{const i=e.findIndex(e=>R(e,t,s));-1!==i&&e.splice(i,1)})},R=(e,t,s)=>e===t||F(e)===F(t)&&P(e,s)===P(t,s),L=(e,t,s)=>{if(t){const i=T(e,t,s,!0);return-1!==i?e[i]:e[N(e,t,s)]}return e[0]},B=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},z=(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(!R(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),_=e=>{const{data:t=[],groupField:s}=e;return s?t.filter(e=>s&&void 0!==e[s]):t},H=e=>e.preventDefault(),V=e=>{const{selected:t,defaultItem:s,textField:n}=e,a=i.useUnstyled(),o=a&&a.uDropDownsBase;return h.createElement("div",{onClick:e.onClick,onMouseDown:H,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionLabel({c:o,selected:t}))},P(s,n)||"")},q=({icon:e,svgIcon:t})=>t||e?h.createElement("span",{className:"k-list-item-icon-wrapper",role:"presentation"},h.createElement(i.IconWrap,{className:"k-list-item-icon",name:e?i.toIconName(e):void 0,icon:t,"aria-hidden":"true"})):null,W=e=>{const{selected:t,dataItem:s,virtual:n,disabled:a,id:o,focused:r,render:d,actionsField:u,descriptionField:p,iconField:c,svgIconField:g,checkboxField:v}=e,m=i.useUnstyled(),f=m&&m.uDropDownsBase,b=h.createElement("li",{id:o,role:"option","aria-selected":t,"aria-disabled":!!a||void 0,className:i.classNames(i.uDropDownsBase.li({c:f,selected:t,focused:r,disabled:a})),onClick:t=>e.onClick(e.index,t),style:{position:n?"relative":"unset"}},(()=>{if(!v)return null;const e=P(s,v)||!1;return h.createElement("span",{className:"k-checkbox-wrap"},h.createElement(l.Checkbox,{checked:e,onChange:e=>{s.onCheckboxChange&&s.onCheckboxChange(s,e.value)}}))})(),(g||c)&&h.createElement(q,{icon:c?P(s,c):void 0,svgIcon:g?P(s,g):void 0}),h.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:f}))},P(s,e.textField).toString()),u?P(s,u):null,(()=>{if(!p)return null;const e=P(s,p);return e?h.createElement("span",{className:"k-list-item-description"},e):null})());return void 0!==d?d(b,e):b},A=e=>{const{group:t,virtual:s,render:n,isMultiColumn:a=!1,id:o,iconField:l,svgIconField:r,groupItem:d}=e,u=i.useUnstyled(),p=u&&u.uDropDownsBase,c=h.createElement("li",{id:o,role:"presentation",className:i.classNames(i.uDropDownsBase.groupLi({c:p,isMultiColumn:a})),style:a?{boxSizing:"inherit",position:s?"relative":"unset"}:{position:s?"relative":"unset"}},(r||l)&&h.createElement(q,{icon:l?null==d?void 0:d.groupIcon:void 0,svgIcon:r?null==d?void 0:d.groupSvgIcon:void 0}),h.createElement("span",{className:n?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:p,isMultiColumn:a}))},t));return void 0!==n?n(c,e):c},U=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,{id:a,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:u,listRef:p,wrapperRef:c,listClassName:g,ariaLabel:m,ariaSetSize:f,actionsField:b,descriptionField:y,iconField:C,svgIconField:x,checkboxField:I}=e,k=(()=>{const{textField:t,valueField:s,groupField:i,isMultiColumn:n,optionsGuid:a,skip:o=0,virtual:l,focusedIndex:r,hasDuplicates:d,highlightSelected:u=!0,value:p,data:c,itemRender:g,groupHeaderItemRender:v}=e,m=Array.isArray(p);let f=0;return c.map((k,S)=>{const w=o+S,E=o+S+f,D=d?!!p&&r===S:!k.disabled&&(u&&(!m&&R(k,p,s)||m&&-1!==p.findIndex(e=>R(e,k,s))));let F,K,M;void 0!==i&&(K=P(k,i),0===S&&e.showFirstGroupHeader&&K?F=K:S>0&&(M=P(c[S-1],i),K&&M&&K!==M&&(F=K)));const N=void 0!==F;return void 0!==F&&(f+=1),[N&&h.createElement(A,{id:`k-${a}-item-${E+1}`,virtual:l,key:w+"-group-item",group:F,isMultiColumn:n,render:v,iconField:C,svgIconField:x,groupItem:k}),h.createElement(W,{id:`k-${a}-item-${(N?E+1:E)+1}`,virtual:l,dataItem:k,selected:D,focused:r===S,index:w,key:w,onClick:e.onClick,textField:t,group:F,render:g,disabled:k.disabled,actionsField:b,descriptionField:y,iconField:C,svgIconField:x,checkboxField:I})]})})();return k.length?h.createElement("div",{className:l,style:d,ref:c,role:e.groupField?"listbox":void 0,"aria-label":e.groupField?m:void 0,"aria-hidden":!(!e.groupField||o)||void 0,"aria-setsize":e.groupField?f:void 0,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},(()=>{if(!e.groupField)return h.createElement("ul",{id:a,role:"listbox","aria-label":m,"aria-hidden":!o||void 0,"aria-setsize":f,className:g||i.classNames(i.uDropDownsBase.ul({c:n})),ref:p,style:u},k);const t=[];let s=[];return k.forEach(e=>{Array.isArray(e)&&e.forEach(e=>{e&&e.type===A?(s.length>0&&t.push(s),s=[e]):e&&s.push(e)})}),s.length>0&&t.push(s),t.map(e=>{var t;const s=e.find(e=>h.isValidElement(e)&&e.type===A),o=null==(t=null==s?void 0:s.props)?void 0:t.id;return h.createElement("ul",{id:o?void 0:a,key:o||"first-group",role:"group","aria-labelledby":o,className:g||i.classNames(i.uDropDownsBase.ul({c:n})),ref:o?void 0:p,style:u},e)})})(),e.scroller&&h.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:n}))},e.scroller)):(()=>{const s=e.noDataRender,a=h.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:n})),"aria-live":"polite"},h.createElement("div",null,t.toLanguageString(v,w[v])));return s?s(a):a})()},$="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);class G{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(h.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=$?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)),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&&($||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,n=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let a=this.rowHeightService.index(t),o=this.rowHeightService.offset(a);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=a+this.pageSize-this.total;t>0&&(a-=t,o=this.rowHeightService.offset(a)),this.firstLoaded=a,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&a-1<=this.firstLoaded){const t=n===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(a-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}}let j=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 Y=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new G,this.navigation=new j,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,n,a,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,u=null==(n=null==(i=this.list)?void 0:i.parentElement)?void 0:n.offsetHeight;void 0!==r&&void 0!==u&&(null==(o=null==(a=this.list)?void 0:a.parentElement)||o.scroll({top:r+e*Math.floor(u/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&h.createElement("div",{ref:t=>{e.scrollElement=t},key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({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 n=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),n=!0),n&&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,n=s.container||i.parentNode,a=void 0!==t?t:s.enabled;M(n,i,e,s.translate,a)}}updateComponentArgs(e){for(const t in e)Object.hasOwnProperty.call(e,t)&&(this.component[t]=e[t])}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 n=Math.min(Math.max(0,t),Math.max(0,i.total-s));n!==i.skip&&e.events.push({type:"onPageChange",page:{skip:n,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:n,virtual:a}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&a&&this.vs.enabled&&(a.skip>0&&R(e,i[0],n)?this.triggerOnPageChange(t,a.skip-1,a.pageSize):!o&&a.skip+a.pageSize<a.total&&R(e,i[i.length-1],n)&&this.triggerOnPageChange(t,a.skip+1,a.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,n)=>{e[n-1]&&i[t]!==e[n-1][t]&&s.push({[t]:i[t]}),s.push(e[n])}),s}};Y.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},Y.propTypes={...Y.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},Y.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let Z=Y;const J=Object.freeze({name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1654528156,version:"14.5.0-develop.16",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"}),Q=e=>{const{footer:t,windowWidth:s=0,mobileFilter:n,children:o,navigatable:l,navigatableElements:r,expand:p,animation:c,title:g,subTitle:v,onClose:m}=e,f=i.useAdaptiveModeContext(),b={navigatable:l||!1,navigatableElements:r||[],expand:p,animation:!1!==c,suffixActions:h.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:a.checkIcon,onClick:m}),filter:n,onClose:m,animationStyles:f&&s<=f.small?{top:0,width:"100%",height:"100%"}:void 0,title:g,subTitle:v,className:"k-adaptive-actionsheet",position:f&&s<=f.small?"fullscreen":void 0,appendTo:i.canUseDOM?document.body:null};return h.createElement(u.ActionSheet,{...b},o,t&&h.createElement(u.ActionSheetFooter,{className:"k-actions k-actions-stretched"},h.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),h.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},X=h.forwardRef((e,t)=>{var s;let o=!1;const l=i.getLicenseMessage(J),p=i.usePropsContext(te,e),{delay:c=ee.delay,tabIndex:v=ee.tabIndex,ignoreCase:m=ee.ignoreCase,size:f=ee.size,rounded:b=ee.rounded,fillMode:x=ee.fillMode}=p;if(p.filterable||p.virtual){const e=[];p.filterable&&e.push("filterable"),p.virtual&&e.push("virtualization"),o=!i.validatePackage(J,{component:"DropDownList",features:e})}const I=i.useUnstyled(),k=i.useId(p.id),M=()=>{var e;if(i.canUseDOM)return(null==(e=ye.current)?void 0:e.ownerDocument)||window.document},O=()=>{var e,t;null!=(e=null==Me?void 0:Me.current)&&e.wrapper&&(null==(t=null==Me?void 0:Me.current)||t.wrapper.focus({preventScroll:!0}))},L=()=>{let e;return void 0!==we.current&&null!==we.current?e=we.current:void 0!==p.value?e=p.value:void 0!==Pe.value&&null!==Pe.value?e=Pe.value:void 0!==p.defaultValue&&null!==p.defaultValue&&(e=p.defaultValue),!F(e)&&void 0!==p.defaultItem&&null!==p.defaultItem&&(e=p.defaultItem),e},B=()=>void 0!==p.required?p.required:ee.required,z=()=>{const e=void 0!==p.validationMessage,t=L(),s=!B()||null!==t&&""!==t&&void 0!==t;return{customError:e,valid:void 0!==p.valid?p.valid:s,valueMissing:null===t}},H=e=>{Se.current=!0,e.focus(),window.setTimeout(()=>Se.current=!1,30)},q=()=>{xe.current&&H(xe.current),p.adaptive&&setTimeout(()=>{xe.current&&H(xe.current)},300)},W=h.useCallback(e=>{for(const t of e)Le(t.target.clientWidth)},[]),A=()=>{var e;null!=(e=Ce.current)&&e.setCustomValidity&&Ce.current.setCustomValidity(z().valid?"":p.validationMessage||"Please select a value from the list!")},$=(e,t)=>{const s=L();R(s,e,p.dataItemKey)||(void 0===p.value&&(t.data.value=e),Me.current.updateComponentArgs({value:e}),we.current=e,t.events.push({type:"onChange"}))},G=e=>{var t;null==(t=null==Me?void 0:Me.current)||t.applyState(e),we.current=void 0},j=(e,t)=>{var s;const{virtual:i,dataItemKey:n,defaultItem:a}=p,o=_(p),l=i?i.skip:0,r=L(),d=-1===e&&void 0!==a?a:o[e-l],u=!R(d,r,n);$(d,t),u&&(null==(s=null==Me?void 0:Me.current)||s.triggerPageChangeCornerItems(d,t))},Y=(e,t,s)=>{var i,n;const{defaultItem:a,dataItemKey:o,virtual:l={skip:0,total:0,pageSize:0}}=p,r=L(),d=_(p),u=null==(i=null==Me?void 0:Me.current)?void 0:i.vs,c=d.findIndex(e=>R(e,r,o)),h=null==(n=null==Me?void 0:Me.current)?void 0:n.navigation.navigate({current:l.skip+c,max:(null!=u&&u.enabled?l.total:d.length)-1,min:void 0!==a?-1:0,keyCode:t,skipItems:s||void 0});void 0!==h&&j(h,e),G(e)},X=()=>{const{textField:e,dataItemKey:t,virtual:s={skip:0},focusedItemIndex:i=N,filterable:n,skipDisabledItems:a=!0}=p,o=L(),l=_(p),r=p.filter?p.filter:Pe.text;return a&&e&&!r&&!o?l.findIndex(e=>!e.disabled):F(o)&&void 0===r||n&&""===r?l.findIndex(e=>R(e,o,t)):r?De.current?i(l,r,e):l.findIndex(e=>R(e,o,t)):0===s.skip?0:-1},se=(e,t)=>void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled,ie=()=>{const e=_(p),t=Me.current.initState(),s=X();se(e,s)&&($(null,t),G(t))},ne=e=>{if(e.isPropagationStopped())return;const t=Me.current.initState();t.syntheticEvent=e,Pe.focused||(t.data.focused=!0),ie(),Me.current.togglePopup(t),G(t)},ae=e=>{var t,s,n,a,o,l,r;e&&e.target instanceof Element&&"INPUT"===e.target.nodeName&&e.stopPropagation&&e.stopPropagation();const{filterable:d,disabled:u,defaultItem:c,leftRightKeysNavigation:h=!0,virtual:g={skip:0,total:0,pageSize:0},dataItemKey:v,groupField:m="",textField:f,skipDisabledItems:b=!0}=p,y=_(p),C=L(),x=y.findIndex(e=>R(e,C,v)),I=void 0!==p.opened?p.opened:Pe.opened,k=e.keyCode,S=k===i.Keys.home||k===i.Keys.end,w=k===i.Keys.up||k===i.Keys.down,E=!I&&(e.altKey&&k===i.Keys.down||k===i.Keys.enter||k===i.Keys.space),D=I&&(e.altKey&&k===i.Keys.up||k===i.Keys.esc),F=h&&(k===i.Keys.left||k===i.Keys.right),K=w||F&&!d||S,M=Me.current.initState();if(M.syntheticEvent=e,!u){if(S&&null!=(t=null==Me?void 0:Me.current)&&t.vs.enabled)k===i.Keys.home?0!==g.skip?(null==(s=null==Me?void 0:Me.current)||s.triggerOnPageChange(M,0,g.pageSize),Ee.current=!0):$(y[0],M):g.skip<g.total-g.pageSize?(null==(n=null==Me?void 0:Me.current)||n.triggerOnPageChange(M,g.total-g.pageSize,g.pageSize),Ee.current=!0):$(y[y.length-1],M);else if(I&&k===i.Keys.pageUp)e.preventDefault(),null==(a=null==Me?void 0:Me.current)||a.scrollPopupByPageSize(-1);else if(I&&k===i.Keys.pageDown)e.preventDefault(),null==(o=null==Me?void 0:Me.current)||o.scrollPopupByPageSize(1);else if(I&&k===i.Keys.enter){const t=X();se(y,t)?($(null,M),G(M)):j(t,M),null==(l=null==Me?void 0:Me.current)||l.togglePopup(M),e.preventDefault()}else if(E||D)D&&ie(),null==(r=null==Me?void 0:Me.current)||r.togglePopup(M),e.preventDefault();else if(K){if(De.current=!1,""!==m&&f)if(!b&&I)Y(M,k);else{let e;if(k===i.Keys.down||k===i.Keys.right){const t=y.slice(x+1).find(e=>!e.disabled);e=t&&y.indexOf(t)}else if(k===i.Keys.up||k===i.Keys.left){let t;if(0===x&&c)e=-1;else if(-1===x)t=y,e=y.findIndex(e=>!e.disabled);else{t=y.slice(0,x);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&y.indexOf(s)}}if(void 0!==e){Y(M,k,e-x)}else void 0===e&&x===y.length-1&&Y(M,k)}else if(!b&&I||S)Y(M,k);else if(f){let e;if(k===i.Keys.down||k===i.Keys.right){const t=y.slice(x+1).find(e=>!e.disabled);e=t&&y.indexOf(t)}else if(k===i.Keys.up||k===i.Keys.left){let t;if(0===x&&c)e=-1;else if(-1===x)t=y,e=y.findIndex(e=>!e.disabled);else{t=y.slice(0,x);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&y.indexOf(s)}}if(void 0!==e){Y(M,k,e-x)}else void 0===e&&x===y.length-1&&Y(M,k)}else Y(M,k);e.preventDefault()}G(M)}},oe=e=>{const t=Me.current.initState();t.syntheticEvent=e.syntheticEvent,void 0===p.filter&&(t.data.text=e.target.value),Me.current.filterChanged(e.target.value,t),De.current=!0,G(t),Ve({group:void 0,text:String(e.target.value)})},le=e=>{const t=void 0!==p.filter?p.filter:Pe.text;return p.filterable&&h.createElement(E,{value:t,ref:e=>{xe.current=e&&e.element},onChange:oe,onKeyDown:ae,size:e?"large":f,rounded:b,fillMode:x,renderListFilterWrapper:!0,placeholder:ze.toLanguageString(C,w[C])})},re=e=>{var t;const s=Me.current.initState();s.syntheticEvent=e,null==(t=null==Me?void 0:Me.current)||t.togglePopup(s),$(p.defaultItem,s),G(s)},de=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=p,i=L();return void 0!==t&&h.createElement(V,{defaultItem:t,textField:e,selected:R(i,t,s),key:"defaultitemkey",onClick:re})},ue=(e,t)=>{var s;null==(s=null==Me?void 0:Me.current)||s.handleItemClick(e,t),we.current=void 0},pe=e=>{const{vs:t,list:s}=Me.current;t.scrollHandler(e);const{groupField:i}=p;let n=_(p);if(i&&n.length&&i){const a=Ne.current=Ne.current||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=Me.current.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[e][i]);l!==Pe.group&&Ve({group:l})}},ce=()=>{var e;const{textField:t,dataItemKey:s,virtual:n={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:o,itemRender:l}=p,r=_(p),d=I&&I.uDropDownList,u=Me.current.vs,c=n.skip,g=void 0!==p.opened?p.opened:Pe.opened,v=Me.current.getPopupSettings(),m=`translateY(${u.translate}px)`,f=L();return h.createElement(U,{id:We,show:g,data:r.slice(),focusedIndex:X(),value:f,textField:t,valueField:s,optionsGuid:Ae,groupField:p.groupField,ariaLabel:ze.toLanguageString(S,w[S]),listRef:e=>{u.list=Me.current.list=e},wrapperStyle:{maxHeight:ct?void 0:v.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:d})),listStyle:u.enabled?{transform:m}:void 0,key:"listkey",skip:c,onClick:ue,itemRender:l,groupHeaderItemRender:a,noDataRender:o,onScroll:pe,wrapperRef:u.scrollerRef,scroller:null==(e=null==Me?void 0:Me.current)?void 0:e.renderScrollElement(),ariaSetSize:n.total})},he=()=>{Pe.focused&&window.setTimeout(()=>{Pe.focused&&Me.current.wrapper&&H(Me.current.wrapper)})},ge=e=>{"onMouseDownOutside"in(p.popupSettings||{})&&p.popupSettings.onMouseDownOutside.call(void 0,e)},ve=()=>{const{header:e,footer:t,groupStickyHeaderItemRender:s,groupField:n,list:a}=p,o=_(p),l=I&&I.uDropDownList;let{group:r}=Pe;return void 0===r&&void 0!==n&&(r=P(o[0],n)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:l}))},e),h.createElement("div",{className:i.classNames("k-list",{[`k-list-${ct?"lg":i.sizeMap[f]||f}`]:ct||f})},!a&&r&&0!==o.length&&h.createElement(D,{group:r,render:s}),ce()),t&&h.createElement("div",{className:"k-list-footer"},t))},me=e=>{clearTimeout(Ie.current),p.filterable||(Ie.current=window.setTimeout(()=>ke.current.word="",c),(e=>{const{dataItemKey:t}=p,s=_(p),i=L();let n=s.map((e,t)=>({item:e,itemIndex:t}));const a=ke.current.word,o=ke.current.last,l=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(a,o);let r,d=n.length,u=Math.max(0,s.findIndex(e=>R(e,i,t)));p.defaultItem&&(r={item:p.defaultItem,itemIndex:-1},d+=1,u+=1),u+=l?1:0,n=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(n,u,r);let c,h,g,v=0;const{textField:f}=p;for(;v<d;){if(c=P(n[v].item,f),h=l&&K(c,o,m),g=K(c,a,m),h||g){v=n[v].itemIndex;break}v++}if(v!==d){const t=Me.current.initState();t.syntheticEvent=e,j(v,t),G(t),we.current=void 0}})(e))},fe=()=>{const e=Me.current.initState();e.data.opened=Pe.opened,Me.current.togglePopup(e),G(e)},be=h.useRef(null),ye=h.useRef(null),Ce=h.useRef(null),xe=h.useRef(null);h.useImperativeHandle(be,()=>({get element(){return ye.current},get index(){return(()=>{const{dataItemKey:e}=p,t=_(p),s=L();return t.findIndex(t=>R(t,s,e))})()},get name(){return p.name},get validity(){return z()},get value(){return L()},get focused(){return Pe.focused},get opened(){return Pe.opened},focus:O,props:p,togglePopup:fe})),h.useImperativeHandle(t,()=>be.current),i.useWebMcpRegister("dropdownlist",be,p,p.webMcp);const Ie=h.useRef(null),ke=h.useRef({word:"",last:""}),Se=h.useRef(!1),we=h.useRef(null),Ee=h.useRef(!1),De=h.useRef(!1),Fe=h.useRef({}),Ke=h.useRef({}),Me=h.useRef(new Z({props:p,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Ne=h.useRef(0),Te=h.useRef(null),[Pe,Oe]=h.useState({}),[Re,Le]=h.useState(),[,Be]=h.useReducer(e=>e,!0),ze=r.useLocalization(),_e=p.name||p.id,He=h.useCallback(e=>{if(null==e||!Me.current)return;const t=_(p),{textField:s}=p,i=String(e),n=T(t,i,s,!1,m),a=-1!==n?t[n]:void 0;if(void 0!==a){const e=Me.current.initState();e.syntheticEvent={target:ye.current},$(a,e),G(e)}},[p,m]);i.useKendoPaste(ye,{fieldName:_e,onValueChange:He,enabled:!!_e});const Ve=e=>{Oe({...Pe,...e})};h.useEffect(()=>{Me.current.updateComponentArgs({props:p,setState:Ve,state:Pe,forceUpdate:Be,element:ye.current,handleItemSelect:j,value:L()})},[Ve,Pe,Be,j,L]),h.useEffect(()=>{var e,t,s,i,n,a,o,l,r,d,u,c,h;const{dataItemKey:g,virtual:v,groupField:m="",textField:f}=p,b=_(p),y=Fe.current.virtual?Fe.current.virtual.total:0,C=void 0!==p.opened?p.opened:Pe.opened,x=void 0!==Fe.current.opened?Fe.current.opened:Ke.current.opened,I=!x&&C;if(null==(e=null==Me?void 0:Me.current)||e.didUpdate(),null!=(t=null==Me?void 0:Me.current)&&t.getPopupSettings().animate||I&&q(),v&&v.total!==y)null==(s=null==Me?void 0:Me.current)||s.vs.calcScrollElementHeight(),null==(i=null==Me?void 0:Me.current)||i.vs.reset();else{const e=L(),t=void 0!==Fe.current.value?Fe.current.value:Ke.current.value;let s=b.findIndex(t=>R(t,e,g));""!==m&&e&&f&&(s=null==(a=null==(n=null==Me?void 0:Me.current)?void 0:n.getGroupedDataModernMode(b,m))?void 0:a.map(e=>e[f]).indexOf(e[f]));const i=!R(t,e,g);I&&v?null==(o=null==Me?void 0:Me.current)||o.scrollToVirtualItem(v,s):I&&!v?(q(),b&&0!==b.length&&(null==(l=null==Me?void 0:Me.current)||l.resetGroupStickyHeader(b[0][m],{setState:Ve,group:Pe.group,state:Pe})),null==(r=null==Me?void 0:Me.current)||r.scrollToItem(s)):C&&x&&e&&i&&!Ee.current?null==(u=null==Me?void 0:Me.current)||u.scrollToItem(s,null==(d=null==Me?void 0:Me.current)?void 0:d.vs.enabled):C&&x&&Ee.current&&(Ee.current&&v&&0===v.skip?null==(c=null==Me?void 0:Me.current)||c.vs.reset():Ee.current&&v&&v.skip===v.total-v.pageSize&&(null==(h=null==Me?void 0:Me.current)||h.vs.scrollToEnd()))}Ee.current=!1,Ke.current=Pe,Fe.current=p,A()}),h.useEffect(()=>{var e,t;return Te.current=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(W.bind(void 0)),null==(e=null==Me?void 0:Me.current)||e.didMount(),A(),null!=(t=M())&&t.body&&Te.current&&Te.current.observe(M().body),()=>{var e;null!=(e=M())&&e.body&&Te.current&&Te.current.disconnect()}},[]);const qe=k+"-accessibility-id",We=k+"-listbox-id",Ae=k+"-guid",Ue=ze.toLanguageString(y,w[y]),{style:$e,className:Ge,label:je,dir:Ye,virtual:Ze,adaptive:Je,dataItemKey:Qe,disabled:Xe,loading:et,iconClassName:tt,svgIcon:st,valueRender:it}=p,nt=void 0!==p.opened?p.opened:Pe.opened,at=L(),ot=P(at,p.textField),lt=!(void 0!==p.validityStyles?p.validityStyles:ee.validityStyles)||z().valid,rt=Me.current,dt=rt.vs,ut=I&&I.uDropDownList;dt.enabled=void 0!==Ze;const pt=i.useAdaptiveModeContext(),ct=!!(Re&&pt&&Re<=pt.medium&&p.adaptive);void 0!==Ze&&(rt.vs.skip=Ze.skip,rt.vs.total=Ze.total,rt.vs.pageSize=Ze.pageSize);const ht=_(p),{focused:gt}=Pe,vt=ht.findIndex(e=>R(e,at,Qe)),mt=null!=(s=null==Ze?void 0:Ze.skip)?s:0,ft=nt&&vt>=0?`k-${Ae}-item-${vt+mt+1}`:void 0,bt=h.createElement("span",{id:qe,className:i.classNames(i.uDropDownList.inputInner({c:ut}))},ot&&h.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:ut}))},ot)),yt=void 0!==it?it.call(void 0,bt,at):bt,Ct=h.createElement(h.Fragment,null,h.createElement("span",{ref:e=>{ye.current=e,Me.current.wrapper=e},className:i.classNames(i.uDropDownList.wrapper({c:ut,size:f,rounded:b,fillMode:x,focused:gt,disabled:Xe,invalid:!lt,loading:et,required:B()}),Ge),style:je?{...$e,width:void 0}:$e,dir:Ye,onMouseDown:nt?e=>{"INPUT"!==e.target.nodeName&&(H(Me.current.wrapper),e.preventDefault())}:void 0,onFocus:ct?e=>ne(e):e=>{Se.current||Me.current.handleFocus(e)},onBlur:e=>{if(Se.current||!Pe.focused)return;const t=void 0!==p.opened?p.opened:Pe.opened,s=Me.current.initState();s.syntheticEvent=e,s.data.focused=!1,s.events.push({type:"onBlur"}),t&&ie(),t&&!ct&&Me.current.togglePopup(s),G(s)},tabIndex:i.getTabIndex(v,Xe),accessKey:p.accessKey,onKeyDown:ae,onKeyPress:e=>{if(p.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);m&&(t=t.toLowerCase())," "===t&&e.preventDefault(),ke.current={word:ke.current.word+t,last:ke.current.last+t},me(e)},onClick:Xe?void 0:ne,role:"combobox","aria-required":B()||void 0,"aria-disabled":Xe||void 0,"aria-haspopup":"listbox","aria-expanded":nt||!1,"aria-activedescendant":ft,"aria-label":p.ariaLabel||p.label,"aria-labelledby":p.ariaLabelledBy,"aria-describedby":p.ariaDescribedBy||(nt?qe:void 0),"aria-controls":nt?We:void 0,id:p.id,title:p.title},yt,et&&h.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:ut})),name:"loading"}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":Ue,size:f,fillMode:x,className:i.classNames(i.uDropDownList.inputButton({c:ut})),iconClass:tt,svgIcon:tt?void 0:st||a.chevronDownIcon,onMouseDown:e=>Pe.focused&&e.preventDefault()}),(e=>h.createElement("select",{name:p.name,ref:e=>{Ce.current=e},tabIndex:-1,"aria-hidden":!0,title:p.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:p.valueMap?p.valueMap.call(void 0,e):e})))(at),!ct&&(()=>{const{header:e,footer:t,dir:s,groupField:n,groupStickyHeaderItemRender:a,list:r}=p,d=_(p),u=Me.current,c=u.getPopupSettings(),v=void 0!==p.opened?p.opened:Pe.opened,m=void 0!==c.width?c.width:u.popupWidth,b=I&&I.uDropDownList,y={dir:void 0!==s?s:u.dirCalculated,width:m,popupSettings:{...c,popupClass:i.classNames(c.popupClass,i.uDropDownList.listContainer({c:b,popup:!0})),anchor:c.anchor||ye.current,show:v,onOpen:q,onClose:he,onMouseDownOutside:ge},itemsCount:[d.length]};let{group:C}=Pe;return void 0===C&&void 0!==n&&(C=P(d[0],n)),h.createElement(g,{...y},le(!1),e&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:b}))},e),h.createElement("div",{className:i.classNames(i.uDropDownList.list({c:b,size:f,virtual:Me.current.vs.enabled}))},de(),!r&&C&&0!==d.length&&h.createElement(D,{group:C,render:a}),ce()),t&&h.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:b}))},t),o&&h.createElement(i.WatermarkOverlay,{message:l}))})()),ct&&(()=>{const{groupField:e}=p,t=_(p),s=void 0!==p.opened?p.opened:Pe.opened,n=I&&I.uDropDownList,a={title:p.adaptiveTitle||p.label,subTitle:p.adaptiveSubtitle,expand:s,onClose:e=>ne(e),windowWidth:Re,mobileFilter:le(!0)};let{group:o}=Pe;return void 0===o&&void 0!==e&&(o=P(t[0],e)),h.createElement(Q,{...a},h.createElement(u.ActionSheetContent,null,h.createElement("div",{className:i.classNames(i.uDropDownList.listContainer({c:n,popup:!1}))},ve())))})());return je?h.createElement(n.FloatingLabel,{label:je,editorValue:ot,editorValid:lt,editorDisabled:p.disabled,style:{width:$e?$e.width:void 0},children:Ct}):Ct});X.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};const ee={delay:500,tabIndex:0,ignoreCase:!0,...Z.defaultProps,required:!1,size:void 0,rounded:void 0,fillMode:void 0};X.displayName="KendoReactDropDownList";const te=i.createPropsContext();X.displayName="KendoReactDropDownList";let se=class extends h.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:n,suggestedText:a,focused:o}=this.props,l=this.input,r=t!==n||a!==s,d=r&&t.startsWith(n)&&!(s&&a&&s.endsWith(a)),u=i.getActiveElement(document);o&&l&&u!==l&&l.focus(),a&&r&&!d&&l&&l.setSelectionRange(n.length-a.length,n.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:n,tabIndex:a,accessKey:o,unstyled:l,inputAttributes:r}=this.props,d=l&&l.uDropDownsBase,u={tabIndex:a,accessKey:o},p=h.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:d})),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-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||void 0,"aria-controls":e?this.props.ariaControls:void 0,"aria-autocomplete":this.props.ariaAutoComplete,...Object.assign({},u,r)});return n?n(p):p}};const ie=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,o=t.toLanguageString(m,w[m]);return h.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:n})),onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon}))},ne=i.useCustomComponent,ae=class e extends h.Component{constructor(e){super(e),this.state={},this.base=new Z(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this._skipFocus=!1,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.scrollToFocused=!1,this.showLicenseWatermark=!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.handleKendoPasteValue=e=>{const{data:t,textField:s,allowCustom:i}=this.props;if(!t)return;const n=null!=e?String(e):"",a=T(t,n,s,!1,!0);let o=null;if(-1!==a?o=t[a]:i&&(o=s?{[s]:n}:n),null===o)return;const l=this.base.initState();l.syntheticEvent={target:this._element,currentTarget:this._element,nativeEvent:new Event("change",{bubbles:!0})},void 0!==this.state.text&&(l.data.text=void 0),this.triggerOnChange(o,l),this.applyState(l)},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i}=this.props,n=_(this.props)[e-(s?s.skip:0)],a=this.hasDuplicates||!R(n,this.value,i);this.triggerOnChange(n,t),void 0!==this.state.text&&(t.data.text=void 0),a&&this.base.triggerPageChangeCornerItems(n,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=>{this._skipFocus=!0;const{skipDisabledItems:t,textField:s}=this.props,i=_(this.props),n=this.getFocusedIndex(),a=this.getCurrentValueDisabledStatus(s,i,n),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&a&&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),setTimeout(()=>{this._skipFocus=!1},300)},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=P(this.value,this.props.textField),s=F(e)?e:t;return h.createElement(E,{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,placeholder:this.props.placeholder})},this.listContainerContent=()=>{const{header:e,footer:t,size:s,groupStickyHeaderItemRender:n,groupField:a,list:o,unstyled:l,virtual:r}=this.props,d=_(this.props),u=l&&l.uComboBox;let{group:p}=this.state;return void 0===p&&void 0!==a&&(p=P(d[0],a)),h.createElement("div",{className:i.classNames(i.uComboBox.list({c:u,list:o,size:"large",tableSize:s,virtual:r}))},e&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:u}))},e),!o&&p&&0!==d.length&&h.createElement(D,{group:p,render:n}),this.renderList(),t&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:u}),this.props.footerClassName)},t))},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;this.props.onListScroll&&this.props.onListScroll(e);let n=_(this.props);if(!i||!n.length)return;const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=this.base.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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=_(this.props),n=this.getFocusedIndex(),a=!(-1===n)&&this.getCurrentValueDisabledStatus(s,i,n);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&a&&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:n,groupField:a}=this.props,o=_(this.props),l=this.value,r=Math.max(0,o.findIndex(e=>R(e,l,n))),d=e.keyCode,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();if(p.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==a&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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=t&&o.indexOf(t)}else if(d===i.Keys.up||d===i.Keys.left){let t;if(0===r)t=o,e=o.findIndex(e=>!e.disabled);else{t=o.slice(0,r);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&o.indexOf(s)}}if(void 0!==e){const t=e-r;this.onNavigate(p,d,t)}else void 0===e&&r===o.length-1&&this.onNavigate(p,d)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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(p,d,t)}else this.onNavigate(p,d)}this.applyState(p)}const c=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)},h=this.getFocusedIndex(),g=-1===h,v=!g&&this.getCurrentValueDisabledStatus(s,o,h);u?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?c():d===i.Keys.enter?(e.preventDefault(),(s&&!g&&e.currentTarget.value?o[h][s]:void 0)?!t&&s&&v?this.clearValueOnEnterOrEsc(e):v||this.applyValueOnEnter(e.currentTarget.value,p):this.applyValueOnEnter(e.currentTarget.value,p)):d===i.Keys.esc&&(!t&&s&&v&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,p)):u||d!==i.Keys.esc?e.altKey&&d===i.Keys.down&&c():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,n=i.value;if(this.props.suggest){const e=i.selectionEnd===n.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;F(t)||(t=P(this.value,this.props.textField)||"");const s=t&&t===n,a=t&&t.length>n.length;s||a||!e?this._suggested="":this.suggestValue(n)}void 0===this.props.filter&&(t.data.text=n),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s?this.scrollToFocused=!0:this.base.togglePopup(t),this.base.filterChanged(n,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!")},this.handleFocus=e=>{if(this._skipFocus)return;const t=this.base.initState();t.syntheticEvent=e,this.mobileMode&&!this._skipFocus&&(this._skipFocus=!0,this.base.togglePopup(t),this.applyState(t),setTimeout(()=>{this._skipFocus=!1},300)),this.base.handleFocus(e)},this.showLicenseWatermark=!i.validatePackage(J,{component:"ComboBox"}),this.licenseMessage=i.getLicenseMessage(J)}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(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=(null==(e=this.props._adaptiveMode)?void 0:e.medium)&&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=_(this.props),s=this.value;return t.findIndex(t=>R(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,i;const{dataItemKey:n,virtual:a,groupField:o="",textField:l}=this.props,r=_(this.props),d=e.virtual?e.virtual.total:0,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened;e.data!==r&&this.checkForDuplicatePlainTextRecords();const c=!p&&u,h=this.value;if(this._valueOnDidUpdate=h,this.base.didUpdate(),a&&a.total!==d)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const d=void 0!==e.value?e.value:t.value;let g=this.hasDuplicates?this.navigationIndex||0:r.findIndex(e=>R(e,h,n));l&&h&&(g=null==(s=this.base.getGroupedDataModernMode(r,o))?void 0:s.map(e=>e[l]).indexOf(h[l]));const v=!R(d,h,n);if(c&&a?this.base.scrollToVirtualItem(a,g):c&&!a?(this.onPopupOpened(),r&&0!==r.length&&this.base.resetGroupStickyHeader(r[0][o],this),this.base.scrollToItem(g)):(this.hasDuplicates||u&&p&&h&&v)&&this.base.scrollToItem(g),u&&p&&this.scrollToFocused){const e=null!=(i=this.props.filter?this.props.filter:this.state.text)?i:"";if(e){const{focusedItemIndex:t=N}=this.props,s=t(r,e,l);this.base.scrollToItem(s)}else this.base.scrollToItem(0)}}this.scrollToFocused=!1,c&&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();const t=this.props.name||this.props.id;this.KendoPasteSubscription=i.subscribeToKendoPaste(this._element,{fieldName:t,onValueChange:e=>{this.handleKendoPasteValue(e)}})}componentWillUnmount(){var e,t;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect(),null==(t=this.KendoPasteSubscription)||t.unsubscribe()}render(){const t=r.provideLocalizationService(this),s=t.toLanguageString(f,w[f]),o=t.toLanguageString(b,w[b]),{dir:l,disabled:u,clearButton:p=e.defaultProps.clearButton,label:c,textField:g,className:v,style:m,loading:y,iconClassName:C,virtual:x,size:I,rounded:k,fillMode:S,opened:E=this.state.opened,placeholder:D,svgIcon:K,unstyled:M}=this.props,N=!this.validityStyles||this.validity.valid,T=void 0!==this.props.filter?this.props.filter:this.state.text,O=P(this.value,g),R=F(T)?T:O,L=p&&(!!R||F(this.value)),B=this.base.vs,z=this.props.id||this._inputId,_=M&&M.uComboBox;B.enabled=void 0!==x,void 0!==x&&(B.skip=x.skip,B.total=x.total,B.pageSize=x.pageSize);const[H,V]=ne(this.props.prefix||h.Fragment),[q,W]=ne(this.props.suffix||h.Fragment),A=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:_,size:I,rounded:k,fillMode:S,disabled:u,invalid:!N,loading:y,required:this.required}),v),ref:this.componentRef,style:c?{...m,width:void 0}:m,dir:l,onFocus:this.handleFocus},this.props.prefix&&h.createElement(H,{...V}),this.renderSearchBar(R||"",z,D),L&&!y&&h.createElement(ie,{onClick:this.clearButtonClick,key:"clearbutton"}),y&&h.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:_})),name:"loading",key:"loading"}),this.props.suffix&&h.createElement(q,{...W}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":E?o:s,svgIcon:K||(C?void 0:a.chevronDownIcon),iconClass:C,size:I,fillMode:S,className:i.classNames(i.uComboBox.inputButton({c:_})),onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return c?h.createElement(n.FloatingLabel,{label:c,editorId:z,editorValue:R,editorValid:N,editorDisabled:u,style:{width:m?m.width:void 0},children:A,unstyled:M}):A}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,n=_(this.props),a=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const u=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(u),-1===l||F(d))if(""===a)this.handleItemSelect(0,e);else{const a=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:a,max:(r.enabled?r.total:n.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,ignoreCase:n}=this.props,a=_(this.props),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=P(this.value,s)===e?this.index:T(a,e,s,!1,n),r=-1!==l;let d;if(this._suggested="",r)d=a[l];else{if(!i)return this.selectFocusedItem(e,t);d=void 0!==s?{[s]:e}:e}this.triggerOnChange(d,t),o&&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,ignoreCase:n}=this.props,a=_(this.props),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=P(this.value,s);if(this._suggested="",e===l||""===e&&!F(l))return this.closeOpenedApplyStateNonMobileMode(t,o),this.applyState(t);const r=T(a,e,s,!0,n);let d=null;-1!==r?d=a[r]:i&&(d=e?s?{[s]:e}:e:null),this.triggerOnChange(d,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),this.closeOpenedApplyStateNonMobileMode(t,o),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:n={skip:0},focusedItemIndex:a=N}=this.props,o=_(this.props),l=n.skip,r=""===e&&0===l?0:a(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,{groupField:t,adaptiveTitle:s=this.props.label,adaptiveSubtitle:i}=this.props,n=_(this.props),a=void 0!==this.props.opened?this.props.opened:this.state.opened;let{group:o}=this.state;void 0===o&&void 0!==t&&(o=P(n[0],t));const l={title:s||this.props.label,subTitle:i,expand:a,onClose:e=>this.toggleBtnClick(e),windowWidth:e,mobileFilter:this.renderMobileListFilter()};return h.createElement(Q,{...l},h.createElement(u.ActionSheetContent,null,h.createElement("div",{className:"k-list-container"},this.listContainerContent())))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:n,groupField:a,size:o,list:l,virtual:r,groupStickyHeaderItemRender:d,unstyled:u}=this.props,p=_(this.props),c=void 0!==this.props.opened?this.props.opened:this.state.opened,v=e.getPopupSettings(),m=void 0!==v.width?v.width:e.popupWidth,f=u&&u.uComboBox;let{group:b}=this.state;return void 0===b&&void 0!==a&&(b=P(p[0],a)),h.createElement(g,{width:m,popupSettings:{...v,anchor:v.anchor||this.element,show:c,popupClass:i.classNames(v.popupClass,i.uComboBox.listContainer({c:f,popup:!0}))},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[p.length]},h.createElement("div",{className:i.classNames(i.uComboBox.list({c:f,list:l,size:o,tableSize:o,virtual:r}))},s&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:f}))},s),!l&&b&&0!==p.length&&h.createElement(D,{group:b,render:d}),this.renderList(),n&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:f}),this.props.footerClassName)},n)),this.showLicenseWatermark&&h.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}renderList(){const e=this.base,t=r.provideLocalizationService(this),{textField:s,dataItemKey:n,listNoDataRender:a,itemRender:o,groupHeaderItemRender:l,virtual:d={skip:0,total:void 0},unstyled:u}=this.props,p=_(this.props),c=e.getPopupSettings(),g=e.vs,v=d.skip,m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=`translateY(${g.translate}px)`,b=m?this.getFocusedIndex(this.hasDuplicates):void 0,y=void 0!==this.props.filter?this.props.filter:this.state.text,C=P(this.value,s),x=F(y)&&y!==C?null:this.value,I=this.props.list||U,k=u&&u.uComboBox;return h.createElement(I,{id:e.listBoxId,virtual:!!d,show:m,data:p,focusedIndex:b,value:x,textField:s,valueField:n,groupField:this.props.groupField,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,hasDuplicates:this.hasDuplicates,ariaLabel:t.toLanguageString(S,w[S]),listRef:e=>{g.list=this.base.list=e,this.itemHeight=0},wrapperStyle:this.mobileMode?{}:{maxHeight:c.height},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:k,virtual:d})),listStyle:g.enabled?{transform:f}:void 0,key:"listkey",skip:v,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:l,noDataRender:a,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll,wrapperRef:g.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:d.total})}renderSearchBar(e,t,s){const{tabIndex:i,accessKey:n,disabled:a,title:o,ariaLabelledBy:l,ariaDescribedBy:r,dataItemKey:d,virtual:u={skip:0},unstyled:p,inputAttributes:c}=this.props;_(this.props);const g=void 0!==this.props.opened?this.props.opened:this.state.opened,v=g?this.getFocusedIndex(this.hasDuplicates):-1;return this._suggested&&!R(this._valueOnDidUpdate,this.value,d)&&(this._suggested=""),h.createElement(se,{id:t,readOnly:g&&this.mobileMode,placeholder:s,tabIndex:i,accessKey:n,title:o,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:g&&v>=0?`k-${this.base.guid}-item-${v+u.skip+1}`:void 0,role:"combobox",ariaLabelledBy:l,ariaLabel:this.props.ariaLabel,ariaDescribedBy:r,ariaRequired:this.required,render:this.props.valueRender,ariaControls:g?this.base.listBoxId:void 0,unstyled:p,inputAttributes:c})}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)||R(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:n={skip:0},focusedItemIndex:a=N,skipDisabledItems:o}=this.props,l=_(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=>R(e,t,i)):r?a(l,r,s):o&&s&&!r&&0===n.skip?l.findIndex(e=>!e.disabled):0===n.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const n=t[N(t,e,s)];if(n){const t=P(n,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})}};ae.displayName="ComboBox",ae.propTypes={...Z.propTypes,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","full","none"]),fillMode:s.oneOf(["solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,ignoreCase: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,inputAttributes:s.object},ae.defaultProps={...Z.defaultProps,size:void 0,rounded:void 0,fillMode:void 0,allowCustom:!1,ignoreCase:!1,clearButton:!0,required:!1,isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let oe=ae;const le=i.createPropsContext(),re=i.withIdHOC(i.withPropsContext(le,i.withUnstyledHOC(i.withAdaptiveModeContext(oe))));re.displayName="KendoReactComboBox";const de=h.forwardRef((e,t)=>{const[s,n]=i.useMergedRef(t);return i.useWebMcpRegister("combobox",s,e,e.webMcp),h.createElement(re,{...e,ref:n})});de.displayName="KendoReactComboBox";const{sizeMap:ue,roundedMap:pe}=i.kendoThemeMaps,ce=class e extends h.Component{constructor(){super(...arguments),this.state={},this.base=new Z(this),this._element=null,this._suggested="",this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleKendoPasteValue=e=>{const t=null!=e?String(e):"",s=this.base.initState();s.syntheticEvent={target:this._element,currentTarget:this._element,nativeEvent:new Event("change",{bubbles:!0})},this.triggerOnChange(t,s),this.applyState(s)},this.handleItemSelect=(e,t)=>{const s=_(this.props),i=P(s[e],this.props.textField);this.state.text&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=_(this.props)[e];R(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.renderAdaptiveListContainer=()=>{const{windowWidth:e=0}=this.state,t=h.createElement(E,{value:this.value,ref:e=>{this._adaptiveInput=e&&e.element},onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:"large",rounded:this.props.rounded,fillMode:this.props.fillMode,placeholder:this.props.placeholder}),s={title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,expand:this.opened,onClose:e=>this.onCancel(e),windowWidth:e,mobileFilter:t};return h.createElement(Q,{...s},h.createElement(u.ActionSheetContent,null,h.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=this.state.text;F(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.listContainerContent=()=>{const{header:e,footer:t,size:s,groupStickyHeaderItemRender:n,groupField:a,list:o}=this.props,l=_(this.props);let{group:r}=this.state;return void 0===r&&void 0!==a&&(r=P(l[0],a)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:"k-list-header"},e),h.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":ue[s]||s}`]:this.mobileMode||s})},!o&&r&&0!==l.length&&h.createElement(D,{group:r,render:n}),this.renderList()),t&&h.createElement("div",{className:"k-list-footer"},t))},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let i=_(this.props);if(!s||!i.length)return;const n=this.itemHeight||(t?t.children[0].offsetHeight:0),a=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(n*e>a);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=this.mobileMode?e.target.element:e.currentTarget,i=s.value,n=s.selectionEnd===i.length;t.syntheticEvent=e;const a=this._suggested,o=this.value,l=o&&o.substring(0,o.length-a.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:u}=this.props,p=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==u&&!1!==u){r||d||!n?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);(!p&&i||p&&!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:n}=this.props,a=_(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=a[o],r=e.keyCode,d=e.altKey,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();p.syntheticEvent=e;const c=()=>{u&&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(u&&r===i.Keys.pageUp)c(),this.base.scrollPopupByPageSize(-1);else if(u&&r===i.Keys.pageDown)c(),this.base.scrollPopupByPageSize(1);else if(!u||r!==i.Keys.enter&&r!==i.Keys.esc)if(u||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==s&&n)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=a.slice(o+1).find(e=>!e.disabled);e=t&&a.indexOf(t)}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=a,e=a.findIndex(e=>!e.disabled);else{t=a.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&a.indexOf(s)}}if(void 0!==e){const t=e-o;this.onNavigate(p,r,t)}else void 0===e&&o===a.length-1&&this.onNavigate(p,r)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=a.slice(o+1).find(e=>!e.disabled);else if(r===i.Keys.up||r===i.Keys.left){const t=a.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-o-1;this.onNavigate(p,r,t)}else this.onNavigate(p,r)}this.applyState(p),c()}}else this._suggested="",this.triggerOnChange("",p),void 0!==this.state.focusedItem&&(p.data.focusedItem=void 0),this.applyState(p);else c(),!1===t&&l&&l.disabled?(u&&this.togglePopup(p),this.applyState(p)):this.applyInputValue(e.currentTarget.value,p,e.keyCode)},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{const t=this.base.initState();!this.state.focused||this._skipFocusEvent||(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"})),this.applyState(t))},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&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300),this.base.togglePopup(s),this.applyState(s)}}get _inputId(){return this.props.id+"-accessibility-id"}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}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 opened(){return!!(void 0!==this.props.opened?this.props.opened:this.state.opened)}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=(null==(e=this.props._adaptiveMode)?void 0:e.medium)&&this.props.adaptive)}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,n=_(this.props),{data:a=[]}=e,o=this.focusedIndex(),l=n[o],r=a!==n,d=void 0!==l&&t.focusedItem!==l,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,c=!p&&u;if(""===i)(u&&(d||r)||c)&&this.base.scrollToItem(o);else if(!this._isScrolling){const e=null==(s=this.base.getGroupedDataModernMode(n,i))?void 0:s.indexOf(l);c&&(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][i],this),this.base.scrollToItem(e)),u&&p&&d&&this.base.scrollToItem(e)}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);const t=this.props.name||this.props.id;this.KendoPasteSubscription=i.subscribeToKendoPaste(this._element,{fieldName:t,onValueChange:e=>{this.handleKendoPasteValue(e)}})}componentWillUnmount(){var e;this.observerResize&&this.observerResize.disconnect(),null==(e=this.KendoPasteSubscription)||e.unsubscribe()}render(){const{dir:e,disabled:t,label:s,className:a,style:o,loading:l,suggest:r,size:d,rounded:u,fillMode:p}=this.props,c=!this.validityStyles||this.validity.valid,g=this.base,v=this.value,m=!1!==this.props.clearButton&&!l&&!!v,f=this.props.id||this._inputId,b=this.state.focused;"string"==typeof r&&(this._suggested=r);const[y,C]=ne(this.props.prefix||h.Fragment),[x,I]=ne(this.props.suffix||h.Fragment),k=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-autocomplete k-input",a,{[`k-input-${ue[d]||d}`]:d,[`k-rounded-${pe[u]||u}`]:u,[`k-input-${p}`]:p,"k-invalid":!c,"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,onFocus:this.mobileMode?e=>this.handleWrapperClick(e):this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick},this.props.prefix&&h.createElement(y,{...C}),this.renderSearchBar(v||"",f),l&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),m&&!l&&h.createElement(ie,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&h.createElement(x,{...I}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:f,editorValue:v,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:k}):k}onNavigate(e,t,s){const i=this.value,{textField:n,focusedItemIndex:a}=this.props,o=_(this.props),l=void 0!==this.state.focusedItem?o.findIndex(e=>R(e,this.state.focusedItem,n)):a?a(o,i,n):o.indexOf(L(o,i,n)),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 n=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:a}=this.props,o=_(this.props),l=o[this.focusedIndex()];if(this._suggested="",n&&s===i.Keys.enter&&l&&!l.disabled){const s=P(o[this.focusedIndex(e)],a);this.triggerOnChange(s,t)}n&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:n,disabled:a,readonly:o,inputAttributes:l}=this.props,{focused:r}=this.state,d=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(se,{id:t,placeholder:i,tabIndex:n,accessKey:this.props.accessKey,value:e,suggestedText:this._suggested,focused:r,name:this.props.name,ref:e=>{this._input=e&&e.input},onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:s.handleFocus,onBlur:this.handleBlur,disabled:a,readOnly:o,expanded:d,ariaControls:d?s.listBoxId:void 0,activedescendant:`k-${s.guid}-item-${this.focusedIndex()+1}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaLabel:this.props.ariaLabel,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender,inputAttributes:l})}renderListContainer(){const e=this.base,{dir:t,groupField:s}=this.props,n=_(this.props),a=e.getPopupSettings(),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=void 0!==a.width?a.width:e.popupWidth;let{group:r}=this.state;return void 0===r&&void 0!==s&&(r=P(n[0],s)),h.createElement(g,{width:l,popupSettings:{...a,anchor:a.anchor||this.element,show:o,popupClass:i.classNames(a.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[n.length]},this.listContainerContent())}renderList(){const e=this.base,t=r.provideLocalizationService(this),s=e.getPopupSettings(),{textField:i,listNoDataRender:n,itemRender:a,groupHeaderItemRender:o}=this.props,l=_(this.props),d=this.value,u=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(U,{id:e.listBoxId,show:u,data:l.slice(),focusedIndex:this.focusedIndex(),value:d,textField:i,valueField:i,highlightSelected:!0,optionsGuid:e.guid,groupField:this.props.groupField,ariaLabel:t.toLanguageString(k,w[k]),listRef:t=>{e.list=t},wrapperStyle:this.mobileMode?{}:{maxHeight:s.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:o,noDataRender:n,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||{}}))}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}suggestValue(e){if(this._suggested="",e){const{textField:t}=this.props,s=_(this.props),i=s[N(s,e,t)];if(i){const s=P(i,t);e.toLowerCase()!==s.toLowerCase()&&(this._suggested=s.substring(e.length))}}}focusedIndex(e){const{textField:t,focusedItemIndex:s,skipDisabledItems:i}=this.props,n=_(this.props),a=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return n.findIndex(e=>R(e,this.state.focusedItem,t));if(s)return s(n,a,t);const o=n.indexOf(L(n,a,t));return i&&t&&-1===o?n.findIndex(e=>!e.disabled):Math.max(0,o)}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ce.displayName="AutoComplete",ce.propTypes={...Z.basicPropTypes,size:s.oneOf(["small","medium","large"]),rounded:s.oneOf(["small","medium","large","full","none"]),fillMode:s.oneOf(["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,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,adaptiveSubtitle:s.string,onCancel:s.func,skipDisabledItems:s.bool,inputAttributes:s.object},ce.defaultProps={...Z.defaultProps,size:void 0,rounded:void 0,fillMode:void 0,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let he=ce;const ge=i.createPropsContext();r.registerForLocalization(he);const ve=i.withIdHOC(i.withPropsContext(ge,i.withAdaptiveModeContext(he)));ve.displayName="KendoReactAutoComplete";const me=h.forwardRef((e,t)=>{const[s,n]=i.useMergedRef(t);return i.useWebMcpRegister("autocomplete",s,e,e.webMcp),h.createElement(ve,{...e,ref:n})});me.displayName="KendoReactAutoComplete";const fe=e=>e.syntheticEvent.preventDefault(),be=e=>e.syntheticEvent.stopPropagation();class ye extends h.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:n,onTagDelete:a,size:o}=this.props;return h.createElement(h.Fragment,null,e.map((l,r)=>{const u=n?h.createElement(n,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:a}):h.createElement(d.Chip,{id:`tag-${t}-${l.text?l.text.replace(/\s+/g,"-"):r}`,ariaSelected:!0,role:"option","aria-setsize":e.length,key:l.text+r,text:l.text,removable:!0,onRemove:e=>a.call(void 0,l.data,e.syntheticEvent),onMouseDown:fe,onClick:be,className:l===s?"k-focus":void 0,size:o});return i?i(l,u):u}),this.props.children)}}var Ce=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(Ce||{});const{sizeMap:xe,roundedMap:Ie}=i.kendoThemeMaps,ke=e=>e.preventDefault(),Se=e=>2===e,we=class e extends h.Component{constructor(e){super(e),this.state={activedescendant:Ce.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new Z(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.showLicenseWatermark=!1,this.focus=()=>{this._input&&this._input.focus()},this.handleKendoPasteValue=e=>{if(null==e)return;const t=_(this.props),{textField:s,dataItemKey:i}=this.props,n=String(e).split(",").map(e=>e.trim()).filter(e=>e).reduce((e,n)=>{const a=T(t,n,s,!1,!0);if(-1!==a){const s=t[a];e.some(e=>R(e,s,i))||e.push(s)}return e},[]);if(0===n.length)return;const a=this.base.initState();a.syntheticEvent={target:this._element},this.triggerOnChange(n,a),this.applyState(a)},this.handleItemSelect=(e,t)=>{const{dataItemKey:s,virtual:i}=this.props,n=_(this.props),a=n[e-(i?i.skip:0)],o=this.value.findIndex(e=>R(e,a,s));this._lastSelectedOrDeslectedItemIndex=n.findIndex(e=>R(e,a,s));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,a],(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(a,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;O(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{allowCustom:s,virtual:i}=this.props,n=_(this.props),a=i?i.skip:0,o=i?i.pageSize:0,l=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:r}=this.getFocusedState(),d=s&&l,u=n[e-a];if(i&&!u&&e>=0&&r!==e){const s=Math.floor(e/o)*o;if(s!==a)return this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=Ce.PopupList),void this.base.triggerOnPageChange(t,s,o)}u&&r!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=Ce.PopupList):d&&-1===e&&void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(u,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.scrollToFocused=!0:(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,virtual:n}=this.props,a=_(this.props),o=e.keyCode,l=void 0!==this.props.filter?this.props.filter:this.state.text,r=void 0!==this.props.opened?this.props.opened:this.state.opened,{focusedItem:d,focusedIndex:u}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=e,!l&&this.value.length>0&&(o===i.Keys.left||o===i.Keys.right||o===i.Keys.home||o===i.Keys.end||o===i.Keys.delete||o===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,p);const c=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(o===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(o===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,u);null===t?e=0!==u?a.slice(u-1,u):[a[u]]:t===u?e=[a[t-1]]:u>=0&&(e=t>u?a.slice(u-1,t):a.slice(t-1,u)),e&&e.length>0&&(u>=1&&this.itemFocus(u-1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const t=this.getLastSelectedOrDeselectedIndex(0,u);null===t?e=u!==a.length-1?a.slice(u,u+1):[a[u]]:t===u?e=a.slice(u,u+2):u>=0&&(e=t>u?a.slice(u+1,t+1):a.slice(t,u+2)),e&&e.length>=1&&(this.itemFocus(u+1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.altKey&&o===i.Keys.up)c();else if(o===i.Keys.up||o===i.Keys.down){const l=n?n.skip:0,d=u-l;if(""!==s&&t)if(!this.props.skipDisabledItems&&r)this.onNavigate(p,o);else{let e=0;if(o===i.Keys.down||o===i.Keys.right){const t=a.slice(d+1).find(e=>!e.disabled);e=t&&a.indexOf(t),e&&-1!==e&&(e+=l)}else if(o===i.Keys.up||o===i.Keys.left){let t;if(-1===u)t=a,e=a.findIndex(e=>!e.disabled),-1!==e&&(e+=l);else{t=a.slice(0,d);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&a.indexOf(s),e&&-1!==e&&(e+=l)}}if(e){const t=e-u;this.onNavigate(p,o,t)}else this.onNavigate(p,o)}else if(!this.props.skipDisabledItems&&r)this.onNavigate(p,o);else{let e=null;if(o===i.Keys.down||o===i.Keys.right)e=a.slice(d+1).find(e=>!e.disabled);else if(o===i.Keys.up||o===i.Keys.left){const t=a.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=a.indexOf(e);if(-1!==t){const e=l+t-u;this.onNavigate(p,o,e)}else this.onNavigate(p,o)}else this.onNavigate(p,o)}this.applyState(p),e.preventDefault()}else o===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&l&&null===d?this.customItemSelect(e):d&&d.disabled?c():this.selectFocusedItem(e)):o===i.Keys.esc&&c();else e.altKey&&o===i.Keys.down?c():o===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:n,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=_(this.props),u=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),c=s&&u&&h.createElement("div",{className:i.classNames("k-list",{[`k-list-${xe[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:ke},h.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":Se(p)}),style:{fontStyle:"italic"}},u,h.createElement(i.IconWrap,{name:"plus",icon:a.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==l&&(g=P(d[0],l)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:"k-list-header"},e),c,h.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":xe[n]||n}`]:this.mobileMode||n,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&h.createElement(D,{group:g,render:o}),this.renderList()),this.showLicenseWatermark&&h.createElement(i.WatermarkOverlay,{message:this.licenseMessage}),t&&h.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=_(this.props),n=this.base.getPopupSettings(),a=void 0!==n.width?n.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:a,popupSettings:{...n,popupClass:i.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),anchor:n.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return h.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,adaptiveSubtitle:t,filterable:s,filter:i}=this.props,{windowWidth:n=0}=this.state,a=void 0!==i?i:this.state.text,o=s?h.createElement(E,{value:a,ref:e=>{this._adaptiveInput=e&&e.element},onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:"large",rounded:this.props.rounded,fillMode:this.props.fillMode,placeholder:this.props.placeholder}):null,l={title:e||this.props.label,subTitle:t,expand:this.opened,onClose:e=>this.closePopup(e),windowWidth:n,mobileFilter:o};return h.createElement(Q,{...l},h.createElement(u.ActionSheetContent,null,h.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 e=r.provideLocalizationService(this),{textField:t,listNoDataRender:s,itemRender:i,groupHeaderItemRender:n,dataItemKey:a,virtual:o={skip:0,total:void 0}}=this.props,l=_(this.props),d=this.base.vs,{focusedIndex:u}=this.getFocusedState(),p=this.base.getPopupSettings(),c=`translateY(${d.translate}px)`;return h.createElement(U,{id:this.base.listBoxId,show:this.opened,data:l.slice(),focusedIndex:u-o.skip,value:this.value,textField:t,valueField:a,optionsGuid:this.base.guid,groupField:this.props.groupField,ariaLabel:e.toLanguageString(S,w[S]),listRef:e=>{d.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:p.height},wrapperCssClass:"k-list-content",listStyle:d.enabled?{transform:c}:void 0,key:"listKey",skip:o.skip,onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:n,noDataRender:s,onMouseDown:ke,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:d.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:o.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let n=_(this.props);if(i&&n.length&&i){const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=this.base.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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 n=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const a=[...this.value,n];this.triggerOnChange(a,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.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!")},this.validate(e),this.licenseMessage=i.getLicenseMessage(J)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}validate(e){if(e.filterable||e.virtual){const t=[];e.filterable&&t.push("filterable"),e.virtual&&t.push("virtualization"),this.showLicenseWatermark=!i.validatePackage(J,{component:"MultiSelect",features:t})}}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:P(e,t),data:[e]})}):s.push(...e),s}get mobileMode(){var e;return!!(this.state.windowWidth&&this.props._adaptiveMode&&this.state.windowWidth<=(null==(e=this.props._adaptiveMode)?void 0:e.medium)&&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:n=""}=this.props,a=_(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,u=r&&!this.opened,p=this.base.getPopupSettings();if(this.validate(this.props),this.base.didUpdate(),!p.animate&&u&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==n&&(t=null==(s=this.base.getGroupedDataModernMode(a,n))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][n],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);const t=this.props.name||this.props.id;this.KendoPasteSubscription=i.subscribeToKendoPaste(this._element,{fieldName:t,onValueChange:e=>{this.handleKendoPasteValue(e)}})}componentWillUnmount(){var e,t;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect(),null==(t=this.KendoPasteSubscription)||t.unsubscribe()}onNavigate(e,t,s){const{allowCustom:n}=this.props,a=_(this.props),o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=n&&o,u=Se(l),p=this.base,c=p.vs;if(this.opened&&t===i.Keys.up&&u)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=p.navigation.navigate({keyCode:t,current:r,max:(c.enabled?c.total:a.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:a,disabled:o,textField:l,dataItemKey:d,virtual:u,size:p,rounded:c,fillMode:g,loading:v,filter:m}=this.props,{text:f,focused:b,focusedTag:y,currentValue:C}=this.state,x=this.base.vs,k=this.props.id||this._inputId;x.enabled=void 0!==u,void 0!==u&&(x.skip=u.skip,x.total=u.total,x.pageSize=u.pageSize);const S=this.mobileMode&&this.opened?C:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const E=!this.validityStyles||this.validity.valid,D=r.provideLocalizationService(this),F=!!(void 0!==m?m:f)||S&&S.length>0,[K,M]=ne(this.props.prefix||h.Fragment),[N,T]=ne(this.props.suffix||h.Fragment),O=h.createElement(h.Fragment,null,h.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${xe[p]||p}`]:p,[`k-rounded-${Ie[c]||c}`]:c,[`k-input-${g}`]:g,"k-focus":b&&!o,"k-invalid":!E,"k-disabled":o,"k-loading":v,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:a,onFocus:e=>{this.mobileMode?this.handleWrapperClick(e):this.handleFocus(e)},onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:B},this.props.prefix&&h.createElement(K,{...M}),h.createElement("div",{className:i.classNames("k-input-values")},h.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${xe[p]||p}`]:p}),role:"listbox","aria-label":D.toLanguageString(I,w[I]),"aria-orientation":"horizontal",id:"tagslist-"+this.base.guid},S&&S.length>0&&h.createElement(ye,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:S,guid:this.base.guid,focused:y?S.find(e=>z(e,y,d)):void 0,size:p})),this.renderSearchBar(k)),v&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&h.createElement(N,{...T}),F&&h.createElement(ie,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:k,editorValue:f||P(this.value[0],l),editorValid:E,editorDisabled:o,style:{width:e?e.width:void 0},children:O}):O}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:n,placeholder:a,ariaDescribedBy:o,ariaLabelledBy:l,ariaLabel:r,inputAttributes:d}=this.props,u=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:p}=this.getFocusedState(),c=0!==this.value.length||u?void 0:a,g=i&&i.length>0?void 0:a,v=t===Ce.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`k-${this.base.guid}-item-${p+1}`,m=o?` ${o}`:"",f=this.value.length>0?`tagslist-${this.base.guid}${m}`:o,b={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return h.createElement(se,{id:e,name:this.props.name,size:Math.max((c||"").length,u.length,1),placeholder:this.mobileMode&&this.opened?g:c,value:u,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,expanded:this.opened,ariaControls:this.base.listBoxId,role:"combobox",activedescendant:v,ariaDescribedBy:f,ariaLabelledBy:l,ariaRequired:this.required,ariaLabel:r,ariaAutoComplete:"list",inputAttributes:d,...b})}onTagsNavigate(e,t){const s=e.keyCode,{focusedTag:n}=this.state,a=this._tags,o=this.props.dataItemKey;let l,r=n?a.findIndex(e=>z(e,n,o)):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):a.length-1,l=a[r];else if(s===i.Keys.right)r===a.length-1?l=void 0:d&&(r=Math.min(a.length-1,r+1),l=a[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;O(e,a[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)O(e,a[r].data,o),this.triggerOnChange(e,t);else if(!d&&a.length){const s=a.pop();O(e,s.data,o),this.triggerOnChange(e,t)}}}else l=a[a.length-1];else l=a[0];l!==n&&(t.data.focusedTag=l,t.data.activedescendant=Ce.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=_(this.props),{focusedIndex:n}=t||this.getFocusedState();void 0!==i[n-(s?s.skip:0)]&&this.handleItemClick(n,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:n,textField:a,focusedItemIndex:o=N,skipDisabledItems:l}=this.props,r=_(this.props),d=n&&n.skip||0;let u;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const p=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return u=o(r,t,a),{focusedItem:r[u],focusedIndex:u+d,focusedType:1};if(p.length){const e=p[p.length-1];return u=r.findIndex(t=>R(t,e,i)),void 0!==r[u]?{focusedIndex:u+d,focusedItem:r[u],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&a&&!t&&0===d){const e=r.findIndex(e=>!e.disabled);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}};we.displayName="MultiSelect",we.propTypes={...Z.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,adaptiveSubtitle:s.string,onCancel:s.func,skipDisabledItems:s.bool,inputAttributes:s.object},we.defaultProps={...Z.defaultProps,autoClose:!0,required:!1,size:void 0,rounded:void 0,fillMode:void 0,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let Ee=we;const De=i.createPropsContext(),Fe=i.withIdHOC(i.withPropsContext(De,i.withAdaptiveModeContext(Ee)));Fe.displayName="KendoReactMultiSelect",r.registerForLocalization(Ee);const Ke=h.forwardRef((e,t)=>{const[s,n]=i.useMergedRef(t);return i.useWebMcpRegister("multiselect",s,e,e.webMcp),h.createElement(Fe,{...e,ref:n})});Ke.displayName="KendoReactMultiSelect";const Me=e=>h.createElement(U,{...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}}),Ne=i.createPropsContext(),Te=h.forwardRef((e,t)=>{const s=i.usePropsContext(Ne,e),n=h.useRef(null),a=h.useRef(null),o=i.getScrollbarWidth(),{columns:l=Oe.columns,popupSettings:r=Oe.popupSettings,size:d=Oe.size,rounded:u=Oe.rounded,fillMode:p=Oe.fillMode,className:c,prefix:g,suffix:v,onOpen:m,onClose:f,onFocus:b,onBlur:y,onChange:C,onFilterChange:x,onPageChange:I,...k}=s;h.useImperativeHandle(n,()=>{var e;return{element:(null==(e=a.current)?void 0:e.element)||null,focus(){a.current&&a.current.focus()},get value(){var e;return null==(e=a.current)?void 0:e.value},get name(){var e;return null==(e=a.current)?void 0:e.name},props:s}}),h.useImperativeHandle(t,()=>n.current);const S=h.useMemo(()=>{if(void 0!==s.groupField&&s.data)return P(s.data[0],s.groupField)},[s.data,s.groupField]),[w,E]=h.useState(S),[D,F]=h.useState(!0),K=h.useRef(null),[M]=g?ne(s.prefix||h.Fragment):[],[N]=v?ne(s.suffix||h.Fragment):[],T=h.useMemo(()=>{const e=h.createElement("th",{className:"k-table-th",colSpan:l.length},w);return h.createElement(h.Fragment,null,s.header,h.createElement("div",{ref:K,className:"k-table-header-wrap"},h.createElement("table",{className:"k-table",role:"presentation"},h.createElement("colgroup",null,l.map((e,t)=>h.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Oe.width}}))),h.createElement("thead",{className:"k-table-thead"},h.createElement("tr",{className:"k-table-row"},l.map((e,t)=>h.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" "))),w&&D&&h.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))},[s.header,l,w,D]),O=h.useMemo(()=>`calc(${l.map(e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Oe.width)).filter(Boolean).join(" + ")} + ${o}px + 4px)`,[l,o]),R=s.virtual?s.virtual.skip:0,L=h.useCallback((e,t)=>{const n=l.map((e,n)=>h.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Oe.width},key:e.uniqueKey?e.uniqueKey:n},e.field?String(i.getter(e.field)(t.dataItem)):""));let a,o,r,d,u=s.data||[];const p=t.index-R;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(u[p]),r=d(u[p-1]),o&&r&&o!==r&&(a=o));const c=h.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":!!a,"k-disabled":t.dataItem.disabled})},n);return s.itemRender?s.itemRender.call(void 0,c,t):c},[l,s.groupField,s.itemRender,s.data,R]),B=h.useCallback((e,t)=>{e&&e.call(void 0,{...t,target:n.current})},[]),z=h.useCallback(e=>(s.virtual||E(S),B(m,e)),[B,m,s.virtual,S]),_=h.useCallback(e=>B(f,e),[f]),H=h.useCallback(e=>B(b,e),[b]),V=h.useCallback(e=>B(y,e),[y]),q=h.useCallback(e=>B(C,e),[C]),W=h.useCallback(e=>B(I,e),[I]),A=h.useCallback(e=>(E(S),B(x,{...e,mobileMode:e.target.mobileMode})),[x]),U=h.useCallback(e=>{E(e.group)},[]),$=h.useCallback(e=>{K.current&&(K.current.scrollLeft=e.target.scrollLeft)},[]);h.useEffect(()=>{i.setScrollbarWidth()}),h.useEffect(()=>{const e=s.data;E(S),e&&0!==e.length?F(!0):F(!1)},[s.data]);const G=h.useCallback(e=>h.createElement(Me,{...e}),[]);return h.createElement(re,{...k,list:G,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||O,className:r.className},ref:a,header:T,itemRender:L,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:u,fillMode:p,groupField:s.groupField,isMultiColumn:!0,onOpen:z,onClose:_,onFocus:H,onBlur:V,onChange:q,onFilterChange:A,onPageChange:W,onGroupScroll:U,onListScroll:$,className:i.classNames("k-dropdowngrid",c),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,adaptiveSubtitle:s.adaptiveSubtitle,footer:s.footer,footerClassName:"k-table-footer",prefix:M,suffix:N})}),Pe={...oe.propTypes,columns:s.any.isRequired},Oe={columns:[],popupSettings:{},width:"200px",size:void 0,rounded:void 0,fillMode:void 0};function Re(e){return"string"==typeof e?Number(e.replace("px","")):e}function Le(e,t,s,i){const n=Re(t.popupSettings.width),a=(void 0!==s.width&&Re(s.width))!==n,o=void 0!==i.width,l=a?s.width:o?i.width:n,r=Re(function(e,t,s){const[i,n]=h.useState(t);return h.useEffect(()=>{void 0!==i&&e.current&&n(e.current.offsetWidth)},s),i}(e,l));return a||o?l:r&&n&&r>n?r:n}Te.displayName="KendoMultiColumnComboBox",Te.propTypes=Pe;const Be=e=>h.createElement("div",{className:"k-nodata"},h.createElement("div",null,e.children)),{sizeMap:ze,roundedMap:_e}=i.kendoThemeMaps,He=e=>h.createElement("span",{className:"k-input-value-text"},e.children),Ve=e=>e.split("_").map(e=>parseInt(e,10)),qe={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:void 0,rounded:void 0,fillMode:void 0},We=i.createPropsContext(),Ae=h.forwardRef((e,t)=>{const s=!i.validatePackage(J,{component:"DropDownTree"}),l=i.getLicenseMessage(J),c=i.usePropsContext(We,e),g={...qe,...c},f=i.useId(),b=g.id||f,C=`${b}-treeview`,x=`${b}-value`,{data:I,dataItemKey:k,popupSettings:S={},style:D,opened:K,disabled:M,onOpen:N=i.noop,onClose:T=i.noop,placeholder:O,label:L,name:B,selectField:z,subItemsField:_,validationMessage:H,valid:V,required:q,validityStyles:W}=g,A=i.getTabIndex(g.tabIndex,M),U=h.useRef(null),$=h.useRef(null),G=h.useRef(null),j=h.useRef(null),Y=h.useRef(null),Z=h.useRef(null),X=h.useRef(!1),[ee,te]=h.useState(void 0),se=void 0!==g.value,ie=se?g.value:void 0!==ee?ee:g.defaultValue,ne=F(ie),ae=ne?P(ie,g.textField):"",oe=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:H,valid:V,required:q},ne),le=h.useContext(i.ZIndexContext),re=le?le+2e3:12e3,de=h.useCallback(()=>$.current&&$.current.focus(),[]);h.useImperativeHandle(U,()=>({props:g,element:$.current,focus:de})),h.useImperativeHandle(t,()=>U.current),i.useWebMcpRegister("dropdowntree",U,g,g.webMcp);const ue=i.useRtl($,g.dir),pe={width:Le($,qe,{...qe.popupSettings,...S},D),...void 0!==ue?{direction:ue}:{}},[ce,he]=h.useState(!1),ge=void 0!==K?K:ce,[ve,me]=h.useState(!1),[fe,be]=h.useState(),[ye,Ce]=h.useState(""),xe=i.useAdaptiveModeContext(),Ie=!!(fe&&xe&&fe<=xe.medium&&g.adaptive),ke=h.useCallback(()=>{Y.current&&Y.current.setCustomValidity&&Y.current.setCustomValidity(oe.valid?"":void 0===H?"Please select a value from the list!":H)},[H,oe]);h.useEffect(ke),h.useEffect(()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ye.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}},[]);const Se=h.useCallback(e=>{if(!ge){if(N){const t={...e};N.call(void 0,t)}void 0===K&&he(!0)}},[ge,K,N]),we=h.useCallback(e=>{if(ge){if(T){const t={...e};T.call(void 0,t)}void 0===K&&(he(!1),Ie&&setTimeout(()=>{var e;Me(null==(e=j.current)?void 0:e.element)},300))}},[ge,K,T,Ie]),Ee=h.useCallback(e=>{if(!e.isDefaultPrevented()&&U.current){me(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};(ge?we:Se)(t)}},[ge,K,N,T]),De=h.useCallback(e=>{X.current=!0,e(),window.setTimeout(()=>X.current=!1,0)},[]),Fe=h.useCallback(e=>{var t,s;const{keyCode:n,altKey:a}=e,o=Z.current&&Z.current.element;if(!U.current||e.isDefaultPrevented()&&(null==(t=G.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};if(ge)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),we(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===i.Keys.up&&null!=(s=G.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find(e=>null==e?void 0:e.querySelector(".k-focus"));if(t&&0===e.indexOf(t))return De(()=>{var e;Me(null==(e=G.current)?void 0:e.element)})}De(i.noop)}else n===i.Keys.down&&De(()=>{var e;Me((null==(e=G.current)?void 0:e.element)||o)});else a&&n===i.Keys.down?(e.preventDefault(),Se(l)):ge||n===i.Keys.esc&&$e(e)},[ge,K,N,T]),Ke=h.useCallback(e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),De(t===i.Keys.up?()=>{Me($.current)}:()=>{var e;Me(null==(e=Z.current)?void 0:e.element)}))},[]),Me=h.useCallback(e=>{e&&De(()=>e.focus())},[]),Ne=h.useCallback(e=>{var t;S.onOpen&&S.onOpen(e),ve||!ge||K?c.filterable?Me(null==(t=G.current)?void 0:t.element):Me(Z.current&&Z.current.element):we({target:U.current})},[T,c.filterable,ve,K,ge]),Te=h.useCallback(e=>{S.onClose&&S.onClose(e),ve&&Me($.current)},[ve]),Pe=h.useCallback(e=>{if(!ve&&!X.current&&(me(!0),c.onFocus&&U.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};c.onFocus.call(void 0,t)}},[ve,c.onFocus]),Oe=h.useCallback(e=>{if(ve&&!X.current&&U.current){me(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};if(c.onBlur){const e={...t};c.onBlur.call(void 0,e)}Ie||we(t)}},[ve,c.onBlur,ge,K,T]),Re=h.useCallback(()=>{ve&&De(i.noop),Ie&&setTimeout(()=>{var e;Me(null==(e=j.current)?void 0:e.element)},300)},[ve,Ie]),Ae=h.useCallback((e,t,s)=>{if(c.onChange){const i={value:t,level:s?Ve(s):[],...e};c.onChange.call(void 0,i)}se||te(t)},[c.onChange,se]),Ue=h.useCallback(e=>{if(R(e.item,ie,k)||!U.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,a={syntheticEvent:n,nativeEvent:i,target:U.current};Ae(a,t,s),we(a)},[se,ie,c.onChange,k,ge,K,T]),$e=h.useCallback(e=>{if(!U.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:U.current};Ae(t,null),we(t),e.preventDefault()},[se,c.onChange,ge,K,T]),Ge=h.useCallback(e=>{if(e.syntheticEvent.stopPropagation(),c.onExpandChange&&U.current){const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,a={level:Ve(s),item:t,nativeEvent:i,syntheticEvent:n,target:U.current};c.onExpandChange.call(void 0,a)}},[c.onExpandChange]),je=h.useCallback(e=>{if(c.onFilterChange&&U.current){const t={filter:{field:c.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:U.current};c.onFilterChange.call(void 0,t),void 0===c.filter&&Ce(e.target.value)}},[c.onFilterChange,c.filter,c.textField]),Ye=h.useCallback(e=>{for(const t of e)be(t.target.clientWidth)},[]),Ze=h.useMemo(()=>se||!ne?I:i.mapTree(I,_,e=>i.extendDataItem(e,_,{[z]:R(e,ie,k)})),[I,ie,se,ne,z,_]),Je=g.listNoData||Be,Qe=g.valueHolder||He,Xe=r.useLocalization(),et=!W||oe.valid,{size:tt,rounded:st,fillMode:it}=g,nt=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-dropdowntree k-picker",g.className,{[`k-picker-${ze[tt]||tt}`]:tt,[`k-rounded-${_e[st]||st}`]:st,[`k-picker-${it}`]:it,"k-focus":ve,"k-invalid":!et,"k-loading":g.loading,"k-required":q,"k-disabled":g.disabled}),tabIndex:A,accessKey:g.accessKey,id:b,style:L?{...D,width:void 0}:D,dir:ue,ref:$,onKeyDown:M?void 0:Fe,onMouseDown:Re,onClick:M?void 0:Ee,onFocus:Ie?e=>Ee(e):Pe,onBlur:Oe,role:"combobox","aria-haspopup":"tree","aria-expanded":ge,"aria-disabled":M,"aria-label":g.ariaLabel||L,"aria-labelledby":g.ariaLabelledBy,"aria-controls":ge?C:void 0,"aria-describedby":g.ariaDescribedBy||(ge?x:void 0),"aria-required":q||void 0},h.createElement("span",{className:"k-input-inner",id:x},(ae||O)&&h.createElement(Qe,{item:ie},ae||O)),g.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ne&&!M&&h.createElement("span",{onClick:$e,className:"k-clear-value",title:Xe.toLanguageString(m,w[m]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon})),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":Xe.toLanguageString(y,w[y]),className:"k-input-button",size:tt,fillMode:it,icon:"chevron-down",svgIcon:a.chevronDownIcon}),h.createElement("select",{name:B,ref:Y,tabIndex:-1,"aria-hidden":!0,title:L,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:g.valueMap?g.valueMap.call(void 0,ie):ie})),!Ie&&h.createElement(i.ZIndexContext.Provider,{value:re},h.createElement(o.Popup,{...S,className:i.classNames(S.className,{"k-rtl":"rtl"===ue}),popupClass:i.classNames(S.popupClass,"k-dropdowntree-popup k-list-container"),style:pe,anchor:S.anchor||$.current,show:ge,onOpen:Ne,onClose:Te},g.filterable&&h.createElement(E,{value:void 0===g.filter?ye:g.filter,ref:G,onChange:je,onKeyDown:Ke,size:tt,rounded:st,fillMode:it,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),I.length>0?h.createElement(p.TreeView,{id:C,style:{height:S.height},ref:Z,tabIndex:A,data:Ze,focusIdField:k,textField:g.textField,selectField:z,expandField:g.expandField,childrenField:_,expandIcons:!0,onItemClick:Ue,onExpandChange:Ge,size:tt,item:g.item,dir:ue,animate:!1}):h.createElement(Je,null,Xe.toLanguageString(v,w[v])),s&&h.createElement(i.WatermarkOverlay,{message:l})))),Ie&&(()=>{const e=g.filterable?h.createElement(E,{value:void 0===g.filter?ye:g.filter,ref:j,onChange:je,onKeyDown:Ke,size:"large",rounded:st,fillMode:it,placeholder:O}):null,t={title:g.adaptiveTitle||L,subTitle:g.adaptiveSubtitle,expand:ge,onClose:e=>we(e),windowWidth:fe,mobileFilter:e};return h.createElement(Q,{...t},h.createElement(u.ActionSheetContent,null,I.length>0?h.createElement(p.TreeView,{id:C,ref:Z,tabIndex:A,data:Ze,focusIdField:k,textField:g.textField,selectField:z,expandField:g.expandField,childrenField:_,expandIcons:!0,onItemClick:Ue,onExpandChange:Ge,size:"large",item:g.item,dir:ue,animate:!1}):h.createElement(Je,null,Xe.toLanguageString(v,w[v]))))})());return L?h.createElement(n.FloatingLabel,{label:L,editorValue:ae,editorPlaceholder:O,editorValid:et,editorDisabled:M,editorId:b,style:{width:D?D.width:void 0},children:nt,dir:ue}):nt}),Ue={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,adaptiveSubtitle:s.string,adaptive:s.bool};Ae.displayName="KendoReactDropDownTree",Ae.propTypes=Ue;const{sizeMap:$e,roundedMap:Ge}=i.kendoThemeMaps,je=e=>e.split("_").map(e=>parseInt(e,10)),Ye={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:void 0,rounded:void 0,fillMode:void 0,required:!1,validityStyles:!0},Ze=i.createPropsContext(),Je=h.forwardRef((e,t)=>{var s;const a=i.usePropsContext(Ze,e),l=!i.validatePackage(J,{component:"MultiSelectTree"}),d=i.getLicenseMessage(J),c=i.useId(),g=a.id||c,m=`${g}-treeview`,{data:f=[],dataItemKey:b,style:y={},placeholder:C,label:x,name:k,validationMessage:S,valid:D,tags:F,value:K,opened:M,disabled:N,popupSettings:T=Ye.popupSettings,checkField:O=Ye.checkField,checkIndeterminateField:L=Ye.checkIndeterminateField,subItemsField:B=Ye.subItemsField,size:_=Ye.size,rounded:H=Ye.rounded,fillMode:V=Ye.fillMode,required:q=Ye.required,validityStyles:W=Ye.validityStyles,onOpen:A=i.noop,onClose:U=i.noop}=a,$=i.getTabIndex(a.tabIndex,N),G=h.useRef(null),j=h.useRef(null),Y=h.useRef(null),Z=h.useRef(null),X=h.useRef(null),ee=h.useRef(null),te=h.useRef(!1),se=h.useRef([]),ne=h.useRef(null),[ae,oe]=h.useState(),[le,re]=h.useState(!1),[de,ue]=h.useState(!1),[pe,ce]=h.useState(),[he,ge]=h.useState([]),[ve,me]=h.useState(""),fe=void 0!==M?M:le,be=!(!Array.isArray(K)||!K.length),Ce=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:S,valid:D,required:q},be),xe=i.useRtl(j,a.dir),Ie={width:Le(j,Ye,T,y),...void 0!==xe?{direction:xe}:{}},ke=h.useCallback(()=>j.current&&j.current.focus(),[]),Se=i.useAdaptiveModeContext(),we=!!(pe&&Se&&pe<=Se.medium&&a.adaptive);se.current=void 0===F?(K||[]).map(e=>({text:P(e,a.textField),data:[e]})):[...F],h.useImperativeHandle(G,()=>({props:a,element:j.current,focus:ke})),h.useImperativeHandle(t,()=>G.current);const Ee=h.useCallback(()=>{X.current&&X.current.setCustomValidity&&X.current.setCustomValidity(Ce.valid?"":void 0===S?"Please select a value from the list!":S)},[S,Ce]);h.useEffect(Ee),h.useEffect(()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}},[]),h.useEffect(()=>{ne.current&&fe&&ne.current.setPosition(ne.current.element)},[K,fe]);const De=h.useCallback((e,t,s)=>{if(a.onChange){const i={items:t,operation:s,...e};a.onChange.call(void 0,i)}},[a.onChange]),Fe=h.useCallback(e=>{if(R(e.item,K,b)||!G.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,n={syntheticEvent:i,nativeEvent:s,target:G.current};De(n,[t],"toggle")},[K,b,De]),Ke=h.useCallback(e=>{if(!fe){if(A){const t={...e};A.call(void 0,t)}void 0===M&&(re(!0),ge(K||[]),we&&setTimeout(()=>{var e;Te(null==(e=Z.current)?void 0:e.element)},300))}},[fe,M,A,we,Z]),Me=h.useCallback(e=>{if(fe){if(U){const t={...e};U.call(void 0,t)}void 0===M&&re(!1)}},[fe,M,U]),Ne=h.useCallback(e=>{te.current=!0,e(),window.setTimeout(()=>te.current=!1,0)},[]),Te=h.useCallback(e=>{e&&Ne(()=>e.focus())},[Ne]),Pe=h.useCallback(()=>{var e;!de&&fe?Me({target:G.current}):a.filterable?Te(null==(e=Y.current)?void 0:e.element):Te(ee.current&&ee.current.element)},[de,fe,Te,Me,a.filterable]),Oe=h.useCallback(()=>{de&&Te(j.current)},[de,Te]),Re=h.useCallback(e=>{if(!de&&!te.current&&(ue(!0),a.onFocus&&G.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};a.onFocus.call(void 0,t)}},[de,a.onFocus]),ze=h.useCallback(e=>{if(de&&!te.current&&G.current){ue(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};if(a.onBlur){const e={...t};a.onBlur.call(void 0,e)}we||Me(t)}},[de,a.onBlur,fe,M,U]),_e=h.useCallback(()=>{de&&Ne(i.noop)},[de,Ne]),He=h.useCallback(e=>{if(!e.isDefaultPrevented()&&G.current){ue(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};fe||Ke(t)}},[fe,Ke]),Ve=h.useCallback(e=>{var t,s;const{keyCode:n,altKey:a}=e,o=ee.current&&ee.current.element;if(!G.current||e.isDefaultPrevented()&&(null==(t=Y.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};if(K&&K.length>0&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete)){const e=se.current;let t,s=ae?e.findIndex(e=>z(e,ae,b)):-1;const a=-1!==s;n===i.Keys.left?(s=a?Math.max(0,s-1):e.length-1,t=e[s]):n===i.Keys.right?s===e.length-1?t=void 0:a&&(s=Math.min(e.length-1,s+1),t=e[s]):n===i.Keys.home?t=e[0]:n===i.Keys.end?t=e[e.length-1]:n===i.Keys.delete&&a&&De(l,e[s].data,"delete"),t!==ae&&oe(t)}if(fe)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),Me(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===i.Keys.up&&null!=(s=Y.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 Ne(()=>{var e;Te(null==(e=Y.current)?void 0:e.element)})}Ne(i.noop)}else n===i.Keys.down&&Ne(()=>{var e;Te((null==(e=Y.current)?void 0:e.element)||o)});else a&&n===i.Keys.down&&(e.preventDefault(),Ke(l))},[fe,Me,Te,Ne,Ke,ae,b,K,De]),qe=h.useCallback(e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Ne(t===i.Keys.up?()=>{Te(j.current)}:()=>{Te(ee.current&&ee.current.element)}))},[Te,Ne]),We=h.useCallback(e=>{if(!G.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};De(t,[],"clear"),Me(t),e.preventDefault()},[De,Me]),Ae=h.useCallback((e,t)=>{var s;Me({target:G.current}),de||Te(null==(s=Y.current)?void 0:s.element),De({syntheticEvent:t,nativeEvent:t.nativeEvent,target:G.current},e,"delete")},[De,Me,Te,de]),Ue=h.useCallback(e=>{if(a.onExpandChange&&G.current){const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,o={level:je(s),item:t,nativeEvent:i,syntheticEvent:n,target:G.current};a.onExpandChange.call(void 0,o)}},[a.onExpandChange]),Je=h.useCallback(e=>{if(a.onFilterChange&&G.current){const t={filter:{field:a.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:G.current};a.onFilterChange.call(void 0,t),void 0===a.filter&&me(e.target.value)}},[a.onFilterChange,a.filter,a.textField]);h.useCallback(e=>{if(!G.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:G.current};a.onCancel&&a.onCancel.call(void 0,t),Me(t),e.preventDefault()},[a.onCancel,Me]);const Qe=h.useCallback(e=>{for(const t of e)ce(t.target.clientWidth)},[]),Xe=a.listNoData||Be,et=r.useLocalization(),tt=!W||Ce.valid,st=we&&fe?he:se.current,it=null!=(s=a.ariaDescribedBy)?s:st.length>0?"tagslist-"+g:void 0,nt=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-multiselecttree k-input",a.className,{[`k-input-${$e[_]||_}`]:_,[`k-rounded-${Ge[H]||H}`]:H,[`k-input-${V}`]:V,"k-focus":de&&!N,"k-invalid":!tt,"k-disabled":N,"k-loading":a.loading,"k-required":q}),tabIndex:$,accessKey:a.accessKey,id:g,style:x?{...y,width:void 0}:y,dir:xe,ref:j,onKeyDown:N?void 0:Ve,onMouseDown:_e,onFocus:e=>{we?He(e):Re(e)},onBlur:ze,"aria-disabled":N||void 0,"aria-labelledby":a.ariaLabelledBy,onClick:N?void 0:He},h.createElement("div",{id:"tagslist-"+g,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${$e[_]||_}`]:_}),role:"listbox","aria-label":et.toLanguageString(I,w[I]),"aria-orientation":"horizontal"},st.length>0&&h.createElement(ye,{tag:a.tag,onTagDelete:Ae,data:st,guid:g,focused:ae?se.current.find(e=>z(e,ae,b)):void 0,size:_})),h.createElement("span",{className:"k-input-inner",role:"combobox","aria-haspopup":"tree","aria-expanded":fe,"aria-autocomplete":"list","aria-label":a.ariaLabel||x,"aria-controls":fe?m:void 0,"aria-describedby":it,"aria-disabled":!!N||void 0,"aria-required":q||void 0,tabIndex:0},0===st.length&&h.createElement("span",{className:"k-input-value-text"},C)),a.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),be&&!N&&st.length>0&&h.createElement(ie,{onClick:We}),h.createElement("select",{name:k,ref:X,tabIndex:-1,"aria-hidden":!0,title:x,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:a.valueMap?a.valueMap.call(void 0,K):K})),!we&&h.createElement(o.Popup,{...T,popupClass:i.classNames(T.popupClass,"k-multiselecttree-popup"),className:i.classNames(T.className,{"k-rtl":"rtl"===xe}),style:Ie,anchor:T.anchor||j.current,show:fe,onOpen:Pe,onClose:Oe,ref:ne},a.filterable&&h.createElement(E,{value:void 0===a.filter?ve:a.filter,ref:Y,onChange:Je,onKeyDown:qe,tabIndex:$,size:_,rounded:H,fillMode:V,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),f.length>0?h.createElement(p.TreeView,{id:m,style:{height:T.height},animate:!1,ref:ee,tabIndex:$,data:f,focusIdField:b,textField:a.textField,checkField:O,checkIndeterminateField:L,expandField:a.expandField,childrenField:B,expandIcons:!0,onItemClick:Fe,onCheckChange:Fe,onExpandChange:Ue,checkboxes:!0,size:_,item:a.item,dir:xe}):h.createElement(Xe,null,et.toLanguageString(v,w[v])),l&&h.createElement(i.WatermarkOverlay,{message:d}))),we&&(()=>{const e=a.filterable?h.createElement(E,{value:void 0===a.filter?ve:a.filter,ref:Z,onChange:Je,onKeyDown:qe,size:"large",rounded:H,fillMode:V,placeholder:C}):null,t={title:a.adaptiveTitle||a.label,subTitle:a.adaptiveSubtitle,expand:fe,onClose:e=>Me(e),windowWidth:pe,mobileFilter:e};return h.createElement(Q,{...t},h.createElement(u.ActionSheetContent,null,f.length>0?h.createElement(p.TreeView,{id:m,ref:ee,animate:!1,tabIndex:$,data:f,focusIdField:b,textField:a.textField,checkField:O,checkIndeterminateField:L,expandField:a.expandField,childrenField:B,expandIcons:!0,onItemClick:Fe,onCheckChange:Fe,onExpandChange:Ue,checkboxes:!0,size:"large",item:a.item,dir:xe}):h.createElement(Xe,null,et.toLanguageString(v,w[v]))))})());return x?h.createElement(n.FloatingLabel,{label:x,editorValue:be,editorPlaceholder:C,editorValid:tt,editorDisabled:N,editorId:g,style:{width:y?y.width:void 0},children:nt,dir:xe}):nt}),Qe={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,adaptiveSubtitle:s.string,adaptive:s.bool};Je.displayName="KendoReactMultiSelectTree",Je.propTypes=Qe;const Xe=(e,t)=>{const s={};return e&&e.length&&e.forEach(e=>{s[t(e)]=!0}),s},et=de,tt=me,st=Ke;e.AutoComplete=tt,e.AutoCompletePropsContext=ge,e.AutoCompleteWithoutContext=he,e.ComboBox=et,e.ComboBoxPropsContext=le,e.ComboBoxWithoutContext=oe,e.DropDownList=X,e.DropDownListPropsContext=te,e.DropDownTree=Ae,e.DropDownTreePropsContext=We,e.List=U,e.ListContainer=g,e.ListFilter=E,e.ListItem=W,e.MultiColumnComboBox=Te,e.MultiColumnComboBoxPropsContext=Ne,e.MultiSelect=st,e.MultiSelectPropsContext=De,e.MultiSelectTree=Je,e.MultiSelectTreePropsContext=Ze,e.MultiSelectWithoutContext=Ee,e.SearchBar=se,e.TagList=ye,e.dropDownListDefaultProps=ee,e.dropdownsMessages=w,e.findByFieldValue=(e,t,s)=>{if(!e)return;const i=e.findIndex(e=>P(e,t)===s);return e[i]},e.getItemValue=P,e.getMultiSelectTreeValue=(e,t)=>{const{items:s,dataItemKey:n,value:a,subItemsField:o="items",operation:l}=t,r=i.getter(n),d=Xe(a,r);if("clear"===l)return[];if("delete"===l){const e=Xe(s,r);return a.filter(t=>!e[r(t)])}const u=s[0],p=r(u),c=i.getter(o),h=[...e],g=[];let v,m=[];for(;h.length;){const e=h.pop();if(p===r(e)){m=g.map(e=>e.item),v=e;break}{g&&g.length&&g[g.length-1].parentPosition===h.length&&g.pop();const t=c(e);t&&t.length&&(g.push({item:e,parentPosition:h.length}),h.push(...t))}}const f=[...c(v)||[]],b=[];for(;f.length;){const e=f.pop();b.push(e);const t=c(e);t&&t.length&&f.push(...t)}const y=[];if(!d[p]){y.push(...a),y.push(v),y.push(...b.filter(e=>!d[r(e)]));const e=m.filter(e=>!d[r(e)]),t=Xe(y,r);for(let s=e.length-1;s>-1;s--){const i=e[s],n=c(i);if(n.filter(e=>t[r(e)]).length<n.length)break;y.push(i),t[r(i)]=!0}}else{const e=r(v),t=Xe(b,r),s=Xe(m,r);y.push(...a.filter(i=>{const n=r(i);return!t[n]&&e!==n&&!s[n]}))}return y},e.getValueMap=Xe,e.nodata=v,e.scrollToItem=M});
@@ -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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1778773241,version:"14.5.0-develop.15",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"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1778828115,version:"14.5.0-develop.16",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"});exports.packageMetadata=e;
@@ -6,8 +6,8 @@ export const packageMetadata = Object.freeze({
6
6
  productName: 'KendoReact',
7
7
  productCode: 'KENDOUIREACT',
8
8
  productCodes: ['KENDOUIREACT'],
9
- publishDate: 1778773241,
10
- version: '14.5.0-develop.15',
9
+ publishDate: 1778828115,
10
+ version: '14.5.0-develop.16',
11
11
  licensingDocsUrl:
12
12
  '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'
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-dropdowns",
3
- "version": "14.5.0-develop.15",
3
+ "version": "14.5.0-develop.16",
4
4
  "description": "React DropDowns offer an interface for users to select different items from a list and more. KendoReact Dropdowns package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,14 +26,14 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.7.2",
29
- "@progress/kendo-react-buttons": "14.5.0-develop.15",
30
- "@progress/kendo-react-common": "14.5.0-develop.15",
31
- "@progress/kendo-react-inputs": "14.5.0-develop.15",
32
- "@progress/kendo-react-intl": "14.5.0-develop.15",
33
- "@progress/kendo-react-labels": "14.5.0-develop.15",
34
- "@progress/kendo-react-layout": "14.5.0-develop.15",
35
- "@progress/kendo-react-popup": "14.5.0-develop.15",
36
- "@progress/kendo-react-treeview": "14.5.0-develop.15",
29
+ "@progress/kendo-react-buttons": "14.5.0-develop.16",
30
+ "@progress/kendo-react-common": "14.5.0-develop.16",
31
+ "@progress/kendo-react-inputs": "14.5.0-develop.16",
32
+ "@progress/kendo-react-intl": "14.5.0-develop.16",
33
+ "@progress/kendo-react-labels": "14.5.0-develop.16",
34
+ "@progress/kendo-react-layout": "14.5.0-develop.16",
35
+ "@progress/kendo-react-popup": "14.5.0-develop.16",
36
+ "@progress/kendo-react-treeview": "14.5.0-develop.16",
37
37
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
38
38
  "react": "^18.0.0 || ^19.0.0",
39
39
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -82,7 +82,7 @@
82
82
  "package": {
83
83
  "productName": "KendoReact",
84
84
  "productCode": "KENDOUIREACT",
85
- "publishDate": 1778773241,
85
+ "publishDate": 1778828115,
86
86
  "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"
87
87
  }
88
88
  },