@blueprintjs/datetime
Version:
Components for interacting with dates and times
1 lines • 67.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("classnames"),require("react"),require("react-day-picker"),require("tslib")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","classnames","react","react-day-picker","tslib"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("classnames"),require("react"),require("react-day-picker"),require("tslib")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Datetime=t(e.Blueprint.Core,e.classNames,e.React,e.DayPicker,e.window))}(self,(function(e,t,n,a,r){return function(){"use strict";var o={762:function(t){t.exports=e},905:function(e){e.exports=t},359:function(e){e.exports=n},726:function(e){e.exports=a},532:function(e){e.exports=r}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,s),n.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return function(){s.r(u),s.d(u,{Classes:function(){return pt},DateInput:function(){return nt},DatePicker:function(){return tt},DatePickerUtils:function(){return at},DateRangeInput:function(){return ct},DateRangePicker:function(){return ut},DateTimePicker:function(){return rt},DateUtils:function(){return t},Months:function(){return n},TimePicker:function(){return Ze},TimePrecision:function(){return Qe},TimeUnit:function(){return re}});var e={};s.r(e),s.d(e,{DATEINPUT:function(){return o},DATEINPUT_POPOVER:function(){return i},DATEPICKER:function(){return l},DATEPICKER_CAPTION:function(){return c},DATEPICKER_CAPTION_CARET:function(){return p},DATEPICKER_CAPTION_MEASURE:function(){return d},DATEPICKER_CAPTION_SELECT:function(){return h},DATEPICKER_CONTENT:function(){return g},DATEPICKER_DAY:function(){return v},DATEPICKER_DAY_DISABLED:function(){return f},DATEPICKER_DAY_IS_TODAY:function(){return y},DATEPICKER_DAY_OUTSIDE:function(){return m},DATEPICKER_DAY_SELECTED:function(){return D},DATEPICKER_DAY_WRAPPER:function(){return S},DATEPICKER_FOOTER:function(){return E},DATEPICKER_MONTH_SELECT:function(){return I},DATEPICKER_NAVBAR:function(){return M},DATEPICKER_NAVBUTTON:function(){return R},DATEPICKER_TIMEPICKER_WRAPPER:function(){return P},DATEPICKER_YEAR_SELECT:function(){return C},DATERANGEPICKER:function(){return T},DATERANGEPICKER_CALENDARS:function(){return _},DATERANGEPICKER_CONTIGUOUS:function(){return A},DATERANGEPICKER_DAY_HOVERED_RANGE:function(){return F},DATERANGEPICKER_DAY_SELECTED_RANGE:function(){return x},DATERANGEPICKER_SHORTCUTS:function(){return b},DATERANGEPICKER_SINGLE_MONTH:function(){return N},DATERANGEPICKER_TIMEPICKERS:function(){return w},DATETIMEPICKER:function(){return k},TIMEPICKER:function(){return O},TIMEPICKER_AMPM_SELECT:function(){return j},TIMEPICKER_ARROW_BUTTON:function(){return B},TIMEPICKER_ARROW_ROW:function(){return V},TIMEPICKER_DIVIDER_TEXT:function(){return U},TIMEPICKER_HOUR:function(){return H},TIMEPICKER_INPUT:function(){return Y},TIMEPICKER_INPUT_ROW:function(){return K},TIMEPICKER_MILLISECOND:function(){return L},TIMEPICKER_MINUTE:function(){return G},TIMEPICKER_SECOND:function(){return q}});var t={};s.r(t),s.d(t,{areEqual:function(){return J},areRangesEqual:function(){return X},areSameDay:function(){return z},areSameMonth:function(){return Q},areSameTime:function(){return Z},clone:function(){return $},convert24HourMeridiem:function(){return ve},get12HourFrom24Hour:function(){return me},get24HourFrom12Hour:function(){return De},getDateBetween:function(){return ce},getDateNextMonth:function(){return ge},getDateOnlyWithTime:function(){return de},getDatePreviousMonth:function(){return he},getDateTime:function(){return pe},getIsPmFrom24Hour:function(){return fe},getTimeInRange:function(){return ue},isDateValid:function(){return W},isDayInRange:function(){return ee},isDayRangeInRange:function(){return te},isMonthInRange:function(){return ne},isTimeEqualOrGreaterThan:function(){return oe},isTimeEqualOrSmallerThan:function(){return ie},isTimeInRange:function(){return se},isTimeSameOrAfter:function(){return le},isToday:function(){return ye}});var n,a=s(762),r=a.Classes.getClassNamespace(),o="".concat(r,"-dateinput"),i="".concat(o,"-popover"),l="".concat(r,"-datepicker"),c="".concat(l,"-caption"),p="".concat(c,"-caret"),d="".concat(c,"-measure"),h="".concat(c,"-select"),g="".concat(l,"-content"),v="DayPicker-Day",f="".concat(v,"--disabled"),m="".concat(v,"--outside"),D="".concat(v,"--selected"),y="".concat(v,"--isToday"),S="".concat(l,"-day-wrapper"),E="".concat(l,"-footer"),I="".concat(l,"-month-select"),C="".concat(l,"-year-select"),M="".concat(l,"-navbar"),R="DayPicker-NavButton",P="".concat(l,"-timepicker-wrapper"),T="".concat(r,"-daterangepicker"),_="".concat(T,"-calendars"),A="".concat(T,"-contiguous"),N="".concat(T,"-single-month"),x="".concat(v,"--selected-range"),F="".concat(v,"--hovered-range"),b="".concat(T,"-shortcuts"),w="".concat(T,"-timepickers"),k="".concat(r,"-datetimepicker"),O="".concat(r,"-timepicker"),B="".concat(O,"-arrow-button"),V="".concat(O,"-arrow-row"),U="".concat(O,"-divider-text"),H="".concat(O,"-hour"),Y="".concat(O,"-input"),K="".concat(O,"-input-row"),L="".concat(O,"-millisecond"),G="".concat(O,"-minute"),q="".concat(O,"-second"),j="".concat(O,"-ampm-select");function W(e){return e instanceof Date&&!isNaN(e.valueOf())}function J(e,t){return null==e&&null==t||null!=e&&null!=t&&e.getTime()===t.getTime()}function X(e,t){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;var n=e[0],a=e[1],r=t[0],o=t[1],i=null==n&&null==r||z(n,r),s=null==a&&null==o||z(a,o);return i&&s}function z(e,t){return Q(e,t)&&e.getDate()===t.getDate()}function Q(e,t){return null!=e&&null!=t&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Z(e,t){return null!=e&&null!=t&&e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds()&&e.getMilliseconds()===t.getMilliseconds()}function $(e){return new Date(e.getTime())}function ee(e,t,n){if(void 0===n&&(n=!1),null==e)return!1;var a=$(e),r=$(t[0]),o=$(t[1]);return a.setHours(0,0,0,0),r.setHours(0,0,0,0),o.setHours(0,0,0,0),r<=a&&a<=o&&(!n||!z(r,a)&&!z(a,o))}function te(e,t){return(null==e[0]||ee(e[0],t))&&(null==e[1]||ee(e[1],t))}function ne(e,t){if(null==e)return!1;var n=$(e),a=$(t[0]),r=$(t[1]);return n.setDate(1),a.setDate(1),r.setDate(1),n.setHours(0,0,0,0),a.setHours(0,0,0,0),r.setHours(0,0,0,0),a<=n&&n<=r}!function(e){e[e.JANUARY=0]="JANUARY",e[e.FEBRUARY=1]="FEBRUARY",e[e.MARCH=2]="MARCH",e[e.APRIL=3]="APRIL",e[e.MAY=4]="MAY",e[e.JUNE=5]="JUNE",e[e.JULY=6]="JULY",e[e.AUGUST=7]="AUGUST",e[e.SEPTEMBER=8]="SEPTEMBER",e[e.OCTOBER=9]="OCTOBER",e[e.NOVEMBER=10]="NOVEMBER",e[e.DECEMBER=11]="DECEMBER"}(n||(n={}));var ae,re,oe=function(e,t){return e.getTime()>=t.getTime()},ie=function(e,t){return e.getTime()<=t.getTime()};function se(e,t,n){var a=de(e),r=de(t),o=de(n),i=oe(a,r),s=ie(a,o);return ie(o,r)?i||s:i&&s}function ue(e,t,n){return Z(t,n)?n:se(e,t,n)?e:le(e,n)?n:t}function le(e,t){var n=de(e),a=de(t);return oe(n,a)}function ce(e){var t=e[0].getTime(),n=e[1].getTime();return new Date(t+.5*(n-t))}function pe(e,t){return null==e?null:null==t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0):new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}function de(e){return new Date(0,0,0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function he(e){return e.getMonth()===n.JANUARY?new Date(e.getFullYear()-1,n.DECEMBER):new Date(e.getFullYear(),e.getMonth()-1)}function ge(e){return e.getMonth()===n.DECEMBER?new Date(e.getFullYear()+1,n.JANUARY):new Date(e.getFullYear(),e.getMonth()+1)}function ve(e,t){if(e<0||e>23)throw new Error("hour must be between [0,23] inclusive: got ".concat(e));return t?e%12+12:e%12}function fe(e){if(e<0||e>23)throw new Error("hour must be between [0,23] inclusive: got ".concat(e));return e>=12}function me(e){if(e<0||e>23)throw new Error("hour must be between [0,23] inclusive: got ".concat(e));var t=e%12;return 0===t?12:t}function De(e,t){if(e<1||e>12)throw new Error("hour must be between [1,12] inclusive: got ".concat(e));var n=12===e?0:e;return t?n+12:n}function ye(e){return z(e,new Date)}function Se(e){var t;return((t={})[re.HOUR_24]="hours (24hr clock)",t[re.HOUR_12]="hours (12hr clock)",t[re.MINUTE]="minutes",t[re.SECOND]="seconds",t[re.MS]="milliseconds",t)[e]}function Ee(e,t){return null!=t&&!isNaN(t)&&Ce(e)<=t&&t<=Ie(e)}function Ie(e){return Me[e].max}function Ce(e){return Me[e].min}!function(e){e.HOUR_24="hour24",e.HOUR_12="hour12",e.MINUTE="minute",e.SECOND="second",e.MS="ms"}(re||(re={}));var Me=((ae={})[re.HOUR_24]={className:H,max:23,min:0},ae[re.HOUR_12]={className:H,max:12,min:1},ae[re.MINUTE]={className:G,max:59,min:0},ae[re.SECOND]={className:q,max:59,min:0},ae[re.MS]={className:L,max:999,min:0},ae),Re=s(532),Pe=s(905),Te=s.n(Pe),_e=s(359);function Ae(e,t,n){return void 0===n&&(n=!1),null==e?"":W(e)?n||ee(e,[t.minDate,t.maxDate])?t.formatDate(e,t.locale):t.outOfRangeMessage:t.invalidDateMessage}var Ne=s(726),xe=s.n(Ne),Fe="[Blueprint]",be=Fe+" <DatePicker> defaultValue must be within minDate and maxDate bounds.",we=Fe+" <DatePicker> initialMonth must be within minDate and maxDate bounds.",ke=Fe+" <DatePicker> maxDate must be later than minDate.",Oe=Fe+" <DatePicker> value prop must be within minDate and maxDate bounds.",Be=be.replace("DatePicker","DateRangePicker"),Ve=we.replace("DatePicker","DateRangePicker"),Ue=ke.replace("DatePicker","DateRangePicker"),He=Oe.replace("DatePicker","DateRangePicker");function Ye(e,t){return e.length<t?"".concat((n=t-e.length,new Array(n+1).join("0"))).concat(e):e;var n}var Ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={monthRightOffset:0},t.handleMonthSelectChange=t.dateChangeHandler((function(e,t){return e.setMonth(t)}),t.props.onMonthChange),t.handleYearSelectChange=t.dateChangeHandler((function(e,t){return e.setFullYear(t)}),t.props.onYearChange),t}return(0,Re.__extends)(t,e),t.prototype.render=function(){for(var e=this,t=this.props,n=t.date,r=t.locale,o=t.localeUtils,i=t.minDate,s=t.maxDate,u=t.months,l=void 0===u?o.getMonths(r):u,p=i.getFullYear(),d=s.getFullYear(),h=n.getMonth(),g=n.getFullYear(),v=g===p?i.getMonth():0,f=g===d?s.getMonth()+1:void 0,m=l.map((function(e,t){return{label:e,value:t}})).slice(v,f),D=[p],y=p+1;y<=d;++y)D.push(y);g>d&&D.push({value:g,disabled:!0}),this.displayedMonthText=l[h];var S=_e.createElement(a.HTMLSelect,{"aria-label":"Month",iconProps:{style:{right:this.state.monthRightOffset}},className:I,key:"month",minimal:!0,onChange:this.handleMonthSelectChange,value:h,options:m}),E=_e.createElement(a.HTMLSelect,{"aria-label":"Year",className:C,key:"year",minimal:!0,onChange:this.handleYearSelectChange,value:g,options:D}),M=this.props.reverseMonthAndYearMenus?[E,S]:[S,E];return _e.createElement("div",{className:this.props.classNames.caption},_e.createElement("div",{className:c,ref:function(t){return e.containerElement=t}},M),_e.createElement(a.Divider,null))},t.prototype.componentDidMount=function(){var e=this;this.requestAnimationFrame((function(){return e.positionArrows()}))},t.prototype.componentDidUpdate=function(){this.positionArrows()},t.prototype.positionArrows=function(){var e=function(e,t,n){if(void 0===t&&(t=""),void 0===n&&(n=document.body),null==n)return 0;var a=document.createElement("span");a.classList.add(t),a.textContent=e,n.appendChild(a);var r=a.offsetWidth;return a.remove(),r}(this.displayedMonthText,d,this.containerElement),t=null==this.containerElement?0:this.containerElement.firstElementChild.clientWidth,n=Math.max(2,t-e-a.IconSize.STANDARD-2);this.setState({monthRightOffset:n})},t.prototype.dateChangeHandler=function(e,t){var n=this;return function(a){var r,o,i=parseInt(a.target.value,10);if(!isNaN(i)){var s=$(n.props.date);e(s,i),null===(o=(r=n.props).onDateChange)||void 0===o||o.call(r,s),null==t||t(i)}}},t}(a.AbstractPureComponent2),Le="hovered-range",Ge="selected-range",qe=["disabled",Le,"outside","selected",Ge];function je(){var e=new Date;return e.setMonth(e.getMonth()+6),e}function We(){var e=new Date;return e.setFullYear(e.getFullYear()-20),e.setMonth(n.JANUARY,1),e}var Je=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleNextClick=function(){return t.props.onNextClick()},t.handlePreviousClick=function(){return t.props.onPreviousClick()},t}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.classNames,n=e.month,r=e.maxDate,o=e.minDate;return _e.createElement("div",{className:Te()(M,t.navBar)},this.props.hideLeftNavButton||_e.createElement(a.Button,{"aria-label":"Go to previous month",className:t.navButtonPrev,disabled:Q(n,o),icon:"chevron-left",minimal:!0,onClick:this.handlePreviousClick}),this.props.hideRightNavButton||_e.createElement(a.Button,{"aria-label":"Go to next month",className:t.navButtonNext,disabled:Q(n,r),icon:"chevron-right",minimal:!0,onClick:this.handleNextClick}))},t}(_e.PureComponent),Xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getShorcutClickHandler=function(e,n){return function(){(0,t.props.onShortcutClick)(e,n)}},t.isShortcutInRange=function(e){var n=t.props;return te(e,[n.minDate,n.maxDate])},t}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e,t,n,r,o,i,s,u,l,c,p,d,h,g,v=this,f=(!0===this.props.shortcuts?(e=this.props.allowSingleDayRange,t=void 0!==this.props.timePrecision,n=!0===this.props.useSingleDateShortcuts,r=new Date,i=(o=function(e){var t=$(r);return e(t),t.setDate(t.getDate()+1),t})((function(){return null})),s=o((function(e){return e.setDate(e.getDate()-2)})),u=o((function(e){return e.setDate(e.getDate()-7)})),l=o((function(e){return e.setMonth(e.getMonth()-1)})),c=o((function(e){return e.setMonth(e.getMonth()-3)})),p=o((function(e){return e.setMonth(e.getMonth()-6)})),d=o((function(e){return e.setFullYear(e.getFullYear()-1)})),h=o((function(e){return e.setFullYear(e.getFullYear()-2)})),g=e||n?[ze("Today",[r,t?i:r]),ze("Yesterday",[s,t?r:s])]:[],(0,Re.__spreadArray)((0,Re.__spreadArray)((0,Re.__spreadArray)((0,Re.__spreadArray)((0,Re.__spreadArray)([],g,!0),[ze(n?"1 week ago":"Past week",[u,r]),ze(n?"1 month ago":"Past month",[l,r]),ze(n?"3 months ago":"Past 3 months",[c,r])],!1),n?[]:[ze("Past 6 months",[p,r])],!0),[ze(n?"1 year ago":"Past year",[d,r])],!1),n?[]:[ze("Past 2 years",[h,r])],!0)):this.props.shortcuts).map((function(e,t){return _e.createElement(a.MenuItem,{active:v.props.selectedShortcutIndex===t,disabled:!v.isShortcutInRange(e.dateRange),key:t,onClick:v.getShorcutClickHandler(e,t),shouldDismissPopover:!1,text:e.label})}));return _e.createElement(a.Menu,{"aria-label":"Date picker shortcuts",className:b,tabIndex:0},f)},t.defaultProps={selectedShortcutIndex:-1},t}(_e.PureComponent);function ze(e,t){return{dateRange:t,label:e}}var Qe={MILLISECOND:"millisecond",MINUTE:"minute",SECOND:"second"},Ze=function(e){function t(t,n){var r,o=e.call(this,t,n)||this;return o.timeInputIds=((r={})[re.HOUR_24]=a.Utils.uniqueId(re.HOUR_24+"-input"),r[re.HOUR_12]=a.Utils.uniqueId(re.HOUR_12+"-input"),r[re.MINUTE]=a.Utils.uniqueId(re.MINUTE+"-input"),r[re.SECOND]=a.Utils.uniqueId(re.SECOND+"-input"),r[re.MS]=a.Utils.uniqueId(re.MS+"-input"),r),o.getInputChangeHandler=function(e){return function(t){var n=et(t);switch(e){case re.HOUR_12:case re.HOUR_24:o.setState({hourText:n});break;case re.MINUTE:o.setState({minuteText:n});break;case re.SECOND:o.setState({secondText:n});break;case re.MS:o.setState({millisecondText:n})}}},o.getInputBlurHandler=function(e){return function(t){var n,a,r=et(t);o.updateTime(parseInt(r,10),e),null===(a=(n=o.props).onBlur)||void 0===a||a.call(n,t,e)}},o.getInputFocusHandler=function(e){return function(t){var n,a;o.props.selectAllOnFocus&&t.currentTarget.select(),null===(a=(n=o.props).onFocus)||void 0===a||a.call(n,t,e)}},o.getInputKeyDownHandler=function(e){return function(t){var n,r,i;!function(e,t,n){void 0===n&&(n=!0);for(var a=0,r=Object.keys(t);a<r.length;a++){var o=r[a],i=Number(o);e.which===i&&(n&&e.preventDefault(),t[i]())}}(t,(n={},n[a.Keys.ARROW_UP]=function(){return o.incrementTime(e)},n[a.Keys.ARROW_DOWN]=function(){return o.decrementTime(e)},n[a.Keys.ENTER]=function(){t.currentTarget.blur()},n)),null===(i=(r=o.props).onKeyDown)||void 0===i||i.call(r,t,e)}},o.getInputKeyUpHandler=function(e){return function(t){var n,a;null===(a=(n=o.props).onKeyUp)||void 0===a||a.call(n,t,e)}},o.handleAmPmChange=function(e){var t="pm"===e.currentTarget.value;if(t!==o.state.isPm){var n=ve(o.state.value.getHours(),t);o.setState({isPm:t},(function(){return o.updateTime(n,re.HOUR_24)}))}},o.incrementTime=function(e){return o.shiftTime(e,1)},o.decrementTime=function(e){return o.shiftTime(e,-1)},o.state=o.getFullStateFromValue(o.getInitialValue(),t.useAmPm),o}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e,t=this.props.precision===Qe.MILLISECOND,n=t||this.props.precision===Qe.SECOND,r=this.props.useAmPm?re.HOUR_12:re.HOUR_24,o=Te()(O,this.props.className,((e={})[a.Classes.DISABLED]=this.props.disabled,e));return _e.createElement("div",{className:o},_e.createElement("div",{className:V},this.maybeRenderArrowButton(!0,r),this.maybeRenderArrowButton(!0,re.MINUTE),n&&this.maybeRenderArrowButton(!0,re.SECOND),t&&this.maybeRenderArrowButton(!0,re.MS)),_e.createElement("div",{className:K},this.renderInput(H,r,this.state.hourText),this.renderDivider(),this.renderInput(G,re.MINUTE,this.state.minuteText),n&&this.renderDivider(),n&&this.renderInput(q,re.SECOND,this.state.secondText),t&&this.renderDivider("."),t&&this.renderInput(L,re.MS,this.state.millisecondText)),this.maybeRenderAmPm(),_e.createElement("div",{className:V},this.maybeRenderArrowButton(!1,r),this.maybeRenderArrowButton(!1,re.MINUTE),n&&this.maybeRenderArrowButton(!1,re.SECOND),t&&this.maybeRenderArrowButton(!1,re.MS)))},t.prototype.componentDidUpdate=function(e){var t=e.minTime!==this.props.minTime,n=e.maxTime!==this.props.maxTime,a=t||n,r=e.value!==this.props.value,o=a||r,i=this.state.value;null==this.props.value&&(i=this.getInitialValue()),a&&(i=ue(this.state.value,this.props.minTime,this.props.maxTime)),null==this.props.value||Z(this.props.value,e.value)||(i=this.props.value),o&&this.setState(this.getFullStateFromValue(i,this.props.useAmPm))},t.prototype.maybeRenderArrowButton=function(e,t){var n=this;if(!this.props.showArrowButtons)return null;var r=Te()(B,Me[t].className),o="".concat(e?"Increase":"Decrease"," ").concat(Se(t));return _e.createElement("span",{"aria-controls":this.timeInputIds[t],"aria-label":o,tabIndex:-1,className:r,onClick:function(){return(e?n.incrementTime:n.decrementTime)(t)}},_e.createElement(a.Icon,{icon:e?"chevron-up":"chevron-down",title:o}))},t.prototype.renderDivider=function(e){return void 0===e&&(e=":"),_e.createElement("span",{className:U},e)},t.prototype.renderInput=function(e,t,n){var r,o=parseInt(n,10),i=Ee(t,o),s=t===re.HOUR_12||t===re.HOUR_24;return _e.createElement("input",{"aria-label":Se(t),"aria-valuemin":0,"aria-valuenow":o,"aria-valuemax":Ie(t),className:Te()(Y,(r={},r[a.Classes.intentClass(a.Intent.DANGER)]=!i,r),e),id:this.timeInputIds[t],onBlur:this.getInputBlurHandler(t),onChange:this.getInputChangeHandler(t),onFocus:this.getInputFocusHandler(t),onKeyDown:this.getInputKeyDownHandler(t),onKeyUp:this.getInputKeyUpHandler(t),role:this.props.showArrowButtons?"spinbutton":void 0,value:n,disabled:this.props.disabled,autoFocus:s&&this.props.autoFocus})},t.prototype.maybeRenderAmPm=function(){return this.props.useAmPm?_e.createElement(a.HTMLSelect,{className:j,disabled:this.props.disabled,onChange:this.handleAmPmChange,value:this.state.isPm?"pm":"am"},_e.createElement("option",{value:"am"},"AM"),_e.createElement("option",{value:"pm"},"PM")):null},t.prototype.getFullStateFromValue=function(e,t){var n=ue(e,this.props.minTime,this.props.maxTime),a=t?re.HOUR_12:re.HOUR_24;return{hourText:$e(n.getHours(),a),minuteText:$e(n.getMinutes(),re.MINUTE),secondText:$e(n.getSeconds(),re.SECOND),millisecondText:$e(n.getMilliseconds(),re.MS),value:n,isPm:fe(n.getHours())}},t.prototype.shiftTime=function(e,t){if(!this.props.disabled){var n=function(e,t){switch(e){case re.HOUR_24:return t.getHours();case re.HOUR_12:return me(t.getHours());case re.MINUTE:return t.getMinutes();case re.SECOND:return t.getSeconds();case re.MS:return t.getMilliseconds();default:throw Error("Invalid TimeUnit")}}(e,this.state.value)+t;this.updateTime(function(e,t){var n=Ie(e),a=Ce(e);return t>n?a:t<a?n:t}(e,n),e)}},t.prototype.updateTime=function(e,t){var n=$(this.state.value);Ee(t,e)?(function(e,t,n,a){switch(e){case re.HOUR_24:n.setHours(t);break;case re.HOUR_12:n.setHours(De(t,a));break;case re.MINUTE:n.setMinutes(t);break;case re.SECOND:n.setSeconds(t);break;case re.MS:n.setMilliseconds(t);break;default:throw Error("Invalid TimeUnit")}}(t,e,n,this.state.isPm),se(n,this.props.minTime,this.props.maxTime)?this.updateState({value:n}):this.updateState(this.getFullStateFromValue(this.state.value,this.props.useAmPm))):this.updateState(this.getFullStateFromValue(this.state.value,this.props.useAmPm))},t.prototype.updateState=function(e){var t,n,a=e,r=null!=a.value&&!Z(a.value,this.state.value);null==this.props.value?(r&&(a=this.getFullStateFromValue(a.value,this.props.useAmPm)),this.setState(a)):r?this.setState(this.getFullStateFromValue(this.state.value,this.props.useAmPm)):this.setState((0,Re.__assign)((0,Re.__assign)({},a),{value:$(this.state.value)})),r&&(null===(n=(t=this.props).onChange)||void 0===n||n.call(t,a.value))},t.prototype.getInitialValue=function(){var e=this.props.minTime;return null!=this.props.value?e=this.props.value:null!=this.props.defaultValue&&(e=this.props.defaultValue),e},t.defaultProps={autoFocus:!1,disabled:!1,maxTime:new Date(0,0,0,23,59,59,999),minTime:new Date(0,0,0,0,0,0,0),precision:Qe.MINUTE,selectAllOnFocus:!1,showArrowButtons:!1,useAmPm:!1},t.displayName="".concat(a.DISPLAYNAME_PREFIX,".TimePicker"),t}(_e.Component);function $e(e,t){switch(t){case re.HOUR_24:return e.toString();case re.HOUR_12:return me(e).toString();case re.MINUTE:case re.SECOND:return Ye(e.toString(),2);case re.MS:return Ye(e.toString(),3);default:throw Error("Invalid TimeUnit")}}function et(e){return e.target.value}var tt=function(e){function t(t,n){var a=e.call(this,t,n)||this;a.ignoreNextMonthChange=!1,a.shouldHighlightCurrentDay=function(e){return a.props.highlightCurrentDay&&ye(e)},a.getDatePickerModifiers=function(){var e=a.props.modifiers;return(0,Re.__assign)({isToday:a.shouldHighlightCurrentDay},e)},a.renderDay=function(e){var t=e.getDate();return _e.createElement("div",{className:S},t)},a.disabledDays=function(e){return!ee(e,[a.props.minDate,a.props.maxDate])},a.getDisabledDaysModifier=function(){var e=a.props.dayPickerProps.disabledDays;return Array.isArray(e)?(0,Re.__spreadArray)([a.disabledDays],e,!0):[a.disabledDays,e]},a.renderCaption=function(e){return _e.createElement(Ke,(0,Re.__assign)({},e,{maxDate:a.props.maxDate,minDate:a.props.minDate,onDateChange:a.handleMonthChange,reverseMonthAndYearMenus:a.props.reverseMonthAndYearMenus}))},a.renderNavbar=function(e){return _e.createElement(Je,(0,Re.__assign)({},e,{maxDate:a.props.maxDate,minDate:a.props.minDate}))},a.handleDayClick=function(e,t,n){var r,o;if(null===(o=(r=a.props.dayPickerProps).onDayClick)||void 0===o||o.call(r,e,t,n),!t.disabled){a.updateDay(e);var i=a.props.canClearSelection&&t.selected?null:pe(e,a.state.value);a.updateValue(i,!0)}},a.handleShortcutClick=function(e,t){var n=a.props,r=n.onShortcutChange,o=n.selectedShortcutIndex,i=e.dateRange,s=e.includeTime,u=i[0],l=s?u:pe(u,a.state.value);a.updateDay(u),a.updateValue(l,!0),void 0===o&&a.setState({selectedShortcutIndex:t});var c=(0,Re.__assign)((0,Re.__assign)({},e),{date:e.dateRange[0]});null==r||r(c,t)},a.updateDay=function(e){void 0===a.props.value&&a.setState({displayMonth:e.getMonth(),displayYear:e.getFullYear(),selectedDay:e.getDate()}),null!=a.state.value&&a.state.value.getMonth()!==e.getMonth()&&(a.ignoreNextMonthChange=!0)},a.handleClearClick=function(){return a.updateValue(null,!0)},a.handleMonthChange=function(e){var t,n,r=a.computeValidDateInSpecifiedMonthYear(e.getFullYear(),e.getMonth());a.setState({displayMonth:r.getMonth(),displayYear:r.getFullYear()}),null!==a.state.value&&(a.updateValue(r,!1,a.ignoreNextMonthChange),a.ignoreNextMonthChange=!1),null===(n=(t=a.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,r)},a.handleTodayClick=function(){var e=new Date,t=e.getMonth(),n=e.getFullYear(),r=e.getDate();a.setState({displayMonth:t,displayYear:n,selectedDay:r}),a.updateValue(e,!0)},a.handleTimeChange=function(e){var t,n;null===(n=null===(t=a.props.timePickerProps)||void 0===t?void 0:t.onChange)||void 0===n||n.call(t,e);var r=a.state.value,o=pe(null!=r?r:new Date,e);a.updateValue(o,!0)};var r=function(e){return void 0!==e.value?e.value:void 0!==e.defaultValue?e.defaultValue:null}(t),o=function(e,t){var n=new Date;return null!=e.initialMonth?e.initialMonth:null!=t?t:ee(n,[e.minDate,e.maxDate])?n:ce([e.minDate,e.maxDate])}(t,r);return a.state={displayMonth:o.getMonth(),displayYear:o.getFullYear(),selectedDay:null==r?null:r.getDate(),selectedShortcutIndex:void 0!==a.props.selectedShortcutIndex?a.props.selectedShortcutIndex:-1,value:r},a}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,a=t.dayPickerProps,r=t.footerElement,o=t.locale,i=t.localeUtils,s=t.maxDate,u=t.minDate,c=t.showActionsBar,p=this.state,d=p.displayMonth,h=p.displayYear;return _e.createElement("div",{className:Te()(l,n)},this.maybeRenderShortcuts(),_e.createElement("div",{className:g},_e.createElement(xe(),(0,Re.__assign)({showOutsideDays:!0,locale:o,localeUtils:i,modifiers:this.getDatePickerModifiers()},a,{canChangeMonth:!0,captionElement:this.renderCaption,navbarElement:this.renderNavbar,disabledDays:this.getDisabledDaysModifier(),fromMonth:u,month:new Date(h,d),onDayClick:this.handleDayClick,onMonthChange:this.handleMonthChange,selectedDays:this.state.value,toMonth:s,renderDay:null!==(e=null==a?void 0:a.renderDay)&&void 0!==e?e:this.renderDay})),this.maybeRenderTimePicker(),c&&this.renderOptionsBar(),r))},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n);var a=this.props.value;a!==t.value&&(null==a?this.setState({value:a}):this.setState({displayMonth:a.getMonth(),displayYear:a.getFullYear(),selectedDay:a.getDate(),value:a}),this.props.selectedShortcutIndex!==t.selectedShortcutIndex&&this.setState({selectedShortcutIndex:this.props.selectedShortcutIndex}))},t.prototype.validateProps=function(e){var t=e.defaultValue,n=e.initialMonth,a=e.maxDate,r=e.minDate,o=e.value;null==t||ee(t,[r,a])||console.error(be),null==n||ne(n,[r,a])||console.error(we),null!=a&&null!=r&&a<r&&!z(a,r)&&console.error(ke),null==o||ee(o,[r,a])||console.error(Oe)},t.prototype.renderOptionsBar=function(){var e=this.props,t=e.clearButtonText,n=e.todayButtonText,r=e.minDate,o=e.maxDate,i=e.canClearSelection,s=function(e,t){return ee(new Date,[e,t])}(r,o);return[_e.createElement(a.Divider,{key:"div"}),_e.createElement("div",{className:E,key:"footer"},_e.createElement(a.Button,{minimal:!0,disabled:!s,onClick:this.handleTodayClick,text:n}),_e.createElement(a.Button,{disabled:!i,minimal:!0,onClick:this.handleClearClick,text:t}))]},t.prototype.maybeRenderTimePicker=function(){var e=this.props,t=e.timePrecision,n=e.timePickerProps,a=e.minDate,r=e.maxDate;if(null==t&&void 0===n)return null;var o=z(this.state.value,a),i=z(this.state.value,r);return _e.createElement("div",{className:P},_e.createElement(Ze,(0,Re.__assign)({precision:t,minTime:o?a:void 0,maxTime:i?r:void 0},n,{onChange:this.handleTimeChange,value:this.state.value})))},t.prototype.maybeRenderShortcuts=function(){var e=this.props.shortcuts;if(null==e||!1===e)return null;var t=this.state.selectedShortcutIndex,n=this.props,r=n.maxDate,o=n.minDate,i=n.timePrecision,s=!0===e||e.map((function(e){return(0,Re.__assign)((0,Re.__assign)({},e),{dateRange:[e.date,void 0]})}));return[_e.createElement(Xe,(0,Re.__assign)({key:"shortcuts"},{allowSingleDayRange:!0,maxDate:r,minDate:o,selectedShortcutIndex:t,shortcuts:s,timePrecision:i},{onShortcutClick:this.handleShortcutClick,useSingleDateShortcuts:!0})),_e.createElement(a.Divider,{key:"div"})]},t.prototype.computeValidDateInSpecifiedMonthYear=function(e,t){var n=this.props,a=n.minDate,r=n.maxDate,o=this.state.selectedDay,i=new Date(e,t+1,0).getDate(),s=null==o?1:Math.min(o,i),u=pe(new Date(e,t,s,12),this.state.value);return u<a?a:u>r?r:u},t.prototype.updateValue=function(e,t,n){var a,r;void 0===n&&(n=!1),n||null===(r=(a=this.props).onChange)||void 0===r||r.call(a,e,t),void 0===this.props.value&&this.setState({value:e})},t.defaultProps={canClearSelection:!0,clearButtonText:"Clear",dayPickerProps:{},highlightCurrentDay:!1,maxDate:je(),minDate:We(),reverseMonthAndYearMenus:!1,shortcuts:!1,showActionsBar:!1,todayButtonText:"Today"},t.displayName="".concat(a.DISPLAYNAME_PREFIX,".DatePicker"),t}(a.AbstractPureComponent2),nt=function(e){function t(){var t,n=this;return(n=e.apply(this,arguments)||this).state={isInputFocused:!1,isOpen:!1,value:void 0!==n.props.value?n.props.value:n.props.defaultValue,valueString:null},n.inputElement=null,n.popoverContentElement=null,n.handleInputRef=(0,a.refHandler)(n,"inputElement",null===(t=n.props.inputProps)||void 0===t?void 0:t.inputRef),n.handlePopoverContentRef=(0,a.refHandler)(n,"popoverContentElement"),n.handleClosePopover=function(e){var t,a=n.props.popoverProps,r=void 0===a?{}:a;null===(t=r.onClose)||void 0===t||t.call(r,e),n.setState({isOpen:!1})},n.handleDateChange=function(e,t,a){var r,o;void 0===a&&(a=!1);var i=n.state.value,s=!t||!n.props.closeOnSelection||null!=i&&(n.hasMonthChanged(i,e)||n.hasTimeChanged(i,e)),u=!!a;if(void 0===n.props.value){var l=Ae(e,n.props);n.setState({isInputFocused:u,isOpen:s,value:e,valueString:l})}else n.setState({isInputFocused:u,isOpen:s});null===(o=(r=n.props).onChange)||void 0===o||o.call(r,e,t)},n.handleInputFocus=function(e){var t=null==n.state.value?"":n.formatDate(n.state.value);n.setState({isInputFocused:!0,isOpen:!0,valueString:t}),n.safeInvokeInputProp("onFocus",e)},n.handleInputClick=function(e){e.stopPropagation(),n.safeInvokeInputProp("onClick",e)},n.handleInputChange=function(e){var t,a,r,o,i=e.target.value,s=n.parseDate(i);W(s)&&n.isDateInRange(s)?(void 0===n.props.value?n.setState({value:s,valueString:i}):n.setState({valueString:i}),null===(a=(t=n.props).onChange)||void 0===a||a.call(t,s,!0)):(0===i.length&&(null===(o=(r=n.props).onChange)||void 0===o||o.call(r,null,!0)),n.setState({valueString:i})),n.safeInvokeInputProp("onChange",e)},n.handleInputBlur=function(e){var t,a,r,o,i,s,u=n.state.valueString,l=n.parseDate(u);!(u.length>0&&u!==Ae(n.state.value,n.props))||W(l)&&n.isDateInRange(l)?0===u.length?n.setState({isInputFocused:!1,value:null,valueString:null}):n.setState({isInputFocused:!1}):(void 0===n.props.value?n.setState({isInputFocused:!1,value:l,valueString:null}):n.setState({isInputFocused:!1}),isNaN(l.valueOf())?null===(a=(t=n.props).onError)||void 0===a||a.call(t,new Date(void 0)):n.isDateInRange(l)?null===(s=(i=n.props).onChange)||void 0===s||s.call(i,l,!0):null===(o=(r=n.props).onError)||void 0===o||o.call(r,l)),n.safeInvokeInputProp("onBlur",e)},n.handleInputKeyDown=function(e){var t,r;if(e.which===a.Keys.ENTER){var o=n.parseDate(n.state.valueString);n.handleDateChange(o,!0,!0)}else e.which===a.Keys.TAB&&e.shiftKey?n.handleClosePopover():e.which===a.Keys.TAB&&n.state.isOpen?(null===(t=n.getKeyboardFocusableElements().shift())||void 0===t||t.focus(),e.preventDefault()):e.which===a.Keys.ESCAPE&&(n.setState({isOpen:!1}),null===(r=n.inputElement)||void 0===r||r.blur());n.safeInvokeInputProp("onKeyDown",e)},n.getKeyboardFocusableElements=function(){var e,t=Array.from(null===(e=n.popoverContentElement)||void 0===e?void 0:e.querySelectorAll("button:not([disabled]),input,[tabindex]:not([tabindex='-1'])"));return t.pop(),t.shift(),t},n.handleStartFocusBoundaryFocusIn=function(e){var t,a;n.popoverContentElement.contains(n.getRelatedTarget(e))?null===(t=n.inputElement)||void 0===t||t.focus():null===(a=n.getKeyboardFocusableElements().shift())||void 0===a||a.focus()},n.handleEndFocusBoundaryFocusIn=function(e){var t,a;n.popoverContentElement.contains(n.getRelatedTarget(e))?(null===(t=n.inputElement)||void 0===t||t.focus(),n.handleClosePopover()):null===(a=n.getKeyboardFocusableElements().pop())||void 0===a||a.focus()},n.handleShortcutChange=function(e,t){n.setState({selectedShortcutIndex:t})},n}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e=this,t=this.state,n=t.value,r=t.valueString,o=this.state.isInputFocused?r:Ae(n,this.props),s=W(n)?n:null,u=(0,Re.__assign)((0,Re.__assign)({},this.props.dayPickerProps),{onDayKeyDown:function(t,n,a){var r,o;null===(o=(r=e.props.dayPickerProps).onDayKeyDown)||void 0===o||o.call(r,t,n,a)},onMonthChange:function(t){var n,a;null===(a=(n=e.props.dayPickerProps).onMonthChange)||void 0===a||a.call(n,t)}}),l=_e.createElement("div",{ref:this.handlePopoverContentRef},_e.createElement("div",{onFocus:this.handleStartFocusBoundaryFocusIn,tabIndex:0}),_e.createElement(tt,(0,Re.__assign)({},this.props,{dayPickerProps:u,onChange:this.handleDateChange,value:s,onShortcutChange:this.handleShortcutChange,selectedShortcutIndex:this.state.selectedShortcutIndex})),_e.createElement("div",{onFocus:this.handleEndFocusBoundaryFocusIn,tabIndex:0})),c=this.props,p=c.inputProps,d=void 0===p?{}:p,h=c.popoverProps,g=void 0===h?{}:h,v=!(null==n||W(n)&&this.isDateInRange(n));return _e.createElement(a.Popover,(0,Re.__assign)({isOpen:this.state.isOpen&&!this.props.disabled,fill:this.props.fill},g,{autoFocus:!1,className:Te()(g.className,this.props.className),content:l,enforceFocus:!1,onClose:this.handleClosePopover,popoverClassName:Te()(i,g.popoverClassName)}),_e.createElement(a.InputGroup,(0,Re.__assign)({autoComplete:"off",intent:v?a.Intent.DANGER:a.Intent.NONE,placeholder:this.props.placeholder,rightElement:this.props.rightElement,type:"text"},d,{disabled:this.props.disabled,inputRef:this.handleInputRef,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onClick:this.handleInputClick,onFocus:this.handleInputFocus,onKeyDown:this.handleInputKeyDown,value:o})))},t.prototype.componentDidUpdate=function(t,n){var r,o,i,s,u;e.prototype.componentDidUpdate.call(this,t,n),(null===(r=t.inputProps)||void 0===r?void 0:r.inputRef)!==(null===(o=this.props.inputProps)||void 0===o?void 0:o.inputRef)&&((0,a.setRef)(null===(i=t.inputProps)||void 0===i?void 0:i.inputRef,null),this.handleInputRef=(0,a.refHandler)(this,"inputElement",null===(s=this.props.inputProps)||void 0===s?void 0:s.inputRef),(0,a.setRef)(null===(u=this.props.inputProps)||void 0===u?void 0:u.inputRef,this.inputElement)),t.value!==this.props.value&&this.setState({value:this.props.value})},t.prototype.isDateInRange=function(e){return ee(e,[this.props.minDate,this.props.maxDate])},t.prototype.hasMonthChanged=function(e,t){return null==e!=(null==t)||t.getMonth()!==e.getMonth()},t.prototype.hasTimeChanged=function(e,t){return null!=this.props.timePrecision&&(null==e!=(null==t)||t.getHours()!==e.getHours()||t.getMinutes()!==e.getMinutes()||t.getSeconds()!==e.getSeconds()||t.getMilliseconds()!==e.getMilliseconds())},t.prototype.getRelatedTarget=function(e){var t;return null!==(t=e.relatedTarget)&&void 0!==t?t:document.activeElement},t.prototype.safeInvokeInputProp=function(e,t){var n,a=this.props.inputProps,r=void 0===a?{}:a;null===(n=r[e])||void 0===n||n.call(r,t)},t.prototype.parseDate=function(e){if(e===this.props.outOfRangeMessage||e===this.props.invalidDateMessage)return null;var t=this.props,n=t.locale,a=(0,t.parseDate)(e,n);return!1===a?new Date(void 0):a},t.prototype.formatDate=function(e){if(!W(e)||!this.isDateInRange(e))return"";var t=this.props,n=t.locale;return(0,t.formatDate)(e,n)},t.displayName="".concat(a.DISPLAYNAME_PREFIX,".DateInput"),t.defaultProps={closeOnSelection:!0,dayPickerProps:{},disabled:!1,invalidDateMessage:"Invalid date",maxDate:je(),minDate:We(),outOfRangeMessage:"Out of range",reverseMonthAndYearMenus:!1},t}(a.AbstractPureComponent2),at={getDefaultMaxDate:je,getDefaultMinDate:We,getFormattedDateString:Ae},rt=function(e){function t(t,n){var a=e.call(this,t,n)||this;a.handleDateChange=function(e,t){var n,r;void 0===a.props.value&&a.setState({dateValue:e});var o=pe(e,a.state.timeValue);null===(r=(n=a.props).onChange)||void 0===r||r.call(n,o,t)},a.handleTimeChange=function(e){var t,n;void 0===a.props.value&&a.setState({timeValue:e});var r=pe(a.state.dateValue,e);null===(n=(t=a.props).onChange)||void 0===n||n.call(t,r,!0)};var r=void 0!==a.props.value?a.props.value:a.props.defaultValue;return a.state={dateValue:r,timeValue:r},a}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e=pe(this.state.dateValue,this.state.timeValue);return _e.createElement("div",{className:Te()(k,this.props.className)},_e.createElement(tt,(0,Re.__assign)({},this.props.datePickerProps,{canClearSelection:this.props.canClearSelection,onChange:this.handleDateChange,value:e})),_e.createElement(Ze,(0,Re.__assign)({},this.props.timePickerProps,{onChange:this.handleTimeChange,value:this.state.timeValue})))},t.prototype.componentDidUpdate=function(e){this.props.value!==e.value&&(null!=this.props.value?this.setState({dateValue:this.props.value,timeValue:this.props.value}):this.setState({dateValue:null}))},t.defaultProps={canClearSelection:!0,defaultValue:new Date},t.displayName="".concat(a.DISPLAYNAME_PREFIX,".DateTimePicker"),t}(a.AbstractPureComponent2),ot=function(){function e(e,t){this.date=null!==e&&null!==t?new Date(t,e):new Date}return e.fromDate=function(t){return null==t?void 0:new e(t.getMonth(),t.getFullYear())},e.prototype.clone=function(){return new e(this.getMonth(),this.getYear())},e.prototype.getFullDate=function(){return this.date},e.prototype.getMonth=function(){return this.date.getMonth()},e.prototype.getYear=function(){return this.date.getFullYear()},e.prototype.getPreviousMonth=function(){var t=he(this.date);return new e(t.getMonth(),t.getFullYear())},e.prototype.getNextMonth=function(){var t=ge(this.date);return new e(t.getMonth(),t.getFullYear())},e.prototype.isBefore=function(e){return it(this,e)<0},e.prototype.isAfter=function(e){return it(this,e)>0},e.prototype.isSame=function(e){return 0===it(this,e)},e.prototype.isSameMonth=function(e){return this.getMonth()===e.getMonth()},e}();function it(e,t){var n=e.getMonth(),a=e.getYear(),r=t.getMonth(),o=t.getYear();return a===o?n-r:a-o}var st=function(){function e(){}return e.getNextState=function(e,t,n,a){return null!=a?this.getNextStateForBoundary(e,t,n,a):this.getDefaultNextState(e,t,n)},e.getNextStateForBoundary=function(e,t,n,a){var r,o,i=this.getBoundaryDate(a,e),s=this.getOtherBoundary(a),u=this.getBoundaryDate(s,e);if(null==i&&null==u)r=a,o=this.createRangeForBoundary(a,t,null);else if(null!=i&&null==u){var l=z(i,t)?null:t;r=a,o=this.createRangeForBoundary(a,l,null)}else if(null==i&&null!=u)if(z(t,u)){var c=void 0;n?(r=a,c=u):(r=s,c=null),o=this.createRangeForBoundary(a,c,c)}else this.isOverlappingOtherBoundary(a,t,u)?(r=s,o=this.createRangeForBoundary(a,u,t)):(r=a,o=this.createRangeForBoundary(a,t,u));else if(z(i,t)){var p=z(i,u)?null:u;r=a,o=this.createRangeForBoundary(a,null,p)}else if(z(t,u)){var d=n?[u,u]:[i,null];l=d[0],p=d[1],r=n?a:s,o=this.createRangeForBoundary(a,l,p)}else this.isOverlappingOtherBoundary(a,t,u)?(r=a,o=this.createRangeForBoundary(a,t,null)):(r=a,o=this.createRangeForBoundary(a,t,u));return{dateRange:o,boundary:r}},e.getDefaultNextState=function(e,t,n){var a,r=e[0],o=e[1];if(null==r&&null==o)a=[t,null];else if(null!=r&&null==o)a=this.createRange(t,r,n);else if(null==r&&null!=o)a=this.createRange(t,o,n);else{var i=z(r,t),s=z(o,t);a=i&&s?[null,null]:i?[null,o]:s?[r,null]:[t,null]}return{dateRange:a}},e.getOtherBoundary=function(e){return e===a.Boundary.START?a.Boundary.END:a.Boundary.START},e.getBoundaryDate=function(e,t){return e===a.Boundary.START?t[0]:t[1]},e.isOverlappingOtherBoundary=function(e,t,n){return e===a.Boundary.START?t>n:t<n},e.createRangeForBoundary=function(e,t,n){return e===a.Boundary.START?[t,n]:[n,t]},e.createRange=function(e,t,n){return!n&&z(e,t)?[null,null]:e<t?[e,t]:[t,e]},e}(),ut=function(e){function t(t,n){var a,r=e.call(this,t,n)||this;r.modifiers=((a={})["selected-range"]=function(e){var t=r.state.value;return null!=t[0]&&null!=t[1]&&ee(e,t,!0)},a["".concat(Ge,"-start")]=function(e){return z(r.state.value[0],e)},a["".concat(Ge,"-end")]=function(e){return z(r.state.value[1],e)},a["hovered-range"]=function(e){var t=r.state,n=t.hoverValue,a=t.value,o=a[0],i=a[1];return(null!=o||null!=i)&&null!=n&&null!=n[0]&&null!=n[1]&&ee(e,n,!0)},a["".concat(Le,"-start")]=function(e){var t=r.state.hoverValue;return null!=t&&null!=t[0]&&z(t[0],e)},a["".concat(Le,"-end")]=function(e){var t=r.state.hoverValue;return null!=t&&null!=t[1]&&z(t[1],e)},a),r.shouldHighlightCurrentDay=function(e){return r.props.highlightCurrentDay&&ye(e)},r.getDateRangePickerModifiers=function(){var e=r.props.modifiers;return function(e,t){var n=e;if(null!=t){n={};for(var a=0,r=Object.keys(t);a<r.length;a++){var o=r[a];-1===qe.indexOf(o)&&(n[o]=t[o])}for(var i=0,s=Object.keys(e);i<s.length;i++)n[o=s[i]]=e[o]}return n}(r.modifiers,(0,Re.__assign)({isToday:r.shouldHighlightCurrentDay},e))},r.renderDay=function(e){var t=e.getDate();return _e.createElement("div",{className:S},t)},r.disabledDays=function(e){return!ee(e,[r.props.minDate,r.props.maxDate])},r.getDisabledDaysModifier=function(){var e=r.props.dayPickerProps.disabledDays;return e instanceof Array?(0,Re.__spreadArray)([r.disabledDays],e,!0):[r.disabledDays,e]},r.handleTimeChange=function(e,t){var n,a,o,i;null===(a=null===(n=r.props.timePickerProps)||void 0===n?void 0:n.onChange)||void 0===a||a.call(n,e);var s=r.state,u=s.value,l=s.time,c=pe(null!=u[t]?$(u[t]):new Date,e),p=[u[0],u[1]];p[t]=c;var d=[l[0],l[1]];d[t]=e,null===(i=(o=r.props).onChange)||void 0===i||i.call(o,p),r.setState({value:p,time:d})},r.handleTimeChangeLeftCalendar=function(e){r.handleTimeChange(e,0)},r.handleTimeChangeRightCalendar=function(e){r.handleTimeChange(e,1)},r.renderSingleNavbar=function(e){return _e.createElement(Je,(0,Re.__assign)({},e,{maxDate:r.props.maxDate,minDate:r.props.minDate}))},r.renderLeftNavbar=function(e){return _e.createElement(Je,(0,Re.__assign)({},e,{hideRightNavButton:r.props.contiguousCalendarMonths,maxDate:r.props.maxDate,minDate:r.props.minDate}))},r.renderRightNavbar=function(e){return _e.createElement(Je,(0,Re.__assign)({},e,{hideLeftNavButton:r.props.contiguousCalendarMonths,maxDate:r.props.maxDate,minDate:r.props.minDate}))},r.renderSingleCaption=function(e){return _e.createElement(Ke,(0,Re.__assign)({},e,{maxDate:r.props.maxDate,minDate:r.props.minDate,onMonthChange:r.handleLeftMonthSelectChange,onYearChange:r.handleLeftYearSelectChange,reverseMonthAndYearMenus:r.props.reverseMonthAndYearMenus}))},r.renderLeftCaption=function(e){return _e.createElement(Ke,(0,Re.__assign)({},e,{maxDate:he(r.props.maxDate),minDate:r.props.minDate,onMonthChange:r.handleLeftMonthSelectChange,onYearChange:r.handleLeftYearSelectChange,reverseMonthAndYearMenus:r.props.reverseMonthAndYearMenus}))},r.renderRightCaption=function(e){return _e.createElement(Ke,(0,Re.__assign)({},e,{maxDate:r.props.maxDate,minDate:ge(r.props.minDate),onMonthChange:r.handleRightMonthSelectChange,onYearChange:r.handleRightYearSelectChange,reverseMonthAndYearMenus:r.props.reverseMonthAndYearMenus}))},r.handleDayMouseEnter=function(e,t,n){var a,o,i,s;if(null===(o=(a=r.props.dayPickerProps).onDayMouseEnter)||void 0===o||o.call(a,e,t,n),!t.disabled){var u=st.getNextState(r.state.value,e,r.props.allowSingleDayRange,r.props.boundaryToModify),l=u.dateRange,c=u.boundary;r.setState({hoverValue:l}),null===(s=(i=r.props).onHoverChange)||void 0===s||s.call(i,l,e,c)}},r.handleDayMouseLeave=function(e,t,n){var a,o,i,s;null===(o=(a=r.props.dayPickerProps).onDayMouseLeave)||void 0===o||o.call(a,e,t,n),t.disabled||(r.setState({hoverValue:void 0}),null===(s=(i=r.props).onHoverChange)||void 0===s||s.call(i,void 0,e,void 0))},r.handleDayClick=function(e,t,n){var a,o;if(null===(o=(a=r.props.dayPickerProps).onDayClick)||void 0===o||o.call(a,e,t,n),t.disabled)r.forceUpdate();else{var i=st.getNextState(r.state.value,e,r.props.allowSingleDayRange,r.props.boundaryToModify).dateRange;r.handleDayMouseEnter(e,t,n),r.handleNextState(i)}},r.handleShortcutClick=function(e,t){var n=r.props,a=n.onChange,o=n.contiguousCalendarMonths,i=n.onShortcutChange,s=e.dateRange;if(e.includeTime){var u=[s[0],s[1]],l=[s[0],s[1]],c=lt(r.state.value,s,r.state,o);r.setState((0,Re.__assign)((0,Re.__assign)({},c),{time:l})),null==a||a(u)}else r.handleNextState(s);void 0===r.props.selectedShortcutIndex&&r.setState({selectedShortcutIndex:t}),null==i||i(e,t)},r.handleNextState=function(e){var t,n,a=r.state.value;e[0]=pe(e[0],r.state.time[0]),e[1]=pe(e[1],r.state.time[1]);var o=lt(a,e,r.state,r.props.contiguousCalendarMonths);null==r.props.value&&r.setState(o),null===(n=(t=r.props).onChange)||void 0===n||n.call(t,e)},r.handleLeftMonthChange=function(e){var t,n,a=ot.fromDate(e);null===(n=(t=r.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,a.getFullDate()),r.updateLeftView(a)},r.handleRightMonthChange=function(e){var t,n,a=ot.fromDate(e);null===(n=(t=r.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,a.getFullDate()),r.updateRightView(a)},r.handleLeftMonthSelectChange=function(e){var t,n,a=new ot(e,r.state.leftView.getYear());null===(n=(t=r.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,a.getFullDate()),r.updateLeftView(a)},r.handleRightMonthSelectChange=function(e){var t,n,a=new ot(e,r.state.rightView.getYear());null===(n=(t=r.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,a.getFullDate()),r.updateRightView(a)},r.handleLeftYearSelectChange=function(e){var t,n,a=new ot(r.state.leftView.getMonth(),e);null===(n=(t=r.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,a.getFullDate());var o=r.props,i=o.minDate,s=he(o.maxDate),u=new ot(i.getMonth(),i.getFullYear()),l=new ot(s.getMonth(),s.getFullYear());a.isBefore(u)?a=u:a.isAfter(l)&&(a=l);var c=r.state.rightView.clone();a.isBefore(c)&&!r.props.contiguousCalendarMonths||(c=a.getNextMonth()),r.setViews(a,c)},r.handleRightYearSelectChange=function(e){var t,n,a=new ot(r.state.rightView.getMonth(),e);null===(n=(t=r.props.dayPickerProps).onMonthChange)||void 0===n||n.call(t,a.getFullDate());var o=r.props,i=o.minDate,s=o.maxDate,u=ge(i),l=ot.fromDate(u),c=ot.fromDate(s);a.isBefore(l)?a=l:a.isAfter(c)&&(a=c);var p=r.state.leftView.clone();a.isAfter(p)&&!r.props.contiguousCalendarMonths||(p=a.getPreviousMonth()),r.setViews(p,a)};var o=function(e){return null!=e.value?e.value:null!=e.defaultValue?e.defaultValue:[null,null]}(t),i=o,s=function(e,t){var n=new Date;if(null!=e.initialMonth)return e.initialMonth;if(null!=t[0])return $(t[0]);if(null!=t[1]){var a=$(t[1]);return Q(a,e.minDate)||a.setMonth(a.getMonth()-1),a}return ee(n,[e.minDate,e.maxDate])?n:ce([e.minDate,e.maxDate])}(t,o),u=Q(s,t.minDate),l=Q(s,t.maxDate);t.singleMonthOnly||u||!l||s.setMonth(s.getMonth()-1);var c=ot.fromDate(s),p=o[1],d=t.contiguousCalendarMonths||null==p||Q(s,p)?c.getNextMonth():ot.fromDate(p);return r.state={hoverValue:[null,null],leftView:c,rightView:d,selectedShortcutIndex:void 0!==r.props.selectedShortcutIndex?r.props.selectedShortcutIndex:-1,time:i,value:o},r}return(0,Re.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,a=t.contiguousCalendarMonths,r=t.singleMonthOnly,o=t.footerElement,i=r||Q(this.props.minDate,this.props.maxDate),s=Te()(l,T,n,((e={})[A]=a,e[N]=i,e));return _e.createElement("div",{className:s},this.maybeRenderShortcuts(),_e.createElement("div",{className:g},this.renderCalendars(i),this.maybeRenderTimePickers(i),o))},t.prototype.componentDidUpdate=function(t,n){if(e.prototype.componentDidUpdate.call(this,t,n),!X(t.value,this.props.value)||t.contiguousCalendarMonths!==this.props.contiguousCalendarMonths){var a=lt(t.value,this.props.value,this.state,t.contiguousCalendarMonths);this.setState(a)}this.props.selectedShortcutIndex!==t.selectedShortcutIndex&&this.setState({selectedShortcutIndex:this.props.selectedShortcutIndex})},t.prototype.validateProps=function(e){var t=e.defaultValue,n=e.initialMonth,r=e.maxDate,o=e.minDate,i=e.boundaryToModify,s=e.value,u=[o,r];null==t||te(t,u)||console.error(Be),null==n||ne(n,u)||console.error(Ve),null!=r&&null!=o&&r<o&&!z(r,o)&&console.error(Ue),null==s||te(s,u)||console.error(He),null!=i&&i!==a.Boundary.START&&i!==a.Boundary.END&&console.error("<DateRangePicker> preferredBoundaryToModify must be a valid Boundary if defined.")},t.prototype.maybeRenderShortcuts=function(){var e=this.props.shortcuts;if(null==e||!1===e)return null;var t=this.state.selectedShortcutIndex,n=this.props,r=n.allowSingleDayRange,o=n.maxDate,i=n.minDate,s=n.timePrecision;return[_e.createElement(Xe,(0,Re.__assign)({key:"shortcuts"},{allowSingleDayRange:r,maxDate:o,minDate:i,selectedShortcutIndex:t,shortcuts:e,timePrecision:s},{onShortcutClick:this.handleShortcutClick})),_e.createElement(a.Divider,{key:"div"})]},t.prototype.maybeRenderTimePickers=function(e){var n=this.props,a=n.timePrecision,r=n.timePickerProps;return null==a&&r===t.defaultProps.timePickerProps?null:e?_e.createElement(Ze,(0,Re.__assign)({precision:a},r,{onChange:this.handleTimeChangeLeftCalendar,value:this.state.time[0