@progress/kendo-react-dateinputs 13.3.0-develop.3 → 13.3.0-develop.4

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-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-dateinputs-common"),require("@progress/kendo-intl"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-dateinputs-common","@progress/kendo-intl","@progress/kendo-react-popup","@progress/kendo-react-layout"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDateinputs={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoDateMath,e.KendoReactIntl,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLabels,e.KendoDateinputsCommon,e.KendoIntl,e.KendoReactPopup,e.KendoReactLayout)}(this,(function(e,t,i,s,a,n,o,r,l,h,c,u,d){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var m=p(t);const g=e=>Math.max(e,0);let v=class{constructor(e){this.offset=e}},f=class{constructor(e){this.skip=e}},w=class{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(e,t,i,s,a=0,n=0,o="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=s,this.lastScrollTop=0,this.topOffset=a,this.bottomOffset=n,this.direction=o;const r=this.rowsForHeight(a),l=g(t-r);this.onScrollAction(new v(this.rowOffset(l))),this.onPageAction(new f(l))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:s}){const a="vertical"===this.direction?t:e,n="vertical"===this.direction?i:s;if(this.lastScrollTop===a||!this.rowHeightService)return;const o=this.lastScrollTop>=a;this.lastScrollTop=a;const r=this.rowHeightService.index(g(a-this.topOffset)),l=this.rowHeightService.index(g(a+n-this.bottomOffset));if(!o&&l>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=r,this.onScrollAction(new v(this.rowOffset(r))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new f(this.firstLoaded))),o&&r<=this.firstLoaded){const e=Math.floor(.3*this.take);this.firstLoaded=g(r-e),this.onScrollAction(new v(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new f(this.firstLoaded))}}rowOffset(e){return this.rowHeightService?this.rowHeightService.offset(e)+this.topOffset:0}rowsForHeight(e){return this.rowHeightService?Math.ceil(e/this.rowHeightService.height(0)):0}};const b={1:e=>t=>t+e,0:e=>t=>t-e},D={1:e=>t=>Math.min(t,e),0:e=>t=>Math.max(t,e)},y={1:e=>t=>t<e,0:e=>t=>t>e},S=class e extends m.Component{constructor(t){super(t),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=e=>{const t="vertical"===this.direction?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&"scrollTop"===t&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<10||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t),{start:s,end:a}=this.scrollRange(t,i);if(s===a)return;const n=this.scrollStep(s,a),o=b[i](n),r=D[i](a),l=y[i](o(a)),h=e=>{this.animationInProgress=!0;const t=o(e);this.scrollTo(r(t)),l(t)?this.cancelAnimation=window.requestAnimationFrame((()=>{h(t)})):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame((()=>{h(s)}))},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const s=this.props.scrollDuration||e.defaultProps.scrollDuration;return Math.abs(i-t)/(s/17)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const s=this.containerMaxScroll(),a=0===t?1:-1,n=((e,t,i)=>Math.min(Math.abs(t-e),i))(i,e,this.props.maxScrollDifference||0),o=Math.min(e,s);return{start:Math.min(Math.max(o+a*n,0),s),end:o}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t="vertical"===this.direction?e.itemHeight:e.itemWidth;void 0!==t&&(this.rowHeightService=new s.RowHeightService(e.total,t),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:s}=this.props,a={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),s&&s.call(void 0,a),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new w(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(m.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty("vertical"===this.direction?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty("vertical"===this.direction?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty("vertical"===this.direction?"scrollTop":"scrollLeft")}get direction(){return void 0!==this.props.direction?this.props.direction:e.defaultProps.direction}get scrollOffsetSize(){return void 0!==this.props.scrollOffsetSize?this.props.scrollOffsetSize:e.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,s=this.rowHeightService.offset(e),a=s+this.rowHeightService.height(e);return s>=t&&a<=i}isListScrolled(e){return!!this.rowHeightService&&this.containerScrollPosition!==this.rowHeightService.offset(e)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){const{total:e,take:t,bottomOffset:i,className:a,tabIndex:n,role:o,children:r,unstyled:l}=this.props,h=l&&l.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const c=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,u="vertical"===this.direction?{height:`${c}px`}:{width:`${c}px`},d=s.classNames(s.uCalendar.scrollableSelector({c:h}),s.uCalendar.scrollable({c:h,horizontal:"horizontal"===this.direction}),a),p=s.classNames(s.uCalendar.scrollablePlaceholder({c:h,horizontal:"horizontal"===this.direction}));return m.createElement("div",{ref:e=>{this.scrollContainer=e},onScroll:this.handleScroll,className:d,tabIndex:n,role:o},r,m.createElement("div",{style:u,className:p}))}};S.propTypes={bottomOffset:i.number.isRequired,className:i.string,direction:i.oneOf(["horizontal","vertical"]),forceScroll:i.bool,itemHeight:i.number,itemWidth:i.number,maxScrollDifference:i.number,onScroll:i.func,onScrollAction:i.func,scrollDuration:i.number,scrollOffsetSize:i.number,skip:i.number.isRequired,tabIndex:i.number,take:i.number.isRequired,topOffset:i.number.isRequired,total:i.number.isRequired,role:i.string},S.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let C=S;let k=class extends m.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:s,...a}=e;return!((!t||!s||t.getTime()===s.getTime())&&((e,t)=>{const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertyNames(t);if(i.length!==s.length)return!1;for(let s=0;s<i.length;s++){const a=i[s];if(e[a]!==t[a])return!1}return!0})(i,a))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:n,isSelected:o,isRangeStart:r,isRangeMid:l,isRangeEnd:h,isRangeSplitStart:c,isRangeSplitEnd:u,isToday:d,isDisabled:p,view:g,value:v,isOtherMonth:f,showOtherMonthDays:w,allowReverse:b,unstyled:D,...y}=this.props,S="end"===this.props.activeRangeEnd&&h,C="start"===this.props.activeRangeEnd&&r,k=D&&D.uCalendar,x=s.classNames(s.uCalendar.td({c:k,rangeStart:!f&&!b&&r,rangeEnd:!f&&!b&&h,rangeMid:!f&&l,rangeSplitEnd:!f&&u,rangeSplitStart:!f&&c,active:C||S,focused:a,selected:!f&&(o||r||h),today:!f&&d,weekend:i,disabled:p,isOtherMonth:f,isEmpty:!w&&f}),e);return!w&&f?m.createElement("td",{role:"gridcell",className:x}):m.createElement("td",{...y,className:x,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},m.createElement("span",{className:s.classNames(s.uCalendar.link({c:k}))},this.props.children))}};const x=e=>{const{className:t,firstDate:i,weekDays:a,...n}=e,o=s.useUnstyled(),r=o&&o.uCalendar;return m.createElement("td",{className:s.classNames(s.uCalendar.td({c:r,isWeek:!0}),t),...n,onClick:t=>{const{onClick:s}=e;s&&t&&s.call(void 0,i,a||[],t)}},e.children)};var I=(e=>(e[e.month=0]="month",e[e.year=1]="year",e[e.decade=2]="decade",e[e.century=3]="century",e))(I||{});const M={start:null,end:null};function T(e){const t=(t,i,s,...a)=>null===i[s]?null:(t?e.isRequired:e)(i,s,...a),i=t.bind(null,!1);return i.isRequired=t.bind(null,!0),i}const O=(e,t,i)=>void 0===t||void 0===i||t<=e&&e<=i?e:e<t?t:i,E=new Date(1980,0,1),V=new Date(1900,0,1),N=new Date(2099,11,31),R=new Date(1980,0,1),P=new Date(1980,0,1,23,59,59),F=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},L=()=>a.getDate(new Date),B=(e,t,i)=>!e||!(t&&t>e||i&&i<e),A=(e,t,i)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||i&&a.getDate(i)<a.getDate(e)),z=(e,t)=>{const{start:i,end:s}=t||M;return!(!i||!s)&&(i<e&&e<s)},H=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},_=(e,t,i)=>t.getTime()<=e.getTime()&&e.getTime()<=i.getTime(),q=(e,t,i)=>e&&(t&&e<t?a.cloneDate(t):i&&e>i?a.cloneDate(i):e),W=e=>(t,i="",s={})=>{const a=document.createElement(e);return a.className=i,Object.keys(s).forEach((e=>{a.style[e]=s[e]})),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function K(e,t,i={}){let s,a,n,o,r;i.maxWait;const l=window,h=!1,c=!1,u=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){const i=s,o=a;return s=a=void 0,n=e.apply(o,i),n}function p(e,t){return u?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-r;return void 0===r||i>=t||i<0||c}function g(){const e=Date.now();if(m(e))return v();o=p(g,function(e){return t-(e-r)}(e))}function v(e){return o=void 0,s?d():(s=a=void 0,n)}function f(...e){const i=Date.now(),l=m(i);return s=e,a=this,r=i,l&&void 0===o?(o=p(g,t),h?d():n):(void 0===o&&(o=p(g,t)),n)}return t=+t||0,f.cancel=function(){void 0!==o&&function(e){if(u)return l.cancelAnimationFrame(e);clearTimeout(e)}(o),s=r=a=o=void 0},f.flush=function(){return void 0===o?n:v()},f.pending=function(){return void 0!==o},f}let U=class{constructor(e){this.intl=e}getWeekNames(e=!1,t){const i=((e,t)=>e.slice(t).concat(e.slice(0,t)))(this.intl.dateFormatNames({nameType:null!=t?t:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(i):i}};const Y=(e,t)=>{const i=t;return m.createElement("td",{key:e,role:"gridcell",className:s.classNames(s.uCalendar.td({c:i,isEmpty:!0}))}," ")},$=class e extends m.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(e,t)=>{if(!this.firstDate(e))return Y(`week-cell-${t}`);const i=this.firstDate(e),s=this.getWeekNumber(i),a=`kendo-react-calendar-week-cell-${s}`,n={value:s,firstDate:i,weekDays:e,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?m.createElement(this.props.weekCell,{...n,key:a},s):m.createElement(x,{...n,key:a},s)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return Y(t);const i={"aria-selected":e.isSelected},s=`kendo-react-calendar-cell-${e.value.getTime()}`,a={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,unstyled:this.props.unstyled,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?m.createElement(this.props.cell,{...a,key:s},e.formattedValue):m.createElement(k,{...a,key:s},e.formattedValue)})),this.firstDate=e=>{const t=this.firstWeekDateContext(e);return t?t.value:null},this.firstWeekDateContext=e=>{if(!this.weekNumber)return null;let t=0,i=e[t];for(;!i&&t<e.length;)i=e[++t];return i},this.handleClick=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props,a=t.findIndex((t=>t&&t.value===e));s&&i&&s.call(void 0,e,a,i)},this.handleMouseEnter=e=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,a.cloneDate(e))},this.handleMouseLeave=e=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,a.cloneDate(e))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return"horizontal"===this.props.direction}get isMonthView(){return this.props.activeView===I.month}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==I.month)}get selectedDate(){return void 0!==this.props.selectedDate?this.props.selectedDate:e.defaultProps.selectedDate}render(){const{service:e,weekDaysFormat:t,cellUID:i,focusedDate:a,bus:o,activeView:r,selectionRange:l,unstyled:h}=this.props,c=h&&h.uCalendar;this.intl=n.provideIntlService(this),this.weekService=new U(this.intl);const u=this.weekService.getWeekNames(this.weekNumber,t),d=e.rowLength(this.weekNumber),p=e.title(this.props.viewDate),g=L(),v=F(this.props.viewDate,g),f=e.data({cellUID:i,min:this.min,max:this.max,focusedDate:a,isActiveView:!o.canMoveDown(r),selectedDate:this.selectedDate,selectionRange:l,viewDate:v});return m.createElement(m.Fragment,null,this.isMonthView&&this.isHorizontal&&m.createElement("thead",{role:"rowgroup",className:s.classNames(s.uCalendar.thead({c:c}))},m.createElement("tr",{role:"row",className:s.classNames(s.uCalendar.tr({c:c}))},u.map(((e,t)=>m.createElement("th",{key:t,className:s.classNames(s.uCalendar.th({c:c}))},e))))),m.createElement("tbody",{role:"rowgroup",className:s.classNames(s.uCalendar.tbody({c:c}))},!this.isHorizontal&&m.createElement("tr",{role:"presentation",className:s.classNames(s.uCalendar.tr({c:c}))},m.createElement("th",{scope:"col",colSpan:d,className:s.classNames(s.uCalendar.caption({c:c}))},p)),f.map(((e,t)=>m.createElement("tr",{role:"row",className:s.classNames(s.uCalendar.tr({c:c})),key:t},this.weekNumber&&this.buildWeekNumber(e,t),this.buildRow(e))))))}getWeekNumber(e){return this.weekNumber&&this.intl?a.weekInYear(e,this.intl.firstDay()):null}};$.propTypes={activeRangeEnd:i.oneOf(["start","end",null]),activeView:i.number.isRequired,cellUID:i.string.isRequired,direction:i.oneOf(["horizontal","vertical"]),focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,selectedDate:i.oneOfType([i.instanceOf(Date),i.arrayOf(i.instanceOf(Date))]),showWeekNumbers:i.bool,showOtherMonthDays:i.bool,viewDate:i.instanceOf(Date).isRequired},$.defaultProps={direction:"vertical",selectedDate:L(),showWeekNumbers:!1};let j=$;n.registerForIntl(j);const Z=e=>{const{view:t,...i}=e;return m.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...i},e.children)},J=class e extends m.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),i=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(i,this.min,this.max)?t:`${t} - ${this.props.service.title(i)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get rangeLength(){return void 0!==this.props.rangeLength?this.props.rangeLength:e.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const{activeView:e,commands:t,unstyled:i}=this.props,a=i&&i.uCalendar,n=this.getTitle(),o={children:n,value:n,view:e,className:s.classNames(s.uCalendar.title({c:a})),onClick:this.handleTitleClick,disabled:!this.canMoveUp},r={headerTitleProps:o,commands:t},l=this.props.headerTitle?m.createElement(this.props.headerTitle,{...o},n):m.createElement(Z,{...o},n),h=this.props.header?m.createElement(this.props.header,{...r}):m.createElement(m.Fragment,null,l,m.createElement("span",{className:s.classNames(s.uCalendar.spacer({c:a}))}),m.createElement("span",{className:s.classNames(s.uCalendar.nav({c:a}))},this.props.commands));return m.createElement("div",{className:s.classNames(s.uCalendar.header({c:a,vertical:this.props.verticalView}))},h)}};J.propTypes={activeView:i.number.isRequired,currentDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,rangeLength:i.number},J.defaultProps={rangeLength:1,min:V,max:N};let G=J;n.registerForLocalization(G);const X="multiviewcalendar.prevView",Q="multiviewcalendar.nextView",ee="dateinput.increment",te="dateinput.decrement",ie="dateinput.clear",se="calendar.today",ae="datepicker.toggleCalendar",ne="daterangepicker.swapStartEnd",oe="daterangepicker.start",re="daterangepicker.end",le="daterangepicker.separator",he="datetimepicker.toggleDateTimeSelector",ce="timepicker.now",ue="timepicker.selectNow",de="timepicker.cancel",pe="timepicker.set",me="timepicker.toggleTimeSelector",ge="timepicker.toggleClock",ve="datetimepicker.date",fe="datetimepicker.time",we="datetimepicker.cancel",be="datetimepicker.set",De="daterangepicker.cancel",ye="daterangepicker.set",Se={[se]:"Today",[ce]:"NOW",[pe]:"Set",[de]:"Cancel",[ve]:"Date",[fe]:"Time",[we]:"Cancel",[be]:"Set",[De]:"Cancel",[ye]:"Set",[oe]:"Start",[re]:"End",[le]:" ",[ue]:"Select Now",[me]:"Toggle TimeSelector",[ge]:"Toggle Clock",[ee]:"Increase value",[te]:"Decrease value",[ie]:"clear",[ae]:"Toggle calendar",[X]:"Navigate to previous view",[Q]:"Navigate to next view",[ne]:"Swap start and end values",[he]:"Toggle date-time selector"},Ce=class e extends m.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:q(L(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get todayIsInRange(){return B(L(),a.getDate(this.min),a.getDate(this.max))}render(){const{disabled:e,tabIndex:t,unstyled:i}=this.props,a=i&&i.uCalendar;this.localization=n.provideLocalizationService(this);const r=this.localization.toLanguageString(se,Se[se]),l=s.classNames(s.uCalendar.today({c:a,disabled:e}));return m.createElement(o.Button,{className:l,onClick:this.handleClick,tabIndex:t,fillMode:"flat",themeColor:"base",role:"link"},r)}};Ce.propTypes={max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onClick:i.func,disabled:i.bool},Ce.defaultProps={min:V,max:N};let ke=Ce;n.registerForLocalization(ke);const xe=class e extends m.Component{constructor(e){super(e),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.weekService=null,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=q(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildMonthView=(e,t)=>{const{unstyled:i}=this.props,a=i&&i.uCalendar;return m.createElement("table",{key:"calendar-view-list-weekdays",className:s.classNames(s.uCalendar.table({c:a,weekdays:!0})),role:"grid",tabIndex:this.props.tabIndex},m.createElement("colgroup",null,e.map(((e,t)=>m.createElement("col",{key:t})))),m.createElement("thead",{className:s.classNames(s.uCalendar.thead({c:a}))},m.createElement("tr",{className:s.classNames(s.uCalendar.tr({c:a}))},t.map(((e,t)=>m.createElement("th",{key:t,className:s.classNames(s.uCalendar.th({c:a}))},e))))))},this.buildDates=(e,t)=>{const i=this.props.cellUID,{unstyled:a}=this.props,n=a&&a.uCalendar;return m.createElement("table",{className:s.classNames(s.uCalendar.table({c:n})),ref:e=>{this.table=e},role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},m.createElement("colgroup",null,e.map(((e,t)=>m.createElement("col",{key:t})))),t.map((e=>m.createElement(j,{ref:e=>{this.calendarView||(this.calendarView=e)},key:e.getTime(),activeView:this.props.activeView,viewDate:e,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:a}))))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===I.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const s=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==s)&&this.setState({index:e,skip:s}),this.table&&t){const e=`translateY(${t.offset}px)`;this.table.style.transform=e}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){return this.intl=n.provideIntlService(this),this.weekService=new U(this.intl),this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat)}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==I.month)}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get todayIsInRange(){return B(L(),a.getDate(this.props.min),a.getDate(this.props.max))}componentDidUpdate(e,t){this.shouldScroll=!1,void 0!==this.indexToScroll&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){const{activeView:e,min:t,max:i,service:n,unstyled:o}=this.props,r=o&&o.uCalendar;this.calculateHeights();const l=this.lastView!==e,h=q(this.props.focusedDate,t,i),c=l?n.skip(h,t):this.state.skip,u=n.total(t,i),d=this.getTake(c,u),p=n.addToDate(t,c),g=n.addToDate(t,this.state.index),v=new Array(n.rowLength(this.weekNumber)).fill(""),f=e!==this.lastView;this.animateToIndex=!f,(f||!a.isEqualDate(this.lastFocus,h)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(h,this.props.min)),this.lastFocus=h;const w=s.classNames(s.uCalendar.view({c:r,month:e===I.month,year:e===I.year,decade:e===I.decade,century:e===I.century})),b=this.buildDates(v,n.datesList(p,d)),D=m.createElement(m.Fragment,null,m.createElement(G,{key:"calendar-view-list-header",currentDate:g,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,header:this.props.header,unstyled:o,commands:m.createElement(ke,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex,unstyled:o})}),this.props.activeView===I.month&&this.buildMonthView(v,this.weekNames),m.createElement(C,{key:"calendar-view-list-content",skip:c,take:this.take,total:u,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:e=>!this.virtualization&&this.handleVirtualizationMount(e),children:b,tabIndex:this.props.tabIndex,unstyled:o}));return m.createElement("div",{ref:e=>{this._element=e},className:w},this.props.dom.didCalculate?D:null)}};xe.propTypes={activeView:i.number.isRequired,bottomOffset:i.number,cellUID:i.string.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,showWeekNumbers:i.bool,smoothScroll:i.bool,take:i.number,value:i.instanceOf(Date),viewHeight:i.number,viewOffset:i.number,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),tabIndex:i.number},xe.defaultProps={take:5,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let Ie=xe;n.registerForIntl(Ie);const Me=e=>{const{className:t,isRangeStart:i,value:a,text:n,view:o,...r}=e,l=s.useUnstyled(),h=l&&l.uCalendar;return m.createElement("li",{...r,onClick:t=>{var i;null==(i=e.onClick)||i.call(e,a,t)},className:s.classNames(s.uCalendar.li({c:h}),t)},m.createElement("span",{className:s.classNames(s.uCalendar.navigationMarker({c:h,isRangeStart:i}))},e.children))},Te=class e extends m.Component{constructor(e){super(e),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const e=q(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildNavigationItem=e=>{const t=this.props.service.navigationTitle(e),i=this.props.service.isRangeStart(e),s=`kendo-react-calendar-nav-item-${e.getTime()}`,a={text:t,value:e,isRangeStart:i,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?m.createElement(this.props.navigationItem,{...a,key:s},t):m.createElement(Me,{...a,key:s},t)},this.calculateHeights=()=>{const e=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(e-this.itemHeight)/2,this.bottomOffset=e-this.itemHeight},this.handleDateChange=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleScrollAction=({scrollAction:e,pageAction:t})=>{const i=t?t.skip:this.state.skip;if(this.state.skip!==i&&this.setState({skip:i}),this.list&&e){const t=`translateY(${e.offset}px)`;this.list.style.transform=t}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),i=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,i)>0?t:0}}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}componentDidUpdate(e,t){void 0!==this.indexToScroll&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){const{activeView:e,min:t,max:i,service:n,unstyled:o}=this.props;this.calculateHeights();const r=o&&o.uCalendar,l=this.lastView!==e,h=q(this.props.focusedDate,t,i),c=l?n.skip(h,t):this.state.skip,u=n.total(t,i),d=this.getTake(c,u),p=n.addToDate(t,c),g=n.datesList(p,d);(e!==this.lastView||!a.isEqual(h,this.lastFocus))&&(this.indexToScroll=n.skip(h,t));const v=m.createElement(C,{skip:c,take:this.take,total:u,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:e=>!this.virtualization&&this.handleVirtualizationMount(e),tabIndex:this.props.tabIndex,unstyled:o},m.createElement("ul",{ref:e=>{this.list=e},className:s.classNames(s.uCalendar.ul({c:r}))},g.map((e=>this.buildNavigationItem(e)))));return m.createElement("div",{className:s.classNames(s.uCalendar.navigation({c:r}))},m.createElement("span",{className:s.classNames(s.uCalendar.navigationHighlight({c:r}))}),this.props.dom.didCalculate?v:null)}getTake(e,t){return Math.min(t-e,this.take)}};Te.propTypes={activeView:i.number.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,take:i.number,tabIndex:i.number},Te.defaultProps={take:30};let Oe=Te;var Ee=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.PrevView=4]="PrevView",e[e.NextView=5]="NextView",e[e.FirstInView=6]="FirstInView",e[e.LastInView=7]="LastInView",e[e.LowerView=8]="LowerView",e[e.UpperView=9]="UpperView",e))(Ee||{});const Ve=[[]],Ne={[Ee.Left]:e=>a.addDecades(e,-1),[Ee.Up]:e=>a.addDecades(e,-5),[Ee.Right]:e=>a.addDecades(e,1),[Ee.Down]:e=>a.addDecades(e,5),[Ee.PrevView]:e=>a.addCenturies(e,-1),[Ee.NextView]:e=>a.addCenturies(e,1),[Ee.FirstInView]:e=>a.firstDecadeOfCentury(e),[Ee.LastInView]:e=>a.lastDecadeOfCentury(e)};class Re{addToDate(e,t){return a.addCenturies(e,t)}datesList(e,t){return H(0,t).map((t=>a.addCenturies(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return Ve;const c=H(0,4),u=a.firstDecadeOfCentury(h),d=a.lastDecadeOfCentury(h),p=L();return H(0,3).map((e=>{const h=a.addDecades(u,4*e);return c.map((e=>{const c=this.normalize(a.addDecades(h,e),o,n),m=this.isEqual(c,l.start),g=this.isEqual(c,l.end),v=!m&&!g&&z(c,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(c,r,o,n):B(r,o,n)&&this.isEqual(c,r));return _(c,u,d)?{formattedValue:this.value(c),id:`${t}${c.getTime()}`,isFocused:this.isEqual(c,i),isSelected:f,isWeekend:!1,isInRange:B(c,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(c,d),isRangeSplitStart:v&&this.isEqual(c,u),isToday:this.isEqual(c,p),title:this.cellTitle(c),value:c}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&a.firstYearOfDecade(e).getFullYear()===a.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const s=a.firstYearOfDecade(e).getFullYear(),n=!t||a.firstYearOfDecade(t).getFullYear()<=s,o=!i||s<=a.firstYearOfDecade(i).getFullYear();return n&&o}isInSameView(e,t){return 0===a.durationInCenturies(e,t)}isRangeStart(e){return e.getFullYear()%1e3==0}move(e,t){const i=Ne[t];return i?i(e):e}cellTitle(e){return a.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?a.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${a.firstDecadeOfCentury(e).getFullYear()} - ${a.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInCenturies(t,e)}total(e,t){return a.durationInCenturies(e,t)+1}value(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInCenturies(e,t)<i?a.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}}const Pe=[[]],Fe={[Ee.Left]:e=>a.addYears(e,-1),[Ee.Up]:e=>a.addYears(e,-5),[Ee.Right]:e=>a.addYears(e,1),[Ee.Down]:e=>a.addYears(e,5),[Ee.PrevView]:e=>a.addDecades(e,-1),[Ee.NextView]:e=>a.addDecades(e,1),[Ee.FirstInView]:e=>a.firstYearOfDecade(e),[Ee.LastInView]:e=>a.lastYearOfDecade(e)};let Le=class{addToDate(e,t){return a.addDecades(e,t)}datesList(e,t){return H(0,t).map((t=>a.addDecades(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return Pe;const c=H(0,4),u=a.firstYearOfDecade(h),d=a.lastYearOfDecade(h),p=L();return H(0,3).map((e=>{const h=a.addYears(u,4*e);return c.map((e=>{const c=this.normalize(a.addYears(h,e),o,n),m=this.isEqual(c,l.start),g=this.isEqual(c,l.end),v=!m&&!g&&z(c,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(c,r,o,n):B(r,o,n)&&this.isEqual(c,r));return _(c,u,d)?{formattedValue:this.value(c),id:`${t}${c.getTime()}`,isFocused:this.isEqual(c,i),isSelected:f,isWeekend:!1,isInRange:B(c,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(c,d),isRangeSplitStart:v&&this.isEqual(c,u),isToday:this.isEqual(c,p),title:this.cellTitle(c),value:c}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const s=e.getFullYear(),a=!t||t.getFullYear()<=s,n=!i||s<=i.getFullYear();return a&&n}isRangeStart(e){return e.getFullYear()%100==0}isInSameView(e,t){return 0===a.durationInDecades(e,t)}move(e,t){const i=Fe[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${a.firstYearOfDecade(e).getFullYear()} - ${a.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInDecades(t,e)}total(e,t){return a.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInDecades(e,t)<i?a.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const Be=[[]],Ae={[Ee.Left]:e=>a.addDays(e,-1),[Ee.Up]:e=>a.addWeeks(e,-1),[Ee.Right]:e=>a.addDays(e,1),[Ee.Down]:e=>a.addWeeks(e,1),[Ee.PrevView]:e=>a.addMonths(e,-1),[Ee.NextView]:e=>a.addMonths(e,1),[Ee.FirstInView]:e=>a.firstDayOfMonth(e),[Ee.LastInView]:e=>a.lastDayOfMonth(e)};class ze{constructor(e){this.intl=e}addToDate(e,t){return a.addMonths(e,t)}datesList(e,t){return H(0,t).map((t=>a.addMonths(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return Be;const c=a.firstDayOfMonth(h),u=a.lastDayOfMonth(h),d=a.dayOfWeek(c,this.intl.firstDay(),-1),p=H(0,7),m=L();return H(0,6).map((e=>{const h=a.addDays(d,7*e);return p.map((e=>{const d=this.normalize(a.addDays(h,e),o,n),p=d<c||d>u,g=this.isEqual(d,l.start),v=this.isEqual(d,l.end),f=!g&&!v&&z(d,l),w=s&&(Array.isArray(r)?this.isSelectedFromArray(d,r,o,n):B(r,o,n)&&this.isEqual(d,r)),b=this.isEqual(d,i)&&!p;return{formattedValue:this.value(d),id:`${t}${d.getTime()}`,isFocused:b,isSelected:w,isInRange:B(d,o,n),isWeekend:this.isWeekend(d),isRangeStart:g,isRangeMid:f,isRangeEnd:v,isRangeSplitStart:f&&this.isEqual(d,c),isRangeSplitEnd:f&&this.isEqual(d,u),isToday:this.isEqual(d,m),title:this.cellTitle(d),value:d,isOtherMonth:p}}))}))}isEqual(e,t){return!(!e||!t)&&a.getDate(e).getTime()===a.getDate(t).getTime()}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isInArray(e,t){return!!t.length&&a.firstDayOfMonth(t[0])<=e&&e<=a.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const s=a.getDate(e),n=!t||a.getDate(t)<=s,o=!i||s<=a.getDate(i);return n&&o}isInSameView(e,t){return 0===a.durationInMonths(e,t)}isRangeStart(e){return!e.getMonth()}move(e,t){const i=Ae[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return 7+(e?1:0)}skip(e,t){return a.durationInMonths(t,e)}total(e,t){return a.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return a.durationInMonths(e,t)<i?a.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return 6===t||0===t}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.getDate(t):e>i&&this.isEqual(e,i)?a.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const He=[[]],_e={[Ee.Left]:e=>a.addMonths(e,-1),[Ee.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Ee.Right]:e=>a.addMonths(e,1),[Ee.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Ee.PrevView]:e=>a.addYears(e,-1),[Ee.NextView]:e=>a.addYears(e,1),[Ee.FirstInView]:e=>a.firstMonthOfYear(e),[Ee.LastInView]:e=>a.lastMonthOfYear(e)};let qe=class{constructor(e){this._intl=e}addToDate(e,t){return a.addYears(e,t)}datesList(e,t){return H(0,t).map((t=>a.addYears(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return He;const c=this.abbrMonthNames(),u=a.firstMonthOfYear(h),d=a.lastMonthOfYear(h),p=u.getFullYear(),m=H(0,4),g=L();return H(0,3).map((e=>{const h=a.addMonths(u,4*e);return m.map((e=>{const m=this.normalize(a.addMonths(h,e),o,n);if(p<m.getFullYear())return null;const v=this.isEqual(m,l.start),f=this.isEqual(m,l.end),w=!v&&!f&&z(m,l),b=s&&(Array.isArray(r)?this.isSelectedFromArray(m,r,o,n):B(r,o,n)&&this.isEqual(m,r));return{formattedValue:c[m.getMonth()],id:`${t}${m.getTime()}`,isFocused:this.isEqual(m,i),isSelected:b,isInRange:B(m,o,n),isWeekend:!1,isRangeStart:v,isRangeMid:w,isRangeEnd:f,isRangeSplitEnd:w&&this.isEqual(m,d),isRangeSplitStart:w&&this.isEqual(m,u),isToday:this.isEqual(m,g),title:this.cellTitle(m),value:m}}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const s=a.createDate(e.getFullYear(),e.getMonth(),1),n=!t||a.createDate(t.getFullYear(),t.getMonth(),1)<=s,o=!i||s<=a.createDate(i.getFullYear(),i.getMonth(),1);return n&&o}isInSameView(e,t){return 0===a.durationInYears(e,t)}isRangeStart(e){return e.getFullYear()%10==0}move(e,t){const i=_e[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return 4}skip(e,t){return a.durationInYears(t,e)}total(e,t){return a.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return a.durationInYears(e,t)<i?a.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const We={[I.month]:ze,[I.year]:qe,[I.decade]:Le,[I.century]:Re};let Ke=class{constructor(e){this.bottom=I.month,this.top=I.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new We[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const s=this.clamp(((e,t)=>{const i=I[I[e+t]];return void 0!==i?i:e})(e,t));s!==e&&this.onViewChanged({view:s},i)}};class Ue{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){void 0===this.calendarHeight&&this.calculateHeights()}calculateHeights(e,t){if(!s.canUseDOM)return;const i=W("div"),a=W("ul"),n=W("li"),o=W("td"),r=W("th"),l=W("tr"),h=W("tbody"),c=W("thead"),u=W("table"),d=t&&t.uCalendar,p=t&&t.uButton,m=s.strippedClassNames(s.uButton.wrapper({c:p,fillMode:"flat",size:"medium",rounded:"medium",themeColor:"primary"}),s.uCalendar.title({c:d})),g=()=>i(`\n <span class="${m}">\n <span class="${s.strippedClassNames(s.uButton.text({c:p}))}">March 2017</span>\n </span>\n <span class="${s.strippedClassNames(s.uCalendar.spacer({c:d}))}"></span>\n <span class="${s.strippedClassNames(s.uCalendar.nav({c:d}))}"><button class="${s.strippedClassNames(s.uCalendar.today({c:d}))}">TODAY</button></span>\n `,s.strippedClassNames(s.uCalendar.header({c:d,vertical:!0}))),v=(e,t)=>new Array(e).fill("1").map(t),f=e=>i(e,s.strippedClassNames(s.uCalendar.scrollableSelector({c:d}),s.uCalendar.scrollable({c:d,horizontal:!0}))),w=(()=>{let e;return()=>s.canUseDOM?(e||(e=i([f([a([n("<span>FEB</span>")])])],s.strippedClassNames(s.uCalendar.navigation({c:d})),{left:"0px",position:"absolute"})),e):null})(),b=({cells:e,rows:t},a,n)=>{let p;return()=>s.canUseDOM?(p||(p=((e,t,a)=>i(a?[g(),u([c([l([r("MO",s.strippedClassNames(s.uCalendar.th({c:d})))],s.strippedClassNames(s.uCalendar.tr({c:d})))],s.strippedClassNames(s.uCalendar.thead({c:d})))],s.strippedClassNames(s.uCalendar.table({c:d,weekdays:!0}))),f([e,e])]:[g(),f([e,e])],t,{left:"-10000px",position:"absolute"}))(((e,t=1)=>u([h([l([o("1",s.strippedClassNames(s.uCalendar.td({c:d,isWeek:!0})))])].concat(v(e,(()=>l(v(t,(e=>o(`<span class="${s.strippedClassNames(s.uCalendar.link({c:d}))}">${e}</span>`,s.strippedClassNames(s.uCalendar.td({c:d}))))),s.strippedClassNames(s.uCalendar.tr({c:d})))))),s.strippedClassNames(s.uCalendar.tbody({c:d})))],s.strippedClassNames(s.uCalendar.table({c:d}))))(t,e),a,n)),p):null},D=e=>e.querySelector(`.${s.strippedClassNames(s.uCalendar.scrollableSelector({c:d}))}`),y=e=>{const t=D(e);return t.className=`${t.className} scrollable-horizontal`,e},S=b({cells:7,rows:6},s.strippedClassNames(s.uCalendar.view({c:d,month:!0})),!0),C=b({cells:5,rows:3},s.strippedClassNames(s.uCalendar.view({c:d,year:!0})),!1),k=b({cells:5,rows:2},s.strippedClassNames(s.uCalendar.view({c:d,decade:!0})),!1),x=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,I=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},M=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(S(),(e=>{const t=M(e);this.calendarHeight=x(e),this.monthViewHeight=x(t),this.headerHeight=x(t.children[0]),this.scrollableContentHeight=x(D(e))})),this.batch(y(S()),(e=>{const t=M(e);this.calendarWidth=I(e),this.monthViewWidth=I(t),this.scrollableContentWidth=I(D(e))})),this.batch(C(),(e=>{this.yearViewHeight=x(M(e)),this.scrollableYearContentHeight=x(D(e))})),this.batch(y(C()),(e=>{this.yearViewWidth=I(M(e))})),this.batch(k(),(e=>{this.decadeViewHeight=x(M(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(y(k()),(e=>{this.decadeViewWidth=I(M(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(w(),(e=>{this.navigationItemHeight=x(e.querySelector("li"))}))}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i="height"===t?"ViewHeight":"ViewWidth";switch(e){case I.month:return this[`month${i}`];case I.year:return this[`year${i}`];case I.decade:return this[`decade${i}`];case I.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,s=i.appendChild(e);t(s),i.removeChild(s)}}const Ye={33:Ee.PrevView,34:Ee.NextView,35:Ee.LastInView,36:Ee.FirstInView,37:Ee.Left,38:Ee.Up,39:Ee.Right,40:Ee.Down,"meta+38":Ee.UpperView,"meta+40":Ee.LowerView};let $e=class{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return Ye[t]}move(e,t,i,s,a){return s?t===Ee.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,a),e):t===Ee.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,a),e):s.move(e,t):e}};class je{constructor(e){this.dom=e,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(e){const t=Math.max(this.dom.viewHeight(e)/this.dom.navigationItemHeight,1);this.divideByMagnitude=(e=>t=>Math.floor(t/e))(t),this.powerByMagnitude=(e=>t=>t*e)(t)}sync(e,t,i){if(e&&t){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled)return void(this.monthScrolled=!1);this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled)return void(this.navScrolled=!1);this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}const Ze=e=>e?e.virtualization:null,Je=(e=Xe.defaultProps.min,t=Xe.defaultProps.max,i,s)=>void 0!==s?null!==s&&B(a.getDate(s),e,t)?s:null:null!==i&&B(a.getDate(i),e,t)?i:null,Ge=class e extends m.Component{constructor(t){super(t),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(Ze(this.Navigation),Ze(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const t=a.cloneDate(e.value);this.setState({focusedDate:t})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=a.cloneDate(e.value),s=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(s){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:i});this.bus.moveToBottom(this.state.activeView)}this.setState({value:t,focusedDate:i}),this.valueDuringOnChange=t;const{onChange:n}=this.props;if(n){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:t,target:this};n.call(void 0,i)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(this.focusedDate&&this.service){if(84===t&&this.setState({focusedDate:L()}),(i||n)&&(t===s.Keys.left||t===s.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,31===this.focusedDate.getDate()&&this.focusedDate.setDate(30);const e=t===s.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,i=new Date(this.focusedDate.setMonth(e)),n=a.cloneDate(i);this.setState({focusedDate:n})}if(t===s.Keys.enter){if(null!==this.value&&a.isEqualDate(this.focusedDate,this.value)){const e=q(this.focusedDate,this.min,this.max);Ze(this.calendarViewList).scrollToIndex(this.service.skip(e,this.min))}const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=q(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.setState({focusedDate:t})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})};const i=Je(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:i,activeView:O(I[t.defaultActiveView],this.bottomView,this.topView),focusedDate:q(t.focusedDate||i||L(),this.min,this.max)},this.dom=new Ue,this.bus=new Ke(this.handleViewChange),this.navigation=new $e(this.bus),this.oldValue=i}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return I[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return I[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}componentDidMount(){const{unstyled:e}=this.props;Promise.resolve().then((()=>{s.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element,e),this.scrollSyncService=new je(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())}))}componentDidUpdate(e,t){s.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){const{_ref:t,unstyled:i,bottomView:o,topView:r,disabled:l,weekNumber:h,mobileMode:c,className:u}=this.props;t&&t(this);const d=i&&i.uCalendar,p=null!==this.value&&null!==this.oldValue?!a.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,g=O(this.state.activeView,I[void 0!==o?o:e.defaultProps.bottomView],I[void 0!==r?r:e.defaultProps.topView]),v=Je(this.min,this.max,this.value,this.value),f=v?a.getDate(v):null;this.focusedDate=a.getDate(q(p&&null!==v?v:this.state.focusedDate,this.min,this.max)),this.intl=n.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(g,this.intl);const{smoothScroll:w=Number.parseFloat(m.version)<18}=this.props,b=s.classNames(s.uCalendar.wrapper({c:d,disabled:l,weekNumber:h,mobileMode:c}),u),D=[this.props.navigation&&m.createElement(Oe,{key:0,ref:e=>{this.Navigation=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex,unstyled:i}),m.createElement(Ie,{key:1,ref:e=>{this.calendarViewList=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:w,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:f,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:i})];return m.createElement("div",{ref:e=>{this._element=e},className:b,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},D)}};Ge.displayName="Calendar",Ge.propTypes={className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),max:i.instanceOf(Date),min:i.instanceOf(Date),navigation:i.bool,smoothScroll:i.bool,onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,value:i.instanceOf(Date),weekNumber:i.bool,topView:(e,t,i)=>{const s=e[t],a=e.bottomView;return s&&a&&I[s]<I[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be smaller than bottomView.\n `):null},bottomView:(e,t,i)=>{const s=e[t],a=e.topView;return s&&a&&I[s]>I[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be bigger than topView.\n `):null}},Ge.defaultProps={disabled:!1,min:V,max:N,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let Xe=Ge;const Qe=s.createPropsContext(),et=s.withIdHOC(s.withPropsContext(Qe,s.withUnstyledHOC(Xe)));et.displayName="KendoReactCalendar",n.registerForIntl(Xe);const tt="dayperiod",it="hour",st="minute",at="second",nt=e=>(t,i)=>{const s=a.cloneDate(t);return s[e](i),s},ot=[{type:it,getter:e=>e.getHours()},{type:st,getter:e=>e.getMinutes()},{type:at,getter:e=>e.getSeconds()},{type:"millisecond",getter:e=>e.getMilliseconds()}],rt=(e=>t=>e.map((e=>t=>e[t.type]?(e=>(t,i)=>e(i))(t.getter):(e=>(t,i)=>e(t))(t.getter))((e=>e.reduce(((e,t)=>(e[t.type]=t.type,e)),{}))(t))))(ot),lt=(e=>(t,i)=>e.map((e=>{const s=Math.floor(t[e.type]);return s?((e,t,i,s)=>a=>{const n=e(a),o=e(i);return"hour"===s?n-(n-o)%t:a.getTime()<=i.getTime()&&0!==n&&n<=o?Math.ceil(n/t)*t:n-n%t})(e.getter,s,i,e.type):e.getter})))(ot),ht=e=>t=>{const i=a.cloneDate(t);return i.setHours(...e.map((e=>e(i)))),i},ct=nt("setHours"),ut=nt("setMinutes"),dt=nt("setSeconds"),pt=()=>new Date,mt=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},gt=(e,t,i)=>({candidateValue:F(E,e),maxValue:a.addDays(F(E,i),t.getHours()<i.getHours()?0:1),minValue:F(E,t)}),vt=(e,t,i)=>{if(!e||!t||!i)return!0;const{candidateValue:s,minValue:a,maxValue:n}=gt(e,t,i);return a<=s&&s<=n},ft=(e,t)=>{if(null===e||null===t)return!1;const i=F(E,e),s=F(E,t);return i.getTime()<s.getHours()},wt=(e,t)=>{if(null===e||null===t)return!1;const i=F(E,e);return F(E,t).getTime()<i.getHours()},bt=e=>{const t=n.useLocalization(),i=s.useUnstyled(),a=i&&i.uDateInput,o=t.toLanguageString(ie,Se[ie]);return m.createElement("span",{className:s.classNames(s.uDateInput.clearButton({c:a})),role:"button",onClick:t=>{t.stopPropagation();const{onClick:i}=e;i&&i.call(void 0,t)},tabIndex:e.tabindex||-1,title:o,key:"clearbutton"},m.createElement(s.IconWrap,{name:"x",icon:r.xIcon}))};let Dt=class{constructor(e){this.service=e,this.cldr={},this.locale=e.locale,this.format=e.format,this.toString=e.toString,this.formatDate=e.formatDate,this.parseDate=e.parseDate,this.parseNumber=e.parseNumber,this.formatNumber=e.formatNumber,this.splitDateFormat=e.splitDateFormat,this.numberSymbols=e.numberSymbols,this.firstDay=e.firstDay,this.dateFieldName=e.dateFieldName,this.dateFormatNames=(e,t)=>this.service.dateFormatNames(t),this.weekendRange=e=>{};const t=c.localeInfo(this.locale);this.cldr[t.name]=t}};const yt=m.forwardRef(((e,t)=>{var i;const c=s.useId(e.id),u=n.useInternationalization(),d=n.useLocalization(),p=s.useUnstyled(),g=s.usePropsContext(Ct,e).unstyled||p,{format:v=St.format,size:f=St.size,rounded:w=St.rounded,fillMode:b=St.fillMode,formatPlaceholder:D=St.formatPlaceholder,spinners:y=St.spinners,disabled:S=St.disabled,min:C=St.min,max:k=St.max,minTime:x=St.minTime,maxTime:I=St.maxTime,validityStyles:M=St.validityStyles,validationMessage:T=St.validationMessage,placeholder:O=St.placeholder,enableMouseWheel:E=St.enableMouseWheel,autoCorrectParts:V=St.autoCorrectParts,autoSwitchParts:N=St.autoSwitchParts,allowCaretMode:R=St.allowCaretMode,twoDigitYearMax:P=St.twoDigitYearMax,ariaHasPopup:F=St.ariaHasPopup,autoFocus:L=St.autoFocus}=s.usePropsContext(Ct,e),B=()=>void 0!==le.current?le.current:ne.current&&ne.current.value,A=()=>{const e=ne.current&&ne.current.currentText||"",t=B();return null==O||ue.focused||t?e:O},z=()=>void 0!==e.required&&e.required,H=()=>{const t=B()||e.value,i=C,s=k,a=((e,t,i)=>null===e||!(t&&t>e||i&&i<e))(t,i,s)&&vt(t,x,I),n=void 0!==T,o=(!z()||null!=t)&&a,r=void 0!==e.valid?e.valid:o;return{customError:n,rangeOverflow:t&&s.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<i.getTime()||!1,valid:r,valueMissing:null===t}},_=()=>{se.current&&se.current.focus()},q=()=>new Dt(u),W=()=>{const t=B();return{format:v,steps:e.steps,formatPlaceholder:D,placeholder:O,selectPreviousSegmentOnBackspace:!0,value:e.value||t,intlService:q(),autoFill:void 0!==e.autoFill&&e.autoFill,enableMouseWheel:E,autoCorrectParts:V,autoSwitchParts:N,autoSwitchKeys:e.autoSwitchKeys||[],twoDigitYearMax:P,allowCaretMode:R}},K=e=>{ae.current&&ae.current.classList.add("k-focus"),de({focused:!0}),L&&G(!0)},U=e=>{ae.current&&ae.current.classList.remove("k-focus"),de({focused:!1})},Y=e=>"string"==typeof e?e:{inputFormat:e,displayFormat:e},$=e=>{le.current=B(),pe(),he.current=e,le.current=void 0},j=t=>{e.onChange&&e.onChange(t)},Z=e=>{s.getActiveElement(document)===se.current&&e.preventDefault()},J=()=>{se.current&&se.current.setCustomValidity&&se.current.setCustomValidity(H().valid?"":T||St.validationMessage)},G=m.useCallback((e=>{var t;if(se.current&&L&&e){const e=(null==ne?void 0:ne.current).currentText,i=e[(null==ne?void 0:ne.current).currentText.search(/[^a-zA-Z]/)],s=e.split(i)[0].length;ae.current&&ae.current.classList.add("k-focus"),null==(t=null==ne?void 0:ne.current)||t.selectNearestSegment(s)}}),[L]),X=e=>{!se.current||!ne.current||$(e)},Q=t=>{const i=B();he.current&&e.onChange&&!a.isEqual(he.current.oldValue,i)&&e.onChange.call(void 0,{syntheticEvent:t,nativeEvent:he.current.event,value:he.current.value,target:ie.current}),he.current=null},ie=m.useRef(null),se=m.useRef(null),ae=m.useRef(null);m.useImperativeHandle(ie,(()=>({props:e,get options(){return W()},get text(){return A()},get element(){return se.current},get name(){return e.name},get value(){return B()},get validity(){return H()},focus:_,updateOnPaste:X}))),m.useImperativeHandle(t,(()=>ie.current));const ne=m.useRef(null),oe=m.useRef(null),re=m.useRef(!1),le=m.useRef(null),he=m.useRef(null),ce=m.useRef(e),[ue,de]=m.useState({focused:!1}),[,pe]=m.useReducer((e=>e+1),0);m.useLayoutEffect((()=>{re.current||(ne.current=new h.DateInput(se.current,{...W(),format:Y(W().format),events:{focus:K,blur:U,valueChange:$,click:j}}),oe.current=ne.current.dateObject,re.current=!0)}),[]),m.useEffect((()=>(J(),re.current||ae.current&&ae.current.addEventListener("wheel",Z,{passive:!1}),L&&(de({focused:!0}),G(!0)),()=>{ae.current&&ae.current.removeEventListener("wheel",Z)})),[]),m.useEffect((()=>{J(),ne.current&&((((e,t)=>typeof e!=typeof t||("string"==typeof e&&"string"==typeof t?e!==t:"object"==typeof e&&"object"==typeof t&&JSON.stringify(e)!==JSON.stringify(t)))(ce.current.format,v)||ce.current.readonly!==e.readonly||JSON.stringify(ce.current.steps)!==JSON.stringify(e.steps)||q().locale!==ne.current.options.intlService.locale)&&ne.current.setOptions(W(),!0),ce.current.value!==e.value&&(null!==oe.current.getValue()||null!==e.value)&&oe.current.setValue(e.value),void 0!==e.ariaExpanded&&e.ariaExpanded&&(ne.current.options.placeholder=null),void 0!==e.ariaExpanded&&!e.ariaExpanded&&(ne.current.options.placeholder=O),ne.current.refreshElementValue(),ce.current={format:v,readonly:e.readonly,ariaExpanded:e.ariaExpanded,steps:e.steps,value:e.value})}));const me=e.id||c+"-accessibility-id",ge=g&&g.uDateInput,ve=A(),fe=!M||H().valid;m.useImperativeHandle(e._ref,(()=>ie.current));const we=m.createElement("span",{ref:e=>{ae.current=e},style:e.label?void 0:{width:e.width},dir:e.dir,className:s.classNames(s.uDateInput.wrapper({c:ge,size:f,fillMode:b,rounded:w,disabled:S,required:z(),invalid:!fe}),e.className)},m.createElement("input",{ref:e=>{se.current=e},role:e.ariaRole||"textbox",readOnly:e.readonly,tabIndex:e.tabIndex||0,disabled:S,title:void 0!==e.title?e.title:ve,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:L,className:s.classNames(s.uDateInput.inputInner({c:ge})),id:me,value:ve,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-haspopup":F,"aria-disabled":S,"aria-expanded":e.ariaExpanded,"aria-controls":e.ariaControls,"aria-required":e.required,"aria-invalid":!fe,onKeyDown:Q,onChange:Q,onWheel:Q,onInput:Q,onClick:Q,name:e.name,...e.inputAttributes}),e.children,e.clearButton&&e.value&&m.createElement(bt,{onClick:j,key:"clearbutton"}),y&&m.createElement("span",{className:s.classNames(s.uDateInput.inputSpinner({c:ge})),onMouseDown:e=>{e.preventDefault();const t=s.getActiveElement(document);se.current&&t!==se.current&&se.current.focus({preventScroll:!0})}},m.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:s.classNames(s.uDateInput.spinnerIncrease({c:ge})),icon:"caret-alt-up",svgIcon:r.caretAltUpIcon,"aria-label":d.toLanguageString(ee,Se[ee]),title:d.toLanguageString(ee,Se[ee]),onClick:e=>{var t;null==(t=ne.current)||t.modifyDateSegmentValue(1),Q(e)}}),m.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:s.classNames(s.uDateInput.spinnerDecrease({c:ge})),icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,"aria-label":d.toLanguageString(te,Se[te]),title:d.toLanguageString(te,Se[te]),onClick:e=>{var t;null==(t=ne.current)||t.modifyDateSegmentValue(-1),Q(e)}})));return e.label?m.createElement(l.FloatingLabel,{label:e.label,editorId:me,editorValue:null==(i=se.current)?void 0:i.value,editorValid:fe,editorDisabled:S,children:we,style:{width:e.width}}):we}));yt.propTypes={value:i.instanceOf(Date),format:i.oneOfType([T(i.string),i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([T(i.oneOf(["wide","narrow","short","formatPattern"])),i.shape({year:T(i.string),month:T(i.string),day:T(i.string),hour:T(i.string),minute:T(i.string),second:T(i.string)})]),width:i.oneOfType([i.string,i.number]),tabIndex:i.number,title:i.string,steps:i.shape({year:T(i.number),month:T(i.number),day:T(i.number),hour:T(i.number),minute:T(i.number),second:T(i.number)}),min:i.instanceOf(Date),max:i.instanceOf(Date),disabled:i.bool,spinners:i.bool,name:i.string,dir:i.string,label:i.node,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,ariaRole:i.string,ariaHasPopup:i.oneOfType([i.bool,i.oneOf(["grid","dialog"])]),ariaExpanded:i.oneOfType([i.bool]),onChange:i.func,validationMessage:i.string,required:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool,inputAttributes:i.object};const St={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(N),min:a.cloneDate(V),minTime:a.cloneDate(R),maxTime:a.cloneDate(P),validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,enableMouseWheel:!0,autoCorrectParts:!0,autoSwitchParts:!0,allowCaretMode:!1,twoDigitYearMax:68,ariaHasPopup:"grid",autoFocus:!1},Ct=s.createPropsContext();yt.displayName="KendoReactDateInput";const kt=o.Button,xt=e=>{const{dateInput:t,...i}=e,s=(e=>{const[t,i]=m.useState(!1);return m.useEffect((()=>{var t;e.current&&i(!!(null!=(t=e.current.element)&&t.value||e.current.text))})),{editorValue:t}})(t);return m.createElement(l.FloatingLabel,{...i,...s})},It=e=>{const{footer:t,windowWidth:i=0,mobileFilter:a,children:n,navigatable:l,navigatableElements:h,expand:c,animation:u,title:p,subTitle:g,onClose:v}=e,f=s.useAdaptiveModeContext(),w={navigatable:l||!1,navigatableElements:h||[],expand:c,animation:!1!==u,suffixActions:m.createElement(o.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:r.checkIcon,onClick:v}),filter:a,onClose:v,animationStyles:f&&i<=f.small?{top:0,width:"100%",height:"100%"}:void 0,title:p,subTitle:g,className:"k-adaptive-actionsheet",position:f&&i<=f.small?"fullscreen":void 0};return m.createElement(d.ActionSheet,{...w},n,t&&m.createElement(d.ActionSheetFooter,{className:"k-actions k-actions-stretched"},m.createElement(o.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),m.createElement(o.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},Mt=m.forwardRef(((e,t)=>{const i=s.useId(e.id),o=n.useLocalization(),l=s.useAdaptiveModeContext(),{defaultShow:h=Tt.defaultShow,defaultValue:c=Tt.defaultValue,dateInput:u=Tt.dateInput,calendar:p=Tt.calendar,toggleButton:g=Tt.toggleButton,popup:v=Tt.popup,disabled:f=Tt.disabled,format:w=Tt.format,max:b=Tt.max,min:D=Tt.min,popupSettings:y=Tt.popupSettings,tabIndex:S=Tt.tabIndex,weekNumber:C=Tt.weekNumber,validityStyles:k=Tt.validityStyles,size:x=Tt.size,rounded:I=Tt.rounded,fillMode:M=Tt.fillMode,autoFocus:T=Tt.autoFocus,show:O,autoSwitchParts:E,autoSwitchKeys:V,twoDigitYearMax:N,ariaLabel:R,adaptive:P,adaptiveTitle:L=e.label||void 0,adaptiveSubtitle:B,formatPlaceholder:z,inputAttributes:H,validationMessage:_,visited:q,value:W,touched:K,modified:U,_adaptiveMode:Y=l,valid:$,focusedDate:j,id:Z,ariaLabelledBy:J,ariaDescribedBy:G,placeholder:X,onChange:Q,onOpen:ee,onClose:te,...ie}=s.usePropsContext(Ot,e),se=()=>{if(s.canUseDOM)return ke.current&&ke.current.ownerDocument||window.document},ne=()=>!!(Re.windowWidth&&l&&Re.windowWidth<=(null==l?void 0:l.medium)&&e.adaptive),oe=()=>{const e=void 0!==Me.current?Me.current:void 0!==W?W:Re.value;return null!==e?a.cloneDate(e):null},re=()=>void 0!==Te.current?Te.current:void 0!==O?O:Re.show,le=()=>void 0!==e.required&&e.required,he=()=>{const e=oe()||W||null,t=D,i=b,s=A(e,t,i),a=void 0!==_,n=(!le()||null!=e)&&s,o=void 0!==$?$:n;return{customError:a,rangeOverflow:e&&i.getTime()<e.getTime()||!1,rangeUnderflow:e&&e.getTime()<t.getTime()||!1,valid:o,valueMissing:null===e}},ce=()=>{xe.current&&xe.current.focus()},ue=e=>{Ie.current=e},de=e=>{re()!==e&&(Le({show:e}),e&&ee&&ee({target:Ce.current}),!e&&te&&te({target:Ce.current}))},pe=e=>{null!=y&&y.onMouseDownOutside&&y.onMouseDownOutside(e)},me=(e,t)=>{Le({value:a.cloneDate(e||void 0)}),Me.current=e,Te.current=!1,ne()||(Ee.current=!0),Q&&Q({syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:oe(),show:re(),target:Ce.current}),Me.current=void 0,Te.current=void 0,de(!1)},ge=e=>{const t=(e=>{const t=oe();return t&&e?F(e,t):e})(e.value);me(t,e)},ve=()=>{const{popupClass:e,...t}=y,i=re(),n=oe(),o=n&&a.getDate(n),r=s.classNames(e),l={popupClass:"k-datepicker-popup",show:i,anchor:ke.current,className:r,id:Be,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t,onMouseDownOutside:pe},h={disabled:f,value:o,min:D,max:b,weekNumber:C,focusedDate:j,className:ne()?"k-calendar-lg":"",navigation:!ne(),onChange:ge},c=p||Tt.calendar,u=v||Tt.popup;return ne()?m.createElement(c,{_ref:ue,...h}):m.createElement(u,{...l},m.createElement(c,{_ref:ue,...h}))},fe=()=>{Le({focused:!1}),de(!1)},we=()=>{de(!re())},be=()=>{f||(Ee.current=!0,de(!re()))},De=e=>{e.preventDefault()},ye=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc&&re())return Ee.current=!0,void de(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),Ee.current=i===s.Keys.up,de(i===s.Keys.down))},Ce=m.useRef(null),ke=m.useRef(null),xe=m.useRef(null),Ie=m.useRef(null);m.useImperativeHandle(Ce,(()=>({props:e,get element(){return ke.current},get calendar(){return Ie.current},get dateInput(){return xe.current},get name(){return e.name},get show(){return re()},get validity(){return he()},get value(){return oe()},get mobileMode(){return ne()},togglePopup:we,focus:ce}))),m.useImperativeHandle(t,(()=>Ce.current));const Me=m.useRef(void 0),Te=m.useRef(void 0),Oe=m.useRef(null),Ee=m.useRef(!1),Ve=m.useRef(!1),Ne=m.useRef(null),[Re,Pe]=m.useState({value:c,show:h,focused:!1}),[,Fe]=m.useReducer((e=>e),!0),Le=e=>{Pe((t=>({...t,...e})))};m.useEffect((()=>{Ie.current&&Ie.current.element&&re()&&!Ve.current&&Ie.current.element.focus({preventScroll:!0}),ne()&&re()&&!Ve.current&&setTimeout((()=>{Ie.current&&Ie.current.element&&Ie.current.element.focus({preventScroll:!0})}),300),xe.current&&xe.current.element&&!re()&&Ee.current&&xe.current.element.focus({preventScroll:!0}),Ve.current=re(),Ee.current=!1})),m.useEffect((()=>{var e;return Ne.current=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver((e=>(e=>{for(const t of e)Le({windowWidth:t.target.clientWidth})})(e))),re()&&Fe(),null!=(e=se())&&e.body&&Ne.current&&Ne.current.observe(se().body),()=>{var e;clearTimeout(Oe.current),null!=(e=se())&&e.body&&Ne.current&&Ne.current.disconnect()}}),[]);const Be=i+"-popup-id",Ae=ve(),ze=u||Tt.dateInput,He=oe(),_e=g||Tt.toggleButton,qe=(()=>{const{windowWidth:e=0}=Re,t={expand:re(),onClose:fe,title:L,subTitle:B,windowWidth:e};return m.createElement(It,{...t},m.createElement(d.ActionSheetContent,null,ve()))})(),We=!k||he().valid,Ke=o.toLanguageString(ae,Se[ae]),Ue={disabled:f,format:w,formatPlaceholder:z,id:Z,ariaLabelledBy:J,ariaDescribedBy:G,ariaLabel:R,max:b,min:D,name:e.name,onChange:e=>{me(e.value,e)},required:e.required,_ref:xe,tabIndex:re()?-1:S,title:e.title,valid:he().valid,validationMessage:_,validityStyles:k,value:He,label:void 0,placeholder:Re.focused?null:X,ariaExpanded:re(),size:null,fillMode:null,rounded:null,autoFill:e.autoFill,twoDigitYearMax:N,enableMouseWheel:e.enableMouseWheel,autoCorrectParts:e.autoCorrectParts,autoSwitchParts:E,autoSwitchKeys:V,allowCaretMode:e.allowCaretMode,inputAttributes:H},Ye=m.createElement(s.AsyncFocusBlur,{onFocus:()=>{Le({focused:!0})},onBlur:ne()?void 0:fe,onSyncBlur:e.onBlur,onSyncFocus:e.onFocus},(t=>m.createElement(m.Fragment,null,m.createElement("span",{...e.label?{}:ie,ref:ke,className:s.classNames("k-input","k-datepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[x]||x}`]:x,[`k-rounded-${s.kendoThemeMaps.roundedMap[I]||I}`]:I,[`k-input-${M}`]:M,"k-invalid":!We,"k-required":le(),"k-disabled":f},e.className),onKeyDown:ye,style:{width:e.width},onFocus:ne()?be:t.onFocus,onBlur:t.onBlur,onClick:ne()?be:void 0},m.createElement(ze,{_ref:xe,ariaRole:"combobox",ariaExpanded:re(),ariaControls:Be,autoFocus:T,...Ue}),m.createElement(_e,{type:"button",icon:"calendar",svgIcon:r.calendarIcon,title:Ke,className:"k-input-button",rounded:null,onClick:ne()?void 0:be,"aria-label":Ke,fillMode:M,onMouseDown:De}),!ne()&&Ae),ne()&&qe)));return e.label?m.createElement(xt,{dateInput:xe,label:e.label,editorId:i,editorValid:We,editorDisabled:f,children:Ye,style:{width:e.width},...ie}):Ye}));Mt.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:T(i.string),pattern:T(i.string),date:T(i.oneOf(["short","medium","long","full"])),time:T(i.oneOf(["short","medium","long","full"])),datetime:T(i.oneOf(["short","medium","long","full"])),era:T(i.oneOf(["narrow","short","long"])),year:T(i.oneOf(["numeric","2-digit"])),month:T(i.oneOf(["numeric","2-digit","narrow","short","long"])),day:T(i.oneOf(["numeric","2-digit"])),weekday:T(i.oneOf(["narrow","short","long"])),hour:T(i.oneOf(["numeric","2-digit"])),hour12:T(i.bool),minute:T(i.oneOf(["numeric","2-digit"])),second:T(i.oneOf(["numeric","2-digit"])),timeZoneName:T(i.oneOf(["short","long"]))})]),formatPlaceholder:i.oneOfType([T(i.oneOf(["wide","narrow","short","formatPattern"])),i.shape({year:T(i.string),month:T(i.string),day:T(i.string),hour:T(i.string),minute:T(i.string),second:T(i.string)})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:T(i.bool),appendTo:T(i.any),popupClass:T(i.string)}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),adaptive:i.bool,adaptiveTitle:i.string,adaptiveSubtitle:i.string,autoFocus:i.bool,inputAttributes:i.object};const Tt={defaultShow:!1,defaultValue:null,dateInput:yt,calendar:et,toggleButton:kt,popup:u.Popup,disabled:!1,format:"d",max:N,min:V,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},Ot=s.createPropsContext();Mt.displayName="KendoReactDatePicker";const Et=Object.freeze({name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1617189075,version:"13.3.0-develop.3",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"}),Vt=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t),i},Nt=e=>null!==e&&e<12,Rt=(e,t,i)=>!t&&!i||e>=t&&e<=i,Pt=(e,t,i)=>!t&&!i||e>=t||e<=i;let Ft=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),s=Nt(i),a=Nt(t.getHours());if(s&&a||!s&&!a)return e;const[n,o=24]=this.normalizedRange(),r=i+(a?-12:12);return Vt(e,Math.min(Math.max(n,r),o||24))}configure(e){const{min:t=this.min,max:i=this.max,part:s=this.part}=e;this.min=t,this.max=i,this.part=s}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[s,a]=this.normalizedRange(),n=this.intl.dateFormatNames(t);return Nt(s)&&i.push({text:n.am,value:Vt(this.min,s)}),(e=>null!==e&&(!e||e>11))(a)&&i.push({text:n.pm,value:Vt(this.min,Math.max(12,a))}),this.min.getHours()!==s?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return(e||t)&&(e>11||t<12)?1:2}selectedIndex(e){if(!this.valueInList(e)||!this.min)return-1;const t=Math.floor(e.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?t:0===t?1:0}valueInList(e){return!(!this.min||!this.max)&&(this.min.getHours()!==this.normalizedRange()[0]?Pt:Rt)(e.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const e=this.min.getHours(),t=this.max.getHours();return[Math.min(e,t),Math.max(e,t)]}},Lt=class{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){void 0===this.timeListHeight&&this.calculateHeights()}calculateHeights(e,t){if(!s.canUseDOM)return;const i=t&&t.uTime,a=W("div"),n=W("span"),o=W("ul"),r=W("li"),l=a([n("minute",s.strippedClassNames(s.uTime.title({c:i}))),a([a([o([r("<span>02</span>",s.strippedClassNames(s.uTime.li({c:i})))],s.strippedClassNames(s.uTime.ul({c:i})))],s.strippedClassNames(s.uTime.containerSelector({c:i}),s.uTime.container({c:i,content:!0,scrollable:!0})))],s.strippedClassNames(s.uTime.list({c:i})))],s.strippedClassNames(s.uTime.listWrapper({c:i})),{left:"-10000px",position:"absolute"}),h=`.${s.strippedClassNames(s.uTime.containerSelector({c:i}))}`,c=e&&e.querySelector(h)||document.body,u=c.appendChild(l);this.timeListHeight=u.querySelector(h).offsetHeight,this.itemHeight=u.querySelector("li").offsetHeight,c.removeChild(u),this.didCalculate=!0}};const Bt=(e=>t=>t%e)(24),At=(e,t)=>Bt(24+e-t),zt=e=>(t,i)=>i&&a.getDate(t).getTime()!==a.getDate(i).getTime()?ct(t,e):t,Ht=zt(0),_t=zt(23);let qt=class{constructor(e){this.intl=e,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(e,t){return ct(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:n,step:o=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=e=>{const t=ct(E,e);return{text:this.intl.formatDate(t,n.pattern),value:t}},this.min=s,this.max=a,this.step=o}data(e){const[t]=this.range(e),i=((e,t)=>i=>Bt(e+i*t))(t,this.step),s=mt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(!this.min||!this.max)&&(!a.isEqual(this.min,e)||!a.isEqual(this.max,t))}limitRange(e,t,i){return this.boundRange?[Ht(e,i),_t(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(At(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(ct(this.max,this.lastHour(e)))}divideByStep(e){return At(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}};const Wt=(e=>t=>t%e)(60),Kt=(e,t)=>Wt(60+e-t),Ut=e=>(t,i)=>i&&t.getHours()!==i.getHours()?ut(t,e):t,Yt=Ut(0),$t=Ut(59);let jt=class{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return ut(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=ut(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>Wt(e+i*t))(t,this.step),s=mt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[Yt(e,i),$t(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Kt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(ut(this.max,this.lastMinute(e)))}divideByStep(e){return Kt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}};const Zt=(e=>t=>t%e)(60),Jt=(e,t)=>Zt(60+e-t),Gt=e=>(t,i)=>!i||t.getMinutes()===i.getMinutes()&&t.getHours()===i.getHours()?t:dt(t,e),Xt=Gt(0),Qt=Gt(59);class ei{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return dt(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=dt(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>Zt(e+i*t))(t,this.step),s=mt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[Xt(e,i),Qt(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e))}divideByStep(e){return Jt(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Jt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(dt(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const ti={[s.Keys.end]:(e,t)=>e[e.length-1],[s.Keys.home]:(e,t)=>e[0],[s.Keys.up]:(e,t)=>e[t-1],[s.Keys.down]:(e,t)=>e[t+1]},ii={[tt]:Ft,[it]:qt,[st]:jt,[at]:ei},si=class e extends m.Component{constructor(t){super(t),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=e=>{Promise.resolve().then((()=>{this.element&&this.element.focus(e)}))},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),s=this.virtualization.itemOffset(i),a=Math.abs(Math.ceil(e)-s);if(t===i&&a<2)return s;const n=t>i;return n&&a>=this.bottomThreshold||!n&&a>this.topThreshold?this.virtualization.itemOffset(i+1):s},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=9,this.bottomOffset+=18),this.topThreshold=.05*this.itemHeight,this.bottomThreshold=.95*this.itemHeight)},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[s,a]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:s,max:a}))}},this.serviceSettings=t=>{const i={boundRange:this.props.boundRange||e.defaultProps.boundRange,insertUndividedMax:!1,min:a.cloneDate(this.min),max:a.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},i,t);return s.boundRange="hour"!==s.part.type||this.props.boundRange||e.defaultProps.boundRange,s},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(this.virtualization&&this.service&&e&&!t){this.animateToIndex=!1;const t=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),i=this.service.data(this.props.value)[t];this.handleChange(i)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=s.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===s.Keys.down||t===s.Keys.up||t===s.Keys.end||t===s.Keys.home)&&e.preventDefault();const i=(ti[e.keyCode]||s.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));i&&this.handleChange(i)},this.handleChange=K((e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)}),100),this.dom=new Lt}get element(){return this._element}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get min(){return this.props.min||e.defaultProps.min}get max(){return this.props.max||e.defaultProps.max}get step(){return void 0!==this.props.step&&0!==this.props.step?Math.floor(this.props.step):e.defaultProps.step}componentDidMount(){Promise.resolve().then((()=>{const{unstyled:e}=this.props;this._element&&(this.dom.calculateHeights(this._element,e),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);if(this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0,!this.topOffset&&this._element){const{unstyled:e}=this.props;this.dom.calculateHeights(this._element,e)}}render(){const{part:e,value:t,unstyled:i}=this.props;if(!e.type||!ii[e.type])return;const a=i&&i.uTime;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new ii[e.type](this.intl),this.configureServices();const o=this.service.data(t),r="translateY("+this.topOffset+"px)",l=this.service.total(t),h=m.createElement(m.Fragment,null,m.createElement("ul",{style:{transform:r,msTransform:r},className:s.classNames(s.uTime.ul({c:a}))},o.map(((e,t)=>m.createElement("li",{key:t,className:s.classNames(s.uTime.li({c:a})),onClick:()=>{this.handleChange(e)}},m.createElement("span",null,e.text))))),m.createElement("div",{className:s.classNames(s.uTime.scrollablePlaceholder({c:a}))}));return m.createElement("div",{className:s.classNames(s.uTime.list({c:a})),id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:e=>{this._element=e},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?m.createElement(C,{bottomOffset:this.bottomOffset,children:h,className:s.classNames(s.uTime.containerSelector({c:a}),s.uTime.container({c:a})),itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:e=>{this.virtualization=e},role:"presentation",skip:0,tabIndex:-1,take:l,topOffset:this.topOffset,total:l,unstyled:i}):m.createElement("div",{className:s.classNames(s.uTime.containerSelector({c:a}),s.uTime.container({c:a,content:!0,scrollable:!0}))},h))}};si.propTypes={id:i.number,max:i.instanceOf(Date),min:i.instanceOf(Date),part:function(e,t,i){const s=e[t];if(!s||!ii[s.type])throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n Supported part types are hour|minute|second|dayperiod.\n `);return null},step:function(e,t,i){const s=e[t];if(void 0!==s&&s<=0)throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n ${t} cannot be less than 1.\n `);return null},value:i.instanceOf(Date),smoothScroll:i.bool,show:i.bool},si.defaultProps={boundRange:!1,max:P,min:E,step:1,smoothScroll:!0};let ai=si;n.registerForIntl(ai);const ni=new RegExp(`${it}|${st}|${at}|${tt}|literal`),oi=class e extends m.Component{constructor(t){super(t),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(e,t)=>{Promise.resolve().then((()=>{t&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const i=this.timeLists[0];!t&&-1===this.state.activeListIndex&&!this.hasActiveButton()&&i&&i.element&&i.focus(e)}))},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const s=t>=1&&i[t-1];return s&&s&&"literal"===e.type?ni.test(s.type||""):ni.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map((t=>1===e?t.next:t.prev)).map((e=>e&&e.element&&e.element.focus({preventScroll:!0})))},this.listReducer=(e,t,i,s)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:s[i+1]||t,prev:s[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&vt(pt(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case s.Keys.left:return e.preventDefault(),void this.focusList(0);case s.Keys.right:return e.preventDefault(),void this.focusList(1);default:return}},this.handleListBlur=()=>{this.nextTick((()=>{this.setState({activeListIndex:-1})}))},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=ht(lt(this.props.steps,this.props.min||e.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return((e,t,i)=>{if(!e||!t||!i)return e;const{candidateValue:s,minValue:a,maxValue:n}=gt(e,t,i);return s<a?F(e,t):s>n?F(e,i):e})(this.snapTime(a.cloneDate(this.props.value||E)),this.min,this.max)}get intl(){return n.provideIntlService(this)}get min(){return this.snapTime(this.props.min||e.defaultProps.min)}get max(){return this.snapTime(this.props.max||e.defaultProps.max)}get steps(){return this.props.steps||e.defaultProps.steps}get boundRange(){return void 0!==this.props.boundRange?this.props.boundRange:e.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this.value)}render(){const{format:t,smoothScroll:i,onNowClick:a,className:r,disabled:l,mobileMode:h,show:c,onNowKeyDown:u,unstyled:d}=this.props,p=d&&d.uTime;this.snapTime=ht(lt(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(t||e.defaultProps.format).filter(this.timeFormatFilter);const g=s.classNames(s.uTime.part({c:p,mobileMode:h,disabled:l}),r);this.timeLists=[];const v=n.provideLocalizationService(this),f=v.toLanguageString(ue,Se[ue]);return m.createElement("div",{className:g},m.createElement("div",{className:s.classNames(s.uTime.header({c:p}))},m.createElement("span",{className:s.classNames(s.uTime.title({c:p}))},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&m.createElement(o.Button,{type:"button",ref:e=>{this._nowButton=e},className:s.classNames(s.uTime.now({c:p})),fillMode:"flat",themeColor:"base",title:f,onKeyDown:u,"aria-label":f,onClick:a,tabIndex:l?-1:0},v.toLanguageString(ce,Se[ce]))),m.createElement("div",{className:s.classNames(s.uTime.listContainer({c:p})),onKeyDown:this.handleKeyDown},m.createElement("span",{className:s.classNames(s.uTime.highlight({c:p}))}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?m.createElement("div",{key:t,className:s.classNames(s.uTime.listWrapper({c:p,focused:t===this.state.activeListIndex})),role:"presentation",tabIndex:-1},m.createElement("span",{className:s.classNames(s.uTime.title({c:p})),onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),m.createElement(ai,{min:this.min,max:this.max,boundRange:this.boundRange,part:e,step:e.type?this.steps[e.type]:1,smoothScroll:i,ref:e=>{e&&this.timeLists.push(e)},id:t,onFocus:()=>{this.handleListFocus(t)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:l,show:c,mobileMode:h,unstyled:d})):m.createElement("div",{key:t,className:s.classNames(s.uTime.separator({c:p}))},e.pattern)))))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){const e=s.getActiveElement(document);return this._nowButton&&e===this._nowButton.element}hasSteps(){const e=Object.keys(this.steps);return e.length!==e.reduce(((e,t)=>e+this.steps[t]),0)}};oi.propTypes={cancelButton:i.bool,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},oi.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:R,max:P,steps:{},boundRange:!1};let ri=oi;n.registerForIntl(ri),n.registerForLocalization(ri);const li=class e extends m.Component{constructor(t){super(t),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;t!==s.Keys.enter||this.hasActiveButton()||this.handleAccept(e)},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:i}=e;!i&&t===s.Keys.tab&&(e.preventDefault(),!1!==this.props.nowButton?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=e=>{var t;const{keyCode:i,shiftKey:a}=e;a&&i===s.Keys.tab?(e.preventDefault(),this._acceptButton&&(null==(t=this._acceptButton.element)||t.focus({preventScroll:!0}))):i===s.Keys.enter&&(e.stopPropagation(),this.handleNowClick(e))},this.handleAccept=e=>{const t=this.mergeValue(a.cloneDate(this.value||pt()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(a.cloneDate(this.value||pt()),pt());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||e.defaultProps.format),this.mergeValue=(e=>(t,i)=>(t.setHours(...e.map((e=>e(t,i)))),t))(rt(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||E,value:this.props.value||e.defaultProps.value}}get element(){return this._element}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get intl(){return n.provideIntlService(this)}get current(){return null!==this.state.current?a.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:e,cancelButton:t,disabled:i,tabIndex:a,className:r,smoothScroll:l,min:h,max:c,boundRange:u,nowButton:d,steps:p,show:g,mobileMode:v,unstyled:f}=this.props,w=f&&f.uTimePicker,b=f&&f.uTime,D=n.provideLocalizationService(this),y=D.toLanguageString(de,Se[de]),S=D.toLanguageString(pe,Se[pe]);return m.createElement("div",{ref:e=>{this._element=e},tabIndex:i?void 0:a||0,className:s.classNames(s.uTimePicker.timeSelector({c:w,mobileMode:v,disabled:i}),r),onKeyDown:this.handleKeyDown},m.createElement(ri,{ref:e=>{this.timePart=e},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:e,smoothScroll:l,min:h,max:c,boundRange:u,disabled:i,nowButton:d,steps:p,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown,unstyled:f}),this.props.footer&&m.createElement("div",{className:s.classNames(s.uTime.footer({c:b}))},t&&m.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:s.classNames(s.uTime.cancel({c:b})),onClick:this.handleReject,title:y,"aria-label":y},y),m.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:s.classNames(s.uTime.accept({c:b})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:S,"aria-label":S},S)))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}};li.propTypes={cancelButton:i.bool,className:i.string,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},li.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:R,max:P,boundRange:!1,footer:!0};let hi=li;n.registerForIntl(hi),n.registerForLocalization(hi);const ci=class e extends m.Component{constructor(t){super(t),this._element=null,this._dateInput=m.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.showLicenseWatermark=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:s,format:a,steps:n,unstyled:o}=this.props;return m.createElement(hi,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:s,nowButton:i,format:a,min:this.min,max:this.max,steps:n,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:o})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,{unstyled:i}=this.props,a=i&&i.uTimePicker,n=s.classNames(e),o={popupClass:s.uTimePicker.popup({c:a}),show:this.show,animate:null!==this.element,anchor:this.element,className:n,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?m.createElement(this.props.popup,{...o},this.renderTimeSelector()):m.createElement(u.Popup,{...o},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(ge,Se[de]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(pe,Se[pe]),onApply:e=>this.handleValueChange(e)}};return m.createElement(It,{...t},m.createElement(d.ActionSheetContent,null,this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>void 0!==e.value?e.value:t.value,this.nextShow=(e,t)=>void 0!==e.show?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.state.candidate||this.value;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=e=>{this.setShow(!1)},this.handleClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},this.showLicenseWatermark=!s.validatePackage(Et,{component:"TimePicker"}),this.licenseMessage=s.getLicenseMessage(Et),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const e=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),i=this.normalizeTime(this.max),s=((e,t,i)=>{if(null===e)return!0;const{candidateValue:s,minValue:a,maxValue:n}=gt(e,t,i);return a<=s&&s<=n})(e,t,i),a=void 0!==this.props.validationMessage,n=(!this.required||null!==this.value)&&s,o=void 0!==this.props.valid?this.props.valid:n;return{customError:a,rangeOverflow:wt(e,i),rangeUnderflow:ft(e,t),valid:o,valueMissing:null===this.value}}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}get popupSettings(){return this.props.popupSettings||e.defaultProps.popupSettings}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}get localizationService(){return n.provideLocalizationService(this)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow&&this._timeSelector.focusActiveList(),this.mobileMode&&this.show&&!this.prevShow&&setTimeout((()=>{this._timeSelector&&this._timeSelector.focusActiveList()}),300),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,disabled:n,tabIndex:l,title:h,id:c,className:u,format:d,formatPlaceholder:p,width:g,name:v,steps:f,validationMessage:w,required:b,validityStyles:D,ariaLabelledBy:y,ariaDescribedBy:S,unstyled:C,enableMouseWheel:k,autoCorrectParts:x,autoSwitchParts:I,autoSwitchKeys:M,allowCaretMode:T,inputAttributes:O}=this.props,E=C&&C.uTimePicker,V=!this.validityStyles||this.validity.valid,N={disabled:n,format:d,formatPlaceholder:p,id:c,ariaLabelledBy:y,ariaDescribedBy:S,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:v,onChange:this.handleInputValueChange,required:b,steps:f,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:w,validityStyles:D,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,enableMouseWheel:k,autoCorrectParts:x,autoSwitchParts:I,autoSwitchKeys:M,allowCaretMode:T,inputAttributes:O},R=this.localizationService.toLanguageString(ge,Se[ge]),P=this.localizationService.toLanguageString(me,Se[me]),F=m.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(({onFocus:e,onBlur:l})=>m.createElement(m.Fragment,null,m.createElement("span",{ref:e=>{this._element=e},className:s.classNames(s.uTimePicker.wrapper({c:E,size:t,rounded:i,fillMode:a,invalid:!V,required:this.required,disabled:n}),u),onKeyDown:this.handleKeyDown,style:{width:g},onFocus:this.mobileMode?this.handleClick:e,onBlur:l,onClick:this.mobileMode?this.handleClick:void 0},m.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...N}),m.createElement(o.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:r.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:P,className:s.classNames(s.uTimePicker.inputButton({c:E})),rounded:null,fillMode:a,"aria-label":R}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))));return this.props.label?m.createElement(xt,{dateInput:this._dateInput,label:this.props.label,editorId:c,editorValid:V,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}normalizeTime(e){return F(E,e)}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?F(this.value,e):e}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ci.displayName="TimePicker",ci.propTypes={className:i.string,cancelButton:i.bool,nowButton:i.bool,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),inputAttributes:i.object},ci.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:P,min:R,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:yt,size:"medium",rounded:"medium",fillMode:"solid"};let ui=ci;const di=s.createPropsContext(),pi=s.withIdHOC(s.withPropsContext(di,s.withUnstyledHOC(s.withAdaptiveModeContext(ui))));pi.displayName="KendoReactTimePicker",n.registerForLocalization(ui);const mi=class e extends m.Component{constructor(e){super(e),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(null===e.start||null===e.end)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props;s&&i&&s.call(void 0,e,t,i)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}}}get element(){return this._element}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==I.month)}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const e=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=s.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===I.month,"k-calendar-yearview":this.props.activeView===I.year,"k-calendar-decadeview":this.props.activeView===I.decade,"k-calendar-centuryview":this.props.activeView===I.century});return m.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map((t=>m.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},m.createElement(j,{bus:this.props.bus,weekDaysFormat:this.props.weekDaysFormat,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:e,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onWeekSelect:this.handleWeekCellClick,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse})))))}};mi.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,weekDaysFormat:"short",min:V,max:N};let gi=mi;const vi=(e=yi.defaultProps.min,t=yi.defaultProps.max,i)=>i instanceof Date&&!Array.isArray(i)&&B(a.getDate(i),e,t)?a.getDate(i):null,fi=(e=yi.defaultProps.min,t=yi.defaultProps.max,i)=>Array.isArray(i)?i.filter((i=>B(i,e,t))).map((e=>a.getDate(e))):null,wi=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?M:e,bi=(e,t,i)=>e||t&&t[0]||i&&i.start,Di=class e extends m.Component{constructor(t){super(t),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=M,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.showLicenseWatermark=!1,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=e=>({start:e,end:null}),this.rangeWithFocused=(e,t)=>({start:e.start,end:null===e.end&&null!==e.start&&this.isActive?t:e.end}),this.generateRange=(e,t)=>{const{end:i,start:s}=t,a=null!==t.start&&e.getTime()<=t.start.getTime();return!this.props.allowReverse&&a?{start:e,end:this.selectedRange.start}:"end"!==this.activeRange?{start:e,end:i}:{start:s||this.selectedDate,end:e}},this.canNavigate=e=>{if(!this.service)return!1;const t=this.service.move(this.focusedDate,e);return this.min<=t&&t<=this.max||this.service.isInSameView(t,this.min)||this.service.isInSameView(t,this.max)},this.navigate=(e,t)=>{this.calculateFocusFromValue=!1;const i=this.move(e,t);this.setState({navigateDate:i,focusedDate:i})},this.move=(e,t)=>this.clampDate(this.service.move(t,e)),this.clampDate=e=>q(e,this.min,this.max),this.shouldAutoCorrect=(e,t)=>{const{end:i,start:s}=t;return"end"!==this.activeRange?null!==i&&e>i:null!==s&&e<s},this.handleCellEnter=e=>{"range"===this.props.mode&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:e}))},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleTodayClick=e=>{this.todayIsInRange&&this.handleDateChange(e)},this.handlePrevButtonClick=()=>{const e=Ee.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(e,this.move(e,this.focusedDate));else{const t=this.isInMonth(this.focusedDate,this.dates[1])?this.move(e,this.focusedDate):this.focusedDate;this.navigate(e,t)}},this.handleNextButtonClick=()=>{this.navigate(Ee.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(84===t){const e=L();this.calculateFocusFromValue=!1,this.setState({focusedDate:e,navigateDate:e})}if((i||n)&&(t===s.Keys.left&&this.handlePrevButtonClick(),t===s.Keys.right&&this.handleNextButtonClick()),t===s.Keys.enter){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=q(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.dates&&this.service&&!this.service.isInArray(t,this.dates)&&this.setState({navigateDate:t}),this.calculateFocusFromValue=!1,this.setState({focusedDate:t})}e.preventDefault()},this.handleViewChange=({view:e})=>{this.calculateFocusFromValue=!1,this.setState((t=>({activeView:e,navigateDate:t.focusedDate})))},this.handleWeekSelection=(e,t,i)=>{if("single"===this.props.mode)return;const s=0===t?e:a.addDays(e,-t),n=6===t?e:a.addDays(e,6-t);let o=null;if("multiple"===this.props.mode){o=[];for(let e=0;e<=6;e++)o.push(a.addDays(s,e));this.setState({value:o,focusedDate:e})}"range"===this.props.mode&&(o={start:s,end:n},this.setState({value:o,focusedDate:e}));const{onChange:r}=this.props;if(r){const e={syntheticEvent:i,nativeEvent:i.nativeEvent,value:o,target:this};r.call(void 0,e)}},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(i){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:t,navigateDate:t});this.bus.moveToBottom(this.state.activeView)}let s;switch(this.calculateFocusFromValue=!0,this.props.mode){case"single":default:s=a.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const t=this.selectedMultiple.slice();let i=-1;t.forEach(((t,s)=>{a.isEqualDate(t,e.value)&&(i=s)})),-1!==i?t.splice(i,1):t.push(a.cloneDate(e.value)),s=t.slice()}else s=this.selectedDate?[a.cloneDate(this.selectedDate),a.cloneDate(e.value)]:[a.cloneDate(e.value)];break;case"range":s=null!==this.selectedRange.start&&null!==this.selectedRange.end&&"start"===this.activeRange?this.clampRange(e.value):this.generateRange(e.value,this.selectedRange),this.activeRangeEnd="end"!==this.activeRange?"end":"start"}this.valueDuringOnChange=s,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:s,focusedDate:t}),this.valueDuringOnChange=s;const{onChange:n}=this.props;if(n){const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};n.call(void 0,t)}this.valueDuringOnChange=void 0},this.showLicenseWatermark=!s.validatePackage(Et,{component:"MultiViewCalendar"}),this.licenseMessage=s.getLicenseMessage(Et);const i=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=vi(this.min,this.max,i),o=fi(this.min,this.max,i),r=wi(i),l=bi(n,o,r),h=O(I[t.defaultActiveView],this.bottomView,this.topView),c=q(t.focusedDate||l||L(),this.min,this.max);this.state={value:i,activeView:h,focusedDate:c,navigateDate:c},this.activeRangeEnd=((e,t)=>null===e.start&&null===t?"start":null===e.end?"end":"start")(r,n),this.bus=new Ke(this.handleViewChange),this.navigation=new $e(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||gi.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return"rtl"===this.props.dir}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get focusedDate(){return a.cloneDate(this._focusedDate)}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return I[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return I[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}get activeRange(){return void 0!==this.props.activeRangeEnd?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return B(L(),a.getDate(this.min),a.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const e=vi(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&e&&this.selectedDate.getTime()&&e.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||gi.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=n.provideIntlService(this),this.localization=n.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const e=O(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(e,this.intl),this.selectedDate=vi(this.min,this.max,this.value),this.selectedMultiple=fi(this.min,this.max,this.value),this.selectedRange=wi(this.value);const t=bi(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=q(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const i=s.classNames("k-calendar k-calendar-range k-calendar-md",{"k-disabled":this.props.disabled},this.props.className),l=this.rangeWithFocused(this.selectedRange,this.focusedDate),h=this.localization.toLanguageString(X,Se[X]),c=this.localization.toLanguageString(Q,Se[Q]),u=!this.canNavigate(Ee.PrevView),d=!this.canNavigate(Ee.NextView),p={"aria-disabled":u},g={"aria-disabled":d},v=this.lastView!==e,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),w=this.lastViewsCount!==this.props.views;(!f||v||w)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||gi.defaultProps.views));const b=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:L());return m.createElement("div",{ref:e=>{this._element=e},className:i,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},m.createElement(G,{key:`.kendo.calendar.header.${b.getTime()}`,activeView:e,currentDate:b,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:m.createElement(m.Fragment,null,m.createElement(o.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?r.chevronRightIcon:r.chevronLeftIcon,fillMode:"flat",title:h,disabled:u,onClick:this.handlePrevButtonClick,...p}),m.createElement(ke,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),m.createElement(o.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?r.chevronLeftIcon:r.chevronRightIcon,fillMode:"flat",title:c,disabled:d,onClick:this.handleNextButtonClick,...g}))}),m.createElement(gi,{ref:e=>{this.calendarViewList=e},dates:this.dates,activeView:e,focusedDate:this.focusedDate,weekDaysFormat:this.props.weekDaysFormat,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:l,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,onWeekSelect:this.handleWeekSelection,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}isInMonth(e,t){return!!t&&a.firstDayOfMonth(t)<=e&&e<=a.lastDayOfMonth(t)}};Di.displayName="MultiViewCalendar",Di.propTypes={activeRangeEnd:i.oneOf(["start","end"]),allowReverse:i.bool,bottomView:i.oneOf(["month","year","decade","century"]),className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.oneOfType([T(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:T(i.instanceOf(Date)),end:T(i.instanceOf(Date))})]),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,weekDaysFormat:i.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),mode:i.oneOf(["single","multiple","range"]),onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,topView:i.oneOf(["month","year","decade","century"]),value:i.oneOfType([T(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:T(i.instanceOf(Date).isRequired),end:T(i.instanceOf(Date).isRequired)})]),views:(e,t,i)=>{const s=e[t];return void 0!==s&&s<1?new Error(`Invalid prop '${t}' supplied to'${i}'. The '${t}' property cannot be less than 1'`):null},weekNumber:i.bool,showOtherMonthDays:i.bool,dir:i.string},Di.defaultProps={disabled:!1,min:V,max:N,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let yi=Di;const Si=s.createPropsContext(),Ci=s.withIdHOC(s.withPropsContext(Si,yi));Ci.displayName="KendoReactMultiViewCalendar",n.registerForIntl(yi),n.registerForLocalization(yi);const ki=class e extends m.Component{constructor(t){super(t),this._element=null,this._calendar=null,this._startDateInput=m.createRef(),this._endDateInput=m.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.showLicenseWatermark=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(void 0!==e.value?e.value:t.value)||M,this.calculateShow=(e,t)=>void 0!==e.show?e.show:t.show,this.renderCalendar=()=>{const e=this.value||M,t={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?m.createElement(this.props.calendar,{...t}):m.createElement(Ci,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:s.classNames("k-calendar-container","k-daterangepicker-popup"),animate:null!==this._element,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?m.createElement(this.props.popup,{...e},this.renderCalendar()):m.createElement(u.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:e=>this.handleCancel(e),title:this.props.adaptiveTitle,subTitle:this.props.adaptiveSubtitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(De,Se[De]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(ye,Se[ye]),onApply:this.handleBlur}};return m.createElement(It,{...t},m.createElement(d.ActionSheetContent,null,m.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick((()=>{this.setShow(!1)}));const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick((()=>{this.setShow(!1),this.setState({currentValue:M})}));const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:a.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:a.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!(Array.isArray(e.value)||e.value instanceof Date))return e.value||M;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:null!==this.value.end?t:this.value.start,end:null!==this.value.start?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;t===s.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===s.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):i&&t===s.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const e={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,e)}this.valueDuringOnChange=void 0},this.showLicenseWatermark=!s.validatePackage(Et,{component:"DateRangePicker"}),this.licenseMessage=s.getLicenseMessage(Et),this.state={show:this.props.show||this.props.defaultShow||e.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||e.defaultProps.defaultValue,currentValue:M},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value)||M}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return n.provideLocalizationService(this)}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)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.mobileMode&&this.show&&setTimeout((()=>{this.focusCalendarElement()}),300),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{autoFocus:e}=this.props,t=this.value||M,i=this.mobileMode&&this.show?this.state.currentValue:t,a=(this.props.startDateInputSettings||{}).id||this._startInputId,l=(this.props.endDateInputSettings||{}).id||this._endInputId,h=s.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),c=this.localizationService.toLanguageString(oe,Se[oe]),u=this.localizationService.toLanguageString(re,Se[re]),d=this.localizationService.toLanguageString(le,Se[le]),p={disableSelection:this.mobileMode&&!0,label:c,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.startDateInputSettings,value:i.start,onChange:this.handleStartChange,inputAttributes:this.props.inputAttributes},g={disableSelection:this.mobileMode&&!0,label:u,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.endDateInputSettings,value:i.end,onChange:this.handleEndChange,inputAttributes:this.props.inputAttributes},v=m.createElement(o.Button,{type:"button",className:"k-select",fillMode:"flat",title:n.provideLocalizationService(this).toLanguageString(ne,Se[ne]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":a+" "+l,"aria-label":n.provideLocalizationService(this).toLanguageString(ne,Se[ne])},m.createElement(s.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:r.arrowsSwapIcon}));return m.createElement(m.Fragment,null,m.createElement("span",{ref:e=>{this._element=e},className:h,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.mobileMode?this.handleClick:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?m.createElement(this.props.startDateInput,{...p}):m.createElement(yt,{...p,autoFocus:e,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?v:d,this.props.endDateInput?m.createElement(this.props.endDateInput,{...g}):m.createElement(yt,{...g,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}focusDateInputElement(){if(!(document&&this.startDateInput&&this.startDateInput.element&&this.endDateInput&&this.endDateInput.element))return;const e=s.getActiveElement(document);null!==this.value.start&&null===this.value.end||e===this.endDateInput.element?e!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0}):this.startDateInput.element.focus({preventScroll:!0})}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ki.displayName="DateRangePicker",ki.propTypes={allowReverse:i.bool,calendarSettings:i.any,className:i.string,defaultShow:i.bool,defaultValue:i.shape({start:T(i.instanceOf(Date).isRequired),end:T(i.instanceOf(Date).isRequired)}),disabled:i.bool,endDateInputSettings:i.shape(yt.propTypes),focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),onBlur:i.func,onChange:i.func,onFocus:i.func,popupSettings:i.any,show:i.bool,startDateInputSettings:i.any,style:i.any,swapButton:i.any,tabIndex:i.number,dir:i.string,value:i.shape({start:T(i.instanceOf(Date)),end:T(i.instanceOf(Date))}),autoFocus:i.bool,inputAttributes:i.object},ki.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:M,disabled:!1,format:"d",max:N,min:V,swapButton:!1,autoFocus:!1};let xi=ki;const Ii=s.createPropsContext(),Mi=s.withIdHOC(s.withPropsContext(Ii,s.withAdaptiveModeContext(xi)));Mi.displayName="KendoReactDateRangePicker",n.registerForLocalization(xi);const Ti=class extends m.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._dateButtonRef=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then((()=>{"time"===this.state.tab&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();"date"===this.state.tab&&t&&t.focus(e)}))},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-calendar"),this.move=e=>{if("right"===e&&"time"===this.state.tab||"left"===e&&"date"===this.state.tab)return;const t="left"===e?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e,unstyled:t}=this.props,i=t&&t.uDateTimePicker,a=this.localizationService.toLanguageString(we,Se[we]),n=this.localizationService.toLanguageString(be,Se[be]);return m.createElement("div",{className:s.classNames(s.uDateTimePicker.timeFooter({c:i}))},e&&m.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:s.classNames(s.uTime.cancel({c:i})),onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:a,"aria-label":a},a),m.createElement(o.Button,{type:"button",themeColor:"primary",ref:e=>{this._acceptButton=e},className:s.classNames(s.uTime.accept({c:i})),disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:n,"aria-label":n},n))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||E});const t=this.mergeDate(this.props.value,this.props.value||E);if(this.props.onReject){const i={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,i)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const i=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:this})},this.handleNowClick=e=>{this.setState({timeValue:pt()}),this.handleAccept(e,pt())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;if(!this.props.disabled)switch(t){case s.Keys.enter:return void(!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e));case s.Keys.left:if(!i)return;return void this.move("left");case s.Keys.right:if(!i)return;return void this.move("right");default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var t,i,a,n;const{keyCode:o,shiftKey:r}=e;r&&o===s.Keys.tab&&(e.stopPropagation(),this.hasDateValue?null==(n=null==(a=this._acceptButton)?void 0:a.element)||n.focus():null==(i=null==(t=this._cancelButton)?void 0:t.element)||i.focus()),o===s.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||E}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return null!==this.state.dateValue}get localizationService(){return n.provideLocalizationService(this)}componentDidUpdate(e,t){var i,s;this.shouldFocusPart&&this.focus({preventScroll:!0}),((null==(i=e.value)?void 0:i.getTime())!==(null==(s=this.props.value)?void 0:s.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState((t=>({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?t.dateValue:this.props.value,timeValue:this.props.value||E}))),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h,unstyled:c}=this.props,u=c&&c.uDateTimePicker,d=s.classNames(s.uDateTimePicker.wrap({c:u,date:"date"===this.state.tab,time:"time"===this.state.tab,disabled:e})),p=this.localizationService.toLanguageString(ve,Se[ve]),g=this.localizationService.toLanguageString(fe,Se[fe]),v={min:t,max:i,weekNumber:a,focusedDate:n,disabled:e||"date"!==this.state.tab,value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:e||"date"!==this.state.tab?-1:void 0,mobileMode:l};return m.createElement("div",{onKeyDown:this.handleKeyDown,className:d,tabIndex:-1},m.createElement("div",{className:s.classNames(s.uDateTimePicker.buttonGroup({c:u}))},m.createElement(o.ButtonGroup,{width:"100%",unstyled:c},m.createElement(o.Button,{ref:e=>{this._dateButtonRef=e},type:"button",selected:"date"===this.state.tab,togglable:!0,size:l?"large":void 0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},p),m.createElement(o.Button,{type:"button",selected:"time"===this.state.tab,togglable:!0,size:l?"large":void 0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},g))),m.createElement("div",{className:s.classNames(s.uDateTimePicker.selector({c:u}))},m.createElement("div",{className:s.classNames(s.uDateTimePicker.calendarWrap({c:u})),ref:e=>{this._calendarWrap=e}},this.props.calendar?m.createElement(this.props.calendar,{key:this.state.tab,...v}):m.createElement(et,{key:this.state.tab,ref:e=>{this._calendar=e},...v})),m.createElement("div",{className:s.classNames(s.uDateTimePicker.timeWrap({c:u}))},m.createElement("div",{className:s.classNames(s.uDateTimePicker.timeSelector({c:u,mobileMode:l}))},m.createElement(ri,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||R,max:this.maxTime||P,steps:this.props.steps,value:this.state.timeValue,format:r,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:l,unstyled:c})))),h&&this.dateTimeFooter())}get minTime(){return void 0!==this.props.minTime?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return void 0!==this.props.maxTime?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return a.isEqualDate(e,t||L())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?F(t,e):t}mergeDate(e,t){return e?F(e||L(),t):t}};Ti.defaultProps={footerActions:!0};let Oi=Ti;n.registerForLocalization(Oi);const Ei=class e extends m.Component{constructor(t){super(t),this._element=null,this._dateInput=m.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:s,calendar:a,cancelButton:n,weekNumber:o,focusedDate:r,unstyled:l}=this.props;return m.createElement(Oi,{ref:e=>{this._dateTimeSelector=e},cancelButton:n,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:o,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:r,format:s,calendar:a,mobileMode:this.mobileMode,footerActions:!this.mobileMode,unstyled:l})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(we,Se[we]),i=n.provideLocalizationService(this).toLanguageString(be,Se[be]),s={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:e,footer:{cancelText:t,onCancel:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleReject(e)},applyText:i,onApply:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleAccept(e)}}};return m.createElement(It,{...s},m.createElement(d.ActionSheetContent,null,this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}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 min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get validity(){const e=A(this.value,this.min,this.max)&&vt(this.value,this.props.minTime||R,this.props.maxTime||P),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,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}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const e=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),this.mobileMode&&this.show&&!this.prevShow&&setTimeout((()=>{this._dateTimeSelector&&this._dateTimeSelector.focus({preventScroll:!0})}),300),e&&!this.show&&this.shouldFocusDateInput&&e.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,autoFocus:l=e.defaultProps.autoFocus,inputAttributes:h,disabled:c,tabIndex:d,title:p,id:g,format:v,formatPlaceholder:f,min:w,max:b,className:D,width:y,name:S,validationMessage:C,required:k,validityStyles:x,minTime:I,maxTime:M,ariaLabelledBy:T,ariaDescribedBy:O,popup:E=u.Popup,unstyled:V,autoFill:N,twoDigitYearMax:R,enableMouseWheel:P,autoCorrectParts:F,autoSwitchParts:L,autoSwitchKeys:B,allowCaretMode:A}=this.props,z=V&&V.uDateTimePicker,H=!this.validityStyles||this.validity.valid,_={id:g,ariaLabelledBy:T,ariaDescribedBy:O,format:v,formatPlaceholder:f,disabled:c,title:p,validityStyles:x,validationMessage:C,required:k,min:w,max:b,minTime:I,maxTime:M,name:S,tabIndex:this.show?-1:d,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null,unstyled:V,autoFill:N,twoDigitYearMax:R,enableMouseWheel:P,autoCorrectParts:F,autoSwitchParts:L,autoSwitchKeys:B,allowCaretMode:A},q=m.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},(({onFocus:e,onBlur:u})=>m.createElement(m.Fragment,null,m.createElement("div",{ref:e=>{this._element=e},className:s.classNames(s.uDateTimePicker.wrapper({c:z,size:t,fillMode:a,rounded:i,disabled:c,required:this.required,invalid:!H}),D),onKeyDown:this.handleKeyDown,style:{width:y},onFocus:this.mobileMode?this.handleClick:e,onBlur:u,onClick:this.mobileMode?this.handleClick:void 0},m.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,ariaHasPopup:"dialog",autoFocus:l,inputAttributes:h,..._}),m.createElement(o.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:r.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:n.provideLocalizationService(this).toLanguageString(he,Se[he]),className:s.classNames(s.uDateTimePicker.inputButton({c:z})),rounded:null,fillMode:a,"aria-label":n.provideLocalizationService(this).toLanguageString(he,Se[he])}),m.createElement(E,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:s.classNames(s.uDateTimePicker.popup({c:z})),id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?m.createElement(xt,{dateInput:this._dateInput,label:this.props.label,editorId:g,editorValid:H,editorDisabled:this.props.disabled,children:q,style:{width:this.props.width}}):q}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Ei.displayName="DateTimePicker",Ei.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,cancelButton:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool,inputAttributes:i.object},Ei.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:N,min:V,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,cancelButton:!0,dateInput:yt,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Vi=Ei;const Ni=s.createPropsContext(),Ri=s.withIdHOC(s.withPropsContext(Ni,s.withUnstyledHOC(s.withAdaptiveModeContext(Vi))));Ri.displayName="KendoReactDateTimePicker",n.registerForLocalization(Vi),e.Action=Ee,e.BusViewService=Ke,e.Calendar=et,e.CalendarCell=k,e.CalendarHeaderTitle=Z,e.CalendarNavigationItem=Me,e.CalendarPropsContext=Qe,e.CalendarViewEnum=I,e.CalendarWeekCell=x,e.CalendarWithoutContext=Xe,e.CenturyViewService=Re,e.DOMService=Ue,e.DateInput=yt,e.DateInputPropsContext=Ct,e.DatePicker=Mt,e.DatePickerPropsContext=Ot,e.DateRangePicker=Mi,e.DateRangePickerPropsContext=Ii,e.DateRangePickerWithoutContext=xi,e.DateTimePicker=Ri,e.DateTimePickerPropsContext=Ni,e.DateTimePickerWithoutContext=Vi,e.DayPeriodService=Ft,e.DecadeViewService=Le,e.EMPTY_SELECTIONRANGE=M,e.Header=G,e.HorizontalViewList=gi,e.HoursService=qt,e.MAX_DATE=N,e.MAX_TIME=P,e.MIN_DATE=V,e.MIN_TIME=R,e.MinutesService=jt,e.MonthViewService=ze,e.MultiViewCalendar=Ci,e.MultiViewCalendarPropsContext=Si,e.MultiViewCalendarWithoutContext=yi,e.NavigationService=$e,e.ScrollSyncService=je,e.SecondsService=ei,e.TimeList=ai,e.TimePart=ri,e.TimePicker=pi,e.TimePickerPropsContext=di,e.TimePickerWithoutContext=ui,e.TimeSelector=hi,e.TodayCommand=ke,e.ToggleButton=kt,e.ViewList=Ie,e.Virtualization=C,e.WeekNamesService=U,e.YearViewService=qe,e.dateInputDefaultProps=St,e.dateInputsMessages=Se,e.datePickerDefaultProps=Tt,e.decreaseValue=te,e.end=re,e.getNow=pt,e.getToday=L,e.increaseValue=ee,e.separator=le,e.start=oe,e.swapStartEnd=ne,e.today=se,e.toggleCalendar=ae,e.toggleDateTimeSelector=he}));
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-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-dateinputs-common"),require("@progress/kendo-intl"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-dateinputs-common","@progress/kendo-intl","@progress/kendo-react-popup","@progress/kendo-react-layout"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDateinputs={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoDateMath,e.KendoReactIntl,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLabels,e.KendoDateinputsCommon,e.KendoIntl,e.KendoReactPopup,e.KendoReactLayout)}(this,(function(e,t,i,s,a,n,o,r,l,h,c,u,d){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var m=p(t);const g=e=>Math.max(e,0);let v=class{constructor(e){this.offset=e}},f=class{constructor(e){this.skip=e}},w=class{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(e,t,i,s,a=0,n=0,o="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=s,this.lastScrollTop=0,this.topOffset=a,this.bottomOffset=n,this.direction=o;const r=this.rowsForHeight(a),l=g(t-r);this.onScrollAction(new v(this.rowOffset(l))),this.onPageAction(new f(l))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:s}){const a="vertical"===this.direction?t:e,n="vertical"===this.direction?i:s;if(this.lastScrollTop===a||!this.rowHeightService)return;const o=this.lastScrollTop>=a;this.lastScrollTop=a;const r=this.rowHeightService.index(g(a-this.topOffset)),l=this.rowHeightService.index(g(a+n-this.bottomOffset));if(!o&&l>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=r,this.onScrollAction(new v(this.rowOffset(r))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new f(this.firstLoaded))),o&&r<=this.firstLoaded){const e=Math.floor(.3*this.take);this.firstLoaded=g(r-e),this.onScrollAction(new v(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new f(this.firstLoaded))}}rowOffset(e){return this.rowHeightService?this.rowHeightService.offset(e)+this.topOffset:0}rowsForHeight(e){return this.rowHeightService?Math.ceil(e/this.rowHeightService.height(0)):0}};const b={1:e=>t=>t+e,0:e=>t=>t-e},D={1:e=>t=>Math.min(t,e),0:e=>t=>Math.max(t,e)},y={1:e=>t=>t<e,0:e=>t=>t>e},S=class e extends m.Component{constructor(t){super(t),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=e=>{const t="vertical"===this.direction?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&"scrollTop"===t&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<10||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t),{start:s,end:a}=this.scrollRange(t,i);if(s===a)return;const n=this.scrollStep(s,a),o=b[i](n),r=D[i](a),l=y[i](o(a)),h=e=>{this.animationInProgress=!0;const t=o(e);this.scrollTo(r(t)),l(t)?this.cancelAnimation=window.requestAnimationFrame((()=>{h(t)})):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame((()=>{h(s)}))},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const s=this.props.scrollDuration||e.defaultProps.scrollDuration;return Math.abs(i-t)/(s/17)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const s=this.containerMaxScroll(),a=0===t?1:-1,n=((e,t,i)=>Math.min(Math.abs(t-e),i))(i,e,this.props.maxScrollDifference||0),o=Math.min(e,s);return{start:Math.min(Math.max(o+a*n,0),s),end:o}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t="vertical"===this.direction?e.itemHeight:e.itemWidth;void 0!==t&&(this.rowHeightService=new s.RowHeightService(e.total,t),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:s}=this.props,a={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),s&&s.call(void 0,a),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new w(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(m.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty("vertical"===this.direction?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty("vertical"===this.direction?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty("vertical"===this.direction?"scrollTop":"scrollLeft")}get direction(){return void 0!==this.props.direction?this.props.direction:e.defaultProps.direction}get scrollOffsetSize(){return void 0!==this.props.scrollOffsetSize?this.props.scrollOffsetSize:e.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,s=this.rowHeightService.offset(e),a=s+this.rowHeightService.height(e);return s>=t&&a<=i}isListScrolled(e){return!!this.rowHeightService&&this.containerScrollPosition!==this.rowHeightService.offset(e)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){const{total:e,take:t,bottomOffset:i,className:a,tabIndex:n,role:o,children:r,unstyled:l}=this.props,h=l&&l.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const c=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,u="vertical"===this.direction?{height:`${c}px`}:{width:`${c}px`},d=s.classNames(s.uCalendar.scrollableSelector({c:h}),s.uCalendar.scrollable({c:h,horizontal:"horizontal"===this.direction}),a),p=s.classNames(s.uCalendar.scrollablePlaceholder({c:h,horizontal:"horizontal"===this.direction}));return m.createElement("div",{ref:e=>{this.scrollContainer=e},onScroll:this.handleScroll,className:d,tabIndex:n,role:o},r,m.createElement("div",{style:u,className:p}))}};S.propTypes={bottomOffset:i.number.isRequired,className:i.string,direction:i.oneOf(["horizontal","vertical"]),forceScroll:i.bool,itemHeight:i.number,itemWidth:i.number,maxScrollDifference:i.number,onScroll:i.func,onScrollAction:i.func,scrollDuration:i.number,scrollOffsetSize:i.number,skip:i.number.isRequired,tabIndex:i.number,take:i.number.isRequired,topOffset:i.number.isRequired,total:i.number.isRequired,role:i.string},S.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let C=S;let k=class extends m.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:s,...a}=e;return!((!t||!s||t.getTime()===s.getTime())&&((e,t)=>{const i=Object.getOwnPropertyNames(e),s=Object.getOwnPropertyNames(t);if(i.length!==s.length)return!1;for(let s=0;s<i.length;s++){const a=i[s];if(e[a]!==t[a])return!1}return!0})(i,a))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:n,isSelected:o,isRangeStart:r,isRangeMid:l,isRangeEnd:h,isRangeSplitStart:c,isRangeSplitEnd:u,isToday:d,isDisabled:p,view:g,value:v,isOtherMonth:f,showOtherMonthDays:w,allowReverse:b,unstyled:D,...y}=this.props,S="end"===this.props.activeRangeEnd&&h,C="start"===this.props.activeRangeEnd&&r,k=D&&D.uCalendar,x=s.classNames(s.uCalendar.td({c:k,rangeStart:!f&&!b&&r,rangeEnd:!f&&!b&&h,rangeMid:!f&&l,rangeSplitEnd:!f&&u,rangeSplitStart:!f&&c,active:C||S,focused:a,selected:!f&&(o||r||h),today:!f&&d,weekend:i,disabled:p,isOtherMonth:f,isEmpty:!w&&f}),e);return!w&&f?m.createElement("td",{role:"gridcell",className:x}):m.createElement("td",{...y,className:x,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},m.createElement("span",{className:s.classNames(s.uCalendar.link({c:k}))},this.props.children))}};const x=e=>{const{className:t,firstDate:i,weekDays:a,...n}=e,o=s.useUnstyled(),r=o&&o.uCalendar;return m.createElement("td",{className:s.classNames(s.uCalendar.td({c:r,isWeek:!0}),t),...n,onClick:t=>{const{onClick:s}=e;s&&t&&s.call(void 0,i,a||[],t)}},e.children)};var I=(e=>(e[e.month=0]="month",e[e.year=1]="year",e[e.decade=2]="decade",e[e.century=3]="century",e))(I||{});const M={start:null,end:null};function T(e){const t=(t,i,s,...a)=>null===i[s]?null:(t?e.isRequired:e)(i,s,...a),i=t.bind(null,!1);return i.isRequired=t.bind(null,!0),i}const O=(e,t,i)=>void 0===t||void 0===i||t<=e&&e<=i?e:e<t?t:i,E=new Date(1980,0,1),V=new Date(1900,0,1),N=new Date(2099,11,31),R=new Date(1980,0,1),P=new Date(1980,0,1,23,59,59),F=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},L=()=>a.getDate(new Date),B=(e,t,i)=>!e||!(t&&t>e||i&&i<e),A=(e,t,i)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||i&&a.getDate(i)<a.getDate(e)),z=(e,t)=>{const{start:i,end:s}=t||M;return!(!i||!s)&&(i<e&&e<s)},H=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},_=(e,t,i)=>t.getTime()<=e.getTime()&&e.getTime()<=i.getTime(),q=(e,t,i)=>e&&(t&&e<t?a.cloneDate(t):i&&e>i?a.cloneDate(i):e),W=e=>(t,i="",s={})=>{const a=document.createElement(e);return a.className=i,Object.keys(s).forEach((e=>{a.style[e]=s[e]})),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function K(e,t,i={}){let s,a,n,o,r;i.maxWait;const l=window,h=!1,c=!1,u=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){const i=s,o=a;return s=a=void 0,n=e.apply(o,i),n}function p(e,t){return u?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-r;return void 0===r||i>=t||i<0||c}function g(){const e=Date.now();if(m(e))return v();o=p(g,function(e){return t-(e-r)}(e))}function v(e){return o=void 0,s?d():(s=a=void 0,n)}function f(...e){const i=Date.now(),l=m(i);return s=e,a=this,r=i,l&&void 0===o?(o=p(g,t),h?d():n):(void 0===o&&(o=p(g,t)),n)}return t=+t||0,f.cancel=function(){void 0!==o&&function(e){if(u)return l.cancelAnimationFrame(e);clearTimeout(e)}(o),s=r=a=o=void 0},f.flush=function(){return void 0===o?n:v()},f.pending=function(){return void 0!==o},f}let U=class{constructor(e){this.intl=e}getWeekNames(e=!1,t){const i=((e,t)=>e.slice(t).concat(e.slice(0,t)))(this.intl.dateFormatNames({nameType:null!=t?t:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(i):i}};const Y=(e,t)=>{const i=t;return m.createElement("td",{key:e,role:"gridcell",className:s.classNames(s.uCalendar.td({c:i,isEmpty:!0}))}," ")},$=class e extends m.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(e,t)=>{if(!this.firstDate(e))return Y(`week-cell-${t}`);const i=this.firstDate(e),s=this.getWeekNumber(i),a=`kendo-react-calendar-week-cell-${s}`,n={value:s,firstDate:i,weekDays:e,unstyled:this.props.unstyled,onClick:this.handleWeekCellClick};return this.props.weekCell?m.createElement(this.props.weekCell,{...n,key:a},s):m.createElement(x,{...n,key:a},s)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return Y(t);const i={"aria-selected":e.isSelected},s=`kendo-react-calendar-cell-${e.value.getTime()}`,a={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse,unstyled:this.props.unstyled,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?m.createElement(this.props.cell,{...a,key:s},e.formattedValue):m.createElement(k,{...a,key:s},e.formattedValue)})),this.firstDate=e=>{const t=this.firstWeekDateContext(e);return t?t.value:null},this.firstWeekDateContext=e=>{if(!this.weekNumber)return null;let t=0,i=e[t];for(;!i&&t<e.length;)i=e[++t];return i},this.handleClick=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props,a=t.findIndex((t=>t&&t.value===e));s&&i&&s.call(void 0,e,a,i)},this.handleMouseEnter=e=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,a.cloneDate(e))},this.handleMouseLeave=e=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,a.cloneDate(e))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return"horizontal"===this.props.direction}get isMonthView(){return this.props.activeView===I.month}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==I.month)}get selectedDate(){return void 0!==this.props.selectedDate?this.props.selectedDate:e.defaultProps.selectedDate}render(){const{service:e,weekDaysFormat:t,cellUID:i,focusedDate:a,bus:o,activeView:r,selectionRange:l,unstyled:h}=this.props,c=h&&h.uCalendar;this.intl=n.provideIntlService(this),this.weekService=new U(this.intl);const u=this.weekService.getWeekNames(this.weekNumber,t),d=e.rowLength(this.weekNumber),p=e.title(this.props.viewDate),g=L(),v=F(this.props.viewDate,g),f=e.data({cellUID:i,min:this.min,max:this.max,focusedDate:a,isActiveView:!o.canMoveDown(r),selectedDate:this.selectedDate,selectionRange:l,viewDate:v});return m.createElement(m.Fragment,null,this.isMonthView&&this.isHorizontal&&m.createElement("thead",{role:"rowgroup",className:s.classNames(s.uCalendar.thead({c:c}))},m.createElement("tr",{role:"row",className:s.classNames(s.uCalendar.tr({c:c}))},u.map(((e,t)=>m.createElement("th",{key:t,className:s.classNames(s.uCalendar.th({c:c}))},e))))),m.createElement("tbody",{role:"rowgroup",className:s.classNames(s.uCalendar.tbody({c:c}))},!this.isHorizontal&&m.createElement("tr",{role:"presentation",className:s.classNames(s.uCalendar.tr({c:c}))},m.createElement("th",{scope:"col",colSpan:d,className:s.classNames(s.uCalendar.caption({c:c}))},p)),f.map(((e,t)=>m.createElement("tr",{role:"row",className:s.classNames(s.uCalendar.tr({c:c})),key:t},this.weekNumber&&this.buildWeekNumber(e,t),this.buildRow(e))))))}getWeekNumber(e){return this.weekNumber&&this.intl?a.weekInYear(e,this.intl.firstDay()):null}};$.propTypes={activeRangeEnd:i.oneOf(["start","end",null]),activeView:i.number.isRequired,cellUID:i.string.isRequired,direction:i.oneOf(["horizontal","vertical"]),focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,selectedDate:i.oneOfType([i.instanceOf(Date),i.arrayOf(i.instanceOf(Date))]),showWeekNumbers:i.bool,showOtherMonthDays:i.bool,viewDate:i.instanceOf(Date).isRequired},$.defaultProps={direction:"vertical",selectedDate:L(),showWeekNumbers:!1};let j=$;n.registerForIntl(j);const Z=e=>{const{view:t,...i}=e;return m.createElement(o.Button,{type:"button",fillMode:"flat",themeColor:"primary",...i},e.children)},J=class e extends m.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const e=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),i=this.props.service.addToDate(this.props.currentDate,e);return e<1||!this.props.service.isInRange(i,this.min,this.max)?t:`${t} - ${this.props.service.title(i)}`},this.handleTitleClick=e=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,e)}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get rangeLength(){return void 0!==this.props.rangeLength?this.props.rangeLength:e.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const{activeView:e,commands:t,unstyled:i}=this.props,a=i&&i.uCalendar,n=this.getTitle(),o={children:n,value:n,view:e,className:s.classNames(s.uCalendar.title({c:a})),onClick:this.handleTitleClick,disabled:!this.canMoveUp},r={headerTitleProps:o,commands:t},l=this.props.headerTitle?m.createElement(this.props.headerTitle,{...o},n):m.createElement(Z,{...o},n),h=this.props.header?m.createElement(this.props.header,{...r}):m.createElement(m.Fragment,null,l,m.createElement("span",{className:s.classNames(s.uCalendar.spacer({c:a}))}),m.createElement("span",{className:s.classNames(s.uCalendar.nav({c:a}))},this.props.commands));return m.createElement("div",{className:s.classNames(s.uCalendar.header({c:a,vertical:this.props.verticalView}))},h)}};J.propTypes={activeView:i.number.isRequired,currentDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,rangeLength:i.number},J.defaultProps={rangeLength:1,min:V,max:N};let G=J;n.registerForLocalization(G);const X="multiviewcalendar.prevView",Q="multiviewcalendar.nextView",ee="dateinput.increment",te="dateinput.decrement",ie="dateinput.clear",se="calendar.today",ae="datepicker.toggleCalendar",ne="daterangepicker.swapStartEnd",oe="daterangepicker.start",re="daterangepicker.end",le="daterangepicker.separator",he="datetimepicker.toggleDateTimeSelector",ce="timepicker.now",ue="timepicker.selectNow",de="timepicker.cancel",pe="timepicker.set",me="timepicker.toggleTimeSelector",ge="timepicker.toggleClock",ve="datetimepicker.date",fe="datetimepicker.time",we="datetimepicker.cancel",be="datetimepicker.set",De="daterangepicker.cancel",ye="daterangepicker.set",Se={[se]:"Today",[ce]:"NOW",[pe]:"Set",[de]:"Cancel",[ve]:"Date",[fe]:"Time",[we]:"Cancel",[be]:"Set",[De]:"Cancel",[ye]:"Set",[oe]:"Start",[re]:"End",[le]:" ",[ue]:"Select Now",[me]:"Toggle TimeSelector",[ge]:"Toggle Clock",[ee]:"Increase value",[te]:"Decrease value",[ie]:"clear",[ae]:"Toggle calendar",[X]:"Navigate to previous view",[Q]:"Navigate to next view",[ne]:"Swap start and end values",[he]:"Toggle date-time selector"},Ce=class e extends m.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:q(L(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get todayIsInRange(){return B(L(),a.getDate(this.min),a.getDate(this.max))}render(){const{disabled:e,tabIndex:t,unstyled:i}=this.props,a=i&&i.uCalendar;this.localization=n.provideLocalizationService(this);const r=this.localization.toLanguageString(se,Se[se]),l=s.classNames(s.uCalendar.today({c:a,disabled:e}));return m.createElement(o.Button,{className:l,onClick:this.handleClick,tabIndex:t,fillMode:"flat",themeColor:"base",role:"link"},r)}};Ce.propTypes={max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onClick:i.func,disabled:i.bool},Ce.defaultProps={min:V,max:N};let ke=Ce;n.registerForLocalization(ke);const xe=class e extends m.Component{constructor(e){super(e),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.weekService=null,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=q(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildMonthView=(e,t)=>{const{unstyled:i}=this.props,a=i&&i.uCalendar;return m.createElement("table",{key:"calendar-view-list-weekdays",className:s.classNames(s.uCalendar.table({c:a,weekdays:!0})),role:"grid",tabIndex:this.props.tabIndex},m.createElement("colgroup",null,e.map(((e,t)=>m.createElement("col",{key:t})))),m.createElement("thead",{className:s.classNames(s.uCalendar.thead({c:a}))},m.createElement("tr",{className:s.classNames(s.uCalendar.tr({c:a}))},t.map(((e,t)=>m.createElement("th",{key:t,className:s.classNames(s.uCalendar.th({c:a}))},e))))))},this.buildDates=(e,t)=>{const i=this.props.cellUID,{unstyled:a}=this.props,n=a&&a.uCalendar;return m.createElement("table",{className:s.classNames(s.uCalendar.table({c:n})),ref:e=>{this.table=e},role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},m.createElement("colgroup",null,e.map(((e,t)=>m.createElement("col",{key:t})))),t.map((e=>m.createElement(j,{ref:e=>{this.calendarView||(this.calendarView=e)},key:e.getTime(),activeView:this.props.activeView,viewDate:e,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:a}))))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===I.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const s=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==s)&&this.setState({index:e,skip:s}),this.table&&t){const e=`translateY(${t.offset}px)`;this.table.style.transform=e}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){return this.intl=n.provideIntlService(this),this.weekService=new U(this.intl),this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat)}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==I.month)}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get todayIsInRange(){return B(L(),a.getDate(this.props.min),a.getDate(this.props.max))}componentDidUpdate(e,t){this.shouldScroll=!1,void 0!==this.indexToScroll&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){const{activeView:e,min:t,max:i,service:n,unstyled:o}=this.props,r=o&&o.uCalendar;this.calculateHeights();const l=this.lastView!==e,h=q(this.props.focusedDate,t,i),c=l?n.skip(h,t):this.state.skip,u=n.total(t,i),d=this.getTake(c,u),p=n.addToDate(t,c),g=n.addToDate(t,this.state.index),v=new Array(n.rowLength(this.weekNumber)).fill(""),f=e!==this.lastView;this.animateToIndex=!f,(f||!a.isEqualDate(this.lastFocus,h)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(h,this.props.min)),this.lastFocus=h;const w=s.classNames(s.uCalendar.view({c:r,month:e===I.month,year:e===I.year,decade:e===I.decade,century:e===I.century})),b=this.buildDates(v,n.datesList(p,d)),D=m.createElement(m.Fragment,null,m.createElement(G,{key:"calendar-view-list-header",currentDate:g,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,header:this.props.header,unstyled:o,commands:m.createElement(ke,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex,unstyled:o})}),this.props.activeView===I.month&&this.buildMonthView(v,this.weekNames),m.createElement(C,{key:"calendar-view-list-content",skip:c,take:this.take,total:u,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:e=>!this.virtualization&&this.handleVirtualizationMount(e),children:b,tabIndex:this.props.tabIndex,unstyled:o}));return m.createElement("div",{ref:e=>{this._element=e},className:w},this.props.dom.didCalculate?D:null)}};xe.propTypes={activeView:i.number.isRequired,bottomOffset:i.number,cellUID:i.string.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,showWeekNumbers:i.bool,smoothScroll:i.bool,take:i.number,value:i.instanceOf(Date),viewHeight:i.number,viewOffset:i.number,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),tabIndex:i.number},xe.defaultProps={take:5,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let Ie=xe;n.registerForIntl(Ie);const Me=e=>{const{className:t,isRangeStart:i,value:a,text:n,view:o,...r}=e,l=s.useUnstyled(),h=l&&l.uCalendar;return m.createElement("li",{...r,onClick:t=>{var i;null==(i=e.onClick)||i.call(e,a,t)},className:s.classNames(s.uCalendar.li({c:h}),t)},m.createElement("span",{className:s.classNames(s.uCalendar.navigationMarker({c:h,isRangeStart:i}))},e.children))},Te=class e extends m.Component{constructor(e){super(e),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const e=q(this.props.focusedDate,this.props.min,this.props.max),t=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(t)}},this.buildNavigationItem=e=>{const t=this.props.service.navigationTitle(e),i=this.props.service.isRangeStart(e),s=`kendo-react-calendar-nav-item-${e.getTime()}`,a={text:t,value:e,isRangeStart:i,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?m.createElement(this.props.navigationItem,{...a,key:s},t):m.createElement(Me,{...a,key:s},t)},this.calculateHeights=()=>{const e=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(e-this.itemHeight)/2,this.bottomOffset=e-this.itemHeight},this.handleDateChange=(e,t)=>{const{onChange:i}=this.props;if(i&&t){const s={value:a.cloneDate(e),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};i.call(void 0,s)}},this.handleScrollAction=({scrollAction:e,pageAction:t})=>{const i=t?t.skip:this.state.skip;if(this.state.skip!==i&&this.setState({skip:i}),this.list&&e){const t=`translateY(${e.offset}px)`;this.list.style.transform=t}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),i=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,i)>0?t:0}}get take(){return void 0!==this.props.take?this.props.take:e.defaultProps.take}componentDidUpdate(e,t){void 0!==this.indexToScroll&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){const{activeView:e,min:t,max:i,service:n,unstyled:o}=this.props;this.calculateHeights();const r=o&&o.uCalendar,l=this.lastView!==e,h=q(this.props.focusedDate,t,i),c=l?n.skip(h,t):this.state.skip,u=n.total(t,i),d=this.getTake(c,u),p=n.addToDate(t,c),g=n.datesList(p,d);(e!==this.lastView||!a.isEqual(h,this.lastFocus))&&(this.indexToScroll=n.skip(h,t));const v=m.createElement(C,{skip:c,take:this.take,total:u,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:e=>!this.virtualization&&this.handleVirtualizationMount(e),tabIndex:this.props.tabIndex,unstyled:o},m.createElement("ul",{ref:e=>{this.list=e},className:s.classNames(s.uCalendar.ul({c:r}))},g.map((e=>this.buildNavigationItem(e)))));return m.createElement("div",{className:s.classNames(s.uCalendar.navigation({c:r}))},m.createElement("span",{className:s.classNames(s.uCalendar.navigationHighlight({c:r}))}),this.props.dom.didCalculate?v:null)}getTake(e,t){return Math.min(t-e,this.take)}};Te.propTypes={activeView:i.number.isRequired,focusedDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onChange:i.func,take:i.number,tabIndex:i.number},Te.defaultProps={take:30};let Oe=Te;var Ee=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Up=2]="Up",e[e.Down=3]="Down",e[e.PrevView=4]="PrevView",e[e.NextView=5]="NextView",e[e.FirstInView=6]="FirstInView",e[e.LastInView=7]="LastInView",e[e.LowerView=8]="LowerView",e[e.UpperView=9]="UpperView",e))(Ee||{});const Ve=[[]],Ne={[Ee.Left]:e=>a.addDecades(e,-1),[Ee.Up]:e=>a.addDecades(e,-5),[Ee.Right]:e=>a.addDecades(e,1),[Ee.Down]:e=>a.addDecades(e,5),[Ee.PrevView]:e=>a.addCenturies(e,-1),[Ee.NextView]:e=>a.addCenturies(e,1),[Ee.FirstInView]:e=>a.firstDecadeOfCentury(e),[Ee.LastInView]:e=>a.lastDecadeOfCentury(e)};class Re{addToDate(e,t){return a.addCenturies(e,t)}datesList(e,t){return H(0,t).map((t=>a.addCenturies(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return Ve;const c=H(0,4),u=a.firstDecadeOfCentury(h),d=a.lastDecadeOfCentury(h),p=L();return H(0,3).map((e=>{const h=a.addDecades(u,4*e);return c.map((e=>{const c=this.normalize(a.addDecades(h,e),o,n),m=this.isEqual(c,l.start),g=this.isEqual(c,l.end),v=!m&&!g&&z(c,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(c,r,o,n):B(r,o,n)&&this.isEqual(c,r));return _(c,u,d)?{formattedValue:this.value(c),id:`${t}${c.getTime()}`,isFocused:this.isEqual(c,i),isSelected:f,isWeekend:!1,isInRange:B(c,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(c,d),isRangeSplitStart:v&&this.isEqual(c,u),isToday:this.isEqual(c,p),title:this.cellTitle(c),value:c}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&a.firstYearOfDecade(e).getFullYear()===a.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const s=a.firstYearOfDecade(e).getFullYear(),n=!t||a.firstYearOfDecade(t).getFullYear()<=s,o=!i||s<=a.firstYearOfDecade(i).getFullYear();return n&&o}isInSameView(e,t){return 0===a.durationInCenturies(e,t)}isRangeStart(e){return e.getFullYear()%1e3==0}move(e,t){const i=Ne[t];return i?i(e):e}cellTitle(e){return a.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?a.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${a.firstDecadeOfCentury(e).getFullYear()} - ${a.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInCenturies(t,e)}total(e,t){return a.durationInCenturies(e,t)+1}value(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInCenturies(e,t)<i?a.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}}const Pe=[[]],Fe={[Ee.Left]:e=>a.addYears(e,-1),[Ee.Up]:e=>a.addYears(e,-5),[Ee.Right]:e=>a.addYears(e,1),[Ee.Down]:e=>a.addYears(e,5),[Ee.PrevView]:e=>a.addDecades(e,-1),[Ee.NextView]:e=>a.addDecades(e,1),[Ee.FirstInView]:e=>a.firstYearOfDecade(e),[Ee.LastInView]:e=>a.lastYearOfDecade(e)};let Le=class{addToDate(e,t){return a.addDecades(e,t)}datesList(e,t){return H(0,t).map((t=>a.addDecades(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return Pe;const c=H(0,4),u=a.firstYearOfDecade(h),d=a.lastYearOfDecade(h),p=L();return H(0,3).map((e=>{const h=a.addYears(u,4*e);return c.map((e=>{const c=this.normalize(a.addYears(h,e),o,n),m=this.isEqual(c,l.start),g=this.isEqual(c,l.end),v=!m&&!g&&z(c,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(c,r,o,n):B(r,o,n)&&this.isEqual(c,r));return _(c,u,d)?{formattedValue:this.value(c),id:`${t}${c.getTime()}`,isFocused:this.isEqual(c,i),isSelected:f,isWeekend:!1,isInRange:B(c,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(c,d),isRangeSplitStart:v&&this.isEqual(c,u),isToday:this.isEqual(c,p),title:this.cellTitle(c),value:c}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const s=e.getFullYear(),a=!t||t.getFullYear()<=s,n=!i||s<=i.getFullYear();return a&&n}isRangeStart(e){return e.getFullYear()%100==0}isInSameView(e,t){return 0===a.durationInDecades(e,t)}move(e,t){const i=Fe[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?a.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${a.firstYearOfDecade(e).getFullYear()} - ${a.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return 4}skip(e,t){return a.durationInDecades(t,e)}total(e,t){return a.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return a.durationInDecades(e,t)<i?a.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const Be=[[]],Ae={[Ee.Left]:e=>a.addDays(e,-1),[Ee.Up]:e=>a.addWeeks(e,-1),[Ee.Right]:e=>a.addDays(e,1),[Ee.Down]:e=>a.addWeeks(e,1),[Ee.PrevView]:e=>a.addMonths(e,-1),[Ee.NextView]:e=>a.addMonths(e,1),[Ee.FirstInView]:e=>a.firstDayOfMonth(e),[Ee.LastInView]:e=>a.lastDayOfMonth(e)};class ze{constructor(e){this.intl=e}addToDate(e,t){return a.addMonths(e,t)}datesList(e,t){return H(0,t).map((t=>a.addMonths(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return Be;const c=a.firstDayOfMonth(h),u=a.lastDayOfMonth(h),d=a.dayOfWeek(c,this.intl.firstDay(),-1),p=H(0,7),m=L();return H(0,6).map((e=>{const h=a.addDays(d,7*e);return p.map((e=>{const d=this.normalize(a.addDays(h,e),o,n),p=d<c||d>u,g=this.isEqual(d,l.start),v=this.isEqual(d,l.end),f=!g&&!v&&z(d,l),w=s&&(Array.isArray(r)?this.isSelectedFromArray(d,r,o,n):B(r,o,n)&&this.isEqual(d,r)),b=this.isEqual(d,i)&&!p;return{formattedValue:this.value(d),id:`${t}${d.getTime()}`,isFocused:b,isSelected:w,isInRange:B(d,o,n),isWeekend:this.isWeekend(d),isRangeStart:g,isRangeMid:f,isRangeEnd:v,isRangeSplitStart:f&&this.isEqual(d,c),isRangeSplitEnd:f&&this.isEqual(d,u),isToday:this.isEqual(d,m),title:this.cellTitle(d),value:d,isOtherMonth:p}}))}))}isEqual(e,t){return!(!e||!t)&&a.getDate(e).getTime()===a.getDate(t).getTime()}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isInArray(e,t){return!!t.length&&a.firstDayOfMonth(t[0])<=e&&e<=a.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const s=a.getDate(e),n=!t||a.getDate(t)<=s,o=!i||s<=a.getDate(i);return n&&o}isInSameView(e,t){return 0===a.durationInMonths(e,t)}isRangeStart(e){return!e.getMonth()}move(e,t){const i=Ae[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return 7+(e?1:0)}skip(e,t){return a.durationInMonths(t,e)}total(e,t){return a.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return a.durationInMonths(e,t)<i?a.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return 6===t||0===t}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.getDate(t):e>i&&this.isEqual(e,i)?a.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const He=[[]],_e={[Ee.Left]:e=>a.addMonths(e,-1),[Ee.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Ee.Right]:e=>a.addMonths(e,1),[Ee.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Ee.PrevView]:e=>a.addYears(e,-1),[Ee.NextView]:e=>a.addYears(e,1),[Ee.FirstInView]:e=>a.firstMonthOfYear(e),[Ee.LastInView]:e=>a.lastMonthOfYear(e)};let qe=class{constructor(e){this._intl=e}addToDate(e,t){return a.addYears(e,t)}datesList(e,t){return H(0,t).map((t=>a.addYears(e,t)))}data(e){const{cellUID:t,focusedDate:i,isActiveView:s,max:n,min:o,selectedDate:r,selectionRange:l=M,viewDate:h}=e;if(!h)return He;const c=this.abbrMonthNames(),u=a.firstMonthOfYear(h),d=a.lastMonthOfYear(h),p=u.getFullYear(),m=H(0,4),g=L();return H(0,3).map((e=>{const h=a.addMonths(u,4*e);return m.map((e=>{const m=this.normalize(a.addMonths(h,e),o,n);if(p<m.getFullYear())return null;const v=this.isEqual(m,l.start),f=this.isEqual(m,l.end),w=!v&&!f&&z(m,l),b=s&&(Array.isArray(r)?this.isSelectedFromArray(m,r,o,n):B(r,o,n)&&this.isEqual(m,r));return{formattedValue:c[m.getMonth()],id:`${t}${m.getTime()}`,isFocused:this.isEqual(m,i),isSelected:b,isInRange:B(m,o,n),isWeekend:!1,isRangeStart:v,isRangeMid:w,isRangeEnd:f,isRangeSplitEnd:w&&this.isEqual(m,d),isRangeSplitStart:w&&this.isEqual(m,u),isToday:this.isEqual(m,g),title:this.cellTitle(m),value:m}}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{B(e,i,s)&&this.isEqual(e,t)&&(a=!0)})),a}isEqual(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const s=a.createDate(e.getFullYear(),e.getMonth(),1),n=!t||a.createDate(t.getFullYear(),t.getMonth(),1)<=s,o=!i||s<=a.createDate(i.getFullYear(),i.getMonth(),1);return n&&o}isInSameView(e,t){return 0===a.durationInYears(e,t)}isRangeStart(e){return e.getFullYear()%10==0}move(e,t){const i=_e[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return 4}skip(e,t){return a.durationInYears(t,e)}total(e,t){return a.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return a.durationInYears(e,t)<i?a.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?a.cloneDate(t):e>i&&this.isEqual(e,i)?a.cloneDate(i):e}};const We={[I.month]:ze,[I.year]:qe,[I.decade]:Le,[I.century]:Re};let Ke=class{constructor(e){this.bottom=I.month,this.top=I.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new We[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const s=this.clamp(((e,t)=>{const i=I[I[e+t]];return void 0!==i?i:e})(e,t));s!==e&&this.onViewChanged({view:s},i)}};class Ue{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){void 0===this.calendarHeight&&this.calculateHeights()}calculateHeights(e,t){if(!s.canUseDOM)return;const i=W("div"),a=W("ul"),n=W("li"),o=W("td"),r=W("th"),l=W("tr"),h=W("tbody"),c=W("thead"),u=W("table"),d=t&&t.uCalendar,p=t&&t.uButton,m=s.strippedClassNames(s.uButton.wrapper({c:p,fillMode:"flat",size:"medium",rounded:"medium",themeColor:"primary"}),s.uCalendar.title({c:d})),g=()=>i(`\n <span class="${m}">\n <span class="${s.strippedClassNames(s.uButton.text({c:p}))}">March 2017</span>\n </span>\n <span class="${s.strippedClassNames(s.uCalendar.spacer({c:d}))}"></span>\n <span class="${s.strippedClassNames(s.uCalendar.nav({c:d}))}"><button class="${s.strippedClassNames(s.uCalendar.today({c:d}))}">TODAY</button></span>\n `,s.strippedClassNames(s.uCalendar.header({c:d,vertical:!0}))),v=(e,t)=>new Array(e).fill("1").map(t),f=e=>i(e,s.strippedClassNames(s.uCalendar.scrollableSelector({c:d}),s.uCalendar.scrollable({c:d,horizontal:!0}))),w=(()=>{let e;return()=>s.canUseDOM?(e||(e=i([f([a([n("<span>FEB</span>")])])],s.strippedClassNames(s.uCalendar.navigation({c:d})),{left:"0px",position:"absolute"})),e):null})(),b=({cells:e,rows:t},a,n)=>{let p;return()=>s.canUseDOM?(p||(p=((e,t,a)=>i(a?[g(),u([c([l([r("MO",s.strippedClassNames(s.uCalendar.th({c:d})))],s.strippedClassNames(s.uCalendar.tr({c:d})))],s.strippedClassNames(s.uCalendar.thead({c:d})))],s.strippedClassNames(s.uCalendar.table({c:d,weekdays:!0}))),f([e,e])]:[g(),f([e,e])],t,{left:"-10000px",position:"absolute"}))(((e,t=1)=>u([h([l([o("1",s.strippedClassNames(s.uCalendar.td({c:d,isWeek:!0})))])].concat(v(e,(()=>l(v(t,(e=>o(`<span class="${s.strippedClassNames(s.uCalendar.link({c:d}))}">${e}</span>`,s.strippedClassNames(s.uCalendar.td({c:d}))))),s.strippedClassNames(s.uCalendar.tr({c:d})))))),s.strippedClassNames(s.uCalendar.tbody({c:d})))],s.strippedClassNames(s.uCalendar.table({c:d}))))(t,e),a,n)),p):null},D=e=>e.querySelector(`.${s.strippedClassNames(s.uCalendar.scrollableSelector({c:d}))}`),y=e=>{const t=D(e);return t.className=`${t.className} scrollable-horizontal`,e},S=b({cells:7,rows:6},s.strippedClassNames(s.uCalendar.view({c:d,month:!0})),!0),C=b({cells:5,rows:3},s.strippedClassNames(s.uCalendar.view({c:d,year:!0})),!1),k=b({cells:5,rows:2},s.strippedClassNames(s.uCalendar.view({c:d,decade:!0})),!1),x=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,I=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},M=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(S(),(e=>{const t=M(e);this.calendarHeight=x(e),this.monthViewHeight=x(t),this.headerHeight=x(t.children[0]),this.scrollableContentHeight=x(D(e))})),this.batch(y(S()),(e=>{const t=M(e);this.calendarWidth=I(e),this.monthViewWidth=I(t),this.scrollableContentWidth=I(D(e))})),this.batch(C(),(e=>{this.yearViewHeight=x(M(e)),this.scrollableYearContentHeight=x(D(e))})),this.batch(y(C()),(e=>{this.yearViewWidth=I(M(e))})),this.batch(k(),(e=>{this.decadeViewHeight=x(M(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(y(k()),(e=>{this.decadeViewWidth=I(M(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(w(),(e=>{this.navigationItemHeight=x(e.querySelector("li"))}))}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i="height"===t?"ViewHeight":"ViewWidth";switch(e){case I.month:return this[`month${i}`];case I.year:return this[`year${i}`];case I.decade:return this[`decade${i}`];case I.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,s=i.appendChild(e);t(s),i.removeChild(s)}}const Ye={33:Ee.PrevView,34:Ee.NextView,35:Ee.LastInView,36:Ee.FirstInView,37:Ee.Left,38:Ee.Up,39:Ee.Right,40:Ee.Down,"meta+38":Ee.UpperView,"meta+40":Ee.LowerView};let $e=class{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return Ye[t]}move(e,t,i,s,a){return s?t===Ee.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,a),e):t===Ee.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,a),e):s.move(e,t):e}};class je{constructor(e){this.dom=e,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(e){const t=Math.max(this.dom.viewHeight(e)/this.dom.navigationItemHeight,1);this.divideByMagnitude=(e=>t=>Math.floor(t/e))(t),this.powerByMagnitude=(e=>t=>t*e)(t)}sync(e,t,i){if(e&&t){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled)return void(this.monthScrolled=!1);this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled)return void(this.navScrolled=!1);this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}const Ze=e=>e?e.virtualization:null,Je=(e=Xe.defaultProps.min,t=Xe.defaultProps.max,i,s)=>void 0!==s?null!==s&&B(a.getDate(s),e,t)?s:null:null!==i&&B(a.getDate(i),e,t)?i:null,Ge=class e extends m.Component{constructor(t){super(t),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(Ze(this.Navigation),Ze(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const t=a.cloneDate(e.value);this.setState({focusedDate:t})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=a.cloneDate(e.value),s=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(s){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:i});this.bus.moveToBottom(this.state.activeView)}this.setState({value:t,focusedDate:i}),this.valueDuringOnChange=t;const{onChange:n}=this.props;if(n){const i={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:t,target:this};n.call(void 0,i)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(this.focusedDate&&this.service){if(84===t&&this.setState({focusedDate:L()}),(i||n)&&(t===s.Keys.left||t===s.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,31===this.focusedDate.getDate()&&this.focusedDate.setDate(30);const e=t===s.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,i=new Date(this.focusedDate.setMonth(e)),n=a.cloneDate(i);this.setState({focusedDate:n})}if(t===s.Keys.enter){if(null!==this.value&&a.isEqualDate(this.focusedDate,this.value)){const e=q(this.focusedDate,this.min,this.max);Ze(this.calendarViewList).scrollToIndex(this.service.skip(e,this.min))}const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=q(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.setState({focusedDate:t})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})};const i=Je(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:i,activeView:O(I[t.defaultActiveView],this.bottomView,this.topView),focusedDate:q(t.focusedDate||i||L(),this.min,this.max)},this.dom=new Ue,this.bus=new Ke(this.handleViewChange),this.navigation=new $e(this.bus),this.oldValue=i}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return I[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return I[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}componentDidMount(){const{unstyled:e}=this.props;Promise.resolve().then((()=>{s.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element,e),this.scrollSyncService=new je(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())}))}componentDidUpdate(e,t){s.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.isActive&&(this.oldValue=this.value)}render(){const{_ref:t,unstyled:i,bottomView:o,topView:r,disabled:l,weekNumber:h,mobileMode:c,className:u}=this.props;t&&t(this);const d=i&&i.uCalendar,p=null!==this.value&&null!==this.oldValue?!a.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,g=O(this.state.activeView,I[void 0!==o?o:e.defaultProps.bottomView],I[void 0!==r?r:e.defaultProps.topView]),v=Je(this.min,this.max,this.value,this.value),f=v?a.getDate(v):null;this.focusedDate=a.getDate(q(p&&null!==v?v:this.state.focusedDate,this.min,this.max)),this.intl=n.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(g,this.intl);const{smoothScroll:w=Number.parseFloat(m.version)<18}=this.props,b=s.classNames(s.uCalendar.wrapper({c:d,disabled:l,weekNumber:h,mobileMode:c}),u),D=[this.props.navigation&&m.createElement(Oe,{key:0,ref:e=>{this.Navigation=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex,unstyled:i}),m.createElement(Ie,{key:1,ref:e=>{this.calendarViewList=e},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:w,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:f,cellUID:this.cellUID,headerTitle:this.props.headerTitle,header:this.props.header,tabIndex:this.props.tabIndex,weekDaysFormat:this.props.weekDaysFormat,showOtherMonthDays:this.props.showOtherMonthDays,unstyled:i})];return m.createElement("div",{ref:e=>{this._element=e},className:b,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},D)}};Ge.displayName="Calendar",Ge.propTypes={className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,weekDaysFormat:i.oneOf(["short","abbreviated","narrow"]),max:i.instanceOf(Date),min:i.instanceOf(Date),navigation:i.bool,smoothScroll:i.bool,onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,value:i.instanceOf(Date),weekNumber:i.bool,topView:(e,t,i)=>{const s=e[t],a=e.bottomView;return s&&a&&I[s]<I[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be smaller than bottomView.\n `):null},bottomView:(e,t,i)=>{const s=e[t],a=e.topView;return s&&a&&I[s]>I[a]?new Error(`Invalid prop + ${t} suplied to ${i}.\n ${t} can not be bigger than topView.\n `):null}},Ge.defaultProps={disabled:!1,min:V,max:N,weekDaysFormat:"short",navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month",showOtherMonthDays:!1};let Xe=Ge;const Qe=s.createPropsContext(),et=s.withIdHOC(s.withPropsContext(Qe,s.withUnstyledHOC(Xe)));et.displayName="KendoReactCalendar",n.registerForIntl(Xe);const tt="dayperiod",it="hour",st="minute",at="second",nt=e=>(t,i)=>{const s=a.cloneDate(t);return s[e](i),s},ot=[{type:it,getter:e=>e.getHours()},{type:st,getter:e=>e.getMinutes()},{type:at,getter:e=>e.getSeconds()},{type:"millisecond",getter:e=>e.getMilliseconds()}],rt=(e=>t=>e.map((e=>t=>e[t.type]?(e=>(t,i)=>e(i))(t.getter):(e=>(t,i)=>e(t))(t.getter))((e=>e.reduce(((e,t)=>(e[t.type]=t.type,e)),{}))(t))))(ot),lt=(e=>(t,i)=>e.map((e=>{const s=Math.floor(t[e.type]);return s?((e,t,i,s)=>a=>{const n=e(a),o=e(i);return"hour"===s?n-(n-o)%t:a.getTime()<=i.getTime()&&0!==n&&n<=o?Math.ceil(n/t)*t:n-n%t})(e.getter,s,i,e.type):e.getter})))(ot),ht=e=>t=>{const i=a.cloneDate(t);return i.setHours(...e.map((e=>e(i)))),i},ct=nt("setHours"),ut=nt("setMinutes"),dt=nt("setSeconds"),pt=()=>new Date,mt=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},gt=(e,t,i)=>({candidateValue:F(E,e),maxValue:a.addDays(F(E,i),t.getHours()<i.getHours()?0:1),minValue:F(E,t)}),vt=(e,t,i)=>{if(!e||!t||!i)return!0;const{candidateValue:s,minValue:a,maxValue:n}=gt(e,t,i);return a<=s&&s<=n},ft=(e,t)=>{if(null===e||null===t)return!1;const i=F(E,e),s=F(E,t);return i.getTime()<s.getHours()},wt=(e,t)=>{if(null===e||null===t)return!1;const i=F(E,e);return F(E,t).getTime()<i.getHours()},bt=e=>{const t=n.useLocalization(),i=s.useUnstyled(),a=i&&i.uDateInput,o=t.toLanguageString(ie,Se[ie]);return m.createElement("span",{className:s.classNames(s.uDateInput.clearButton({c:a})),role:"button",onClick:t=>{t.stopPropagation();const{onClick:i}=e;i&&i.call(void 0,t)},tabIndex:e.tabindex||-1,title:o,key:"clearbutton"},m.createElement(s.IconWrap,{name:"x",icon:r.xIcon}))};let Dt=class{constructor(e){this.service=e,this.cldr={},this.locale=e.locale,this.format=e.format,this.toString=e.toString,this.formatDate=e.formatDate,this.parseDate=e.parseDate,this.parseNumber=e.parseNumber,this.formatNumber=e.formatNumber,this.splitDateFormat=e.splitDateFormat,this.numberSymbols=e.numberSymbols,this.firstDay=e.firstDay,this.dateFieldName=e.dateFieldName,this.dateFormatNames=(e,t)=>this.service.dateFormatNames(t),this.weekendRange=e=>{};const t=c.localeInfo(this.locale);this.cldr[t.name]=t}};const yt=m.forwardRef(((e,t)=>{var i;const c=s.useId(e.id),u=n.useInternationalization(),d=n.useLocalization(),p=s.useUnstyled(),g=s.usePropsContext(Ct,e).unstyled||p,{format:v=St.format,size:f=St.size,rounded:w=St.rounded,fillMode:b=St.fillMode,formatPlaceholder:D=St.formatPlaceholder,spinners:y=St.spinners,disabled:S=St.disabled,min:C=St.min,max:k=St.max,minTime:x=St.minTime,maxTime:I=St.maxTime,validityStyles:M=St.validityStyles,validationMessage:T=St.validationMessage,placeholder:O=St.placeholder,enableMouseWheel:E=St.enableMouseWheel,autoCorrectParts:V=St.autoCorrectParts,autoSwitchParts:N=St.autoSwitchParts,allowCaretMode:R=St.allowCaretMode,twoDigitYearMax:P=St.twoDigitYearMax,ariaHasPopup:F=St.ariaHasPopup,autoFocus:L=St.autoFocus}=s.usePropsContext(Ct,e),B=()=>void 0!==le.current?le.current:ne.current&&ne.current.value,A=()=>{const e=ne.current&&ne.current.currentText||"",t=B();return null==O||ue.focused||t?e:O},z=()=>void 0!==e.required&&e.required,H=()=>{const t=B()||e.value,i=C,s=k,a=((e,t,i)=>null===e||!(t&&t>e||i&&i<e))(t,i,s)&&vt(t,x,I),n=void 0!==T,o=(!z()||null!=t)&&a,r=void 0!==e.valid?e.valid:o;return{customError:n,rangeOverflow:t&&s.getTime()<t.getTime()||!1,rangeUnderflow:t&&t.getTime()<i.getTime()||!1,valid:r,valueMissing:null===t}},_=()=>{se.current&&se.current.focus()},q=()=>new Dt(u),W=()=>{const t=B();return{format:v,steps:e.steps,formatPlaceholder:D,placeholder:O,selectPreviousSegmentOnBackspace:!0,value:e.value||t,intlService:q(),autoFill:void 0!==e.autoFill&&e.autoFill,enableMouseWheel:E,autoCorrectParts:V,autoSwitchParts:N,autoSwitchKeys:e.autoSwitchKeys||[],twoDigitYearMax:P,allowCaretMode:R}},K=e=>{ae.current&&ae.current.classList.add("k-focus"),de({focused:!0}),L&&G(!0)},U=e=>{ae.current&&ae.current.classList.remove("k-focus"),de({focused:!1})},Y=e=>"string"==typeof e?e:{inputFormat:e,displayFormat:e},$=e=>{le.current=B(),pe(),he.current=e,le.current=void 0},j=t=>{e.onChange&&e.onChange(t)},Z=e=>{s.getActiveElement(document)===se.current&&e.preventDefault()},J=()=>{se.current&&se.current.setCustomValidity&&se.current.setCustomValidity(H().valid?"":T||St.validationMessage)},G=m.useCallback((e=>{var t;if(se.current&&L&&e){const e=(null==ne?void 0:ne.current).currentText,i=e[(null==ne?void 0:ne.current).currentText.search(/[^a-zA-Z]/)],s=e.split(i)[0].length;ae.current&&ae.current.classList.add("k-focus"),null==(t=null==ne?void 0:ne.current)||t.selectNearestSegment(s)}}),[L]),X=e=>{!se.current||!ne.current||$(e)},Q=t=>{const i=B();he.current&&e.onChange&&!a.isEqual(he.current.oldValue,i)&&e.onChange.call(void 0,{syntheticEvent:t,nativeEvent:he.current.event,value:he.current.value,target:ie.current}),he.current=null},ie=m.useRef(null),se=m.useRef(null),ae=m.useRef(null);m.useImperativeHandle(ie,(()=>({props:e,get options(){return W()},get text(){return A()},get element(){return se.current},get name(){return e.name},get value(){return B()},get validity(){return H()},focus:_,updateOnPaste:X}))),m.useImperativeHandle(t,(()=>ie.current));const ne=m.useRef(null),oe=m.useRef(null),re=m.useRef(!1),le=m.useRef(null),he=m.useRef(null),ce=m.useRef(e),[ue,de]=m.useState({focused:!1}),[,pe]=m.useReducer((e=>e+1),0);m.useLayoutEffect((()=>{re.current||(ne.current=new h.DateInput(se.current,{...W(),format:Y(W().format),events:{focus:K,blur:U,valueChange:$,click:j}}),oe.current=ne.current.dateObject,re.current=!0)}),[]),m.useEffect((()=>(J(),re.current||ae.current&&ae.current.addEventListener("wheel",Z,{passive:!1}),L&&(de({focused:!0}),G(!0)),()=>{ae.current&&ae.current.removeEventListener("wheel",Z)})),[]),m.useEffect((()=>{J(),ne.current&&((((e,t)=>typeof e!=typeof t||("string"==typeof e&&"string"==typeof t?e!==t:"object"==typeof e&&"object"==typeof t&&JSON.stringify(e)!==JSON.stringify(t)))(ce.current.format,v)||ce.current.readonly!==e.readonly||JSON.stringify(ce.current.steps)!==JSON.stringify(e.steps)||q().locale!==ne.current.options.intlService.locale)&&ne.current.setOptions(W(),!0),ce.current.value!==e.value&&(null!==oe.current.getValue()||null!==e.value)&&oe.current.setValue(e.value),void 0!==e.ariaExpanded&&e.ariaExpanded&&(ne.current.options.placeholder=null),void 0!==e.ariaExpanded&&!e.ariaExpanded&&(ne.current.options.placeholder=O),ne.current.refreshElementValue(),ce.current={format:v,readonly:e.readonly,ariaExpanded:e.ariaExpanded,steps:e.steps,value:e.value})}));const me=e.id||c+"-accessibility-id",ge=g&&g.uDateInput,ve=A(),fe=!M||H().valid;m.useImperativeHandle(e._ref,(()=>ie.current));const we=m.createElement("span",{ref:e=>{ae.current=e},style:e.label?void 0:{width:e.width},dir:e.dir,className:s.classNames(s.uDateInput.wrapper({c:ge,size:f,fillMode:b,rounded:w,disabled:S,required:z(),invalid:!fe}),e.className)},m.createElement("input",{ref:e=>{se.current=e},role:e.ariaRole||"textbox",readOnly:e.readonly,tabIndex:e.tabIndex||0,disabled:S,title:void 0!==e.title?e.title:ve,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:L,className:s.classNames(s.uDateInput.inputInner({c:ge})),id:me,value:ve,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-haspopup":F,"aria-disabled":S,"aria-expanded":e.ariaExpanded,"aria-controls":e.ariaControls,"aria-required":e.required,"aria-invalid":!fe,onKeyDown:Q,onChange:Q,onWheel:Q,onInput:Q,onClick:Q,name:e.name,...e.inputAttributes}),e.children,e.clearButton&&e.value&&m.createElement(bt,{onClick:j,key:"clearbutton"}),y&&m.createElement("span",{className:s.classNames(s.uDateInput.inputSpinner({c:ge})),onMouseDown:e=>{e.preventDefault();const t=s.getActiveElement(document);se.current&&t!==se.current&&se.current.focus({preventScroll:!0})}},m.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:s.classNames(s.uDateInput.spinnerIncrease({c:ge})),icon:"caret-alt-up",svgIcon:r.caretAltUpIcon,"aria-label":d.toLanguageString(ee,Se[ee]),title:d.toLanguageString(ee,Se[ee]),onClick:e=>{var t;null==(t=ne.current)||t.modifyDateSegmentValue(1),Q(e)}}),m.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:s.classNames(s.uDateInput.spinnerDecrease({c:ge})),icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,"aria-label":d.toLanguageString(te,Se[te]),title:d.toLanguageString(te,Se[te]),onClick:e=>{var t;null==(t=ne.current)||t.modifyDateSegmentValue(-1),Q(e)}})));return e.label?m.createElement(l.FloatingLabel,{label:e.label,editorId:me,editorValue:null==(i=se.current)?void 0:i.value,editorValid:fe,editorDisabled:S,children:we,style:{width:e.width}}):we}));yt.propTypes={value:i.instanceOf(Date),format:i.oneOfType([T(i.string),i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([T(i.oneOf(["wide","narrow","short","formatPattern"])),i.shape({year:T(i.string),month:T(i.string),day:T(i.string),hour:T(i.string),minute:T(i.string),second:T(i.string)})]),width:i.oneOfType([i.string,i.number]),tabIndex:i.number,title:i.string,steps:i.shape({year:T(i.number),month:T(i.number),day:T(i.number),hour:T(i.number),minute:T(i.number),second:T(i.number)}),min:i.instanceOf(Date),max:i.instanceOf(Date),disabled:i.bool,spinners:i.bool,name:i.string,dir:i.string,label:i.node,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,ariaRole:i.string,ariaHasPopup:i.oneOfType([i.bool,i.oneOf(["grid","dialog"])]),ariaExpanded:i.oneOfType([i.bool]),onChange:i.func,validationMessage:i.string,required:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool,inputAttributes:i.object};const St={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(N),min:a.cloneDate(V),minTime:a.cloneDate(R),maxTime:a.cloneDate(P),validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,enableMouseWheel:!0,autoCorrectParts:!0,autoSwitchParts:!0,allowCaretMode:!1,twoDigitYearMax:68,ariaHasPopup:"grid",autoFocus:!1},Ct=s.createPropsContext();yt.displayName="KendoReactDateInput";const kt=o.Button,xt=e=>{const{dateInput:t,...i}=e,s=(e=>{const[t,i]=m.useState(!1);return m.useEffect((()=>{var t;e.current&&i(!!(null!=(t=e.current.element)&&t.value||e.current.text))})),{editorValue:t}})(t);return m.createElement(l.FloatingLabel,{...i,...s})},It=e=>{const{footer:t,windowWidth:i=0,mobileFilter:a,children:n,navigatable:l,navigatableElements:h,expand:c,animation:u,title:p,subTitle:g,onClose:v}=e,f=s.useAdaptiveModeContext(),w={navigatable:l||!1,navigatableElements:h||[],expand:c,animation:!1!==u,suffixActions:m.createElement(o.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",size:"large",themeColor:"primary",svgIcon:r.checkIcon,onClick:v}),filter:a,onClose:v,animationStyles:f&&i<=f.small?{top:0,width:"100%",height:"100%"}:void 0,title:p,subTitle:g,className:"k-adaptive-actionsheet",position:f&&i<=f.small?"fullscreen":void 0};return m.createElement(d.ActionSheet,{...w},n,t&&m.createElement(d.ActionSheetFooter,{className:"k-actions k-actions-stretched"},m.createElement(o.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),m.createElement(o.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},Mt=m.forwardRef(((e,t)=>{const i=s.useId(e.id),o=n.useLocalization(),l=s.useAdaptiveModeContext(),{defaultShow:h=Tt.defaultShow,defaultValue:c=Tt.defaultValue,dateInput:u=Tt.dateInput,calendar:p=Tt.calendar,toggleButton:g=Tt.toggleButton,popup:v=Tt.popup,disabled:f=Tt.disabled,format:w=Tt.format,max:b=Tt.max,min:D=Tt.min,popupSettings:y=Tt.popupSettings,tabIndex:S=Tt.tabIndex,weekNumber:C=Tt.weekNumber,validityStyles:k=Tt.validityStyles,size:x=Tt.size,rounded:I=Tt.rounded,fillMode:M=Tt.fillMode,autoFocus:T=Tt.autoFocus,show:O,autoSwitchParts:E,autoSwitchKeys:V,twoDigitYearMax:N,ariaLabel:R,adaptive:P,adaptiveTitle:L=e.label||void 0,adaptiveSubtitle:B,formatPlaceholder:z,inputAttributes:H,validationMessage:_,visited:q,value:W,touched:K,modified:U,_adaptiveMode:Y=l,valid:$,focusedDate:j,id:Z,ariaLabelledBy:J,ariaDescribedBy:G,placeholder:X,onChange:Q,onOpen:ee,onClose:te,...ie}=s.usePropsContext(Ot,e),se=()=>{if(s.canUseDOM)return ke.current&&ke.current.ownerDocument||window.document},ne=()=>!!(Re.windowWidth&&l&&Re.windowWidth<=(null==l?void 0:l.medium)&&e.adaptive),oe=()=>{const e=void 0!==Me.current?Me.current:void 0!==W?W:Re.value;return null!==e?a.cloneDate(e):null},re=()=>void 0!==Te.current?Te.current:void 0!==O?O:Re.show,le=()=>void 0!==e.required&&e.required,he=()=>{const e=oe()||W||null,t=D,i=b,s=A(e,t,i),a=void 0!==_,n=(!le()||null!=e)&&s,o=void 0!==$?$:n;return{customError:a,rangeOverflow:e&&i.getTime()<e.getTime()||!1,rangeUnderflow:e&&e.getTime()<t.getTime()||!1,valid:o,valueMissing:null===e}},ce=()=>{xe.current&&xe.current.focus()},ue=e=>{Ie.current=e},de=e=>{re()!==e&&(Le({show:e}),e&&ee&&ee({target:Ce.current}),!e&&te&&te({target:Ce.current}))},pe=e=>{null!=y&&y.onMouseDownOutside&&y.onMouseDownOutside(e)},me=(e,t)=>{Le({value:a.cloneDate(e||void 0)}),Me.current=e,Te.current=!1,ne()||(Ee.current=!0),Q&&Q({syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:oe(),show:re(),target:Ce.current}),Me.current=void 0,Te.current=void 0,de(!1)},ge=e=>{const t=(e=>{const t=oe();return t&&e?F(e,t):e})(e.value);me(t,e)},ve=()=>{const{popupClass:e,...t}=y,i=re(),n=oe(),o=n&&a.getDate(n),r=s.classNames(e),l={popupClass:"k-datepicker-popup",show:i,anchor:ke.current,className:r,id:Be,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t,onMouseDownOutside:pe},h={disabled:f,value:o,min:D,max:b,weekNumber:C,focusedDate:j,className:ne()?"k-calendar-lg":"",navigation:!ne(),onChange:ge},c=p||Tt.calendar,u=v||Tt.popup;return ne()?m.createElement(c,{_ref:ue,...h}):m.createElement(u,{...l},m.createElement(c,{_ref:ue,...h}))},fe=()=>{Le({focused:!1}),de(!1)},we=()=>{de(!re())},be=()=>{f||(Ee.current=!0,de(!re()))},De=e=>{e.preventDefault()},ye=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc&&re())return Ee.current=!0,void de(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),Ee.current=i===s.Keys.up,de(i===s.Keys.down))},Ce=m.useRef(null),ke=m.useRef(null),xe=m.useRef(null),Ie=m.useRef(null);m.useImperativeHandle(Ce,(()=>({props:e,get element(){return ke.current},get calendar(){return Ie.current},get dateInput(){return xe.current},get name(){return e.name},get show(){return re()},get validity(){return he()},get value(){return oe()},get mobileMode(){return ne()},togglePopup:we,focus:ce}))),m.useImperativeHandle(t,(()=>Ce.current));const Me=m.useRef(void 0),Te=m.useRef(void 0),Oe=m.useRef(null),Ee=m.useRef(!1),Ve=m.useRef(!1),Ne=m.useRef(null),[Re,Pe]=m.useState({value:c,show:h,focused:!1}),[,Fe]=m.useReducer((e=>e),!0),Le=e=>{Pe((t=>({...t,...e})))};m.useEffect((()=>{Ie.current&&Ie.current.element&&re()&&!Ve.current&&Ie.current.element.focus({preventScroll:!0}),ne()&&re()&&!Ve.current&&setTimeout((()=>{Ie.current&&Ie.current.element&&Ie.current.element.focus({preventScroll:!0})}),300),xe.current&&xe.current.element&&!re()&&Ee.current&&xe.current.element.focus({preventScroll:!0}),Ve.current=re(),Ee.current=!1})),m.useEffect((()=>{var e;return Ne.current=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver((e=>(e=>{for(const t of e)Le({windowWidth:t.target.clientWidth})})(e))),re()&&Fe(),null!=(e=se())&&e.body&&Ne.current&&Ne.current.observe(se().body),()=>{var e;clearTimeout(Oe.current),null!=(e=se())&&e.body&&Ne.current&&Ne.current.disconnect()}}),[]);const Be=i+"-popup-id",Ae=ve(),ze=u||Tt.dateInput,He=oe(),_e=g||Tt.toggleButton,qe=(()=>{const{windowWidth:e=0}=Re,t={expand:re(),onClose:fe,title:L,subTitle:B,windowWidth:e};return m.createElement(It,{...t},m.createElement(d.ActionSheetContent,null,ve()))})(),We=!k||he().valid,Ke=o.toLanguageString(ae,Se[ae]),Ue={disabled:f,format:w,formatPlaceholder:z,id:Z,ariaLabelledBy:J,ariaDescribedBy:G,ariaLabel:R,max:b,min:D,name:e.name,onChange:e=>{me(e.value,e)},required:e.required,_ref:xe,tabIndex:re()?-1:S,title:e.title,valid:he().valid,validationMessage:_,validityStyles:k,value:He,label:void 0,placeholder:Re.focused?null:X,ariaExpanded:re(),size:null,fillMode:null,rounded:null,autoFill:e.autoFill,twoDigitYearMax:N,enableMouseWheel:e.enableMouseWheel,autoCorrectParts:e.autoCorrectParts,autoSwitchParts:E,autoSwitchKeys:V,allowCaretMode:e.allowCaretMode,inputAttributes:H},Ye=m.createElement(s.AsyncFocusBlur,{onFocus:()=>{Le({focused:!0})},onBlur:ne()?void 0:fe,onSyncBlur:e.onBlur,onSyncFocus:e.onFocus},(t=>m.createElement(m.Fragment,null,m.createElement("span",{...e.label?{}:ie,ref:ke,className:s.classNames("k-input","k-datepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[x]||x}`]:x,[`k-rounded-${s.kendoThemeMaps.roundedMap[I]||I}`]:I,[`k-input-${M}`]:M,"k-invalid":!We,"k-required":le(),"k-disabled":f},e.className),onKeyDown:ye,style:{width:e.width},onFocus:ne()?be:t.onFocus,onBlur:t.onBlur,onClick:ne()?be:void 0},m.createElement(ze,{_ref:xe,ariaRole:"combobox",ariaExpanded:re(),ariaControls:Be,autoFocus:T,...Ue}),m.createElement(_e,{type:"button",icon:"calendar",svgIcon:r.calendarIcon,title:Ke,className:"k-input-button",rounded:null,onClick:ne()?void 0:be,"aria-label":Ke,fillMode:M,onMouseDown:De}),!ne()&&Ae),ne()&&qe)));return e.label?m.createElement(xt,{dateInput:xe,label:e.label,editorId:i,editorValid:We,editorDisabled:f,children:Ye,style:{width:e.width},...ie}):Ye}));Mt.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:T(i.string),pattern:T(i.string),date:T(i.oneOf(["short","medium","long","full"])),time:T(i.oneOf(["short","medium","long","full"])),datetime:T(i.oneOf(["short","medium","long","full"])),era:T(i.oneOf(["narrow","short","long"])),year:T(i.oneOf(["numeric","2-digit"])),month:T(i.oneOf(["numeric","2-digit","narrow","short","long"])),day:T(i.oneOf(["numeric","2-digit"])),weekday:T(i.oneOf(["narrow","short","long"])),hour:T(i.oneOf(["numeric","2-digit"])),hour12:T(i.bool),minute:T(i.oneOf(["numeric","2-digit"])),second:T(i.oneOf(["numeric","2-digit"])),timeZoneName:T(i.oneOf(["short","long"]))})]),formatPlaceholder:i.oneOfType([T(i.oneOf(["wide","narrow","short","formatPattern"])),i.shape({year:T(i.string),month:T(i.string),day:T(i.string),hour:T(i.string),minute:T(i.string),second:T(i.string)})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:T(i.bool),appendTo:T(i.any),popupClass:T(i.string)}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),adaptive:i.bool,adaptiveTitle:i.string,adaptiveSubtitle:i.string,autoFocus:i.bool,inputAttributes:i.object};const Tt={defaultShow:!1,defaultValue:null,dateInput:yt,calendar:et,toggleButton:kt,popup:u.Popup,disabled:!1,format:"d",max:N,min:V,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1},Ot=s.createPropsContext();Mt.displayName="KendoReactDatePicker";const Et=Object.freeze({name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1617189075,version:"13.3.0-develop.4",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"}),Vt=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t),i},Nt=e=>null!==e&&e<12,Rt=(e,t,i)=>!t&&!i||e>=t&&e<=i,Pt=(e,t,i)=>!t&&!i||e>=t||e<=i;let Ft=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),s=Nt(i),a=Nt(t.getHours());if(s&&a||!s&&!a)return e;const[n,o=24]=this.normalizedRange(),r=i+(a?-12:12);return Vt(e,Math.min(Math.max(n,r),o||24))}configure(e){const{min:t=this.min,max:i=this.max,part:s=this.part}=e;this.min=t,this.max=i,this.part=s}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[s,a]=this.normalizedRange(),n=this.intl.dateFormatNames(t);return Nt(s)&&i.push({text:n.am,value:Vt(this.min,s)}),(e=>null!==e&&(!e||e>11))(a)&&i.push({text:n.pm,value:Vt(this.min,Math.max(12,a))}),this.min.getHours()!==s?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return(e||t)&&(e>11||t<12)?1:2}selectedIndex(e){if(!this.valueInList(e)||!this.min)return-1;const t=Math.floor(e.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?t:0===t?1:0}valueInList(e){return!(!this.min||!this.max)&&(this.min.getHours()!==this.normalizedRange()[0]?Pt:Rt)(e.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const e=this.min.getHours(),t=this.max.getHours();return[Math.min(e,t),Math.max(e,t)]}},Lt=class{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){void 0===this.timeListHeight&&this.calculateHeights()}calculateHeights(e,t){if(!s.canUseDOM)return;const i=t&&t.uTime,a=W("div"),n=W("span"),o=W("ul"),r=W("li"),l=a([n("minute",s.strippedClassNames(s.uTime.title({c:i}))),a([a([o([r("<span>02</span>",s.strippedClassNames(s.uTime.li({c:i})))],s.strippedClassNames(s.uTime.ul({c:i})))],s.strippedClassNames(s.uTime.containerSelector({c:i}),s.uTime.container({c:i,content:!0,scrollable:!0})))],s.strippedClassNames(s.uTime.list({c:i})))],s.strippedClassNames(s.uTime.listWrapper({c:i})),{left:"-10000px",position:"absolute"}),h=`.${s.strippedClassNames(s.uTime.containerSelector({c:i}))}`,c=e&&e.querySelector(h)||document.body,u=c.appendChild(l);this.timeListHeight=u.querySelector(h).offsetHeight,this.itemHeight=u.querySelector("li").offsetHeight,c.removeChild(u),this.didCalculate=!0}};const Bt=(e=>t=>t%e)(24),At=(e,t)=>Bt(24+e-t),zt=e=>(t,i)=>i&&a.getDate(t).getTime()!==a.getDate(i).getTime()?ct(t,e):t,Ht=zt(0),_t=zt(23);let qt=class{constructor(e){this.intl=e,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(e,t){return ct(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:n,step:o=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=e=>{const t=ct(E,e);return{text:this.intl.formatDate(t,n.pattern),value:t}},this.min=s,this.max=a,this.step=o}data(e){const[t]=this.range(e),i=((e,t)=>i=>Bt(e+i*t))(t,this.step),s=mt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(!this.min||!this.max)&&(!a.isEqual(this.min,e)||!a.isEqual(this.max,t))}limitRange(e,t,i){return this.boundRange?[Ht(e,i),_t(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(At(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(ct(this.max,this.lastHour(e)))}divideByStep(e){return At(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}};const Wt=(e=>t=>t%e)(60),Kt=(e,t)=>Wt(60+e-t),Ut=e=>(t,i)=>i&&t.getHours()!==i.getHours()?ut(t,e):t,Yt=Ut(0),$t=Ut(59);let jt=class{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return ut(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=ut(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>Wt(e+i*t))(t,this.step),s=mt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[Yt(e,i),$t(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e))}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Kt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(ut(this.max,this.lastMinute(e)))}divideByStep(e){return Kt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}};const Zt=(e=>t=>t%e)(60),Jt=(e,t)=>Zt(60+e-t),Gt=e=>(t,i)=>!i||t.getMinutes()===i.getMinutes()&&t.getHours()===i.getHours()?t:dt(t,e),Xt=Gt(0),Qt=Gt(59);class ei{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return dt(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:s=this.max,part:a,step:n=this.step}=e;this.insertUndividedMax=t,this.toListItem=e=>{const t=dt(E,e);return{text:this.intl.formatDate(t,a.pattern),value:t}},this.min=i,this.max=s,this.step=n}data(e){const[t]=this.range(e),i=((e,t)=>i=>Zt(e+i*t))(t,this.step),s=mt(0,this.countFromMin(e)).map((e=>this.toListItem&&this.toListItem(i(e))));return this.addLast(s),e&&this.addMissing(s,e),s}isRangeChanged(e,t){return!(null===this.min||null===this.max||a.isEqual(this.min,e)&&a.isEqual(this.max,t))}limitRange(e,t,i){return[Xt(e,i),Qt(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return!e||(this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e))}divideByStep(e){return Jt(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Jt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(dt(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const ti={[s.Keys.end]:(e,t)=>e[e.length-1],[s.Keys.home]:(e,t)=>e[0],[s.Keys.up]:(e,t)=>e[t-1],[s.Keys.down]:(e,t)=>e[t+1]},ii={[tt]:Ft,[it]:qt,[st]:jt,[at]:ei},si=class e extends m.Component{constructor(t){super(t),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=e=>{Promise.resolve().then((()=>{this.element&&this.element.focus(e)}))},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),s=this.virtualization.itemOffset(i),a=Math.abs(Math.ceil(e)-s);if(t===i&&a<2)return s;const n=t>i;return n&&a>=this.bottomThreshold||!n&&a>this.topThreshold?this.virtualization.itemOffset(i+1):s},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=9,this.bottomOffset+=18),this.topThreshold=.05*this.itemHeight,this.bottomThreshold=.95*this.itemHeight)},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[s,a]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:s,max:a}))}},this.serviceSettings=t=>{const i={boundRange:this.props.boundRange||e.defaultProps.boundRange,insertUndividedMax:!1,min:a.cloneDate(this.min),max:a.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},i,t);return s.boundRange="hour"!==s.part.type||this.props.boundRange||e.defaultProps.boundRange,s},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(this.virtualization&&this.service&&e&&!t){this.animateToIndex=!1;const t=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),i=this.service.data(this.props.value)[t];this.handleChange(i)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=s.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===s.Keys.down||t===s.Keys.up||t===s.Keys.end||t===s.Keys.home)&&e.preventDefault();const i=(ti[e.keyCode]||s.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));i&&this.handleChange(i)},this.handleChange=K((e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)}),100),this.dom=new Lt}get element(){return this._element}get animate(){return!(!this.props.smoothScroll||!this.animateToIndex)}get min(){return this.props.min||e.defaultProps.min}get max(){return this.props.max||e.defaultProps.max}get step(){return void 0!==this.props.step&&0!==this.props.step?Math.floor(this.props.step):e.defaultProps.step}componentDidMount(){Promise.resolve().then((()=>{const{unstyled:e}=this.props;this._element&&(this.dom.calculateHeights(this._element,e),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);if(this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0,!this.topOffset&&this._element){const{unstyled:e}=this.props;this.dom.calculateHeights(this._element,e)}}render(){const{part:e,value:t,unstyled:i}=this.props;if(!e.type||!ii[e.type])return;const a=i&&i.uTime;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new ii[e.type](this.intl),this.configureServices();const o=this.service.data(t),r="translateY("+this.topOffset+"px)",l=this.service.total(t),h=m.createElement(m.Fragment,null,m.createElement("ul",{style:{transform:r,msTransform:r},className:s.classNames(s.uTime.ul({c:a}))},o.map(((e,t)=>m.createElement("li",{key:t,className:s.classNames(s.uTime.li({c:a})),onClick:()=>{this.handleChange(e)}},m.createElement("span",null,e.text))))),m.createElement("div",{className:s.classNames(s.uTime.scrollablePlaceholder({c:a}))}));return m.createElement("div",{className:s.classNames(s.uTime.list({c:a})),id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:e=>{this._element=e},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?m.createElement(C,{bottomOffset:this.bottomOffset,children:h,className:s.classNames(s.uTime.containerSelector({c:a}),s.uTime.container({c:a})),itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:e=>{this.virtualization=e},role:"presentation",skip:0,tabIndex:-1,take:l,topOffset:this.topOffset,total:l,unstyled:i}):m.createElement("div",{className:s.classNames(s.uTime.containerSelector({c:a}),s.uTime.container({c:a,content:!0,scrollable:!0}))},h))}};si.propTypes={id:i.number,max:i.instanceOf(Date),min:i.instanceOf(Date),part:function(e,t,i){const s=e[t];if(!s||!ii[s.type])throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n Supported part types are hour|minute|second|dayperiod.\n `);return null},step:function(e,t,i){const s=e[t];if(void 0!==s&&s<=0)throw new Error(`\n Invalid prop '${t}' supplied to ${i}.\n ${t} cannot be less than 1.\n `);return null},value:i.instanceOf(Date),smoothScroll:i.bool,show:i.bool},si.defaultProps={boundRange:!1,max:P,min:E,step:1,smoothScroll:!0};let ai=si;n.registerForIntl(ai);const ni=new RegExp(`${it}|${st}|${at}|${tt}|literal`),oi=class e extends m.Component{constructor(t){super(t),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(e,t)=>{Promise.resolve().then((()=>{t&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const i=this.timeLists[0];!t&&-1===this.state.activeListIndex&&!this.hasActiveButton()&&i&&i.element&&i.focus(e)}))},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const s=t>=1&&i[t-1];return s&&s&&"literal"===e.type?ni.test(s.type||""):ni.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map((t=>1===e?t.next:t.prev)).map((e=>e&&e.element&&e.element.focus({preventScroll:!0})))},this.listReducer=(e,t,i,s)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:s[i+1]||t,prev:s[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&vt(pt(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case s.Keys.left:return e.preventDefault(),void this.focusList(0);case s.Keys.right:return e.preventDefault(),void this.focusList(1);default:return}},this.handleListBlur=()=>{this.nextTick((()=>{this.setState({activeListIndex:-1})}))},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=ht(lt(this.props.steps,this.props.min||e.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return((e,t,i)=>{if(!e||!t||!i)return e;const{candidateValue:s,minValue:a,maxValue:n}=gt(e,t,i);return s<a?F(e,t):s>n?F(e,i):e})(this.snapTime(a.cloneDate(this.props.value||E)),this.min,this.max)}get intl(){return n.provideIntlService(this)}get min(){return this.snapTime(this.props.min||e.defaultProps.min)}get max(){return this.snapTime(this.props.max||e.defaultProps.max)}get steps(){return this.props.steps||e.defaultProps.steps}get boundRange(){return void 0!==this.props.boundRange?this.props.boundRange:e.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this.value)}render(){const{format:t,smoothScroll:i,onNowClick:a,className:r,disabled:l,mobileMode:h,show:c,onNowKeyDown:u,unstyled:d}=this.props,p=d&&d.uTime;this.snapTime=ht(lt(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(t||e.defaultProps.format).filter(this.timeFormatFilter);const g=s.classNames(s.uTime.part({c:p,mobileMode:h,disabled:l}),r);this.timeLists=[];const v=n.provideLocalizationService(this),f=v.toLanguageString(ue,Se[ue]);return m.createElement("div",{className:g},m.createElement("div",{className:s.classNames(s.uTime.header({c:p}))},m.createElement("span",{className:s.classNames(s.uTime.title({c:p}))},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&m.createElement(o.Button,{type:"button",ref:e=>{this._nowButton=e},className:s.classNames(s.uTime.now({c:p})),fillMode:"flat",themeColor:"base",title:f,onKeyDown:u,"aria-label":f,onClick:a,tabIndex:l?-1:0},v.toLanguageString(ce,Se[ce]))),m.createElement("div",{className:s.classNames(s.uTime.listContainer({c:p})),onKeyDown:this.handleKeyDown},m.createElement("span",{className:s.classNames(s.uTime.highlight({c:p}))}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?m.createElement("div",{key:t,className:s.classNames(s.uTime.listWrapper({c:p,focused:t===this.state.activeListIndex})),role:"presentation",tabIndex:-1},m.createElement("span",{className:s.classNames(s.uTime.title({c:p})),onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),m.createElement(ai,{min:this.min,max:this.max,boundRange:this.boundRange,part:e,step:e.type?this.steps[e.type]:1,smoothScroll:i,ref:e=>{e&&this.timeLists.push(e)},id:t,onFocus:()=>{this.handleListFocus(t)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:l,show:c,mobileMode:h,unstyled:d})):m.createElement("div",{key:t,className:s.classNames(s.uTime.separator({c:p}))},e.pattern)))))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){const e=s.getActiveElement(document);return this._nowButton&&e===this._nowButton.element}hasSteps(){const e=Object.keys(this.steps);return e.length!==e.reduce(((e,t)=>e+this.steps[t]),0)}};oi.propTypes={cancelButton:i.bool,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},oi.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:R,max:P,steps:{},boundRange:!1};let ri=oi;n.registerForIntl(ri),n.registerForLocalization(ri);const li=class e extends m.Component{constructor(t){super(t),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;t!==s.Keys.enter||this.hasActiveButton()||this.handleAccept(e)},this.revertToNowButton=e=>{const{keyCode:t,shiftKey:i}=e;!i&&t===s.Keys.tab&&(e.preventDefault(),!1!==this.props.nowButton?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=e=>{var t;const{keyCode:i,shiftKey:a}=e;a&&i===s.Keys.tab?(e.preventDefault(),this._acceptButton&&(null==(t=this._acceptButton.element)||t.focus({preventScroll:!0}))):i===s.Keys.enter&&(e.stopPropagation(),this.handleNowClick(e))},this.handleAccept=e=>{const t=this.mergeValue(a.cloneDate(this.value||pt()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(a.cloneDate(this.value||pt()),pt());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||e.defaultProps.format),this.mergeValue=(e=>(t,i)=>(t.setHours(...e.map((e=>e(t,i)))),t))(rt(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||E,value:this.props.value||e.defaultProps.value}}get element(){return this._element}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get intl(){return n.provideIntlService(this)}get current(){return null!==this.state.current?a.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:e,cancelButton:t,disabled:i,tabIndex:a,className:r,smoothScroll:l,min:h,max:c,boundRange:u,nowButton:d,steps:p,show:g,mobileMode:v,unstyled:f}=this.props,w=f&&f.uTimePicker,b=f&&f.uTime,D=n.provideLocalizationService(this),y=D.toLanguageString(de,Se[de]),S=D.toLanguageString(pe,Se[pe]);return m.createElement("div",{ref:e=>{this._element=e},tabIndex:i?void 0:a||0,className:s.classNames(s.uTimePicker.timeSelector({c:w,mobileMode:v,disabled:i}),r),onKeyDown:this.handleKeyDown},m.createElement(ri,{ref:e=>{this.timePart=e},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:e,smoothScroll:l,min:h,max:c,boundRange:u,disabled:i,nowButton:d,steps:p,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown,unstyled:f}),this.props.footer&&m.createElement("div",{className:s.classNames(s.uTime.footer({c:b}))},t&&m.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:s.classNames(s.uTime.cancel({c:b})),onClick:this.handleReject,title:y,"aria-label":y},y),m.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:s.classNames(s.uTime.accept({c:b})),themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:S,"aria-label":S},S)))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}};li.propTypes={cancelButton:i.bool,className:i.string,disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),max:i.instanceOf(Date),min:i.instanceOf(Date),nowButton:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,value:i.instanceOf(Date),show:i.bool},li.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:R,max:P,boundRange:!1,footer:!0};let hi=li;n.registerForIntl(hi),n.registerForLocalization(hi);const ci=class e extends m.Component{constructor(t){super(t),this._element=null,this._dateInput=m.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.showLicenseWatermark=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:s,format:a,steps:n,unstyled:o}=this.props;return m.createElement(hi,{ref:this.setTimeSelectorRef,mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:s,nowButton:i,format:a,min:this.min,max:this.max,steps:n,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject,unstyled:o})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,{unstyled:i}=this.props,a=i&&i.uTimePicker,n=s.classNames(e),o={popupClass:s.uTimePicker.popup({c:a}),show:this.show,animate:null!==this.element,anchor:this.element,className:n,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?m.createElement(this.props.popup,{...o},this.renderTimeSelector()):m.createElement(u.Popup,{...o},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(ge,Se[de]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(pe,Se[pe]),onApply:e=>this.handleValueChange(e)}};return m.createElement(It,{...t},m.createElement(d.ActionSheetContent,null,this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>void 0!==e.value?e.value:t.value,this.nextShow=(e,t)=>void 0!==e.show?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.state.candidate||this.value;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=e=>{this.setShow(!1)},this.handleClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},this.showLicenseWatermark=!s.validatePackage(Et,{component:"TimePicker"}),this.licenseMessage=s.getLicenseMessage(Et),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const e=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),i=this.normalizeTime(this.max),s=((e,t,i)=>{if(null===e)return!0;const{candidateValue:s,minValue:a,maxValue:n}=gt(e,t,i);return a<=s&&s<=n})(e,t,i),a=void 0!==this.props.validationMessage,n=(!this.required||null!==this.value)&&s,o=void 0!==this.props.valid?this.props.valid:n;return{customError:a,rangeOverflow:wt(e,i),rangeUnderflow:ft(e,t),valid:o,valueMissing:null===this.value}}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}get popupSettings(){return this.props.popupSettings||e.defaultProps.popupSettings}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}get localizationService(){return n.provideLocalizationService(this)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow&&this._timeSelector.focusActiveList(),this.mobileMode&&this.show&&!this.prevShow&&setTimeout((()=>{this._timeSelector&&this._timeSelector.focusActiveList()}),300),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,disabled:n,tabIndex:l,title:h,id:c,className:u,format:d,formatPlaceholder:p,width:g,name:v,steps:f,validationMessage:w,required:b,validityStyles:D,ariaLabelledBy:y,ariaDescribedBy:S,unstyled:C,enableMouseWheel:k,autoCorrectParts:x,autoSwitchParts:I,autoSwitchKeys:M,allowCaretMode:T,inputAttributes:O}=this.props,E=C&&C.uTimePicker,V=!this.validityStyles||this.validity.valid,N={disabled:n,format:d,formatPlaceholder:p,id:c,ariaLabelledBy:y,ariaDescribedBy:S,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:v,onChange:this.handleInputValueChange,required:b,steps:f,tabIndex:this.show?-1:l,title:h,valid:this.validity.valid,validationMessage:w,validityStyles:D,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,enableMouseWheel:k,autoCorrectParts:x,autoSwitchParts:I,autoSwitchKeys:M,allowCaretMode:T,inputAttributes:O},R=this.localizationService.toLanguageString(ge,Se[ge]),P=this.localizationService.toLanguageString(me,Se[me]),F=m.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(({onFocus:e,onBlur:l})=>m.createElement(m.Fragment,null,m.createElement("span",{ref:e=>{this._element=e},className:s.classNames(s.uTimePicker.wrapper({c:E,size:t,rounded:i,fillMode:a,invalid:!V,required:this.required,disabled:n}),u),onKeyDown:this.handleKeyDown,style:{width:g},onFocus:this.mobileMode?this.handleClick:e,onBlur:l,onClick:this.mobileMode?this.handleClick:void 0},m.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...N}),m.createElement(o.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:r.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:P,className:s.classNames(s.uTimePicker.inputButton({c:E})),rounded:null,fillMode:a,"aria-label":R}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))));return this.props.label?m.createElement(xt,{dateInput:this._dateInput,label:this.props.label,editorId:c,editorValid:V,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}normalizeTime(e){return F(E,e)}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}mergeTime(e){return this.value&&e?F(this.value,e):e}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ci.displayName="TimePicker",ci.propTypes={className:i.string,cancelButton:i.bool,nowButton:i.bool,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,steps:i.shape({hour:i.number,minute:i.number,second:i.number}),smoothScroll:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),inputAttributes:i.object},ci.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:P,min:R,popupSettings:{},tabIndex:0,steps:{},validityStyles:!0,dateInput:yt,size:"medium",rounded:"medium",fillMode:"solid"};let ui=ci;const di=s.createPropsContext(),pi=s.withIdHOC(s.withPropsContext(di,s.withUnstyledHOC(s.withAdaptiveModeContext(ui))));pi.displayName="KendoReactTimePicker",n.registerForLocalization(ui);const mi=class e extends m.Component{constructor(e){super(e),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(null===e.start||null===e.end)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleWeekCellClick=(e,t,i)=>{const{onWeekSelect:s}=this.props;s&&i&&s.call(void 0,e,t,i)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const s={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:a.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,s)}}}get element(){return this._element}get weekNumber(){return!(!this.props.showWeekNumbers||this.props.activeView!==I.month)}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const e=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=s.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===I.month,"k-calendar-yearview":this.props.activeView===I.year,"k-calendar-decadeview":this.props.activeView===I.decade,"k-calendar-centuryview":this.props.activeView===I.century});return m.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map((t=>m.createElement("table",{className:"k-calendar-table",key:t.getTime(),role:"grid"},m.createElement(j,{bus:this.props.bus,weekDaysFormat:this.props.weekDaysFormat,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:e,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onWeekSelect:this.handleWeekCellClick,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse})))))}};mi.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,weekDaysFormat:"short",min:V,max:N};let gi=mi;const vi=(e=yi.defaultProps.min,t=yi.defaultProps.max,i)=>i instanceof Date&&!Array.isArray(i)&&B(a.getDate(i),e,t)?a.getDate(i):null,fi=(e=yi.defaultProps.min,t=yi.defaultProps.max,i)=>Array.isArray(i)?i.filter((i=>B(i,e,t))).map((e=>a.getDate(e))):null,wi=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?M:e,bi=(e,t,i)=>e||t&&t[0]||i&&i.start,Di=class e extends m.Component{constructor(t){super(t),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=M,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.showLicenseWatermark=!1,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=e=>({start:e,end:null}),this.rangeWithFocused=(e,t)=>({start:e.start,end:null===e.end&&null!==e.start&&this.isActive?t:e.end}),this.generateRange=(e,t)=>{const{end:i,start:s}=t,a=null!==t.start&&e.getTime()<=t.start.getTime();return!this.props.allowReverse&&a?{start:e,end:this.selectedRange.start}:"end"!==this.activeRange?{start:e,end:i}:{start:s||this.selectedDate,end:e}},this.canNavigate=e=>{if(!this.service)return!1;const t=this.service.move(this.focusedDate,e);return this.min<=t&&t<=this.max||this.service.isInSameView(t,this.min)||this.service.isInSameView(t,this.max)},this.navigate=(e,t)=>{this.calculateFocusFromValue=!1;const i=this.move(e,t);this.setState({navigateDate:i,focusedDate:i})},this.move=(e,t)=>this.clampDate(this.service.move(t,e)),this.clampDate=e=>q(e,this.min,this.max),this.shouldAutoCorrect=(e,t)=>{const{end:i,start:s}=t;return"end"!==this.activeRange?null!==i&&e>i:null!==s&&e<s},this.handleCellEnter=e=>{"range"===this.props.mode&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:e}))},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleTodayClick=e=>{this.todayIsInRange&&this.handleDateChange(e)},this.handlePrevButtonClick=()=>{const e=Ee.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(e,this.move(e,this.focusedDate));else{const t=this.isInMonth(this.focusedDate,this.dates[1])?this.move(e,this.focusedDate):this.focusedDate;this.navigate(e,t)}},this.handleNextButtonClick=()=>{this.navigate(Ee.NextView,this.focusedDate)},this.handleKeyDown=e=>{const{keyCode:t,ctrlKey:i,metaKey:n}=e;if(84===t){const e=L();this.calculateFocusFromValue=!1,this.setState({focusedDate:e,navigateDate:e})}if((i||n)&&(t===s.Keys.left&&this.handlePrevButtonClick(),t===s.Keys.right&&this.handleNextButtonClick()),t===s.Keys.enter){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(t)}else{const t=q(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(a.isEqualDate(this.focusedDate,t))return;this.dates&&this.service&&!this.service.isInArray(t,this.dates)&&this.setState({navigateDate:t}),this.calculateFocusFromValue=!1,this.setState({focusedDate:t})}e.preventDefault()},this.handleViewChange=({view:e})=>{this.calculateFocusFromValue=!1,this.setState((t=>({activeView:e,navigateDate:t.focusedDate})))},this.handleWeekSelection=(e,t,i)=>{if("single"===this.props.mode)return;const s=0===t?e:a.addDays(e,-t),n=6===t?e:a.addDays(e,6-t);let o=null;if("multiple"===this.props.mode){o=[];for(let e=0;e<=6;e++)o.push(a.addDays(s,e));this.setState({value:o,focusedDate:e})}"range"===this.props.mode&&(o={start:s,end:n},this.setState({value:o,focusedDate:e}));const{onChange:r}=this.props;if(r){const e={syntheticEvent:i,nativeEvent:i.nativeEvent,value:o,target:this};r.call(void 0,e)}},this.handleDateChange=e=>{const t=a.cloneDate(e.value),i=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(i){if(!e.isTodayClick)return this.bus.moveDown(this.state.activeView,e.syntheticEvent),void this.setState({focusedDate:t,navigateDate:t});this.bus.moveToBottom(this.state.activeView)}let s;switch(this.calculateFocusFromValue=!0,this.props.mode){case"single":default:s=a.cloneDate(e.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const t=this.selectedMultiple.slice();let i=-1;t.forEach(((t,s)=>{a.isEqualDate(t,e.value)&&(i=s)})),-1!==i?t.splice(i,1):t.push(a.cloneDate(e.value)),s=t.slice()}else s=this.selectedDate?[a.cloneDate(this.selectedDate),a.cloneDate(e.value)]:[a.cloneDate(e.value)];break;case"range":s=null!==this.selectedRange.start&&null!==this.selectedRange.end&&"start"===this.activeRange?this.clampRange(e.value):this.generateRange(e.value,this.selectedRange),this.activeRangeEnd="end"!==this.activeRange?"end":"start"}this.valueDuringOnChange=s,e.isTodayClick&&this.setState({navigateDate:t}),this.setState({value:s,focusedDate:t}),this.valueDuringOnChange=s;const{onChange:n}=this.props;if(n){const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};n.call(void 0,t)}this.valueDuringOnChange=void 0},this.showLicenseWatermark=!s.validatePackage(Et,{component:"MultiViewCalendar"}),this.licenseMessage=s.getLicenseMessage(Et);const i=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=vi(this.min,this.max,i),o=fi(this.min,this.max,i),r=wi(i),l=bi(n,o,r),h=O(I[t.defaultActiveView],this.bottomView,this.topView),c=q(t.focusedDate||l||L(),this.min,this.max);this.state={value:i,activeView:h,focusedDate:c,navigateDate:c},this.activeRangeEnd=((e,t)=>null===e.start&&null===t?"start":null===e.end?"end":"start")(r,n),this.bus=new Ke(this.handleViewChange),this.navigation=new $e(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||gi.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return"rtl"===this.props.dir}get element(){return this._element}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value}get focusedDate(){return a.cloneDate(this._focusedDate)}get min(){return a.getDate(void 0!==this.props.min?this.props.min:e.defaultProps.min)}get max(){return a.getDate(void 0!==this.props.max?this.props.max:e.defaultProps.max)}get bottomView(){return I[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView]}get topView(){return I[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]}get activeRange(){return void 0!==this.props.activeRangeEnd?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return B(L(),a.getDate(this.min),a.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const e=vi(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&e&&this.selectedDate.getTime()&&e.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||gi.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=n.provideIntlService(this),this.localization=n.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const e=O(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(e,this.intl),this.selectedDate=vi(this.min,this.max,this.value),this.selectedMultiple=fi(this.min,this.max,this.value),this.selectedRange=wi(this.value);const t=bi(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=q(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const i=s.classNames("k-calendar k-calendar-range k-calendar-md",{"k-disabled":this.props.disabled},this.props.className),l=this.rangeWithFocused(this.selectedRange,this.focusedDate),h=this.localization.toLanguageString(X,Se[X]),c=this.localization.toLanguageString(Q,Se[Q]),u=!this.canNavigate(Ee.PrevView),d=!this.canNavigate(Ee.NextView),p={"aria-disabled":u},g={"aria-disabled":d},v=this.lastView!==e,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),w=this.lastViewsCount!==this.props.views;(!f||v||w)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||gi.defaultProps.views));const b=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:L());return m.createElement("div",{ref:e=>{this._element=e},className:i,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},m.createElement(G,{key:`.kendo.calendar.header.${b.getTime()}`,activeView:e,currentDate:b,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:m.createElement(m.Fragment,null,m.createElement(o.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?r.chevronRightIcon:r.chevronLeftIcon,fillMode:"flat",title:h,disabled:u,onClick:this.handlePrevButtonClick,...p}),m.createElement(ke,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),m.createElement(o.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?r.chevronLeftIcon:r.chevronRightIcon,fillMode:"flat",title:c,disabled:d,onClick:this.handleNextButtonClick,...g}))}),m.createElement(gi,{ref:e=>{this.calendarViewList=e},dates:this.dates,activeView:e,focusedDate:this.focusedDate,weekDaysFormat:this.props.weekDaysFormat,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:l,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,onWeekSelect:this.handleWeekSelection,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,showOtherMonthDays:this.props.showOtherMonthDays,allowReverse:this.props.allowReverse}),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}isInMonth(e,t){return!!t&&a.firstDayOfMonth(t)<=e&&e<=a.lastDayOfMonth(t)}};Di.displayName="MultiViewCalendar",Di.propTypes={activeRangeEnd:i.oneOf(["start","end"]),allowReverse:i.bool,bottomView:i.oneOf(["month","year","decade","century"]),className:i.string,defaultActiveView:i.oneOf(["month","year","decade","century"]),defaultValue:i.oneOfType([T(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:T(i.instanceOf(Date)),end:T(i.instanceOf(Date))})]),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,weekDaysFormat:i.oneOf(["narrow","short","abbreviated"]),ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),mode:i.oneOf(["single","multiple","range"]),onBlur:i.func,onChange:i.func,onFocus:i.func,tabIndex:i.number,topView:i.oneOf(["month","year","decade","century"]),value:i.oneOfType([T(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:T(i.instanceOf(Date).isRequired),end:T(i.instanceOf(Date).isRequired)})]),views:(e,t,i)=>{const s=e[t];return void 0!==s&&s<1?new Error(`Invalid prop '${t}' supplied to'${i}'. The '${t}' property cannot be less than 1'`):null},weekNumber:i.bool,showOtherMonthDays:i.bool,dir:i.string},Di.defaultProps={disabled:!1,min:V,max:N,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",weekDaysFormat:"short",tabIndex:0,bottomView:"month",views:2,allowReverse:!1,showOtherMonthDays:!1};let yi=Di;const Si=s.createPropsContext(),Ci=s.withIdHOC(s.withPropsContext(Si,yi));Ci.displayName="KendoReactMultiViewCalendar",n.registerForIntl(yi),n.registerForLocalization(yi);const ki=class e extends m.Component{constructor(t){super(t),this._element=null,this._calendar=null,this._startDateInput=m.createRef(),this._endDateInput=m.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.showLicenseWatermark=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(void 0!==e.value?e.value:t.value)||M,this.calculateShow=(e,t)=>void 0!==e.show?e.show:t.show,this.renderCalendar=()=>{const e=this.value||M,t={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?m.createElement(this.props.calendar,{...t}):m.createElement(Ci,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:s.classNames("k-calendar-container","k-daterangepicker-popup"),animate:null!==this._element,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?m.createElement(this.props.popup,{...e},this.renderCalendar()):m.createElement(u.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:e=>this.handleCancel(e),title:this.props.adaptiveTitle,subTitle:this.props.adaptiveSubtitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(De,Se[De]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(ye,Se[ye]),onApply:this.handleBlur}};return m.createElement(It,{...t},m.createElement(d.ActionSheetContent,null,m.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=e=>{this.nextTick((()=>{this.setShow(!1)}));const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick((()=>{this.setShow(!1),this.setState({currentValue:M})}));const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:a.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:a.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!(Array.isArray(e.value)||e.value instanceof Date))return e.value||M;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:null!==this.value.end?t:this.value.start,end:null!==this.value.start?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;t===s.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===s.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):i&&t===s.Keys.up&&(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const e={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,e)}this.valueDuringOnChange=void 0},this.showLicenseWatermark=!s.validatePackage(Et,{component:"DateRangePicker"}),this.licenseMessage=s.getLicenseMessage(Et),this.state={show:this.props.show||this.props.defaultShow||e.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||e.defaultProps.defaultValue,currentValue:M},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value)||M}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return n.provideLocalizationService(this)}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)}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.mobileMode&&this.show&&setTimeout((()=>{this.focusCalendarElement()}),300),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{autoFocus:e}=this.props,t=this.value||M,i=this.mobileMode&&this.show?this.state.currentValue:t,a=(this.props.startDateInputSettings||{}).id||this._startInputId,l=(this.props.endDateInputSettings||{}).id||this._endInputId,h=s.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),c=this.localizationService.toLanguageString(oe,Se[oe]),u=this.localizationService.toLanguageString(re,Se[re]),d=this.localizationService.toLanguageString(le,Se[le]),p={disableSelection:this.mobileMode&&!0,label:c,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.startDateInputSettings,value:i.start,onChange:this.handleStartChange,inputAttributes:this.props.inputAttributes},g={disableSelection:this.mobileMode&&!0,label:u,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,clearButton:this.props.clearButton,...this.props.endDateInputSettings,value:i.end,onChange:this.handleEndChange,inputAttributes:this.props.inputAttributes},v=m.createElement(o.Button,{type:"button",className:"k-select",fillMode:"flat",title:n.provideLocalizationService(this).toLanguageString(ne,Se[ne]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":a+" "+l,"aria-label":n.provideLocalizationService(this).toLanguageString(ne,Se[ne])},m.createElement(s.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:r.arrowsSwapIcon}));return m.createElement(m.Fragment,null,m.createElement("span",{ref:e=>{this._element=e},className:h,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.mobileMode?this.handleClick:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?m.createElement(this.props.startDateInput,{...p}):m.createElement(yt,{...p,autoFocus:e,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?v:d,this.props.endDateInput?m.createElement(this.props.endDateInput,{...g}):m.createElement(yt,{...g,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup(),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}focusDateInputElement(){if(!(document&&this.startDateInput&&this.startDateInput.element&&this.endDateInput&&this.endDateInput.element))return;const e=s.getActiveElement(document);null!==this.value.start&&null===this.value.end||e===this.endDateInput.element?e!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0}):this.startDateInput.element.focus({preventScroll:!0})}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};ki.displayName="DateRangePicker",ki.propTypes={allowReverse:i.bool,calendarSettings:i.any,className:i.string,defaultShow:i.bool,defaultValue:i.shape({start:T(i.instanceOf(Date).isRequired),end:T(i.instanceOf(Date).isRequired)}),disabled:i.bool,endDateInputSettings:i.shape(yt.propTypes),focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,max:i.instanceOf(Date),min:i.instanceOf(Date),onBlur:i.func,onChange:i.func,onFocus:i.func,popupSettings:i.any,show:i.bool,startDateInputSettings:i.any,style:i.any,swapButton:i.any,tabIndex:i.number,dir:i.string,value:i.shape({start:T(i.instanceOf(Date)),end:T(i.instanceOf(Date))}),autoFocus:i.bool,inputAttributes:i.object},ki.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:M,disabled:!1,format:"d",max:N,min:V,swapButton:!1,autoFocus:!1};let xi=ki;const Ii=s.createPropsContext(),Mi=s.withIdHOC(s.withPropsContext(Ii,s.withAdaptiveModeContext(xi)));Mi.displayName="KendoReactDateRangePicker",n.registerForLocalization(xi);const Ti=class extends m.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._dateButtonRef=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then((()=>{"time"===this.state.tab&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();"date"===this.state.tab&&t&&t.focus(e)}))},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-calendar"),this.move=e=>{if("right"===e&&"time"===this.state.tab||"left"===e&&"date"===this.state.tab)return;const t="left"===e?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e,unstyled:t}=this.props,i=t&&t.uDateTimePicker,a=this.localizationService.toLanguageString(we,Se[we]),n=this.localizationService.toLanguageString(be,Se[be]);return m.createElement("div",{className:s.classNames(s.uDateTimePicker.timeFooter({c:i}))},e&&m.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:s.classNames(s.uTime.cancel({c:i})),onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:a,"aria-label":a},a),m.createElement(o.Button,{type:"button",themeColor:"primary",ref:e=>{this._acceptButton=e},className:s.classNames(s.uTime.accept({c:i})),disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:n,"aria-label":n},n))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||E});const t=this.mergeDate(this.props.value,this.props.value||E);if(this.props.onReject){const i={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,i)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const i=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:this})},this.handleNowClick=e=>{this.setState({timeValue:pt()}),this.handleAccept(e,pt())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;if(!this.props.disabled)switch(t){case s.Keys.enter:return void(!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e));case s.Keys.left:if(!i)return;return void this.move("left");case s.Keys.right:if(!i)return;return void this.move("right");default:return}},this.handleCancelKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var t,i,a,n;const{keyCode:o,shiftKey:r}=e;r&&o===s.Keys.tab&&(e.stopPropagation(),this.hasDateValue?null==(n=null==(a=this._acceptButton)?void 0:a.element)||n.focus():null==(i=null==(t=this._cancelButton)?void 0:t.element)||i.focus()),o===s.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===s.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||E}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return null!==this.state.dateValue}get localizationService(){return n.provideLocalizationService(this)}componentDidUpdate(e,t){var i,s;this.shouldFocusPart&&this.focus({preventScroll:!0}),((null==(i=e.value)?void 0:i.getTime())!==(null==(s=this.props.value)?void 0:s.getTime())||this.state.tab!==t.tab&&this.props.value)&&this.setState((t=>({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?t.dateValue:this.props.value,timeValue:this.props.value||E}))),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h,unstyled:c}=this.props,u=c&&c.uDateTimePicker,d=s.classNames(s.uDateTimePicker.wrap({c:u,date:"date"===this.state.tab,time:"time"===this.state.tab,disabled:e})),p=this.localizationService.toLanguageString(ve,Se[ve]),g=this.localizationService.toLanguageString(fe,Se[fe]),v={min:t,max:i,weekNumber:a,focusedDate:n,disabled:e||"date"!==this.state.tab,value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:e||"date"!==this.state.tab?-1:void 0,mobileMode:l};return m.createElement("div",{onKeyDown:this.handleKeyDown,className:d,tabIndex:-1},m.createElement("div",{className:s.classNames(s.uDateTimePicker.buttonGroup({c:u}))},m.createElement(o.ButtonGroup,{width:"100%",unstyled:c},m.createElement(o.Button,{ref:e=>{this._dateButtonRef=e},type:"button",selected:"date"===this.state.tab,togglable:!0,size:l?"large":void 0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},p),m.createElement(o.Button,{type:"button",selected:"time"===this.state.tab,togglable:!0,size:l?"large":void 0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},g))),m.createElement("div",{className:s.classNames(s.uDateTimePicker.selector({c:u}))},m.createElement("div",{className:s.classNames(s.uDateTimePicker.calendarWrap({c:u})),ref:e=>{this._calendarWrap=e}},this.props.calendar?m.createElement(this.props.calendar,{key:this.state.tab,...v}):m.createElement(et,{key:this.state.tab,ref:e=>{this._calendar=e},...v})),m.createElement("div",{className:s.classNames(s.uDateTimePicker.timeWrap({c:u}))},m.createElement("div",{className:s.classNames(s.uDateTimePicker.timeSelector({c:u,mobileMode:l}))},m.createElement(ri,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||R,max:this.maxTime||P,steps:this.props.steps,value:this.state.timeValue,format:r,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:l,unstyled:c})))),h&&this.dateTimeFooter())}get minTime(){return void 0!==this.props.minTime?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return void 0!==this.props.maxTime?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(e,t){return a.isEqualDate(e,t||L())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=s.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?F(t,e):t}mergeDate(e,t){return e?F(e||L(),t):t}};Ti.defaultProps={footerActions:!0};let Oi=Ti;n.registerForLocalization(Oi);const Ei=class e extends m.Component{constructor(t){super(t),this._element=null,this._dateInput=m.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:s,calendar:a,cancelButton:n,weekNumber:o,focusedDate:r,unstyled:l}=this.props;return m.createElement(Oi,{ref:e=>{this._dateTimeSelector=e},cancelButton:n,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:o,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:r,format:s,calendar:a,mobileMode:this.mobileMode,footerActions:!this.mobileMode,unstyled:l})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(we,Se[we]),i=n.provideLocalizationService(this).toLanguageString(be,Se[be]),s={expand:this.show,onClose:this.handleBlur,title:this.props.adaptiveTitle||this.props.label,subTitle:this.props.adaptiveSubtitle,windowWidth:e,footer:{cancelText:t,onCancel:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleReject(e)},applyText:i,onApply:e=>{var t;return null==(t=this._dateTimeSelector)?void 0:t.handleAccept(e)}}};return m.createElement(It,{...s},m.createElement(d.ActionSheetContent,null,this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:a.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===s.Keys.esc)return this.shouldFocusDateInput=!0,void this.setShow(!1);t&&(i===s.Keys.up||i===s.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===s.Keys.up,this.setShow(i===s.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),this.state={value:this.props.defaultValue||e.defaultProps.defaultValue,show:this.props.defaultShow||e.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(s.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const e=void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.props.value?this.props.value:this.state.value;return null!==e?a.cloneDate(e):null}get show(){return void 0!==this.showDuringOnChange?this.showDuringOnChange:void 0!==this.props.show?this.props.show:this.state.show}get name(){return this.props.name}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 min(){return void 0!==this.props.min?this.props.min:e.defaultProps.min}get max(){return void 0!==this.props.max?this.props.max:e.defaultProps.max}get validity(){const e=A(this.value,this.min,this.max)&&vt(this.value,this.props.minTime||R,this.props.maxTime||P),t=void 0!==this.props.validationMessage,i=(!this.required||null!==this.value)&&e,s=void 0!==this.props.valid?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,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}get dateInputComp(){return this.props.dateInput||e.defaultProps.dateInput}componentDidMount(){var e;this.observerResize=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const e=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),this.mobileMode&&this.show&&!this.prevShow&&setTimeout((()=>{this._dateTimeSelector&&this._dateTimeSelector.focus({preventScroll:!0})}),300),e&&!this.show&&this.shouldFocusDateInput&&e.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var e;clearTimeout(this.nextTickId),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:t=e.defaultProps.size,rounded:i=e.defaultProps.rounded,fillMode:a=e.defaultProps.fillMode,autoFocus:l=e.defaultProps.autoFocus,inputAttributes:h,disabled:c,tabIndex:d,title:p,id:g,format:v,formatPlaceholder:f,min:w,max:b,className:D,width:y,name:S,validationMessage:C,required:k,validityStyles:x,minTime:I,maxTime:M,ariaLabelledBy:T,ariaDescribedBy:O,popup:E=u.Popup,unstyled:V,autoFill:N,twoDigitYearMax:R,enableMouseWheel:P,autoCorrectParts:F,autoSwitchParts:L,autoSwitchKeys:B,allowCaretMode:A}=this.props,z=V&&V.uDateTimePicker,H=!this.validityStyles||this.validity.valid,_={id:g,ariaLabelledBy:T,ariaDescribedBy:O,format:v,formatPlaceholder:f,disabled:c,title:p,validityStyles:x,validationMessage:C,required:k,min:w,max:b,minTime:I,maxTime:M,name:S,tabIndex:this.show?-1:d,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null,unstyled:V,autoFill:N,twoDigitYearMax:R,enableMouseWheel:P,autoCorrectParts:F,autoSwitchParts:L,autoSwitchKeys:B,allowCaretMode:A},q=m.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},(({onFocus:e,onBlur:u})=>m.createElement(m.Fragment,null,m.createElement("div",{ref:e=>{this._element=e},className:s.classNames(s.uDateTimePicker.wrapper({c:z,size:t,fillMode:a,rounded:i,disabled:c,required:this.required,invalid:!H}),D),onKeyDown:this.handleKeyDown,style:{width:y},onFocus:this.mobileMode?this.handleClick:e,onBlur:u,onClick:this.mobileMode?this.handleClick:void 0},m.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,ariaHasPopup:"dialog",autoFocus:l,inputAttributes:h,..._}),m.createElement(o.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:r.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleClick,title:n.provideLocalizationService(this).toLanguageString(he,Se[he]),className:s.classNames(s.uDateTimePicker.inputButton({c:z})),rounded:null,fillMode:a,"aria-label":n.provideLocalizationService(this).toLanguageString(he,Se[he])}),m.createElement(E,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:s.classNames(s.uDateTimePicker.popup({c:z})),id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?m.createElement(xt,{dateInput:this._dateInput,label:this.props.label,editorId:g,editorValid:H,editorDisabled:this.props.disabled,children:q,style:{width:this.props.width}}):q}setShow(e){const{onOpen:t,onClose:i}=this.props;this.show!==e&&(this.setState({show:e}),e&&t&&t.call(void 0,{target:this}),!e&&i&&i.call(void 0,{target:this}))}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};Ei.displayName="DateTimePicker",Ei.propTypes={className:i.string,defaultShow:i.bool,defaultValue:i.instanceOf(Date),disabled:i.bool,focusedDate:i.instanceOf(Date),format:i.oneOfType([i.string,i.shape({skeleton:i.string,pattern:i.string,date:i.oneOf(["short","medium","long","full"]),time:i.oneOf(["short","medium","long","full"]),datetime:i.oneOf(["short","medium","long","full"]),era:i.oneOf(["narrow","short","long"]),year:i.oneOf(["numeric","2-digit"]),month:i.oneOf(["numeric","2-digit","narrow","short","long"]),day:i.oneOf(["numeric","2-digit"]),weekday:i.oneOf(["narrow","short","long"]),hour:i.oneOf(["numeric","2-digit"]),hour12:i.bool,minute:i.oneOf(["numeric","2-digit"]),second:i.oneOf(["numeric","2-digit"]),timeZoneName:i.oneOf(["short","long"])})]),formatPlaceholder:i.oneOfType([i.oneOf(["wide","narrow","short","formatPattern"]),i.shape({year:i.string,month:i.string,day:i.string,hour:i.string,minute:i.string,second:i.string})]),id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,min:i.instanceOf(Date),max:i.instanceOf(Date),name:i.string,popupSettings:i.shape({animate:i.bool,appendTo:i.any,popupClass:i.string}),show:i.bool,tabIndex:i.number,title:i.string,value:i.instanceOf(Date),weekNumber:i.bool,width:i.oneOfType([i.number,i.string]),validationMessage:i.string,required:i.bool,validate:i.bool,valid:i.bool,cancelButton:i.bool,size:i.oneOf([null,"small","medium","large"]),rounded:i.oneOf([null,"small","medium","large","full"]),fillMode:i.oneOf([null,"solid","flat","outline"]),autoFocus:i.bool,inputAttributes:i.object},Ei.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:N,min:V,popupSettings:{},tabIndex:0,weekNumber:!1,validityStyles:!0,cancelButton:!0,dateInput:yt,size:"medium",rounded:"medium",fillMode:"solid",autoFocus:!1};let Vi=Ei;const Ni=s.createPropsContext(),Ri=s.withIdHOC(s.withPropsContext(Ni,s.withUnstyledHOC(s.withAdaptiveModeContext(Vi))));Ri.displayName="KendoReactDateTimePicker",n.registerForLocalization(Vi),e.Action=Ee,e.BusViewService=Ke,e.Calendar=et,e.CalendarCell=k,e.CalendarHeaderTitle=Z,e.CalendarNavigationItem=Me,e.CalendarPropsContext=Qe,e.CalendarViewEnum=I,e.CalendarWeekCell=x,e.CalendarWithoutContext=Xe,e.CenturyViewService=Re,e.DOMService=Ue,e.DateInput=yt,e.DateInputPropsContext=Ct,e.DatePicker=Mt,e.DatePickerPropsContext=Ot,e.DateRangePicker=Mi,e.DateRangePickerPropsContext=Ii,e.DateRangePickerWithoutContext=xi,e.DateTimePicker=Ri,e.DateTimePickerPropsContext=Ni,e.DateTimePickerWithoutContext=Vi,e.DayPeriodService=Ft,e.DecadeViewService=Le,e.EMPTY_SELECTIONRANGE=M,e.Header=G,e.HorizontalViewList=gi,e.HoursService=qt,e.MAX_DATE=N,e.MAX_TIME=P,e.MIN_DATE=V,e.MIN_TIME=R,e.MinutesService=jt,e.MonthViewService=ze,e.MultiViewCalendar=Ci,e.MultiViewCalendarPropsContext=Si,e.MultiViewCalendarWithoutContext=yi,e.NavigationService=$e,e.ScrollSyncService=je,e.SecondsService=ei,e.TimeList=ai,e.TimePart=ri,e.TimePicker=pi,e.TimePickerPropsContext=di,e.TimePickerWithoutContext=ui,e.TimeSelector=hi,e.TodayCommand=ke,e.ToggleButton=kt,e.ViewList=Ie,e.Virtualization=C,e.WeekNamesService=U,e.YearViewService=qe,e.dateInputDefaultProps=St,e.dateInputsMessages=Se,e.datePickerDefaultProps=Tt,e.decreaseValue=te,e.end=re,e.getNow=pt,e.getToday=L,e.increaseValue=ee,e.separator=le,e.start=oe,e.swapStartEnd=ne,e.today=se,e.toggleCalendar=ae,e.toggleDateTimeSelector=he}));
package/index.d.mts CHANGED
@@ -857,8 +857,8 @@ export declare interface DateInputCustomFormatPlaceholder {
857
857
  */
858
858
  export declare const dateInputDefaultProps: {
859
859
  format: string;
860
- size: "small" | "large" | "medium" | null | undefined;
861
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
860
+ size: "small" | "medium" | "large" | null | undefined;
861
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
862
862
  fillMode: "flat" | "solid" | "outline" | null | undefined;
863
863
  formatPlaceholder: DateInputFormatPlaceholder;
864
864
  spinners: boolean;
@@ -1400,8 +1400,8 @@ export declare const datePickerDefaultProps: {
1400
1400
  tabIndex: number;
1401
1401
  weekNumber: boolean;
1402
1402
  validityStyles: boolean;
1403
- size: "small" | "large" | "medium" | null | undefined;
1404
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
1403
+ size: "small" | "medium" | "large" | null | undefined;
1404
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
1405
1405
  fillMode: "flat" | "solid" | "outline" | null | undefined;
1406
1406
  autoFocus: boolean;
1407
1407
  };
@@ -2741,8 +2741,8 @@ export declare class DateTimePickerWithoutContext extends React_2.Component<Date
2741
2741
  validate: default_2.Requireable<boolean>;
2742
2742
  valid: default_2.Requireable<boolean>;
2743
2743
  cancelButton: default_2.Requireable<boolean>;
2744
- size: default_2.Requireable<"small" | "large" | "medium" | null | undefined>;
2745
- rounded: default_2.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
2744
+ size: default_2.Requireable<"small" | "medium" | "large" | null | undefined>;
2745
+ rounded: default_2.Requireable<"small" | "medium" | "large" | "full" | null | undefined>;
2746
2746
  fillMode: default_2.Requireable<"flat" | "solid" | "outline" | null | undefined>;
2747
2747
  autoFocus: default_2.Requireable<boolean>;
2748
2748
  inputAttributes: default_2.Requireable<object>;
@@ -2763,8 +2763,8 @@ export declare class DateTimePickerWithoutContext extends React_2.Component<Date
2763
2763
  validityStyles: boolean;
2764
2764
  cancelButton: boolean;
2765
2765
  dateInput: React_2.ComponentType<DateInputProps<any>>;
2766
- size: "small" | "large" | "medium" | null | undefined;
2767
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
2766
+ size: "small" | "medium" | "large" | null | undefined;
2767
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
2768
2768
  fillMode: "flat" | "solid" | "outline" | null | undefined;
2769
2769
  autoFocus: boolean;
2770
2770
  };
@@ -4373,8 +4373,8 @@ export declare class TimePickerWithoutContext extends React_2.Component<TimePick
4373
4373
  required: default_2.Requireable<boolean>;
4374
4374
  validate: default_2.Requireable<boolean>;
4375
4375
  valid: default_2.Requireable<boolean>;
4376
- size: default_2.Requireable<"small" | "large" | "medium" | null | undefined>;
4377
- rounded: default_2.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
4376
+ size: default_2.Requireable<"small" | "medium" | "large" | null | undefined>;
4377
+ rounded: default_2.Requireable<"small" | "medium" | "large" | "full" | null | undefined>;
4378
4378
  fillMode: default_2.Requireable<"flat" | "solid" | "outline" | null | undefined>;
4379
4379
  inputAttributes: default_2.Requireable<object>;
4380
4380
  };
@@ -4393,8 +4393,8 @@ export declare class TimePickerWithoutContext extends React_2.Component<TimePick
4393
4393
  steps: {};
4394
4394
  validityStyles: boolean;
4395
4395
  dateInput: React_2.ComponentType<DateInputProps<any>>;
4396
- size: "small" | "large" | "medium" | null | undefined;
4397
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
4396
+ size: "small" | "medium" | "large" | null | undefined;
4397
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
4398
4398
  fillMode: "flat" | "solid" | "outline" | null | undefined;
4399
4399
  };
4400
4400
  /**
package/index.d.ts CHANGED
@@ -857,8 +857,8 @@ export declare interface DateInputCustomFormatPlaceholder {
857
857
  */
858
858
  export declare const dateInputDefaultProps: {
859
859
  format: string;
860
- size: "small" | "large" | "medium" | null | undefined;
861
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
860
+ size: "small" | "medium" | "large" | null | undefined;
861
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
862
862
  fillMode: "flat" | "solid" | "outline" | null | undefined;
863
863
  formatPlaceholder: DateInputFormatPlaceholder;
864
864
  spinners: boolean;
@@ -1400,8 +1400,8 @@ export declare const datePickerDefaultProps: {
1400
1400
  tabIndex: number;
1401
1401
  weekNumber: boolean;
1402
1402
  validityStyles: boolean;
1403
- size: "small" | "large" | "medium" | null | undefined;
1404
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
1403
+ size: "small" | "medium" | "large" | null | undefined;
1404
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
1405
1405
  fillMode: "flat" | "solid" | "outline" | null | undefined;
1406
1406
  autoFocus: boolean;
1407
1407
  };
@@ -2741,8 +2741,8 @@ export declare class DateTimePickerWithoutContext extends React_2.Component<Date
2741
2741
  validate: default_2.Requireable<boolean>;
2742
2742
  valid: default_2.Requireable<boolean>;
2743
2743
  cancelButton: default_2.Requireable<boolean>;
2744
- size: default_2.Requireable<"small" | "large" | "medium" | null | undefined>;
2745
- rounded: default_2.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
2744
+ size: default_2.Requireable<"small" | "medium" | "large" | null | undefined>;
2745
+ rounded: default_2.Requireable<"small" | "medium" | "large" | "full" | null | undefined>;
2746
2746
  fillMode: default_2.Requireable<"flat" | "solid" | "outline" | null | undefined>;
2747
2747
  autoFocus: default_2.Requireable<boolean>;
2748
2748
  inputAttributes: default_2.Requireable<object>;
@@ -2763,8 +2763,8 @@ export declare class DateTimePickerWithoutContext extends React_2.Component<Date
2763
2763
  validityStyles: boolean;
2764
2764
  cancelButton: boolean;
2765
2765
  dateInput: React_2.ComponentType<DateInputProps<any>>;
2766
- size: "small" | "large" | "medium" | null | undefined;
2767
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
2766
+ size: "small" | "medium" | "large" | null | undefined;
2767
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
2768
2768
  fillMode: "flat" | "solid" | "outline" | null | undefined;
2769
2769
  autoFocus: boolean;
2770
2770
  };
@@ -4373,8 +4373,8 @@ export declare class TimePickerWithoutContext extends React_2.Component<TimePick
4373
4373
  required: default_2.Requireable<boolean>;
4374
4374
  validate: default_2.Requireable<boolean>;
4375
4375
  valid: default_2.Requireable<boolean>;
4376
- size: default_2.Requireable<"small" | "large" | "medium" | null | undefined>;
4377
- rounded: default_2.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
4376
+ size: default_2.Requireable<"small" | "medium" | "large" | null | undefined>;
4377
+ rounded: default_2.Requireable<"small" | "medium" | "large" | "full" | null | undefined>;
4378
4378
  fillMode: default_2.Requireable<"flat" | "solid" | "outline" | null | undefined>;
4379
4379
  inputAttributes: default_2.Requireable<object>;
4380
4380
  };
@@ -4393,8 +4393,8 @@ export declare class TimePickerWithoutContext extends React_2.Component<TimePick
4393
4393
  steps: {};
4394
4394
  validityStyles: boolean;
4395
4395
  dateInput: React_2.ComponentType<DateInputProps<any>>;
4396
- size: "small" | "large" | "medium" | null | undefined;
4397
- rounded: "small" | "large" | "medium" | "full" | null | undefined;
4396
+ size: "small" | "medium" | "large" | null | undefined;
4397
+ rounded: "small" | "medium" | "large" | "full" | null | undefined;
4398
4398
  fillMode: "flat" | "solid" | "outline" | null | undefined;
4399
4399
  };
4400
4400
  /**
@@ -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-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1768210138,version:"13.3.0-develop.3",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-dateinputs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1768232863,version:"13.3.0-develop.4",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;
@@ -10,8 +10,8 @@ const e = Object.freeze({
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1768210138,
14
- version: "13.3.0-develop.3",
13
+ publishDate: 1768232863,
14
+ version: "13.3.0-develop.4",
15
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"
16
16
  });
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-dateinputs",
3
- "version": "13.3.0-develop.3",
3
+ "version": "13.3.0-develop.4",
4
4
  "description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -28,12 +28,12 @@
28
28
  "@progress/kendo-date-math": "^1.4.0",
29
29
  "@progress/kendo-licensing": "^1.7.2",
30
30
  "@progress/kendo-dateinputs-common": "^0.4.7",
31
- "@progress/kendo-react-buttons": "13.3.0-develop.3",
32
- "@progress/kendo-react-common": "13.3.0-develop.3",
33
- "@progress/kendo-react-intl": "13.3.0-develop.3",
34
- "@progress/kendo-react-labels": "13.3.0-develop.3",
35
- "@progress/kendo-react-layout": "13.3.0-develop.3",
36
- "@progress/kendo-react-popup": "13.3.0-develop.3",
31
+ "@progress/kendo-react-buttons": "13.3.0-develop.4",
32
+ "@progress/kendo-react-common": "13.3.0-develop.4",
33
+ "@progress/kendo-react-intl": "13.3.0-develop.4",
34
+ "@progress/kendo-react-labels": "13.3.0-develop.4",
35
+ "@progress/kendo-react-layout": "13.3.0-develop.4",
36
+ "@progress/kendo-react-popup": "13.3.0-develop.4",
37
37
  "@progress/kendo-svg-icons": "^4.0.0",
38
38
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
39
39
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
@@ -89,7 +89,7 @@
89
89
  "package": {
90
90
  "productName": "KendoReact",
91
91
  "productCode": "KENDOUIREACT",
92
- "publishDate": 1768210138,
92
+ "publishDate": 1768232863,
93
93
  "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"
94
94
  }
95
95
  },