@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.3.0-develop.1

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.
Files changed (200) hide show
  1. package/calendar/components/Calendar.js +12 -0
  2. package/calendar/components/Calendar.mjs +328 -0
  3. package/calendar/components/CalendarCell.js +8 -0
  4. package/calendar/components/CalendarCell.mjs +101 -0
  5. package/calendar/components/CalendarHeaderTitle.js +8 -0
  6. package/calendar/components/CalendarHeaderTitle.mjs +23 -0
  7. package/calendar/components/CalendarNavigationItem.js +8 -0
  8. package/calendar/components/CalendarNavigationItem.mjs +29 -0
  9. package/calendar/components/CalendarWeekCell.js +8 -0
  10. package/calendar/components/CalendarWeekCell.mjs +23 -0
  11. package/calendar/components/Header.js +8 -0
  12. package/calendar/components/Header.mjs +78 -0
  13. package/calendar/components/HorizontalViewList.js +8 -0
  14. package/calendar/components/HorizontalViewList.mjs +120 -0
  15. package/calendar/components/MultiViewCalendar.js +8 -0
  16. package/calendar/components/MultiViewCalendar.mjs +428 -0
  17. package/calendar/components/Navigation.js +8 -0
  18. package/calendar/components/Navigation.mjs +117 -0
  19. package/calendar/components/TodayCommand.js +8 -0
  20. package/calendar/components/TodayCommand.mjs +74 -0
  21. package/calendar/components/View.js +8 -0
  22. package/calendar/components/View.mjs +153 -0
  23. package/calendar/components/ViewList.js +8 -0
  24. package/calendar/components/ViewList.mjs +228 -0
  25. package/calendar/models/CalendarViewEnum.js +8 -0
  26. package/calendar/models/CalendarViewEnum.mjs +12 -0
  27. package/calendar/models/NavigationAction.js +8 -0
  28. package/calendar/models/NavigationAction.mjs +12 -0
  29. package/calendar/models/SelectionRange.js +8 -0
  30. package/calendar/models/SelectionRange.mjs +12 -0
  31. package/calendar/services/BusViewService.js +8 -0
  32. package/calendar/services/BusViewService.mjs +58 -0
  33. package/calendar/services/CenturyViewService.js +8 -0
  34. package/calendar/services/CenturyViewService.mjs +126 -0
  35. package/calendar/services/DOMService.js +14 -0
  36. package/calendar/services/DOMService.mjs +124 -0
  37. package/calendar/services/DecadeViewService.js +8 -0
  38. package/calendar/services/DecadeViewService.mjs +126 -0
  39. package/calendar/services/MonthViewService.js +8 -0
  40. package/calendar/services/MonthViewService.mjs +139 -0
  41. package/calendar/services/NavigationService.js +8 -0
  42. package/calendar/services/NavigationService.mjs +36 -0
  43. package/calendar/services/ScrollSyncService.js +8 -0
  44. package/calendar/services/ScrollSyncService.mjs +50 -0
  45. package/calendar/services/WeekNamesService.js +8 -0
  46. package/calendar/services/WeekNamesService.mjs +24 -0
  47. package/calendar/services/YearViewService.js +8 -0
  48. package/calendar/services/YearViewService.mjs +135 -0
  49. package/common/AdaptiveMode.js +8 -0
  50. package/common/AdaptiveMode.mjs +73 -0
  51. package/common/PickerWrap.js +8 -0
  52. package/common/PickerWrap.mjs +32 -0
  53. package/common/constants.js +8 -0
  54. package/common/constants.mjs +12 -0
  55. package/dateinput/DateInput.js +8 -0
  56. package/dateinput/DateInput.mjs +503 -0
  57. package/dateinput/models/kendo-date.js +8 -0
  58. package/dateinput/models/kendo-date.mjs +233 -0
  59. package/dateinput/models/mask.js +8 -0
  60. package/dateinput/models/mask.mjs +16 -0
  61. package/dateinput/utils.js +8 -0
  62. package/dateinput/utils.mjs +38 -0
  63. package/datepicker/DatePicker.js +8 -0
  64. package/datepicker/DatePicker.mjs +462 -0
  65. package/datepicker/ToggleButton.js +8 -0
  66. package/datepicker/ToggleButton.mjs +13 -0
  67. package/daterangepicker/DateRangePicker.js +8 -0
  68. package/daterangepicker/DateRangePicker.mjs +426 -0
  69. package/datetimepicker/DateTimePicker.js +8 -0
  70. package/datetimepicker/DateTimePicker.mjs +475 -0
  71. package/datetimepicker/DateTimeSelector.js +8 -0
  72. package/datetimepicker/DateTimeSelector.mjs +275 -0
  73. package/dist/cdn/js/kendo-react-dateinputs.js +8 -21
  74. package/hooks/usePickerFloatingLabel.js +8 -0
  75. package/hooks/usePickerFloatingLabel.mjs +31 -0
  76. package/index.d.mts +4528 -5
  77. package/index.d.ts +4528 -39
  78. package/index.js +8 -21
  79. package/index.mjs +114 -6540
  80. package/messages/index.js +8 -0
  81. package/messages/index.mjs +59 -0
  82. package/package-metadata.js +8 -0
  83. package/package-metadata.mjs +19 -0
  84. package/package.json +7 -7
  85. package/timepicker/TimeList.js +14 -0
  86. package/timepicker/TimeList.mjs +230 -0
  87. package/timepicker/TimePart.js +8 -0
  88. package/timepicker/TimePart.mjs +267 -0
  89. package/timepicker/TimePicker.js +8 -0
  90. package/timepicker/TimePicker.mjs +479 -0
  91. package/timepicker/TimeSelector.js +8 -0
  92. package/timepicker/TimeSelector.mjs +250 -0
  93. package/timepicker/models/TimePart.js +8 -0
  94. package/timepicker/models/TimePart.mjs +18 -0
  95. package/timepicker/services/DOMService.js +8 -0
  96. package/timepicker/services/DOMService.mjs +34 -0
  97. package/timepicker/services/DayPeriodService.js +8 -0
  98. package/timepicker/services/DayPeriodService.mjs +89 -0
  99. package/timepicker/services/HoursService.js +8 -0
  100. package/timepicker/services/HoursService.mjs +92 -0
  101. package/timepicker/services/MinutesService.js +8 -0
  102. package/timepicker/services/MinutesService.mjs +91 -0
  103. package/timepicker/services/SecondsService.js +8 -0
  104. package/timepicker/services/SecondsService.mjs +91 -0
  105. package/timepicker/utils.js +8 -0
  106. package/timepicker/utils.mjs +91 -0
  107. package/utils.js +8 -0
  108. package/utils.mjs +111 -0
  109. package/virtualization/Virtualization.js +8 -0
  110. package/virtualization/Virtualization.mjs +204 -0
  111. package/virtualization/services/RowHeightService.js +8 -0
  112. package/virtualization/services/RowHeightService.mjs +50 -0
  113. package/virtualization/services/ScrollerService.js +8 -0
  114. package/virtualization/services/ScrollerService.mjs +52 -0
  115. package/PopupSettings.d.ts +0 -18
  116. package/calendar/components/Calendar.d.ts +0 -191
  117. package/calendar/components/CalendarCell.d.ts +0 -39
  118. package/calendar/components/CalendarHeaderTitle.d.ts +0 -32
  119. package/calendar/components/CalendarNavigationItem.d.ts +0 -31
  120. package/calendar/components/CalendarWeekCell.d.ts +0 -29
  121. package/calendar/components/Header.d.ts +0 -58
  122. package/calendar/components/HorizontalViewList.d.ts +0 -71
  123. package/calendar/components/MultiViewCalendar.d.ts +0 -212
  124. package/calendar/components/Navigation.d.ts +0 -80
  125. package/calendar/components/TodayCommand.d.ts +0 -35
  126. package/calendar/components/View.d.ts +0 -89
  127. package/calendar/components/ViewList.d.ts +0 -115
  128. package/calendar/models/ActiveView.d.ts +0 -8
  129. package/calendar/models/CalendarSettings.d.ts +0 -106
  130. package/calendar/models/CalendarViewEnum.d.ts +0 -13
  131. package/calendar/models/CellContext.d.ts +0 -23
  132. package/calendar/models/MultiViewCalendarMode.d.ts +0 -13
  133. package/calendar/models/MultiViewCalendarSettings.d.ts +0 -115
  134. package/calendar/models/NavigationAction.d.ts +0 -19
  135. package/calendar/models/SelectionRange.d.ts +0 -21
  136. package/calendar/models/SelectionRangeEnd.d.ts +0 -8
  137. package/calendar/models/ViewService.d.ts +0 -29
  138. package/calendar/models/index.d.ts +0 -15
  139. package/calendar/services/BusViewService.d.ts +0 -25
  140. package/calendar/services/CenturyViewService.d.ts +0 -29
  141. package/calendar/services/DOMService.d.ts +0 -33
  142. package/calendar/services/DecadeViewService.d.ts +0 -31
  143. package/calendar/services/MonthViewService.d.ts +0 -37
  144. package/calendar/services/NavigationService.d.ts +0 -18
  145. package/calendar/services/ScrollSyncService.d.ts +0 -25
  146. package/calendar/services/WeekNamesService.d.ts +0 -13
  147. package/calendar/services/YearViewService.d.ts +0 -35
  148. package/calendar/services/index.d.ts +0 -14
  149. package/common/AdaptiveMode.d.ts +0 -25
  150. package/common/PickerWrap.d.ts +0 -22
  151. package/common/constants.d.ts +0 -8
  152. package/dateinput/DateInput.d.ts +0 -355
  153. package/dateinput/models/DateInputSettings.d.ts +0 -103
  154. package/dateinput/models/format-placeholder.d.ts +0 -43
  155. package/dateinput/models/incremental-steps.d.ts +0 -15
  156. package/dateinput/models/index.d.ts +0 -11
  157. package/dateinput/models/kendo-date.d.ts +0 -57
  158. package/dateinput/models/mask.d.ts +0 -11
  159. package/dateinput/models/selection.d.ts +0 -11
  160. package/dateinput/utils.d.ts +0 -34
  161. package/datepicker/DatePicker.d.ts +0 -358
  162. package/datepicker/ToggleButton.d.ts +0 -14
  163. package/datepicker/models/DatePickerSettings.d.ts +0 -141
  164. package/datepicker/models/index.d.ts +0 -6
  165. package/daterangepicker/DateRangePicker.d.ts +0 -354
  166. package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +0 -10
  167. package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +0 -10
  168. package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +0 -10
  169. package/daterangepicker/models/DateRangePickerSettings.d.ts +0 -126
  170. package/daterangepicker/models/index.d.ts +0 -9
  171. package/datetimepicker/DateTimePicker.d.ts +0 -342
  172. package/datetimepicker/DateTimeSelector.d.ts +0 -106
  173. package/datetimepicker/models/DateTimePickerSettings.d.ts +0 -144
  174. package/datetimepicker/models/index.d.ts +0 -6
  175. package/hooks/usePickerFloatingLabel.d.ts +0 -24
  176. package/messages/index.d.ts +0 -124
  177. package/package-metadata.d.ts +0 -9
  178. package/timepicker/TimeList.d.ts +0 -91
  179. package/timepicker/TimePart.d.ts +0 -141
  180. package/timepicker/TimePicker.d.ts +0 -355
  181. package/timepicker/TimeSelector.d.ts +0 -144
  182. package/timepicker/models/IncrementalSteps.d.ts +0 -12
  183. package/timepicker/models/ListItem.d.ts +0 -11
  184. package/timepicker/models/ListService.d.ts +0 -19
  185. package/timepicker/models/ListServiceSettings.d.ts +0 -16
  186. package/timepicker/models/TimePart.d.ts +0 -14
  187. package/timepicker/models/TimePickerSettings.d.ts +0 -133
  188. package/timepicker/models/index.d.ts +0 -11
  189. package/timepicker/services/DOMService.d.ts +0 -14
  190. package/timepicker/services/DayPeriodService.d.ts +0 -51
  191. package/timepicker/services/HoursService.d.ts +0 -37
  192. package/timepicker/services/MinutesService.d.ts +0 -36
  193. package/timepicker/services/SecondsService.d.ts +0 -36
  194. package/timepicker/services/index.d.ts +0 -10
  195. package/timepicker/utils.d.ts +0 -60
  196. package/utils.d.ts +0 -100
  197. package/virtualization/Virtualization.d.ts +0 -120
  198. package/virtualization/services/RowHeightService.d.ts +0 -22
  199. package/virtualization/services/ScrollerService.d.ts +0 -53
  200. package/virtualization/services/index.d.ts +0 -7
