react-day-picker
Advanced tools
Comparing version 8.3.4 to 8.3.5
@@ -1,1 +0,1 @@ | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("date-fns/locale/en-US"),a=require("date-fns/format"),n=require("date-fns/endOfMonth"),r=require("date-fns/startOfDay"),o=require("date-fns/startOfMonth"),l=require("date-fns/isSameYear"),u=require("date-fns/setMonth"),i=require("date-fns/setYear"),d=require("date-fns/startOfYear"),s=require("date-fns/addMonths"),f=require("date-fns/isBefore"),c=require("date-fns/isSameMonth"),p=require("date-fns/differenceInCalendarMonths"),m=require("date-fns/addDays"),v=require("date-fns/startOfISOWeek"),y=require("date-fns/startOfWeek"),h=require("date-fns/getUnixTime"),b=require("date-fns/isSameDay"),g=require("date-fns/differenceInCalendarDays"),w=require("date-fns/subDays"),x=require("date-fns/isAfter"),D=require("date-fns"),M=require("date-fns/isDate"),_=require("date-fns/addWeeks"),k=require("date-fns/addYears"),E=require("date-fns/endOfISOWeek"),N=require("date-fns/endOfWeek"),C=require("date-fns/max"),P=require("date-fns/min"),O=require("date-fns/getWeeksInMonth"),S=require("date-fns/getISOWeek"),W=require("date-fns/getWeek"),L=require("date-fns/parse");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function q(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var B=I(e),j=q(e),F=I(t),R=I(a),T=I(n),A=I(r),Y=I(o),H=I(l),K=I(u),U=I(i),z=I(d),Z=I(s),G=I(f),J=I(c),Q=I(p),V=I(m),X=I(v),$=I(y),ee=I(h),te=I(b),ae=I(g),ne=I(w),re=I(x),oe=I(M),le=I(_),ue=I(k),ie=I(E),de=I(N),se=I(C),fe=I(P),ce=I(O),pe=I(S),me=I(W),ve=I(L),ye=function(){return ye=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ye.apply(this,arguments)};function he(e){return"multiple"===e.mode}function be(e){return"range"===e.mode}function ge(e){return"single"===e.mode}var we={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var xe=Object.freeze({__proto__:null,formatCaption:function(e,t){return R.default(e,"LLLL y",t)},formatDay:function(e,t){return R.default(e,"d",t)},formatMonthCaption:function(e,t){return R.default(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return R.default(e,"cccccc",t)},formatYearCaption:function(e,t){return R.default(e,"yyyy",t)}}),De=Object.freeze({__proto__:null,labelDay:function(e,t,a){return R.default(e,"do MMMM (EEEE)",a)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekday:function(e,t){return R.default(e,"cccc",t)},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelYearDropdown:function(){return"Year: "}});function Me(e){var t=e.fromYear,a=e.toYear,n=e.fromMonth,r=e.toMonth,o=e.fromDate,l=e.toDate;return n?o=Y.default(n):t&&(o=new Date(t,0,1)),r?l=T.default(r):a&&(l=new Date(a,11,31)),{fromDate:o?A.default(o):void 0,toDate:l?A.default(l):void 0}}var _e=e.createContext(void 0);function ke(e){var t,a,n,r,o,l=e.initialProps,u=(a=we,n=F.default,r=new Date,{captionLayout:"buttons",classNames:a,formatters:xe,labels:De,locale:n,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:r,mode:"default"}),i=Me(l),d=i.fromDate,s=i.toDate,f=null!==(t=l.captionLayout)&&void 0!==t?t:u.captionLayout;"buttons"===f||d&&s||(f="buttons"),(ge(l)||he(l)||be(l))&&(o=l.onSelect);var c=ye(ye(ye({},u),l),{captionLayout:f,classNames:ye(ye({},u.classNames),l.classNames),components:ye({},l.components),formatters:ye(ye({},u.formatters),l.formatters),fromDate:d,labels:ye(ye({},u.labels),l.labels),mode:l.mode||u.mode,modifiers:ye(ye({},u.modifiers),l.modifiers),modifiersClassNames:ye(ye({},u.modifiersClassNames),l.modifiersClassNames),onSelect:o,styles:ye(ye({},u.styles),l.styles),toDate:s});return B.default.createElement(_e.Provider,{value:c},e.children)}function Ee(){var t=e.useContext(_e);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function Ne(e){var t=Ee(),a=t.locale,n=t.classNames,r=t.styles,o=t.formatters.formatCaption;return B.default.createElement("h2",{className:n.caption_label,style:r.caption_label,"aria-live":"polite","aria-atomic":"true",id:e.id},o(e.displayMonth,{locale:a}))}function Ce(e){return B.default.createElement("svg",ye({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e),B.default.createElement("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"}))}function Pe(e){var t,a,n=e.onChange,r=e.value,o=e.children,l=e.caption,u=e.className,i=e.style,d=Ee(),s=null!==(a=null===(t=d.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==a?a:Ce;return B.default.createElement("div",{className:u,style:i},B.default.createElement("span",{className:d.classNames.vhidden},e["aria-label"]),B.default.createElement("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:r,onChange:n},o),B.default.createElement("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true"},l,B.default.createElement(s,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})))}function Oe(e){var t,a=Ee(),n=a.fromDate,r=a.toDate,o=a.styles,l=a.locale,u=a.formatters.formatMonthCaption,i=a.classNames,d=a.components,s=a.labels.labelMonthDropdown;if(!n)return B.default.createElement(B.default.Fragment,null);if(!r)return B.default.createElement(B.default.Fragment,null);var f=[];if(H.default(n,r))for(var c=Y.default(n),p=n.getMonth();p<=r.getMonth();p++)f.push(K.default(c,p));else for(c=Y.default(new Date),p=0;p<=11;p++)f.push(K.default(c,p));var m=null!==(t=null==d?void 0:d.Dropdown)&&void 0!==t?t:Pe;return B.default.createElement(m,{name:"months","aria-label":s(),className:i.dropdown_month,style:o.dropdown_month,onChange:function(t){var a=Number(t.target.value),n=K.default(Y.default(e.displayMonth),a);e.onChange(n)},value:e.displayMonth.getMonth(),caption:u(e.displayMonth,{locale:l})},f.map((function(e){return B.default.createElement("option",{key:e.getMonth(),value:e.getMonth()},u(e,{locale:l}))})))}function Se(e){var t,a=e.displayMonth,n=Ee(),r=n.fromDate,o=n.toDate,l=n.locale,u=n.styles,i=n.classNames,d=n.components,s=n.formatters.formatYearCaption,f=n.labels.labelYearDropdown,c=[];if(!r)return B.default.createElement(B.default.Fragment,null);if(!o)return B.default.createElement(B.default.Fragment,null);for(var p=r.getFullYear(),m=o.getFullYear(),v=p;v<=m;v++)c.push(U.default(z.default(new Date),v));var y=null!==(t=null==d?void 0:d.Dropdown)&&void 0!==t?t:Pe;return B.default.createElement(y,{name:"years","aria-label":f(),className:i.dropdown_year,style:u.dropdown_year,onChange:function(t){var n=U.default(Y.default(a),Number(t.target.value));e.onChange(n)},value:a.getFullYear(),caption:s(a,{locale:l})},c.map((function(e){return B.default.createElement("option",{key:e.getFullYear(),value:e.getFullYear()},s(e,{locale:l}))})))}function We(){var t=Ee(),a=function(e){var t=e.month,a=e.defaultMonth,n=e.today,r=t||a||n||new Date,o=e.toDate,l=e.fromDate,u=e.numberOfMonths,i=void 0===u?1:u;if(o&&Q.default(o,r)<0){var d=-1*(i-1);r=Z.default(o,d)}return l&&Q.default(r,l)<0&&(r=l),Y.default(r)}(t),n=function(t,a){var n=e.useState(t),r=n[0];return[void 0===a?r:a,n[1]]}(a,t.month),r=n[0],o=n[1];return[r,function(e){var a;if(!t.disableNavigation){var n=Y.default(e);o(n),null===(a=t.onMonthChange)||void 0===a||a.call(t,n)}}]}var Le=e.createContext(void 0);function Ie(e){var t=Ee(),a=We(),n=a[0],r=a[1],o=function(e,t){for(var a=t.reverseMonths,n=t.numberOfMonths,r=Y.default(e),o=Y.default(Z.default(r,n)),l=Q.default(o,r),u=[],i=0;i<l;i++){var d=Z.default(r,i);u.push(d)}return a&&(u=u.reverse()),u}(n,t),l=function(e,t){if(!t.disableNavigation){var a=t.toDate,n=t.pagedNavigation,r=t.numberOfMonths,o=void 0===r?1:r,l=n?o:1,u=Y.default(e);if(!a)return Z.default(u,l);if(!(Q.default(a,e)<o))return Z.default(u,l)}}(n,t),u=function(e,t){if(!t.disableNavigation){var a=t.fromDate,n=t.pagedNavigation,r=t.numberOfMonths,o=n?void 0===r?1:r:1,l=Y.default(e);if(!a)return Z.default(l,-o);if(!(Q.default(l,a)<=0))return Z.default(l,-o)}}(n,t),i=function(e){return o.some((function(t){return J.default(e,t)}))},d={currentMonth:n,displayMonths:o,goToMonth:r,goToDate:function(e,a){i(e)||(a&&G.default(e,a)?r(Z.default(e,1+-1*t.numberOfMonths)):r(e))},previousMonth:u,nextMonth:l,isDateDisplayed:i};return B.default.createElement(Le.Provider,{value:d},e.children)}function qe(){var t=e.useContext(Le);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function Be(e){var t,a=Ee(),n=a.classNames,r=a.styles,o=a.components,l=qe().goToMonth,u=function(e){l(e)},i=null!==(t=null==o?void 0:o.CaptionLabel)&&void 0!==t?t:Ne,d=B.default.createElement(i,{id:e.id,displayMonth:e.displayMonth});return B.default.createElement("div",{className:n.caption_dropdowns,style:r.caption_dropdowns},B.default.createElement("div",{className:n.vhidden},d),B.default.createElement(Oe,{onChange:u,displayMonth:e.displayMonth}),B.default.createElement(Se,{onChange:u,displayMonth:e.displayMonth}))}function je(e){return B.default.createElement("svg",ye({width:"16px",height:"16px",viewBox:"0 0 120 120"},e),B.default.createElement("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"}))}function Fe(e){return B.default.createElement("svg",ye({width:"16px",height:"16px",viewBox:"0 0 120 120"},e),B.default.createElement("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"}))}var Re=e.forwardRef((function(e,t){var a=Ee(),n=a.classNames,r=a.styles,o=[n.button_reset,n.button];e.className&&o.push(e.className);var l=o.join(" "),u=ye(ye({},r.button_reset),r.button);return e.style&&Object.assign(u,e.style),B.default.createElement("button",ye({},e,{ref:t,type:"button",className:l,style:u}))}));function Te(e){var t,a,n=Ee(),r=n.dir,o=n.locale,l=n.classNames,u=n.styles,i=n.labels,d=i.labelPrevious,s=i.labelNext,f=n.components;if(!e.nextMonth&&!e.previousMonth)return B.default.createElement(B.default.Fragment,null);var c=d(e.previousMonth,{locale:o}),p=[l.nav_button,l.nav_button_previous].join(" "),m=s(e.nextMonth,{locale:o}),v=[l.nav_button,l.nav_button_next].join(" "),y=null!==(t=null==f?void 0:f.IconRight)&&void 0!==t?t:Fe,h=null!==(a=null==f?void 0:f.IconLeft)&&void 0!==a?a:je;return B.default.createElement("div",{className:l.nav,style:u.nav},!e.hidePrevious&&B.default.createElement(Re,{name:"previous-month","aria-label":c,className:p,style:u.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick},"rtl"===r?B.default.createElement(y,{className:l.nav_icon,style:u.nav_icon}):B.default.createElement(h,{className:l.nav_icon,style:u.nav_icon})),!e.hideNext&&B.default.createElement(Re,{name:"next-month","aria-label":m,className:v,style:u.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick},"rtl"===r?B.default.createElement(h,{className:l.nav_icon,style:u.nav_icon}):B.default.createElement(y,{className:l.nav_icon,style:u.nav_icon})))}function Ae(e){var t,a,n=Ee(),r=n.numberOfMonths,o=n.dir,l=n.components,u=qe(),i=u.previousMonth,d=u.nextMonth,s=u.goToMonth,f=u.displayMonths,c=f.findIndex((function(t){return J.default(e.displayMonth,t)})),p=0===c,m=c===f.length-1;"rtl"===o&&(m=(t=[p,m])[0],p=t[1]);var v=r>1&&(p||!m),y=r>1&&(m||!p),h=null!==(a=null==l?void 0:l.CaptionLabel)&&void 0!==a?a:Ne,b=B.default.createElement(h,{id:e.id,displayMonth:e.displayMonth});return B.default.createElement(B.default.Fragment,null,b,B.default.createElement(Te,{displayMonth:e.displayMonth,hideNext:v,hidePrevious:y,nextMonth:d,previousMonth:i,onPreviousClick:function(){i&&s(i)},onNextClick:function(){d&&s(d)}}))}function Ye(e){var t,a,n=Ee(),r=n.classNames,o=n.disableNavigation,l=n.styles,u=n.captionLayout,i=n.components,d=null!==(t=null==i?void 0:i.CaptionLabel)&&void 0!==t?t:Ne;return a=o?B.default.createElement(d,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===u?B.default.createElement(Be,{displayMonth:e.displayMonth,id:e.id}):B.default.createElement(Ae,{displayMonth:e.displayMonth,id:e.id}),B.default.createElement("div",{className:r.caption,style:l.caption},a)}function He(){var e=Ee(),t=e.footer,a=e.styles,n=e.classNames.tfoot;return t?B.default.createElement("tfoot",{className:n,style:a.tfoot},B.default.createElement("tr",null,B.default.createElement("td",{colSpan:8},t))):B.default.createElement(B.default.Fragment,null)}function Ke(){var e=Ee(),t=e.classNames,a=e.styles,n=e.showWeekNumber,r=e.locale,o=e.weekStartsOn,l=e.ISOWeek,u=e.formatters.formatWeekdayName,i=e.labels.labelWeekday,d=function(e,t,a){for(var n=a?X.default(new Date):$.default(new Date,{locale:e,weekStartsOn:t}),r=[],o=0;o<7;o++){var l=V.default(n,o);r.push(l)}return r}(r,o,l);return B.default.createElement("tr",{style:a.head_row,className:t.head_row},n&&B.default.createElement("th",{scope:"col",style:a.head_cell,className:t.head_cell}),d.map((function(e,n){return B.default.createElement("th",{key:n,scope:"col",className:t.head_cell,style:a.head_cell},B.default.createElement("span",{"aria-hidden":!0},u(e,{locale:r})),B.default.createElement("span",{className:t.vhidden},i(e,{locale:r})))})))}function Ue(){var e,t=Ee(),a=t.classNames,n=t.styles,r=t.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:Ke;return B.default.createElement("thead",{style:n.head,className:a.head},B.default.createElement(o,null))}function ze(e){var t=Ee(),a=t.locale,n=t.formatters.formatDay;return B.default.createElement(B.default.Fragment,null,n(e.date,{locale:a}))}var Ze=e.createContext(void 0);function Ge(e){if(!he(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return B.default.createElement(Ze.Provider,{value:t},e.children)}return B.default.createElement(Je,{initialProps:e.initialProps,children:e.children})}function Je(e){var t=e.initialProps,a=e.children,n=t.selected,r=t.min,o=t.max,l={disabled:[]};n&&l.disabled.push((function(e){var t=o&&n.length>o-1,a=n.some((function(t){return te.default(t,e)}));return Boolean(t&&!a)}));var u={selected:n,onDayClick:function(e,a,l){var u,i;if((null===(u=t.onDayClick)||void 0===u||u.call(t,e,a,l),!Boolean(a.selected&&r&&(null==n?void 0:n.length)===r))&&!Boolean(!a.selected&&o&&(null==n?void 0:n.length)===o)){var d=n?function(e,t,a){if(a||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([],n,!0):[];if(a.selected){var s=d.findIndex((function(t){return te.default(e,t)}));d.splice(s,1)}else d.push(e);null===(i=t.onSelect)||void 0===i||i.call(t,d,e,a,l)}},modifiers:l};return B.default.createElement(Ze.Provider,{value:u},a)}function Qe(){var t=e.useContext(Ze);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Ve(e,t){var a=t||{},n=a.from,r=a.to;if(!n)return{from:e,to:void 0};if(!r&&te.default(n,e))return{from:n,to:e};if(!r&&G.default(e,n))return{from:e,to:n};if(!r)return{from:n,to:e};if(!te.default(r,e)||!te.default(n,e)){if(te.default(r,e))return{from:r,to:void 0};if(!te.default(n,e))return re.default(n,e)?{from:e,to:r}:{from:n,to:e}}}var Xe,$e=e.createContext(void 0);function et(e){if(!be(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return B.default.createElement($e.Provider,{value:t},e.children)}return B.default.createElement(tt,{initialProps:e.initialProps,children:e.children})}function tt(e){var t=e.initialProps,a=e.children,n=t.selected,r=n||{},o=r.from,l=r.to,u=t.min,i=t.max,d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o&&(d.range_start=[o],l?(d.range_end=[l],d.range_middle=[{after:o,before:l}]):d.range_end=[o]),u&&(o&&!l&&d.disabled.push({after:ne.default(o,u-1),before:V.default(o,u-1)}),o&&l&&d.disabled.push({after:o,before:V.default(o,u-1)})),i&&(o&&!l&&(d.disabled.push({before:V.default(o,1-i)}),d.disabled.push({after:V.default(o,i-1)})),o&&l)){var s=i-(ae.default(l,o)+1);d.disabled.push({before:ne.default(o,s)}),d.disabled.push({after:V.default(l,s)})}return B.default.createElement($e.Provider,{value:{selected:n,onDayClick:function(e,a,r){var o,l;null===(o=t.onDayClick)||void 0===o||o.call(t,e,a,r);var u=Ve(e,n);null===(l=t.onSelect)||void 0===l||l.call(t,u,e,a,r)},modifiers:d}},a)}function at(){var t=e.useContext($e);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function nt(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}exports.InternalModifier=void 0,(Xe=exports.InternalModifier||(exports.InternalModifier={})).Outside="outside",Xe.Disabled="disabled",Xe.Selected="selected",Xe.Hidden="hidden",Xe.Today="today",Xe.RangeStart="range_start",Xe.RangeEnd="range_end",Xe.RangeMiddle="range_middle";var rt=exports.InternalModifier.Selected,ot=exports.InternalModifier.Disabled,lt=exports.InternalModifier.Hidden,ut=exports.InternalModifier.Today,it=exports.InternalModifier.RangeEnd,dt=exports.InternalModifier.RangeMiddle,st=exports.InternalModifier.RangeStart,ft=exports.InternalModifier.Outside;var ct=e.createContext(void 0);function pt(e){var t=Ee(),a=function(e,t,a){var n,r=((n={})[rt]=nt(e.selected),n[ot]=nt(e.disabled),n[lt]=nt(e.hidden),n[ut]=[e.today],n[it]=[],n[dt]=[],n[st]=[],n[ft]=[],n);return e.fromDate&&r[ot].push({before:e.fromDate}),e.toDate&&r[ot].push({after:e.toDate}),he(e)?r[ot]=r[ot].concat(t.modifiers[ot]):be(e)&&(r[ot]=r[ot].concat(a.modifiers[ot]),r[st]=a.modifiers[st],r[dt]=a.modifiers[dt],r[it]=a.modifiers[it]),r}(t,Qe(),at()),n=function(e){var t={};return Object.entries(e).forEach((function(e){var a=e[0],n=e[1];t[a]=nt(n)})),t}(t.modifiers),r=ye(ye({},a),n);return B.default.createElement(ct.Provider,{value:r},e.children)}function mt(){var t=e.useContext(ct);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function vt(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function yt(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function ht(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function bt(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function gt(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function wt(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(a=t,oe.default(a))return te.default(e,t);var a;if(function(e){return Array.isArray(e)&&e.every(oe.default)}(t))return t.includes(e);if(yt(t))return function(e,t){var a,n=t.from,r=t.to;if(!n)return!1;if(!r&&te.default(n,e))return!0;if(!r)return!1;var o=ae.default(r,n)<0;return r&&o&&(n=(a=[r,n])[0],r=a[1]),ae.default(e,n)>=0&&ae.default(r,e)>=0}(e,t);if(gt(t))return t.dayOfWeek.includes(e.getDay());if(vt(t)){var n=ae.default(t.before,e)>0,r=ae.default(t.after,e)<0;return D.isAfter(t.before,t.after)?r&&n:n||r}return ht(t)?ae.default(e,t.after)>0:bt(t)?ae.default(t.before,e)>0:"function"==typeof t&&t(e)}))}function xt(e,t,a){var n=Object.keys(t).reduce((function(a,n){var r=t[n];return wt(e,r)&&a.push(n),a}),[]),r={};return n.forEach((function(e){return r[e]=!0})),a&&!J.default(e,a)&&(r.outside=!0),r}function Dt(e,t){var a=t.moveBy,n=t.direction,r=t.context,o=t.modifiers,l=t.retry,u=void 0===l?{count:0,lastFocused:e}:l,i=r.weekStartsOn,d=r.fromDate,s=r.toDate,f=r.locale,c={day:V.default,week:le.default,month:Z.default,year:ue.default,startOfWeek:function(e){return r.ISOWeek?X.default(e):$.default(e,{locale:f,weekStartsOn:i})},endOfWeek:function(e){return r.ISOWeek?ie.default(e):de.default(e,{locale:f,weekStartsOn:i})}}[a](e,"after"===n?1:-1);"before"===n&&d?c=se.default([d,c]):"after"===n&&s&&(c=fe.default([s,c]));var p=!0;if(o){var m=xt(c,o);p=!m.disabled&&!m.hidden}return p?c:u.count>365?u.lastFocused:Dt(c,{moveBy:a,direction:n,context:r,modifiers:o,retry:ye(ye({},u),{count:u.count+1})})}var Mt=e.createContext(void 0);function _t(t){var a=qe(),n=mt(),r=e.useState(),o=r[0],l=r[1],u=e.useState(),i=u[0],d=u[1],s=function(e,t){for(var a,n,r=Y.default(e[0]),o=T.default(e[e.length-1]),l=r;l<=o;){var u=xt(l,t);if(u.disabled||u.hidden)l=V.default(l,1);else{if(u.selected)return l;u.today&&!n&&(n=l),a||(a=l),l=V.default(l,1)}}return n||a}(a.displayMonths,n),f=(null!=o?o:i&&a.isDateDisplayed(i))?i:s,c=function(e){l(e)},p=Ee(),m=function(e,t){if(o){var r=Dt(o,{moveBy:e,direction:t,context:p,modifiers:n});te.default(o,r)||(a.goToDate(r,o),c(r))}},v={focusedDay:o,focusTarget:f,blur:function(){d(o),l(void 0)},focus:c,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return B.default.createElement(Mt.Provider,{value:v},t.children)}function kt(){var t=e.useContext(Mt);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function Et(e,t){return xt(e,mt(),t)}var Nt=e.createContext(void 0);function Ct(e){if(!ge(e.initialProps)){var t={selected:void 0};return B.default.createElement(Nt.Provider,{value:t},e.children)}return B.default.createElement(Pt,{initialProps:e.initialProps,children:e.children})}function Pt(e){var t=e.initialProps,a=e.children,n={selected:t.selected,onDayClick:function(e,a,n){var r,o,l;null===(r=t.onDayClick)||void 0===r||r.call(t,e,a,n),!a.selected||t.required?null===(l=t.onSelect)||void 0===l||l.call(t,e,e,a,n):null===(o=t.onSelect)||void 0===o||o.call(t,void 0,e,a,n)}};return B.default.createElement(Nt.Provider,{value:n},a)}function Ot(){var t=e.useContext(Nt);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function St(e,t){var a=[e.classNames.day];return Object.keys(t).forEach((function(t){var n=e.modifiersClassNames[t];if(n)a.push(n);else if(function(e){return Object.values(exports.InternalModifier).includes(e)}(t)){var r=e.classNames["day_".concat(t)];r&&a.push(r)}})),a}function Wt(t,a,n){var r,o,l,u=Ee(),i=kt(),d=Et(t,a),s=function(e,t){var a=Ee(),n=Ot(),r=Qe(),o=at(),l=kt(),u=l.focusDayAfter,i=l.focusDayBefore,d=l.focusWeekAfter,s=l.focusWeekBefore,f=l.blur,c=l.focus,p=l.focusMonthBefore,m=l.focusMonthAfter,v=l.focusYearBefore,y=l.focusYearAfter,h=l.focusStartOfWeek,b=l.focusEndOfWeek,g={onClick:function(l){var u,i,d,s;ge(a)?null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,l):he(a)?null===(i=r.onDayClick)||void 0===i||i.call(r,e,t,l):be(a)?null===(d=o.onDayClick)||void 0===d||d.call(o,e,t,l):null===(s=a.onDayClick)||void 0===s||s.call(a,e,t,l)},onFocus:function(n){var r;c(e),null===(r=a.onDayFocus)||void 0===r||r.call(a,e,t,n)},onBlur:function(n){var r;f(),null===(r=a.onDayBlur)||void 0===r||r.call(a,e,t,n)},onKeyDown:function(n){var r;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===a.dir?u():i();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===a.dir?i():u();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),d();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),s();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():p();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?y():m();break;case"Home":n.preventDefault(),n.stopPropagation(),h();break;case"End":n.preventDefault(),n.stopPropagation(),b()}null===(r=a.onDayKeyDown)||void 0===r||r.call(a,e,t,n)},onKeyUp:function(n){var r;null===(r=a.onDayKeyUp)||void 0===r||r.call(a,e,t,n)},onMouseEnter:function(n){var r;null===(r=a.onDayMouseEnter)||void 0===r||r.call(a,e,t,n)},onMouseLeave:function(n){var r;null===(r=a.onDayMouseLeave)||void 0===r||r.call(a,e,t,n)},onTouchCancel:function(n){var r;null===(r=a.onDayTouchCancel)||void 0===r||r.call(a,e,t,n)},onTouchEnd:function(n){var r;null===(r=a.onDayTouchEnd)||void 0===r||r.call(a,e,t,n)},onTouchMove:function(n){var r;null===(r=a.onDayTouchMove)||void 0===r||r.call(a,e,t,n)},onTouchStart:function(n){var r;null===(r=a.onDayTouchStart)||void 0===r||r.call(a,e,t,n)}};return g}(t,d),f=function(){var e=Ee(),t=Ot(),a=Qe(),n=at();return ge(e)?t.selected:he(e)?a.selected:be(e)?n.selected:void 0}(),c=Boolean(u.onDayClick||"default"!==u.mode);e.useEffect((function(){var e;d.outside||i.focusedDay&&c&&te.default(i.focusedDay,t)&&(null===(e=n.current)||void 0===e||e.focus())}),[i.focusedDay,t,n,c,d.outside]);var p=St(u,d).join(" "),m=function(e,t){var a=ye({},e.styles.day);return Object.keys(t).forEach((function(t){var n;a=ye(ye({},a),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])})),a}(u,d),v=u.labels.labelDay(t,d,{locale:u.locale}),y=Boolean(d.outside&&!u.showOutsideDays||d.hidden),h=null!==(l=null===(o=u.components)||void 0===o?void 0:o.DayContent)&&void 0!==l?l:ze,b={style:m,className:p,children:B.default.createElement(h,{date:t,displayMonth:a,activeModifiers:d}),"aria-label":v},g=i.focusTarget&&te.default(i.focusTarget,t)&&!d.outside,w=ye(ye(ye({},b),((r={disabled:d.disabled})["aria-pressed"]=d.selected,r["aria-label"]=v,r.tabIndex=g?0:-1,r)),s);return{isButton:c,isHidden:y,activeModifiers:d,selectedDays:f,buttonProps:w,divProps:b}}function Lt(t){var a=e.useRef(null),n=Wt(t.date,t.displayMonth,a);return n.isHidden?B.default.createElement(B.default.Fragment,null):n.isButton?B.default.createElement(Re,ye({name:"day",ref:a},n.buttonProps)):B.default.createElement("div",ye({},n.divProps))}function It(e){var t=e.number,a=e.dates,n=Ee(),r=n.onWeekNumberClick,o=n.styles,l=n.classNames,u=n.locale,i=n.labels.labelWeekNumber,d=(0,n.formatters.formatWeekNumber)(Number(t),{locale:u});if(!r)return B.default.createElement("span",{className:l.weeknumber,style:o.weeknumber},d);var s=i(Number(t),{locale:u});return B.default.createElement(Re,{name:"week-number","aria-label":s,className:l.weeknumber,style:o.weeknumber,onClick:function(e){r(t,a,e)}},d)}function qt(e){var t,a,n,r=Ee(),o=r.styles,l=r.classNames,u=r.showWeekNumber,i=r.components,d=null!==(t=null==i?void 0:i.Day)&&void 0!==t?t:Lt,s=null!==(a=null==i?void 0:i.WeekNumber)&&void 0!==a?a:It;return u&&(n=B.default.createElement("td",{className:l.cell,style:o.cell},B.default.createElement(s,{number:e.weekNumber,dates:e.dates}))),B.default.createElement("tr",{className:l.row,style:o.row},n,e.dates.map((function(t){return B.default.createElement("td",{className:l.cell,style:o.cell,key:ee.default(t)},B.default.createElement(d,{displayMonth:e.displayMonth,date:t}))})))}function Bt(e,t,a){for(var n=(null==a?void 0:a.ISOWeek)?ie.default(t):de.default(t,a),r=(null==a?void 0:a.ISOWeek)?X.default(e):$.default(e,a),o=ae.default(n,r),l=[],u=0;u<=o;u++)l.push(V.default(r,u));return l.reduce((function(e,t){var n=(null==a?void 0:a.ISOWeek)?pe.default(t):me.default(t,a),r=e.find((function(e){return e.weekNumber===n}));return r?(r.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)}),[])}function jt(e){var t,a,n,r=Ee(),o=r.locale,l=r.classNames,u=r.styles,i=r.hideHead,d=r.fixedWeeks,s=r.components,f=r.weekStartsOn,c=r.firstWeekContainsDate,p=r.ISOWeek,m=function(e,t){var a=Bt(Y.default(e),T.default(e),t);if(null==t?void 0:t.useFixedWeeks){var n=ce.default(e,t);if(n<6){var r=a[a.length-1],o=r.dates[r.dates.length-1],l=le.default(o,6-n),u=Bt(le.default(o,1),l,t);a.push.apply(a,u)}}return a}(e.displayMonth,{useFixedWeeks:Boolean(d),ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:c}),v=null!==(t=null==s?void 0:s.Head)&&void 0!==t?t:Ue,y=null!==(a=null==s?void 0:s.Row)&&void 0!==a?a:qt,h=null!==(n=null==s?void 0:s.Footer)&&void 0!==n?n:He;return B.default.createElement("table",{className:l.table,style:u.table,role:"grid","aria-labelledby":e["aria-labelledby"]},!i&&B.default.createElement(v,null),B.default.createElement("tbody",{className:l.tbody,style:u.tbody},m.map((function(t){return B.default.createElement(y,{displayMonth:e.displayMonth,key:t.weekNumber,dates:t.dates,weekNumber:t.weekNumber})}))),B.default.createElement(h,null))}var Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect,Rt=!1,Tt=0;function At(){return"react-day-picker-".concat(++Tt)}function Yt(e){var t,a,n=Ee(),r=n.dir,o=n.classNames,l=n.styles,u=n.components,i=qe().displayMonths,d=function(e){var t,a=null!=e?e:Rt?At():null,n=j.useState(a),r=n[0],o=n[1];return Ft((function(){null===r&&o(At())}),[]),j.useEffect((function(){!1===Rt&&(Rt=!0)}),[]),null!==(t=null!=e?e:r)&&void 0!==t?t:void 0}(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),s=[o.month],f=l.month,c=0===e.displayIndex,p=e.displayIndex===i.length-1,m=!c&&!p;"rtl"===r&&(p=(t=[c,p])[0],c=t[1]),c&&(s.push(o.caption_start),f=ye(ye({},f),l.caption_start)),p&&(s.push(o.caption_end),f=ye(ye({},f),l.caption_end)),m&&(s.push(o.caption_between),f=ye(ye({},f),l.caption_between));var v=null!==(a=null==u?void 0:u.Caption)&&void 0!==a?a:Ye;return B.default.createElement("div",{key:e.displayIndex,className:s.join(" "),style:f},B.default.createElement(v,{id:d,displayMonth:e.displayMonth}),B.default.createElement(jt,{"aria-labelledby":d,displayMonth:e.displayMonth}))}function Ht(){var t=Ee(),a=kt(),n=qe(),r=e.useState(!1),o=r[0],l=r[1];e.useEffect((function(){t.initialFocus&&a.focusTarget&&(o||(a.focus(a.focusTarget),l(!0)))}),[t.initialFocus,o,a.focus,a.focusTarget,a]);var u=[t.classNames.root,t.className];t.numberOfMonths>1&&u.push(t.classNames.multiple_months),t.showWeekNumber&&u.push(t.classNames.with_weeknumber);var i=ye(ye({},t.styles.root),t.style);return B.default.createElement("div",{className:u.join(" "),style:i,dir:t.dir},B.default.createElement("div",{className:t.classNames.months,style:t.styles.months},n.displayMonths.map((function(e,t){return B.default.createElement(Yt,{key:t,displayIndex:t,displayMonth:e})}))))}function Kt(e){var t=e.children,a=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a}(e,["children"]);return B.default.createElement(ke,{initialProps:a},B.default.createElement(Ie,null,B.default.createElement(Ct,{initialProps:a},B.default.createElement(Ge,{initialProps:a},B.default.createElement(et,{initialProps:a},B.default.createElement(pt,null,B.default.createElement(_t,null,t)))))))}function Ut(e){return!isNaN(e.getTime())}exports.Button=Re,exports.Caption=Ye,exports.CaptionDropdowns=Be,exports.CaptionLabel=Ne,exports.CaptionNavigation=Ae,exports.Day=Lt,exports.DayContent=ze,exports.DayPicker=function(e){return B.default.createElement(Kt,ye({},e),B.default.createElement(Ht,null))},exports.DayPickerContext=_e,exports.DayPickerProvider=ke,exports.Dropdown=Pe,exports.FocusContext=Mt,exports.FocusProvider=_t,exports.Footer=He,exports.Head=Ue,exports.HeadRow=Ke,exports.IconDropdown=Ce,exports.IconLeft=je,exports.IconRight=Fe,exports.NavigationContext=Le,exports.NavigationProvider=Ie,exports.RootProvider=Kt,exports.Row=qt,exports.SelectMultipleContext=Ze,exports.SelectMultipleProvider=Ge,exports.SelectMultipleProviderInternal=Je,exports.SelectRangeContext=$e,exports.SelectRangeProvider=et,exports.SelectRangeProviderInternal=tt,exports.SelectSingleContext=Nt,exports.SelectSingleProvider=Ct,exports.SelectSingleProviderInternal=Pt,exports.WeekNumber=It,exports.addToRange=Ve,exports.isDateAfterType=ht,exports.isDateBeforeType=bt,exports.isDateInterval=vt,exports.isDateRange=yt,exports.isDayOfWeekType=gt,exports.isDayPickerDefault=function(e){return void 0===e.mode||"default"===e.mode},exports.isDayPickerMultiple=he,exports.isDayPickerRange=be,exports.isDayPickerSingle=ge,exports.isMatch=wt,exports.useActiveModifiers=Et,exports.useDayPicker=Ee,exports.useDayRender=Wt,exports.useFocusContext=kt,exports.useInput=function(t){void 0===t&&(t={});var a=t.locale,n=void 0===a?F.default:a,r=t.required,o=t.format,l=void 0===o?"PP":o,u=t.defaultSelected,i=t.today,d=void 0===i?new Date:i,s=Me(t),f=s.fromDate,c=s.toDate,p=function(e){return ve.default(e,l,d,{locale:n})},m=e.useState(null!=u?u:d),v=m[0],y=m[1],h=e.useState(u),b=h[0],g=h[1],w=u?R.default(u,l,{locale:n}):"",x=e.useState(w),D=x[0],M=x[1],_=function(){g(u),y(null!=u?u:d),M(null!=w?w:"")},k={month:v,onDayClick:function(e,t){var a=t.selected;if(!r&&a)return g(void 0),void M("");g(e),M(e?R.default(e,l,{locale:n}):"")},onMonthChange:function(e){y(e)},selected:b,locale:n,fromDate:f,toDate:c,today:d},E={onBlur:function(e){Ut(p(e.target.value))||_()},onChange:function(e){M(e.target.value);var t=p(e.target.value),a=f&&ae.default(f,t)>0,n=c&&ae.default(t,c)>0;!Ut(t)||a||n?g(void 0):(g(t),y(t))},onFocus:function(e){if(e.target.value){var t=p(e.target.value);Ut(t)&&y(t)}else _()},value:D,placeholder:R.default(new Date,l,{locale:n})};return{dayPickerProps:k,inputProps:E,reset:_,setSelected:function(e){g(e),y(null!=e?e:d),M(e?R.default(e,l,{locale:n}):"")}}},exports.useNavigation=qe,exports.useSelectMultiple=Qe,exports.useSelectRange=at,exports.useSelectSingle=Ot})); | ||
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("date-fns/locale/en-US"),a=require("date-fns/format"),n=require("date-fns/endOfMonth"),r=require("date-fns/startOfDay"),o=require("date-fns/startOfMonth"),l=require("date-fns/isSameYear"),u=require("date-fns/setMonth"),i=require("date-fns/setYear"),d=require("date-fns/startOfYear"),s=require("date-fns/addMonths"),f=require("date-fns/isBefore"),c=require("date-fns/isSameMonth"),p=require("date-fns/differenceInCalendarMonths"),m=require("date-fns/addDays"),v=require("date-fns/startOfISOWeek"),y=require("date-fns/startOfWeek"),h=require("date-fns/getUnixTime"),b=require("date-fns/isSameDay"),g=require("date-fns"),w=require("date-fns/differenceInCalendarDays"),x=require("date-fns/subDays"),D=require("date-fns/isAfter"),M=require("date-fns/isDate"),_=require("date-fns/addWeeks"),k=require("date-fns/addYears"),E=require("date-fns/endOfISOWeek"),N=require("date-fns/endOfWeek"),C=require("date-fns/max"),P=require("date-fns/min"),S=require("date-fns/getWeeksInMonth"),O=require("date-fns/getISOWeek"),W=require("date-fns/getWeek"),L=require("date-fns/parse");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function q(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var B=I(e),j=q(e),F=I(t),R=I(a),T=I(n),A=I(r),Y=I(o),H=I(l),K=I(u),U=I(i),z=I(d),Z=I(s),G=I(f),J=I(c),Q=I(p),V=I(m),X=I(v),$=I(y),ee=I(h),te=I(b),ae=I(w),ne=I(x),re=I(D),oe=I(M),le=I(_),ue=I(k),ie=I(E),de=I(N),se=I(C),fe=I(P),ce=I(S),pe=I(O),me=I(W),ve=I(L),ye=function(){return ye=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ye.apply(this,arguments)};function he(e){return"multiple"===e.mode}function be(e){return"range"===e.mode}function ge(e){return"single"===e.mode}var we={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var xe=Object.freeze({__proto__:null,formatCaption:function(e,t){return R.default(e,"LLLL y",t)},formatDay:function(e,t){return R.default(e,"d",t)},formatMonthCaption:function(e,t){return R.default(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return R.default(e,"cccccc",t)},formatYearCaption:function(e,t){return R.default(e,"yyyy",t)}}),De=Object.freeze({__proto__:null,labelDay:function(e,t,a){return R.default(e,"do MMMM (EEEE)",a)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekday:function(e,t){return R.default(e,"cccc",t)},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelYearDropdown:function(){return"Year: "}});function Me(e){var t=e.fromYear,a=e.toYear,n=e.fromMonth,r=e.toMonth,o=e.fromDate,l=e.toDate;return n?o=Y.default(n):t&&(o=new Date(t,0,1)),r?l=T.default(r):a&&(l=new Date(a,11,31)),{fromDate:o?A.default(o):void 0,toDate:l?A.default(l):void 0}}var _e=e.createContext(void 0);function ke(e){var t,a,n,r,o,l=e.initialProps,u=(a=we,n=F.default,r=new Date,{captionLayout:"buttons",classNames:a,formatters:xe,labels:De,locale:n,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:r,mode:"default"}),i=Me(l),d=i.fromDate,s=i.toDate,f=null!==(t=l.captionLayout)&&void 0!==t?t:u.captionLayout;"buttons"===f||d&&s||(f="buttons"),(ge(l)||he(l)||be(l))&&(o=l.onSelect);var c=ye(ye(ye({},u),l),{captionLayout:f,classNames:ye(ye({},u.classNames),l.classNames),components:ye({},l.components),formatters:ye(ye({},u.formatters),l.formatters),fromDate:d,labels:ye(ye({},u.labels),l.labels),mode:l.mode||u.mode,modifiers:ye(ye({},u.modifiers),l.modifiers),modifiersClassNames:ye(ye({},u.modifiersClassNames),l.modifiersClassNames),onSelect:o,styles:ye(ye({},u.styles),l.styles),toDate:s});return B.default.createElement(_e.Provider,{value:c},e.children)}function Ee(){var t=e.useContext(_e);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function Ne(e){var t=Ee(),a=t.locale,n=t.classNames,r=t.styles,o=t.formatters.formatCaption;return B.default.createElement("h2",{className:n.caption_label,style:r.caption_label,"aria-live":"polite","aria-atomic":"true",id:e.id},o(e.displayMonth,{locale:a}))}function Ce(e){return B.default.createElement("svg",ye({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e),B.default.createElement("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"}))}function Pe(e){var t,a,n=e.onChange,r=e.value,o=e.children,l=e.caption,u=e.className,i=e.style,d=Ee(),s=null!==(a=null===(t=d.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==a?a:Ce;return B.default.createElement("div",{className:u,style:i},B.default.createElement("span",{className:d.classNames.vhidden},e["aria-label"]),B.default.createElement("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:r,onChange:n},o),B.default.createElement("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true"},l,B.default.createElement(s,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})))}function Se(e){var t,a=Ee(),n=a.fromDate,r=a.toDate,o=a.styles,l=a.locale,u=a.formatters.formatMonthCaption,i=a.classNames,d=a.components,s=a.labels.labelMonthDropdown;if(!n)return B.default.createElement(B.default.Fragment,null);if(!r)return B.default.createElement(B.default.Fragment,null);var f=[];if(H.default(n,r))for(var c=Y.default(n),p=n.getMonth();p<=r.getMonth();p++)f.push(K.default(c,p));else for(c=Y.default(new Date),p=0;p<=11;p++)f.push(K.default(c,p));var m=null!==(t=null==d?void 0:d.Dropdown)&&void 0!==t?t:Pe;return B.default.createElement(m,{name:"months","aria-label":s(),className:i.dropdown_month,style:o.dropdown_month,onChange:function(t){var a=Number(t.target.value),n=K.default(Y.default(e.displayMonth),a);e.onChange(n)},value:e.displayMonth.getMonth(),caption:u(e.displayMonth,{locale:l})},f.map((function(e){return B.default.createElement("option",{key:e.getMonth(),value:e.getMonth()},u(e,{locale:l}))})))}function Oe(e){var t,a=e.displayMonth,n=Ee(),r=n.fromDate,o=n.toDate,l=n.locale,u=n.styles,i=n.classNames,d=n.components,s=n.formatters.formatYearCaption,f=n.labels.labelYearDropdown,c=[];if(!r)return B.default.createElement(B.default.Fragment,null);if(!o)return B.default.createElement(B.default.Fragment,null);for(var p=r.getFullYear(),m=o.getFullYear(),v=p;v<=m;v++)c.push(U.default(z.default(new Date),v));var y=null!==(t=null==d?void 0:d.Dropdown)&&void 0!==t?t:Pe;return B.default.createElement(y,{name:"years","aria-label":f(),className:i.dropdown_year,style:u.dropdown_year,onChange:function(t){var n=U.default(Y.default(a),Number(t.target.value));e.onChange(n)},value:a.getFullYear(),caption:s(a,{locale:l})},c.map((function(e){return B.default.createElement("option",{key:e.getFullYear(),value:e.getFullYear()},s(e,{locale:l}))})))}function We(){var t=Ee(),a=function(e){var t=e.month,a=e.defaultMonth,n=e.today,r=t||a||n||new Date,o=e.toDate,l=e.fromDate,u=e.numberOfMonths,i=void 0===u?1:u;if(o&&Q.default(o,r)<0){var d=-1*(i-1);r=Z.default(o,d)}return l&&Q.default(r,l)<0&&(r=l),Y.default(r)}(t),n=function(t,a){var n=e.useState(t),r=n[0];return[void 0===a?r:a,n[1]]}(a,t.month),r=n[0],o=n[1];return[r,function(e){var a;if(!t.disableNavigation){var n=Y.default(e);o(n),null===(a=t.onMonthChange)||void 0===a||a.call(t,n)}}]}var Le=e.createContext(void 0);function Ie(e){var t=Ee(),a=We(),n=a[0],r=a[1],o=function(e,t){for(var a=t.reverseMonths,n=t.numberOfMonths,r=Y.default(e),o=Y.default(Z.default(r,n)),l=Q.default(o,r),u=[],i=0;i<l;i++){var d=Z.default(r,i);u.push(d)}return a&&(u=u.reverse()),u}(n,t),l=function(e,t){if(!t.disableNavigation){var a=t.toDate,n=t.pagedNavigation,r=t.numberOfMonths,o=void 0===r?1:r,l=n?o:1,u=Y.default(e);if(!a)return Z.default(u,l);if(!(Q.default(a,e)<o))return Z.default(u,l)}}(n,t),u=function(e,t){if(!t.disableNavigation){var a=t.fromDate,n=t.pagedNavigation,r=t.numberOfMonths,o=n?void 0===r?1:r:1,l=Y.default(e);if(!a)return Z.default(l,-o);if(!(Q.default(l,a)<=0))return Z.default(l,-o)}}(n,t),i=function(e){return o.some((function(t){return J.default(e,t)}))},d={currentMonth:n,displayMonths:o,goToMonth:r,goToDate:function(e,a){i(e)||(a&&G.default(e,a)?r(Z.default(e,1+-1*t.numberOfMonths)):r(e))},previousMonth:u,nextMonth:l,isDateDisplayed:i};return B.default.createElement(Le.Provider,{value:d},e.children)}function qe(){var t=e.useContext(Le);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function Be(e){var t,a=Ee(),n=a.classNames,r=a.styles,o=a.components,l=qe().goToMonth,u=function(e){l(e)},i=null!==(t=null==o?void 0:o.CaptionLabel)&&void 0!==t?t:Ne,d=B.default.createElement(i,{id:e.id,displayMonth:e.displayMonth});return B.default.createElement("div",{className:n.caption_dropdowns,style:r.caption_dropdowns},B.default.createElement("div",{className:n.vhidden},d),B.default.createElement(Se,{onChange:u,displayMonth:e.displayMonth}),B.default.createElement(Oe,{onChange:u,displayMonth:e.displayMonth}))}function je(e){return B.default.createElement("svg",ye({width:"16px",height:"16px",viewBox:"0 0 120 120"},e),B.default.createElement("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"}))}function Fe(e){return B.default.createElement("svg",ye({width:"16px",height:"16px",viewBox:"0 0 120 120"},e),B.default.createElement("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"}))}var Re=e.forwardRef((function(e,t){var a=Ee(),n=a.classNames,r=a.styles,o=[n.button_reset,n.button];e.className&&o.push(e.className);var l=o.join(" "),u=ye(ye({},r.button_reset),r.button);return e.style&&Object.assign(u,e.style),B.default.createElement("button",ye({},e,{ref:t,type:"button",className:l,style:u}))}));function Te(e){var t,a,n=Ee(),r=n.dir,o=n.locale,l=n.classNames,u=n.styles,i=n.labels,d=i.labelPrevious,s=i.labelNext,f=n.components;if(!e.nextMonth&&!e.previousMonth)return B.default.createElement(B.default.Fragment,null);var c=d(e.previousMonth,{locale:o}),p=[l.nav_button,l.nav_button_previous].join(" "),m=s(e.nextMonth,{locale:o}),v=[l.nav_button,l.nav_button_next].join(" "),y=null!==(t=null==f?void 0:f.IconRight)&&void 0!==t?t:Fe,h=null!==(a=null==f?void 0:f.IconLeft)&&void 0!==a?a:je;return B.default.createElement("div",{className:l.nav,style:u.nav},!e.hidePrevious&&B.default.createElement(Re,{name:"previous-month","aria-label":c,className:p,style:u.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick},"rtl"===r?B.default.createElement(y,{className:l.nav_icon,style:u.nav_icon}):B.default.createElement(h,{className:l.nav_icon,style:u.nav_icon})),!e.hideNext&&B.default.createElement(Re,{name:"next-month","aria-label":m,className:v,style:u.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick},"rtl"===r?B.default.createElement(h,{className:l.nav_icon,style:u.nav_icon}):B.default.createElement(y,{className:l.nav_icon,style:u.nav_icon})))}function Ae(e){var t,a,n=Ee(),r=n.numberOfMonths,o=n.dir,l=n.components,u=qe(),i=u.previousMonth,d=u.nextMonth,s=u.goToMonth,f=u.displayMonths,c=f.findIndex((function(t){return J.default(e.displayMonth,t)})),p=0===c,m=c===f.length-1;"rtl"===o&&(m=(t=[p,m])[0],p=t[1]);var v=r>1&&(p||!m),y=r>1&&(m||!p),h=null!==(a=null==l?void 0:l.CaptionLabel)&&void 0!==a?a:Ne,b=B.default.createElement(h,{id:e.id,displayMonth:e.displayMonth});return B.default.createElement(B.default.Fragment,null,b,B.default.createElement(Te,{displayMonth:e.displayMonth,hideNext:v,hidePrevious:y,nextMonth:d,previousMonth:i,onPreviousClick:function(){i&&s(i)},onNextClick:function(){d&&s(d)}}))}function Ye(e){var t,a,n=Ee(),r=n.classNames,o=n.disableNavigation,l=n.styles,u=n.captionLayout,i=n.components,d=null!==(t=null==i?void 0:i.CaptionLabel)&&void 0!==t?t:Ne;return a=o?B.default.createElement(d,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===u?B.default.createElement(Be,{displayMonth:e.displayMonth,id:e.id}):B.default.createElement(Ae,{displayMonth:e.displayMonth,id:e.id}),B.default.createElement("div",{className:r.caption,style:l.caption},a)}function He(){var e=Ee(),t=e.footer,a=e.styles,n=e.classNames.tfoot;return t?B.default.createElement("tfoot",{className:n,style:a.tfoot},B.default.createElement("tr",null,B.default.createElement("td",{colSpan:8},t))):B.default.createElement(B.default.Fragment,null)}function Ke(){var e=Ee(),t=e.classNames,a=e.styles,n=e.showWeekNumber,r=e.locale,o=e.weekStartsOn,l=e.ISOWeek,u=e.formatters.formatWeekdayName,i=e.labels.labelWeekday,d=function(e,t,a){for(var n=a?X.default(new Date):$.default(new Date,{locale:e,weekStartsOn:t}),r=[],o=0;o<7;o++){var l=V.default(n,o);r.push(l)}return r}(r,o,l);return B.default.createElement("tr",{style:a.head_row,className:t.head_row},n&&B.default.createElement("th",{scope:"col",style:a.head_cell,className:t.head_cell}),d.map((function(e,n){return B.default.createElement("th",{key:n,scope:"col",className:t.head_cell,style:a.head_cell},B.default.createElement("span",{"aria-hidden":!0},u(e,{locale:r})),B.default.createElement("span",{className:t.vhidden},i(e,{locale:r})))})))}function Ue(){var e,t=Ee(),a=t.classNames,n=t.styles,r=t.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:Ke;return B.default.createElement("thead",{style:n.head,className:a.head},B.default.createElement(o,null))}function ze(e){var t=Ee(),a=t.locale,n=t.formatters.formatDay;return B.default.createElement(B.default.Fragment,null,n(e.date,{locale:a}))}var Ze=e.createContext(void 0);function Ge(e){if(!he(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return B.default.createElement(Ze.Provider,{value:t},e.children)}return B.default.createElement(Je,{initialProps:e.initialProps,children:e.children})}function Je(e){var t=e.initialProps,a=e.children,n=t.selected,r=t.min,o=t.max,l={disabled:[]};n&&l.disabled.push((function(e){var t=o&&n.length>o-1,a=n.some((function(t){return te.default(t,e)}));return Boolean(t&&!a)}));var u={selected:n,onDayClick:function(e,a,l){var u,i;if((null===(u=t.onDayClick)||void 0===u||u.call(t,e,a,l),!Boolean(a.selected&&r&&(null==n?void 0:n.length)===r))&&!Boolean(!a.selected&&o&&(null==n?void 0:n.length)===o)){var d=n?function(e,t,a){if(a||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([],n,!0):[];if(a.selected){var s=d.findIndex((function(t){return te.default(e,t)}));d.splice(s,1)}else d.push(e);null===(i=t.onSelect)||void 0===i||i.call(t,d,e,a,l)}},modifiers:l};return B.default.createElement(Ze.Provider,{value:u},a)}function Qe(){var t=e.useContext(Ze);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Ve(e,t){var a=t||{},n=a.from,r=a.to;if(!n)return{from:e,to:void 0};if(!r&&te.default(n,e))return{from:n,to:e};if(!r&&G.default(e,n))return{from:e,to:n};if(!r)return{from:n,to:e};if(!te.default(r,e)||!te.default(n,e)){if(te.default(r,e))return{from:r,to:void 0};if(!te.default(n,e))return re.default(n,e)?{from:e,to:r}:{from:n,to:e}}}var Xe,$e=e.createContext(void 0);function et(e){if(!be(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return B.default.createElement($e.Provider,{value:t},e.children)}return B.default.createElement(tt,{initialProps:e.initialProps,children:e.children})}function tt(e){var t=e.initialProps,a=e.children,n=t.selected,r=n||{},o=r.from,l=r.to,u=t.min,i=t.max,d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o&&(d.range_start=[o],l?(d.range_end=[l],g.isSameDay(o,l)||(d.range_middle=[{after:o,before:l}])):d.range_end=[o]),u&&(o&&!l&&d.disabled.push({after:ne.default(o,u-1),before:V.default(o,u-1)}),o&&l&&d.disabled.push({after:o,before:V.default(o,u-1)})),i&&(o&&!l&&(d.disabled.push({before:V.default(o,1-i)}),d.disabled.push({after:V.default(o,i-1)})),o&&l)){var s=i-(ae.default(l,o)+1);d.disabled.push({before:ne.default(o,s)}),d.disabled.push({after:V.default(l,s)})}return B.default.createElement($e.Provider,{value:{selected:n,onDayClick:function(e,a,r){var o,l;null===(o=t.onDayClick)||void 0===o||o.call(t,e,a,r);var u=Ve(e,n);null===(l=t.onSelect)||void 0===l||l.call(t,u,e,a,r)},modifiers:d}},a)}function at(){var t=e.useContext($e);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function nt(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}exports.InternalModifier=void 0,(Xe=exports.InternalModifier||(exports.InternalModifier={})).Outside="outside",Xe.Disabled="disabled",Xe.Selected="selected",Xe.Hidden="hidden",Xe.Today="today",Xe.RangeStart="range_start",Xe.RangeEnd="range_end",Xe.RangeMiddle="range_middle";var rt=exports.InternalModifier.Selected,ot=exports.InternalModifier.Disabled,lt=exports.InternalModifier.Hidden,ut=exports.InternalModifier.Today,it=exports.InternalModifier.RangeEnd,dt=exports.InternalModifier.RangeMiddle,st=exports.InternalModifier.RangeStart,ft=exports.InternalModifier.Outside;var ct=e.createContext(void 0);function pt(e){var t=Ee(),a=function(e,t,a){var n,r=((n={})[rt]=nt(e.selected),n[ot]=nt(e.disabled),n[lt]=nt(e.hidden),n[ut]=[e.today],n[it]=[],n[dt]=[],n[st]=[],n[ft]=[],n);return e.fromDate&&r[ot].push({before:e.fromDate}),e.toDate&&r[ot].push({after:e.toDate}),he(e)?r[ot]=r[ot].concat(t.modifiers[ot]):be(e)&&(r[ot]=r[ot].concat(a.modifiers[ot]),r[st]=a.modifiers[st],r[dt]=a.modifiers[dt],r[it]=a.modifiers[it]),r}(t,Qe(),at()),n=function(e){var t={};return Object.entries(e).forEach((function(e){var a=e[0],n=e[1];t[a]=nt(n)})),t}(t.modifiers),r=ye(ye({},a),n);return B.default.createElement(ct.Provider,{value:r},e.children)}function mt(){var t=e.useContext(ct);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function vt(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function yt(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function ht(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function bt(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function gt(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function wt(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(a=t,oe.default(a))return te.default(e,t);var a,n,r,o,l,u;if(function(e){return Array.isArray(e)&&e.every(oe.default)}(t))return t.includes(e);if(yt(t))return n=e,l=(r=t).from,u=r.to,!!l&&(!(u||!te.default(l,n))||!!u&&(ae.default(u,l)<0&&(l=(o=[u,l])[0],u=o[1]),ae.default(n,l)>=0&&ae.default(u,n)>=0));if(gt(t))return t.dayOfWeek.includes(e.getDay());if(vt(t)){var i=ae.default(t.before,e)>0,d=ae.default(t.after,e)<0;return g.isAfter(t.before,t.after)?d&&i:i||d}return ht(t)?ae.default(e,t.after)>0:bt(t)?ae.default(t.before,e)>0:"function"==typeof t&&t(e)}))}function xt(e,t,a){var n=Object.keys(t).reduce((function(a,n){var r=t[n];return wt(e,r)&&a.push(n),a}),[]),r={};return n.forEach((function(e){return r[e]=!0})),a&&!J.default(e,a)&&(r.outside=!0),r}function Dt(e,t){var a=t.moveBy,n=t.direction,r=t.context,o=t.modifiers,l=t.retry,u=void 0===l?{count:0,lastFocused:e}:l,i=r.weekStartsOn,d=r.fromDate,s=r.toDate,f=r.locale,c={day:V.default,week:le.default,month:Z.default,year:ue.default,startOfWeek:function(e){return r.ISOWeek?X.default(e):$.default(e,{locale:f,weekStartsOn:i})},endOfWeek:function(e){return r.ISOWeek?ie.default(e):de.default(e,{locale:f,weekStartsOn:i})}}[a](e,"after"===n?1:-1);"before"===n&&d?c=se.default([d,c]):"after"===n&&s&&(c=fe.default([s,c]));var p=!0;if(o){var m=xt(c,o);p=!m.disabled&&!m.hidden}return p?c:u.count>365?u.lastFocused:Dt(c,{moveBy:a,direction:n,context:r,modifiers:o,retry:ye(ye({},u),{count:u.count+1})})}var Mt=e.createContext(void 0);function _t(t){var a=qe(),n=mt(),r=e.useState(),o=r[0],l=r[1],u=e.useState(),i=u[0],d=u[1],s=function(e,t){for(var a,n,r=Y.default(e[0]),o=T.default(e[e.length-1]),l=r;l<=o;){var u=xt(l,t);if(u.disabled||u.hidden)l=V.default(l,1);else{if(u.selected)return l;u.today&&!n&&(n=l),a||(a=l),l=V.default(l,1)}}return n||a}(a.displayMonths,n),f=(null!=o?o:i&&a.isDateDisplayed(i))?i:s,c=function(e){l(e)},p=Ee(),m=function(e,t){if(o){var r=Dt(o,{moveBy:e,direction:t,context:p,modifiers:n});te.default(o,r)||(a.goToDate(r,o),c(r))}},v={focusedDay:o,focusTarget:f,blur:function(){d(o),l(void 0)},focus:c,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return B.default.createElement(Mt.Provider,{value:v},t.children)}function kt(){var t=e.useContext(Mt);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function Et(e,t){return xt(e,mt(),t)}var Nt=e.createContext(void 0);function Ct(e){if(!ge(e.initialProps)){var t={selected:void 0};return B.default.createElement(Nt.Provider,{value:t},e.children)}return B.default.createElement(Pt,{initialProps:e.initialProps,children:e.children})}function Pt(e){var t=e.initialProps,a=e.children,n={selected:t.selected,onDayClick:function(e,a,n){var r,o,l;null===(r=t.onDayClick)||void 0===r||r.call(t,e,a,n),!a.selected||t.required?null===(l=t.onSelect)||void 0===l||l.call(t,e,e,a,n):null===(o=t.onSelect)||void 0===o||o.call(t,void 0,e,a,n)}};return B.default.createElement(Nt.Provider,{value:n},a)}function St(){var t=e.useContext(Nt);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Ot(e,t){var a=[e.classNames.day];return Object.keys(t).forEach((function(t){var n=e.modifiersClassNames[t];if(n)a.push(n);else if(function(e){return Object.values(exports.InternalModifier).includes(e)}(t)){var r=e.classNames["day_".concat(t)];r&&a.push(r)}})),a}function Wt(t,a,n){var r,o,l,u=Ee(),i=kt(),d=Et(t,a),s=function(e,t){var a=Ee(),n=St(),r=Qe(),o=at(),l=kt(),u=l.focusDayAfter,i=l.focusDayBefore,d=l.focusWeekAfter,s=l.focusWeekBefore,f=l.blur,c=l.focus,p=l.focusMonthBefore,m=l.focusMonthAfter,v=l.focusYearBefore,y=l.focusYearAfter,h=l.focusStartOfWeek,b=l.focusEndOfWeek,g={onClick:function(l){var u,i,d,s;ge(a)?null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,l):he(a)?null===(i=r.onDayClick)||void 0===i||i.call(r,e,t,l):be(a)?null===(d=o.onDayClick)||void 0===d||d.call(o,e,t,l):null===(s=a.onDayClick)||void 0===s||s.call(a,e,t,l)},onFocus:function(n){var r;c(e),null===(r=a.onDayFocus)||void 0===r||r.call(a,e,t,n)},onBlur:function(n){var r;f(),null===(r=a.onDayBlur)||void 0===r||r.call(a,e,t,n)},onKeyDown:function(n){var r;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===a.dir?u():i();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===a.dir?i():u();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),d();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),s();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():p();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?y():m();break;case"Home":n.preventDefault(),n.stopPropagation(),h();break;case"End":n.preventDefault(),n.stopPropagation(),b()}null===(r=a.onDayKeyDown)||void 0===r||r.call(a,e,t,n)},onKeyUp:function(n){var r;null===(r=a.onDayKeyUp)||void 0===r||r.call(a,e,t,n)},onMouseEnter:function(n){var r;null===(r=a.onDayMouseEnter)||void 0===r||r.call(a,e,t,n)},onMouseLeave:function(n){var r;null===(r=a.onDayMouseLeave)||void 0===r||r.call(a,e,t,n)},onTouchCancel:function(n){var r;null===(r=a.onDayTouchCancel)||void 0===r||r.call(a,e,t,n)},onTouchEnd:function(n){var r;null===(r=a.onDayTouchEnd)||void 0===r||r.call(a,e,t,n)},onTouchMove:function(n){var r;null===(r=a.onDayTouchMove)||void 0===r||r.call(a,e,t,n)},onTouchStart:function(n){var r;null===(r=a.onDayTouchStart)||void 0===r||r.call(a,e,t,n)}};return g}(t,d),f=function(){var e=Ee(),t=St(),a=Qe(),n=at();return ge(e)?t.selected:he(e)?a.selected:be(e)?n.selected:void 0}(),c=Boolean(u.onDayClick||"default"!==u.mode);e.useEffect((function(){var e;d.outside||i.focusedDay&&c&&te.default(i.focusedDay,t)&&(null===(e=n.current)||void 0===e||e.focus())}),[i.focusedDay,t,n,c,d.outside]);var p=Ot(u,d).join(" "),m=function(e,t){var a=ye({},e.styles.day);return Object.keys(t).forEach((function(t){var n;a=ye(ye({},a),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])})),a}(u,d),v=u.labels.labelDay(t,d,{locale:u.locale}),y=Boolean(d.outside&&!u.showOutsideDays||d.hidden),h=null!==(l=null===(o=u.components)||void 0===o?void 0:o.DayContent)&&void 0!==l?l:ze,b={style:m,className:p,children:B.default.createElement(h,{date:t,displayMonth:a,activeModifiers:d}),"aria-label":v},g=i.focusTarget&&te.default(i.focusTarget,t)&&!d.outside,w=ye(ye(ye({},b),((r={disabled:d.disabled})["aria-pressed"]=d.selected,r["aria-label"]=v,r.tabIndex=g?0:-1,r)),s);return{isButton:c,isHidden:y,activeModifiers:d,selectedDays:f,buttonProps:w,divProps:b}}function Lt(t){var a=e.useRef(null),n=Wt(t.date,t.displayMonth,a);return n.isHidden?B.default.createElement(B.default.Fragment,null):n.isButton?B.default.createElement(Re,ye({name:"day",ref:a},n.buttonProps)):B.default.createElement("div",ye({},n.divProps))}function It(e){var t=e.number,a=e.dates,n=Ee(),r=n.onWeekNumberClick,o=n.styles,l=n.classNames,u=n.locale,i=n.labels.labelWeekNumber,d=(0,n.formatters.formatWeekNumber)(Number(t),{locale:u});if(!r)return B.default.createElement("span",{className:l.weeknumber,style:o.weeknumber},d);var s=i(Number(t),{locale:u});return B.default.createElement(Re,{name:"week-number","aria-label":s,className:l.weeknumber,style:o.weeknumber,onClick:function(e){r(t,a,e)}},d)}function qt(e){var t,a,n,r=Ee(),o=r.styles,l=r.classNames,u=r.showWeekNumber,i=r.components,d=null!==(t=null==i?void 0:i.Day)&&void 0!==t?t:Lt,s=null!==(a=null==i?void 0:i.WeekNumber)&&void 0!==a?a:It;return u&&(n=B.default.createElement("td",{className:l.cell,style:o.cell},B.default.createElement(s,{number:e.weekNumber,dates:e.dates}))),B.default.createElement("tr",{className:l.row,style:o.row},n,e.dates.map((function(t){return B.default.createElement("td",{className:l.cell,style:o.cell,key:ee.default(t)},B.default.createElement(d,{displayMonth:e.displayMonth,date:t}))})))}function Bt(e,t,a){for(var n=(null==a?void 0:a.ISOWeek)?ie.default(t):de.default(t,a),r=(null==a?void 0:a.ISOWeek)?X.default(e):$.default(e,a),o=ae.default(n,r),l=[],u=0;u<=o;u++)l.push(V.default(r,u));return l.reduce((function(e,t){var n=(null==a?void 0:a.ISOWeek)?pe.default(t):me.default(t,a),r=e.find((function(e){return e.weekNumber===n}));return r?(r.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)}),[])}function jt(e){var t,a,n,r=Ee(),o=r.locale,l=r.classNames,u=r.styles,i=r.hideHead,d=r.fixedWeeks,s=r.components,f=r.weekStartsOn,c=r.firstWeekContainsDate,p=r.ISOWeek,m=function(e,t){var a=Bt(Y.default(e),T.default(e),t);if(null==t?void 0:t.useFixedWeeks){var n=ce.default(e,t);if(n<6){var r=a[a.length-1],o=r.dates[r.dates.length-1],l=le.default(o,6-n),u=Bt(le.default(o,1),l,t);a.push.apply(a,u)}}return a}(e.displayMonth,{useFixedWeeks:Boolean(d),ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:c}),v=null!==(t=null==s?void 0:s.Head)&&void 0!==t?t:Ue,y=null!==(a=null==s?void 0:s.Row)&&void 0!==a?a:qt,h=null!==(n=null==s?void 0:s.Footer)&&void 0!==n?n:He;return B.default.createElement("table",{className:l.table,style:u.table,role:"grid","aria-labelledby":e["aria-labelledby"]},!i&&B.default.createElement(v,null),B.default.createElement("tbody",{className:l.tbody,style:u.tbody},m.map((function(t){return B.default.createElement(y,{displayMonth:e.displayMonth,key:t.weekNumber,dates:t.dates,weekNumber:t.weekNumber})}))),B.default.createElement(h,null))}var Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect,Rt=!1,Tt=0;function At(){return"react-day-picker-".concat(++Tt)}function Yt(e){var t,a,n=Ee(),r=n.dir,o=n.classNames,l=n.styles,u=n.components,i=qe().displayMonths,d=function(e){var t,a=null!=e?e:Rt?At():null,n=j.useState(a),r=n[0],o=n[1];return Ft((function(){null===r&&o(At())}),[]),j.useEffect((function(){!1===Rt&&(Rt=!0)}),[]),null!==(t=null!=e?e:r)&&void 0!==t?t:void 0}(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),s=[o.month],f=l.month,c=0===e.displayIndex,p=e.displayIndex===i.length-1,m=!c&&!p;"rtl"===r&&(p=(t=[c,p])[0],c=t[1]),c&&(s.push(o.caption_start),f=ye(ye({},f),l.caption_start)),p&&(s.push(o.caption_end),f=ye(ye({},f),l.caption_end)),m&&(s.push(o.caption_between),f=ye(ye({},f),l.caption_between));var v=null!==(a=null==u?void 0:u.Caption)&&void 0!==a?a:Ye;return B.default.createElement("div",{key:e.displayIndex,className:s.join(" "),style:f},B.default.createElement(v,{id:d,displayMonth:e.displayMonth}),B.default.createElement(jt,{"aria-labelledby":d,displayMonth:e.displayMonth}))}function Ht(){var t=Ee(),a=kt(),n=qe(),r=e.useState(!1),o=r[0],l=r[1];e.useEffect((function(){t.initialFocus&&a.focusTarget&&(o||(a.focus(a.focusTarget),l(!0)))}),[t.initialFocus,o,a.focus,a.focusTarget,a]);var u=[t.classNames.root,t.className];t.numberOfMonths>1&&u.push(t.classNames.multiple_months),t.showWeekNumber&&u.push(t.classNames.with_weeknumber);var i=ye(ye({},t.styles.root),t.style);return B.default.createElement("div",{className:u.join(" "),style:i,dir:t.dir},B.default.createElement("div",{className:t.classNames.months,style:t.styles.months},n.displayMonths.map((function(e,t){return B.default.createElement(Yt,{key:t,displayIndex:t,displayMonth:e})}))))}function Kt(e){var t=e.children,a=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]])}return a}(e,["children"]);return B.default.createElement(ke,{initialProps:a},B.default.createElement(Ie,null,B.default.createElement(Ct,{initialProps:a},B.default.createElement(Ge,{initialProps:a},B.default.createElement(et,{initialProps:a},B.default.createElement(pt,null,B.default.createElement(_t,null,t)))))))}function Ut(e){return!isNaN(e.getTime())}exports.Button=Re,exports.Caption=Ye,exports.CaptionDropdowns=Be,exports.CaptionLabel=Ne,exports.CaptionNavigation=Ae,exports.Day=Lt,exports.DayContent=ze,exports.DayPicker=function(e){return B.default.createElement(Kt,ye({},e),B.default.createElement(Ht,null))},exports.DayPickerContext=_e,exports.DayPickerProvider=ke,exports.Dropdown=Pe,exports.FocusContext=Mt,exports.FocusProvider=_t,exports.Footer=He,exports.Head=Ue,exports.HeadRow=Ke,exports.IconDropdown=Ce,exports.IconLeft=je,exports.IconRight=Fe,exports.NavigationContext=Le,exports.NavigationProvider=Ie,exports.RootProvider=Kt,exports.Row=qt,exports.SelectMultipleContext=Ze,exports.SelectMultipleProvider=Ge,exports.SelectMultipleProviderInternal=Je,exports.SelectRangeContext=$e,exports.SelectRangeProvider=et,exports.SelectRangeProviderInternal=tt,exports.SelectSingleContext=Nt,exports.SelectSingleProvider=Ct,exports.SelectSingleProviderInternal=Pt,exports.WeekNumber=It,exports.addToRange=Ve,exports.isDateAfterType=ht,exports.isDateBeforeType=bt,exports.isDateInterval=vt,exports.isDateRange=yt,exports.isDayOfWeekType=gt,exports.isDayPickerDefault=function(e){return void 0===e.mode||"default"===e.mode},exports.isDayPickerMultiple=he,exports.isDayPickerRange=be,exports.isDayPickerSingle=ge,exports.isMatch=wt,exports.useActiveModifiers=Et,exports.useDayPicker=Ee,exports.useDayRender=Wt,exports.useFocusContext=kt,exports.useInput=function(t){void 0===t&&(t={});var a=t.locale,n=void 0===a?F.default:a,r=t.required,o=t.format,l=void 0===o?"PP":o,u=t.defaultSelected,i=t.today,d=void 0===i?new Date:i,s=Me(t),f=s.fromDate,c=s.toDate,p=function(e){return ve.default(e,l,d,{locale:n})},m=e.useState(null!=u?u:d),v=m[0],y=m[1],h=e.useState(u),b=h[0],g=h[1],w=u?R.default(u,l,{locale:n}):"",x=e.useState(w),D=x[0],M=x[1],_=function(){g(u),y(null!=u?u:d),M(null!=w?w:"")},k={month:v,onDayClick:function(e,t){var a=t.selected;if(!r&&a)return g(void 0),void M("");g(e),M(e?R.default(e,l,{locale:n}):"")},onMonthChange:function(e){y(e)},selected:b,locale:n,fromDate:f,toDate:c,today:d},E={onBlur:function(e){Ut(p(e.target.value))||_()},onChange:function(e){M(e.target.value);var t=p(e.target.value),a=f&&ae.default(f,t)>0,n=c&&ae.default(t,c)>0;!Ut(t)||a||n?g(void 0):(g(t),y(t))},onFocus:function(e){if(e.target.value){var t=p(e.target.value);Ut(t)&&y(t)}else _()},value:D,placeholder:R.default(new Date,l,{locale:n})};return{dayPickerProps:k,inputProps:E,reset:_,setSelected:function(e){g(e),y(null!=e?e:d),M(e?R.default(e,l,{locale:n}):"")}}},exports.useNavigation=qe,exports.useSelectMultiple=Qe,exports.useSelectRange=at,exports.useSelectSingle=St})); |
{ | ||
"name": "react-day-picker", | ||
"version": "8.3.4", | ||
"version": "8.3.5", | ||
"description": "Customizable Date Picker for React", | ||
@@ -5,0 +5,0 @@ "author": "Giampaolo Bellavite <io@gpbl.dev>", |
@@ -0,1 +1,2 @@ | ||
import { addDays } from 'date-fns'; | ||
import { DateRange } from 'index'; | ||
@@ -16,11 +17,19 @@ | ||
describe('when range is missing the "to" date', () => { | ||
const to = undefined; | ||
describe('when the from date is the same as date', () => { | ||
const range: DateRange = { from: date, to }; | ||
const result = isDateInRange(date, range); | ||
test('should return true', () => { | ||
expect(result).toBe(true); | ||
}); | ||
const result = isDateInRange(date, { from: date, to: undefined }); | ||
test('should return true', () => { | ||
expect(result).toBe(true); | ||
}); | ||
const result = isDateInRange(date, { from: undefined }); | ||
}); | ||
describe('when the range dates are the same as date', () => { | ||
const range: DateRange = { from: date, to: date }; | ||
const result = isDateInRange(date, range); | ||
test('should return true', () => { | ||
expect(result).toBe(true); | ||
}); | ||
}); | ||
describe('when the range dates are the same but not as date', () => { | ||
const range: DateRange = { from: date, to: date }; | ||
const result = isDateInRange(addDays(date, 1), range); | ||
test('should return false', () => { | ||
@@ -30,1 +39,9 @@ expect(result).toBe(false); | ||
}); | ||
describe('when the range is inverted', () => { | ||
const range: DateRange = { from: addDays(date, 1), to: date }; | ||
const result = isDateInRange(date, range); | ||
test('should return true', () => { | ||
expect(result).toBe(true); | ||
}); | ||
}); |
@@ -18,11 +18,10 @@ import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; | ||
} | ||
const isToBeforeFrom = differenceInCalendarDays(to, from) < 0; | ||
if (to && isToBeforeFrom) { | ||
const isRangeInverted = differenceInCalendarDays(to, from) < 0; | ||
if (isRangeInverted) { | ||
[from, to] = [to, from]; | ||
} | ||
return ( | ||
const isInRange = | ||
differenceInCalendarDays(date, from) >= 0 && | ||
differenceInCalendarDays(to, date) >= 0 | ||
); | ||
differenceInCalendarDays(to, date) >= 0; | ||
return isInRange; | ||
} |
@@ -70,3 +70,3 @@ import { RenderResult } from '@testing-library/react-hooks'; | ||
}); | ||
test('should call "onSelect" with the clicked day as the "from" propx', () => { | ||
test('should call "onSelect" with the clicked day as the "from" prop', () => { | ||
expect(initialProps.onSelect).toHaveBeenCalledWith( | ||
@@ -150,2 +150,23 @@ { from: day, to: undefined }, | ||
describe('when "from" and "to" are the same', () => { | ||
const date = new Date(); | ||
const selected = { from: date, to: date }; | ||
const dayPickerProps: DayPickerRangeProps = { | ||
...initialProps, | ||
selected | ||
}; | ||
beforeAll(() => { | ||
setup(dayPickerProps); | ||
}); | ||
test('should return the "range_start" modifier with the date', () => { | ||
expect(result.current.modifiers.range_start).toEqual([date]); | ||
}); | ||
test('should return the "range_end" modifier with the date', () => { | ||
expect(result.current.modifiers.range_end).toEqual([date]); | ||
}); | ||
test('should return an empty "range_middle"', () => { | ||
expect(result.current.modifiers.range_middle).toEqual([]); | ||
}); | ||
}); | ||
describe('when the max number of the selected days is reached', () => { | ||
@@ -152,0 +173,0 @@ const from = today; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1104785
16824