@@ -1,21 +1,8 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- (function(p,Ft){typeof exports=="object"&&typeof module!="undefined"?Ft(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-react-popup"),require("@progress/kendo-react-layout")):typeof define=="function"&&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-react-popup","@progress/kendo-react-layout"],Ft):(p=typeof globalThis!="undefined"?globalThis:p||self,Ft(p.KendoReactDateinputs={},p.React,p.PropTypes,p.KendoReactCommon,p.KendoDateMath,p.KendoReactIntl,p.KendoReactButtons,p.KendoSvgIcons,p.KendoReactLabels,p.KendoReactPopup,p.KendoReactLayout))})(this,function(p,Ft,n,d,l,x,L,J,Ye,Wt,ht){"use strict";"use client";function Ti(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const o=Ti(Ft),ft={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},ji=(i,t,e)=>[...i.slice(0,t+1),...i.slice(t+1).map(s=>s+e)];class Zi{constructor(t=0,e,s){this.total=t,this.rowHeight=e,this.detailRowHeight=s,this.offsets=[],this.heights=[];let a=0;for(let r=0;r<t;r++)this.offsets.push(a),a+=e,this.heights.push(e)}height(t){return this.heights[t]}expandDetail(t){this.height(t)===this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight)}collapseDetail(t){this.height(t)>this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight*-1)}index(t){for(let e=0;e<this.offsets.length;e++){if(t===this.offsets[e])return e;if(t<this.offsets[e])return e-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){return this.heights.reduce((t,e)=>t+e,0)}updateRowHeight(t,e){this.heights[t]+=e,this.offsets=ji(this.offsets,t,e)}}const Kt=i=>Math.max(i,0);class re{constructor(t){this.offset=t}}class le{constructor(t){this.skip=t}}class Gi{constructor(t,e){this.onScrollAction=t,this.onPageAction=e,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(t,e,s,a,r=0,h=0,u="vertical"){this.rowHeightService=t,this.firstLoaded=e,this.lastLoaded=e+s,this.take=s,this.total=a,this.lastScrollTop=0,this.topOffset=r,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(r),m=Kt(e-c);this.onScrollAction(new re(this.rowOffset(m))),this.onPageAction(new le(m))}onScroll({scrollLeft:t,scrollTop:e,offsetHeight:s,offsetWidth:a}){const r=this.direction==="vertical"?e:t,h=this.direction==="vertical"?s:a;if(this.lastScrollTop===r||!this.rowHeightService)return;const u=this.lastScrollTop>=r;this.lastScrollTop=r;const c=this.rowHeightService.index(Kt(r-this.topOffset)),m=this.rowHeightService.index(Kt(r+h-this.bottomOffset));if(!u&&m>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new re(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new le(this.firstLoaded))),u&&c<=this.firstLoaded){const f=Math.floor(this.take*.3);this.firstLoaded=Kt(c-f),this.onScrollAction(new re(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new le(this.firstLoaded))}}rowOffset(t){return this.rowHeightService?this.rowHeightService.offset(t)+this.topOffset:0}rowsForHeight(t){return this.rowHeightService?Math.ceil(t/this.rowHeightService.height(0)):0}}const Xi=(i,t,e)=>Math.min(Math.abs(t-i),e),Ji=17,Qi=10,Pi={[1]:i=>t=>t+i,[0]:i=>t=>t-i},ts={[1]:i=>t=>Math.min(t,i),[0]:i=>t=>Math.max(t,i)},es={[1]:i=>t=>t<i,[0]:i=>t=>t>i},Ut=class extends o.Component{constructor(i){super(i),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const e=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const s=this.scrollContainer[e];this.restrictScroll&&e==="scrollTop"&&(!Number.isInteger(s)||!Number.isInteger(t))&&Math.abs(s-t)<Qi||(this.scrollContainer[e]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const e=this.rowHeightService.offset(t),s=this.getContainerScrollDirection(e);let{start:a,end:r}=this.scrollRange(e,s);if(a===r)return;const h=this.scrollStep(a,r),u=Pi[s](h),c=ts[s](r),m=es[s](u(r)),f=g=>{this.animationInProgress=!0;const w=u(g);this.scrollTo(c(w)),m(w)?this.cancelAnimation=window.requestAnimationFrame(()=>{f(w)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{f(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,e)=>{const s=this.props.scrollDuration||Ut.defaultProps.scrollDuration;return Math.abs(e-t)/(s/Ji)},this.scrollRange=(t,e)=>{const s=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${s}`,10))return{start:t,end:t};const a=this.containerMaxScroll(),r=e===0?1:-1,h=Xi(s,t,this.props.maxScrollDifference||0),u=Math.min(t,a);return{start:Math.min(Math.max(u+r*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const e=this.direction==="vertical"?t.itemHeight:t.itemWidth;e!==void 0&&(this.rowHeightService=new Zi(t.total,e,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const e=t.target;this.scrollerService.onScroll({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,offsetHeight:e.offsetHeight,offsetWidth:e.offsetWidth});const s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,r={index:s,target:e,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),a&&a.call(void 0,r),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new Gi(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(o.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:Ut.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Ut.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(i){return this.rowHeightService?this.rowHeightService.index(i):0}itemOffset(i){return this.rowHeightService?this.rowHeightService.offset(i):0}isIndexVisible(i){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,e=t+this.containerOffsetSize,s=this.rowHeightService.offset(i),a=s+this.rowHeightService.height(i);return s>=t&&a<=e}isListScrolled(i){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(i):!1}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const i=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${i}px`}:{width:`${i}px`},e=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),s=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return o.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:e,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,o.createElement("div",{style:t,className:s}))}};let gt=Ut;gt.propTypes={bottomOffset:n.number.isRequired,className:n.string,direction:n.oneOf(["horizontal","vertical"]),forceScroll:n.bool,itemHeight:n.number,itemWidth:n.number,maxScrollDifference:n.number,onScroll:n.func,onScrollAction:n.func,scrollDuration:n.number,scrollOffsetSize:n.number,skip:n.number.isRequired,tabIndex:n.number,take:n.number.isRequired,topOffset:n.number.isRequired,total:n.number.isRequired,role:n.string},gt.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const is=(i,t)=>{const e=Object.getOwnPropertyNames(i),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let a=0;a<e.length;a++){const r=e[a];if(i[r]!==t[r])return!1}return!0};class $e extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:a,...r}=t;return!((!(e&&a)||e.getTime()===a.getTime())&&is(s,r))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:a,isInRange:r,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:m,isRangeSplitStart:f,isRangeSplitEnd:g,isToday:w,isDisabled:v,view:E,value:O,...N}=this.props,S=this.props.activeRangeEnd==="end"&&m,y=this.props.activeRangeEnd==="start"&&u,b=d.classNames("k-calendar-td",{"k-range-end":m,"k-range-mid":c,"k-range-split-end":g,"k-range-split-start":f,"k-range-start":u,"k-active":y||S,"k-state-pending-focus":a,"k-selected":h||u||m,"k-today":w,"k-weekend":s,"k-disabled":v},t);return o.createElement("td",{...N,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o.createElement("span",{className:"k-link"},this.props.children))}}class Te extends o.Component{render(){const{className:t,firstDate:e,...s}=this.props;return o.createElement("td",{className:d.classNames("k-calendar-td",t),...s},this.props.children)}}var D=(i=>(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i[i.PrevView=4]="PrevView",i[i.NextView=5]="NextView",i[i.FirstInView=6]="FirstInView",i[i.LastInView=7]="LastInView",i[i.LowerView=8]="LowerView",i[i.UpperView=9]="UpperView",i))(D||{}),C=(i=>(i[i.month=0]="month",i[i.year=1]="year",i[i.decade=2]="decade",i[i.century=3]="century",i))(C||{});const q={start:null,end:null};function et(i){const t=(s,a,r,...h)=>a[r]===null?null:(s?i.isRequired:i)(a,r,...h),e=t.bind(null,!1);return e.isRequired=t.bind(null,!0),e}const Yt=(i,t,e)=>t===void 0||e===void 0||t<=i&&i<=e?i:i<t?t:e,B=new Date(1980,0,1),it=new Date(1900,0,1),st=new Date(2099,11,31),ct=new Date(1980,0,1),nt=new Date(1980,0,1,23,59,59),R=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e},z=()=>l.getDate(new Date),A=(i,t,e)=>!i||!(t&&t>i||e&&e<i),je=(i,t,e)=>i===null||!(t&&l.getDate(t)>l.getDate(i)||e&&l.getDate(e)<l.getDate(i)),$t=(i,t)=>{const{start:e,end:s}=t||q;return!e||!s?!1:e<i&&i<s},T=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Ze=(i,t,e)=>t.getTime()<=i.getTime()&&i.getTime()<=e.getTime(),Ge=(i,t)=>i.slice(t).concat(i.slice(0,t)),Y=(i,t,e)=>i&&(t&&i<t?l.cloneDate(t):e&&i>e?l.cloneDate(e):i),$=i=>(t,e="",s={})=>{const a=document.createElement(i);return a.className=e,Object.keys(s).map(r=>a.style[r]=s[r]),typeof t=="string"?a.innerHTML=t||"":(t||[]).forEach(r=>r&&a.appendChild(r)),a};function ss(i,t,e={}){let s,a;e.maxWait;let r,h,u;const c=window;let m=!1,f=!1;const g=!t&&t!==0&&typeof c.requestAnimationFrame=="function";if(typeof i!="function")throw new TypeError("Expected a function");t=+t||0;function w(V){const _=s,tt=a;return s=a=void 0,r=i.apply(tt,_),r}function v(V,_){return g?(c.cancelAnimationFrame(h),c.requestAnimationFrame(V)):setTimeout(V,_)}function E(V){if(g)return c.cancelAnimationFrame(V);clearTimeout(V)}function O(V){return h=v(y,t),m?w():r}function N(V){const _=V-u;return t-_}function S(V){const _=V-u;return u===void 0||_>=t||_<0||f}function y(){const V=Date.now();if(S(V))return b();h=v(y,N(V))}function b(V){return h=void 0,s?w():(s=a=void 0,r)}function K(){h!==void 0&&E(h),s=u=a=h=void 0}function M(){return h===void 0?r:b()}function F(){return h!==void 0}function U(...V){const _=Date.now(),tt=S(_);return s=V,a=this,u=_,tt&&h===void 0?O():(h===void 0&&(h=v(y,t)),r)}return U.cancel=K,U.flush=M,U.pending=F,U}const ns=[[]],oe=4,as=3,rs={[D.Left]:i=>l.addDecades(i,-1),[D.Up]:i=>l.addDecades(i,-5),[D.Right]:i=>l.addDecades(i,1),[D.Down]:i=>l.addDecades(i,5),[D.PrevView]:i=>l.addCenturies(i,-1),[D.NextView]:i=>l.addCenturies(i,1),[D.FirstInView]:i=>l.firstDecadeOfCentury(i),[D.LastInView]:i=>l.lastDecadeOfCentury(i)};class Xe{addToDate(t,e){return l.addCenturies(t,e)}datesList(t,e){return T(0,e).map(s=>l.addCenturies(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return ns;const f=T(0,oe),g=l.firstDecadeOfCentury(m),w=l.lastDecadeOfCentury(m),v=z();return T(0,as).map(E=>{const O=l.addDecades(g,E*oe);return f.map(N=>{const S=this.normalize(l.addDecades(O,N),h,r),y=this.isEqual(S,c.start),b=this.isEqual(S,c.end),M=!y&&!b&&$t(S,c),F=a&&(Array.isArray(u)?this.isSelectedFromArray(S,u,h,r):A(u,h,r)&&this.isEqual(S,u));return Ze(S,g,w)?{formattedValue:this.value(S),id:`${e}${S.getTime()}`,isFocused:this.isEqual(S,s),isSelected:F,isWeekend:!1,isInRange:A(S,h,r),isRangeStart:y,isRangeMid:M,isRangeEnd:b,isRangeSplitEnd:M&&this.isEqual(S,w),isRangeSplitStart:M&&this.isEqual(S,g),isToday:this.isEqual(S,v),title:this.cellTitle(S),value:S}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:l.firstYearOfDecade(t).getFullYear()===l.firstYearOfDecade(e).getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+99}isInRange(t,e,s){const a=l.firstYearOfDecade(t).getFullYear(),r=!e||l.firstYearOfDecade(e).getFullYear()<=a,h=!s||a<=l.firstYearOfDecade(s).getFullYear();return r&&h}isInSameView(t,e){return l.durationInCenturies(t,e)===0}isRangeStart(t){return t.getFullYear()%1e3===0}move(t,e){const s=rs[e];return s?s(t):t}cellTitle(t){return l.firstYearOfDecade(t).getFullYear().toString()}navigationTitle(t){return t?l.firstDecadeOfCentury(t).getFullYear().toString():""}title(t){return t?`${l.firstDecadeOfCentury(t).getFullYear()} - ${l.lastDecadeOfCentury(t).getFullYear()}`:""}rowLength(t){return oe}skip(t,e){return l.durationInCenturies(e,t)}total(t,e){return l.durationInCenturies(t,e)+1}value(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInCenturies(t,e)<s?l.addCenturies(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const ls=[[]],he=4,os=3,hs={[D.Left]:i=>l.addYears(i,-1),[D.Up]:i=>l.addYears(i,-5),[D.Right]:i=>l.addYears(i,1),[D.Down]:i=>l.addYears(i,5),[D.PrevView]:i=>l.addDecades(i,-1),[D.NextView]:i=>l.addDecades(i,1),[D.FirstInView]:i=>l.firstYearOfDecade(i),[D.LastInView]:i=>l.lastYearOfDecade(i)};class Je{addToDate(t,e){return l.addDecades(t,e)}datesList(t,e){return T(0,e).map(s=>l.addDecades(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return ls;const f=T(0,he),g=l.firstYearOfDecade(m),w=l.lastYearOfDecade(m),v=z();return T(0,os).map(E=>{const O=l.addYears(g,E*he);return f.map(N=>{const S=this.normalize(l.addYears(O,N),h,r),y=this.isEqual(S,c.start),b=this.isEqual(S,c.end),M=!y&&!b&&$t(S,c),F=a&&(Array.isArray(u)?this.isSelectedFromArray(S,u,h,r):A(u,h,r)&&this.isEqual(S,u));return Ze(S,g,w)?{formattedValue:this.value(S),id:`${e}${S.getTime()}`,isFocused:this.isEqual(S,s),isSelected:F,isWeekend:!1,isInRange:A(S,h,r),isRangeStart:y,isRangeMid:M,isRangeEnd:b,isRangeSplitEnd:M&&this.isEqual(S,w),isRangeSplitStart:M&&this.isEqual(S,g),isToday:this.isEqual(S,v),title:this.cellTitle(S),value:S}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+9}isInRange(t,e,s){const a=t.getFullYear(),r=!e||e.getFullYear()<=a,h=!s||a<=s.getFullYear();return r&&h}isRangeStart(t){return t.getFullYear()%100===0}isInSameView(t,e){return l.durationInDecades(t,e)===0}move(t,e){const s=hs[e];return s?s(t):t}cellTitle(t){return t.getFullYear().toString()}navigationTitle(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}title(t){return t?`${l.firstYearOfDecade(t).getFullYear()} - ${l.lastYearOfDecade(t).getFullYear()}`:""}rowLength(t){return he}skip(t,e){return l.durationInDecades(e,t)}total(t,e){return l.durationInDecades(t,e)+1}value(t){return t?t.getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInDecades(t,e)<s?l.addDecades(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const cs=[[]],ce=7,us=6,ds=6,ms=0,ps={[D.Left]:i=>l.addDays(i,-1),[D.Up]:i=>l.addWeeks(i,-1),[D.Right]:i=>l.addDays(i,1),[D.Down]:i=>l.addWeeks(i,1),[D.PrevView]:i=>l.addMonths(i,-1),[D.NextView]:i=>l.addMonths(i,1),[D.FirstInView]:i=>l.firstDayOfMonth(i),[D.LastInView]:i=>l.lastDayOfMonth(i)};class Qe{constructor(t){this.intl=t}addToDate(t,e){return l.addMonths(t,e)}datesList(t,e){return T(0,e).map(s=>l.addMonths(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return cs;const f=l.firstDayOfMonth(m),g=l.lastDayOfMonth(m),w=-1,v=l.dayOfWeek(f,this.intl.firstDay(),w),E=T(0,ce),O=z();return T(0,us).map(N=>{const S=l.addDays(v,N*ce);return E.map(y=>{const b=this.normalize(l.addDays(S,y),h,r);if(b<f||b>g)return null;const M=this.isEqual(b,c.start),F=this.isEqual(b,c.end),V=!M&&!F&&$t(b,c),_=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):A(u,h,r)&&this.isEqual(b,u));return{formattedValue:this.value(b),id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:_,isInRange:A(b,h,r),isWeekend:this.isWeekend(b),isRangeStart:M,isRangeMid:V,isRangeEnd:F,isRangeSplitStart:V&&this.isEqual(b,f),isRangeSplitEnd:V&&this.isEqual(b,g),isToday:this.isEqual(b,O),title:this.cellTitle(b),value:b}})})}isEqual(t,e){return!t||!e?!1:l.getDate(t).getTime()===l.getDate(e).getTime()}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isInArray(t,e){return!!e.length&&l.firstDayOfMonth(e[0])<=t&&t<=l.lastDayOfMonth(e[e.length-1])}isInRange(t,e,s){const a=l.getDate(t),r=!e||l.getDate(e)<=a,h=!s||a<=l.getDate(s);return r&&h}isInSameView(t,e){return l.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const s=ps[e];return s?s(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return ce+(t?1:0)}skip(t,e){return l.durationInMonths(e,t)}total(t,e){return l.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,s=1){return l.durationInMonths(t,e)<s?l.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===ds||e===ms}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.getDate(e):t>s&&this.isEqual(t,s)?l.getDate(s):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fs=[[]],ue=4,gs=3,vs=i=>i>4?-5:i<2?-2:-7,ws=i=>i<7?5:i<10?7:2,bs={[D.Left]:i=>l.addMonths(i,-1),[D.Up]:i=>l.addMonths(i,vs(i.getMonth())),[D.Right]:i=>l.addMonths(i,1),[D.Down]:i=>l.addMonths(i,ws(i.getMonth())),[D.PrevView]:i=>l.addYears(i,-1),[D.NextView]:i=>l.addYears(i,1),[D.FirstInView]:i=>l.firstMonthOfYear(i),[D.LastInView]:i=>l.lastMonthOfYear(i)};class Pe{constructor(t){this._intl=t}addToDate(t,e){return l.addYears(t,e)}datesList(t,e){return T(0,e).map(s=>l.addYears(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=q,viewDate:m}=t;if(!m)return fs;const f=this.abbrMonthNames(),g=l.firstMonthOfYear(m),w=l.lastMonthOfYear(m),v=g.getFullYear(),E=T(0,ue),O=z();return T(0,gs).map(N=>{const S=l.addMonths(g,N*ue);return E.map(y=>{const b=this.normalize(l.addMonths(S,y),h,r);if(v<b.getFullYear())return null;const M=this.isEqual(b,c.start),F=this.isEqual(b,c.end),V=!M&&!F&&$t(b,c),_=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):A(u,h,r)&&this.isEqual(b,u));return{formattedValue:f[b.getMonth()],id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:_,isInRange:A(b,h,r),isWeekend:!1,isRangeStart:M,isRangeMid:V,isRangeEnd:F,isRangeSplitEnd:V&&this.isEqual(b,w),isRangeSplitStart:V&&this.isEqual(b,g),isToday:this.isEqual(b,O),title:this.cellTitle(b),value:b}})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{A(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()}isInRange(t,e,s){const a=l.createDate(t.getFullYear(),t.getMonth(),1),r=!e||l.createDate(e.getFullYear(),e.getMonth(),1)<=a,h=!s||a<=l.createDate(s.getFullYear(),s.getMonth(),1);return r&&h}isInSameView(t,e){return l.durationInYears(t,e)===0}isRangeStart(t){return t.getFullYear()%10===0}move(t,e){const s=bs[e];return s?s(t):t}cellTitle(t){return`${t.getFullYear()} ${this.value(t)}`}navigationTitle(t){return this.title(t)}title(t){return t?t.getFullYear().toString():""}rowLength(t){return ue}skip(t,e){return l.durationInYears(e,t)}total(t,e){return l.durationInYears(t,e)+1}value(t){return t?this.abbrMonthNames()[t.getMonth()]:""}viewDate(t,e,s=1){return l.durationInYears(t,e)<s?l.addYears(t,-1):t}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const Ss={[C.month]:Qe,[C.year]:Pe,[C.decade]:Je,[C.century]:Xe},Ds=(i,t)=>{const e=C[C[i+t]];return e!==void 0?e:i};class de{constructor(t){this.bottom=C.month,this.top=C.century,this.onViewChanged=t}configure(t,e){this.bottom=t,this.top=e}service(t,e){return new Ss[`${t}`](e)}moveDown(t,e){this.move(t,-1,e)}moveUp(t,e){this.move(t,1,e)}moveToBottom(t){t!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(t){return this.bottom<t}canMoveUp(t){return t<this.top}clamp(t){return t<this.bottom?this.bottom:t>this.top?this.top:t}move(t,e,s){const a=this.clamp(Ds(t,e));a!==t&&this.onViewChanged({view:a},s)}}let ti=class{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(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=$("div"),s=$("ul"),a=$("li"),r=$("td"),h=$("th"),u=$("tr"),c=$("tbody"),m=$("thead"),f=$("table"),g=()=>e(`
6
- <span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">
7
- <span className="k-button-text">March 2017</span>
8
- </span>
9
- <span class="k-spacer"></span>
10
- <span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>
11
- `,"k-calendar-header k-hstack"),w=()=>f([m([u([h("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),v=(I,H)=>new Array(I).fill("1").map(H),E=(I,H=1)=>f([c([u([r("1","k-calendar-td k-alt")])].concat(v(I,()=>u(v(H,_t=>r(`<span class="k-link">${_t}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),O=I=>e(I,"k-content k-scrollable"),N=(I,H,_t)=>e(_t?[g(),w(),O([I,I])]:[g(),O([I,I])],H,{left:"-10000px",position:"absolute"}),S=(()=>{let I;return()=>d.canUseDOM?(I||(I=e([O([s([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),I):null})(),y=({cells:I,rows:H},_t,fn)=>{let Ue;return()=>d.canUseDOM?(Ue||(Ue=N(E(H,I),_t,fn)),Ue):null},b=I=>I.querySelector(".k-scrollable"),K=I=>{const H=b(I);return H.className=`${H.className} k-scrollable-horizontal`,I},M=y({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),F=y({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),U=y({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),V=()=>K(M()),_=()=>K(F()),tt=()=>K(U()),X=I=>parseFloat(window.getComputedStyle(I).height)||I.offsetHeight,pt=I=>{const H=window.getComputedStyle(I);return parseFloat(H.width)+parseFloat(H.paddingLeft)+parseFloat(H.paddingRight)||I.offsetWidth},Mt=I=>I.querySelector("tbody");this.didCalculate=!0,t&&(this.hostContainer=t),this.batch(M(),I=>{const H=Mt(I);this.calendarHeight=X(I),this.monthViewHeight=X(H),this.headerHeight=X(H.children[0]),this.scrollableContentHeight=X(b(I))}),this.batch(V(),I=>{const H=Mt(I);this.calendarWidth=pt(I),this.monthViewWidth=pt(H),this.scrollableContentWidth=pt(b(I))}),this.batch(F(),I=>{this.yearViewHeight=X(Mt(I)),this.scrollableYearContentHeight=X(b(I))}),this.batch(_(),I=>{this.yearViewWidth=pt(Mt(I))}),this.batch(U(),I=>{this.decadeViewHeight=X(Mt(I)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(tt(),I=>{this.decadeViewWidth=pt(Mt(I)),this.centuryViewWidth=this.decadeViewWidth}),this.batch(S(),I=>{this.navigationItemHeight=X(I.querySelector("li"))})}viewHeight(t){return this.viewDimension(t,"height")}viewWidth(t){return this.viewDimension(t,"width")}viewDimension(t,e){const s=e==="height"?"ViewHeight":"ViewWidth";switch(t){case C.month:return this[`month${s}`];case C.year:return this[`year${s}`];case C.decade:return this[`decade${s}`];case C.century:return this[`century${s}`];default:return 1}}batch(t,e){const s=this.hostContainer||document.body,a=s.appendChild(t);e(a),s.removeChild(a)}};const Is={33:D.PrevView,34:D.NextView,35:D.LastInView,36:D.FirstInView,37:D.Left,38:D.Up,39:D.Right,40:D.Down,"meta+38":D.UpperView,"meta+40":D.LowerView};class me{constructor(t){this.bus=t}action(t){const e=`${t.ctrlKey||t.metaKey?"meta+":""}${t.keyCode}`;return Is[e]}move(t,e,s,a,r){return a?e===D.UpperView&&this.bus.canMoveUp(s)?(this.bus.moveUp(s,r),t):e===D.LowerView&&this.bus.canMoveDown(s)?(this.bus.moveDown(s,r),t):a.move(t,e):t}}const xs=i=>t=>Math.floor(t/i),Cs=i=>t=>t*i;class ei{constructor(t){this.dom=t,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(t){const e=Math.max(this.dom.viewHeight(t)/this.dom.navigationItemHeight,1);this.divideByMagnitude=xs(e),this.powerByMagnitude=Cs(e)}sync(t,e,s){if(!(!t||!e)){if(this.navigator=t,this.view=e,s.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(s.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(t){const e=this.siblingComponent(t),s=this.calculateScroll(e,t.scrollTop);e.scrollTo(s)}siblingComponent(t){return this.navigator.element===t?this.view:this.navigator}calculateScroll(t,e){const s=t===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return s?s(e):0}}class ii{constructor(t){this.intl=t}getWeekNames(t=!1){const e=Ge(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return t?[""].concat(e):e}}const si=i=>o.createElement("td",{key:i,className:"k-calendar-td"}," "),ni=class extends o.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(i,t)=>{if(!this.firstDate(i))return si(`week-cell-${t}`);const s=this.firstDate(i),a=this.getWeekNumber(s),r=`kendo-react-calendar-week-cell-${a}`,h={className:"k-alt",value:a,firstDate:s};return this.props.weekCell?o.createElement(this.props.weekCell,{...h,key:r},a):o.createElement(Te,{...h,key:r},a)},this.buildRow=i=>i.map((t,e)=>{if(!t)return si(e);const s={"aria-selected":t.isSelected},a=`kendo-react-calendar-cell-${t.value.getTime()}`,r={...s,...t,isDisabled:!t.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?o.createElement(this.props.cell,{...r,key:a},t.formattedValue):o.createElement($e,{...r,key:a},t.formattedValue)}),this.firstDate=i=>{const t=this.firstWeekDateContext(i);return t?t.value:null},this.firstWeekDateContext=i=>{if(!this.weekNumber)return null;let t=0,e=i[t];for(;!e&&t<i.length;)e=i[++t];return e},this.handleClick=(i,t)=>{const{onChange:e}=this.props;if(e&&t){const s={value:l.cloneDate(i),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};e.call(void 0,s)}},this.handleMouseEnter=i=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,l.cloneDate(i))},this.handleMouseLeave=i=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,l.cloneDate(i))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===C.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===C.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:ni.defaultProps.selectedDate}render(){this.intl=x.provideIntlService(this),this.weekService=new ii(this.intl);const i=this.weekService.getWeekNames(this.weekNumber),t=this.props.service.rowLength(this.weekNumber),e=this.props.service.title(this.props.viewDate),s=z(),a=R(this.props.viewDate,s),r=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return o.createElement(o.Fragment,null,this.isMonthView&&this.isHorizontal&&o.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},o.createElement("tr",{role:"row",className:"k-calendar-tr"},i.map((h,u)=>o.createElement("th",{key:u,className:"k-calendar-th"},h)))),o.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&o.createElement("tr",{role:"presentation",className:"k-calendar-tr"},o.createElement("th",{scope:"col",colSpan:t,className:"k-calendar-caption"},e)),r.map((h,u)=>o.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(h,u),this.buildRow(h)))))}getWeekNumber(i){return!this.weekNumber||!this.intl?null:l.weekInYear(i,this.intl.firstDay())}};let Lt=ni;Lt.propTypes={activeRangeEnd:n.oneOf(["start","end",null]),activeView:n.number.isRequired,cellUID:n.string.isRequired,direction:n.oneOf(["horizontal","vertical"]),focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,selectedDate:n.oneOfType([n.instanceOf(Date),n.arrayOf(n.instanceOf(Date))]),showWeekNumbers:n.bool,viewDate:n.instanceOf(Date).isRequired},Lt.defaultProps={direction:"vertical",selectedDate:z(),showWeekNumbers:!1},x.registerForIntl(Lt);class ai extends o.PureComponent{render(){const{view:t,...e}=this.props;return o.createElement(L.Button,{type:"button",fillMode:"flat",...e},this.props.children)}}const Tt=class extends o.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const i=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),e=this.props.service.addToDate(this.props.currentDate,i);return i<1||!this.props.service.isInRange(e,this.min,this.max)?t:`${t} - ${this.props.service.title(e)}`},this.handleTitleClick=i=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,i)}}get min(){return this.props.min!==void 0?this.props.min:Tt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Tt.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:Tt.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const i=this.getTitle(),t=d.classNames("k-calendar-title"),e={children:i,value:i,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},s=this.props.headerTitle?o.createElement(this.props.headerTitle,{...e},i):o.createElement(ai,{...e},i);return o.createElement("div",{className:d.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},s,o.createElement("span",{className:"k-spacer"}),o.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};let vt=Tt;vt.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number},vt.defaultProps={rangeLength:1,min:it,max:st},x.registerForLocalization(vt);const pe="multiviewcalendar.prevView",fe="multiviewcalendar.nextView",wt="dateinput.increment",bt="dateinput.decrement",jt="calendar.today",Zt="datepicker.toggleCalendar",St="daterangepicker.swapStartEnd",Gt="daterangepicker.start",Xt="daterangepicker.end",Jt="daterangepicker.separator",Dt="datetimepicker.toggleDateTimeSelector",ge="timepicker.now",ve="timepicker.selectNow",Qt="timepicker.cancel",At="timepicker.set",we="timepicker.toggleTimeSelector",Pt="timepicker.toggleClock",be="datetimepicker.date",Se="datetimepicker.time",Ht="datetimepicker.cancel",Bt="datetimepicker.set",De="daterangepicker.cancel",Ie="daterangepicker.set",k={[jt]:"TODAY",[ge]:"NOW",[At]:"Set",[Qt]:"Cancel",[be]:"Date",[Se]:"Time",[Ht]:"Cancel",[Bt]:"Set",[De]:"Cancel",[Ie]:"Set",[Gt]:"Start",[Xt]:"End",[Jt]:" ",[ve]:"Select Now",[we]:"Toggle TimeSelector",[Pt]:"Toggle Clock",[wt]:"Increase value",[bt]:"Decrease value",[Zt]:"Toggle calendar",[pe]:"Navigate to previous view",[fe]:"Navigate to next view",[St]:"Swap start and end values",[Dt]:"Toggle date-time selector"},xe=class extends o.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=i=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:i,nativeEvent:i.nativeEvent,value:Y(z(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:xe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:xe.defaultProps.max}get todayIsInRange(){return A(z(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=x.provideLocalizationService(this);const i=this.localization.toLanguageString(jt,k[jt]),t=d.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return o.createElement(L.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},i)}};let It=xe;It.propTypes={max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onClick:n.func,disabled:n.bool},It.defaultProps={min:it,max:st},x.registerForLocalization(It);const Es=5,ri=class extends o.Component{constructor(i){super(i),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.focusActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus"),e=this._element.querySelector(".k-state-pending-focus");t&&t[0]&&t[0].classList.remove("k-focus"),e&&e.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus");t&&t.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=t=>{if(this.virtualization=t,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=Y(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildMonthView=(t,e)=>o.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},o.createElement("colgroup",null,t.map((s,a)=>o.createElement("col",{key:a}))),o.createElement("thead",{className:"k-calendar-thead"},o.createElement("tr",{className:"k-calendar-tr"},e.map((s,a)=>o.createElement("th",{key:a,className:"k-calendar-th"},s))))),this.buildDates=(t,e)=>{const s=this.props.cellUID;return o.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":s+this.props.focusedDate.getTime()},o.createElement("colgroup",null,t.map((a,r)=>o.createElement("col",{key:r}))),e.map(a=>o.createElement(Lt,{ref:r=>{this.calendarView||(this.calendarView=r)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:s,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})))},this.calculateHeights=()=>{if(!this.props.dom)return;const t=this.props.activeView===C.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=t-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=(t,e)=>Math.min(e-t,this.take),this.handleScrollAction=({index:t,scrollAction:e,pageAction:s})=>{const a=s?s.skip:this.state.skip;if((this.state.index!==t||this.state.skip!==a)&&this.setState({index:t,skip:a}),this.table&&e){const r=`translateY(${e.offset}px)`;this.table.style.transform=r}},this.handleTodayClick=t=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,t,!0)},this.handleDateChange=(t,e=!1)=>{const{onChange:s}=this.props;if(s){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:l.cloneDate(t.value),target:this,isTodayClick:e};s.call(void 0,a)}},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(){this.intl=x.provideIntlService(this);const i=Ge(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(i):i}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===C.month)}get take(){return this.props.take!==void 0?this.props.take:ri.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return A(z(),l.getDate(this.props.min),l.getDate(this.props.max))}componentDidUpdate(i,t){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const i=this.lastView!==this.props.activeView,t=Y(this.props.focusedDate,this.props.min,this.props.max),e=i?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),a=this.getTake(e,s),r=this.props.service.addToDate(this.props.min,e),h=this.props.service.addToDate(this.props.min,this.state.index),u=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),c=this.props.activeView!==this.lastView;this.animateToIndex=!c,(c||!l.isEqualDate(this.lastFocus,t)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(t,this.props.min)),this.lastFocus=t;const m=d.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===C.month,"k-calendar-yearview":this.props.activeView===C.year,"k-calendar-decadeview":this.props.activeView===C.decade,"k-calendar-centuryview":this.props.activeView===C.century}),f=this.buildDates(u,this.props.service.datesList(r,a)),g=o.createElement(o.Fragment,null,o.createElement(vt,{key:"calendar-view-list-header",currentDate:h,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:o.createElement(o.Fragment,null,o.createElement(It,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===C.month&&this.buildMonthView(u,this.weekNames),o.createElement(gt,{key:"calendar-view-list-content",skip:e,take:this.take,total:s,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:f,tabIndex:this.props.tabIndex}));return o.createElement("div",{ref:w=>{this._element=w},className:m},this.props.dom.didCalculate?g:null)}};let zt=ri;zt.propTypes={activeView:n.number.isRequired,bottomOffset:n.number,cellUID:n.string.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,showWeekNumbers:n.bool,smoothScroll:n.bool,take:n.number,value:n.instanceOf(Date),viewHeight:n.number,viewOffset:n.number,tabIndex:n.number},zt.defaultProps={take:Es,showWeekNumbers:!1,smoothScroll:!0},x.registerForIntl(zt);class li extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)}}render(){const{isRangeStart:t,value:e,text:s,...a}=this.props;return o.createElement("li",{...a,onClick:this.handleClick},o.createElement("span",{className:d.classNames({"k-calendar-navigation-marker":t})},this.props.children))}}const Vs=30,oi=class extends o.Component{constructor(i){super(i),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=s=>{if(this.virtualization=s,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const a=Y(this.props.focusedDate,this.props.min,this.props.max),r=this.props.service.skip(a,this.props.min);this.virtualization.scrollToIndex(r)}},this.buildNavigationItem=s=>{const a=this.props.service.navigationTitle(s),r=this.props.service.isRangeStart(s),h=`kendo-react-calendar-nav-item-${s.getTime()}`,u={text:a,value:s,isRangeStart:r,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?o.createElement(this.props.navigationItem,{...u,key:h},a):o.createElement(li,{...u,key:h},a)},this.calculateHeights=()=>{const s=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(s-this.itemHeight)/2,this.bottomOffset=s-this.itemHeight},this.handleDateChange=(s,a)=>{const{onChange:r}=this.props;if(r&&a){const h={value:l.cloneDate(s),target:this,nativeEvent:a&&a.nativeEvent,syntheticEvent:a};r.call(void 0,h)}},this.handleScrollAction=({scrollAction:s,pageAction:a})=>{const r=a?a.skip:this.state.skip;if(this.state.skip!==r&&this.setState({skip:r}),this.list&&s){const h=`translateY(${s.offset}px)`;this.list.style.transform=h}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),e=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,e)>0?t:0}}get take(){return this.props.take!==void 0?this.props.take:oi.defaultProps.take}componentDidUpdate(i,t){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){this.calculateHeights();const i=this.lastView!==this.props.activeView,t=Y(this.props.focusedDate,this.props.min,this.props.max),e=i?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),a=this.getTake(e,s),r=this.props.service.addToDate(this.props.min,e),h=this.props.service.datesList(r,a);(this.props.activeView!==this.lastView||!l.isEqual(t,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(t,this.props.min));const u=o.createElement(gt,{skip:e,take:this.take,total:s,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},o.createElement("ul",{ref:c=>{this.list=c},className:"k-reset"},h.map(c=>this.buildNavigationItem(c))));return o.createElement("div",{className:"k-calendar-navigation"},o.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?u:null)}getTake(i,t){return Math.min(t-i,this.take)}};let Ce=oi;Ce.propTypes={activeView:n.number.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,take:n.number,tabIndex:n.number},Ce.defaultProps={take:Vs};const Ee=i=>i?i.virtualization:null,hi=(i=rt.defaultProps.min,t=rt.defaultProps.max,e,s)=>s!==void 0?s!==null&&A(l.getDate(s),i,t)?s:null:e!==null&&A(l.getDate(e),i,t)?e:null,at=class extends o.Component{constructor(i){super(i),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(Ee(this.Navigation),Ee(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const s=l.cloneDate(e.value);this.setState({focusedDate:s})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const s=l.cloneDate(e.value),a=l.cloneDate(e.value),r=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(r)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:a});return}this.setState({value:s,focusedDate:a}),this.valueDuringOnChange=s;const{onChange:h}=this.props;if(h){const u={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};h.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:a,ctrlKey:r,metaKey:h}=e;if(!(!this.focusedDate||!this.service)){if(a===84&&this.setState({focusedDate:z()}),(r||h)&&(a===d.Keys.left||a===d.Keys.right)){if(this.props.disabled)return;this.didNavigationChange=!0,this.focusedDate.getDate()===31&&this.focusedDate.setDate(30);const u=a===d.Keys.left?this.focusedDate.getMonth()-1:this.focusedDate.getMonth()+1,c=new Date(this.focusedDate.setMonth(u)),m=l.cloneDate(c);this.setState({focusedDate:m})}if(a===d.Keys.enter){if(this.value!==null&&l.isEqualDate(this.focusedDate,this.value)){const c=Y(this.focusedDate,this.min,this.max);Ee(this.calendarViewList).scrollToIndex(this.service.skip(c,this.min))}const u={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(u)}else{const u=Y(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(l.isEqualDate(this.focusedDate,u))return;this.setState({focusedDate:u})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},d.validatePackage(ft);const t=hi(this.min,this.max,this.props.defaultValue||at.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:Yt(C[i.defaultActiveView],this.bottomView,this.topView),focusedDate:Y(i.focusedDate||t||z(),this.min,this.max)},this.dom=new ti,this.bus=new de(this.handleViewChange),this.navigation=new me(this.bus),this.oldValue=t}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get min(){return l.getDate(this.props.min!==void 0?this.props.min:at.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:at.defaultProps.max)}get bottomView(){return C[this.props.bottomView!==void 0?this.props.bottomView:at.defaultProps.bottomView]}get topView(){return C[this.props.topView!==void 0?this.props.topView:at.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{d.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new ei(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(i,t){d.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(){this.props._ref&&this.props._ref(this);const i=this.value!==null&&this.oldValue!==null?!l.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,t=Yt(this.state.activeView,C[this.props.bottomView!==void 0?this.props.bottomView:at.defaultProps.bottomView],C[this.props.topView!==void 0?this.props.topView:at.defaultProps.topView]),e=hi(this.min,this.max,this.value,this.value),s=e?l.getDate(e):null;this.focusedDate=l.getDate(Y(i&&e!==null?e:this.state.focusedDate,this.min,this.max)),this.intl=x.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(t,this.intl);const{smoothScroll:a=Number.parseFloat(o.version)<18}=this.props,r=d.classNames("k-widget k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber,"k-calendar-lg":this.props.mobileMode},this.props.className),h=[this.props.navigation&&o.createElement(Ce,{key:0,ref:u=>{this.Navigation=u},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}),o.createElement(zt,{key:1,ref:u=>{this.calendarViewList=u},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:a,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:s,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return o.createElement("div",{ref:u=>{this._element=u},className:r,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},h)}};let rt=at;rt.displayName="Calendar",rt.propTypes={className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),navigation:n.bool,smoothScroll:n.bool,onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,value:n.instanceOf(Date),weekNumber:n.bool,topView:(i,t,e)=>{const s=i[t],a=i.bottomView;return s&&a&&C[s]<C[a]?new Error(`Invalid prop + ${t} suplied to ${e}.
12
- ${t} can not be smaller than bottomView.
13
- `):null},bottomView:(i,t,e)=>{const s=i[t],a=i.topView;return s&&a&&C[s]>C[a]?new Error(`Invalid prop + ${t} suplied to ${e}.
14
- ${t} can not be bigger than topView.
15
- `):null}},rt.defaultProps={disabled:!1,min:it,max:st,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};const ci=d.createPropsContext(),te=d.withIdHOC(d.withPropsContext(ci,rt));te.displayName="KendoReactCalendar",x.registerForIntl(rt);class Os{constructor(){this.symbols="",this.partMap=[]}}const ks="d",Ns="wide",ys=(i,t,e,s)=>{const a=i[s+i.length-e.length],r=i.substring(0,s+i.length-e.length),h=e.substring(0,s),u=[];if(r===h&&s>0)return u.push([t[s-1],h[s-1]]),u;if(r.indexOf(h)===0&&(h.length===0||t[h.length-1]!==t[h.length])){let c="";h.length===1&&u.push([t[0],h[0]]);for(let m=h.length;m<r.length;m++)t[m]!==c&&t[m]!=="_"&&(c=t[m],u.push([c,""]));return u}if(h.indexOf(r)===0||t[s-1]==="_"){let c=t[0];for(let m=Math.max(0,r.length-1);m<t.length;m++)if(t[m]!=="_"){c=t[m];break}return[[c,h[s-1]]]}return h[h.length-1]===" "||h[h.length-1]===a?[[t[s-1],"_"]]:[[t[s-1],h[s-1]]]},Ms=(i,t)=>(i[t.pattern[0]]=t.type,i),_s=(i,t,e)=>i===null||!(t&&t>i||e&&e<i),Fs=["k-widget","k-dateinput"];class Ls{constructor(t,e,s){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=l.getDate(new Date),this.intlProvider=t,this.formatPlaceholder=e,this.format=s,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(t){t?l.isEqual(t,this._value)||(this._value=l.cloneDate(t),this.modifyExisting(!0)):(this._value=l.getDate(new Date),this.modifyExisting(!1))}hasValue(){const t=(e,s)=>e||s.type!=="literal"&&s.type!=="dayperiod"&&this.getExisting(s.pattern[0]);return this.intl.splitDateFormat(this.format).reduce(t,!1)}getDateObject(){for(let t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return l.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(t){const e=this.dateFormatString(this.value,this.format).symbols;for(let s=0;s<e.length;s++)this.setExisting(e[s],t)}getExisting(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(t,e){switch(t){case"y":this.year=e,e===!1&&this._value.setFullYear(2e3);break;case"M":this.month=e,e===!1&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;default:return}}modifyPart(t,e){let s=l.cloneDate(this.value);switch(t){case"y":s.setFullYear(s.getFullYear()+e);break;case"M":s=l.addMonths(this.value,e);break;case"d":case"E":s.setDate(s.getDate()+e);break;case"h":case"H":s.setHours(s.getHours()+e);break;case"m":s.setMinutes(s.getMinutes()+e);break;case"s":s.setSeconds(s.getSeconds()+e);break;case"a":s.setHours(s.getHours()+12*e);break}this.setExisting(t,!0),this._value=s}parsePart(t,e){if(this.resetLeadingZero(),!e)return this.setExisting(t,!1),{value:null};const s=this.intl.formatDate(this.value,this.format),a=this.dateFormatString(this.value,this.format),r=a.symbols;let h=!1,u="",c="",m="";for(let w=0;w<s.length;w++)r[w]===t?(c+=this.getExisting(t)?s[w]:"0",h=!0):h?m+=s[w]:u+=s[w];let f=null;const g=this.matchMonth(e);for(;c.length>0&&c.charAt(0)==="0";)c=c.slice(1);c.length>=4&&(c="");for(let w=0;w<2;w++){let v=c+e,E=parseInt(v,10);if(f=this.intl.parseDate(u+v+m,this.format),!f&&!isNaN(E)&&!isNaN(parseInt(e,10))){if(t==="M"&&!g){const O=E-1;O>-1&&O<12&&(f=l.cloneDate(this.value),f.setMonth(O),f.getMonth()!==O&&(f=l.lastDayOfMonth(l.addMonths(f,-1))))}t==="y"&&(f=l.createDate(parseInt(v,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date&&f.getDate()!==this.value.getDate()&&(f=l.lastDayOfMonth(l.addMonths(f,-1))))}if(f)return this._value=f,this.setExisting(t,!0),{value:this.value};c=""}return g&&(f=this.intl.parseDate(u+g+m,this.format),f)?(this._value=f,this.setExisting(t,!0),{value:this.value}):(e==="0"&&(this.leadingZero=this.isAbbrMonth(a.partMap,t)?null:{[t]:!0},this.setExisting(t,!1)),{value:null})}symbolMap(t){return this.intl.splitDateFormat(this.format).reduce(Ms,{})[t]}resetLeadingZero(){const t=this.leadingZero!==null;return this.leadingZero=null,t}isAbbrMonth(t,e){const s=this.partPattern(t,e);return s.type==="month"&&s.names}partPattern(t,e){return t.filter(s=>s.pattern.indexOf(e)!==-1)[0]}matchMonth(t){if(this.typedMonthPart+=t.toLowerCase(),this.monthNames.length===0)return"";for(;this.typedMonthPart.length>0;){for(let s=0;s<this.monthNames.length;s++)if(this.monthNames[s].toLowerCase().indexOf(this.typedMonthPart)===0)return this.monthNames[s];const e=parseInt(this.typedMonthPart,10);if(e>=1&&e<=12&&e.toString()===this.typedMonthPart)return this.monthNames[e-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const t=this.intl.splitDateFormat(this.format);for(let e=0;e<t.length;e++)if(t[e].type==="month"&&t[e].names)return this.intl.dateFormatNames(t[e].names);return[]}dateFormatString(t,e){const s=this.intl.splitDateFormat(e),a=[],r=[];for(let u=0;u<s.length;u++){let c=this.intl.formatDate(t,{pattern:s[u].pattern}).length;for(;c>0;)a.push(this.symbols[s[u].pattern[0]]||"_"),r.push(s[u]),c--}const h=new Os;return h.symbols=a.join(""),h.partMap=r,h}merge(t,e){let s="",a="",r=e.symbols;for(let h=r.length-1;h>=0;h--)if(this.knownParts.indexOf(r[h])===-1||this.getExisting(r[h]))s=t[h]+s,a=r[h]+a;else{const u=r[h];for(;h>=0&&u===r[h];)h--;for(h++,this.leadingZero&&this.leadingZero[u]?s="0"+s:s=this.dateFieldName(e.partMap[h])+s;a.length<s.length;)a=r[h]+a}return{text:s,format:a}}dateFieldName(t){const e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:e==="formatPattern"?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))}}const j={dayperiod:"dayperiod",hour:"hour",millisecond:"millisecond",minute:"minute",second:"second"},Ve=i=>(t,e)=>{const s=l.cloneDate(t);return s[i](e),s},ui=[{type:j.hour,getter:i=>i.getHours()},{type:j.minute,getter:i=>i.getMinutes()},{type:j.second,getter:i=>i.getSeconds()},{type:j.millisecond,getter:i=>i.getMilliseconds()}],As=i=>(t,e)=>i(t),Hs=i=>(t,e)=>i(e),Bs=i=>i.reduce((t,e)=>(t[e.type]=e.type,t),{}),zs=i=>t=>i[t.type]?Hs(t.getter):As(t.getter),qs=i=>t=>i.map(zs(Bs(t))),Rs=(i,t,e,s)=>a=>{const r=i(a),h=i(e);return s==="hour"?r-(r-h)%t:a.getTime()<=e.getTime()&&r!==0&&r<=h?Math.ceil(r/t)*t:r-r%t},Ws=i=>(t,e)=>i.map(s=>{const a=Math.floor(t[s.type]);return a?Rs(s.getter,a,e,s.type):s.getter}),Ks=qs(ui),di=Ws(ui),Us=i=>(t,e)=>(t.setHours(...i.map(s=>s(t,e))),t),mi=i=>t=>{const e=l.cloneDate(t);return e.setHours(...i.map(s=>s(e))),e},ee=Ve("setHours"),ie=Ve("setMinutes"),se=Ve("setSeconds"),ut=()=>new Date,Oe=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},ke=(i,t,e)=>({candidateValue:R(B,i),maxValue:l.addDays(R(B,e),t.getHours()<e.getHours()?0:1),minValue:R(B,t)}),Ys=(i,t,e)=>{if(!i||!t||!e)return i;const{candidateValue:s,minValue:a,maxValue:r}=ke(i,t,e);return s<a?R(i,t):s>r?R(i,e):i},Ne=(i,t,e)=>{if(!i||!t||!e)return!0;const{candidateValue:s,minValue:a,maxValue:r}=ke(i,t,e);return a<=s&&s<=r},$s=(i,t,e)=>{if(i===null)return!0;const{candidateValue:s,minValue:a,maxValue:r}=ke(i,t,e);return a<=s&&s<=r},Ts=(i,t)=>{if(i===null||t===null)return!1;const e=R(B,i),s=R(B,t);return e.getTime()<s.getHours()},js=(i,t)=>{if(i===null||t===null)return!1;const e=R(B,i);return R(B,t).getTime()<e.getHours()},Zs="Please enter a valid value!",Z=class extends o.Component{constructor(i){super(i),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||Z.defaultProps.validationMessage)},this.updateOnPaste=t=>{if(!this.element||!this.kendoDate)return;const e=x.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,s=this.value;this.kendoDate.setValue(e),this.triggerChange(t,s)},this.spinnersMouseDown=t=>{t.preventDefault();const e=d.getActiveElement(document);this.element&&e!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=t=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(t),this.paste=!1;return}const{text:e,format:s}=this.kendoDate.getTextAndFormat();this.currentFormat=s;const a=this.value,r=ys(e,this.currentFormat,this.element.value,this.selection.start),h=r.length===1&&r[0][1]==="_";if(!h)for(let u=0;u<r.length;u++)this.kendoDate.parsePart(r[u][0],r[u][1]);r.length&&r[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(r[0][0])),h&&this.switchDateSegment(1),this.triggerChange(t,a)},this.elementClick=t=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=t=>{d.getActiveElement(document)===this.element&&t.preventDefault()},this.wheel=t=>{d.getActiveElement(document)===this.element&&(t.nativeEvent.deltaY<0&&this.increasePart(t),t.nativeEvent.deltaY>0&&this.decreasePart(t))},this.increasePart=t=>{this.modifyDateSegmentValue(1,t)},this.decreasePart=t=>{this.modifyDateSegmentValue(-1,t)},this.elementKeyDown=t=>{if(!t.altKey){switch(t.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,t);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,t);break;default:return}t.preventDefault()}},this.elementOnFocus=t=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=t=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},d.validatePackage(ft),this.state={focused:!1}}get _inputId(){return this.props.id+"-accessibility-id"}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(i,t){this._lastSelectedSymbol&&t.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):this.props.placeholder!==void 0&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:i=Z.defaultProps.size,fillMode:t=Z.defaultProps.fillMode,rounded:e=Z.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const s=x.provideLocalizationService(this),a={...Z.defaultProps,...this.props},{name:r,label:h,id:u}=a,c=this.text,m=c===this.props.placeholder?"":c,f=c===this.props.placeholder?c:void 0,g=u||this._inputId,w=!this.validityStyles||this.validity.valid;let v=[...Fs];this.props.className&&v.push(this.props.className);const E=o.createElement(d.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:O,onBlur:N})=>o.createElement("span",{ref:S=>{this._wrapper=S},style:h?void 0:{width:this.props.width},dir:this.props.dir,className:d.classNames("k-dateinput","k-input",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${t}`]:t,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,"k-invalid":!w,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:O,onBlur:N},o.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:this.props.title!==void 0?this.props.title:c,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",className:"k-input-inner",id:g,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:d.noop,value:m,placeholder:f,name:r,ref:S=>this._element=S}),this.props.children,this.props.spinners&&o.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},o.createElement(L.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:J.caretAltUpIcon,"aria-label":s.toLanguageString(wt,k[wt]),title:s.toLanguageString(wt,k[wt]),onClick:this.increasePart}),o.createElement(L.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:J.caretAltDownIcon,"aria-label":s.toLanguageString(bt,k[bt]),title:s.toLanguageString(bt,k[bt]),onClick:this.decreasePart}))));return h?o.createElement(Ye.FloatingLabel,{label:h,editorId:g,editorValue:c,editorValid:w,editorDisabled:this.props.disabled,children:E,style:{width:this.props.width}}):E}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:Z.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Z.defaultProps.max}get text(){const i={...ot.defaultProps,...this.props},{formatPlaceholder:t=Z.defaultProps.formatPlaceholder,format:e=Z.defaultProps.format,value:s,defaultValue:a}=i;this.kendoDate===null?(this.kendoDate=new Ls(this.intl.bind(this),t,e),this.kendoDate.setValue(s||a||null)):(this.kendoDate.format=e,this.kendoDate.formatPlaceholder=t),s!==void 0&&this.value!==s&&this.kendoDate.setValue(s);const{text:r,format:h}=this.kendoDate.getTextAndFormat();return this.currentFormat=h,i.placeholder!==null&&i.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?i.placeholder:r}get validity(){const i=_s(this.value,this.min,this.max)&&Ne(this.value,this.props.minTime,this.props.maxTime),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;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:this.value===null}}get element(){return this._element}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Z.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Z.defaultProps.required}get wrapper(){return this._wrapper}intl(){return x.provideIntlService(this)}get selection(){let i={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(i={start:this.element.selectionStart,end:this.element.selectionEnd}),i}setSelection(i){this._lastSelectedSymbol=this.currentFormat[i.start],window.requestAnimationFrame(()=>{const t=d.getActiveElement(document);this.element&&t===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(i.start,i.end)})}triggerChange(i,t){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!l.isEqual(t,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:i,nativeEvent:i.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(i){let t=-1,e=0;for(let s=0;s<this.currentFormat.length;s++)this.currentFormat[s]===i&&(e=s+1,t===-1&&(t=s));return t<0&&(t=0),{start:t,end:e}}selectionByIndex(i){let t={start:i,end:i};for(let e=i,s=i-1;e<this.currentFormat.length||s>=0;e++,s--){if(e<this.currentFormat.length&&this.currentFormat[e]!=="_"){t=this.selectionBySymbol(this.currentFormat[e]);break}if(s>=0&&this.currentFormat[s]!=="_"){t=this.selectionBySymbol(this.currentFormat[s]);break}}return t}switchDateSegment(i){const{start:t,end:e}=this.selection;if(t<e&&this.currentFormat[t]!==this.currentFormat[e-1]){this.setSelection(this.selectionByIndex(i>0?t:e-1));return}const s=this.currentFormat[t];let a=t+i;for(;a>0&&a<this.currentFormat.length&&!(this.currentFormat[a]!==s&&this.currentFormat[a]!=="_");)a+=i;if(this.currentFormat[a]==="_")return;let r=a;for(;r>=0&&r<this.currentFormat.length&&this.currentFormat[r]===this.currentFormat[a];)r+=i;a>r&&(r+1!==t||a+1!==e)?this.setSelection({start:r+1,end:a+1}):a<r&&(a!==t||r!==e)&&this.setSelection({start:a,end:r})}modifyDateSegmentValue(i,t){if(!this.kendoDate)return;const e=this.value,s=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(s),r=((this.props.steps||{})[a]||1)*i;this.kendoDate.modifyPart(s,r),this.triggerChange(t,e)}};let lt=Z;lt.displayName="DateInput",lt.propTypes={value:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),width:n.oneOfType([n.string,n.number]),tabIndex:n.number,title:n.string,steps:n.shape({year:n.number,month:n.number,day:n.number,hour:n.number,minute:n.number,second:n.number}),min:n.instanceOf(Date),max:n.instanceOf(Date),disabled:n.bool,spinners:n.bool,name:n.string,dir:n.string,label:n.string,id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,ariaRole:n.string,ariaHasPopup:n.oneOfType([n.bool,n.string]),ariaExpanded:n.oneOfType([n.bool]),onChange:n.func,validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},lt.defaultProps={format:ks,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:Ns,spinners:!1,disabled:!1,max:l.cloneDate(st),min:l.cloneDate(it),minTime:l.cloneDate(ct),maxTime:l.cloneDate(nt),required:!1,validityStyles:!0,validationMessage:Zs,placeholder:null,ariaHasPopup:"grid"};const pi=d.createPropsContext(),ot=d.withIdHOC(d.withPropsContext(pi,lt));ot.displayName="KendoReactDateInput",x.registerForIntl(lt),x.registerForLocalization(lt);const fi=L.Button,gi=o.forwardRef((i,t)=>{const{_ref:e}=i,s=o.useRef(null);o.useImperativeHandle(t,()=>s.current),o.useImperativeHandle(e,()=>s.current);const a=o.useMemo(()=>d.classNames(i.className,"k-picker-wrap"),[i.className]);return o.createElement("span",{ref:s,id:i.id,style:i.style,className:a,tabIndex:i.tabIndex},i.children)}),Gs=i=>{const[t,e]=o.useState(!1),s=()=>{i.current&&e(!!i.current.text)};return o.useEffect(s),{editorValue:t}},ye=i=>{const t=Gs(i.dateInput);return o.createElement(Ye.FloatingLabel,{...i,...t})},vi=500,ne=i=>{const{footer:t,children:e,windowWidth:s=0,navigatable:a,navigatableElements:r,expand:h,animation:u,onClose:c,adaptiveTitle:m,mobileFilter:f}=i,g={navigatable:a||!1,navigatableElements:r||[],expand:h,animation:u!==!1,onClose:c,animationStyles:s<=vi?{top:0,width:"100%",height:"100%"}:void 0,className:s<=vi?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return o.createElement(ht.ActionSheet,{...g},o.createElement(ht.ActionSheetHeader,{className:"k-text-center"},o.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},o.createElement("div",{className:"k-actionsheet-title"},o.createElement("div",null,m)),o.createElement("div",{className:"k-actionsheet-actions"},o.createElement(L.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:J.xIcon,onClick:c}))),f&&o.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},f)),e,t&&o.createElement(ht.ActionSheetFooter,{className:"k-actions k-actions-stretched"},o.createElement(L.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),o.createElement(L.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},ae=768,W=class extends o.Component{constructor(i){super(i),this._element=null,this._dateInput=o.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.nextValue=(t,e)=>t.value!==void 0?t.value:e.value,this.nextShow=(t,e)=>t.show!==void 0?t.show:e.show,this.renderPopup=()=>{const{disabled:t,min:e,max:s,weekNumber:a,focusedDate:r}=this.props,{popupClass:h,...u}=this.props.popupSettings,c=this.show,m=this.value,f=m&&l.getDate(m),g=d.classNames("k-calendar-container k-group k-reset",h),w={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:g,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...u},v={disabled:t,value:f,min:e,max:s,weekNumber:a,focusedDate:r,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?o.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}):o.createElement(this.popupComp,{...w},o.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}))},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=t=>{this.handleValueChange(t.value,t)},this.handleCalendarValueChange=t=>{const e=this.mergeTime(t.value);this.handleValueChange(e,t)},this.handleValueChange=(t,e)=>{this.setState({value:l.cloneDate(t||void 0)}),this.valueDuringOnChange=t,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:s}=this.props;s&&s.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.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},d.validatePackage(ft),this.state={value:this.props.defaultValue||W.defaultProps.defaultValue,show:this.props.defaultShow||W.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:W.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:W.defaultProps.max}get dateInputComp(){return this.props.dateInput||W.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||W.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||W.defaultProps.calendar}get popupComp(){return this.props.popup||W.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||W.defaultProps.pickerWrap}get validity(){const i=je(this.value,this.min,this.max),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;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:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:W.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:W.defaultProps.required}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=W.defaultProps.size,rounded:t=W.defaultProps.rounded,fillMode:e=W.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,format:u,formatPlaceholder:c,min:m,max:f,className:g,width:w,name:v,validationMessage:E,required:O,validityStyles:N,ariaLabelledBy:S,ariaDescribedBy:y,ariaLabel:b}=this.props,K=this.show,M=this.value,F=!this.validityStyles||this.validity.valid,U={disabled:s,format:u,formatPlaceholder:c,id:h,ariaLabelledBy:S,ariaDescribedBy:y,ariaLabel:b,max:f,min:m,name:v,onChange:this.handleInputValueChange,required:O,tabIndex:K?-1:a,title:r,valid:this.validity.valid,validationMessage:E,validityStyles:N,value:M,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},V=x.provideLocalizationService(this).toLanguageString(Zt,k[Zt]),_=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:tt,onBlur:X})=>o.createElement(o.Fragment,null,o.createElement("span",{ref:pt=>{this._element=pt},className:d.classNames("k-input","k-datepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!F,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:w},onFocus:tt,onBlur:X,onClick:this.mobileMode?this.handleIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...U}),o.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:J.calendarIcon,title:V,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":V,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(ye,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:F,editorDisabled:this.props.disabled,children:_,style:{width:this.props.width}}):_}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?R(i,this.value):i}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let xt=W;xt.displayName="DatePicker",xt.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"]),adaptive:n.bool,adaptiveTitle:n.string},xt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:ot,calendar:te,toggleButton:fi,popup:Wt.Popup,pickerWrap:gi,disabled:!1,format:"d",max:st,min:it,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};const wi=d.createPropsContext(),bi=d.withIdHOC(d.withPropsContext(wi,xt));bi.displayName="KendoReactDatePicker",x.registerForLocalization(xt);const Me=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t),e},_e=i=>i!==null&&i<12,Xs=i=>i!==null&&(!i||i>11),Js=(i,t,e)=>!t&&!e||i>=t&&i<=e,Qs=(i,t,e)=>!t&&!e||i>=t||i<=e;class Si{constructor(t){this.intl=t,this.min=null,this.max=null,this.part=null}apply(t,e){const s=t.getHours(),a=_e(s),r=_e(e.getHours());if(a&&r||!a&&!r)return t;const[h,u=24]=this.normalizedRange(),c=s+(r?-12:12);return Me(t,Math.min(Math.max(h,c),u||24))}configure(t){const{min:e=this.min,max:s=this.max,part:a=this.part}=t;this.min=e,this.max=s,this.part=a}data(t){const e=this.part&&this.part.names;if(!e||!this.min)return[];const s=[],[a,r]=this.normalizedRange(),h=this.intl.dateFormatNames(e);return _e(a)&&s.push({text:h.am,value:Me(this.min,a)}),Xs(r)&&s.push({text:h.pm,value:Me(this.min,Math.max(12,r))}),this.min.getHours()!==a?s.reverse():s}isRangeChanged(t,e){return!1}limitRange(t,e,s){return[t,e]}total(){const[t,e]=this.normalizedRange();return!t&&!e?2:t>11||e<12?1:2}selectedIndex(t){if(!this.valueInList(t)||!this.min)return-1;const e=Math.floor(t.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?e:e===0?1:0}valueInList(t){return!this.min||!this.max?!1:(this.min.getHours()!==this.normalizedRange()[0]?Qs:Js)(t.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const t=this.min.getHours(),e=this.max.getHours();return[Math.min(t,e),Math.max(t,e)]}}class Ps{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=$("div"),s=$("span"),a=$("ul"),r=$("li"),h=()=>r("<span>02</span>","k-item"),u=()=>a([h()],"k-reset"),c=()=>e([u()],"k-content k-scrollable k-time-container"),f=(()=>e([s("minute","k-title"),e([c()],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}))(),w=t&&t.querySelector(".k-time-container")||document.body,v=w.appendChild(f);this.timeListHeight=v.querySelector(".k-scrollable").offsetHeight,this.itemHeight=v.querySelector("li").offsetHeight,w.removeChild(v),this.didCalculate=!0}}const Fe=24,Di=(i=>t=>t%i)(Fe),tn=(i,t)=>e=>Di(i+e*t),Ii=(i,t)=>Di(Fe+i-t),xi=i=>(t,e)=>!e||l.getDate(t).getTime()===l.getDate(e).getTime()?t:ee(t,i),en=xi(0),sn=xi(Fe-1);class Ci{constructor(t){this.intl=t,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(t,e){return ee(t,e.getHours())}configure(t){const{boundRange:e=this.boundRange,insertUndividedMax:s=this.insertUndividedMax,min:a=this.min,max:r=this.max,part:h,step:u=this.step}=t;this.boundRange=e,this.insertUndividedMax=s,this.toListItem=c=>{const m=ee(B,c);return{text:this.intl.formatDate(m,h.pattern),value:m}},this.min=a,this.max=r,this.step=u}data(t){const[e]=this.range(t),s=tn(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Oe(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return!this.min||!this.max?!1:!l.isEqual(this.min,t)||!l.isEqual(this.max,e)}limitRange(t,e,s){return this.boundRange?[en(t,s),sn(e,s)]:[t,e]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastHour(t)===t.getHours()||!this.isMissing(t):!0}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastHour(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getHours());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(Ii(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(ee(this.max,this.lastHour(t)))}divideByStep(t){return Ii(t.getHours(),this.min.getHours())/this.step}lastHour(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getHours(),s.getHours()]}}const Le=60,Ei=(i=>t=>t%i)(Le),nn=(i,t)=>e=>Ei(i+e*t),Vi=(i,t)=>Ei(Le+i-t),Oi=i=>(t,e)=>!e||t.getHours()===e.getHours()?t:ie(t,i),an=Oi(0),rn=Oi(Le-1);class ki{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,e){return ie(t,e.getMinutes())}configure(t){const{insertUndividedMax:e=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:r,step:h=this.step}=t;this.insertUndividedMax=e,this.toListItem=u=>{const c=ie(B,u);return{text:this.intl.formatDate(c,r.pattern),value:c}},this.min=s,this.max=a,this.step=h}data(t){const[e]=this.range(t),s=nn(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Oe(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,t)||!l.isEqual(this.max,e))}limitRange(t,e,s){return[an(t,s),rn(e,s)]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastMinute(t)===t.getMinutes()||!this.isMissing(t):!0}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastMinute(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getMinutes());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(Vi(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(ie(this.max,this.lastMinute(t)))}divideByStep(t){return Vi(t.getMinutes(),this.min.getMinutes())/this.step}lastMinute(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getMinutes(),s.getMinutes()]}}const Ae=60,Ni=(i=>t=>t%i)(Ae),ln=(i,t)=>e=>Ni(i+e*t),yi=(i,t)=>Ni(Ae+i-t),Mi=i=>(t,e)=>!e||t.getMinutes()===e.getMinutes()&&t.getHours()===e.getHours()?t:se(t,i),on=Mi(0),hn=Mi(Ae-1);class _i{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,e){return se(t,e.getSeconds())}configure(t){const{insertUndividedMax:e=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:r,step:h=this.step}=t;this.insertUndividedMax=e,this.toListItem=u=>{const c=se(B,u);return{text:this.intl.formatDate(c,r.pattern),value:c}},this.min=s,this.max=a,this.step=h}data(t){const[e]=this.range(t),s=ln(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Oe(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,t)||!l.isEqual(this.max,e))}limitRange(t,e,s){return[on(t,s),hn(e,s)]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastSecond(t)===t.getSeconds()||!this.isMissing(t):!0}divideByStep(t){return yi(t.getSeconds(),this.min.getSeconds())/this.step}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastSecond(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getSeconds());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(yi(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(se(this.max,this.lastSecond(t)))}lastSecond(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getSeconds(),s.getSeconds()]}}const cn=2,Fi=.05,un=100,dn=0,Li=9,mn={[d.Keys.end]:(i,t)=>i[i.length-1],[d.Keys.home]:(i,t)=>i[0],[d.Keys.up]:(i,t)=>i[t-1],[d.Keys.down]:(i,t)=>i[t+1]},He={[j.dayperiod]:Si,[j.hour]:Ci,[j.minute]:ki,[j.second]:_i},Ct=class extends o.Component{constructor(i){super(i),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=t=>{Promise.resolve().then(()=>{this.element&&this.element.focus(t)})},this.itemOffset=t=>{if(!this.virtualization||!this.service)return-1;const e=this.service.selectedIndex(this.props.value),s=this.virtualization.activeIndex(),a=this.virtualization.itemOffset(s),r=Math.abs(Math.ceil(t)-a);if(e===s&&r<cn)return a;const h=e>s;return h&&r>=this.bottomThreshold||!h&&r>this.topThreshold?this.virtualization.itemOffset(s+1):a},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+=Li,this.bottomOffset+=Li*2),this.topThreshold=this.itemHeight*Fi,this.bottomThreshold=this.itemHeight*(1-Fi))},this.configureServices=({min:t,max:e,value:s}=this.props)=>{if(this.service){const[a,r]=this.service.limitRange(t||this.min,e||this.max,s||this.props.value);this.service.configure(this.serviceSettings({min:a,max:r}))}},this.serviceSettings=t=>{const e={boundRange:this.props.boundRange||Ct.defaultProps.boundRange,insertUndividedMax:!1,min:l.cloneDate(this.min),max:l.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},e,t);return s.boundRange=s.part.type!=="hour"||this.props.boundRange||Ct.defaultProps.boundRange,s},this.handleScrollAction=({target:t,animationInProgress:e})=>{if(!(!this.virtualization||!this.service)&&t&&!e){this.animateToIndex=!1;const s=this.virtualization.itemIndex(this.itemOffset(t.scrollTop)),a=this.service.data(this.props.value)[s];this.handleChange(a)}},this.handleFocus=t=>{const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleBlur=t=>{const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleMouseOver=()=>{if(!this._element)return;const t=d.getActiveElement(document);document&&t!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=t=>{if(!this.service)return;const{keyCode:e}=t;(e===d.Keys.down||e===d.Keys.up||e===d.Keys.end||e===d.Keys.home)&&t.preventDefault();const a=(mn[t.keyCode]||d.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));a&&this.handleChange(a)},this.handleChange=ss(t=>{if(!this.service)return;const e=this.service.apply(this.props.value,t.value);if(this.props.value.getTime()===e.getTime())return;const{onChange:s}=this.props;s&&s.call(void 0,e)},un),this.dom=new Ps}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||Ct.defaultProps.min}get max(){return this.props.max||Ct.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):Ct.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const i=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](i),this.animateToIndex=!0}render(){if(!this.props.part.type||!He[this.props.part.type])return;this.calculateHeights(),this.intl=x.provideIntlService(this),this.service=new He[this.props.part.type](this.intl),this.configureServices();const i=this.service.data(this.props.value),t="translateY("+this.topOffset+"px)",e=this.service.total(this.props.value),s=o.createElement("ul",{style:{transform:t,msTransform:t},className:"k-reset"},i.map((a,r)=>o.createElement("li",{key:r,className:"k-item",onClick:()=>{this.handleChange(a)}},o.createElement("span",null,a.text))));return o.createElement("div",{className:"k-time-list",id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:a=>{this._element=a},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?o.createElement(gt,{bottomOffset:this.bottomOffset,children:s,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:a=>{this.virtualization=a},role:"presentation",skip:dn,tabIndex:-1,take:e,topOffset:this.topOffset,total:e}):o.createElement("div",{className:"k-time-container"},s))}};let qt=Ct;qt.propTypes={id:n.number,max:n.instanceOf(Date),min:n.instanceOf(Date),part:function(i,t,e){const s=i[t];if(!s||!He[s.type])throw new Error(`
16
- Invalid prop '${t}' supplied to ${e}.
17
- Supported part types are hour|minute|second|dayperiod.
18
- `);return null},step:function(i,t,e){const s=i[t];if(s!==void 0&&s<=0)throw new Error(`
19
- Invalid prop '${t}' supplied to ${e}.
20
- ${t} cannot be less than 1.
21
- `);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool},qt.defaultProps={boundRange:!1,max:nt,min:B,step:1,smoothScroll:!0},x.registerForIntl(qt);const Be=new RegExp(`${j.hour}|${j.minute}|${j.second}|${j.dayperiod}|literal`),dt=class extends o.Component{constructor(i){super(i),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=(t,e)=>{Promise.resolve().then(()=>{e&&this._nowButton&&this._nowButton.element&&this._nowButton.element.focus();const s=this.timeLists[0];!e&&this.state.activeListIndex===-1&&!this.hasActiveButton()&&s&&s.element&&s.focus(t)})},this.timeFormatReducer=(t,e)=>t+e.pattern,this.timeFormatFilter=(t,e,s)=>{const a=e>=1&&s[e-1];return a&&a&&t.type==="literal"?Be.test(a.type||""):Be.test(t.type||"")},this.focusList=t=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(e=>t===1?e.next:e.prev).map(e=>e&&e.element&&e.element.focus({preventScroll:!0}))},this.listReducer=(t,e,s,a)=>t.length||e.props.id!==this.state.activeListIndex?t:[{next:a[s+1]||e,prev:a[s-1]||e}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Ne(ut(),this.min,this.max),this.handleKeyDown=t=>{const{keyCode:e}=t;switch(e){case d.Keys.left:t.preventDefault(),this.focusList(0);return;case d.Keys.right:t.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=t=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:t})},this.handleChange=t=>{const{onChange:e}=this.props;e&&e.call(void 0,t)},this.snapTime=mi(di(this.props.steps,this.props.min||dt.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ys(this.snapTime(l.cloneDate(this.props.value||B)),this.min,this.max)}get intl(){return x.provideIntlService(this)}get min(){return this.snapTime(this.props.min||dt.defaultProps.min)}get max(){return this.snapTime(this.props.max||dt.defaultProps.max)}get steps(){return this.props.steps||dt.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:dt.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this.value)}render(){const{format:i,smoothScroll:t,onNowClick:e,className:s,disabled:a,mobileMode:r,show:h,onNowKeyDown:u}=this.props;this.snapTime=mi(di(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(i||dt.defaultProps.format).filter(this.timeFormatFilter);const c=d.classNames({"k-disabled":a,"k-time-part":r},s);this.timeLists=[];const m=x.provideLocalizationService(this),f=m.toLanguageString(ve,k[ve]);return o.createElement("div",{className:c},o.createElement("div",{className:"k-time-header"},o.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&o.createElement(L.Button,{type:"button",ref:g=>{this._nowButton=g},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:f,onKeyDown:u,"aria-label":f,onClick:e,tabIndex:a?-1:0},m.toLanguageString(ge,k[ge]))),o.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},o.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((g,w)=>g.type!=="literal"?o.createElement("div",{key:w,className:d.classNames("k-time-list-wrapper",{"k-focus":w===this.state.activeListIndex}),role:"presentation",tabIndex:-1},o.createElement("span",{className:"k-title",onMouseDown:v=>{v.preventDefault()}},this.intl.dateFieldName(g)),o.createElement(qt,{min:this.min,max:this.max,boundRange:this.boundRange,part:g,step:g.type?this.steps[g.type]:1,smoothScroll:t,ref:v=>{v&&this.timeLists.push(v)},id:w,onFocus:()=>{this.handleListFocus(w)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:r})):o.createElement("div",{key:w,className:"k-time-separator"},g.pattern))))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){const i=d.getActiveElement(document);return this._nowButton&&i===this._nowButton.element}hasSteps(){const i=Object.keys(this.steps);return i.length!==i.reduce((t,e)=>t+this.steps[e],0)}};let mt=dt;mt.propTypes={cancelButton:n.bool,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool},mt.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:ct,max:nt,steps:{},boundRange:!1},x.registerForIntl(mt),x.registerForLocalization(mt);const ze=class extends o.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:e}=t;switch(e){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.revertToNowButton=t=>{const{keyCode:e,shiftKey:s}=t;!s&&e===d.Keys.tab&&(t.preventDefault(),this.props.nowButton!==!1?this.timePart&&this.timePart.focus({preventScroll:!0},!0):this.timePart&&this.timePart.focus({preventScroll:!0}))},this.handleNowKeyDown=t=>{var a;const{keyCode:e,shiftKey:s}=t;s&&e===d.Keys.tab?(t.preventDefault(),this._acceptButton&&((a=this._acceptButton.element)==null||a.focus({preventScroll:!0}))):e===d.Keys.enter&&(t.stopPropagation(),this.handleNowClick(t))},this.handleAccept=t=>{const e=this.mergeValue(l.cloneDate(this.value||ut()),this.timePart?this.timePart.value:this.current);this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:e}=this.props;e&&e.call(void 0,t)},this.handleNowClick=t=>{const e=this.mergeValue(l.cloneDate(this.value||ut()),ut());this.setState({current:e,value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:e}=this.props;e&&e.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||ze.defaultProps.format),this.mergeValue=Us(Ks(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||B,value:this.props.value||ze.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get intl(){return x.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:e,tabIndex:s,className:a,smoothScroll:r,min:h,max:u,boundRange:c,nowButton:m,steps:f,show:g,mobileMode:w}=this.props,v=x.provideLocalizationService(this),E=v.toLanguageString(Qt,k[Qt]),O=v.toLanguageString(At,k[At]);return o.createElement("div",{ref:N=>{this._element=N},tabIndex:e?void 0:s||0,className:d.classNames("k-timeselector",a,{"k-disabled":e}),onKeyDown:this.handleKeyDown},o.createElement(mt,{ref:N=>{this.timePart=N},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:r,min:h,max:u,boundRange:c,disabled:e,nowButton:m,steps:f,show:g,mobileMode:w,onNowKeyDown:this.handleNowKeyDown}),this.props.footer&&o.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},t&&o.createElement(L.Button,{type:"button",ref:N=>{this._cancelButton=N},className:"k-time-cancel",onClick:this.handleReject,title:E,"aria-label":E},E),o.createElement(L.Button,{type:"button",ref:N=>{this._acceptButton=N},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:O,"aria-label":O},O)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=d.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};let Et=ze;Et.propTypes={cancelButton:n.bool,className:n.string,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool},Et.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:ct,max:nt,boundRange:!1,footer:!0},x.registerForIntl(Et),x.registerForLocalization(Et);const G=class extends o.Component{constructor(i){super(i),this._element=null,this._dateInput=o.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:t,cancelButton:e,nowButton:s,disabled:a,format:r,steps:h}=this.props;return o.createElement(Et,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:e,disabled:a,nowButton:s,format:r,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:t,...e}=this.popupSettings,s=d.classNames("k-group k-reset",t),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:s,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...e};return this.props.popup?o.createElement(this.props.popup,{...a},this.renderTimeSelector()):o.createElement(Wt.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(Pt,k[Qt]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(At,k[At]),onApply:s=>this.handleValueChange(s)}};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,e)=>t.value!==void 0?t.value:e.value,this.nextShow=(t,e)=>t.show!==void 0?t.show:e.show,this.handleInputValueChange=t=>{const e=this.mergeTime(t.value);this.handleValueChange({...t,value:e})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:l.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:e}=this.props,s=this.value||this.state.candidate;e&&e.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:s,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=t=>{this.setShow(!1)},this.handleIconClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},d.validatePackage(ft),this.state={value:this.props.defaultValue||G.defaultProps.defaultValue,show:this.props.defaultShow||G.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(d.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 i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),e=this.normalizeTime(this.max),s=$s(i,t,e),a=this.props.validationMessage!==void 0,r=(!this.required||this.value!==null)&&s,h=this.props.valid!==void 0?this.props.valid:r;return{customError:a,rangeOverflow:js(i,e),rangeUnderflow:Ts(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:G.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:G.defaultProps.required}get popupSettings(){return this.props.popupSettings||G.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:G.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:G.defaultProps.max}get dateInputComp(){return this.props.dateInput||G.defaultProps.dateInput}get localizationService(){return x.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=G.defaultProps.size,rounded:t=G.defaultProps.rounded,fillMode:e=G.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,className:u,format:c,formatPlaceholder:m,width:f,name:g,steps:w,validationMessage:v,required:E,validityStyles:O,ariaLabelledBy:N,ariaDescribedBy:S}=this.props,y=!this.validityStyles||this.validity.valid,b={disabled:s,format:c,formatPlaceholder:m,id:h,ariaLabelledBy:N,ariaDescribedBy:S,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:g,onChange:this.handleInputValueChange,required:E,steps:w,tabIndex:this.show?-1:a,title:r,valid:this.validity.valid,validationMessage:v,validityStyles:O,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,readonly:this.mobileMode},K=this.localizationService.toLanguageString(Pt,k[Pt]),M=this.localizationService.toLanguageString(we,k[we]),F=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:U,onBlur:V})=>o.createElement(o.Fragment,null,o.createElement("div",{id:this.props.id,ref:_=>{this._element=_},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!y,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:U,onBlur:V,onClick:this.mobileMode?this.handleIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...b}),o.createElement(L.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:J.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:M,className:"k-input-button",rounded:null,"aria-label":K}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(ye,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:y,editorDisabled:this.props.disabled,children:F,style:{width:this.props.width}}):F}normalizeTime(i){return R(B,i)}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?R(this.value,i):i}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Vt=G;Vt.displayName="TimePicker",Vt.propTypes={className:n.string,cancelButton:n.bool,nowButton:n.bool,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},Vt.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:nt,min:ct,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:ot,size:"medium",rounded:"medium",fillMode:"solid"};const Ai=d.createPropsContext(),Hi=d.withIdHOC(d.withPropsContext(Ai,Vt));Hi.displayName="KendoReactTimePicker",x.registerForLocalization(Vt);const Bi=2,qe=class extends o.Component{constructor(i){super(i),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus"),e=this._element.querySelector(".k-state-pending-focus");t&&t[0]&&t[0].classList.remove("k-focus"),e&&e.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus");t&&t.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=t=>{if(t.start===null||t.end===null)return t;const e=t.end<t.start;return{start:e?t.end:t.start,end:e?t.start:t.end}},this.handleDateChange=(t,e=!1)=>{const{onChange:s}=this.props;if(s){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:l.cloneDate(t.value),target:this,isTodayClick:e};s.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===C.month)}get min(){return this.props.min!==void 0?this.props.min:qe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:qe.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const i=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=d.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===C.month,"k-calendar-yearview":this.props.activeView===C.year,"k-calendar-decadeview":this.props.activeView===C.decade,"k-calendar-centuryview":this.props.activeView===C.century});return o.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map(e=>o.createElement("table",{className:"k-calendar-table k-content",key:e.getTime(),role:"grid"},o.createElement(Lt,{bus:this.props.bus,service:this.props.service,key:e.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:e,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:i,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let Ot=qe;Ot.defaultProps={showWeekNumbers:!1,views:Bi,take:Bi,allowReverse:!0,min:it,max:st};const Re=(i=Q.defaultProps.min,t=Q.defaultProps.max,e)=>e instanceof Date&&!Array.isArray(e)&&A(l.getDate(e),i,t)?l.getDate(e):null,zi=(i=Q.defaultProps.min,t=Q.defaultProps.max,e)=>Array.isArray(e)?e.filter(s=>A(s,i,t)).map(s=>l.getDate(s)):null,qi=i=>typeof i=="object"&&!(i instanceof Date)&&i!==null&&!Array.isArray(i)?i:q,Ri=(i,t,e)=>i||t&&t[0]||e&&e.start,pn=(i,t)=>i.start===null&&t===null?"start":i.end===null?"end":"start",kt=class extends o.Component{constructor(i){super(i),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=q,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.focus=()=>{this._element&&this._element.focus()},this.clampRange=c=>({start:c,end:null}),this.rangeWithFocused=(c,m)=>({start:c.start,end:c.end===null&&c.start!==null&&this.isActive?m:c.end}),this.generateRange=(c,m)=>{const{end:f,start:g}=m,w=m.start!==null&&c.getTime()<=m.start.getTime();return!this.props.allowReverse&&w?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:f}:{start:g||this.selectedDate,end:c}},this.canNavigate=c=>{if(!this.service)return!1;const m=this.service.move(this.focusedDate,c);return this.min<=m&&m<=this.max||this.service.isInSameView(m,this.min)||this.service.isInSameView(m,this.max)},this.navigate=(c,m)=>{this.calculateFocusFromValue=!1;const f=this.move(c,m);this.setState({navigateDate:f,focusedDate:f})},this.move=(c,m)=>this.clampDate(this.service.move(m,c)),this.clampDate=c=>Y(c,this.min,this.max),this.shouldAutoCorrect=(c,m)=>{const{end:f,start:g}=m;return this.activeRange!=="end"?f!==null&&c>f:g!==null&&c<g},this.handleCellEnter=c=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:c}))},this.handleMouseDown=c=>{c.preventDefault()},this.handleClick=c=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=c=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:m}=this.props;m&&m.call(void 0,c)},this.handleBlur=c=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:m}=this.props;m&&m.call(void 0,c)},this.handleTodayClick=c=>{this.todayIsInRange&&this.handleDateChange(c)},this.handlePrevButtonClick=()=>{const c=D.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(c,this.move(c,this.focusedDate));else{const m=this.isInMonth(this.focusedDate,this.dates[1])?this.move(c,this.focusedDate):this.focusedDate;this.navigate(c,m)}},this.handleNextButtonClick=()=>{this.navigate(D.NextView,this.focusedDate)},this.handleKeyDown=c=>{const{keyCode:f,ctrlKey:g,metaKey:w}=c;if(f===84){const v=z();this.calculateFocusFromValue=!1,this.setState({focusedDate:v,navigateDate:v})}if((g||w)&&(f===d.Keys.left&&this.handlePrevButtonClick(),f===d.Keys.right&&this.handleNextButtonClick()),f===d.Keys.enter){const v={syntheticEvent:c,nativeEvent:c.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(v)}else{const v=Y(this.navigation.move(this.focusedDate,this.navigation.action(c),this.state.activeView,this.service,c),this.min,this.max);if(l.isEqualDate(this.focusedDate,v))return;this.dates&&this.service&&!this.service.isInArray(v,this.dates)&&this.setState({navigateDate:v}),this.calculateFocusFromValue=!1,this.setState({focusedDate:v})}c.preventDefault()},this.handleViewChange=({view:c})=>{this.calculateFocusFromValue=!1,this.setState(m=>({activeView:c,navigateDate:m.focusedDate}))},this.handleDateChange=c=>{const m=l.cloneDate(c.value),f=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(f)if(c.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,c.syntheticEvent),this.setState({focusedDate:m,navigateDate:m});return}this.calculateFocusFromValue=!0;let g;switch(this.props.mode){case"single":g=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){const v=this.selectedMultiple.slice();let E=-1;v.forEach((O,N)=>{l.isEqualDate(O,c.value)&&(E=N)}),E!==-1?v.splice(E,1):v.push(l.cloneDate(c.value)),g=v.slice()}else this.selectedDate?g=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:g=[l.cloneDate(c.value)];break;case"range":{g=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(c.value):this.generateRange(c.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:g=l.cloneDate(c.value);break}this.valueDuringOnChange=g,c.isTodayClick&&this.setState({navigateDate:m}),this.setState({value:g,focusedDate:m}),this.valueDuringOnChange=g;const{onChange:w}=this.props;if(w){const v={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:g,target:this};w.call(void 0,v)}this.valueDuringOnChange=void 0};const t=i.value!==void 0?i.value:i.defaultValue||kt.defaultProps.defaultValue,e=Re(this.min,this.max,t),s=zi(this.min,this.max,t),a=qi(t),r=Ri(e,s,a),h=Yt(C[i.defaultActiveView],this.bottomView,this.topView),u=Y(i.focusedDate||r||z(),this.min,this.max);this.state={value:t,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=pn(a,e),this.bus=new de(this.handleViewChange),this.navigation=new me(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||Ot.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return l.cloneDate(this._focusedDate)}get min(){return l.getDate(this.props.min!==void 0?this.props.min:kt.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:kt.defaultProps.max)}get bottomView(){return C[this.props.bottomView!==void 0?this.props.bottomView:kt.defaultProps.bottomView]}get topView(){return C[this.props.topView!==void 0?this.props.topView:kt.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return A(z(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const i=Re(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&i&&this.selectedDate.getTime()&&i.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||Ot.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=x.provideIntlService(this),this.localization=x.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const i=Yt(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(i,this.intl),this.selectedDate=Re(this.min,this.max,this.value),this.selectedMultiple=zi(this.min,this.max,this.value),this.selectedRange=qi(this.value);const t=Ri(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=Y(this.calculateFocusFromValue&&t!==null?t:this.state.focusedDate,this.min,this.max);const e=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),s=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(pe,k[pe]),r=this.localization.toLanguageString(fe,k[fe]),h=!this.canNavigate(D.PrevView),u=!this.canNavigate(D.NextView),c={"aria-disabled":h},m={"aria-disabled":u},f=this.lastView!==i,g=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),w=this.lastViewsCount!==this.props.views;(!g||f||w)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||Ot.defaultProps.views));const v=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:z());return o.createElement("div",{ref:E=>{this._element=E},className:e,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},o.createElement(vt,{key:`.kendo.calendar.header.${v.getTime()}`,activeView:i,currentDate:v,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:o.createElement(o.Fragment,null,o.createElement(L.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?J.chevronRightIcon:J.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),o.createElement(It,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),o.createElement(L.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?J.chevronLeftIcon:J.chevronRightIcon,fillMode:"flat",title:r,disabled:u,onClick:this.handleNextButtonClick,...m}))}),o.createElement(Ot,{ref:E=>{this.calendarViewList=E},dates:this.dates,activeView:i,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:s,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(i,t){return!!t&&l.firstDayOfMonth(t)<=i&&i<=l.lastDayOfMonth(t)}};let Q=kt;Q.displayName="MultiViewCalendar",Q.propTypes={activeRangeEnd:n.oneOf(["start","end"]),allowReverse:n.bool,bottomView:n.oneOf(["month","year","decade","century"]),className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.oneOfType([et(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:et(n.instanceOf(Date)),end:et(n.instanceOf(Date))})]),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),mode:n.oneOf(["single","multiple","range"]),onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,topView:n.oneOf(["month","year","decade","century"]),value:n.oneOfType([et(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)})]),views:(i,t,e)=>{const s=i[t];return s!==void 0&&s<1?new Error(`Invalid prop '${t}' supplied to'${e}'. The '${t}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string},Q.defaultProps={disabled:!1,min:it,max:st,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const Wi=d.createPropsContext(),We=d.withIdHOC(d.withPropsContext(Wi,Q));We.displayName="KendoReactMultiViewCalendar",x.registerForIntl(Q),x.registerForLocalization(Q);const Rt=class extends o.Component{constructor(i){super(i),this._element=null,this._calendar=null,this._startDateInput=o.createRef(),this._endDateInput=o.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(t,e)=>(t.value!==void 0?t.value:e.value)||q,this.calculateShow=(t,e)=>t.show!==void 0?t.show:e.show,this.renderCalendar=()=>{const t=this.value||q,e={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:t,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?o.createElement(this.props.calendar,{...e}):o.createElement(We,{...e,ref:this.setCalendarRef})},this.renderPopup=()=>{const t={popupClass:"k-daterangepicker-popup",animate:this._element!==null,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?o.createElement(this.props.popup,{...t},this.renderCalendar()):o.createElement(Wt.Popup,{...t},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:s=>this.handleCancel(s),adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(De,k[De]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(Ie,k[Ie]),onApply:this.handleBlur}};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},o.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=t=>{const e={start:this.value.end,end:this.value.start},s={syntheticEvent:t,nativeEvent:t.nativeEvent};this.handleChange(e,s)},this.handleReverseMouseDown=t=>{t.preventDefault()},this.handleFocus=t=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||this.mobileMode&&this.setState({currentValue:this.value});const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleClick=()=>{this.shouldFocusDateInput||this.setShow(!0)},this.handleBlur=t=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleCancel=t=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:q})});const{onCancel:e}=this.props;e&&e.call(void 0,t)},this.handleEndChange=t=>{const e={start:this.value.start,end:l.cloneDate(t.value||void 0)};this.handleChange(e,t)},this.handleStartChange=t=>{const e={start:l.cloneDate(t.value||void 0),end:this.value.end};this.handleChange(e,t)},this.extractRangeFromValue=t=>{if(!Array.isArray(t.value)&&!(t.value instanceof Date))return t.value||q;const e=Array.isArray(t.value)?t.value[0]:t.value;return{start:this.value.end!==null?e:this.value.start,end:this.value.start!==null?e:this.value.end}},this.handleCalendarChange=t=>{const e=this.extractRangeFromValue(t);this.handleChange(e,t)},this.handleKeyDown=t=>{const{keyCode:e,altKey:s}=t;e===d.Keys.esc?(t.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):s&&e===d.Keys.down?(t.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0),this.focusCalendarElement()):s&&e===d.Keys.up&&(t.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1))},this.handleChange=(t,e)=>{this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:s}=this.props;if(s){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this};s.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(ft),this.state={show:this.props.show||this.props.defaultShow||Rt.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Rt.defaultProps.defaultValue,currentValue:q},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(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||q}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:Rt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Rt.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return x.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=this.value||q,t=this.mobileMode&&this.show?this.state.currentValue:i,e=(this.props.startDateInputSettings||{}).id||this._startInputId,s=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),r=this.localizationService.toLanguageString(Gt,k[Gt]),h=this.localizationService.toLanguageString(Xt,k[Xt]),u=this.localizationService.toLanguageString(Jt,k[Jt]),c={disableSelection:this.mobileMode&&!0,label:r,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,...this.props.startDateInputSettings,value:t.start,onChange:this.handleStartChange},m={disableSelection:this.mobileMode&&!0,label:h,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,...this.props.endDateInputSettings,value:t.end,onChange:this.handleEndChange},f=o.createElement(L.Button,{type:"button",className:"k-select",fillMode:"flat",title:x.provideLocalizationService(this).toLanguageString(St,k[St]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":e+" "+s,"aria-label":x.provideLocalizationService(this).toLanguageString(St,k[St])},o.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:J.arrowsSwapIcon}));return o.createElement(o.Fragment,null,o.createElement("span",{ref:g=>{this._element=g},className:a,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?o.createElement(this.props.startDateInput,{...c}):o.createElement(ot,{...c,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?f:u,this.props.endDateInput?o.createElement(this.props.endDateInput,{...m}):o.createElement(ot,{...m,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const i=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&i!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):i!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Nt=Rt;Nt.displayName="DateRangePicker",Nt.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(lt.propTypes),focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),onBlur:n.func,onChange:n.func,onFocus:n.func,popupSettings:n.any,show:n.bool,startDateInputSettings:n.any,style:n.any,swapButton:n.any,tabIndex:n.number,dir:n.string,value:n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)})},Nt.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:q,disabled:!1,format:"d",max:st,min:it,swapButton:!1};const Ki=d.createPropsContext(),Ui=d.withIdHOC(d.withPropsContext(Ki,Nt));Ui.displayName="KendoReactDateRangePicker",x.registerForLocalization(Nt);class Ke extends o.Component{constructor(t){super(t),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(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(e);const s=this.calendarElement();this.state.tab==="date"&&s&&s.focus(e)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=e=>{if(e==="right"&&this.state.tab==="time"||e==="left"&&this.state.tab==="date")return;const s=e==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:s})},this.dateTimeFooter=()=>{const{cancelButton:e}=this.props,s=this.localizationService.toLanguageString(Ht,k[Ht]),a=this.localizationService.toLanguageString(Bt,k[Bt]);return o.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched"},e&&o.createElement(L.Button,{type:"button",ref:r=>{this._cancelButton=r},className:"k-time-cancel",onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:s,"aria-label":s},s),o.createElement(L.Button,{type:"button",themeColor:"primary",ref:r=>{this._acceptButton=r},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:a,"aria-label":a},a))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||B});const s=this.mergeDate(this.props.value,this.props.value||B);if(this.props.onReject){const a={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:s};this.props.onReject.call(void 0,a)}},this.handleAccept=(e,s)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,s||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:a,target:this})},this.handleNowClick=e=>{this.setState({timeValue:ut()}),this.handleAccept(e,ut())},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:s,altKey:a}=e;if(!this.props.disabled)switch(s){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e);return;case d.Keys.left:if(!a)return;this.move("left");return;case d.Keys.right:if(!a)return;this.move("right");return;default:return}},this.handleCancelKeyDown=e=>{const{keyCode:s}=e;s===d.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&!this.hasDateValue&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{const{keyCode:s}=e;s===d.Keys.tab&&this._dateButtonRef&&this._dateButtonRef.element&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var r,h,u,c;const{keyCode:s,shiftKey:a}=e;a&&s===d.Keys.tab&&(e.stopPropagation(),this.hasDateValue?(c=(u=this._acceptButton)==null?void 0:u.element)==null||c.focus():(h=(r=this._cancelButton)==null?void 0:r.element)==null||h.focus()),s===d.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:s}=e;s===d.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||B}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return x.provideLocalizationService(this)}componentDidUpdate(t,e){var s,a;this.shouldFocusPart&&this.focus({preventScroll:!0}),(((s=t.value)==null?void 0:s.getTime())!==((a=this.props.value)==null?void 0:a.getTime())||this.state.tab!==e.tab&&this.props.value)&&this.setState({dateValue:t.value&&this.props.value&&l.isEqualDate(t.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||B}),this.shouldFocusPart=!1}render(){const{disabled:t,min:e,max:s,weekNumber:a,focusedDate:r,format:h,mobileMode:u,footerActions:c}=this.props,m=d.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":t},"k-datetime-wrap"),f=this.localizationService.toLanguageString(be,k[be]),g=this.localizationService.toLanguageString(Se,k[Se]),w={min:e,max:s,weekNumber:a,focusedDate:r,disabled:t||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:t||this.state.tab!=="date"?-1:void 0,mobileMode:u};return o.createElement("div",{onKeyDown:this.handleKeyDown,className:m,tabIndex:-1},o.createElement("div",{className:"k-datetime-buttongroup"},o.createElement(L.ButtonGroup,{width:"100%"},o.createElement(L.Button,{ref:v=>this._dateButtonRef=v,type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},f),o.createElement(L.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},g))),o.createElement("div",{className:"k-datetime-selector"},o.createElement("div",{className:"k-datetime-calendar-wrap",ref:v=>this._calendarWrap=v},this.props.calendar?o.createElement(this.props.calendar,{key:this.state.tab,...w}):o.createElement(te,{key:this.state.tab,ref:v=>{this._calendar=v},...w})),o.createElement("div",{className:"k-datetime-time-wrap"},o.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},o.createElement(mt,{key:1,onNowClick:this.handleNowClick,disabled:t||this.state.tab!=="time",ref:v=>{this._timePart=v},min:this.minTime||ct,max:this.maxTime||nt,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:u})))),c&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(t,e){return l.isEqualDate(t,e||z())?t:null}hasActiveButton(){if(!this._acceptButton)return!1;const t=d.getActiveElement(document);return this._acceptButton&&t===this._acceptButton.element||this._cancelButton&&t===this._cancelButton.element}mergeTime(t,e){return t&&e?R(e,t):e}mergeDate(t,e){return t?R(t||z(),e):e}}Ke.defaultProps={footerActions:!0},x.registerForLocalization(Ke);const P=class extends o.Component{constructor(i){super(i),this._element=null,this._dateInput=o.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const t=this.dateInputElement();t&&t.focus()},this.renderPicker=()=>{const{disabled:t,minTime:e,maxTime:s,format:a,calendar:r,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return o.createElement(Ke,{ref:m=>{this._dateTimeSelector=m},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:t,weekNumber:u,min:this.min,max:this.max,minTime:e,maxTime:s,focusedDate:c,format:a,calendar:r,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e=x.provideLocalizationService(this).toLanguageString(Ht,k[Ht]),s=x.provideLocalizationService(this).toLanguageString(Bt,k[Bt]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:e,onCancel:r=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(r)},applyText:s,onApply:r=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(r)}}};return o.createElement(ne,{...a},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=t=>{this.setState({value:l.cloneDate(t.value||void 0)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:e}=this.props;e&&e.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.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.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(ft),this.state={value:this.props.defaultValue||P.defaultProps.defaultValue,show:this.props.defaultShow||P.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:P.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:P.defaultProps.max}get validity(){const i=je(this.value,this.min,this.max)&&Ne(this.value,this.props.minTime||ct,this.props.maxTime||nt),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;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:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:P.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:P.defaultProps.required}get dateInputComp(){return this.props.dateInput||P.defaultProps.dateInput}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const i=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),i&&!this.show&&this.shouldFocusDateInput&&i.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=P.defaultProps.size,rounded:t=P.defaultProps.rounded,fillMode:e=P.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,format:u,formatPlaceholder:c,min:m,max:f,className:g,width:w,name:v,validationMessage:E,required:O,validityStyles:N,minTime:S,maxTime:y,ariaLabelledBy:b,ariaDescribedBy:K,popup:M=Wt.Popup}=this.props,F=!this.validityStyles||this.validity.valid,U={id:h,ariaLabelledBy:b,ariaDescribedBy:K,format:u,formatPlaceholder:c,disabled:s,title:r,validityStyles:N,validationMessage:E,required:O,min:m,max:f,minTime:S,maxTime:y,name:v,tabIndex:this.show?-1:a,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},V=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:_,onBlur:tt})=>o.createElement(o.Fragment,null,o.createElement("div",{ref:X=>{this._element=X},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,"k-invalid":!F,"k-required":this.required,"k-disabled":this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:w},onFocus:this.mobileMode?void 0:_,onBlur:tt,onClick:this.mobileMode?this.handleDateIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...U}),o.createElement(L.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:J.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:x.provideLocalizationService(this).toLanguageString(Dt,k[Dt]),className:"k-input-button",rounded:null,"aria-label":x.provideLocalizationService(this).toLanguageString(Dt,k[Dt])}),o.createElement(M,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:"k-datetime-container k-reset",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?o.createElement(ye,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:F,editorDisabled:this.props.disabled,children:V,style:{width:this.props.width}}):V}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};let yt=P;yt.displayName="DateTimePicker",yt.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,cancelButton:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},yt.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:st,min:it,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:ot,size:"medium",rounded:"medium",fillMode:"solid"};const Yi=d.createPropsContext(),$i=d.withIdHOC(d.withPropsContext(Yi,yt));$i.displayName="KendoReactDateTimePicker",x.registerForLocalization(yt),p.Action=D,p.BusViewService=de,p.Calendar=te,p.CalendarCell=$e,p.CalendarHeaderTitle=ai,p.CalendarNavigationItem=li,p.CalendarPropsContext=ci,p.CalendarViewEnum=C,p.CalendarWeekCell=Te,p.CalendarWithoutContext=rt,p.CenturyViewService=Xe,p.DOMService=ti,p.DateInput=ot,p.DateInputPropsContext=pi,p.DateInputWithoutContext=lt,p.DatePicker=bi,p.DatePickerPropsContext=wi,p.DatePickerWithoutContext=xt,p.DateRangePicker=Ui,p.DateRangePickerPropsContext=Ki,p.DateRangePickerWithoutContext=Nt,p.DateTimePicker=$i,p.DateTimePickerPropsContext=Yi,p.DateTimePickerWithoutContext=yt,p.DayPeriodService=Si,p.DecadeViewService=Je,p.EMPTY_SELECTIONRANGE=q,p.Header=vt,p.HorizontalViewList=Ot,p.HoursService=Ci,p.MAX_DATE=st,p.MAX_TIME=nt,p.MIN_DATE=it,p.MIN_TIME=ct,p.MinutesService=ki,p.MonthViewService=Qe,p.MultiViewCalendar=We,p.MultiViewCalendarPropsContext=Wi,p.MultiViewCalendarWithoutContext=Q,p.NavigationService=me,p.PickerWrap=gi,p.ScrollSyncService=ei,p.SecondsService=_i,p.TimeList=qt,p.TimePart=mt,p.TimePicker=Hi,p.TimePickerPropsContext=Ai,p.TimePickerWithoutContext=Vt,p.TimeSelector=Et,p.TodayCommand=It,p.ToggleButton=fi,p.ViewList=zt,p.Virtualization=gt,p.WeekNamesService=ii,p.YearViewService=Pe,p.dateInputsMessages=k,p.decreaseValue=bt,p.end=Xt,p.getNow=ut,p.getToday=z,p.increaseValue=wt,p.separator=Jt,p.start=Gt,p.swapStartEnd=St,p.today=jt,p.toggleCalendar=Zt,p.toggleDateTimeSelector=Dt,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-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-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-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.KendoReactPopup,e.KendoReactLayout)}(this,(function(e,t,i,s,a,n,o,r,l,h,d){"use strict";function c(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 u=c(t);const p={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"};let m=class{constructor(e=0,t,i){this.total=e,this.rowHeight=t,this.detailRowHeight=i,this.offsets=[],this.heights=[];let s=0;for(let i=0;i<e;i++)this.offsets.push(s),s+=t,this.heights.push(t)}height(e){return this.heights[e]}expandDetail(e){this.height(e)===this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight)}collapseDetail(e){this.height(e)>this.rowHeight&&this.updateRowHeight(e,-1*this.detailRowHeight)}index(e){for(let t=0;t<this.offsets.length;t++){if(e===this.offsets[t])return t;if(e<this.offsets[t])return t-1}return this.total-1}offset(e){return this.offsets[e]}totalHeight(){return this.heights.reduce(((e,t)=>e+t),0)}updateRowHeight(e,t){this.heights[e]+=t,this.offsets=((e,t,i)=>[...e.slice(0,t+1),...e.slice(t+1).map((e=>e+i))])(this.offsets,e,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},k=class e extends u.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);let{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 m(e.total,t,0),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(u.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(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const e=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t="vertical"===this.direction?{height:`${e}px`}:{width:`${e}px`},i=s.classNames("k-content k-scrollable",{"k-scrollable-horizontal":"horizontal"===this.direction},this.props.className),a=s.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":"horizontal"===this.direction});return u.createElement("div",{ref:e=>{this.scrollContainer=e},onScroll:this.handleScroll,className:i,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,u.createElement("div",{style:t,className:a}))}};k.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},k.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let S=k;let x=class extends u.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:d,isRangeSplitEnd:c,isToday:p,isDisabled:m,view:g,value:v,...f}=this.props,w="end"===this.props.activeRangeEnd&&h,b="start"===this.props.activeRangeEnd&&r,D=s.classNames("k-calendar-td",{"k-range-end":h,"k-range-mid":l,"k-range-split-end":c,"k-range-split-start":d,"k-range-start":r,"k-active":b||w,"k-state-pending-focus":a,"k-selected":o||r||h,"k-today":p,"k-weekend":i,"k-disabled":m},e);return u.createElement("td",{...f,className:D,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},u.createElement("span",{className:"k-link"},this.props.children))}},C=class extends u.Component{render(){const{className:e,firstDate:t,...i}=this.props;return u.createElement("td",{className:s.classNames("k-calendar-td",e),...i},this.props.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 O(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 E=(e,t,i)=>void 0===t||void 0===i||t<=e&&e<=i?e:e<t?t:i,V=new Date(1980,0,1),T=new Date(1900,0,1),P=new Date(2099,11,31),F=new Date(1980,0,1),R=new Date(1980,0,1,23,59,59),N=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},L=()=>a.getDate(new Date),_=(e,t,i)=>!e||!(t&&t>e||i&&i<e),B=(e,t,i)=>null===e||!(t&&a.getDate(t)>a.getDate(e)||i&&a.getDate(i)<a.getDate(e)),A=(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},z=(e,t,i)=>t.getTime()<=e.getTime()&&e.getTime()<=i.getTime(),q=(e,t)=>e.slice(t).concat(e.slice(0,t)),K=(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).map((e=>a.style[e]=s[e])),"string"==typeof t?a.innerHTML=t||"":(t||[]).forEach((e=>e&&a.appendChild(e))),a};function U(e,t,i={}){let s,a,n,o,r;i.maxWait;const l=window;let h=!1,d=!1;const c=!t&&0!==t&&"function"==typeof l.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function u(t){const i=s,o=a;return s=a=void 0,n=e.apply(o,i),n}function p(e,t){return c?(l.cancelAnimationFrame(o),l.requestAnimationFrame(e)):setTimeout(e,t)}function m(e){const i=e-r;return void 0===r||i>=t||i<0||d}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?u():(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?u():n):(void 0===o&&(o=p(g,t)),n)}return t=+t||0,f.cancel=function(){void 0!==o&&function(e){if(c)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 Y=class{constructor(e){this.intl=e}getWeekNames(e=!1){const t=q(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(t):t}};const $=e=>u.createElement("td",{key:e,className:"k-calendar-td"}," "),j=class e extends u.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(e,t)=>{if(!this.firstDate(e))return $(`week-cell-${t}`);const i=this.firstDate(e),s=this.getWeekNumber(i),a=`kendo-react-calendar-week-cell-${s}`,n={className:"k-alt",value:s,firstDate:i};return this.props.weekCell?u.createElement(this.props.weekCell,{...n,key:a},s):u.createElement(C,{...n,key:a},s)},this.buildRow=e=>e.map(((e,t)=>{if(!e)return $(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,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?u.createElement(this.props.cell,{...a,key:s},e.formattedValue):u.createElement(x,{...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.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(){this.intl=n.provideIntlService(this),this.weekService=new Y(this.intl);const e=this.weekService.getWeekNames(this.weekNumber),t=this.props.service.rowLength(this.weekNumber),i=this.props.service.title(this.props.viewDate),s=L(),a=N(this.props.viewDate,s),o=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return u.createElement(u.Fragment,null,this.isMonthView&&this.isHorizontal&&u.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},u.createElement("tr",{role:"row",className:"k-calendar-tr"},e.map(((e,t)=>u.createElement("th",{key:t,className:"k-calendar-th"},e))))),u.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&u.createElement("tr",{role:"presentation",className:"k-calendar-tr"},u.createElement("th",{scope:"col",colSpan:t,className:"k-calendar-caption"},i)),o.map(((e,t)=>u.createElement("tr",{role:"row",className:"k-calendar-tr",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}};j.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,viewDate:i.instanceOf(Date).isRequired},j.defaultProps={direction:"vertical",selectedDate:L(),showWeekNumbers:!1};let Z=j;n.registerForIntl(Z);let G=class extends u.PureComponent{render(){const{view:e,...t}=this.props;return u.createElement(o.Button,{type:"button",fillMode:"flat",...t},this.props.children)}};const X=class e extends u.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 e=this.getTitle(),t=s.classNames("k-calendar-title"),i={children:e,value:e,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},a=this.props.headerTitle?u.createElement(this.props.headerTitle,{...i},e):u.createElement(G,{...i},e);return u.createElement("div",{className:s.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},a,u.createElement("span",{className:"k-spacer"}),u.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};X.propTypes={activeView:i.number.isRequired,currentDate:i.instanceOf(Date).isRequired,max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,rangeLength:i.number},X.defaultProps={rangeLength:1,min:T,max:P};let J=X;n.registerForLocalization(J);const Q="multiviewcalendar.prevView",ee="multiviewcalendar.nextView",te="dateinput.increment",ie="dateinput.decrement",se="calendar.today",ae="datepicker.toggleCalendar",ne="daterangepicker.swapStartEnd",oe="daterangepicker.start",re="daterangepicker.end",le="daterangepicker.separator",he="datetimepicker.toggleDateTimeSelector",de="timepicker.now",ce="timepicker.selectNow",ue="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",ke={[se]:"TODAY",[de]:"NOW",[pe]:"Set",[ue]:"Cancel",[ve]:"Date",[fe]:"Time",[we]:"Cancel",[be]:"Set",[De]:"Cancel",[ye]:"Set",[oe]:"Start",[re]:"End",[le]:" ",[ce]:"Select Now",[me]:"Toggle TimeSelector",[ge]:"Toggle Clock",[te]:"Increase value",[ie]:"Decrease value",[ae]:"Toggle calendar",[Q]:"Navigate to previous view",[ee]:"Navigate to next view",[ne]:"Swap start and end values",[he]:"Toggle date-time selector"},Se=class e extends u.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=e=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,value:K(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 _(L(),a.getDate(this.min),a.getDate(this.max))}render(){this.localization=n.provideLocalizationService(this);const e=this.localization.toLanguageString(se,ke[se]),t=s.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return u.createElement(o.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},e)}};Se.propTypes={max:i.instanceOf(Date).isRequired,min:i.instanceOf(Date).isRequired,onClick:i.func,disabled:i.bool},Se.defaultProps={min:T,max:P};let xe=Se;n.registerForLocalization(xe);const Ce=class e extends u.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.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=K(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)=>u.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},u.createElement("colgroup",null,e.map(((e,t)=>u.createElement("col",{key:t})))),u.createElement("thead",{className:"k-calendar-thead"},u.createElement("tr",{className:"k-calendar-tr"},t.map(((e,t)=>u.createElement("th",{key:t,className:"k-calendar-th"},e)))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return u.createElement("table",{className:"k-calendar-table",ref:e=>this.table=e,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},u.createElement("colgroup",null,e.map(((e,t)=>u.createElement("col",{key:t})))),t.map((e=>u.createElement(Z,{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}))))},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(){this.intl=n.provideIntlService(this);const e=q(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(e):e}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 _(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(){this.calculateHeights();const e=this.lastView!==this.props.activeView,t=K(this.props.focusedDate,this.props.min,this.props.max),i=e?this.props.service.skip(t,this.props.min):this.state.skip,n=this.props.service.total(this.props.min,this.props.max),o=this.getTake(i,n),r=this.props.service.addToDate(this.props.min,i),l=this.props.service.addToDate(this.props.min,this.state.index),h=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),d=this.props.activeView!==this.lastView;this.animateToIndex=!d,(d||!a.isEqualDate(this.lastFocus,t)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(t,this.props.min)),this.lastFocus=t;const c=s.classNames("k-calendar-view k-vstack",{"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}),p=this.buildDates(h,this.props.service.datesList(r,o)),m=u.createElement(u.Fragment,null,u.createElement(J,{key:"calendar-view-list-header",currentDate:l,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:u.createElement(u.Fragment,null,u.createElement(xe,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===I.month&&this.buildMonthView(h,this.weekNames),u.createElement(S,{key:"calendar-view-list-content",skip:i,take:this.take,total:n,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:p,tabIndex:this.props.tabIndex}));return u.createElement("div",{ref:e=>{this._element=e},className:c},this.props.dom.didCalculate?m:null)}};Ce.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,tabIndex:i.number},Ce.defaultProps={take:5,showWeekNumbers:!1,smoothScroll:!0};let Ie=Ce;n.registerForIntl(Ie);let Me=class extends u.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)}}render(){const{isRangeStart:e,value:t,text:i,...a}=this.props;return u.createElement("li",{...a,onClick:this.handleClick},u.createElement("span",{className:s.classNames({"k-calendar-navigation-marker":e})},this.props.children))}};const Oe=class e extends u.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=K(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?u.createElement(this.props.navigationItem,{...a,key:s},t):u.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(){this.calculateHeights();const e=this.lastView!==this.props.activeView,t=K(this.props.focusedDate,this.props.min,this.props.max),i=e?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),n=this.getTake(i,s),o=this.props.service.addToDate(this.props.min,i),r=this.props.service.datesList(o,n);(this.props.activeView!==this.lastView||!a.isEqual(t,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(t,this.props.min));const l=u.createElement(S,{skip:i,take:this.take,total:s,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},u.createElement("ul",{ref:e=>{this.list=e},className:"k-reset"},r.map((e=>this.buildNavigationItem(e)))));return u.createElement("div",{className:"k-calendar-navigation"},u.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?l:null)}getTake(e,t){return Math.min(t-e,this.take)}};Oe.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},Oe.defaultProps={take:30};let Ee=Oe;var Ve=(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))(Ve||{});const Te=[[]],Pe={[Ve.Left]:e=>a.addDecades(e,-1),[Ve.Up]:e=>a.addDecades(e,-5),[Ve.Right]:e=>a.addDecades(e,1),[Ve.Down]:e=>a.addDecades(e,5),[Ve.PrevView]:e=>a.addCenturies(e,-1),[Ve.NextView]:e=>a.addCenturies(e,1),[Ve.FirstInView]:e=>a.firstDecadeOfCentury(e),[Ve.LastInView]:e=>a.lastDecadeOfCentury(e)};class Fe{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 Te;const d=H(0,4),c=a.firstDecadeOfCentury(h),u=a.lastDecadeOfCentury(h),p=L();return H(0,3).map((e=>{const h=a.addDecades(c,4*e);return d.map((e=>{const d=this.normalize(a.addDecades(h,e),o,n),m=this.isEqual(d,l.start),g=this.isEqual(d,l.end),v=!m&&!g&&A(d,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(d,r,o,n):_(r,o,n)&&this.isEqual(d,r));return z(d,c,u)?{formattedValue:this.value(d),id:`${t}${d.getTime()}`,isFocused:this.isEqual(d,i),isSelected:f,isWeekend:!1,isInRange:_(d,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(d,u),isRangeSplitStart:v&&this.isEqual(d,c),isToday:this.isEqual(d,p),title:this.cellTitle(d),value:d}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{_(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=Pe[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 Re=[[]],Ne={[Ve.Left]:e=>a.addYears(e,-1),[Ve.Up]:e=>a.addYears(e,-5),[Ve.Right]:e=>a.addYears(e,1),[Ve.Down]:e=>a.addYears(e,5),[Ve.PrevView]:e=>a.addDecades(e,-1),[Ve.NextView]:e=>a.addDecades(e,1),[Ve.FirstInView]:e=>a.firstYearOfDecade(e),[Ve.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 Re;const d=H(0,4),c=a.firstYearOfDecade(h),u=a.lastYearOfDecade(h),p=L();return H(0,3).map((e=>{const h=a.addYears(c,4*e);return d.map((e=>{const d=this.normalize(a.addYears(h,e),o,n),m=this.isEqual(d,l.start),g=this.isEqual(d,l.end),v=!m&&!g&&A(d,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(d,r,o,n):_(r,o,n)&&this.isEqual(d,r));return z(d,c,u)?{formattedValue:this.value(d),id:`${t}${d.getTime()}`,isFocused:this.isEqual(d,i),isSelected:f,isWeekend:!1,isInRange:_(d,o,n),isRangeStart:m,isRangeMid:v,isRangeEnd:g,isRangeSplitEnd:v&&this.isEqual(d,u),isRangeSplitStart:v&&this.isEqual(d,c),isToday:this.isEqual(d,p),title:this.cellTitle(d),value:d}:null}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{_(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=Ne[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 _e=[[]],Be={[Ve.Left]:e=>a.addDays(e,-1),[Ve.Up]:e=>a.addWeeks(e,-1),[Ve.Right]:e=>a.addDays(e,1),[Ve.Down]:e=>a.addWeeks(e,1),[Ve.PrevView]:e=>a.addMonths(e,-1),[Ve.NextView]:e=>a.addMonths(e,1),[Ve.FirstInView]:e=>a.firstDayOfMonth(e),[Ve.LastInView]:e=>a.lastDayOfMonth(e)};class Ae{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 _e;const d=a.firstDayOfMonth(h),c=a.lastDayOfMonth(h),u=a.dayOfWeek(d,this.intl.firstDay(),-1),p=H(0,7),m=L();return H(0,6).map((e=>{const h=a.addDays(u,7*e);return p.map((e=>{const u=this.normalize(a.addDays(h,e),o,n);if(u<d||u>c)return null;const p=this.isEqual(u,l.start),g=this.isEqual(u,l.end),v=!p&&!g&&A(u,l),f=s&&(Array.isArray(r)?this.isSelectedFromArray(u,r,o,n):_(r,o,n)&&this.isEqual(u,r));return{formattedValue:this.value(u),id:`${t}${u.getTime()}`,isFocused:this.isEqual(u,i),isSelected:f,isInRange:_(u,o,n),isWeekend:this.isWeekend(u),isRangeStart:p,isRangeMid:v,isRangeEnd:g,isRangeSplitStart:v&&this.isEqual(u,d),isRangeSplitEnd:v&&this.isEqual(u,c),isToday:this.isEqual(u,m),title:this.cellTitle(u),value:u}}))}))}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=>{_(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=Be[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=[[]],ze={[Ve.Left]:e=>a.addMonths(e,-1),[Ve.Up]:e=>a.addMonths(e,(e=>e>4?-5:e<2?-2:-7)(e.getMonth())),[Ve.Right]:e=>a.addMonths(e,1),[Ve.Down]:e=>a.addMonths(e,(e=>e<7?5:e<10?7:2)(e.getMonth())),[Ve.PrevView]:e=>a.addYears(e,-1),[Ve.NextView]:e=>a.addYears(e,1),[Ve.FirstInView]:e=>a.firstMonthOfYear(e),[Ve.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 d=this.abbrMonthNames(),c=a.firstMonthOfYear(h),u=a.lastMonthOfYear(h),p=c.getFullYear(),m=H(0,4),g=L();return H(0,3).map((e=>{const h=a.addMonths(c,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&&A(m,l),b=s&&(Array.isArray(r)?this.isSelectedFromArray(m,r,o,n):_(r,o,n)&&this.isEqual(m,r));return{formattedValue:d[m.getMonth()],id:`${t}${m.getTime()}`,isFocused:this.isEqual(m,i),isSelected:b,isInRange:_(m,o,n),isWeekend:!1,isRangeStart:v,isRangeMid:w,isRangeEnd:f,isRangeSplitEnd:w&&this.isEqual(m,u),isRangeSplitStart:w&&this.isEqual(m,c),isToday:this.isEqual(m,g),title:this.cellTitle(m),value:m}}))}))}isSelectedFromArray(e,t,i,s){let a=!1;return t.forEach((t=>{_(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=ze[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 Ke={[I.month]:Ae,[I.year]:qe,[I.decade]:Le,[I.century]:Fe};let We=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 Ke[`${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)}},Ue=class{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){if(!s.canUseDOM)return;const t=W("div"),i=W("ul"),a=W("li"),n=W("td"),o=W("th"),r=W("tr"),l=W("tbody"),h=W("thead"),d=W("table"),c=()=>t('\n <span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">\n <span className="k-button-text">March 2017</span>\n </span>\n <span class="k-spacer"></span>\n <span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>\n ',"k-calendar-header k-hstack"),u=(e,t)=>new Array(e).fill("1").map(t),p=e=>t(e,"k-content k-scrollable"),m=(()=>{let e;return()=>s.canUseDOM?(e||(e=t([p([i([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),e):null})(),g=({cells:e,rows:i},a,m)=>{let g;return()=>s.canUseDOM?(g||(g=((e,i,s)=>t(s?[c(),d([h([r([o("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),p([e,e])]:[c(),p([e,e])],i,{left:"-10000px",position:"absolute"}))(((e,t=1)=>d([l([r([n("1","k-calendar-td k-alt")])].concat(u(e,(()=>r(u(t,(e=>n(`<span class="k-link">${e}</span>`,"k-calendar-td"))),"k-calendar-tr")))),"k-calendar-tbody")],"k-calendar-table"))(i,e),a,m)),g):null},v=e=>e.querySelector(".k-scrollable"),f=e=>{const t=v(e);return t.className=`${t.className} k-scrollable-horizontal`,e},w=g({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),b=g({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),D=g({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),y=e=>parseFloat(window.getComputedStyle(e).height)||e.offsetHeight,k=e=>{const t=window.getComputedStyle(e);return parseFloat(t.width)+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)||e.offsetWidth},S=e=>e.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(w(),(e=>{const t=S(e);this.calendarHeight=y(e),this.monthViewHeight=y(t),this.headerHeight=y(t.children[0]),this.scrollableContentHeight=y(v(e))})),this.batch(f(w()),(e=>{const t=S(e);this.calendarWidth=k(e),this.monthViewWidth=k(t),this.scrollableContentWidth=k(v(e))})),this.batch(b(),(e=>{this.yearViewHeight=y(S(e)),this.scrollableYearContentHeight=y(v(e))})),this.batch(f(b()),(e=>{this.yearViewWidth=k(S(e))})),this.batch(D(),(e=>{this.decadeViewHeight=y(S(e)),this.centuryViewHeight=this.decadeViewHeight})),this.batch(f(D()),(e=>{this.decadeViewWidth=k(S(e)),this.centuryViewWidth=this.decadeViewWidth})),this.batch(m(),(e=>{this.navigationItemHeight=y(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:Ve.PrevView,34:Ve.NextView,35:Ve.LastInView,36:Ve.FirstInView,37:Ve.Left,38:Ve.Up,39:Ve.Right,40:Ve.Down,"meta+38":Ve.UpperView,"meta+40":Ve.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===Ve.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,a),e):t===Ve.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,Ge=(e=Je.defaultProps.min,t=Je.defaultProps.max,i,s)=>void 0!==s?null!==s&&_(a.getDate(s),e,t)?s:null:null!==i&&_(a.getDate(i),e,t)?i:null,Xe=class e extends u.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=K(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=K(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})},s.validatePackage(p);const i=Ge(this.min,this.max,this.props.defaultValue||e.defaultProps.defaultValue,this.props.value);this.state={value:i,activeView:E(I[t.defaultActiveView],this.bottomView,this.topView),focusedDate:K(t.focusedDate||i||L(),this.min,this.max)},this.dom=new Ue,this.bus=new We(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(){Promise.resolve().then((()=>{s.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),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(){this.props._ref&&this.props._ref(this);const t=null!==this.value&&null!==this.oldValue?!a.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,i=E(this.state.activeView,I[void 0!==this.props.bottomView?this.props.bottomView:e.defaultProps.bottomView],I[void 0!==this.props.topView?this.props.topView:e.defaultProps.topView]),o=Ge(this.min,this.max,this.value,this.value),r=o?a.getDate(o):null;this.focusedDate=a.getDate(K(t&&null!==o?o:this.state.focusedDate,this.min,this.max)),this.intl=n.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(i,this.intl);const{smoothScroll:l=Number.parseFloat(u.version)<18}=this.props,h=s.classNames("k-widget k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber,"k-calendar-lg":this.props.mobileMode},this.props.className),d=[this.props.navigation&&u.createElement(Ee,{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}),u.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:l,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:r,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return u.createElement("div",{ref:e=>{this._element=e},className:h,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)}};Xe.displayName="Calendar",Xe.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,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}},Xe.defaultProps={disabled:!1,min:T,max:P,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};let Je=Xe;const Qe=s.createPropsContext(),et=s.withIdHOC(s.withPropsContext(Qe,Je));et.displayName="KendoReactCalendar",n.registerForIntl(Je);class tt{constructor(){this.symbols="",this.partMap=[]}}const it=(e,t)=>(e[t.pattern[0]]=t.type,e),st=["k-widget","k-dateinput"];let at=class{constructor(e,t,i){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=a.getDate(new Date),this.intlProvider=e,this.formatPlaceholder=t,this.format=i,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(e){e?a.isEqual(e,this._value)||(this._value=a.cloneDate(e),this.modifyExisting(!0)):(this._value=a.getDate(new Date),this.modifyExisting(!1))}hasValue(){return this.intl.splitDateFormat(this.format).reduce(((e,t)=>e||"literal"!==t.type&&"dayperiod"!==t.type&&this.getExisting(t.pattern[0])),!1)}getDateObject(){for(let e=0;e<this.knownParts.length;e++)if(!this.getExisting(this.knownParts[e]))return null;return a.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(e){const t=this.dateFormatString(this.value,this.format).symbols;for(let i=0;i<t.length;i++)this.setExisting(t[i],e)}getExisting(e){switch(e){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(e,t){switch(e){case"y":this.year=t,!1===t&&this._value.setFullYear(2e3);break;case"M":this.month=t,!1===t&&this._value.setMonth(0);break;case"d":this.date=t;break;case"h":case"H":this.hours=t;break;case"m":this.minutes=t;break;case"s":this.seconds=t;break;default:return}}modifyPart(e,t){let i=a.cloneDate(this.value);switch(e){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":i=a.addMonths(this.value,t);break;case"d":case"E":i.setDate(i.getDate()+t);break;case"h":case"H":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"a":i.setHours(i.getHours()+12*t)}this.setExisting(e,!0),this._value=i}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const i=this.intl.formatDate(this.value,this.format),s=this.dateFormatString(this.value,this.format),n=s.symbols;let o=!1,r="",l="",h="";for(let t=0;t<i.length;t++)n[t]===e?(l+=this.getExisting(e)?i[t]:"0",o=!0):o?h+=i[t]:r+=i[t];let d=null;const c=this.matchMonth(t);for(;l.length>0&&"0"===l.charAt(0);)l=l.slice(1);l.length>=4&&(l="");for(let i=0;i<2;i++){let i=l+t,s=parseInt(i,10);if(d=this.intl.parseDate(r+i+h,this.format),!d&&!isNaN(s)&&!isNaN(parseInt(t,10))){if("M"===e&&!c){const e=s-1;e>-1&&e<12&&(d=a.cloneDate(this.value),d.setMonth(e),d.getMonth()!==e&&(d=a.lastDayOfMonth(a.addMonths(d,-1))))}"y"===e&&(d=a.createDate(parseInt(i,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date&&d.getDate()!==this.value.getDate()&&(d=a.lastDayOfMonth(a.addMonths(d,-1))))}if(d)return this._value=d,this.setExisting(e,!0),{value:this.value};l=""}return c&&(d=this.intl.parseDate(r+c+h,this.format),d)?(this._value=d,this.setExisting(e,!0),{value:this.value}):("0"===t&&(this.leadingZero=this.isAbbrMonth(s.partMap,e)?null:{[e]:!0},this.setExisting(e,!1)),{value:null})}symbolMap(e){return this.intl.splitDateFormat(this.format).reduce(it,{})[e]}resetLeadingZero(){const e=null!==this.leadingZero;return this.leadingZero=null,e}isAbbrMonth(e,t){const i=this.partPattern(e,t);return"month"===i.type&&i.names}partPattern(e,t){return e.filter((e=>-1!==e.pattern.indexOf(t)))[0]}matchMonth(e){if(this.typedMonthPart+=e.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(let e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];const e=parseInt(this.typedMonthPart,10);if(e>=1&&e<=12&&e.toString()===this.typedMonthPart)return this.monthNames[e-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const e=this.intl.splitDateFormat(this.format);for(let t=0;t<e.length;t++)if("month"===e[t].type&&e[t].names)return this.intl.dateFormatNames(e[t].names);return[]}dateFormatString(e,t){const i=this.intl.splitDateFormat(t),s=[],a=[];for(let t=0;t<i.length;t++){let n=this.intl.formatDate(e,{pattern:i[t].pattern}).length;for(;n>0;)s.push(this.symbols[i[t].pattern[0]]||"_"),a.push(i[t]),n--}const n=new tt;return n.symbols=s.join(""),n.partMap=a,n}merge(e,t){let i="",s="",a=t.symbols;for(let n=a.length-1;n>=0;n--)if(-1===this.knownParts.indexOf(a[n])||this.getExisting(a[n]))i=e[n]+i,s=a[n]+s;else{const e=a[n];for(;n>=0&&e===a[n];)n--;for(n++,i=this.leadingZero&&this.leadingZero[e]?"0"+i:this.dateFieldName(t.partMap[n])+i;s.length<i.length;)s=a[n]+s}return{text:i,format:s}}dateFieldName(e){const t=this.formatPlaceholder||"wide";return t[e.type]?t[e.type]:"formatPattern"===t?e.pattern:this.intl.dateFieldName(Object.assign(e,{nameType:t}))}};const nt="dayperiod",ot="hour",rt="minute",lt="second",ht=e=>(t,i)=>{const s=a.cloneDate(t);return s[e](i),s},dt=[{type:ot,getter:e=>e.getHours()},{type:rt,getter:e=>e.getMinutes()},{type:lt,getter:e=>e.getSeconds()},{type:"millisecond",getter:e=>e.getMilliseconds()}],ct=(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))))(dt),ut=(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})))(dt),pt=e=>t=>{const i=a.cloneDate(t);return i.setHours(...e.map((e=>e(i)))),i},mt=ht("setHours"),gt=ht("setMinutes"),vt=ht("setSeconds"),ft=()=>new Date,wt=(e,t,i=1)=>{const s=[];for(let a=e;a<t;a+=i)s.push(a);return s},bt=(e,t,i)=>({candidateValue:N(V,e),maxValue:a.addDays(N(V,i),t.getHours()<i.getHours()?0:1),minValue:N(V,t)}),Dt=(e,t,i)=>{if(!e||!t||!i)return!0;const{candidateValue:s,minValue:a,maxValue:n}=bt(e,t,i);return a<=s&&s<=n},yt=(e,t)=>{if(null===e||null===t)return!1;const i=N(V,e),s=N(V,t);return i.getTime()<s.getHours()},kt=(e,t)=>{if(null===e||null===t)return!1;const i=N(V,e);return N(V,t).getTime()<i.getHours()},St=class e extends u.Component{constructor(t){super(t),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||e.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const t=n.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,i=this.value;this.kendoDate.setValue(t),this.triggerChange(e,i)},this.spinnersMouseDown=e=>{e.preventDefault();const t=s.getActiveElement(document);this.element&&t!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste)return this.updateOnPaste(e),void(this.paste=!1);const{text:t,format:i}=this.kendoDate.getTextAndFormat();this.currentFormat=i;const s=this.value,a=((e,t,i,s)=>{const a=e[s+e.length-i.length],n=e.substring(0,s+e.length-i.length),o=i.substring(0,s),r=[];if(n===o&&s>0)return r.push([t[s-1],o[s-1]]),r;if(0===n.indexOf(o)&&(0===o.length||t[o.length-1]!==t[o.length])){let e="";1===o.length&&r.push([t[0],o[0]]);for(let i=o.length;i<n.length;i++)t[i]!==e&&"_"!==t[i]&&(e=t[i],r.push([e,""]));return r}if(0===o.indexOf(n)||"_"===t[s-1]){let e=t[0];for(let i=Math.max(0,n.length-1);i<t.length;i++)if("_"!==t[i]){e=t[i];break}return[[e,o[s-1]]]}return" "===o[o.length-1]||o[o.length-1]===a?[[t[s-1],"_"]]:[[t[s-1],o[s-1]]]})(t,this.currentFormat,this.element.value,this.selection.start),n=1===a.length&&"_"===a[0][1];if(!n)for(let e=0;e<a.length;e++)this.kendoDate.parsePart(a[e][0],a[e][1]);a.length&&"_"!==a[0][0]&&this.setSelection(this.selectionBySymbol(a[0][0])),n&&this.switchDateSegment(1),this.triggerChange(e,s)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{s.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{s.getActiveElement(document)===this.element&&(e.nativeEvent.deltaY<0&&this.increasePart(e),e.nativeEvent.deltaY>0&&this.decreasePart(e))},this.increasePart=e=>{this.modifyDateSegmentValue(1,e)},this.decreasePart=e=>{this.modifyDateSegmentValue(-1,e)},this.elementKeyDown=e=>{if(!e.altKey){switch(e.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;default:return}e.preventDefault()}},this.elementOnFocus=e=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=e=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},s.validatePackage(p),this.state={focused:!1}}get _inputId(){return this.props.id+"-accessibility-id"}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(e,t){this._lastSelectedSymbol&&t.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):void 0!==this.props.placeholder&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:t=e.defaultProps.size,fillMode:i=e.defaultProps.fillMode,rounded:a=e.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const h=n.provideLocalizationService(this),d={...e.defaultProps,...this.props},{name:c,label:p,id:m}=d,g=this.text,v=g===this.props.placeholder?"":g,f=g===this.props.placeholder?g:void 0,w=m||this._inputId,b=!this.validityStyles||this.validity.valid;let D=[...st];this.props.className&&D.push(this.props.className);const y=u.createElement(s.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},(({onFocus:e,onBlur:n})=>u.createElement("span",{ref:e=>{this._wrapper=e},style:p?void 0:{width:this.props.width},dir:this.props.dir,className:s.classNames("k-dateinput","k-input",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${i}`]:i,[`k-rounded-${s.kendoThemeMaps.roundedMap[a]||a}`]:a,"k-invalid":!b,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:e,onBlur:n},u.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:void 0!==this.props.title?this.props.title:g,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",className:"k-input-inner",id:w,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:s.noop,value:v,placeholder:f,name:c,ref:e=>this._element=e}),this.props.children,this.props.spinners&&u.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:r.caretAltUpIcon,"aria-label":h.toLanguageString(te,ke[te]),title:h.toLanguageString(te,ke[te]),onClick:this.increasePart}),u.createElement(o.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,"aria-label":h.toLanguageString(ie,ke[ie]),title:h.toLanguageString(ie,ke[ie]),onClick:this.decreasePart})))));return p?u.createElement(l.FloatingLabel,{label:p,editorId:w,editorValue:g,editorValid:b,editorDisabled:this.props.disabled,children:y,style:{width:this.props.width}}):y}get value(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}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 text(){const t={...It.defaultProps,...this.props},{formatPlaceholder:i=e.defaultProps.formatPlaceholder,format:s=e.defaultProps.format,value:a,defaultValue:n}=t;null===this.kendoDate?(this.kendoDate=new at(this.intl.bind(this),i,s),this.kendoDate.setValue(a||n||null)):(this.kendoDate.format=s,this.kendoDate.formatPlaceholder=i),void 0!==a&&this.value!==a&&this.kendoDate.setValue(a);const{text:o,format:r}=this.kendoDate.getTextAndFormat();return this.currentFormat=r,null===t.placeholder||void 0===t.placeholder||this.state.focused||this.kendoDate.hasValue()?o:t.placeholder}get validity(){const e=((e,t,i)=>null===e||!(t&&t>e||i&&i<e))(this.value,this.min,this.max)&&Dt(this.value,this.props.minTime,this.props.maxTime),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 element(){return this._element}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get wrapper(){return this._wrapper}intl(){return n.provideIntlService(this)}get selection(){let e={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(e={start:this.element.selectionStart,end:this.element.selectionEnd}),e}setSelection(e){this._lastSelectedSymbol=this.currentFormat[e.start],window.requestAnimationFrame((()=>{const t=s.getActiveElement(document);this.element&&t===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(e.start,e.end)}))}triggerChange(e,t){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!a.isEqual(t,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(e){let t=-1,i=0;for(let s=0;s<this.currentFormat.length;s++)this.currentFormat[s]===e&&(i=s+1,-1===t&&(t=s));return t<0&&(t=0),{start:t,end:i}}selectionByIndex(e){let t={start:e,end:e};for(let i=e,s=e-1;i<this.currentFormat.length||s>=0;i++,s--){if(i<this.currentFormat.length&&"_"!==this.currentFormat[i]){t=this.selectionBySymbol(this.currentFormat[i]);break}if(s>=0&&"_"!==this.currentFormat[s]){t=this.selectionBySymbol(this.currentFormat[s]);break}}return t}switchDateSegment(e){const{start:t,end:i}=this.selection;if(t<i&&this.currentFormat[t]!==this.currentFormat[i-1])return void this.setSelection(this.selectionByIndex(e>0?t:i-1));const s=this.currentFormat[t];let a=t+e;for(;a>0&&a<this.currentFormat.length&&(this.currentFormat[a]===s||"_"===this.currentFormat[a]);)a+=e;if("_"===this.currentFormat[a])return;let n=a;for(;n>=0&&n<this.currentFormat.length&&this.currentFormat[n]===this.currentFormat[a];)n+=e;a>n&&(n+1!==t||a+1!==i)?this.setSelection({start:n+1,end:a+1}):a<n&&(a!==t||n!==i)&&this.setSelection({start:a,end:n})}modifyDateSegmentValue(e,t){if(!this.kendoDate)return;const i=this.value,s=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(s),n=((this.props.steps||{})[a]||1)*e;this.kendoDate.modifyPart(s,n),this.triggerChange(t,i)}};St.displayName="DateInput",St.propTypes={value: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})]),width:i.oneOfType([i.string,i.number]),tabIndex:i.number,title:i.string,steps:i.shape({year:i.number,month:i.number,day:i.number,hour:i.number,minute:i.number,second:i.number}),min:i.instanceOf(Date),max:i.instanceOf(Date),disabled:i.bool,spinners:i.bool,name:i.string,dir:i.string,label:i.string,id:i.string,ariaLabelledBy:i.string,ariaDescribedBy:i.string,ariaLabel:i.string,ariaRole:i.string,ariaHasPopup:i.oneOfType([i.bool,i.string]),ariaExpanded:i.oneOfType([i.bool]),onChange:i.func,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"])},St.defaultProps={format:"d",size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:"wide",spinners:!1,disabled:!1,max:a.cloneDate(P),min:a.cloneDate(T),minTime:a.cloneDate(F),maxTime:a.cloneDate(R),required:!1,validityStyles:!0,validationMessage:"Please enter a valid value!",placeholder:null,ariaHasPopup:"grid"};let xt=St;const Ct=s.createPropsContext(),It=s.withIdHOC(s.withPropsContext(Ct,xt));It.displayName="KendoReactDateInput",n.registerForIntl(xt),n.registerForLocalization(xt);const Mt=o.Button,Ot=u.forwardRef(((e,t)=>{const{_ref:i}=e,a=u.useRef(null);u.useImperativeHandle(t,(()=>a.current)),u.useImperativeHandle(i,(()=>a.current));const n=u.useMemo((()=>s.classNames(e.className,"k-picker-wrap")),[e.className]);return u.createElement("span",{ref:a,id:e.id,style:e.style,className:n,tabIndex:e.tabIndex},e.children)})),Et=e=>{const t=(e=>{const[t,i]=u.useState(!1);return u.useEffect((()=>{e.current&&i(!!e.current.text)})),{editorValue:t}})(e.dateInput);return u.createElement(l.FloatingLabel,{...e,...t})},Vt=e=>{const{footer:t,children:i,windowWidth:s=0,navigatable:a,navigatableElements:n,expand:l,animation:h,onClose:c,adaptiveTitle:p,mobileFilter:m}=e,g={navigatable:a||!1,navigatableElements:n||[],expand:l,animation:!1!==h,onClose:c,animationStyles:s<=500?{top:0,width:"100%",height:"100%"}:void 0,className:s<=500?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return u.createElement(d.ActionSheet,{...g},u.createElement(d.ActionSheetHeader,{className:"k-text-center"},u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",null,p)),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(o.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:r.xIcon,onClick:c}))),m&&u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),i,t&&u.createElement(d.ActionSheetFooter,{className:"k-actions k-actions-stretched"},u.createElement(o.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),u.createElement(o.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},Tt=768,Pt=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=e=>{this._calendar=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.renderPopup=()=>{const{disabled:e,min:t,max:i,weekNumber:n,focusedDate:o}=this.props,{popupClass:r,...l}=this.props.popupSettings,h=this.show,d=this.value,c=d&&a.getDate(d),p=s.classNames("k-calendar-container k-group k-reset",r),m={popupClass:"k-datepicker-popup",show:h,anchor:this._element,className:p,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...l},g={disabled:e,value:c,min:t,max:i,weekNumber:n,focusedDate:o,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?u.createElement(this.calendarComp,{_ref:this.setCalendarRef,...g}):u.createElement(this.popupComp,{...m},u.createElement(this.calendarComp,{_ref:this.setCalendarRef,...g}))},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e};return u.createElement(Vt,{...t},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=e=>{this.handleValueChange(e.value,e)},this.handleCalendarValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange(t,e)},this.handleValueChange=(e,t)=>{this.setState({value:a.cloneDate(e||void 0)}),this.valueDuringOnChange=e,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.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.handleIconClick=()=>{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))},s.validatePackage(p),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 mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Tt&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}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 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 toggleButtonComp(){return this.props.toggleButton||e.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||e.defaultProps.calendar}get popupComp(){return this.props.popup||e.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||e.defaultProps.pickerWrap}get validity(){const e=B(this.value,this.min,this.max),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:e.defaultProps.required}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._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),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;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,disabled:o,tabIndex:l,title:h,id:d,format:c,formatPlaceholder:p,min:m,max:g,className:v,width:f,name:w,validationMessage:b,required:D,validityStyles:y,ariaLabelledBy:k,ariaDescribedBy:S,ariaLabel:x}=this.props,C=this.show,I=this.value,M=!this.validityStyles||this.validity.valid,O={disabled:o,format:c,formatPlaceholder:p,id:d,ariaLabelledBy:k,ariaDescribedBy:S,ariaLabel:x,max:g,min:m,name:w,onChange:this.handleInputValueChange,required:D,tabIndex:C?-1:l,title:h,valid:this.validity.valid,validationMessage:b,validityStyles:y,value:I,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},E=n.provideLocalizationService(this).toLanguageString(ae,ke[ae]),V=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(({onFocus:e,onBlur:n})=>u.createElement(u.Fragment,null,u.createElement("span",{ref:e=>{this._element=e},className:s.classNames("k-input","k-datepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!M,"k-required":this.required,"k-disabled":this.props.disabled},v),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:e,onBlur:n,onClick:this.mobileMode?this.handleIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...O}),u.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:r.calendarIcon,title:E,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":E,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Et,{dateInput:this._dateInput,label:this.props.label,editorId:d,editorValid:M,editorDisabled:this.props.disabled,children:V,style:{width:this.props.width}}):V}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?N(e,this.value):e}nextTick(e){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout((()=>e()))}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}};Pt.displayName="DatePicker",Pt.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,ariaLabel: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,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},Pt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:It,calendar:et,toggleButton:Mt,popup:h.Popup,pickerWrap:Ot,disabled:!1,format:"d",max:P,min:T,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};let Ft=Pt;const Rt=s.createPropsContext(),Nt=s.withIdHOC(s.withPropsContext(Rt,Ft));Nt.displayName="KendoReactDatePicker",n.registerForLocalization(Ft);const Lt=(e,t)=>{const i=a.cloneDate(e);return i.setHours(t),i},_t=e=>null!==e&&e<12,Bt=(e,t,i)=>!t&&!i||e>=t&&e<=i,At=(e,t,i)=>!t&&!i||e>=t||e<=i;let Ht=class{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),s=_t(i),a=_t(t.getHours());if(s&&a||!s&&!a)return e;const[n,o=24]=this.normalizedRange(),r=i+(a?-12:12);return Lt(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 _t(s)&&i.push({text:n.am,value:Lt(this.min,s)}),(e=>null!==e&&(!e||e>11))(a)&&i.push({text:n.pm,value:Lt(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]?At:Bt)(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)]}},zt=class{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){void 0===this.timeListHeight&&this.calculateHeights()}calculateHeights(e){if(!s.canUseDOM)return;const t=W("div"),i=W("span"),a=W("ul"),n=W("li"),o=t([i("minute","k-title"),t([t([a([n("<span>02</span>","k-item")],"k-reset")],"k-content k-scrollable k-time-container")],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}),r=e&&e.querySelector(".k-time-container")||document.body,l=r.appendChild(o);this.timeListHeight=l.querySelector(".k-scrollable").offsetHeight,this.itemHeight=l.querySelector("li").offsetHeight,r.removeChild(l),this.didCalculate=!0}};const qt=(e=>t=>t%e)(24),Kt=(e,t)=>qt(24+e-t),Wt=e=>(t,i)=>i&&a.getDate(t).getTime()!==a.getDate(i).getTime()?mt(t,e):t,Ut=Wt(0),Yt=Wt(23);class $t{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 mt(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=mt(V,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=>qt(e+i*t))(t,this.step),s=wt(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?[Ut(e,i),Yt(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(Kt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(mt(this.max,this.lastHour(e)))}divideByStep(e){return Kt(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 jt=(e=>t=>t%e)(60),Zt=(e,t)=>jt(60+e-t),Gt=e=>(t,i)=>i&&t.getHours()!==i.getHours()?gt(t,e):t,Xt=Gt(0),Jt=Gt(59);let Qt=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 gt(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=gt(V,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=>jt(e+i*t))(t,this.step),s=wt(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),Jt(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(Zt(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(gt(this.max,this.lastMinute(e)))}divideByStep(e){return Zt(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 ei=(e=>t=>t%e)(60),ti=(e,t)=>ei(60+e-t),ii=e=>(t,i)=>!i||t.getMinutes()===i.getMinutes()&&t.getHours()===i.getHours()?t:vt(t,e),si=ii(0),ai=ii(59);class ni{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return vt(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=vt(V,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=>ei(e+i*t))(t,this.step),s=wt(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[si(e,i),ai(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 ti(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(ti(i,t)/this.step)+1}isMissing(e){return!!e&&this.selectedIndex(e)!==this.divideByStep(e)}isLastMissing(e){return null!==this.max&&this.isMissing(vt(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 oi={[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]},ri={[nt]:Ht,[ot]:$t,[rt]:Qt,[lt]:ni},li=class e extends u.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=(oi[e.keyCode]||s.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));i&&this.handleChange(i)},this.handleChange=U((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 zt}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((()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())}))}componentDidUpdate(){if(!this.virtualization||!this.service)return;const e=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](e),this.animateToIndex=!0}render(){if(!this.props.part.type||!ri[this.props.part.type])return;this.calculateHeights(),this.intl=n.provideIntlService(this),this.service=new ri[this.props.part.type](this.intl),this.configureServices();const e=this.service.data(this.props.value),t="translateY("+this.topOffset+"px)",i=this.service.total(this.props.value),s=u.createElement("ul",{style:{transform:t,msTransform:t},className:"k-reset"},e.map(((e,t)=>u.createElement("li",{key:t,className:"k-item",onClick:()=>{this.handleChange(e)}},u.createElement("span",null,e.text)))));return u.createElement("div",{className:"k-time-list",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?u.createElement(S,{bottomOffset:this.bottomOffset,children:s,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:e=>{this.virtualization=e},role:"presentation",skip:0,tabIndex:-1,take:i,topOffset:this.topOffset,total:i}):u.createElement("div",{className:"k-time-container"},s))}};li.propTypes={id:i.number,max:i.instanceOf(Date),min:i.instanceOf(Date),part:function(e,t,i){const s=e[t];if(!s||!ri[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},li.defaultProps={boundRange:!1,max:R,min:V,step:1,smoothScroll:!0};let hi=li;n.registerForIntl(hi);const di=new RegExp(`${ot}|${rt}|${lt}|${nt}|literal`),ci=class e extends u.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?di.test(s.type||""):di.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&&Dt(ft(),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=pt(ut(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}=bt(e,t,i);return s<a?N(e,t):s>n?N(e,i):e})(this.snapTime(a.cloneDate(this.props.value||V)),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:d,onNowKeyDown:c}=this.props;this.snapTime=pt(ut(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(t||e.defaultProps.format).filter(this.timeFormatFilter);const p=s.classNames({"k-disabled":l,"k-time-part":h},r);this.timeLists=[];const m=n.provideLocalizationService(this),g=m.toLanguageString(ce,ke[ce]);return u.createElement("div",{className:p},u.createElement("div",{className:"k-time-header"},u.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&u.createElement(o.Button,{type:"button",ref:e=>{this._nowButton=e},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:g,onKeyDown:c,"aria-label":g,onClick:a,tabIndex:l?-1:0},m.toLanguageString(de,ke[de]))),u.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},u.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map(((e,t)=>"literal"!==e.type?u.createElement("div",{key:t,className:s.classNames("k-time-list-wrapper",{"k-focus":t===this.state.activeListIndex}),role:"presentation",tabIndex:-1},u.createElement("span",{className:"k-title",onMouseDown:e=>{e.preventDefault()}},this.intl.dateFieldName(e)),u.createElement(hi,{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:d,mobileMode:h})):u.createElement("div",{key:t,className:"k-time-separator"},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)}};ci.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},ci.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:F,max:R,steps:{},boundRange:!1};let ui=ci;n.registerForIntl(ui),n.registerForLocalization(ui);const pi=class e extends u.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||ft()),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||ft()),ft());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))(ct(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||V,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:d,boundRange:c,nowButton:p,steps:m,show:g,mobileMode:v}=this.props,f=n.provideLocalizationService(this),w=f.toLanguageString(ue,ke[ue]),b=f.toLanguageString(pe,ke[pe]);return u.createElement("div",{ref:e=>{this._element=e},tabIndex:i?void 0:a||0,className:s.classNames("k-timeselector",r,{"k-disabled":i}),onKeyDown:this.handleKeyDown},u.createElement(ui,{ref:e=>{this.timePart=e},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:e,smoothScroll:l,min:h,max:d,boundRange:c,disabled:i,nowButton:p,steps:m,show:g,mobileMode:v,onNowKeyDown:this.handleNowKeyDown}),this.props.footer&&u.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},t&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:"k-time-cancel",onClick:this.handleReject,title:w,"aria-label":w},w),u.createElement(o.Button,{type:"button",ref:e=>{this._acceptButton=e},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,onKeyDown:this.revertToNowButton,title:b,"aria-label":b},b)))}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}};pi.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},pi.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:F,max:R,boundRange:!1,footer:!0};let mi=pi;n.registerForIntl(mi),n.registerForLocalization(mi);const gi=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:s,format:a,steps:n}=this.props;return u.createElement(mi,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",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})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=s.classNames("k-group k-reset",e),a={popupClass:"k-timepicker-popup",show:this.show,animate:null!==this.element,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?u.createElement(this.props.popup,{...a},this.renderTimeSelector()):u.createElement(h.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(ge,ke[ue]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(pe,ke[pe]),onApply:e=>this.handleValueChange(e)}};return u.createElement(Vt,{...t},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},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.value||this.state.candidate;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.handleIconClick=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))},s.validatePackage(p),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}=bt(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:kt(e,i),rangeUnderflow:yt(e,t),valid:o,valueMissing:null===this.value}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Tt&&this.props.adaptive)}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}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.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:d,className:c,format:p,formatPlaceholder:m,width:g,name:v,steps:f,validationMessage:w,required:b,validityStyles:D,ariaLabelledBy:y,ariaDescribedBy:k}=this.props,S=!this.validityStyles||this.validity.valid,x={disabled:n,format:p,formatPlaceholder:m,id:d,ariaLabelledBy:y,ariaDescribedBy:k,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,readonly:this.mobileMode},C=this.localizationService.toLanguageString(ge,ke[ge]),I=this.localizationService.toLanguageString(me,ke[me]),M=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},(({onFocus:e,onBlur:n})=>u.createElement(u.Fragment,null,u.createElement("div",{id:this.props.id,ref:e=>{this._element=e},className:s.classNames("k-input","k-timepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!S,"k-required":this.required,"k-disabled":this.props.disabled},c),onKeyDown:this.handleKeyDown,style:{width:g},onFocus:e,onBlur:n,onClick:this.mobileMode?this.handleIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...x}),u.createElement(o.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:r.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:I,className:"k-input-button",rounded:null,"aria-label":C}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())));return this.props.label?u.createElement(Et,{dateInput:this._dateInput,label:this.props.label,editorId:d,editorValid:S,editorDisabled:this.props.disabled,children:M,style:{width:this.props.width}}):M}normalizeTime(e){return N(V,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?N(this.value,e):e}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}};gi.displayName="TimePicker",gi.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"])},gi.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:R,min:F,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid"};let vi=gi;const fi=s.createPropsContext(),wi=s.withIdHOC(s.withPropsContext(fi,vi));wi.displayName="KendoReactTimePicker",n.registerForLocalization(vi);const bi=class e extends u.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.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 u.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map((t=>u.createElement("table",{className:"k-calendar-table k-content",key:t.getTime(),role:"grid"},u.createElement(Z,{bus:this.props.bus,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,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell})))))}};bi.defaultProps={showWeekNumbers:!1,views:2,take:2,allowReverse:!0,min:T,max:P};let Di=bi;const yi=(e=Ii.defaultProps.min,t=Ii.defaultProps.max,i)=>i instanceof Date&&!Array.isArray(i)&&_(a.getDate(i),e,t)?a.getDate(i):null,ki=(e=Ii.defaultProps.min,t=Ii.defaultProps.max,i)=>Array.isArray(i)?i.filter((i=>_(i,e,t))).map((e=>a.getDate(e))):null,Si=e=>"object"!=typeof e||e instanceof Date||null===e||Array.isArray(e)?M:e,xi=(e,t,i)=>e||t&&t[0]||i&&i.start,Ci=class e extends u.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.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=>K(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=Ve.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(Ve.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=K(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.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};const i=void 0!==t.value?t.value:t.defaultValue||e.defaultProps.defaultValue,n=yi(this.min,this.max,i),o=ki(this.min,this.max,i),r=Si(i),l=xi(n,o,r),h=E(I[t.defaultActiveView],this.bottomView,this.topView),d=K(t.focusedDate||l||L(),this.min,this.max);this.state={value:i,activeView:h,focusedDate:d,navigateDate:d},this.activeRangeEnd=((e,t)=>null===e.start&&null===t?"start":null===e.end?"end":"start")(r,n),this.bus=new We(this.handleViewChange),this.navigation=new $e(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||Di.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 _(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=yi(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||Di.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=E(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(e,this.intl),this.selectedDate=yi(this.min,this.max,this.value),this.selectedMultiple=ki(this.min,this.max,this.value),this.selectedRange=Si(this.value);const t=xi(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=K(this.calculateFocusFromValue&&null!==t?t:this.state.focusedDate,this.min,this.max);const i=s.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),l=this.rangeWithFocused(this.selectedRange,this.focusedDate),h=this.localization.toLanguageString(Q,ke[Q]),d=this.localization.toLanguageString(ee,ke[ee]),c=!this.canNavigate(Ve.PrevView),p=!this.canNavigate(Ve.NextView),m={"aria-disabled":c},g={"aria-disabled":p},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||Di.defaultProps.views));const b=a.cloneDate(this.dates&&this.dates[0]?this.dates[0]:L());return u.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},u.createElement(J,{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:u.createElement(u.Fragment,null,u.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:c,onClick:this.handlePrevButtonClick,...m}),u.createElement(xe,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),u.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:d,disabled:p,onClick:this.handleNextButtonClick,...g}))}),u.createElement(Di,{ref:e=>{this.calendarViewList=e},dates:this.dates,activeView:e,focusedDate:this.focusedDate,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,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(e,t){return!!t&&a.firstDayOfMonth(t)<=e&&e<=a.lastDayOfMonth(t)}};Ci.displayName="MultiViewCalendar",Ci.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([O(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:O(i.instanceOf(Date)),end:O(i.instanceOf(Date))})]),disabled:i.bool,focusedDate:i.instanceOf(Date),id:i.string,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([O(i.instanceOf(Date)),i.arrayOf(i.instanceOf(Date)),i.shape({start:O(i.instanceOf(Date).isRequired),end:O(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,dir:i.string},Ci.defaultProps={disabled:!1,min:T,max:P,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};let Ii=Ci;const Mi=s.createPropsContext(),Oi=s.withIdHOC(s.withPropsContext(Mi,Ii));Oi.displayName="KendoReactMultiViewCalendar",n.registerForIntl(Ii),n.registerForLocalization(Ii);const Ei=class e extends u.Component{constructor(t){super(t),this._element=null,this._calendar=null,this._startDateInput=u.createRef(),this._endDateInput=u.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!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?u.createElement(this.props.calendar,{...t}):u.createElement(Oi,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={popupClass:"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?u.createElement(this.props.popup,{...e},this.renderCalendar()):u.createElement(h.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:e=>this.handleCancel(e),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(De,ke[De]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(ye,ke[ye]),onApply:this.handleBlur}};return u.createElement(Vt,{...t},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},u.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},s.validatePackage(p),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(){return!!(this.state.windowWidth&&this.state.windowWidth<=Tt&&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.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 e=this.value||M,t=this.mobileMode&&this.show?this.state.currentValue:e,i=(this.props.startDateInputSettings||{}).id||this._startInputId,a=(this.props.endDateInputSettings||{}).id||this._endInputId,l=s.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),h=this.localizationService.toLanguageString(oe,ke[oe]),d=this.localizationService.toLanguageString(re,ke[re]),c=this.localizationService.toLanguageString(le,ke[le]),p={disableSelection:this.mobileMode&&!0,label:h,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,...this.props.startDateInputSettings,value:t.start,onChange:this.handleStartChange},m={disableSelection:this.mobileMode&&!0,label:d,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,...this.props.endDateInputSettings,value:t.end,onChange:this.handleEndChange},g=u.createElement(o.Button,{type:"button",className:"k-select",fillMode:"flat",title:n.provideLocalizationService(this).toLanguageString(ne,ke[ne]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":i+" "+a,"aria-label":n.provideLocalizationService(this).toLanguageString(ne,ke[ne])},u.createElement(s.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:r.arrowsSwapIcon}));return u.createElement(u.Fragment,null,u.createElement("span",{ref:e=>{this._element=e},className:l,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onBlur:this.mobileMode?void 0:this.handleBlur,dir:this.props.dir},this.props.startDateInput?u.createElement(this.props.startDateInput,{...p}):u.createElement(It,{...p,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?g:c,this.props.endDateInput?u.createElement(this.props.endDateInput,{...m}):u.createElement(It,{...m,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}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(let t of e)this.setState({windowWidth:t.target.clientWidth})}};Ei.displayName="DateRangePicker",Ei.propTypes={allowReverse:i.bool,calendarSettings:i.any,className:i.string,defaultShow:i.bool,defaultValue:i.shape({start:O(i.instanceOf(Date).isRequired),end:O(i.instanceOf(Date).isRequired)}),disabled:i.bool,endDateInputSettings:i.shape(xt.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:O(i.instanceOf(Date).isRequired),end:O(i.instanceOf(Date).isRequired)})},Ei.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:M,disabled:!1,format:"d",max:P,min:T,swapButton:!1};let Vi=Ei;const Ti=s.createPropsContext(),Pi=s.withIdHOC(s.withPropsContext(Ti,Vi));Pi.displayName="KendoReactDateRangePicker",n.registerForLocalization(Vi);const Fi=class extends u.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-widget.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}=this.props,t=this.localizationService.toLanguageString(we,ke[we]),i=this.localizationService.toLanguageString(be,ke[be]);return u.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched"},e&&u.createElement(o.Button,{type:"button",ref:e=>{this._cancelButton=e},className:"k-time-cancel",onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:t,"aria-label":t},t),u.createElement(o.Button,{type:"button",themeColor:"primary",ref:e=>{this._acceptButton=e},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:i,"aria-label":i},i))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||V});const t=this.mergeDate(this.props.value,this.props.value||V);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:ft()}),this.handleAccept(e,ft())},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||V}}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({dateValue:e.value&&this.props.value&&a.isEqualDate(e.value,this.props.value)?this.state.dateValue:this.props.value,timeValue:this.props.value||V}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:n,format:r,mobileMode:l,footerActions:h}=this.props,d=s.classNames({"k-date-tab":"date"===this.state.tab,"k-time-tab":"time"===this.state.tab,"k-disabled":e},"k-datetime-wrap"),c=this.localizationService.toLanguageString(ve,ke[ve]),p=this.localizationService.toLanguageString(fe,ke[fe]),m={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 u.createElement("div",{onKeyDown:this.handleKeyDown,className:d,tabIndex:-1},u.createElement("div",{className:"k-datetime-buttongroup"},u.createElement(o.ButtonGroup,{width:"100%"},u.createElement(o.Button,{ref:e=>this._dateButtonRef=e,type:"button",selected:"date"===this.state.tab,togglable:!0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},c),u.createElement(o.Button,{type:"button",selected:"time"===this.state.tab,togglable:!0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},p))),u.createElement("div",{className:"k-datetime-selector"},u.createElement("div",{className:"k-datetime-calendar-wrap",ref:e=>this._calendarWrap=e},this.props.calendar?u.createElement(this.props.calendar,{key:this.state.tab,...m}):u.createElement(et,{key:this.state.tab,ref:e=>{this._calendar=e},...m})),u.createElement("div",{className:"k-datetime-time-wrap"},u.createElement("div",{className:l?"k-reset k-timeselector-lg k-timeselector":""},u.createElement(ui,{key:1,onNowClick:this.handleNowClick,disabled:e||"time"!==this.state.tab,ref:e=>{this._timePart=e},min:this.minTime||F,max:this.maxTime||R,steps:this.props.steps,value:this.state.timeValue,format:r,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:l})))),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?N(t,e):t}mergeDate(e,t){return e?N(e||L(),t):t}};Fi.defaultProps={footerActions:!0};let Ri=Fi;n.registerForLocalization(Ri);const Ni=class e extends u.Component{constructor(t){super(t),this._element=null,this._dateInput=u.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}=this.props;return u.createElement(Ri,{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})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=n.provideLocalizationService(this).toLanguageString(we,ke[we]),i=n.provideLocalizationService(this).toLanguageString(be,ke[be]),s={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,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 u.createElement(Vt,{...s},u.createElement(d.ActionSheetContent,{className:"!k-overflow-hidden"},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.handleDateIconClick=()=>{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"),s.validatePackage(p),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(){return!!(this.state.windowWidth&&this.state.windowWidth<=Tt&&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=B(this.value,this.min,this.max)&&Dt(this.value,this.props.minTime||F,this.props.maxTime||R),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:e.defaultProps.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}),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,disabled:l,tabIndex:d,title:c,id:p,format:m,formatPlaceholder:g,min:v,max:f,className:w,width:b,name:D,validationMessage:y,required:k,validityStyles:S,minTime:x,maxTime:C,ariaLabelledBy:I,ariaDescribedBy:M,popup:O=h.Popup}=this.props,E=!this.validityStyles||this.validity.valid,V={id:p,ariaLabelledBy:I,ariaDescribedBy:M,format:m,formatPlaceholder:g,disabled:l,title:c,validityStyles:S,validationMessage:y,required:k,min:v,max:f,minTime:x,maxTime:C,name:D,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},T=u.createElement(s.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},(({onFocus:e,onBlur:l})=>u.createElement(u.Fragment,null,u.createElement("div",{ref:e=>{this._element=e},className:s.classNames("k-input","k-datetimepicker",{[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-input-${a}`]:a,"k-invalid":!E,"k-required":this.required,"k-disabled":this.props.disabled},w),onKeyDown:this.handleKeyDown,style:{width:b},onFocus:this.mobileMode?void 0:e,onBlur:l,onClick:this.mobileMode?this.handleDateIconClick:void 0},u.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...V}),u.createElement(o.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:r.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:n.provideLocalizationService(this).toLanguageString(he,ke[he]),className:"k-input-button",rounded:null,"aria-label":n.provideLocalizationService(this).toLanguageString(he,ke[he])}),u.createElement(O,{show:this.show,animate:null!==this.element,anchor:this.element,popupClass:"k-datetime-container k-reset",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?u.createElement(Et,{dateInput:this._dateInput,label:this.props.label,editorId:p,editorValid:E,editorDisabled:this.props.disabled,children:T,style:{width:this.props.width}}):T}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})}};Ni.displayName="DateTimePicker",Ni.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"])},Ni.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:P,min:T,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:It,size:"medium",rounded:"medium",fillMode:"solid"};let Li=Ni;const _i=s.createPropsContext(),Bi=s.withIdHOC(s.withPropsContext(_i,Li));Bi.displayName="KendoReactDateTimePicker",n.registerForLocalization(Li),e.Action=Ve,e.BusViewService=We,e.Calendar=et,e.CalendarCell=x,e.CalendarHeaderTitle=G,e.CalendarNavigationItem=Me,e.CalendarPropsContext=Qe,e.CalendarViewEnum=I,e.CalendarWeekCell=C,e.CalendarWithoutContext=Je,e.CenturyViewService=Fe,e.DOMService=Ue,e.DateInput=It,e.DateInputPropsContext=Ct,e.DateInputWithoutContext=xt,e.DatePicker=Nt,e.DatePickerPropsContext=Rt,e.DatePickerWithoutContext=Ft,e.DateRangePicker=Pi,e.DateRangePickerPropsContext=Ti,e.DateRangePickerWithoutContext=Vi,e.DateTimePicker=Bi,e.DateTimePickerPropsContext=_i,e.DateTimePickerWithoutContext=Li,e.DayPeriodService=Ht,e.DecadeViewService=Le,e.EMPTY_SELECTIONRANGE=M,e.Header=J,e.HorizontalViewList=Di,e.HoursService=$t,e.MAX_DATE=P,e.MAX_TIME=R,e.MIN_DATE=T,e.MIN_TIME=F,e.MinutesService=Qt,e.MonthViewService=Ae,e.MultiViewCalendar=Oi,e.MultiViewCalendarPropsContext=Mi,e.MultiViewCalendarWithoutContext=Ii,e.NavigationService=$e,e.PickerWrap=Ot,e.ScrollSyncService=je,e.SecondsService=ni,e.TimeList=hi,e.TimePart=ui,e.TimePicker=wi,e.TimePickerPropsContext=fi,e.TimePickerWithoutContext=vi,e.TimeSelector=mi,e.TodayCommand=xe,e.ToggleButton=Mt,e.ViewList=Ie,e.Virtualization=S,e.WeekNamesService=Y,e.YearViewService=qe,e.dateInputsMessages=ke,e.decreaseValue=ie,e.end=re,e.getNow=ft,e.getToday=L,e.increaseValue=te,e.separator=le,e.start=oe,e.swapStartEnd=ne,e.today=se,e.toggleCalendar=ae,e.toggleDateTimeSelector=he}));