react-multi-date-picker
Advanced tools
Comparing version 4.2.3 to 4.2.4
@@ -1,1 +0,1 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react"),require("react-element-popper"),require("react-date-object")):"function"==typeof define&&define.amd?define(["exports","react","react-element-popper","react-date-object"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ReactMultiDatePicker={},e.React,e.ElementPopper,e.DateObject)}(this,(function(e,r,t,n){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=a(r),d=a(t),i=a(n);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function c(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function f(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function p(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],d=!0,i=!1;try{for(t=t.call(e);!(d=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);d=!0);}catch(e){i=!0,a=e}finally{try{d||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,r)||h(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,r){if(e){if("string"==typeof e)return y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,r):void 0}}function y(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=h(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,d=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return d=e.done,e},e:function(e){i=!0,o=e},f:function(){try{d||null==t.return||t.return()}finally{if(i)throw o}}}}function b(e){return Array.isArray(e)}function v(e){var t=e.state.date,n=t.calendar,a=t.locale,d=e.customWeekDays,l=e.weekStartDayIndex,c=e.displayWeekNumbers,u=e.weekNumber,s=r.useMemo((function(){var e=d;return b(e)&&e.length>=7?(e.length=7,e=e.map((function(e){return b(e)&e.length>1?e=e[1]:b(e)&&(e=e[0]),e}))):e=new i.default({year:1,calendar:n,locale:a}).weekDays.map((function(e){return e.shortName})),e}),[n,a,d]);return s=m(s).slice(l).concat(m(s).splice(0,l)),o.default.createElement("div",{className:"rmdp-week"},c&&o.default.createElement("div",{className:"rmdp-week-day"},u),s.map((function(e,r){return o.default.createElement("div",{key:r,className:"rmdp-week-day"},e)})))}function x(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!r)return!1;if(e.year===r.year){if(n)return!0;if(e.monthIndex===r.monthIndex)return!!t||e.day===r.day}}function w(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY/MM/DD";return e.format(r)}function k(e,r,t){var n=t.multiple,a=t.range,o=t.selectedDate,d=t.onlyMonthPicker,l=t.onlyYearPicker,c=t.format,u=t.focused,s=t.weekPicker;e.setFormat(c);var f=new i.default(e);return[o=n&&a?function(){var e=!0;b(o)||(o=[[o]]);var r=o.find((function(e){return 1===e.length})),t=d?"YYYY/MM":"YYYY/MM/DD",n=o;if(r){var a=r[0];n=n.filter((function(e){if(1===e.length)return!0;var r=p(e,2),n=r[0],o=r[1],d=p([a,f].sort((function(e,r){return e-r})),2),i=p([n,o,d[0],d[1]].map((function(e){return w(e,t)})),4),l=i[0],c=i[1],u=i[2],s=i[3];return!(u<=l&&s>=c||u>=l&&s>=c&&u<=c||u<=l&&s<=c&&s>=l)}))}else n=n.filter((function(e){if(!b(e))return!0;if(0===e.length)return!1;var r=p(e,2),n=p([r[0],r[1],f].map((function(e){return w(e,t)})),3),a=n[0],o=n[1],d=n[2];return!(d>=a&&d<=o)}));n=n.map((function(r){var t;return b(r)?1===r.length?(e=!1,t=r.concat(f)):t=r:(e=!1,t=[r,f]),t.sort((function(e,r){return e-r}))})),e&&(n=[].concat(m(n),[[f]]));return n}():n?function(){var t=o.filter((function(r){return!x(e,r,d,l)}));t.length===o.length?t.push(f):f=t.find((function(e){return x(e,u)}));r&&t.sort((function(e,r){return e-r}));return t}():a?function(){if(s)return[new i.default(f).toFirstOfWeek(),new i.default(f).toLastOfWeek()];if(2===o.length||0===o.length)return[f];if(1===o.length)return[o[0],f].sort((function(e,r){return e-r}))}():f,f]}function D(e,r,t,n){var a=[],o=t?"YYYY/MM":"YYYY/MM/DD",d=w(e,o);function i(r){var n=r[0],i=r[1];if(1===r.length)x(e,n,t)&&a.push("rmdp-range");else if(2===r.length){var l=p([n,i].map((function(e){return w(e,o)})),2),c=l[0],u=l[1];d>=c&&d<=u&&a.push("rmdp-range"),d===c&&a.push("start"),d===u&&a.push("end")}}return n?(b(r)?r:[[r]]).forEach(i):i(r),a.join(" ")}function O(e,r,t,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"day",o=[];if(n&&1===(null==r?void 0:r.length)&&t){var d="day"===a?"YYYY/MM/DD":"YYYY/MM",i=t.format(d),l=r[0].format(d),c=e.format(d);(c>l&&c<=i||c<l&&c>=i)&&(o.push("rmdp-range-hover"),c===i&&o.push(i>l?"end":"start"))}return o}var E,Y="dddd MMMM DD of YYYY";function M(e){var t=e.state,n=e.setState,a=e.onChange,d=e.showOtherDays,l=void 0!==d&&d,f=e.mapDays,m=e.onlyShowInRangeDates,h=e.customWeekDays,y=e.sort,g=e.numberOfMonths,b=e.isRTL,w=e.weekStartDayIndex,M=e.handleFocusedDate,P=e.hideWeekDays,C=e.fullYear,N=p(e.monthAndYears,1)[0],S=e.displayWeekNumbers,I=e.weekNumber,j=void 0===I?"":I,R=e.rangeHover,T=e.highlightToday,A=r.useRef({}),L=r.useRef(),F=t.today,W=t.minDate,B=t.maxDate,_=t.range,V=t.multiple,z=t.date,H=t.selectedDate,q=t.onlyMonthPicker,J=t.onlyYearPicker,K=!q&&!J,U=p(r.useState(),2),$=U[0],G=U[1],Q=V||_?(null==H?void 0:H.length)>0:!!H;A.current.date=z;var X=r.useMemo((function(){return K?function(e,r,t,n){if(!e)return[];for(var a=[],o=0;o<t;o++){var d=(e=new i.default(e).toFirstOfMonth()).monthIndex,l=[];e.toFirstOfWeek().add(n,"day"),e.monthIndex===d&&e.day>1&&e.subtract(7,"days");for(var c=0;c<6;c++){for(var u=[],s=0;s<7;s++)u.push({date:new i.default(e),day:e.format("D"),current:e.monthIndex===d}),e.day+=1;if(l.push(u),c>2&&e.monthIndex!==d&&!r)break}a.push(l)}return a}(A.current.date,l,g,w):[]}),[z.monthIndex,z.year,z.calendar,z.locale,K,l,g,w]);return K&&o.default.createElement("div",{ref:L,className:"rmdp-day-picker ".concat(C?"rmdp-full-year":""),style:{display:C?"grid":"flex"},onMouseLeave:function(){return R&&G()}},X.map((function(e,r){return o.default.createElement("div",{key:r,style:u({},b?"marginLeft":"marginRight",r+(C?0:1)<g?"10px":"")},C&&o.default.createElement("div",{className:"rmdp-month-name"},N[r]),!P&&o.default.createElement(v,{state:t,customWeekDays:h,weekStartDayIndex:w,displayWeekNumbers:S,weekNumber:j}),e.map((function(e,d){return o.default.createElement("div",{key:d,className:"rmdp-week"},S&&o.default.createElement("div",{className:"rmdp-day rmdp-disabled"},o.default.createElement("span",null,e[0].date.format("WW"))),e.map((function(e,d){var u=function(e){if(!e.current&&!l)return{};var r={};return f.forEach((function(n){var a,o=n({date:e.date,today:F,currentMonth:t.date.month,selectedDate:t.selectedDate,isSameDate:x});(null===(a=o)||void 0===a?void 0:a.constructor)!==Object&&(o={}),(o.disabled||o.hidden)&&(e.disabled=!0),o.hidden&&(e.hidden=!0),r=c(c({},r),o)})),delete r.disabled,delete r.hidden,r}(e={date:e.date,day:e.day,current:e.current}),h=Z(e)&&!e.disabled,b="".concat(h?"sd":""),v=u.children;h&&(b="".concat(b," ").concat(u.className||"")),delete u.className,delete u.children;var w=function(e,r){var t=["rmdp-day"],n=e.date,a=e.hidden,o=e.current;if(!Z(e)||a)t.push("rmdp-day-hidden");else{(W&&n<W||B&&n>B||e.disabled)&&(t.push("rmdp-disabled"),e.disabled||(e.disabled=!0)),o||t.push("rmdp-deactive");var d=r>1&&o||1===r;e.disabled&&m||(x(n,F)&&T&&t.push("rmdp-today"),i=n,[].concat(H).some((function(e){return x(e,i)}))&&d&&!_&&t.push("rmdp-selected")),_&&!e.disabled&&d&&(t.push(D(n,H,void 0,V)),V||(t=t.concat(O(n,H,$,R))))}var i;return t.join(" ")}(e,g);(e.hidden||e.disabled)&&(b=b.replace("sd",""));var P=Q?w.includes("selected")||w.includes("range"):w.includes("today");return o.default.createElement("div",{key:d,tabIndex:P?0:-1,"aria-label":"Choose ".concat(e.date.format(Y)),className:w,onMouseEnter:function(){return R&&G(e.date)},onKeyDown:function(r){return function(e,r){var a=e.currentTarget,o=e.key,d=e.code,l={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};if("Space"===d||" "===o)e.preventDefault(),a.click();else if(Object.keys(l).includes(o)){var u=function(e){if(!e)return s();var r=e.getAttribute("class");r.includes("hidden")||r.includes("disabled")?s():e.focus()},s=function(){n(c(c({},t),{},{date:p})),clearTimeout(E),E=setTimeout((function(){return u(ee(p))}),100)};e.preventDefault();var f=l[o],p=new i.default(r.date).add(f,"day"),m=ee(p);u(m)}}(r,e)},onClick:function(){Z(e)&&!e.disabled&&function(e,r,n){var o,d,l,u=e.date,s=e.current,f=t.selectedDate,m=t.focused,h=t.date,g=h,b=g.hour,v=g.minute,x=g.second;u.set({hour:(null===(o=f)||void 0===o?void 0:o.hour)||b,minute:(null===(d=f)||void 0===d?void 0:d.minute)||v,second:(null===(l=f)||void 0===l?void 0:l.second)||x}),1!==n||s?n>1&&!s&&(0===r&&u<h&&(h=new i.default(h).toFirstOfMonth()),r>0&&u.monthIndex>h.monthIndex+r&&r+1===n&&(h=new i.default(h).toFirstOfMonth().add(1,"month"))):h=new i.default(h).toFirstOfMonth();var w=p(k(u,y,t),2);f=w[0],m=w[1],a(f,c(c({},t),{},{date:h,focused:m,selectedDate:f})),M(m,u)}(e,r,g)}},o.default.createElement("span",s({className:b},u),Z(e)&&!e.hidden?null!=v?v:e.day:""))})))})))})));function Z(e){return!!e.current||l}function ee(e){return L.current.querySelector("[aria-label*='".concat(e.format(Y),"']"))}}function P(e){var r=e.direction,t=e.onClick,n=e.disabled;return o.default.createElement("button",{className:"rmdp-arrow-container ".concat(r," ").concat(n?"disabled":""),onClick:t,"aria-roledescription":"button to navigate ".concat(r.replace("rmdp-",""))},o.default.createElement("i",{className:"rmdp-arrow"}))}function C(e){var t=e.state,n=e.setState,a=e.disableYearPicker,d=e.disableMonthPicker,i=e.buttons,l=e.renderButton,u=e.handleMonthChange,s=e.disabled,f=e.hideMonth,m=e.hideYear,h=e.isRTL,y=e.fullYear,g=p(e.monthAndYears,2),b=g[0],v=g[1],x=e.monthYearSeparator,w=e.formatMonth,k=e.formatYear,D=e.headerOrder,O={},E=t.date,Y=t.onlyMonthPicker,M=t.onlyYearPicker,C=t.mustShowYearPicker,N=t.minDate,S=t.maxDate,I=t.year,j=t.today,R=N&&E.year<=N.year&&N.monthIndex>E.monthIndex-1,T=S&&E.year>=S.year&&S.monthIndex<E.monthIndex+1,A=j.year+7;if(A-=12*Math.floor((A-I)/12),(f||y)&&m&&!i)return null;if((Y||y)&&(N&&N.year>=E.year&&(R=!0),S&&S.year<=E.year&&(T=!0)),C||M){var L=A-11;R=N&&N.year>L,T=S&&S.year<A}return s&&(R=!0,T=!0),o.default.createElement("div",{className:"rmdp-header"},o.default.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},Array.from(new Set(D)).map((function(e,t){return o.default.createElement(r.Fragment,{key:t},function(e){switch(e){case"LEFT_BUTTON":return i&&W("left");case"RIGHT_BUTTON":return i&&W("right");case"MONTH_YEAR":case"YEAR_MONTH":if(y)return o.default.createElement("div",{className:"rmdp-header-values",style:O},!m&&E.format("YYYY"));var t=e.split("_").filter((function(e){return"MONTH"===e&&!f||"YEAR"===e&&!m}));return t.length>1&&(t=[t[0],F(),t[1]]),b.map((function(e,n){return o.default.createElement("div",{key:n,className:"rmdp-header-values",style:O},t.map((function(t,i){return o.default.createElement(r.Fragment,{key:i},function(e,r,t){switch(e){case"MONTH":return o.default.createElement("span",{style:{cursor:s||d||Y?"default":"pointer"},onClick:function(){return!d&&_("mustShowMonthPicker")}},function(e,r){return"function"==typeof w?w(e,r):e}(r,v[t]));case"YEAR":return o.default.createElement("span",{style:{cursor:s||a||M?"default":"pointer"},onClick:function(){return!a&&_("mustShowYearPicker")}},function(e,r){return"function"==typeof w?k(e,r):e}(v[t],r));default:return e}}(t,e,n))})))}));default:return}}(e))}))));function F(){return x?o.default.createElement("span",null,x):h?"،":","}function W(e){var t=function(r){r.preventDefault(),B("right"===e?1:-1)},n="left"===e&&R||"right"===e&&T;return l instanceof Function?l(e,t,n):r.isValidElement(l)?r.cloneElement(l,{direction:e,handleClick:t,disabled:n}):o.default.createElement(P,{direction:"rmdp-".concat(e),onClick:t,disabled:n})}function B(e){s||e<0&&R||e>0&&T||(y?E.year+=e:C||M?(I+=12*e,e<0&&N&&I<N.year&&(I=N.year),e>0&&S&&I>S.year&&(I=S.year)):(E.toFirstOfMonth(),Y?E.year+=e:(E.month+=e,u(E))),n(c(c({},t),{},{date:E,year:I})))}function _(e){if(!s){var r={mustShowMonthPicker:!1,mustShowYearPicker:!1};r[e]=!t[e],n(c(c({},t),r))}}}function N(e){return b(e)||(e=[]),JSON.stringify(e)}function S(e){var t=e.state,n=e.onChange,a=e.customMonths,d=e.sort,l=e.handleMonthChange,u=e.handleFocusedDate,s=e.rangeHover,f=e.highlightToday,m=e.numberOfMonths,h=t.date,y=t.today,g=t.minDate,v=t.maxDate,w=t.calendar,E=t.locale,Y=t.onlyMonthPicker,M=t.onlyYearPicker,P=t.range,C=t.onlyShowInRangeDates,S=(t.mustShowMonthPicker||Y)&&!M,I=p(r.useState(),2),j=I[0],R=I[1];a=a&&N(a);var T=r.useMemo((function(){var e=[],r=Y?m:1,n=a&&JSON.parse(a),o=new i.default({calendar:w,locale:E,format:t.date._format,year:t.date.year,month:1,day:1});b(n)&&n.length>=12?(n.length=12,n=n.map((function(e){return b(e)?e[0]:e}))):n=o.locale.months.map((function(e){return p(e,1)[0]}));for(var d=0;d<r;d++){for(var l=[],c=0,u=0;u<4;u++){for(var s=[],f=0;f<3;f++)s.push({date:new i.default(o),name:n[c]}),c++,o.add(1,"month");l.push(s)}e.push(l)}return e}),[w,E,a,t.date.year,t.date._format,m,Y]);return o.default.createElement("div",{className:"".concat(Y?"only ":"","rmdp-month-picker"),style:{display:S?"flex":"none"},onMouseLeave:function(){return s&&R()}},T.map((function(e,r){return o.default.createElement("div",{key:r,style:{margin:"0 5px",flex:1}},e.map((function(e,r){return o.default.createElement("div",{key:r,className:"rmdp-ym"},e.map((function(e,r){var t=e.date,n=e.name;return o.default.createElement("div",{key:r,className:L(t),onClick:function(){return A(t)},onMouseEnter:function(){return s&&R(t)}},o.default.createElement("span",{className:Y?"sd":""},n))})))})))})));function A(e){var r=t.selectedDate,a=t.focused,o=e.year,i=e.monthIndex;if(!(g&&o<=g.year&&i<g.monthIndex||v&&o>=v.year&&i>v.monthIndex)){if(h.setMonth(i+1),Y){var s=p(k(e,d,t),2);r=s[0],a=s[1]}else l(h);n(Y?r:void 0,c(c({},t),{},{date:h,focused:a,selectedDate:r,mustShowMonthPicker:!1})),Y&&u(a,e)}}function L(e){var r=["rmdp-day"],n=e.year,a=e.monthIndex,o=t.selectedDate,d=t.multiple;if((g&&(n<g.year||n===g.year&&a<g.monthIndex)||v&&(n>v.year||n===v.year&&a>v.monthIndex))&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!C)return x(y,e,!0)&&f&&r.push("rmdp-today"),Y?P?(r.push(D(e,o,!0,d)),d||(r=r.concat(O(e,o,j,s,"month")))):[].concat(o).some((function(r){return x(r,e,!0)}))&&r.push("rmdp-selected"):h.monthIndex===a&&r.push("rmdp-selected"),r.join(" ")}}function I(e,r){return e.replace(/[0-9]/g,(function(e){return r[e]}))}function j(e){var t=e.state,n=e.onChange,a=e.sort,d=e.handleFocusedDate,l=e.onYearChange,u=e.rangeHover,s=e.highlightToday,f=t.date,m=t.today,h=t.minDate,y=t.maxDate,g=t.onlyYearPicker,v=t.range,x=t.onlyShowInRangeDates,w=t.year,D=t.mustShowYearPicker||g,O=f.digits,E=p(r.useState(),2),Y=E[0],M=E[1],P=m.year-4;P-=12*Math.ceil((P-w)/12);var C=r.useMemo((function(){for(var e=[],r=P,t=0;t<4;t++){for(var n=[],a=0;a<3;a++)n.push(r),r++;e.push(n)}return e}),[P]);return o.default.createElement("div",{className:"".concat(g?"only ":"","rmdp-year-picker"),style:{display:D?"block":"none"}},C.map((function(e,r){return o.default.createElement("div",{key:r,className:"rmdp-ym",onMouseLeave:function(){return u&&M()}},e.map((function(e,r){return o.default.createElement("div",{key:r,className:N(e),onClick:function(){return function(e){if(S(e))return;var r=new i.default(t.date).setYear(e),o=t.selectedDate,u=t.focused;if(g){var s=p(k(r,a,t),2);o=s[0],u=s[1]}else h&&r.monthIndex<h.monthIndex?r=r.setMonth(h.monthIndex+1):y&&r.monthIndex>y.monthIndex&&(r=r.setMonth(y.monthIndex+1)),null==l||l(r);n(g?o:void 0,c(c({},t),{},{date:r,focused:u,selectedDate:o,mustShowYearPicker:!1})),g&&d(u,r)}(e)},onMouseEnter:function(){return u&&M(e)}},o.default.createElement("span",{className:g?"sd":""},I(e.toString(),O)))})))})));function N(e){var r=["rmdp-day"],n=t.date,a=t.selectedDate,o=t.multiple;if(S(e)&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!x){if(m.year===e&&s&&r.push("rmdp-today"),g)if(v){var d=function(t){var n=t[0],a=t[1];if(1===t.length){if(e===n.year&&r.push("rmdp-range"),u){var o=t[0].year;(e>o&&e<=Y||e<o&&e>=Y)&&(r.push("rmdp-range-hover"),e===Y&&r.push(Y>o?"end":"start"))}}else 2===t.length&&(e>=n.year&&e<=a.year&&r.push("rmdp-range"),e===n.year&&r.push("start"),e===a.year&&r.push("end"))};o?(b(a)?a:[[a]]).forEach((function(e){return d(e)})):d(a)}else[].concat(a).some((function(r){return r&&r.year===e}))&&r.push("rmdp-selected");else e===n.year&&r.push("rmdp-selected");return r.join(" ")}}function S(e){return h&&e<h.year||y&&e>y.year}}function R(e,r,t){return t||(e?"MM/YYYY":r?"YYYY":"YYYY/MM/DD")}function T(e,r){return e instanceof i.default?e.setCalendar(r):e=new i.default({date:e,calendar:r}),e}function A(e){"_self"in o.default.createElement("div")&&console.warn(e.join("\n"))}var L=new i.default,F=L.calendar,W=L.locale;function B(e,r){return e&&e.constructor!==Object&&(A(_("calendar")),e=void 0),r&&r.constructor!==Object&&(A(_("locale")),r=void 0),[e||F,r||W]}function _(e){return["".concat(e," must be an object"),"https://shahabyazdi.github.io/react-multi-date-picker/calendars/"]}function V(e){return e&&e.name?e.name.split("_")[1]:""}function z(e){return["fa","ar"].includes(V(e))}function H(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}H(".rmdp-wrapper{background-color:#fff;border-radius:5px;direction:ltr;text-align:center;width:max-content}.rmdp-shadow{box-shadow:0 0 5px #8798ad}.rmdp-border{border:1px solid #cfd8e2}.rmdp-calendar{height:max-content;padding:4px}.rmdp-border-top{border-top:1px solid #cfd8e2}.rmdp-border-bottom{border-bottom:1px solid #cfd8e2}.rmdp-border-left{border-left:1px solid #cfd8e2}.rmdp-border-right{border-right:1px solid #cfd8e2}.rmdp-week,.rmdp-ym{display:flex;justify-content:space-between}.rmdp-ym{height:25%}.rmdp-day,.rmdp-week-day{color:#000;cursor:pointer;height:34px;position:relative;width:34px}.rmdp-week-day{color:#0074d9;cursor:default;font-size:13px;font-weight:500}.rmdp-day span,.rmdp-week-day{display:flex;flex-direction:column;justify-content:center}.rmdp-day span{border-radius:50%;bottom:3px;font-size:14px;left:3px;position:absolute;right:3px;top:3px}.rmdp-day.rmdp-today span{background-color:#7fdbff;color:#fff}.rmdp-day.rmdp-selected span:not(.highlight){background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-day.rmdp-deactive,.rmdp-day.rmdp-disabled{color:#8798ad}.rmdp-day.rmdp-deactive.rmdp-selected span{background-color:#4ca6f5;box-shadow:0 0 3px #bac5d3}.rmdp-ym .rmdp-day{flex:1;margin:auto}.rmdp-ym .rmdp-day span{border-radius:12px;padding:2px 0}.rmdp-range{background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-range-hover{background-color:#7ea6f0;color:#fff}.rmdp-range-hover.start,.rmdp-range.start{border-bottom-left-radius:50%;border-top-left-radius:50%}.rmdp-range-hover.end,.rmdp-range.end{border-bottom-right-radius:50%;border-top-right-radius:50%}.rmdp-ym .rmdp-range-hover.start,.rmdp-ym .rmdp-range.start{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-ym .rmdp-range-hover.end,.rmdp-ym .rmdp-range.end{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover{background-color:#7ea6f0;color:#fff}.rmdp-day-picker{padding:5px}.rmdp-header{font-size:14px;margin-top:5px;padding:9px 0}.rmdp-month-picker,.rmdp-year-picker{background-color:#fff;border-radius:0 0 5px 5px;bottom:2px;left:2px;position:absolute;right:2px;top:2px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:240px;position:static}.only.rmdp-month-picker .rmdp-day,.only.rmdp-year-picker .rmdp-day{width:80px}.rmdp-header-values{color:#000;margin:auto}.rmdp-header-values span{padding:0 0 0 5px}.rmdp-arrow{border:solid #0074d9;border-width:0 2px 2px 0;display:inline-block;height:3px;margin-top:5px;padding:2px;width:3px}.rmdp-right i{margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-left i{margin-left:3px;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-left{left:0}.rmdp-right{right:0}.rmdp-arrow-container{background:transparent;border:none;border-radius:50%;cursor:pointer;display:flex;height:20px;justify-content:center;margin:0 5px;padding:0;width:20px}.rmdp-arrow-container:hover{background-color:#0074d9;box-shadow:0 0 3px #8798ad}.rmdp-arrow-container:hover .rmdp-arrow{border:solid #fff;border-width:0 2px 2px 0}.rmdp-arrow-container.disabled{cursor:default}.rmdp-arrow-container.disabled:hover{background-color:inherit;box-shadow:inherit}.rmdp-arrow-container.disabled .rmdp-arrow,.rmdp-arrow-container.disabled:hover .rmdp-arrow{border:solid gray;border-width:0 2px 2px 0}.rmdp-rtl{direction:rtl}.rmdp-rtl .rmdp-left i{margin-left:0;margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-rtl .rmdp-right i{margin-left:3px;margin-right:0;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-rtl .rmdp-right{left:0;right:auto}.rmdp-rtl .rmdp-left{left:auto;right:0}.rmdp-rtl .rmdp-range-hover.start,.rmdp-rtl .rmdp-range.start{border-bottom-left-radius:unset;border-bottom-right-radius:50%;border-top-left-radius:unset;border-top-right-radius:50%}.rmdp-rtl .rmdp-range-hover.end,.rmdp-rtl .rmdp-range.end{border-bottom-left-radius:50%;border-bottom-right-radius:unset;border-top-left-radius:50%;border-top-right-radius:unset}.rmdp-rtl .rmdp-range.start.end{border-radius:50%}.rmdp-rtl .rmdp-ym .rmdp-range-hover.start,.rmdp-rtl .rmdp-ym .rmdp-range.start{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-rtl .rmdp-ym .rmdp-range-hover.end,.rmdp-rtl .rmdp-ym .rmdp-range.end{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-day-hidden,.rmdp-day.rmdp-disabled{cursor:default}.rmdp-selected .highlight{box-shadow:0 0 3px #8798ad}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-red:hover{background-color:#ff6687}.rmdp-day:not(.rmdp-deactive) .highlight-red{color:#cc0303}.rmdp-day.rmdp-deactive .highlight-red{color:#e08e8e}.rmdp-day.rmdp-selected .highlight-red{background-color:#ea0034;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-red{background-color:#e4b0ba;color:#fff}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-green:hover{background-color:#4db6ac}.rmdp-day:not(.rmdp-deactive) .highlight-green{color:#00796b}.rmdp-day.rmdp-deactive .highlight-green{color:#7ab3ac}.rmdp-day.rmdp-selected .highlight-green{background-color:#009688;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-green{background-color:#749c98;color:#fff}.rmdp-day-hidden,.rmdp-day-hidden:hover span{background-color:unset;color:transparent}.rmdp-month-name{cursor:default;font-size:14px;margin:3px 0}.rmdp-full-year{grid-template-columns:1fr 1fr 1fr}@media (max-height:450px),(max-width:450px){.rmdp-day,.rmdp-week-day{height:28px;width:28px}.rmdp-day span{font-size:12px;padding-left:.5px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:200px;width:205px}.rmdp-header{padding:3px 0 0}.rmdp-header,.rmdp-month-name{font-size:12px}.rmdp-full-year{grid-template-columns:1fr 1fr}}");var q=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","range","multiple","className","role","weekDays","months","children","onChange","showOtherDays","minDate","maxDate","mapDays","disableMonthPicker","disableYearPicker","formattingIgnoreList","onReady","onlyShowInRangeDates","zIndex","plugins","sort","numberOfMonths","currentDate","digits","buttons","renderButton","weekStartDayIndex","disableDayPicker","onPropsChange","onMonthChange","onYearChange","onFocusedDateChange","readOnly","disabled","hideMonth","hideYear","hideWeekDays","shadow","fullYear","displayWeekNumbers","weekNumber","weekPicker","rangeHover","monthYearSeparator","formatMonth","formatYear","highlightToday","headerOrder","style"],J=["datePickerProps","DatePicker"];function K(e,t){var n,a=e.value,d=e.calendar,l=e.locale,u=e.format,m=e.onlyMonthPicker,h=e.onlyYearPicker,y=e.range,g=void 0!==y&&y,v=e.multiple,x=void 0!==v&&v,w=e.className,k=e.role,D=e.weekDays,O=e.months,E=e.children,Y=e.onChange,P=e.showOtherDays,T=e.minDate,A=e.maxDate,L=e.mapDays,F=e.disableMonthPicker,W=e.disableYearPicker,_=e.formattingIgnoreList,V=e.onReady,H=e.onlyShowInRangeDates,K=void 0===H||H,U=e.zIndex,Q=void 0===U?100:U,X=e.plugins,Z=void 0===X?[]:X,ee=e.sort,re=e.numberOfMonths,te=void 0===re?1:re,ne=e.currentDate,ae=e.digits,oe=e.buttons,de=void 0===oe||oe,ie=e.renderButton,le=e.weekStartDayIndex,ce=void 0===le?0:le,ue=e.disableDayPicker,se=e.onPropsChange,fe=e.onMonthChange,pe=e.onYearChange,me=e.onFocusedDateChange,he=e.readOnly,ye=e.disabled,ge=e.hideMonth,be=e.hideYear,ve=e.hideWeekDays,xe=e.shadow,we=void 0===xe||xe,ke=e.fullYear,De=e.displayWeekNumbers,Oe=e.weekNumber,Ee=e.weekPicker,Ye=e.rangeHover,Me=e.monthYearSeparator,Pe=e.formatMonth,Ce=e.formatYear,Ne=e.highlightToday,Se=void 0===Ne||Ne,Ie=e.headerOrder,je=void 0===Ie?["LEFT_BUTTON","MONTH_YEAR","RIGHT_BUTTON"]:Ie,Re=e.style,Te=void 0===Re?{}:Re;f(e,q),!ne||ne instanceof i.default||(console.warn("currentDate must be instance of DateObject"),ne=void 0),("number"!=typeof ce||ce<0||ce>6)&&(ce=0),("number"!=typeof te||te<1||h)&&(te=1),!(x||g||b(a))||g||x||(x=!0),Ee&&(g=!0,x=!1),ke&&(te=12,m=!1,h=!1),h&&!ge&&(ge=!0);var Ae=B(d,l),Le=p(Ae,2);d=Le[0],l=Le[1],u=R(m,h,u),_=N(_),L=[].concat(L).filter(Boolean),Z=[].concat.apply([],Z);var Fe=r.useState({}),We=p(Fe,2),Be=We[0],_e=We[1],Ve={},ze=r.useRef({mustCallOnReady:!0,currentDate:ne});r.useEffect((function(){_e((function(e){var r=ze.current.currentDate,t=e.date,n=e.selectedDate,o=e.initialValue,s=e.focused,f=e.mustSortDates;function p(e){if(e)return e.calendar.name!==d.name&&e.setCalendar(d),e.locale.name!==l.name&&e.setLocale(l),e._format!==u&&e.setFormat(u),e.digits=ae,e.ignoreList=JSON.parse(_),e}function y(e){return new i.default(r||e)}if(a)if(b(n=G(a,d,l,u)))t||(t=y(n.flat()[0]));else if(t&&1!==te){var v=new i.default(t).toFirstOfMonth(),w=new i.default(t).add(te-1,m?"years":"months").toLastOfMonth();(n<v||n>w)&&(t=new i.default(n))}else t=y(n);else t||(t=y({calendar:d,locale:l,format:u})),o&&(n=void 0);if([].concat(n).flat().forEach(p),p(t),x||g||b(a)){if(n||(n=[]),b(n)||(n=x&&g?[[n]]:[n]),g&&!x&&n.length>2){var k=n[n.length-1];n=[n[0],k],s=k}x&&!g&&ee&&!f?(f=!0,n.sort((function(e,r){return e-r}))):g&&!x&&n.sort((function(e,r){return e-r}))}else b(n)&&(n=n.flat()[n.length-1]);return ke&&t.toFirstOfYear(),delete ze.current.currentDate,c(c({},e),{},{date:t,selectedDate:n,multiple:x,range:g,onlyMonthPicker:m,onlyYearPicker:h,initialValue:e.initialValue||a,value:a,focused:s,calendar:d,locale:l,format:u,mustSortDates:f,year:t.year,today:p(e.today)||new i.default({calendar:d}),weekPicker:Ee})}))}),[a,d,l,u,m,h,g,x,ee,te,ae,_,ke,Ee]),r.useEffect((function(){(T||A)&&_e((function(e){var r=e.calendar,t=e.locale,n=e.format,o=p($(G(a,r,t,n),T,A,r),3),d=o[0],i=o[1],l=o[2];return c(c({},e),{},{inRangeDates:K?d:e.selectedDate,minDate:i,maxDate:l})}))}),[T,A,K,a]),Be.today&&!ze.current.isReady&&(ze.current.isReady=!0),r.useEffect((function(){ze.current.isReady&&ze.current.mustCallOnReady&&V instanceof Function&&(ze.current.mustCallOnReady=!1,V())}),[ze.current.isReady,V]);var He="rmdp-top-class "+nr(["top","bottom"]),qe={top:[],bottom:[],left:[],right:[]},Je=z(null===(n=Be.date)||void 0===n?void 0:n.locale),Ke={state:Be,setState:_e,onChange:Ze,sort:ee,handleFocusedDate:rr,isRTL:Je,fullYear:ke,monthAndYears:dr(),rangeHover:Ye,highlightToday:Se,numberOfMonths:te},Ue=arguments[0],$e=Ue.datePickerProps,Ge=Ue.DatePicker,Qe=f(Ue,J);return Xe(),Be.today?o.default.createElement("div",{ref:or,role:k||"dialog",className:"rmdp-wrapper rmdp-".concat(we?"shadow":"border"," ").concat(w||""),style:c({zIndex:Q},Te)},qe.top,o.default.createElement("div",{style:{display:"flex"},className:He},qe.left,!ue&&o.default.createElement("div",{className:"rmdp-calendar ".concat(Je?"rmdp-rtl":""," ").concat(nr(["left","right"]))},o.default.createElement(C,c(c({},Ke),{},{disableYearPicker:W,disableMonthPicker:F,buttons:de,renderButton:ie,handleMonthChange:tr,disabled:ye,hideMonth:ge,hideYear:be,monthYearSeparator:Me,formatMonth:Pe,formatYear:Ce,headerOrder:je})),o.default.createElement("div",{style:{position:"relative"}},o.default.createElement(M,c(c({},Ke),{},{showOtherDays:P,mapDays:L,onlyShowInRangeDates:K,customWeekDays:D,weekStartDayIndex:ce,hideWeekDays:ve,displayWeekNumbers:De,weekNumber:Oe})),!ke&&o.default.createElement(o.default.Fragment,null,!F&&o.default.createElement(S,s({},Ke,{customMonths:O,handleMonthChange:tr})),!W&&o.default.createElement(j,s({},Ke,{onYearChange:pe}))))),qe.right),qe.bottom,E):null;function Xe(){if(ze.current.isReady&&b(Z)){var e={state:Be,setState:_e,registerListener:ar,calendarProps:Qe,datePickerProps:$e,handleChange:Ze,Calendar:ze.current.Calendar,DatePicker:Ge,handlePropsChange:er,handleFocusedDate:function(e){return rr(e)}},t=function(e){return ue?"bottom":e.props.position||"right"};Z.forEach((function(n,a){if("string"!=typeof n.type){var o={},d=t(n);if(qe[d]&&!n.props.disabled){for(var i=0;i<Z.length;i++)if("string"!=typeof Z[i].type&&!Z[i].props.disabled){if(4===Object.keys(o).length)break;var l=t(Z[i]);["top","bottom"].includes(d)?(l===d&&i>a&&(o.bottom=!0),l===d&&i<a&&(o.top=!0)):(He.includes("border-top")&&(o.top=!0),He.includes("border-bottom")&&(o.bottom=!0),l===d&&i>a&&(o.right=!0),l===d&&i<a&&(o.left=!0))}qe[d].push(r.cloneElement(n,c({key:a,position:d,nodes:o},e)))}}else"mapDays"===n.type&&L.push(n.fn(e))}))}}function Ze(e,r){if(!ye){if(e||null===e){if(he)return;Ve.change&&Ve.change.forEach((function(r){return r(e)}))}if(e||null===e){var t=null==Y?void 0:Y(e);r&&!1!==t&&_e(r)}else r&&_e(r);er({value:e})}}function er(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!he&&!ye){var t=c(c(c(c({},Qe),$e),r),{},{value:null!==(e=r.value)&&void 0!==e?e:Be.selectedDate});delete t.onPropsChange,null==se||se(t)}}function rr(e,r){he||ye||null==me||me(e,r)}function tr(e){null==fe||fe(e)}function nr(e){return ue||!b(Z)?"":Array.from(new Set(Z.map((function(r){if(!r.props)return"";var t=r.props.position||"right";return e.includes(t)&&!r.props.disabled?"rmdp-border-"+t:""})))).join(" ")}function ar(e,r){Ve[e]||(Ve[e]=[]),Ve[e].push(r)}function or(e){if(e&&(e.date=Be.date,e.set=function(e,r){ye||_e(c(c({},Be),{},{date:new i.default(Be.date.set(e,r))}))}),ze.current.Calendar=e,t instanceof Function)return t(e);t&&(t.current=e)}function dr(){var e=Be.date;if(!e)return[];for(var r=[],t=[],n=e.digits,a=0;a<te;a++){var o=void 0,d=e.year,i=e.monthIndex+a;if(m&&(d+=a),i>11&&(i-=12,m||d++),b(O)&&O.length>=12){var l=O[i];o=b(l)?l[0]:l}else o=e.months[i].name;d=I(d.toString(),n),r.push(o),t.push(d)}return[r,t]}}var U=r.forwardRef(K);function $(e,r,t,n){return r&&(r=T(r,n).set({hour:0,minute:0,second:0,millisecond:0})),t&&(t=T(t,n).set({hour:23,minute:59,second:59,millisecond:999})),b(e)&&(e=e.filter((function(e){return!(r&&e<r)&&!(t&&e>t)}))),[e,r,t]}function G(e,r,t,n){var a=[].concat(e).map((function(e){return b(e)?e.map(o).filter(d):o(e)})).filter(d);return b(e)?a:a.flat()[0];function o(e){return e?e instanceof i.default?e:new i.default({date:e,calendar:r,locale:t,format:n}):{}}function d(e){return b(e)||e.isValid}}H('.rmdp-visible{visibility:visible}.rmdp-invisible{visibility:hidden}.rmdp-input{border:1px solid #c0c4d6;border-radius:5px;height:22px;margin:1px 0;padding:2px 5px}.rmdp-input:focus{border:1px solid #a4b3c5;box-shadow:0 0 2px #a4b3c5;outline:none!important}.rmdp-button{background-color:#0074d9;border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-block;padding:7px 16px;text-align:center;text-decoration:none;transition:.3s}.rmdp-button:hover{background-color:#143ac5;transition:.4s}.rmdp-button:disabled{background-color:#8798ad}.rmdp-action-button{border-radius:unset;color:#2682d3;float:right;font-weight:700;margin:15px 10px 15px 0}.rmdp-action-button,.rmdp-action-button:hover{background-color:transparent}.rmdp-ep-arrow{overflow:hidden;will-change:transform}.rmdp-ep-arrow:after{background-color:#fff;content:"";height:12px;position:absolute;transform:rotate(45deg);width:12px}.rmdp-ep-shadow:after{box-shadow:0 0 6px #8798ad}.rmdp-ep-border:after{border:1px solid #cfd8e2}.rmdp-ep-arrow[direction=top]{border-bottom:1px solid #fff}.rmdp-ep-arrow[direction=left]{border-right:1px solid #fff}.rmdp-ep-arrow[direction=right]{border-left:1px solid #fff;margin-left:-1px}.rmdp-ep-arrow[direction=bottom]{border-top:1px solid #fff;margin-top:-1.5px}.rmdp-ep-arrow[direction=top]:after{left:4px;top:5px}.rmdp-ep-arrow[direction=bottom]:after{left:4px;top:-6px}.rmdp-ep-arrow[direction=left]:after{left:5px;top:3px}.rmdp-ep-arrow[direction=right]:after{left:-6px;top:3px}');var Q=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","onChange","range","multiple","name","id","title","placeholder","required","style","className","inputClass","disabled","render","weekDays","months","children","inputMode","scrollSensitive","hideOnScroll","minDate","maxDate","formattingIgnoreList","containerClassName","calendarPosition","editable","onOpen","onClose","arrowClassName","zIndex","arrow","fixMainPosition","onPositionChange","onPropsChange","digits","readOnly","shadow","onFocusedDateChange","type","weekPicker","mobileLabels","onOpenPickNewDate","mobileButtons","dateSeparator","multipleRangeSeparator"],X=["label"];function Z(e,t){var n=e.value,a=e.calendar,l=e.locale,u=e.format,m=e.onlyMonthPicker,h=e.onlyYearPicker,y=e.onChange,v=e.range,x=void 0!==v&&v,w=e.multiple,k=void 0!==w&&w,D=e.name,O=e.id,E=e.title,Y=e.placeholder,M=e.required,P=e.style,C=void 0===P?{}:P,S=e.className,j=void 0===S?"":S,T=e.inputClass,A=e.disabled,L=e.render,F=e.weekDays,W=e.months,_=e.children,H=e.inputMode,q=e.scrollSensitive,J=void 0===q||q,K=e.hideOnScroll,$=e.minDate,G=e.maxDate,Z=e.formattingIgnoreList,ee=e.containerClassName,ne=void 0===ee?"":ee,ae=e.calendarPosition,oe=void 0===ae?"bottom-left":ae,de=e.editable,ie=void 0===de||de,le=e.onOpen,ce=e.onClose,ue=e.arrowClassName,se=void 0===ue?"":ue,fe=e.zIndex,pe=void 0===fe?100:fe,me=e.arrow,he=void 0===me||me,ye=e.fixMainPosition,ge=e.onPositionChange,be=e.onPropsChange,ve=e.digits,xe=e.readOnly,we=e.shadow,ke=void 0===we||we,De=e.onFocusedDateChange,Oe=e.type,Ee=e.weekPicker,Ye=e.mobileLabels,Me=e.onOpenPickNewDate,Pe=void 0===Me||Me,Ce=e.mobileButtons,Ne=void 0===Ce?[]:Ce,Se=e.dateSeparator,Ie=e.multipleRangeSeparator,je=void 0===Ie?",":Ie,Re=f(e,Q),Te=r.useState(),Ae=p(Te,2),Le=Ae[0],Fe=Ae[1],We=r.useState(),Be=p(We,2),_e=Be[0],Ve=Be[1],ze=r.useState(""),He=p(ze,2),qe=He[0],Je=He[1],Ke=r.useState(!1),Ue=p(Ke,2),$e=Ue[0],Ge=Ue[1],Qe=r.useState(!1),Xe=p(Qe,2),Ze=Xe[0],er=Xe[1],rr=r.useRef(),tr=r.useRef(),nr=r.useRef(),ar=r.useRef({}),or=Se||(x||Ee?" ~ ":", "),dr=arguments[0],ir=hr(),lr=r.useCallback((function(){if(!1!==(null==ce?void 0:ce())){var e=te(tr);if(e&&e.forEach((function(e){return e.blur()})),ar.current.mobile){var r=nr.current.parentNode.parentNode;r.classList.remove("rmdp-calendar-container-mobile"),r.style.position="absolute",r.style.visibility="hidden"}Ge(!1),er(!1)}}),[ce]),cr=[{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){Ve(void 0),lr()},label:gr("CANCEL")},{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){_e&&(xr(_e,!0),Ve(void 0)),lr()},label:gr("OK")}];ir&&!ar.current.mobile&&(ar.current=c(c({},ar.current),{},{mobile:!0})),!ir&&ar.current.mobile&&(ar.current=c(c({},ar.current),{},{mobile:!1})),Z=N(Z),u=R(m,h,u);var ur=B(a,l),sr=p(ur,2);return a=sr[0],l=sr[1],r.useEffect((function(){function e(e){if($e&&!ar.current.mobile){var r=[];if([tr.current,nr.current].forEach((function(t){!t||t.contains(e.target)||e.target.classList.contains("b-deselect")||e.target.parentNode.classList.contains("b-deselect")||r.push(t)})),2===r.length)return lr();nr.current&&nr.current.contains(e.target)&&(rr.current.removeTransition(),rr.current.refreshPosition())}}function r(){K&&$e&&lr()}return document.addEventListener("click",e,!1),document.addEventListener("scroll",r,!0),function(){document.removeEventListener("click",e,!1),document.removeEventListener("scroll",r,!0)}}),[lr,t,$e,K]),r.useEffect((function(){var e=n,r=ar.current,t=r.date,o=r.initialValue,d=function(){return e[e.length-1]};function s(e){if(e)return e instanceof i.default||(e=new i.default({date:e,calendar:a,locale:l,format:u})),e.calendar!==a&&e.setCalendar(a),e.set({weekDays:F,months:W,digits:ve,locale:l,format:u,ignoreList:JSON.parse(Z)}),e}n||o||!t?o&&!n&&(o=void 0):e=t;var f="";if(x||k||b(e)){var m=function(e){return e=e.map(s).filter((function(e){return void 0!==e})),x&&e.length>2&&(e=[e[0],d()]),[e,re(e,or)]};if(b(e)||(e=x&&k?e?[[e]]:[]:[e]),k&&x)e=e.map((function(r,t){var n=p(m(b(r)?r:[r]),2),a=n[0],o=n[1];return f+=o+(t<e.length-1?" ".concat(je," "):""),a}));else{var h=p(m(e),2);e=h[0],f=h[1]}f=f.toString().replace(/\s,\s$/,"")}else b(e)&&(e=d()),(e=s(e))&&(f=e.format());te(tr).every((function(e){return document.activeElement!==e}))&&Je(f),ar.current=c(c({},ar.current),{},{date:e,separator:or,initialValue:o||n}),ar.current.mobile&&rr.current.isOpen?Ve(e):Fe(e)}),[n,a,l,u,x,k,or,m,h,F,W,ve,Z]),r.useEffect((function(){var e=ar.current.selection;if(e){var r=te(tr);0!==r.length&&(r.forEach((function(r){document.activeElement===r&&(r.setSelectionRange(e,e),ar.current.selection=void 0)})),rr.current.refreshPosition())}}),[qe]),(k||x||b(Le)||!ie)&&(H="none"),o.default.createElement(d.default,s({ref:fr,element:pr(),popper:$e&&mr(),active:!ir&&Ze,position:oe,arrow:!ir&&he,fixMainPosition:!J||ye,zIndex:pe,onChange:!ir&&ge,containerClassName:"rmdp-container ".concat(ne),arrowClassName:["rmdp-ep-arrow","rmdp-ep-".concat(ke?"shadow":"border"),j,se].join(" ")},Re));function fr(e){if(e&&(e.openCalendar=function(){return setTimeout((function(){return br()}),10)},e.closeCalendar=lr,e.isOpen=$e&&Ze),rr.current=e,t instanceof Function)return t(e);t&&(t.current=e)}function pr(){return L?o.default.createElement("div",{ref:tr},r.isValidElement(L)?r.cloneElement(L,{value:qe,openCalendar:br,onFocus:br,handleValueChange:wr,onChange:wr,locale:l,separator:or}):L instanceof Function?L(qe,br,wr,l,or):null):o.default.createElement("input",{ref:tr,type:Oe||"text",name:D,id:O,title:E,required:M,onFocus:br,className:T||"rmdp-input",placeholder:Y,value:qe,onChange:wr,style:C,autoComplete:"off",disabled:!!A,inputMode:H||(ir?"none":void 0),readOnly:xe})}function mr(){return o.default.createElement(U,s({ref:nr,value:_e||Le,onChange:xr,range:x,multiple:k,calendar:a,locale:l,format:u,onlyMonthPicker:m,onlyYearPicker:h,className:j+(ir?" rmdp-mobile":""),weekDays:F,months:W,digits:ve,minDate:$,maxDate:G,formattingIgnoreList:JSON.parse(Z),onPropsChange:be,shadow:ke,onReady:kr,DatePicker:rr.current,datePickerProps:dr,onFocusedDateChange:Dr,weekPicker:Ee},Re),_,ir&&yr())}function hr(){return"string"==typeof j&&j.includes("rmdp-mobile")}function yr(){var e=[].concat.apply([],dr.plugins||[]).some((function(e){var r=e.props;return!(void 0===r?{}:r).disabled}));return b(Ne)&&o.default.createElement("div",{className:"rmdp-action-buttons ".concat(z(l)?"rmdp-rtl":""," ").concat(e?"rmdp-border-top":"")},Ne.concat(cr).map((function(e,r){var t=e.label,n=f(e,X);return o.default.createElement("button",s({key:r},n),t)})))}function gr(e){var r,t=l||(new i.default).locale;if("string"!=typeof t.name)return e;return(null==Ye?void 0:Ye[e])||(null===(r={en:{OK:"OK",CANCEL:"CANCEL"},fa:{OK:"تأیید",CANCEL:"لغو"},ar:{OK:"تأكيد",CANCEL:"الغاء"},hi:{OK:"पुष्टि",CANCEL:"रद्द करें"}}[V(t)])||void 0===r?void 0:r[e])||e}function br(){if(!A&&!xe&&!1!==(null==le?void 0:le())){if(vr()){var e=new i.default({calendar:a,locale:l,format:u,months:W,weekDays:F,digits:ve,ignoreList:JSON.parse(Z)});(!$||e>$)&&(!G||e<G)&&(xr(e),null==be||be(c(c({},dr),{},{value:e})),ar.current.date=e)}var r=te(tr);ir&&r.length>0&&r.forEach((function(e){return e.blur()})),r.length>0||!$e?Ge(!0):lr()}}function vr(){return Pe&&!n&&!ar.current.date&&!x&&!k&&!ir}function xr(e,r,t){if(ir&&!r)return Ve(e);var n="";if(e&&(n=k&&x&&b(e)?e.map((function(e){return re(e,or)})).join(" ".concat(je," ")):re(e,or)),!1===(null==y?void 0:y(e,{validatedValue:n,input:tr.current,isTyping:!!t})))return Je(qe),!1;Fe(e),Je(t||n.toString().replace(/\s,\s$/,"")),ar.current=c(c({},ar.current),{},{date:e})}function wr(e){if(ie){ar.current.selection=e.target.selectionStart;var r=e.target.value,t={calendar:a,locale:l,format:u,ignoreList:JSON.parse(Z)};if(ve=b(ve)?ve:l.digits,!r)return Je(""),xr(null);if(ve){var n,o,d=g(ve);try{for(d.s();!(n=d.n()).done;){var s=n.value;r=r.replace(new RegExp(s,"g"),ve.indexOf(s))}}catch(e){d.e(e)}finally{d.f()}o=b(Le)?k&&x?(r||"").split(je).filter(Boolean).map(p):p(r):f(r),xr(b(Le)||o.isValid?o:null,void 0,I(r,ve))}}function f(e){return/(?=.*Y)(?=.*M)(?=.*D)/.test(u)?new i.default(c(c({},t),{},{date:e})):new i.default(t).parse(e)}function p(e){return(e||"").split(or).filter(Boolean).map((function(e){return f(e.trim())}))}}function kr(){if(er(!0),ir){var e=nr.current.parentNode.parentNode;e.className="rmdp-calendar-container-mobile",e.style.position="fixed",e.style.transform="",setTimeout((function(){e.style.visibility="visible"}),50)}}function Dr(e,r){b(ar.current.date)||!r||ir||lr(),null==De||De(e,r)}}var ee=r.forwardRef(Z);function re(e,r){var t=[].concat(e).map((function(e){return null!=e&&e.isValid?e.format():""}));return t.toString=function(){return this.filter(Boolean).join(r)},t}function te(e){return e.current?"INPUT"===e.current.tagName?[e.current]:Array.from(e.current.querySelectorAll("input")):[]}e.Calendar=U,e.DatePicker=ee,e.getAllDatesInRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var t=e[0],n=e[e.length-1],a=[];if(!(t instanceof i.default&&n instanceof i.default&&t.isValid&&n.isValid&&!(t>n)))return[];for(t=new i.default(t),n=new i.default(n);t<=n;t.day++)a.push(r?t.toDate():new i.default(t));return a},e.toDateObject=T,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react"),require("react-element-popper"),require("react-date-object")):"function"==typeof define&&define.amd?define(["exports","react","react-element-popper","react-date-object"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ReactMultiDatePicker={},e.React,e.ElementPopper,e.DateObject)}(this,(function(e,r,t,n){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=a(r),d=a(t),i=a(n);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){c(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function f(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function p(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],d=!0,i=!1;try{for(t=t.call(e);!(d=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);d=!0);}catch(e){i=!0,a=e}finally{try{d||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,r)||h(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,r){if(e){if("string"==typeof e)return y(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,r):void 0}}function y(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=h(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,d=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return d=e.done,e},e:function(e){i=!0,o=e},f:function(){try{d||null==t.return||t.return()}finally{if(i)throw o}}}}function b(e){return Array.isArray(e)}function v(e){var t=e.state.date,n=t.calendar,a=t.locale,d=e.customWeekDays,l=e.weekStartDayIndex,u=e.displayWeekNumbers,c=e.weekNumber,s=r.useMemo((function(){var e=d;return b(e)&&e.length>=7?(e.length=7,e=e.map((function(e){return b(e)&e.length>1?e=e[1]:b(e)&&(e=e[0]),e}))):e=new i.default({year:1,calendar:n,locale:a}).weekDays.map((function(e){return e.shortName})),e}),[n,a,d]);return s=m(s).slice(l).concat(m(s).splice(0,l)),o.default.createElement("div",{className:"rmdp-week"},u&&o.default.createElement("div",{className:"rmdp-week-day"},c),s.map((function(e,r){return o.default.createElement("div",{key:r,className:"rmdp-week-day"},e)})))}function x(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!r)return!1;if(e.year===r.year){if(n)return!0;if(e.monthIndex===r.monthIndex)return!!t||e.day===r.day}}function w(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY/MM/DD";return e.format(r)}function k(e,r,t){var n=t.multiple,a=t.range,o=t.selectedDate,d=t.onlyMonthPicker,l=t.onlyYearPicker,u=t.format,c=t.focused,s=t.weekPicker;e.setFormat(u);var f=new i.default(e);return[o=n&&a?function(){var e=!0;b(o)||(o=[[o]]);var r=o.find((function(e){return 1===e.length})),t=d?"YYYY/MM":"YYYY/MM/DD",n=o;if(r){var a=r[0];n=n.filter((function(e){if(1===e.length)return!0;var r=p(e,2),n=r[0],o=r[1],d=p([a,f].sort((function(e,r){return e-r})),2),i=p([n,o,d[0],d[1]].map((function(e){return w(e,t)})),4),l=i[0],u=i[1],c=i[2],s=i[3];return!(c<=l&&s>=u||c>=l&&s>=u&&c<=u||c<=l&&s<=u&&s>=l)}))}else n=n.filter((function(e){if(!b(e))return!0;if(0===e.length)return!1;var r=p(e,2),n=p([r[0],r[1],f].map((function(e){return w(e,t)})),3),a=n[0],o=n[1],d=n[2];return!(d>=a&&d<=o)}));n=n.map((function(r){var t;return b(r)?1===r.length?(e=!1,t=r.concat(f)):t=r:(e=!1,t=[r,f]),t.sort((function(e,r){return e-r}))})),e&&(n=[].concat(m(n),[[f]]));return n}():n?function(){var t=o.filter((function(r){return!x(e,r,d,l)}));t.length===o.length?t.push(f):f=t.find((function(e){return x(e,c)}));r&&t.sort((function(e,r){return e-r}));return t}():a?function(){if(s)return[new i.default(f).toFirstOfWeek(),new i.default(f).toLastOfWeek()];if(2===o.length||0===o.length)return[f];if(1===o.length)return[o[0],f].sort((function(e,r){return e-r}))}():f,f]}function D(e,r,t,n){var a=[],o=t?"YYYY/MM":"YYYY/MM/DD",d=w(e,o);function i(r){var n=r[0],i=r[1];if(1===r.length)x(e,n,t)&&a.push("rmdp-range");else if(2===r.length){var l=p([n,i].map((function(e){return w(e,o)})),2),u=l[0],c=l[1];d>=u&&d<=c&&a.push("rmdp-range"),d===u&&a.push("start"),d===c&&a.push("end")}}return n?(b(r)?r:[[r]]).forEach(i):i(r),a.join(" ")}function O(e,r,t,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"day",o=[];if(n&&1===(null==r?void 0:r.length)&&t){var d="day"===a?"YYYY/MM/DD":"YYYY/MM",i=t.format(d),l=r[0].format(d),u=e.format(d);(u>l&&u<=i||u<l&&u>=i)&&(o.push("rmdp-range-hover"),u===i&&o.push(i>l?"end":"start"))}return o}var E,Y="dddd MMMM DD of YYYY";function M(e){var t=e.state,n=e.setState,a=e.onChange,d=e.showOtherDays,l=void 0!==d&&d,f=e.mapDays,m=e.onlyShowInRangeDates,h=e.customWeekDays,y=e.sort,g=e.numberOfMonths,b=e.isRTL,w=e.weekStartDayIndex,M=e.handleFocusedDate,P=e.hideWeekDays,C=e.fullYear,N=p(e.monthAndYears,1)[0],S=e.displayWeekNumbers,I=e.weekNumber,j=void 0===I?"":I,R=e.rangeHover,A=e.highlightToday,T=r.useRef({}),L=r.useRef(),F=t.today,W=t.minDate,B=t.maxDate,_=t.range,V=t.multiple,z=t.date,H=t.selectedDate,q=t.onlyMonthPicker,J=t.onlyYearPicker,K=!q&&!J,U=p(r.useState(),2),$=U[0],G=U[1],Q=V||_?(null==H?void 0:H.length)>0:!!H;T.current.date=z;var X=r.useMemo((function(){return K?function(e,r,t,n){if(!e)return[];for(var a=[],o=0;o<t;o++){var d=(e=new i.default(e).toFirstOfMonth()).monthIndex,l=[];e.toFirstOfWeek().add(n,"day"),e.monthIndex===d&&e.day>1&&e.subtract(7,"days");for(var u=0;u<6;u++){for(var c=[],s=0;s<7;s++)c.push({date:new i.default(e),day:e.format("D"),current:e.monthIndex===d}),e.day+=1;if(l.push(c),u>2&&e.monthIndex!==d&&!r)break}a.push(l)}return a}(T.current.date,l,g,w):[]}),[z.monthIndex,z.year,z.calendar,z.locale,K,l,g,w]);return K&&o.default.createElement("div",{ref:L,className:"rmdp-day-picker ".concat(C?"rmdp-full-year":""),style:{display:C?"grid":"flex"},onMouseLeave:function(){return R&&G()}},X.map((function(e,r){return o.default.createElement("div",{key:r,style:c({},b?"marginLeft":"marginRight",r+(C?0:1)<g?"10px":"")},C&&o.default.createElement("div",{className:"rmdp-month-name"},N[r]),!P&&o.default.createElement(v,{state:t,customWeekDays:h,weekStartDayIndex:w,displayWeekNumbers:S,weekNumber:j}),e.map((function(e,d){return o.default.createElement("div",{key:d,className:"rmdp-week"},S&&o.default.createElement("div",{className:"rmdp-day rmdp-disabled"},o.default.createElement("span",null,e[0].date.format("WW"))),e.map((function(e,d){var c=function(e){if(!e.current&&!l)return{};var r={};return f.forEach((function(n){var a,o=n({date:e.date,today:F,currentMonth:t.date.month,selectedDate:t.selectedDate,isSameDate:x});(null===(a=o)||void 0===a?void 0:a.constructor)!==Object&&(o={}),(o.disabled||o.hidden)&&(e.disabled=!0),o.hidden&&(e.hidden=!0),r=u(u({},r),o)})),delete r.disabled,delete r.hidden,r}(e={date:e.date,day:e.day,current:e.current}),h=Z(e)&&!e.disabled,b="".concat(h?"sd":""),v=c.children;h&&(b="".concat(b," ").concat(c.className||"")),delete c.className,delete c.children;var w=function(e,r){var t=["rmdp-day"],n=e.date,a=e.hidden,o=e.current;if(!Z(e)||a)t.push("rmdp-day-hidden");else{(W&&n<W||B&&n>B||e.disabled)&&(t.push("rmdp-disabled"),e.disabled||(e.disabled=!0)),o||t.push("rmdp-deactive");var d=r>1&&o||1===r;e.disabled&&m||(x(n,F)&&A&&t.push("rmdp-today"),i=n,[].concat(H).some((function(e){return x(e,i)}))&&d&&!_&&t.push("rmdp-selected")),_&&!e.disabled&&d&&(t.push(D(n,H,void 0,V)),V||(t=t.concat(O(n,H,$,R))))}var i;return t.join(" ")}(e,g);(e.hidden||e.disabled)&&(b=b.replace("sd",""));var P=Q?w.includes("selected")||w.includes("range"):w.includes("today");return o.default.createElement("div",{key:d,tabIndex:P?0:-1,"aria-label":"Choose ".concat(e.date.format(Y)),className:w,onMouseEnter:function(){return R&&G(e.date)},onKeyDown:function(r){return function(e,r){var a=e.currentTarget,o=e.key,d=e.code,l={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};if("Space"===d||" "===o)e.preventDefault(),a.click();else if(Object.keys(l).includes(o)){var c=function(e){if(!e)return s();var r=e.getAttribute("class");r.includes("hidden")||r.includes("disabled")?s():e.focus()},s=function(){n(u(u({},t),{},{date:p})),clearTimeout(E),E=setTimeout((function(){return c(ee(p))}),100)};e.preventDefault();var f=l[o],p=new i.default(r.date).add(f,"day"),m=ee(p);c(m)}}(r,e)},onClick:function(){Z(e)&&!e.disabled&&function(e,r,n){var o,d,l,c=e.date,s=e.current,f=t.selectedDate,m=t.focused,h=t.date,g=h,b=g.hour,v=g.minute,x=g.second;c.set({hour:(null===(o=f)||void 0===o?void 0:o.hour)||b,minute:(null===(d=f)||void 0===d?void 0:d.minute)||v,second:(null===(l=f)||void 0===l?void 0:l.second)||x}),1!==n||s?n>1&&!s&&(0===r&&c<h&&(h=new i.default(h).toFirstOfMonth()),r>0&&c.monthIndex>h.monthIndex+r&&r+1===n&&(h=new i.default(h).toFirstOfMonth().add(1,"month"))):h=new i.default(h).toFirstOfMonth();var w=p(k(c,y,t),2);f=w[0],m=w[1],a(f,u(u({},t),{},{date:h,focused:m,selectedDate:f})),M(m,c)}(e,r,g)}},o.default.createElement("span",s({className:b},c),Z(e)&&!e.hidden?null!=v?v:e.day:""))})))})))})));function Z(e){return!!e.current||l}function ee(e){return L.current.querySelector("[aria-label*='".concat(e.format(Y),"']"))}}function P(e){var r=e.direction,t=e.onClick,n=e.disabled;return o.default.createElement("button",{className:"rmdp-arrow-container ".concat(r," ").concat(n?"disabled":""),onClick:t,"aria-roledescription":"button to navigate ".concat(r.replace("rmdp-",""))},o.default.createElement("i",{className:"rmdp-arrow"}))}function C(e){var t=e.state,n=e.setState,a=e.disableYearPicker,d=e.disableMonthPicker,i=e.buttons,l=e.renderButton,c=e.handleMonthChange,s=e.disabled,f=e.hideMonth,m=e.hideYear,h=e.isRTL,y=e.fullYear,g=p(e.monthAndYears,2),b=g[0],v=g[1],x=e.monthYearSeparator,w=e.formatMonth,k=e.formatYear,D=e.headerOrder,O={},E=t.date,Y=t.onlyMonthPicker,M=t.onlyYearPicker,C=t.mustShowYearPicker,N=t.minDate,S=t.maxDate,I=t.year,j=t.today,R=N&&E.year<=N.year&&N.monthIndex>E.monthIndex-1,A=S&&E.year>=S.year&&S.monthIndex<E.monthIndex+1,T=j.year+7;if(T-=12*Math.floor((T-I)/12),(f||y)&&m&&!i)return null;if((Y||y)&&(N&&N.year>=E.year&&(R=!0),S&&S.year<=E.year&&(A=!0)),C||M){var L=T-11;R=N&&N.year>L,A=S&&S.year<T}return s&&(R=!0,A=!0),o.default.createElement("div",{className:"rmdp-header"},o.default.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},Array.from(new Set(D)).map((function(e,t){return o.default.createElement(r.Fragment,{key:t},function(e){switch(e){case"LEFT_BUTTON":return i&&W("left");case"RIGHT_BUTTON":return i&&W("right");case"MONTH_YEAR":case"YEAR_MONTH":if(y)return o.default.createElement("div",{className:"rmdp-header-values",style:O},!m&&E.format("YYYY"));var t=e.split("_").filter((function(e){return"MONTH"===e&&!f||"YEAR"===e&&!m}));return t.length>1&&(t=[t[0],F(),t[1]]),b.map((function(e,n){return o.default.createElement("div",{key:n,className:"rmdp-header-values",style:O},t.map((function(t,i){return o.default.createElement(r.Fragment,{key:i},function(e,r,t){switch(e){case"MONTH":return o.default.createElement("span",{style:{cursor:s||d||Y?"default":"pointer"},onClick:function(){return!d&&_("mustShowMonthPicker")}},function(e,r){return"function"==typeof w?w(e,r):e}(r,v[t]));case"YEAR":return o.default.createElement("span",{style:{cursor:s||a||M?"default":"pointer"},onClick:function(){return!a&&_("mustShowYearPicker")}},function(e,r){return"function"==typeof w?k(e,r):e}(v[t],r));default:return e}}(t,e,n))})))}));default:return}}(e))}))));function F(){return x?o.default.createElement("span",null,x):h?"،":","}function W(e){var t=function(r){r.preventDefault(),B("right"===e?1:-1),function(e){setTimeout((function(){var r=e.target.closest(".rmdp-calendar");if(r){var t=r.querySelector("div[tabindex='0']");t&&t.getAttribute("class").includes("hidden")&&(t.setAttribute("tabindex","-1"),t=void 0),t||(t=r.querySelector("div[tabindex='-1']:not(.rmdp-day-hidden)"))&&t.setAttribute("tabindex","0")}}),200)}(r)},n="left"===e&&R||"right"===e&&A;return l instanceof Function?l(e,t,n):r.isValidElement(l)?r.cloneElement(l,{direction:e,handleClick:t,disabled:n}):o.default.createElement(P,{direction:"rmdp-".concat(e),onClick:t,disabled:n})}function B(e){s||e<0&&R||e>0&&A||(y?E.year+=e:C||M?(I+=12*e,e<0&&N&&I<N.year&&(I=N.year),e>0&&S&&I>S.year&&(I=S.year)):(E.toFirstOfMonth(),Y?E.year+=e:(E.month+=e,c(E))),n(u(u({},t),{},{date:E,year:I})))}function _(e){if(!s){var r={mustShowMonthPicker:!1,mustShowYearPicker:!1};r[e]=!t[e],n(u(u({},t),r))}}}function N(e){return b(e)||(e=[]),JSON.stringify(e)}function S(e){var t=e.state,n=e.onChange,a=e.customMonths,d=e.sort,l=e.handleMonthChange,c=e.handleFocusedDate,s=e.rangeHover,f=e.highlightToday,m=e.numberOfMonths,h=t.date,y=t.today,g=t.minDate,v=t.maxDate,w=t.calendar,E=t.locale,Y=t.onlyMonthPicker,M=t.onlyYearPicker,P=t.range,C=t.onlyShowInRangeDates,S=(t.mustShowMonthPicker||Y)&&!M,I=p(r.useState(),2),j=I[0],R=I[1];a=a&&N(a);var A=r.useMemo((function(){var e=[],r=Y?m:1,n=a&&JSON.parse(a),o=new i.default({calendar:w,locale:E,format:t.date._format,year:t.date.year,month:1,day:1});b(n)&&n.length>=12?(n.length=12,n=n.map((function(e){return b(e)?e[0]:e}))):n=o.locale.months.map((function(e){return p(e,1)[0]}));for(var d=0;d<r;d++){for(var l=[],u=0,c=0;c<4;c++){for(var s=[],f=0;f<3;f++)s.push({date:new i.default(o),name:n[u]}),u++,o.add(1,"month");l.push(s)}e.push(l)}return e}),[w,E,a,t.date.year,t.date._format,m,Y]);return o.default.createElement("div",{className:"".concat(Y?"only ":"","rmdp-month-picker"),style:{display:S?"flex":"none"},onMouseLeave:function(){return s&&R()}},A.map((function(e,r){return o.default.createElement("div",{key:r,style:{margin:"0 5px",flex:1}},e.map((function(e,r){return o.default.createElement("div",{key:r,className:"rmdp-ym"},e.map((function(e,r){var t=e.date,n=e.name;return o.default.createElement("div",{key:r,className:L(t),onClick:function(){return T(t)},onMouseEnter:function(){return s&&R(t)}},o.default.createElement("span",{className:Y?"sd":""},n))})))})))})));function T(e){var r=t.selectedDate,a=t.focused,o=e.year,i=e.monthIndex;if(!(g&&o<=g.year&&i<g.monthIndex||v&&o>=v.year&&i>v.monthIndex)){if(h.setMonth(i+1),Y){var s=p(k(e,d,t),2);r=s[0],a=s[1]}else l(h);n(Y?r:void 0,u(u({},t),{},{date:h,focused:a,selectedDate:r,mustShowMonthPicker:!1})),Y&&c(a,e)}}function L(e){var r=["rmdp-day"],n=e.year,a=e.monthIndex,o=t.selectedDate,d=t.multiple;if((g&&(n<g.year||n===g.year&&a<g.monthIndex)||v&&(n>v.year||n===v.year&&a>v.monthIndex))&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!C)return x(y,e,!0)&&f&&r.push("rmdp-today"),Y?P?(r.push(D(e,o,!0,d)),d||(r=r.concat(O(e,o,j,s,"month")))):[].concat(o).some((function(r){return x(r,e,!0)}))&&r.push("rmdp-selected"):h.monthIndex===a&&r.push("rmdp-selected"),r.join(" ")}}function I(e,r){return e.replace(/[0-9]/g,(function(e){return r[e]}))}function j(e){var t=e.state,n=e.onChange,a=e.sort,d=e.handleFocusedDate,l=e.onYearChange,c=e.rangeHover,s=e.highlightToday,f=t.date,m=t.today,h=t.minDate,y=t.maxDate,g=t.onlyYearPicker,v=t.range,x=t.onlyShowInRangeDates,w=t.year,D=t.mustShowYearPicker||g,O=f.digits,E=p(r.useState(),2),Y=E[0],M=E[1],P=m.year-4;P-=12*Math.ceil((P-w)/12);var C=r.useMemo((function(){for(var e=[],r=P,t=0;t<4;t++){for(var n=[],a=0;a<3;a++)n.push(r),r++;e.push(n)}return e}),[P]);return o.default.createElement("div",{className:"".concat(g?"only ":"","rmdp-year-picker"),style:{display:D?"block":"none"}},C.map((function(e,r){return o.default.createElement("div",{key:r,className:"rmdp-ym",onMouseLeave:function(){return c&&M()}},e.map((function(e,r){return o.default.createElement("div",{key:r,className:N(e),onClick:function(){return function(e){if(S(e))return;var r=new i.default(t.date).setYear(e),o=t.selectedDate,c=t.focused;if(g){var s=p(k(r,a,t),2);o=s[0],c=s[1]}else h&&r.monthIndex<h.monthIndex?r=r.setMonth(h.monthIndex+1):y&&r.monthIndex>y.monthIndex&&(r=r.setMonth(y.monthIndex+1)),null==l||l(r);n(g?o:void 0,u(u({},t),{},{date:r,focused:c,selectedDate:o,mustShowYearPicker:!1})),g&&d(c,r)}(e)},onMouseEnter:function(){return c&&M(e)}},o.default.createElement("span",{className:g?"sd":""},I(e.toString(),O)))})))})));function N(e){var r=["rmdp-day"],n=t.date,a=t.selectedDate,o=t.multiple;if(S(e)&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!x){if(m.year===e&&s&&r.push("rmdp-today"),g)if(v){var d=function(t){var n=t[0],a=t[1];if(1===t.length){if(e===n.year&&r.push("rmdp-range"),c){var o=t[0].year;(e>o&&e<=Y||e<o&&e>=Y)&&(r.push("rmdp-range-hover"),e===Y&&r.push(Y>o?"end":"start"))}}else 2===t.length&&(e>=n.year&&e<=a.year&&r.push("rmdp-range"),e===n.year&&r.push("start"),e===a.year&&r.push("end"))};o?(b(a)?a:[[a]]).forEach((function(e){return d(e)})):d(a)}else[].concat(a).some((function(r){return r&&r.year===e}))&&r.push("rmdp-selected");else e===n.year&&r.push("rmdp-selected");return r.join(" ")}}function S(e){return h&&e<h.year||y&&e>y.year}}function R(e,r,t){return t||(e?"MM/YYYY":r?"YYYY":"YYYY/MM/DD")}function A(e,r){return e instanceof i.default?e.setCalendar(r):e=new i.default({date:e,calendar:r}),e}function T(e){"_self"in o.default.createElement("div")&&console.warn(e.join("\n"))}var L=new i.default,F=L.calendar,W=L.locale;function B(e,r){return e&&e.constructor!==Object&&(T(_("calendar")),e=void 0),r&&r.constructor!==Object&&(T(_("locale")),r=void 0),[e||F,r||W]}function _(e){return["".concat(e," must be an object"),"https://shahabyazdi.github.io/react-multi-date-picker/calendars/"]}function V(e){return e&&e.name?e.name.split("_")[1]:""}function z(e){return["fa","ar"].includes(V(e))}function H(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}H(".rmdp-wrapper{background-color:#fff;border-radius:5px;direction:ltr;text-align:center;width:max-content}.rmdp-shadow{box-shadow:0 0 5px #8798ad}.rmdp-border{border:1px solid #cfd8e2}.rmdp-calendar{height:max-content;padding:4px}.rmdp-border-top{border-top:1px solid #cfd8e2}.rmdp-border-bottom{border-bottom:1px solid #cfd8e2}.rmdp-border-left{border-left:1px solid #cfd8e2}.rmdp-border-right{border-right:1px solid #cfd8e2}.rmdp-week,.rmdp-ym{display:flex;justify-content:space-between}.rmdp-ym{height:25%}.rmdp-day,.rmdp-week-day{color:#000;cursor:pointer;height:34px;position:relative;width:34px}.rmdp-week-day{color:#0074d9;cursor:default;font-size:13px;font-weight:500}.rmdp-day span,.rmdp-week-day{display:flex;flex-direction:column;justify-content:center}.rmdp-day span{border-radius:50%;bottom:3px;font-size:14px;left:3px;position:absolute;right:3px;top:3px}.rmdp-day.rmdp-today span{background-color:#7fdbff;color:#fff}.rmdp-day.rmdp-selected span:not(.highlight){background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-day.rmdp-deactive,.rmdp-day.rmdp-disabled{color:#8798ad}.rmdp-day.rmdp-deactive.rmdp-selected span{background-color:#4ca6f5;box-shadow:0 0 3px #bac5d3}.rmdp-ym .rmdp-day{flex:1;margin:auto}.rmdp-ym .rmdp-day span{border-radius:12px;padding:2px 0}.rmdp-range{background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-range-hover{background-color:#7ea6f0;color:#fff}.rmdp-range-hover.start,.rmdp-range.start{border-bottom-left-radius:50%;border-top-left-radius:50%}.rmdp-range-hover.end,.rmdp-range.end{border-bottom-right-radius:50%;border-top-right-radius:50%}.rmdp-ym .rmdp-range-hover.start,.rmdp-ym .rmdp-range.start{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-ym .rmdp-range-hover.end,.rmdp-ym .rmdp-range.end{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover{background-color:#7ea6f0;color:#fff}.rmdp-day-picker{padding:5px}.rmdp-header{font-size:14px;margin-top:5px;padding:9px 0}.rmdp-month-picker,.rmdp-year-picker{background-color:#fff;border-radius:0 0 5px 5px;bottom:2px;left:2px;position:absolute;right:2px;top:2px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:240px;position:static;width:240px}.rmdp-header-values{color:#000;margin:auto}.rmdp-header-values span{padding:0 0 0 5px}.rmdp-arrow{border:solid #0074d9;border-width:0 2px 2px 0;display:inline-block;height:3px;margin-top:5px;padding:2px;width:3px}.rmdp-right i{margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-left i{margin-left:3px;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-left{left:0}.rmdp-right{right:0}.rmdp-arrow-container{background:transparent;border:none;border-radius:50%;cursor:pointer;display:flex;height:20px;justify-content:center;margin:0 5px;padding:0;width:20px}.rmdp-arrow-container:hover{background-color:#0074d9;box-shadow:0 0 3px #8798ad}.rmdp-arrow-container:hover .rmdp-arrow{border:solid #fff;border-width:0 2px 2px 0}.rmdp-arrow-container.disabled{cursor:default}.rmdp-arrow-container.disabled:hover{background-color:inherit;box-shadow:inherit}.rmdp-arrow-container.disabled .rmdp-arrow,.rmdp-arrow-container.disabled:hover .rmdp-arrow{border:solid gray;border-width:0 2px 2px 0}.rmdp-rtl{direction:rtl}.rmdp-rtl .rmdp-left i{margin-left:0;margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-rtl .rmdp-right i{margin-left:3px;margin-right:0;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-rtl .rmdp-right{left:0;right:auto}.rmdp-rtl .rmdp-left{left:auto;right:0}.rmdp-rtl .rmdp-range-hover.start,.rmdp-rtl .rmdp-range.start{border-bottom-left-radius:unset;border-bottom-right-radius:50%;border-top-left-radius:unset;border-top-right-radius:50%}.rmdp-rtl .rmdp-range-hover.end,.rmdp-rtl .rmdp-range.end{border-bottom-left-radius:50%;border-bottom-right-radius:unset;border-top-left-radius:50%;border-top-right-radius:unset}.rmdp-rtl .rmdp-range.start.end{border-radius:50%}.rmdp-rtl .rmdp-ym .rmdp-range-hover.start,.rmdp-rtl .rmdp-ym .rmdp-range.start{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-rtl .rmdp-ym .rmdp-range-hover.end,.rmdp-rtl .rmdp-ym .rmdp-range.end{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-day-hidden,.rmdp-day.rmdp-disabled{cursor:default}.rmdp-selected .highlight{box-shadow:0 0 3px #8798ad}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-red:hover{background-color:#ff6687}.rmdp-day:not(.rmdp-deactive) .highlight-red{color:#cc0303}.rmdp-day.rmdp-deactive .highlight-red{color:#e08e8e}.rmdp-day.rmdp-selected .highlight-red{background-color:#ea0034;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-red{background-color:#e4b0ba;color:#fff}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-green:hover{background-color:#4db6ac}.rmdp-day:not(.rmdp-deactive) .highlight-green{color:#00796b}.rmdp-day.rmdp-deactive .highlight-green{color:#7ab3ac}.rmdp-day.rmdp-selected .highlight-green{background-color:#009688;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-green{background-color:#749c98;color:#fff}.rmdp-day-hidden,.rmdp-day-hidden:hover span{background-color:unset;color:transparent}.rmdp-month-name{cursor:default;font-size:14px;margin:3px 0}.rmdp-full-year{grid-template-columns:1fr 1fr 1fr}@media (max-height:450px),(max-width:450px){.rmdp-day,.rmdp-week-day{height:28px;width:28px}.rmdp-day span{font-size:12px;padding-left:.5px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:200px;width:230px}.rmdp-header{padding:3px 0 0}.rmdp-header,.rmdp-month-name{font-size:12px}.rmdp-full-year{grid-template-columns:1fr 1fr}}");var q=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","range","multiple","className","role","weekDays","months","children","onChange","showOtherDays","minDate","maxDate","mapDays","disableMonthPicker","disableYearPicker","formattingIgnoreList","onReady","onlyShowInRangeDates","zIndex","plugins","sort","numberOfMonths","currentDate","digits","buttons","renderButton","weekStartDayIndex","disableDayPicker","onPropsChange","onMonthChange","onYearChange","onFocusedDateChange","readOnly","disabled","hideMonth","hideYear","hideWeekDays","shadow","fullYear","displayWeekNumbers","weekNumber","weekPicker","rangeHover","monthYearSeparator","formatMonth","formatYear","highlightToday","headerOrder","style"],J=["datePickerProps","DatePicker"];function K(e,t){var n,a=e.value,d=e.calendar,l=e.locale,c=e.format,m=e.onlyMonthPicker,h=e.onlyYearPicker,y=e.range,g=void 0!==y&&y,v=e.multiple,x=void 0!==v&&v,w=e.className,k=e.role,D=e.weekDays,O=e.months,E=e.children,Y=e.onChange,P=e.showOtherDays,A=e.minDate,T=e.maxDate,L=e.mapDays,F=e.disableMonthPicker,W=e.disableYearPicker,_=e.formattingIgnoreList,V=e.onReady,H=e.onlyShowInRangeDates,K=void 0===H||H,U=e.zIndex,Q=void 0===U?100:U,X=e.plugins,Z=void 0===X?[]:X,ee=e.sort,re=e.numberOfMonths,te=void 0===re?1:re,ne=e.currentDate,ae=e.digits,oe=e.buttons,de=void 0===oe||oe,ie=e.renderButton,le=e.weekStartDayIndex,ue=void 0===le?0:le,ce=e.disableDayPicker,se=e.onPropsChange,fe=e.onMonthChange,pe=e.onYearChange,me=e.onFocusedDateChange,he=e.readOnly,ye=e.disabled,ge=e.hideMonth,be=e.hideYear,ve=e.hideWeekDays,xe=e.shadow,we=void 0===xe||xe,ke=e.fullYear,De=e.displayWeekNumbers,Oe=e.weekNumber,Ee=e.weekPicker,Ye=e.rangeHover,Me=e.monthYearSeparator,Pe=e.formatMonth,Ce=e.formatYear,Ne=e.highlightToday,Se=void 0===Ne||Ne,Ie=e.headerOrder,je=void 0===Ie?["LEFT_BUTTON","MONTH_YEAR","RIGHT_BUTTON"]:Ie,Re=e.style,Ae=void 0===Re?{}:Re;f(e,q),!ne||ne instanceof i.default||(console.warn("currentDate must be instance of DateObject"),ne=void 0),("number"!=typeof ue||ue<0||ue>6)&&(ue=0),("number"!=typeof te||te<1||h)&&(te=1),!(x||g||b(a))||g||x||(x=!0),Ee&&(g=!0,x=!1),ke&&(te=12,m=!1,h=!1),h&&!ge&&(ge=!0);var Te=B(d,l),Le=p(Te,2);d=Le[0],l=Le[1],c=R(m,h,c),_=N(_),L=[].concat(L).filter(Boolean),Z=[].concat.apply([],Z);var Fe=r.useState({}),We=p(Fe,2),Be=We[0],_e=We[1],Ve={},ze=r.useRef({mustCallOnReady:!0,currentDate:ne});r.useEffect((function(){_e((function(e){var r=ze.current.currentDate,t=e.date,n=e.selectedDate,o=e.initialValue,s=e.focused,f=e.mustSortDates;function p(e){if(e)return e.calendar.name!==d.name&&e.setCalendar(d),e.locale.name!==l.name&&e.setLocale(l),e._format!==c&&e.setFormat(c),e.digits=ae,e.ignoreList=JSON.parse(_),e}function y(e){return new i.default(r||e)}if(a)if(b(n=G(a,d,l,c)))t||(t=y(n.flat()[0]));else if(t&&1!==te){var v=new i.default(t).toFirstOfMonth(),w=new i.default(t).add(te-1,m?"years":"months").toLastOfMonth();(n<v||n>w)&&(t=new i.default(n))}else t=y(n);else t||(t=y({calendar:d,locale:l,format:c})),o&&(n=void 0);if([].concat(n).flat().forEach(p),p(t),x||g||b(a)){if(n||(n=[]),b(n)||(n=x&&g?[[n]]:[n]),g&&!x&&n.length>2){var k=n[n.length-1];n=[n[0],k],s=k}x&&!g&&ee&&!f?(f=!0,n.sort((function(e,r){return e-r}))):g&&!x&&n.sort((function(e,r){return e-r}))}else b(n)&&(n=n.flat()[n.length-1]);return ke&&t.toFirstOfYear(),delete ze.current.currentDate,u(u({},e),{},{date:t,selectedDate:n,multiple:x,range:g,onlyMonthPicker:m,onlyYearPicker:h,initialValue:e.initialValue||a,value:a,focused:s,calendar:d,locale:l,format:c,mustSortDates:f,year:t.year,today:p(e.today)||new i.default({calendar:d}),weekPicker:Ee})}))}),[a,d,l,c,m,h,g,x,ee,te,ae,_,ke,Ee]),r.useEffect((function(){(A||T)&&_e((function(e){var r=e.calendar,t=e.locale,n=e.format,o=p($(G(a,r,t,n),A,T,r),3),d=o[0],i=o[1],l=o[2];return u(u({},e),{},{inRangeDates:K?d:e.selectedDate,minDate:i,maxDate:l})}))}),[A,T,K,a]),Be.today&&!ze.current.isReady&&(ze.current.isReady=!0),r.useEffect((function(){ze.current.isReady&&ze.current.mustCallOnReady&&V instanceof Function&&(ze.current.mustCallOnReady=!1,V())}),[ze.current.isReady,V]);var He="rmdp-top-class "+nr(["top","bottom"]),qe={top:[],bottom:[],left:[],right:[]},Je=z(null===(n=Be.date)||void 0===n?void 0:n.locale),Ke={state:Be,setState:_e,onChange:Ze,sort:ee,handleFocusedDate:rr,isRTL:Je,fullYear:ke,monthAndYears:dr(),rangeHover:Ye,highlightToday:Se,numberOfMonths:te},Ue=arguments[0],$e=Ue.datePickerProps,Ge=Ue.DatePicker,Qe=f(Ue,J);return Xe(),Be.today?o.default.createElement("div",{ref:or,role:k||"dialog",className:"rmdp-wrapper rmdp-".concat(we?"shadow":"border"," ").concat(w||""),style:u({zIndex:Q},Ae)},qe.top,o.default.createElement("div",{style:{display:"flex"},className:He},qe.left,!ce&&o.default.createElement("div",{className:"rmdp-calendar ".concat(Je?"rmdp-rtl":""," ").concat(nr(["left","right"]))},o.default.createElement(C,u(u({},Ke),{},{disableYearPicker:W,disableMonthPicker:F,buttons:de,renderButton:ie,handleMonthChange:tr,disabled:ye,hideMonth:ge,hideYear:be,monthYearSeparator:Me,formatMonth:Pe,formatYear:Ce,headerOrder:je})),o.default.createElement("div",{style:{position:"relative"}},o.default.createElement(M,u(u({},Ke),{},{showOtherDays:P,mapDays:L,onlyShowInRangeDates:K,customWeekDays:D,weekStartDayIndex:ue,hideWeekDays:ve,displayWeekNumbers:De,weekNumber:Oe})),!ke&&o.default.createElement(o.default.Fragment,null,!F&&o.default.createElement(S,s({},Ke,{customMonths:O,handleMonthChange:tr})),!W&&o.default.createElement(j,s({},Ke,{onYearChange:pe}))))),qe.right),qe.bottom,E):null;function Xe(){if(ze.current.isReady&&b(Z)){var e={state:Be,setState:_e,registerListener:ar,calendarProps:Qe,datePickerProps:$e,handleChange:Ze,Calendar:ze.current.Calendar,DatePicker:Ge,handlePropsChange:er,handleFocusedDate:function(e){return rr(e)}},t=function(e){return ce?"bottom":e.props.position||"right"};Z.forEach((function(n,a){if("string"!=typeof n.type){var o={},d=t(n);if(qe[d]&&!n.props.disabled){for(var i=0;i<Z.length;i++)if("string"!=typeof Z[i].type&&!Z[i].props.disabled){if(4===Object.keys(o).length)break;var l=t(Z[i]);["top","bottom"].includes(d)?(l===d&&i>a&&(o.bottom=!0),l===d&&i<a&&(o.top=!0)):(He.includes("border-top")&&(o.top=!0),He.includes("border-bottom")&&(o.bottom=!0),l===d&&i>a&&(o.right=!0),l===d&&i<a&&(o.left=!0))}qe[d].push(r.cloneElement(n,u({key:a,position:d,nodes:o},e)))}}else"mapDays"===n.type&&L.push(n.fn(e))}))}}function Ze(e,r){if(!ye){if(e||null===e){if(he)return;Ve.change&&Ve.change.forEach((function(r){return r(e)}))}if(e||null===e){var t=null==Y?void 0:Y(e);r&&!1!==t&&_e(r)}else r&&_e(r);er({value:e})}}function er(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!he&&!ye){var t=u(u(u(u({},Qe),$e),r),{},{value:null!==(e=r.value)&&void 0!==e?e:Be.selectedDate});delete t.onPropsChange,null==se||se(t)}}function rr(e,r){he||ye||null==me||me(e,r)}function tr(e){null==fe||fe(e)}function nr(e){return ce||!b(Z)?"":Array.from(new Set(Z.map((function(r){if(!r.props)return"";var t=r.props.position||"right";return e.includes(t)&&!r.props.disabled?"rmdp-border-"+t:""})))).join(" ")}function ar(e,r){Ve[e]||(Ve[e]=[]),Ve[e].push(r)}function or(e){if(e&&(e.date=Be.date,e.set=function(e,r){ye||_e(u(u({},Be),{},{date:new i.default(Be.date.set(e,r))}))}),ze.current.Calendar=e,t instanceof Function)return t(e);t&&(t.current=e)}function dr(){var e=Be.date;if(!e)return[];for(var r=[],t=[],n=e.digits,a=0;a<te;a++){var o=void 0,d=e.year,i=e.monthIndex+a;if(m&&(d+=a),i>11&&(i-=12,m||d++),b(O)&&O.length>=12){var l=O[i];o=b(l)?l[0]:l}else o=e.months[i].name;d=I(d.toString(),n),r.push(o),t.push(d)}return[r,t]}}var U=r.forwardRef(K);function $(e,r,t,n){return r&&(r=A(r,n).set({hour:0,minute:0,second:0,millisecond:0})),t&&(t=A(t,n).set({hour:23,minute:59,second:59,millisecond:999})),b(e)&&(e=e.filter((function(e){return!(r&&e<r)&&!(t&&e>t)}))),[e,r,t]}function G(e,r,t,n){var a=[].concat(e).map((function(e){return b(e)?e.map(o).filter(d):o(e)})).filter(d);return b(e)?a:a.flat()[0];function o(e){return e?e instanceof i.default?e:new i.default({date:e,calendar:r,locale:t,format:n}):{}}function d(e){return b(e)||e.isValid}}H('.rmdp-visible{visibility:visible}.rmdp-invisible{visibility:hidden}.rmdp-input{border:1px solid #c0c4d6;border-radius:5px;height:22px;margin:1px 0;padding:2px 5px}.rmdp-input:focus{border:1px solid #a4b3c5;box-shadow:0 0 2px #a4b3c5;outline:none!important}.rmdp-button{background-color:#0074d9;border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-block;padding:7px 16px;text-align:center;text-decoration:none;transition:.3s}.rmdp-button:hover{background-color:#143ac5;transition:.4s}.rmdp-button:disabled{background-color:#8798ad}.rmdp-action-button{border-radius:unset;color:#2682d3;float:right;font-weight:700;margin:15px 10px 15px 0}.rmdp-action-button,.rmdp-action-button:hover{background-color:transparent}.rmdp-ep-arrow{overflow:hidden;will-change:transform}.rmdp-ep-arrow:after{background-color:#fff;content:"";height:12px;position:absolute;transform:rotate(45deg);width:12px}.rmdp-ep-shadow:after{box-shadow:0 0 6px #8798ad}.rmdp-ep-border:after{border:1px solid #cfd8e2}.rmdp-ep-arrow[direction=top]{border-bottom:1px solid #fff}.rmdp-ep-arrow[direction=left]{border-right:1px solid #fff}.rmdp-ep-arrow[direction=right]{border-left:1px solid #fff;margin-left:-1px}.rmdp-ep-arrow[direction=bottom]{border-top:1px solid #fff;margin-top:-1.5px}.rmdp-ep-arrow[direction=top]:after{left:4px;top:5px}.rmdp-ep-arrow[direction=bottom]:after{left:4px;top:-6px}.rmdp-ep-arrow[direction=left]:after{left:5px;top:3px}.rmdp-ep-arrow[direction=right]:after{left:-6px;top:3px}');var Q=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","onChange","range","multiple","name","id","title","placeholder","required","style","className","inputClass","disabled","render","weekDays","months","children","inputMode","scrollSensitive","hideOnScroll","minDate","maxDate","formattingIgnoreList","containerClassName","calendarPosition","editable","onOpen","onClose","arrowClassName","zIndex","arrow","fixMainPosition","onPositionChange","onPropsChange","digits","readOnly","shadow","onFocusedDateChange","type","weekPicker","mobileLabels","onOpenPickNewDate","mobileButtons","dateSeparator","multipleRangeSeparator"],X=["label"];function Z(e,t){var n=e.value,a=e.calendar,l=e.locale,c=e.format,m=e.onlyMonthPicker,h=e.onlyYearPicker,y=e.onChange,v=e.range,x=void 0!==v&&v,w=e.multiple,k=void 0!==w&&w,D=e.name,O=e.id,E=e.title,Y=e.placeholder,M=e.required,P=e.style,C=void 0===P?{}:P,S=e.className,j=void 0===S?"":S,A=e.inputClass,T=e.disabled,L=e.render,F=e.weekDays,W=e.months,_=e.children,H=e.inputMode,q=e.scrollSensitive,J=void 0===q||q,K=e.hideOnScroll,$=e.minDate,G=e.maxDate,Z=e.formattingIgnoreList,ee=e.containerClassName,ne=void 0===ee?"":ee,ae=e.calendarPosition,oe=void 0===ae?"bottom-left":ae,de=e.editable,ie=void 0===de||de,le=e.onOpen,ue=e.onClose,ce=e.arrowClassName,se=void 0===ce?"":ce,fe=e.zIndex,pe=void 0===fe?100:fe,me=e.arrow,he=void 0===me||me,ye=e.fixMainPosition,ge=e.onPositionChange,be=e.onPropsChange,ve=e.digits,xe=e.readOnly,we=e.shadow,ke=void 0===we||we,De=e.onFocusedDateChange,Oe=e.type,Ee=e.weekPicker,Ye=e.mobileLabels,Me=e.onOpenPickNewDate,Pe=void 0===Me||Me,Ce=e.mobileButtons,Ne=void 0===Ce?[]:Ce,Se=e.dateSeparator,Ie=e.multipleRangeSeparator,je=void 0===Ie?",":Ie,Re=f(e,Q),Ae=r.useState(),Te=p(Ae,2),Le=Te[0],Fe=Te[1],We=r.useState(),Be=p(We,2),_e=Be[0],Ve=Be[1],ze=r.useState(""),He=p(ze,2),qe=He[0],Je=He[1],Ke=r.useState(!1),Ue=p(Ke,2),$e=Ue[0],Ge=Ue[1],Qe=r.useState(!1),Xe=p(Qe,2),Ze=Xe[0],er=Xe[1],rr=r.useRef(),tr=r.useRef(),nr=r.useRef(),ar=r.useRef({}),or=Se||(x||Ee?" ~ ":", "),dr=arguments[0],ir=hr(),lr=r.useCallback((function(){if(!1!==(null==ue?void 0:ue())){var e=te(tr);if(e&&e.forEach((function(e){return e.blur()})),ar.current.mobile){var r=nr.current.parentNode.parentNode;r.classList.remove("rmdp-calendar-container-mobile"),r.style.position="absolute",r.style.visibility="hidden"}Ge(!1),er(!1)}}),[ue]),ur=[{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){Ve(void 0),lr()},label:gr("CANCEL")},{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){_e&&(xr(_e,!0),Ve(void 0)),lr()},label:gr("OK")}];ir&&!ar.current.mobile&&(ar.current=u(u({},ar.current),{},{mobile:!0})),!ir&&ar.current.mobile&&(ar.current=u(u({},ar.current),{},{mobile:!1})),Z=N(Z),c=R(m,h,c);var cr=B(a,l),sr=p(cr,2);return a=sr[0],l=sr[1],r.useEffect((function(){function e(e){if($e&&!ar.current.mobile){var r=[];if([tr.current,nr.current].forEach((function(t){!t||t.contains(e.target)||e.target.classList.contains("b-deselect")||e.target.parentNode.classList.contains("b-deselect")||r.push(t)})),2===r.length)return lr();nr.current&&nr.current.contains(e.target)&&(rr.current.removeTransition(),rr.current.refreshPosition())}}function r(){K&&$e&&lr()}return document.addEventListener("click",e,!1),document.addEventListener("scroll",r,!0),function(){document.removeEventListener("click",e,!1),document.removeEventListener("scroll",r,!0)}}),[lr,t,$e,K]),r.useEffect((function(){var e=n,r=ar.current,t=r.date,o=r.initialValue,d=function(){return e[e.length-1]};function s(e){if(e)return e instanceof i.default||(e=new i.default({date:e,calendar:a,locale:l,format:c})),e.calendar!==a&&e.setCalendar(a),e.set({weekDays:F,months:W,digits:ve,locale:l,format:c,ignoreList:JSON.parse(Z)}),e}n||o||!t?o&&!n&&(o=void 0):e=t;var f="";if(x||k||b(e)){var m=function(e){return e=e.map(s).filter((function(e){return void 0!==e})),x&&e.length>2&&(e=[e[0],d()]),[e,re(e,or)]};if(b(e)||(e=x&&k?e?[[e]]:[]:[e]),k&&x)e=e.map((function(r,t){var n=p(m(b(r)?r:[r]),2),a=n[0],o=n[1];return f+=o+(t<e.length-1?" ".concat(je," "):""),a}));else{var h=p(m(e),2);e=h[0],f=h[1]}f=f.toString().replace(/\s,\s$/,"")}else b(e)&&(e=d()),(e=s(e))&&(f=e.format());te(tr).every((function(e){return document.activeElement!==e}))&&Je(f),ar.current=u(u({},ar.current),{},{date:e,separator:or,initialValue:o||n}),ar.current.mobile&&rr.current.isOpen?Ve(e):Fe(e)}),[n,a,l,c,x,k,or,m,h,F,W,ve,Z]),r.useEffect((function(){var e=ar.current.selection;if(e){var r=te(tr);0!==r.length&&(r.forEach((function(r){document.activeElement===r&&(r.setSelectionRange(e,e),ar.current.selection=void 0)})),rr.current.refreshPosition())}}),[qe]),(k||x||b(Le)||!ie)&&(H="none"),o.default.createElement(d.default,s({ref:fr,element:pr(),popper:$e&&mr(),active:!ir&&Ze,position:oe,arrow:!ir&&he,fixMainPosition:!J||ye,zIndex:pe,onChange:!ir&&ge,containerClassName:"rmdp-container ".concat(ne),arrowClassName:["rmdp-ep-arrow","rmdp-ep-".concat(ke?"shadow":"border"),j,se].join(" ")},Re));function fr(e){if(e&&(e.openCalendar=function(){return setTimeout((function(){return br()}),10)},e.closeCalendar=lr,e.isOpen=$e&&Ze),rr.current=e,t instanceof Function)return t(e);t&&(t.current=e)}function pr(){return L?o.default.createElement("div",{ref:tr},r.isValidElement(L)?r.cloneElement(L,{value:qe,openCalendar:br,onFocus:br,handleValueChange:wr,onChange:wr,locale:l,separator:or}):L instanceof Function?L(qe,br,wr,l,or):null):o.default.createElement("input",{ref:tr,type:Oe||"text",name:D,id:O,title:E,required:M,onFocus:br,className:A||"rmdp-input",placeholder:Y,value:qe,onChange:wr,style:C,autoComplete:"off",disabled:!!T,inputMode:H||(ir?"none":void 0),readOnly:xe})}function mr(){return o.default.createElement(U,s({ref:nr,value:_e||Le,onChange:xr,range:x,multiple:k,calendar:a,locale:l,format:c,onlyMonthPicker:m,onlyYearPicker:h,className:j+(ir?" rmdp-mobile":""),weekDays:F,months:W,digits:ve,minDate:$,maxDate:G,formattingIgnoreList:JSON.parse(Z),onPropsChange:be,shadow:ke,onReady:kr,DatePicker:rr.current,datePickerProps:dr,onFocusedDateChange:Dr,weekPicker:Ee},Re),_,ir&&yr())}function hr(){return"string"==typeof j&&j.includes("rmdp-mobile")}function yr(){var e=[].concat.apply([],dr.plugins||[]).some((function(e){var r=e.props;return!(void 0===r?{}:r).disabled}));return b(Ne)&&o.default.createElement("div",{className:"rmdp-action-buttons ".concat(z(l)?"rmdp-rtl":""," ").concat(e?"rmdp-border-top":"")},Ne.concat(ur).map((function(e,r){var t=e.label,n=f(e,X);return o.default.createElement("button",s({key:r},n),t)})))}function gr(e){var r,t=l||(new i.default).locale;if("string"!=typeof t.name)return e;return(null==Ye?void 0:Ye[e])||(null===(r={en:{OK:"OK",CANCEL:"CANCEL"},fa:{OK:"تأیید",CANCEL:"لغو"},ar:{OK:"تأكيد",CANCEL:"الغاء"},hi:{OK:"पुष्टि",CANCEL:"रद्द करें"}}[V(t)])||void 0===r?void 0:r[e])||e}function br(){if(!T&&!xe&&!1!==(null==le?void 0:le())){if(vr()){var e=new i.default({calendar:a,locale:l,format:c,months:W,weekDays:F,digits:ve,ignoreList:JSON.parse(Z)});(!$||e>$)&&(!G||e<G)&&(xr(e),null==be||be(u(u({},dr),{},{value:e})),ar.current.date=e)}var r=te(tr);ir&&r.length>0&&r.forEach((function(e){return e.blur()})),r.length>0||!$e?Ge(!0):lr()}}function vr(){return Pe&&!n&&!ar.current.date&&!x&&!k&&!ir}function xr(e,r,t){if(ir&&!r)return Ve(e);var n="";if(e&&(n=k&&x&&b(e)?e.map((function(e){return re(e,or)})).join(" ".concat(je," ")):re(e,or)),!1===(null==y?void 0:y(e,{validatedValue:n,input:tr.current,isTyping:!!t})))return Je(qe),!1;Fe(e),Je(t||n.toString().replace(/\s,\s$/,"")),ar.current=u(u({},ar.current),{},{date:e})}function wr(e){if(ie){ar.current.selection=e.target.selectionStart;var r=e.target.value,t={calendar:a,locale:l,format:c,ignoreList:JSON.parse(Z)};if(ve=b(ve)?ve:l.digits,!r)return Je(""),xr(null);if(ve){var n,o,d=g(ve);try{for(d.s();!(n=d.n()).done;){var s=n.value;r=r.replace(new RegExp(s,"g"),ve.indexOf(s))}}catch(e){d.e(e)}finally{d.f()}o=b(Le)?k&&x?(r||"").split(je).filter(Boolean).map(p):p(r):f(r),xr(b(Le)||o.isValid?o:null,void 0,I(r,ve))}}function f(e){return/(?=.*Y)(?=.*M)(?=.*D)/.test(c)?new i.default(u(u({},t),{},{date:e})):new i.default(t).parse(e)}function p(e){return(e||"").split(or).filter(Boolean).map((function(e){return f(e.trim())}))}}function kr(){if(er(!0),ir){var e=nr.current.parentNode.parentNode;e.className="rmdp-calendar-container-mobile",e.style.position="fixed",e.style.transform="",setTimeout((function(){e.style.visibility="visible"}),50)}}function Dr(e,r){b(ar.current.date)||!r||ir||lr(),null==De||De(e,r)}}var ee=r.forwardRef(Z);function re(e,r){var t=[].concat(e).map((function(e){return null!=e&&e.isValid?e.format():""}));return t.toString=function(){return this.filter(Boolean).join(r)},t}function te(e){return e.current?"INPUT"===e.current.tagName?[e.current]:Array.from(e.current.querySelectorAll("input")):[]}e.Calendar=U,e.DatePicker=ee,e.getAllDatesInRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var t=e[0],n=e[e.length-1],a=[];if(!(t instanceof i.default&&n instanceof i.default&&t.isValid&&n.isValid&&!(t>n)))return[];for(t=new i.default(t),n=new i.default(n);t<=n;t.day++)a.push(r?t.toDate():new i.default(t));return a},e.toDateObject=A,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-date-object")):"function"==typeof define&&define.amd?define(["react","react-date-object"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).DatePanel=t(e.React,e.DateObject)}(this,(function(e,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e),o=r(t);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function p(e){return Array.isArray(e)}function u(e,t){var r=[];return["left","right"].includes(e)?(t.left&&r.push("rmdp-border-left"),t.right&&r.push("rmdp-border-right")):(t.top&&r.push("rmdp-border-top"),t.bottom&&r.push("rmdp-border-bottom")),r.join(" ")}var s=["state","setState","position","registerListener","calendarProps","datePickerProps","handleChange","nodes","Calendar","DatePicker","handlePropsChange","handleFocusedDate"];!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".rmdp-panel{min-width:125px}.rmdp-panel-body{left:0;list-style:none;margin:0;overflow:auto;padding:0 5px;position:absolute;right:0;text-align:center}.rmdp-panel-body li{border-radius:3px;box-shadow:0 0 2px #8798ad;margin:4px 1px;overflow:hidden;position:relative}.rmdp-panel-body li,.rmdp-panel-body li.bg-blue{background-color:#0074d9}.rmdp-panel-body li.bg-red{background-color:#ea0034}.rmdp-panel-body li.bg-green{background-color:#009688}.rmdp-panel-body li.bg-yellow{background-color:#fad817}.rmdp-panel-body li.rmdp-focused{box-shadow:0 0 2px 1px #8798ad}.rmdp-panel-body li button{color:#fff;cursor:pointer}.rmdp-panel-body li .b-deselect{background-color:#0074d9;border:none;font-size:17px}.rmdp-panel-body li .b-deselect span{display:block;transform:rotate(45deg)}.rmdp-panel-body li div{display:grid;flex:1}.rmdp-panel-body li .b-date{background-color:transparent;border:none;font-size:14px;padding:4px}.rmdp-panel-header{color:#000;font-size:14px;height:38px;line-height:37px;margin-bottom:5px;margin-top:8px}.rmdp-panel-body::-webkit-scrollbar{height:7px;width:7px}.rmdp-panel-body::-webkit-scrollbar-thumb{background:#0074d9;border-radius:3px}.rmdp-panel-body::-webkit-scrollbar-thumb:hover{background:#0263b8}.rmdp-rtl .rmdp-panel-body li .b-deselect{left:5px;right:unset}.rmdp-flat .rmdp-panel-header{border-bottom:none;margin-top:8px}.rmdp-flat .rmdp-panel-body li{border-radius:0}@media (max-height:400px),(max-width:400px){.rmdp-panel{min-width:103px}.rmdp-panel-body{padding:0 2px}.rmdp-panel-body li{font-size:12px;margin:4px}.rmdp-panel-header{font-size:12px;height:32px;line-height:32px}.rmdp-panel-body span{font-size:12px}}");var f=["state","setState","position","nodes","handleChange","eachDaysInRange","sort","style","className","onClickDate","removeButton","header","markFocused","focusedClassName","handleFocusedDate","formatFunction"];return function(e){var t=e.state,r=e.setState,a=e.position,l=e.nodes,m=e.handleChange,b=e.eachDaysInRange,h=e.sort,y=e.style,g=void 0===y?{}:y,v=e.className,x=void 0===v?"":v,O=e.onClickDate,w=e.removeButton,k=void 0===w||w,j=e.header,P=e.markFocused,D=e.focusedClassName,C=void 0===D?"":D,E=e.handleFocusedDate,N=e.formatFunction,S=c(e,f),F=[],T=t.multiple,z=t.range,A=t.inRangeDates,R=t.selectedDate,B=t.date.locale,I=["rmdp-panel",a,u(a,l)];if(B=B.name.split("_")[1],T||z&&!b)F=(A||R).map((function(e,t){return p(e)?e.map((function(e){return{date:e,format:e.format(),index:t}})):{date:e,format:e.format(),index:t}}));else if(z&&b){var q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var r=e[0],n=e[e.length-1],a=[];if(!(r instanceof o.default&&n instanceof o.default&&r.isValid&&n.isValid)||r>n)return[];for(r=new o.default(r),n=new o.default(n);r<=n;r.day++)a.push(t?r.toDate():new o.default(r));return a}(A||R);F=q.map((function(e,t){return{date:0===t||t===q.length-1?e:void 0,format:e.format(),index:t}}))}else R&&!p(R)&&(F=[{date:R,format:R.format(),index:0}]);return T&&"date"===h&&F.sort((function(e,t){return e.date-t.date})),T&&"color"===h&&F.every((function(e){return e.date.color}))&&F.sort((function(e,t){return e.date.color<t.date.color?-1:e.date.color>t.date.color?1:0})),["fa","ar"].includes(function(e){return e&&e.name?e.name.split("_")[1]:""}(B))&&I.push("rmdp-rtl"),n.default.createElement("div",i({className:"".concat(I.join(" ")," ").concat(x),style:d({display:"grid",gridTemplateRows:"auto 1fr"},g)},function(e){return e.state,e.setState,e.position,e.registerListener,e.calendarProps,e.datePickerProps,e.handleChange,e.nodes,e.Calendar,e.DatePicker,e.handlePropsChange,e.handleFocusedDate,c(e,s)}(S)),n.default.createElement("div",{className:"rmdp-panel-header"},j||{en:"Dates",fa:"تاریخ ها",ar:"تواریخ",hi:"खजूर"}[B]),n.default.createElement("div",{style:{position:"relative",overflow:"auto",height:["top","bottom"].includes(a)?"100px":""}},n.default.createElement("ul",{className:"rmdp-panel-body"},p(F)&&F.map((function(e,a){var l,i,c,u,s,f=p(e)?e[0]:e;return n.default.createElement("li",{key:a,style:{display:"flex"},className:"".concat(null!==(l=e.date)&&void 0!==l&&l.color?"bg-".concat(e.date.color):""," ").concat(P&&(null===(i=e.date)||void 0===i||null===(c=i.valueOf)||void 0===c?void 0:c.call(i))===(null===(u=t.focused)||void 0===u||null===(s=u.valueOf)||void 0===s?void 0:s.call(u))?C||"rmdp-focused":"")},n.default.createElement("div",null,[e].flat().map((function(e,a){return n.default.createElement("button",{key:a,type:"button",className:"b-date",onClick:function(){return function(e,n){if(L(e?R[n]:void 0),!e)return;r(d(d({},t),{},{date:new o.default(e),focused:T&&z?e:R[n]})),E(R[n])}(e.date,e.index)},style:{cursor:e.date?"pointer":"default"}},N?N(e):e.format)}))),f&&k&&n.default.createElement("button",{type:"button",ariaDescription:"The date ".concat(e.format," has been selected. Click to deselect it."),className:"b-deselect",onClick:function(){return function(e){var r,n;T&&z?(n=R[e].some((function(e){return e===t.focused}))?void 0:t.focused,r=R.filter((function(t,r){return r!==e}))):z||T?n=(r=R.filter((function(t,r){return r!==e}))).find((function(e){var r,n;return e.valueOf()===(null===(r=t.focused)||void 0===r||null===(n=r.valueOf)||void 0===n?void 0:n.call(r))})):(r=null,n=void 0);m(r,d(d({},t),{},{selectedDate:r,focused:n})),L(),E(n)}(f.index)}},n.default.createElement("span",null,"+")))})))));function L(e){O instanceof Function&&O(e)}}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-date-object")):"function"==typeof define&&define.amd?define(["react","react-date-object"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).DatePanel=t(e.React,e.DateObject)}(this,(function(e,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e),o=r(t);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function p(e){return Array.isArray(e)}function u(e,t){var r=[];return["left","right"].includes(e)?(t.left&&r.push("rmdp-border-left"),t.right&&r.push("rmdp-border-right")):(t.top&&r.push("rmdp-border-top"),t.bottom&&r.push("rmdp-border-bottom")),r.join(" ")}var s=["state","setState","position","registerListener","calendarProps","datePickerProps","handleChange","nodes","Calendar","DatePicker","handlePropsChange","handleFocusedDate"];!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".rmdp-panel{min-width:125px}.rmdp-panel-body{left:0;list-style:none;margin:0;overflow:auto;padding:0 5px;position:absolute;right:0;text-align:center}.rmdp-panel-body li{border-radius:3px;box-shadow:0 0 2px #8798ad;margin:4px 1px;overflow:hidden;position:relative}.rmdp-panel-body li,.rmdp-panel-body li.bg-blue{background-color:#0074d9}.rmdp-panel-body li.bg-red{background-color:#ea0034}.rmdp-panel-body li.bg-green{background-color:#009688}.rmdp-panel-body li.bg-yellow{background-color:#fad817}.rmdp-panel-body li.rmdp-focused{box-shadow:0 0 2px 1px #8798ad}.rmdp-panel-body li button{color:#fff;cursor:pointer}.rmdp-panel-body li .b-deselect{background-color:#0074d9;border:none;font-size:17px}.rmdp-panel-body li .b-deselect span{display:block;transform:rotate(45deg)}.rmdp-panel-body li div{display:grid;flex:1}.rmdp-panel-body li .b-date{background-color:transparent;border:none;font-size:14px;padding:4px}.rmdp-panel-header{color:#000;font-size:14px;height:38px;line-height:37px;margin-bottom:5px;margin-top:8px}.rmdp-panel-body::-webkit-scrollbar{height:7px;width:7px}.rmdp-panel-body::-webkit-scrollbar-thumb{background:#0074d9;border-radius:3px}.rmdp-panel-body::-webkit-scrollbar-thumb:hover{background:#0263b8}.rmdp-rtl .rmdp-panel-body li .b-deselect{left:5px;right:unset}.rmdp-flat .rmdp-panel-header{border-bottom:none;margin-top:8px}.rmdp-flat .rmdp-panel-body li{border-radius:0}@media (max-height:400px),(max-width:400px){.rmdp-panel{min-width:103px}.rmdp-panel-body{padding:0 2px}.rmdp-panel-body li{font-size:12px;margin:4px}.rmdp-panel-header{font-size:12px;height:32px;line-height:32px}.rmdp-panel-body li .b-date,.rmdp-panel-body span{font-size:12px}}");var f=["state","setState","position","nodes","handleChange","eachDaysInRange","sort","style","className","onClickDate","removeButton","header","markFocused","focusedClassName","handleFocusedDate","formatFunction"];return function(e){var t=e.state,r=e.setState,a=e.position,l=e.nodes,m=e.handleChange,b=e.eachDaysInRange,h=e.sort,y=e.style,g=void 0===y?{}:y,v=e.className,x=void 0===v?"":v,O=e.onClickDate,w=e.removeButton,k=void 0===w||w,j=e.header,P=e.markFocused,D=e.focusedClassName,C=void 0===D?"":D,E=e.handleFocusedDate,N=e.formatFunction,S=c(e,f),F=[],T=t.multiple,z=t.range,A=t.inRangeDates,R=t.selectedDate,B=t.date.locale,I=["rmdp-panel",a,u(a,l)];if(B=B.name.split("_")[1],T||z&&!b)F=(A||R).map((function(e,t){return p(e)?e.map((function(e){return{date:e,format:e.format(),index:t}})):{date:e,format:e.format(),index:t}}));else if(z&&b){var q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var r=e[0],n=e[e.length-1],a=[];if(!(r instanceof o.default&&n instanceof o.default&&r.isValid&&n.isValid)||r>n)return[];for(r=new o.default(r),n=new o.default(n);r<=n;r.day++)a.push(t?r.toDate():new o.default(r));return a}(A||R);F=q.map((function(e,t){return{date:0===t||t===q.length-1?e:void 0,format:e.format(),index:t}}))}else R&&!p(R)&&(F=[{date:R,format:R.format(),index:0}]);return T&&"date"===h&&F.sort((function(e,t){return e.date-t.date})),T&&"color"===h&&F.every((function(e){return e.date.color}))&&F.sort((function(e,t){return e.date.color<t.date.color?-1:e.date.color>t.date.color?1:0})),["fa","ar"].includes(function(e){return e&&e.name?e.name.split("_")[1]:""}(B))&&I.push("rmdp-rtl"),n.default.createElement("div",i({className:"".concat(I.join(" ")," ").concat(x),style:d({display:"grid",gridTemplateRows:"auto 1fr"},g)},function(e){return e.state,e.setState,e.position,e.registerListener,e.calendarProps,e.datePickerProps,e.handleChange,e.nodes,e.Calendar,e.DatePicker,e.handlePropsChange,e.handleFocusedDate,c(e,s)}(S)),n.default.createElement("div",{className:"rmdp-panel-header"},j||{en:"Dates",fa:"تاریخ ها",ar:"تواریخ",hi:"खजूर"}[B]),n.default.createElement("div",{style:{position:"relative",overflow:"auto",height:["top","bottom"].includes(a)?"100px":""}},n.default.createElement("ul",{className:"rmdp-panel-body"},p(F)&&F.map((function(e,a){var l,i,c,u,s,f=p(e)?e[0]:e;return n.default.createElement("li",{key:a,style:{display:"flex"},className:"".concat(null!==(l=e.date)&&void 0!==l&&l.color?"bg-".concat(e.date.color):""," ").concat(P&&(null===(i=e.date)||void 0===i||null===(c=i.valueOf)||void 0===c?void 0:c.call(i))===(null===(u=t.focused)||void 0===u||null===(s=u.valueOf)||void 0===s?void 0:s.call(u))?C||"rmdp-focused":"")},n.default.createElement("div",null,[e].flat().map((function(e,a){return n.default.createElement("button",{key:a,type:"button",className:"b-date",onClick:function(){return function(e,n){if(L(e?R[n]:void 0),!e)return;r(d(d({},t),{},{date:new o.default(e),focused:T&&z?e:R[n]})),E(R[n])}(e.date,e.index)},style:{cursor:e.date?"pointer":"default"}},N?N(e):e.format)}))),f&&k&&n.default.createElement("button",{type:"button","aria-roledescription":"The date ".concat(e.format," has been selected. Click to deselect it."),className:"b-deselect",onClick:function(){return function(e){var r,n;T&&z?(n=R[e].some((function(e){return e===t.focused}))?void 0:t.focused,r=R.filter((function(t,r){return r!==e}))):z||T?n=(r=R.filter((function(t,r){return r!==e}))).find((function(e){var r,n;return e.valueOf()===(null===(r=t.focused)||void 0===r||null===(n=r.valueOf)||void 0===n?void 0:n.call(r))})):(r=null,n=void 0);m(r,d(d({},t),{},{selectedDate:r,focused:n})),L(),E(n)}(f.index)}},n.default.createElement("span",null,"+")))})))));function L(e){O instanceof Function&&O(e)}}})); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react-element-popper"),t=require("react-date-object");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(e),o=n(r),d=n(t);function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?i(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function s(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function f(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],d=!0,i=!1;try{for(t=t.call(e);!(d=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);d=!0);}catch(e){i=!0,a=e}finally{try{d||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,r)||m(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){if(e){if("string"==typeof e)return h(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,r):void 0}}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function y(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=m(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,d=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return d=e.done,e},e:function(e){i=!0,o=e},f:function(){try{d||null==t.return||t.return()}finally{if(i)throw o}}}}function g(e){return Array.isArray(e)}function b(r){var t=r.state.date,n=t.calendar,o=t.locale,i=r.customWeekDays,l=r.weekStartDayIndex,u=r.displayWeekNumbers,c=r.weekNumber,s=e.useMemo((function(){var e=i;return g(e)&&e.length>=7?(e.length=7,e=e.map((function(e){return g(e)&e.length>1?e=e[1]:g(e)&&(e=e[0]),e}))):e=new d.default({year:1,calendar:n,locale:o}).weekDays.map((function(e){return e.shortName})),e}),[n,o,i]);return s=p(s).slice(l).concat(p(s).splice(0,l)),a.default.createElement("div",{className:"rmdp-week"},u&&a.default.createElement("div",{className:"rmdp-week-day"},c),s.map((function(e,r){return a.default.createElement("div",{key:r,className:"rmdp-week-day"},e)})))}function v(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!r)return!1;if(e.year===r.year){if(n)return!0;if(e.monthIndex===r.monthIndex)return!!t||e.day===r.day}}function x(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY/MM/DD";return e.format(r)}function w(e,r,t){var n=t.multiple,a=t.range,o=t.selectedDate,i=t.onlyMonthPicker,l=t.onlyYearPicker,u=t.format,c=t.focused,s=t.weekPicker;e.setFormat(u);var m=new d.default(e);return[o=n&&a?function(){var e=!0;g(o)||(o=[[o]]);var r=o.find((function(e){return 1===e.length})),t=i?"YYYY/MM":"YYYY/MM/DD",n=o;if(r){var a=r[0];n=n.filter((function(e){if(1===e.length)return!0;var r=f(e,2),n=r[0],o=r[1],d=f([a,m].sort((function(e,r){return e-r})),2),i=f([n,o,d[0],d[1]].map((function(e){return x(e,t)})),4),l=i[0],u=i[1],c=i[2],s=i[3];return!(c<=l&&s>=u||c>=l&&s>=u&&c<=u||c<=l&&s<=u&&s>=l)}))}else n=n.filter((function(e){if(!g(e))return!0;if(0===e.length)return!1;var r=f(e,2),n=f([r[0],r[1],m].map((function(e){return x(e,t)})),3),a=n[0],o=n[1],d=n[2];return!(d>=a&&d<=o)}));n=n.map((function(r){var t;return g(r)?1===r.length?(e=!1,t=r.concat(m)):t=r:(e=!1,t=[r,m]),t.sort((function(e,r){return e-r}))})),e&&(n=[].concat(p(n),[[m]]));return n}():n?function(){var t=o.filter((function(r){return!v(e,r,i,l)}));t.length===o.length?t.push(m):m=t.find((function(e){return v(e,c)}));r&&t.sort((function(e,r){return e-r}));return t}():a?function(){if(s)return[new d.default(m).toFirstOfWeek(),new d.default(m).toLastOfWeek()];if(2===o.length||0===o.length)return[m];if(1===o.length)return[o[0],m].sort((function(e,r){return e-r}))}():m,m]}function k(e,r,t,n){var a=[],o=t?"YYYY/MM":"YYYY/MM/DD",d=x(e,o);function i(r){var n=r[0],i=r[1];if(1===r.length)v(e,n,t)&&a.push("rmdp-range");else if(2===r.length){var l=f([n,i].map((function(e){return x(e,o)})),2),u=l[0],c=l[1];d>=u&&d<=c&&a.push("rmdp-range"),d===u&&a.push("start"),d===c&&a.push("end")}}return n?(g(r)?r:[[r]]).forEach(i):i(r),a.join(" ")}function D(e,r,t,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"day",o=[];if(n&&1===(null==r?void 0:r.length)&&t){var d="day"===a?"YYYY/MM/DD":"YYYY/MM",i=t.format(d),l=r[0].format(d),u=e.format(d);(u>l&&u<=i||u<l&&u>=i)&&(o.push("rmdp-range-hover"),u===i&&o.push(i>l?"end":"start"))}return o}var O;function Y(r){var t=r.state,n=r.setState,o=r.onChange,i=r.showOtherDays,s=void 0!==i&&i,p=r.mapDays,m=r.onlyShowInRangeDates,h=r.customWeekDays,y=r.sort,g=r.numberOfMonths,x=r.isRTL,Y=r.weekStartDayIndex,M=r.handleFocusedDate,E=r.hideWeekDays,P=r.fullYear,C=f(r.monthAndYears,1)[0],N=r.displayWeekNumbers,S=r.weekNumber,I=void 0===S?"":S,j=r.rangeHover,R=r.highlightToday,A=e.useRef({}),T=e.useRef(),L=t.today,F=t.minDate,W=t.maxDate,B=t.range,_=t.multiple,V=t.date,z=t.selectedDate,H=t.onlyMonthPicker,q=t.onlyYearPicker,J=!H&&!q,K=f(e.useState(),2),U=K[0],$=K[1],G=_||B?(null==z?void 0:z.length)>0:!!z;A.current.date=V;var Q=e.useMemo((function(){return J?function(e,r,t,n){if(!e)return[];for(var a=[],o=0;o<t;o++){var i=(e=new d.default(e).toFirstOfMonth()).monthIndex,l=[];e.toFirstOfWeek().add(n,"day"),e.monthIndex===i&&e.day>1&&e.subtract(7,"days");for(var u=0;u<6;u++){for(var c=[],s=0;s<7;s++)c.push({date:new d.default(e),day:e.format("D"),current:e.monthIndex===i}),e.day+=1;if(l.push(c),u>2&&e.monthIndex!==i&&!r)break}a.push(l)}return a}(A.current.date,s,g,Y):[]}),[V.monthIndex,V.year,V.calendar,V.locale,J,s,g,Y]);return J&&a.default.createElement("div",{ref:T,className:"rmdp-day-picker ".concat(P?"rmdp-full-year":""),style:{display:P?"grid":"flex"},onMouseLeave:function(){return j&&$()}},Q.map((function(e,r){return a.default.createElement("div",{key:r,style:u({},x?"marginLeft":"marginRight",r+(P?0:1)<g?"10px":"")},P&&a.default.createElement("div",{className:"rmdp-month-name"},C[r]),!E&&a.default.createElement(b,{state:t,customWeekDays:h,weekStartDayIndex:Y,displayWeekNumbers:N,weekNumber:I}),e.map((function(e,i){return a.default.createElement("div",{key:i,className:"rmdp-week"},N&&a.default.createElement("div",{className:"rmdp-day rmdp-disabled"},a.default.createElement("span",null,e[0].date.format("WW"))),e.map((function(e,i){var u=function(e){if(!e.current&&!s)return{};var r={};return p.forEach((function(n){var a,o=n({date:e.date,today:L,currentMonth:t.date.month,selectedDate:t.selectedDate,isSameDate:v});(null===(a=o)||void 0===a?void 0:a.constructor)!==Object&&(o={}),(o.disabled||o.hidden)&&(e.disabled=!0),o.hidden&&(e.hidden=!0),r=l(l({},r),o)})),delete r.disabled,delete r.hidden,r}(e={date:e.date,day:e.day,current:e.current}),h=X(e)&&!e.disabled,b="".concat(h?"sd":""),x=u.children;h&&(b="".concat(b," ").concat(u.className||"")),delete u.className,delete u.children;var Y=function(e,r){var t=["rmdp-day"],n=e.date,a=e.hidden,o=e.current;if(!X(e)||a)t.push("rmdp-day-hidden");else{(F&&n<F||W&&n>W||e.disabled)&&(t.push("rmdp-disabled"),e.disabled||(e.disabled=!0)),o||t.push("rmdp-deactive");var d=r>1&&o||1===r;e.disabled&&m||(v(n,L)&&R&&t.push("rmdp-today"),i=n,[].concat(z).some((function(e){return v(e,i)}))&&d&&!B&&t.push("rmdp-selected")),B&&!e.disabled&&d&&(t.push(k(n,z,void 0,_)),_||(t=t.concat(D(n,z,U,j))))}var i;return t.join(" ")}(e,g);(e.hidden||e.disabled)&&(b=b.replace("sd",""));var E=G?Y.includes("selected")||Y.includes("range"):Y.includes("today");return a.default.createElement("div",{key:i,tabIndex:E?0:-1,"aria-label":"Choose ".concat(e.date.format("dddd MMMM DD of YYYY")),className:Y,onMouseEnter:function(){return j&&$(e.date)},onKeyDown:function(r){return function(e,r){var a=e.currentTarget,o=e.key,i=e.code,u={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};if("Space"===i||" "===o)e.preventDefault(),a.click();else if(Object.keys(u).includes(o)){var c=function(e){if(!e)return s();var r=e.getAttribute("class");r.includes("hidden")||r.includes("disabled")?s():e.focus()},s=function(){n(l(l({},t),{},{date:p})),clearTimeout(O),O=setTimeout((function(){return c(Z(p))}),100)};e.preventDefault();var f=u[o],p=new d.default(r.date).add(f,"day"),m=Z(p);c(m)}}(r,e)},onClick:function(){X(e)&&!e.disabled&&function(e,r,n){var a,i,u,c=e.date,s=e.current,p=t.selectedDate,m=t.focused,h=t.date,g=h,b=g.hour,v=g.minute,x=g.second;c.set({hour:(null===(a=p)||void 0===a?void 0:a.hour)||b,minute:(null===(i=p)||void 0===i?void 0:i.minute)||v,second:(null===(u=p)||void 0===u?void 0:u.second)||x}),1!==n||s?n>1&&!s&&(0===r&&c<h&&(h=new d.default(h).toFirstOfMonth()),r>0&&c.monthIndex>h.monthIndex+r&&r+1===n&&(h=new d.default(h).toFirstOfMonth().add(1,"month"))):h=new d.default(h).toFirstOfMonth();var k=f(w(c,y,t),2);p=k[0],m=k[1],o(p,l(l({},t),{},{date:h,focused:m,selectedDate:p})),M(m,c)}(e,r,g)}},a.default.createElement("span",c({className:b},u),X(e)&&!e.hidden?null!=x?x:e.day:""))})))})))})));function X(e){return!!e.current||s}function Z(e){return T.current.querySelector("[aria-label*='".concat(e.format("dddd MMMM DD of YYYY"),"']"))}}function M(e){var r=e.direction,t=e.onClick,n=e.disabled;return a.default.createElement("button",{className:"rmdp-arrow-container ".concat(r," ").concat(n?"disabled":""),onClick:t,"aria-roledescription":"button to navigate ".concat(r.replace("rmdp-",""))},a.default.createElement("i",{className:"rmdp-arrow"}))}function E(r){var t=r.state,n=r.setState,o=r.disableYearPicker,d=r.disableMonthPicker,i=r.buttons,u=r.renderButton,c=r.handleMonthChange,s=r.disabled,p=r.hideMonth,m=r.hideYear,h=r.isRTL,y=r.fullYear,g=f(r.monthAndYears,2),b=g[0],v=g[1],x=r.monthYearSeparator,w=r.formatMonth,k=r.formatYear,D=r.headerOrder,O={},Y=t.date,E=t.onlyMonthPicker,P=t.onlyYearPicker,C=t.mustShowYearPicker,N=t.minDate,S=t.maxDate,I=t.year,j=t.today,R=N&&Y.year<=N.year&&N.monthIndex>Y.monthIndex-1,A=S&&Y.year>=S.year&&S.monthIndex<Y.monthIndex+1,T=j.year+7;if(T-=12*Math.floor((T-I)/12),(p||y)&&m&&!i)return null;if((E||y)&&(N&&N.year>=Y.year&&(R=!0),S&&S.year<=Y.year&&(A=!0)),C||P){var L=T-11;R=N&&N.year>L,A=S&&S.year<T}return s&&(R=!0,A=!0),a.default.createElement("div",{className:"rmdp-header"},a.default.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},Array.from(new Set(D)).map((function(r,t){return a.default.createElement(e.Fragment,{key:t},function(r){switch(r){case"LEFT_BUTTON":return i&&W("left");case"RIGHT_BUTTON":return i&&W("right");case"MONTH_YEAR":case"YEAR_MONTH":if(y)return a.default.createElement("div",{className:"rmdp-header-values",style:O},!m&&Y.format("YYYY"));var t=r.split("_").filter((function(e){return"MONTH"===e&&!p||"YEAR"===e&&!m}));return t.length>1&&(t=[t[0],F(),t[1]]),b.map((function(r,n){return a.default.createElement("div",{key:n,className:"rmdp-header-values",style:O},t.map((function(t,i){return a.default.createElement(e.Fragment,{key:i},function(e,r,t){switch(e){case"MONTH":return a.default.createElement("span",{style:{cursor:s||d||E?"default":"pointer"},onClick:function(){return!d&&_("mustShowMonthPicker")}},function(e,r){return"function"==typeof w?w(e,r):e}(r,v[t]));case"YEAR":return a.default.createElement("span",{style:{cursor:s||o||P?"default":"pointer"},onClick:function(){return!o&&_("mustShowYearPicker")}},function(e,r){return"function"==typeof w?k(e,r):e}(v[t],r));default:return e}}(t,r,n))})))}));default:return}}(r))}))));function F(){return x?a.default.createElement("span",null,x):h?"،":","}function W(r){var t=function(e){e.preventDefault(),B("right"===r?1:-1)},n="left"===r&&R||"right"===r&&A;return u instanceof Function?u(r,t,n):e.isValidElement(u)?e.cloneElement(u,{direction:r,handleClick:t,disabled:n}):a.default.createElement(M,{direction:"rmdp-".concat(r),onClick:t,disabled:n})}function B(e){s||e<0&&R||e>0&&A||(y?Y.year+=e:C||P?(I+=12*e,e<0&&N&&I<N.year&&(I=N.year),e>0&&S&&I>S.year&&(I=S.year)):(Y.toFirstOfMonth(),E?Y.year+=e:(Y.month+=e,c(Y))),n(l(l({},t),{},{date:Y,year:I})))}function _(e){if(!s){var r={mustShowMonthPicker:!1,mustShowYearPicker:!1};r[e]=!t[e],n(l(l({},t),r))}}}function P(e){return g(e)||(e=[]),JSON.stringify(e)}function C(r){var t=r.state,n=r.onChange,o=r.customMonths,i=r.sort,u=r.handleMonthChange,c=r.handleFocusedDate,s=r.rangeHover,p=r.highlightToday,m=r.numberOfMonths,h=t.date,y=t.today,b=t.minDate,x=t.maxDate,O=t.calendar,Y=t.locale,M=t.onlyMonthPicker,E=t.onlyYearPicker,C=t.range,N=t.onlyShowInRangeDates,S=(t.mustShowMonthPicker||M)&&!E,I=f(e.useState(),2),j=I[0],R=I[1];o=o&&P(o);var A=e.useMemo((function(){var e=[],r=M?m:1,n=o&&JSON.parse(o),a=new d.default({calendar:O,locale:Y,format:t.date._format,year:t.date.year,month:1,day:1});g(n)&&n.length>=12?(n.length=12,n=n.map((function(e){return g(e)?e[0]:e}))):n=a.locale.months.map((function(e){return f(e,1)[0]}));for(var i=0;i<r;i++){for(var l=[],u=0,c=0;c<4;c++){for(var s=[],p=0;p<3;p++)s.push({date:new d.default(a),name:n[u]}),u++,a.add(1,"month");l.push(s)}e.push(l)}return e}),[O,Y,o,t.date.year,t.date._format,m,M]);return a.default.createElement("div",{className:"".concat(M?"only ":"","rmdp-month-picker"),style:{display:S?"flex":"none"},onMouseLeave:function(){return s&&R()}},A.map((function(e,r){return a.default.createElement("div",{key:r,style:{margin:"0 5px",flex:1}},e.map((function(e,r){return a.default.createElement("div",{key:r,className:"rmdp-ym"},e.map((function(e,r){var t=e.date,n=e.name;return a.default.createElement("div",{key:r,className:L(t),onClick:function(){return T(t)},onMouseEnter:function(){return s&&R(t)}},a.default.createElement("span",{className:M?"sd":""},n))})))})))})));function T(e){var r=t.selectedDate,a=t.focused,o=e.year,d=e.monthIndex;if(!(b&&o<=b.year&&d<b.monthIndex||x&&o>=x.year&&d>x.monthIndex)){if(h.setMonth(d+1),M){var s=f(w(e,i,t),2);r=s[0],a=s[1]}else u(h);n(M?r:void 0,l(l({},t),{},{date:h,focused:a,selectedDate:r,mustShowMonthPicker:!1})),M&&c(a,e)}}function L(e){var r=["rmdp-day"],n=e.year,a=e.monthIndex,o=t.selectedDate,d=t.multiple;if((b&&(n<b.year||n===b.year&&a<b.monthIndex)||x&&(n>x.year||n===x.year&&a>x.monthIndex))&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!N)return v(y,e,!0)&&p&&r.push("rmdp-today"),M?C?(r.push(k(e,o,!0,d)),d||(r=r.concat(D(e,o,j,s,"month")))):[].concat(o).some((function(r){return v(r,e,!0)}))&&r.push("rmdp-selected"):h.monthIndex===a&&r.push("rmdp-selected"),r.join(" ")}}function N(e,r){return e.replace(/[0-9]/g,(function(e){return r[e]}))}function S(r){var t=r.state,n=r.onChange,o=r.sort,i=r.handleFocusedDate,u=r.onYearChange,c=r.rangeHover,s=r.highlightToday,p=t.date,m=t.today,h=t.minDate,y=t.maxDate,b=t.onlyYearPicker,v=t.range,x=t.onlyShowInRangeDates,k=t.year,D=t.mustShowYearPicker||b,O=p.digits,Y=f(e.useState(),2),M=Y[0],E=Y[1],P=m.year-4;P-=12*Math.ceil((P-k)/12);var C=e.useMemo((function(){for(var e=[],r=P,t=0;t<4;t++){for(var n=[],a=0;a<3;a++)n.push(r),r++;e.push(n)}return e}),[P]);return a.default.createElement("div",{className:"".concat(b?"only ":"","rmdp-year-picker"),style:{display:D?"block":"none"}},C.map((function(e,r){return a.default.createElement("div",{key:r,className:"rmdp-ym",onMouseLeave:function(){return c&&E()}},e.map((function(e,r){return a.default.createElement("div",{key:r,className:S(e),onClick:function(){return function(e){if(I(e))return;var r=new d.default(t.date).setYear(e),a=t.selectedDate,c=t.focused;if(b){var s=f(w(r,o,t),2);a=s[0],c=s[1]}else h&&r.monthIndex<h.monthIndex?r=r.setMonth(h.monthIndex+1):y&&r.monthIndex>y.monthIndex&&(r=r.setMonth(y.monthIndex+1)),null==u||u(r);n(b?a:void 0,l(l({},t),{},{date:r,focused:c,selectedDate:a,mustShowYearPicker:!1})),b&&i(c,r)}(e)},onMouseEnter:function(){return c&&E(e)}},a.default.createElement("span",{className:b?"sd":""},N(e.toString(),O)))})))})));function S(e){var r=["rmdp-day"],n=t.date,a=t.selectedDate,o=t.multiple;if(I(e)&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!x){if(m.year===e&&s&&r.push("rmdp-today"),b)if(v){var d=function(t){var n=t[0],a=t[1];if(1===t.length){if(e===n.year&&r.push("rmdp-range"),c){var o=t[0].year;(e>o&&e<=M||e<o&&e>=M)&&(r.push("rmdp-range-hover"),e===M&&r.push(M>o?"end":"start"))}}else 2===t.length&&(e>=n.year&&e<=a.year&&r.push("rmdp-range"),e===n.year&&r.push("start"),e===a.year&&r.push("end"))};o?(g(a)?a:[[a]]).forEach((function(e){return d(e)})):d(a)}else[].concat(a).some((function(r){return r&&r.year===e}))&&r.push("rmdp-selected");else e===n.year&&r.push("rmdp-selected");return r.join(" ")}}function I(e){return h&&e<h.year||y&&e>y.year}}function I(e,r,t){return t||(e?"MM/YYYY":r?"YYYY":"YYYY/MM/DD")}function j(e,r){return e instanceof d.default?e.setCalendar(r):e=new d.default({date:e,calendar:r}),e}function R(e){"_self"in a.default.createElement("div")&&console.warn(e.join("\n"))}var A=new d.default,T=A.calendar,L=A.locale;function F(e,r){return e&&e.constructor!==Object&&(R(W("calendar")),e=void 0),r&&r.constructor!==Object&&(R(W("locale")),r=void 0),[e||T,r||L]}function W(e){return["".concat(e," must be an object"),"https://shahabyazdi.github.io/react-multi-date-picker/calendars/"]}function B(e){return e&&e.name?e.name.split("_")[1]:""}function _(e){return["fa","ar"].includes(B(e))}function V(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}V(".rmdp-wrapper{background-color:#fff;border-radius:5px;direction:ltr;text-align:center;width:max-content}.rmdp-shadow{box-shadow:0 0 5px #8798ad}.rmdp-border{border:1px solid #cfd8e2}.rmdp-calendar{height:max-content;padding:4px}.rmdp-border-top{border-top:1px solid #cfd8e2}.rmdp-border-bottom{border-bottom:1px solid #cfd8e2}.rmdp-border-left{border-left:1px solid #cfd8e2}.rmdp-border-right{border-right:1px solid #cfd8e2}.rmdp-week,.rmdp-ym{display:flex;justify-content:space-between}.rmdp-ym{height:25%}.rmdp-day,.rmdp-week-day{color:#000;cursor:pointer;height:34px;position:relative;width:34px}.rmdp-week-day{color:#0074d9;cursor:default;font-size:13px;font-weight:500}.rmdp-day span,.rmdp-week-day{display:flex;flex-direction:column;justify-content:center}.rmdp-day span{border-radius:50%;bottom:3px;font-size:14px;left:3px;position:absolute;right:3px;top:3px}.rmdp-day.rmdp-today span{background-color:#7fdbff;color:#fff}.rmdp-day.rmdp-selected span:not(.highlight){background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-day.rmdp-deactive,.rmdp-day.rmdp-disabled{color:#8798ad}.rmdp-day.rmdp-deactive.rmdp-selected span{background-color:#4ca6f5;box-shadow:0 0 3px #bac5d3}.rmdp-ym .rmdp-day{flex:1;margin:auto}.rmdp-ym .rmdp-day span{border-radius:12px;padding:2px 0}.rmdp-range{background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-range-hover{background-color:#7ea6f0;color:#fff}.rmdp-range-hover.start,.rmdp-range.start{border-bottom-left-radius:50%;border-top-left-radius:50%}.rmdp-range-hover.end,.rmdp-range.end{border-bottom-right-radius:50%;border-top-right-radius:50%}.rmdp-ym .rmdp-range-hover.start,.rmdp-ym .rmdp-range.start{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-ym .rmdp-range-hover.end,.rmdp-ym .rmdp-range.end{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover{background-color:#7ea6f0;color:#fff}.rmdp-day-picker{padding:5px}.rmdp-header{font-size:14px;margin-top:5px;padding:9px 0}.rmdp-month-picker,.rmdp-year-picker{background-color:#fff;border-radius:0 0 5px 5px;bottom:2px;left:2px;position:absolute;right:2px;top:2px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:240px;position:static}.only.rmdp-month-picker .rmdp-day,.only.rmdp-year-picker .rmdp-day{width:80px}.rmdp-header-values{color:#000;margin:auto}.rmdp-header-values span{padding:0 0 0 5px}.rmdp-arrow{border:solid #0074d9;border-width:0 2px 2px 0;display:inline-block;height:3px;margin-top:5px;padding:2px;width:3px}.rmdp-right i{margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-left i{margin-left:3px;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-left{left:0}.rmdp-right{right:0}.rmdp-arrow-container{background:transparent;border:none;border-radius:50%;cursor:pointer;display:flex;height:20px;justify-content:center;margin:0 5px;padding:0;width:20px}.rmdp-arrow-container:hover{background-color:#0074d9;box-shadow:0 0 3px #8798ad}.rmdp-arrow-container:hover .rmdp-arrow{border:solid #fff;border-width:0 2px 2px 0}.rmdp-arrow-container.disabled{cursor:default}.rmdp-arrow-container.disabled:hover{background-color:inherit;box-shadow:inherit}.rmdp-arrow-container.disabled .rmdp-arrow,.rmdp-arrow-container.disabled:hover .rmdp-arrow{border:solid gray;border-width:0 2px 2px 0}.rmdp-rtl{direction:rtl}.rmdp-rtl .rmdp-left i{margin-left:0;margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-rtl .rmdp-right i{margin-left:3px;margin-right:0;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-rtl .rmdp-right{left:0;right:auto}.rmdp-rtl .rmdp-left{left:auto;right:0}.rmdp-rtl .rmdp-range-hover.start,.rmdp-rtl .rmdp-range.start{border-bottom-left-radius:unset;border-bottom-right-radius:50%;border-top-left-radius:unset;border-top-right-radius:50%}.rmdp-rtl .rmdp-range-hover.end,.rmdp-rtl .rmdp-range.end{border-bottom-left-radius:50%;border-bottom-right-radius:unset;border-top-left-radius:50%;border-top-right-radius:unset}.rmdp-rtl .rmdp-range.start.end{border-radius:50%}.rmdp-rtl .rmdp-ym .rmdp-range-hover.start,.rmdp-rtl .rmdp-ym .rmdp-range.start{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-rtl .rmdp-ym .rmdp-range-hover.end,.rmdp-rtl .rmdp-ym .rmdp-range.end{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-day-hidden,.rmdp-day.rmdp-disabled{cursor:default}.rmdp-selected .highlight{box-shadow:0 0 3px #8798ad}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-red:hover{background-color:#ff6687}.rmdp-day:not(.rmdp-deactive) .highlight-red{color:#cc0303}.rmdp-day.rmdp-deactive .highlight-red{color:#e08e8e}.rmdp-day.rmdp-selected .highlight-red{background-color:#ea0034;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-red{background-color:#e4b0ba;color:#fff}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-green:hover{background-color:#4db6ac}.rmdp-day:not(.rmdp-deactive) .highlight-green{color:#00796b}.rmdp-day.rmdp-deactive .highlight-green{color:#7ab3ac}.rmdp-day.rmdp-selected .highlight-green{background-color:#009688;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-green{background-color:#749c98;color:#fff}.rmdp-day-hidden,.rmdp-day-hidden:hover span{background-color:unset;color:transparent}.rmdp-month-name{cursor:default;font-size:14px;margin:3px 0}.rmdp-full-year{grid-template-columns:1fr 1fr 1fr}@media (max-height:450px),(max-width:450px){.rmdp-day,.rmdp-week-day{height:28px;width:28px}.rmdp-day span{font-size:12px;padding-left:.5px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:200px;width:205px}.rmdp-header{padding:3px 0 0}.rmdp-header,.rmdp-month-name{font-size:12px}.rmdp-full-year{grid-template-columns:1fr 1fr}}");var z=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","range","multiple","className","role","weekDays","months","children","onChange","showOtherDays","minDate","maxDate","mapDays","disableMonthPicker","disableYearPicker","formattingIgnoreList","onReady","onlyShowInRangeDates","zIndex","plugins","sort","numberOfMonths","currentDate","digits","buttons","renderButton","weekStartDayIndex","disableDayPicker","onPropsChange","onMonthChange","onYearChange","onFocusedDateChange","readOnly","disabled","hideMonth","hideYear","hideWeekDays","shadow","fullYear","displayWeekNumbers","weekNumber","weekPicker","rangeHover","monthYearSeparator","formatMonth","formatYear","highlightToday","headerOrder","style"],H=["datePickerProps","DatePicker"];function q(r,t){var n,o=r.value,i=r.calendar,u=r.locale,p=r.format,m=r.onlyMonthPicker,h=r.onlyYearPicker,y=r.range,b=void 0!==y&&y,v=r.multiple,x=void 0!==v&&v,w=r.className,k=r.role,D=r.weekDays,O=r.months,M=r.children,j=r.onChange,R=r.showOtherDays,A=r.minDate,T=r.maxDate,L=r.mapDays,W=r.disableMonthPicker,B=r.disableYearPicker,V=r.formattingIgnoreList,q=r.onReady,J=r.onlyShowInRangeDates,$=void 0===J||J,G=r.zIndex,Q=void 0===G?100:G,X=r.plugins,Z=void 0===X?[]:X,ee=r.sort,re=r.numberOfMonths,te=void 0===re?1:re,ne=r.currentDate,ae=r.digits,oe=r.buttons,de=void 0===oe||oe,ie=r.renderButton,le=r.weekStartDayIndex,ue=void 0===le?0:le,ce=r.disableDayPicker,se=r.onPropsChange,fe=r.onMonthChange,pe=r.onYearChange,me=r.onFocusedDateChange,he=r.readOnly,ye=r.disabled,ge=r.hideMonth,be=r.hideYear,ve=r.hideWeekDays,xe=r.shadow,we=void 0===xe||xe,ke=r.fullYear,De=r.displayWeekNumbers,Oe=r.weekNumber,Ye=r.weekPicker,Me=r.rangeHover,Ee=r.monthYearSeparator,Pe=r.formatMonth,Ce=r.formatYear,Ne=r.highlightToday,Se=void 0===Ne||Ne,Ie=r.headerOrder,je=void 0===Ie?["LEFT_BUTTON","MONTH_YEAR","RIGHT_BUTTON"]:Ie,Re=r.style,Ae=void 0===Re?{}:Re;s(r,z),!ne||ne instanceof d.default||(console.warn("currentDate must be instance of DateObject"),ne=void 0),("number"!=typeof ue||ue<0||ue>6)&&(ue=0),("number"!=typeof te||te<1||h)&&(te=1),!(x||b||g(o))||b||x||(x=!0),Ye&&(b=!0,x=!1),ke&&(te=12,m=!1,h=!1),h&&!ge&&(ge=!0);var Te=F(i,u),Le=f(Te,2);i=Le[0],u=Le[1],p=I(m,h,p),V=P(V),L=[].concat(L).filter(Boolean),Z=[].concat.apply([],Z);var Fe=e.useState({}),We=f(Fe,2),Be=We[0],_e=We[1],Ve={},ze=e.useRef({mustCallOnReady:!0,currentDate:ne});e.useEffect((function(){_e((function(e){var r=ze.current.currentDate,t=e.date,n=e.selectedDate,a=e.initialValue,c=e.focused,s=e.mustSortDates;function f(e){if(e)return e.calendar.name!==i.name&&e.setCalendar(i),e.locale.name!==u.name&&e.setLocale(u),e._format!==p&&e.setFormat(p),e.digits=ae,e.ignoreList=JSON.parse(V),e}function y(e){return new d.default(r||e)}if(o)if(g(n=U(o,i,u,p)))t||(t=y(n.flat()[0]));else if(t&&1!==te){var v=new d.default(t).toFirstOfMonth(),w=new d.default(t).add(te-1,m?"years":"months").toLastOfMonth();(n<v||n>w)&&(t=new d.default(n))}else t=y(n);else t||(t=y({calendar:i,locale:u,format:p})),a&&(n=void 0);if([].concat(n).flat().forEach(f),f(t),x||b||g(o)){if(n||(n=[]),g(n)||(n=x&&b?[[n]]:[n]),b&&!x&&n.length>2){var k=n[n.length-1];n=[n[0],k],c=k}x&&!b&&ee&&!s?(s=!0,n.sort((function(e,r){return e-r}))):b&&!x&&n.sort((function(e,r){return e-r}))}else g(n)&&(n=n.flat()[n.length-1]);return ke&&t.toFirstOfYear(),delete ze.current.currentDate,l(l({},e),{},{date:t,selectedDate:n,multiple:x,range:b,onlyMonthPicker:m,onlyYearPicker:h,initialValue:e.initialValue||o,value:o,focused:c,calendar:i,locale:u,format:p,mustSortDates:s,year:t.year,today:f(e.today)||new d.default({calendar:i}),weekPicker:Ye})}))}),[o,i,u,p,m,h,b,x,ee,te,ae,V,ke,Ye]),e.useEffect((function(){(A||T)&&_e((function(e){var r=e.calendar,t=e.locale,n=e.format,a=f(K(U(o,r,t,n),A,T,r),3),d=a[0],i=a[1],u=a[2];return l(l({},e),{},{inRangeDates:$?d:e.selectedDate,minDate:i,maxDate:u})}))}),[A,T,$,o]),Be.today&&!ze.current.isReady&&(ze.current.isReady=!0),e.useEffect((function(){ze.current.isReady&&ze.current.mustCallOnReady&&q instanceof Function&&(ze.current.mustCallOnReady=!1,q())}),[ze.current.isReady,q]);var He="rmdp-top-class "+nr(["top","bottom"]),qe={top:[],bottom:[],left:[],right:[]},Je=_(null===(n=Be.date)||void 0===n?void 0:n.locale),Ke={state:Be,setState:_e,onChange:Ze,sort:ee,handleFocusedDate:rr,isRTL:Je,fullYear:ke,monthAndYears:dr(),rangeHover:Me,highlightToday:Se,numberOfMonths:te},Ue=arguments[0],$e=Ue.datePickerProps,Ge=Ue.DatePicker,Qe=s(Ue,H);return Xe(),Be.today?a.default.createElement("div",{ref:or,role:k||"dialog",className:"rmdp-wrapper rmdp-".concat(we?"shadow":"border"," ").concat(w||""),style:l({zIndex:Q},Ae)},qe.top,a.default.createElement("div",{style:{display:"flex"},className:He},qe.left,!ce&&a.default.createElement("div",{className:"rmdp-calendar ".concat(Je?"rmdp-rtl":""," ").concat(nr(["left","right"]))},a.default.createElement(E,l(l({},Ke),{},{disableYearPicker:B,disableMonthPicker:W,buttons:de,renderButton:ie,handleMonthChange:tr,disabled:ye,hideMonth:ge,hideYear:be,monthYearSeparator:Ee,formatMonth:Pe,formatYear:Ce,headerOrder:je})),a.default.createElement("div",{style:{position:"relative"}},a.default.createElement(Y,l(l({},Ke),{},{showOtherDays:R,mapDays:L,onlyShowInRangeDates:$,customWeekDays:D,weekStartDayIndex:ue,hideWeekDays:ve,displayWeekNumbers:De,weekNumber:Oe})),!ke&&a.default.createElement(a.default.Fragment,null,!W&&a.default.createElement(C,c({},Ke,{customMonths:O,handleMonthChange:tr})),!B&&a.default.createElement(S,c({},Ke,{onYearChange:pe}))))),qe.right),qe.bottom,M):null;function Xe(){if(ze.current.isReady&&g(Z)){var r={state:Be,setState:_e,registerListener:ar,calendarProps:Qe,datePickerProps:$e,handleChange:Ze,Calendar:ze.current.Calendar,DatePicker:Ge,handlePropsChange:er,handleFocusedDate:function(e){return rr(e)}},t=function(e){return ce?"bottom":e.props.position||"right"};Z.forEach((function(n,a){if("string"!=typeof n.type){var o={},d=t(n);if(qe[d]&&!n.props.disabled){for(var i=0;i<Z.length;i++)if("string"!=typeof Z[i].type&&!Z[i].props.disabled){if(4===Object.keys(o).length)break;var u=t(Z[i]);["top","bottom"].includes(d)?(u===d&&i>a&&(o.bottom=!0),u===d&&i<a&&(o.top=!0)):(He.includes("border-top")&&(o.top=!0),He.includes("border-bottom")&&(o.bottom=!0),u===d&&i>a&&(o.right=!0),u===d&&i<a&&(o.left=!0))}qe[d].push(e.cloneElement(n,l({key:a,position:d,nodes:o},r)))}}else"mapDays"===n.type&&L.push(n.fn(r))}))}}function Ze(e,r){if(!ye){if(e||null===e){if(he)return;Ve.change&&Ve.change.forEach((function(r){return r(e)}))}if(e||null===e){var t=null==j?void 0:j(e);r&&!1!==t&&_e(r)}else r&&_e(r);er({value:e})}}function er(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!he&&!ye){var t=l(l(l(l({},Qe),$e),r),{},{value:null!==(e=r.value)&&void 0!==e?e:Be.selectedDate});delete t.onPropsChange,null==se||se(t)}}function rr(e,r){he||ye||null==me||me(e,r)}function tr(e){null==fe||fe(e)}function nr(e){return ce||!g(Z)?"":Array.from(new Set(Z.map((function(r){if(!r.props)return"";var t=r.props.position||"right";return e.includes(t)&&!r.props.disabled?"rmdp-border-"+t:""})))).join(" ")}function ar(e,r){Ve[e]||(Ve[e]=[]),Ve[e].push(r)}function or(e){if(e&&(e.date=Be.date,e.set=function(e,r){ye||_e(l(l({},Be),{},{date:new d.default(Be.date.set(e,r))}))}),ze.current.Calendar=e,t instanceof Function)return t(e);t&&(t.current=e)}function dr(){var e=Be.date;if(!e)return[];for(var r=[],t=[],n=e.digits,a=0;a<te;a++){var o=void 0,d=e.year,i=e.monthIndex+a;if(m&&(d+=a),i>11&&(i-=12,m||d++),g(O)&&O.length>=12){var l=O[i];o=g(l)?l[0]:l}else o=e.months[i].name;d=N(d.toString(),n),r.push(o),t.push(d)}return[r,t]}}var J=e.forwardRef(q);function K(e,r,t,n){return r&&(r=j(r,n).set({hour:0,minute:0,second:0,millisecond:0})),t&&(t=j(t,n).set({hour:23,minute:59,second:59,millisecond:999})),g(e)&&(e=e.filter((function(e){return!(r&&e<r)&&!(t&&e>t)}))),[e,r,t]}function U(e,r,t,n){var a=[].concat(e).map((function(e){return g(e)?e.map(o).filter(i):o(e)})).filter(i);return g(e)?a:a.flat()[0];function o(e){return e?e instanceof d.default?e:new d.default({date:e,calendar:r,locale:t,format:n}):{}}function i(e){return g(e)||e.isValid}}V('.rmdp-visible{visibility:visible}.rmdp-invisible{visibility:hidden}.rmdp-input{border:1px solid #c0c4d6;border-radius:5px;height:22px;margin:1px 0;padding:2px 5px}.rmdp-input:focus{border:1px solid #a4b3c5;box-shadow:0 0 2px #a4b3c5;outline:none!important}.rmdp-button{background-color:#0074d9;border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-block;padding:7px 16px;text-align:center;text-decoration:none;transition:.3s}.rmdp-button:hover{background-color:#143ac5;transition:.4s}.rmdp-button:disabled{background-color:#8798ad}.rmdp-action-button{border-radius:unset;color:#2682d3;float:right;font-weight:700;margin:15px 10px 15px 0}.rmdp-action-button,.rmdp-action-button:hover{background-color:transparent}.rmdp-ep-arrow{overflow:hidden;will-change:transform}.rmdp-ep-arrow:after{background-color:#fff;content:"";height:12px;position:absolute;transform:rotate(45deg);width:12px}.rmdp-ep-shadow:after{box-shadow:0 0 6px #8798ad}.rmdp-ep-border:after{border:1px solid #cfd8e2}.rmdp-ep-arrow[direction=top]{border-bottom:1px solid #fff}.rmdp-ep-arrow[direction=left]{border-right:1px solid #fff}.rmdp-ep-arrow[direction=right]{border-left:1px solid #fff;margin-left:-1px}.rmdp-ep-arrow[direction=bottom]{border-top:1px solid #fff;margin-top:-1.5px}.rmdp-ep-arrow[direction=top]:after{left:4px;top:5px}.rmdp-ep-arrow[direction=bottom]:after{left:4px;top:-6px}.rmdp-ep-arrow[direction=left]:after{left:5px;top:3px}.rmdp-ep-arrow[direction=right]:after{left:-6px;top:3px}');var $=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","onChange","range","multiple","name","id","title","placeholder","required","style","className","inputClass","disabled","render","weekDays","months","children","inputMode","scrollSensitive","hideOnScroll","minDate","maxDate","formattingIgnoreList","containerClassName","calendarPosition","editable","onOpen","onClose","arrowClassName","zIndex","arrow","fixMainPosition","onPositionChange","onPropsChange","digits","readOnly","shadow","onFocusedDateChange","type","weekPicker","mobileLabels","onOpenPickNewDate","mobileButtons","dateSeparator","multipleRangeSeparator"],G=["label"];function Q(r,t){var n=r.value,i=r.calendar,u=r.locale,p=r.format,m=r.onlyMonthPicker,h=r.onlyYearPicker,b=r.onChange,v=r.range,x=void 0!==v&&v,w=r.multiple,k=void 0!==w&&w,D=r.name,O=r.id,Y=r.title,M=r.placeholder,E=r.required,C=r.style,S=void 0===C?{}:C,j=r.className,R=void 0===j?"":j,A=r.inputClass,T=r.disabled,L=r.render,W=r.weekDays,V=r.months,z=r.children,H=r.inputMode,q=r.scrollSensitive,K=void 0===q||q,U=r.hideOnScroll,Q=r.minDate,X=r.maxDate,re=r.formattingIgnoreList,te=r.containerClassName,ne=void 0===te?"":te,ae=r.calendarPosition,oe=void 0===ae?"bottom-left":ae,de=r.editable,ie=void 0===de||de,le=r.onOpen,ue=r.onClose,ce=r.arrowClassName,se=void 0===ce?"":ce,fe=r.zIndex,pe=void 0===fe?100:fe,me=r.arrow,he=void 0===me||me,ye=r.fixMainPosition,ge=r.onPositionChange,be=r.onPropsChange,ve=r.digits,xe=r.readOnly,we=r.shadow,ke=void 0===we||we,De=r.onFocusedDateChange,Oe=r.type,Ye=r.weekPicker,Me=r.mobileLabels,Ee=r.onOpenPickNewDate,Pe=void 0===Ee||Ee,Ce=r.mobileButtons,Ne=void 0===Ce?[]:Ce,Se=r.dateSeparator,Ie=r.multipleRangeSeparator,je=void 0===Ie?",":Ie,Re=s(r,$),Ae=e.useState(),Te=f(Ae,2),Le=Te[0],Fe=Te[1],We=e.useState(),Be=f(We,2),_e=Be[0],Ve=Be[1],ze=e.useState(""),He=f(ze,2),qe=He[0],Je=He[1],Ke=e.useState(!1),Ue=f(Ke,2),$e=Ue[0],Ge=Ue[1],Qe=e.useState(!1),Xe=f(Qe,2),Ze=Xe[0],er=Xe[1],rr=e.useRef(),tr=e.useRef(),nr=e.useRef(),ar=e.useRef({}),or=Se||(x||Ye?" ~ ":", "),dr=arguments[0],ir=hr(),lr=e.useCallback((function(){if(!1!==(null==ue?void 0:ue())){var e=ee(tr);if(e&&e.forEach((function(e){return e.blur()})),ar.current.mobile){var r=nr.current.parentNode.parentNode;r.classList.remove("rmdp-calendar-container-mobile"),r.style.position="absolute",r.style.visibility="hidden"}Ge(!1),er(!1)}}),[ue]),ur=[{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){Ve(void 0),lr()},label:gr("CANCEL")},{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){_e&&(xr(_e,!0),Ve(void 0)),lr()},label:gr("OK")}];ir&&!ar.current.mobile&&(ar.current=l(l({},ar.current),{},{mobile:!0})),!ir&&ar.current.mobile&&(ar.current=l(l({},ar.current),{},{mobile:!1})),re=P(re),p=I(m,h,p);var cr=F(i,u),sr=f(cr,2);return i=sr[0],u=sr[1],e.useEffect((function(){function e(e){if($e&&!ar.current.mobile){var r=[];if([tr.current,nr.current].forEach((function(t){!t||t.contains(e.target)||e.target.classList.contains("b-deselect")||e.target.parentNode.classList.contains("b-deselect")||r.push(t)})),2===r.length)return lr();nr.current&&nr.current.contains(e.target)&&(rr.current.removeTransition(),rr.current.refreshPosition())}}function r(){U&&$e&&lr()}return document.addEventListener("click",e,!1),document.addEventListener("scroll",r,!0),function(){document.removeEventListener("click",e,!1),document.removeEventListener("scroll",r,!0)}}),[lr,t,$e,U]),e.useEffect((function(){var e=n,r=ar.current,t=r.date,a=r.initialValue,o=function(){return e[e.length-1]};function c(e){if(e)return e instanceof d.default||(e=new d.default({date:e,calendar:i,locale:u,format:p})),e.calendar!==i&&e.setCalendar(i),e.set({weekDays:W,months:V,digits:ve,locale:u,format:p,ignoreList:JSON.parse(re)}),e}n||a||!t?a&&!n&&(a=void 0):e=t;var s="";if(x||k||g(e)){var m=function(e){return e=e.map(c).filter((function(e){return void 0!==e})),x&&e.length>2&&(e=[e[0],o()]),[e,Z(e,or)]};if(g(e)||(e=x&&k?e?[[e]]:[]:[e]),k&&x)e=e.map((function(r,t){var n=f(m(g(r)?r:[r]),2),a=n[0],o=n[1];return s+=o+(t<e.length-1?" ".concat(je," "):""),a}));else{var h=f(m(e),2);e=h[0],s=h[1]}s=s.toString().replace(/\s,\s$/,"")}else g(e)&&(e=o()),(e=c(e))&&(s=e.format());ee(tr).every((function(e){return document.activeElement!==e}))&&Je(s),ar.current=l(l({},ar.current),{},{date:e,separator:or,initialValue:a||n}),ar.current.mobile&&rr.current.isOpen?Ve(e):Fe(e)}),[n,i,u,p,x,k,or,m,h,W,V,ve,re]),e.useEffect((function(){var e=ar.current.selection;if(e){var r=ee(tr);0!==r.length&&(r.forEach((function(r){document.activeElement===r&&(r.setSelectionRange(e,e),ar.current.selection=void 0)})),rr.current.refreshPosition())}}),[qe]),(k||x||g(Le)||!ie)&&(H="none"),a.default.createElement(o.default,c({ref:fr,element:pr(),popper:$e&&mr(),active:!ir&&Ze,position:oe,arrow:!ir&&he,fixMainPosition:!K||ye,zIndex:pe,onChange:!ir&&ge,containerClassName:"rmdp-container ".concat(ne),arrowClassName:["rmdp-ep-arrow","rmdp-ep-".concat(ke?"shadow":"border"),R,se].join(" ")},Re));function fr(e){if(e&&(e.openCalendar=function(){return setTimeout((function(){return br()}),10)},e.closeCalendar=lr,e.isOpen=$e&&Ze),rr.current=e,t instanceof Function)return t(e);t&&(t.current=e)}function pr(){return L?a.default.createElement("div",{ref:tr},e.isValidElement(L)?e.cloneElement(L,{value:qe,openCalendar:br,onFocus:br,handleValueChange:wr,onChange:wr,locale:u,separator:or}):L instanceof Function?L(qe,br,wr,u,or):null):a.default.createElement("input",{ref:tr,type:Oe||"text",name:D,id:O,title:Y,required:E,onFocus:br,className:A||"rmdp-input",placeholder:M,value:qe,onChange:wr,style:S,autoComplete:"off",disabled:!!T,inputMode:H||(ir?"none":void 0),readOnly:xe})}function mr(){return a.default.createElement(J,c({ref:nr,value:_e||Le,onChange:xr,range:x,multiple:k,calendar:i,locale:u,format:p,onlyMonthPicker:m,onlyYearPicker:h,className:R+(ir?" rmdp-mobile":""),weekDays:W,months:V,digits:ve,minDate:Q,maxDate:X,formattingIgnoreList:JSON.parse(re),onPropsChange:be,shadow:ke,onReady:kr,DatePicker:rr.current,datePickerProps:dr,onFocusedDateChange:Dr,weekPicker:Ye},Re),z,ir&&yr())}function hr(){return"string"==typeof R&&R.includes("rmdp-mobile")}function yr(){var e=[].concat.apply([],dr.plugins||[]).some((function(e){var r=e.props;return!(void 0===r?{}:r).disabled}));return g(Ne)&&a.default.createElement("div",{className:"rmdp-action-buttons ".concat(_(u)?"rmdp-rtl":""," ").concat(e?"rmdp-border-top":"")},Ne.concat(ur).map((function(e,r){var t=e.label,n=s(e,G);return a.default.createElement("button",c({key:r},n),t)})))}function gr(e){var r,t=u||(new d.default).locale;if("string"!=typeof t.name)return e;return(null==Me?void 0:Me[e])||(null===(r={en:{OK:"OK",CANCEL:"CANCEL"},fa:{OK:"تأیید",CANCEL:"لغو"},ar:{OK:"تأكيد",CANCEL:"الغاء"},hi:{OK:"पुष्टि",CANCEL:"रद्द करें"}}[B(t)])||void 0===r?void 0:r[e])||e}function br(){if(!T&&!xe&&!1!==(null==le?void 0:le())){if(vr()){var e=new d.default({calendar:i,locale:u,format:p,months:V,weekDays:W,digits:ve,ignoreList:JSON.parse(re)});(!Q||e>Q)&&(!X||e<X)&&(xr(e),null==be||be(l(l({},dr),{},{value:e})),ar.current.date=e)}var r=ee(tr);ir&&r.length>0&&r.forEach((function(e){return e.blur()})),r.length>0||!$e?Ge(!0):lr()}}function vr(){return Pe&&!n&&!ar.current.date&&!x&&!k&&!ir}function xr(e,r,t){if(ir&&!r)return Ve(e);var n="";if(e&&(n=k&&x&&g(e)?e.map((function(e){return Z(e,or)})).join(" ".concat(je," ")):Z(e,or)),!1===(null==b?void 0:b(e,{validatedValue:n,input:tr.current,isTyping:!!t})))return Je(qe),!1;Fe(e),Je(t||n.toString().replace(/\s,\s$/,"")),ar.current=l(l({},ar.current),{},{date:e})}function wr(e){if(ie){ar.current.selection=e.target.selectionStart;var r=e.target.value,t={calendar:i,locale:u,format:p,ignoreList:JSON.parse(re)};if(ve=g(ve)?ve:u.digits,!r)return Je(""),xr(null);if(ve){var n,a,o=y(ve);try{for(o.s();!(n=o.n()).done;){var c=n.value;r=r.replace(new RegExp(c,"g"),ve.indexOf(c))}}catch(e){o.e(e)}finally{o.f()}a=g(Le)?k&&x?(r||"").split(je).filter(Boolean).map(f):f(r):s(r),xr(g(Le)||a.isValid?a:null,void 0,N(r,ve))}}function s(e){return/(?=.*Y)(?=.*M)(?=.*D)/.test(p)?new d.default(l(l({},t),{},{date:e})):new d.default(t).parse(e)}function f(e){return(e||"").split(or).filter(Boolean).map((function(e){return s(e.trim())}))}}function kr(){if(er(!0),ir){var e=nr.current.parentNode.parentNode;e.className="rmdp-calendar-container-mobile",e.style.position="fixed",e.style.transform="",setTimeout((function(){e.style.visibility="visible"}),50)}}function Dr(e,r){g(ar.current.date)||!r||ir||lr(),null==De||De(e,r)}}var X=e.forwardRef(Q);function Z(e,r){var t=[].concat(e).map((function(e){return null!=e&&e.isValid?e.format():""}));return t.toString=function(){return this.filter(Boolean).join(r)},t}function ee(e){return e.current?"INPUT"===e.current.tagName?[e.current]:Array.from(e.current.querySelectorAll("input")):[]}Object.defineProperty(exports,"DateObject",{enumerable:!0,get:function(){return d.default}}),exports.Calendar=J,exports.default=X,exports.getAllDatesInRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var t=e[0],n=e[e.length-1],a=[];if(!(t instanceof d.default&&n instanceof d.default&&t.isValid&&n.isValid&&!(t>n)))return[];for(t=new d.default(t),n=new d.default(n);t<=n;t.day++)a.push(r?t.toDate():new d.default(t));return a},exports.toDateObject=j; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react-element-popper"),t=require("react-date-object");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(e),o=n(r),d=n(t);function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?i(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function s(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function f(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],d=!0,i=!1;try{for(t=t.call(e);!(d=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);d=!0);}catch(e){i=!0,a=e}finally{try{d||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,r)||m(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){if(e){if("string"==typeof e)return h(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,r):void 0}}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function y(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=m(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,d=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return d=e.done,e},e:function(e){i=!0,o=e},f:function(){try{d||null==t.return||t.return()}finally{if(i)throw o}}}}function g(e){return Array.isArray(e)}function b(r){var t=r.state.date,n=t.calendar,o=t.locale,i=r.customWeekDays,l=r.weekStartDayIndex,u=r.displayWeekNumbers,c=r.weekNumber,s=e.useMemo((function(){var e=i;return g(e)&&e.length>=7?(e.length=7,e=e.map((function(e){return g(e)&e.length>1?e=e[1]:g(e)&&(e=e[0]),e}))):e=new d.default({year:1,calendar:n,locale:o}).weekDays.map((function(e){return e.shortName})),e}),[n,o,i]);return s=p(s).slice(l).concat(p(s).splice(0,l)),a.default.createElement("div",{className:"rmdp-week"},u&&a.default.createElement("div",{className:"rmdp-week-day"},c),s.map((function(e,r){return a.default.createElement("div",{key:r,className:"rmdp-week-day"},e)})))}function v(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!r)return!1;if(e.year===r.year){if(n)return!0;if(e.monthIndex===r.monthIndex)return!!t||e.day===r.day}}function x(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY/MM/DD";return e.format(r)}function w(e,r,t){var n=t.multiple,a=t.range,o=t.selectedDate,i=t.onlyMonthPicker,l=t.onlyYearPicker,u=t.format,c=t.focused,s=t.weekPicker;e.setFormat(u);var m=new d.default(e);return[o=n&&a?function(){var e=!0;g(o)||(o=[[o]]);var r=o.find((function(e){return 1===e.length})),t=i?"YYYY/MM":"YYYY/MM/DD",n=o;if(r){var a=r[0];n=n.filter((function(e){if(1===e.length)return!0;var r=f(e,2),n=r[0],o=r[1],d=f([a,m].sort((function(e,r){return e-r})),2),i=f([n,o,d[0],d[1]].map((function(e){return x(e,t)})),4),l=i[0],u=i[1],c=i[2],s=i[3];return!(c<=l&&s>=u||c>=l&&s>=u&&c<=u||c<=l&&s<=u&&s>=l)}))}else n=n.filter((function(e){if(!g(e))return!0;if(0===e.length)return!1;var r=f(e,2),n=f([r[0],r[1],m].map((function(e){return x(e,t)})),3),a=n[0],o=n[1],d=n[2];return!(d>=a&&d<=o)}));n=n.map((function(r){var t;return g(r)?1===r.length?(e=!1,t=r.concat(m)):t=r:(e=!1,t=[r,m]),t.sort((function(e,r){return e-r}))})),e&&(n=[].concat(p(n),[[m]]));return n}():n?function(){var t=o.filter((function(r){return!v(e,r,i,l)}));t.length===o.length?t.push(m):m=t.find((function(e){return v(e,c)}));r&&t.sort((function(e,r){return e-r}));return t}():a?function(){if(s)return[new d.default(m).toFirstOfWeek(),new d.default(m).toLastOfWeek()];if(2===o.length||0===o.length)return[m];if(1===o.length)return[o[0],m].sort((function(e,r){return e-r}))}():m,m]}function k(e,r,t,n){var a=[],o=t?"YYYY/MM":"YYYY/MM/DD",d=x(e,o);function i(r){var n=r[0],i=r[1];if(1===r.length)v(e,n,t)&&a.push("rmdp-range");else if(2===r.length){var l=f([n,i].map((function(e){return x(e,o)})),2),u=l[0],c=l[1];d>=u&&d<=c&&a.push("rmdp-range"),d===u&&a.push("start"),d===c&&a.push("end")}}return n?(g(r)?r:[[r]]).forEach(i):i(r),a.join(" ")}function D(e,r,t,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"day",o=[];if(n&&1===(null==r?void 0:r.length)&&t){var d="day"===a?"YYYY/MM/DD":"YYYY/MM",i=t.format(d),l=r[0].format(d),u=e.format(d);(u>l&&u<=i||u<l&&u>=i)&&(o.push("rmdp-range-hover"),u===i&&o.push(i>l?"end":"start"))}return o}var O;function Y(r){var t=r.state,n=r.setState,o=r.onChange,i=r.showOtherDays,s=void 0!==i&&i,p=r.mapDays,m=r.onlyShowInRangeDates,h=r.customWeekDays,y=r.sort,g=r.numberOfMonths,x=r.isRTL,Y=r.weekStartDayIndex,M=r.handleFocusedDate,E=r.hideWeekDays,P=r.fullYear,C=f(r.monthAndYears,1)[0],N=r.displayWeekNumbers,S=r.weekNumber,I=void 0===S?"":S,j=r.rangeHover,R=r.highlightToday,A=e.useRef({}),T=e.useRef(),L=t.today,F=t.minDate,W=t.maxDate,B=t.range,_=t.multiple,V=t.date,z=t.selectedDate,H=t.onlyMonthPicker,q=t.onlyYearPicker,J=!H&&!q,K=f(e.useState(),2),U=K[0],$=K[1],G=_||B?(null==z?void 0:z.length)>0:!!z;A.current.date=V;var Q=e.useMemo((function(){return J?function(e,r,t,n){if(!e)return[];for(var a=[],o=0;o<t;o++){var i=(e=new d.default(e).toFirstOfMonth()).monthIndex,l=[];e.toFirstOfWeek().add(n,"day"),e.monthIndex===i&&e.day>1&&e.subtract(7,"days");for(var u=0;u<6;u++){for(var c=[],s=0;s<7;s++)c.push({date:new d.default(e),day:e.format("D"),current:e.monthIndex===i}),e.day+=1;if(l.push(c),u>2&&e.monthIndex!==i&&!r)break}a.push(l)}return a}(A.current.date,s,g,Y):[]}),[V.monthIndex,V.year,V.calendar,V.locale,J,s,g,Y]);return J&&a.default.createElement("div",{ref:T,className:"rmdp-day-picker ".concat(P?"rmdp-full-year":""),style:{display:P?"grid":"flex"},onMouseLeave:function(){return j&&$()}},Q.map((function(e,r){return a.default.createElement("div",{key:r,style:u({},x?"marginLeft":"marginRight",r+(P?0:1)<g?"10px":"")},P&&a.default.createElement("div",{className:"rmdp-month-name"},C[r]),!E&&a.default.createElement(b,{state:t,customWeekDays:h,weekStartDayIndex:Y,displayWeekNumbers:N,weekNumber:I}),e.map((function(e,i){return a.default.createElement("div",{key:i,className:"rmdp-week"},N&&a.default.createElement("div",{className:"rmdp-day rmdp-disabled"},a.default.createElement("span",null,e[0].date.format("WW"))),e.map((function(e,i){var u=function(e){if(!e.current&&!s)return{};var r={};return p.forEach((function(n){var a,o=n({date:e.date,today:L,currentMonth:t.date.month,selectedDate:t.selectedDate,isSameDate:v});(null===(a=o)||void 0===a?void 0:a.constructor)!==Object&&(o={}),(o.disabled||o.hidden)&&(e.disabled=!0),o.hidden&&(e.hidden=!0),r=l(l({},r),o)})),delete r.disabled,delete r.hidden,r}(e={date:e.date,day:e.day,current:e.current}),h=X(e)&&!e.disabled,b="".concat(h?"sd":""),x=u.children;h&&(b="".concat(b," ").concat(u.className||"")),delete u.className,delete u.children;var Y=function(e,r){var t=["rmdp-day"],n=e.date,a=e.hidden,o=e.current;if(!X(e)||a)t.push("rmdp-day-hidden");else{(F&&n<F||W&&n>W||e.disabled)&&(t.push("rmdp-disabled"),e.disabled||(e.disabled=!0)),o||t.push("rmdp-deactive");var d=r>1&&o||1===r;e.disabled&&m||(v(n,L)&&R&&t.push("rmdp-today"),i=n,[].concat(z).some((function(e){return v(e,i)}))&&d&&!B&&t.push("rmdp-selected")),B&&!e.disabled&&d&&(t.push(k(n,z,void 0,_)),_||(t=t.concat(D(n,z,U,j))))}var i;return t.join(" ")}(e,g);(e.hidden||e.disabled)&&(b=b.replace("sd",""));var E=G?Y.includes("selected")||Y.includes("range"):Y.includes("today");return a.default.createElement("div",{key:i,tabIndex:E?0:-1,"aria-label":"Choose ".concat(e.date.format("dddd MMMM DD of YYYY")),className:Y,onMouseEnter:function(){return j&&$(e.date)},onKeyDown:function(r){return function(e,r){var a=e.currentTarget,o=e.key,i=e.code,u={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};if("Space"===i||" "===o)e.preventDefault(),a.click();else if(Object.keys(u).includes(o)){var c=function(e){if(!e)return s();var r=e.getAttribute("class");r.includes("hidden")||r.includes("disabled")?s():e.focus()},s=function(){n(l(l({},t),{},{date:p})),clearTimeout(O),O=setTimeout((function(){return c(Z(p))}),100)};e.preventDefault();var f=u[o],p=new d.default(r.date).add(f,"day"),m=Z(p);c(m)}}(r,e)},onClick:function(){X(e)&&!e.disabled&&function(e,r,n){var a,i,u,c=e.date,s=e.current,p=t.selectedDate,m=t.focused,h=t.date,g=h,b=g.hour,v=g.minute,x=g.second;c.set({hour:(null===(a=p)||void 0===a?void 0:a.hour)||b,minute:(null===(i=p)||void 0===i?void 0:i.minute)||v,second:(null===(u=p)||void 0===u?void 0:u.second)||x}),1!==n||s?n>1&&!s&&(0===r&&c<h&&(h=new d.default(h).toFirstOfMonth()),r>0&&c.monthIndex>h.monthIndex+r&&r+1===n&&(h=new d.default(h).toFirstOfMonth().add(1,"month"))):h=new d.default(h).toFirstOfMonth();var k=f(w(c,y,t),2);p=k[0],m=k[1],o(p,l(l({},t),{},{date:h,focused:m,selectedDate:p})),M(m,c)}(e,r,g)}},a.default.createElement("span",c({className:b},u),X(e)&&!e.hidden?null!=x?x:e.day:""))})))})))})));function X(e){return!!e.current||s}function Z(e){return T.current.querySelector("[aria-label*='".concat(e.format("dddd MMMM DD of YYYY"),"']"))}}function M(e){var r=e.direction,t=e.onClick,n=e.disabled;return a.default.createElement("button",{className:"rmdp-arrow-container ".concat(r," ").concat(n?"disabled":""),onClick:t,"aria-roledescription":"button to navigate ".concat(r.replace("rmdp-",""))},a.default.createElement("i",{className:"rmdp-arrow"}))}function E(r){var t=r.state,n=r.setState,o=r.disableYearPicker,d=r.disableMonthPicker,i=r.buttons,u=r.renderButton,c=r.handleMonthChange,s=r.disabled,p=r.hideMonth,m=r.hideYear,h=r.isRTL,y=r.fullYear,g=f(r.monthAndYears,2),b=g[0],v=g[1],x=r.monthYearSeparator,w=r.formatMonth,k=r.formatYear,D=r.headerOrder,O={},Y=t.date,E=t.onlyMonthPicker,P=t.onlyYearPicker,C=t.mustShowYearPicker,N=t.minDate,S=t.maxDate,I=t.year,j=t.today,R=N&&Y.year<=N.year&&N.monthIndex>Y.monthIndex-1,A=S&&Y.year>=S.year&&S.monthIndex<Y.monthIndex+1,T=j.year+7;if(T-=12*Math.floor((T-I)/12),(p||y)&&m&&!i)return null;if((E||y)&&(N&&N.year>=Y.year&&(R=!0),S&&S.year<=Y.year&&(A=!0)),C||P){var L=T-11;R=N&&N.year>L,A=S&&S.year<T}return s&&(R=!0,A=!0),a.default.createElement("div",{className:"rmdp-header"},a.default.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},Array.from(new Set(D)).map((function(r,t){return a.default.createElement(e.Fragment,{key:t},function(r){switch(r){case"LEFT_BUTTON":return i&&W("left");case"RIGHT_BUTTON":return i&&W("right");case"MONTH_YEAR":case"YEAR_MONTH":if(y)return a.default.createElement("div",{className:"rmdp-header-values",style:O},!m&&Y.format("YYYY"));var t=r.split("_").filter((function(e){return"MONTH"===e&&!p||"YEAR"===e&&!m}));return t.length>1&&(t=[t[0],F(),t[1]]),b.map((function(r,n){return a.default.createElement("div",{key:n,className:"rmdp-header-values",style:O},t.map((function(t,i){return a.default.createElement(e.Fragment,{key:i},function(e,r,t){switch(e){case"MONTH":return a.default.createElement("span",{style:{cursor:s||d||E?"default":"pointer"},onClick:function(){return!d&&_("mustShowMonthPicker")}},function(e,r){return"function"==typeof w?w(e,r):e}(r,v[t]));case"YEAR":return a.default.createElement("span",{style:{cursor:s||o||P?"default":"pointer"},onClick:function(){return!o&&_("mustShowYearPicker")}},function(e,r){return"function"==typeof w?k(e,r):e}(v[t],r));default:return e}}(t,r,n))})))}));default:return}}(r))}))));function F(){return x?a.default.createElement("span",null,x):h?"،":","}function W(r){var t=function(e){e.preventDefault(),B("right"===r?1:-1),function(e){setTimeout((function(){var r=e.target.closest(".rmdp-calendar");if(r){var t=r.querySelector("div[tabindex='0']");t&&t.getAttribute("class").includes("hidden")&&(t.setAttribute("tabindex","-1"),t=void 0),t||(t=r.querySelector("div[tabindex='-1']:not(.rmdp-day-hidden)"))&&t.setAttribute("tabindex","0")}}),200)}(e)},n="left"===r&&R||"right"===r&&A;return u instanceof Function?u(r,t,n):e.isValidElement(u)?e.cloneElement(u,{direction:r,handleClick:t,disabled:n}):a.default.createElement(M,{direction:"rmdp-".concat(r),onClick:t,disabled:n})}function B(e){s||e<0&&R||e>0&&A||(y?Y.year+=e:C||P?(I+=12*e,e<0&&N&&I<N.year&&(I=N.year),e>0&&S&&I>S.year&&(I=S.year)):(Y.toFirstOfMonth(),E?Y.year+=e:(Y.month+=e,c(Y))),n(l(l({},t),{},{date:Y,year:I})))}function _(e){if(!s){var r={mustShowMonthPicker:!1,mustShowYearPicker:!1};r[e]=!t[e],n(l(l({},t),r))}}}function P(e){return g(e)||(e=[]),JSON.stringify(e)}function C(r){var t=r.state,n=r.onChange,o=r.customMonths,i=r.sort,u=r.handleMonthChange,c=r.handleFocusedDate,s=r.rangeHover,p=r.highlightToday,m=r.numberOfMonths,h=t.date,y=t.today,b=t.minDate,x=t.maxDate,O=t.calendar,Y=t.locale,M=t.onlyMonthPicker,E=t.onlyYearPicker,C=t.range,N=t.onlyShowInRangeDates,S=(t.mustShowMonthPicker||M)&&!E,I=f(e.useState(),2),j=I[0],R=I[1];o=o&&P(o);var A=e.useMemo((function(){var e=[],r=M?m:1,n=o&&JSON.parse(o),a=new d.default({calendar:O,locale:Y,format:t.date._format,year:t.date.year,month:1,day:1});g(n)&&n.length>=12?(n.length=12,n=n.map((function(e){return g(e)?e[0]:e}))):n=a.locale.months.map((function(e){return f(e,1)[0]}));for(var i=0;i<r;i++){for(var l=[],u=0,c=0;c<4;c++){for(var s=[],p=0;p<3;p++)s.push({date:new d.default(a),name:n[u]}),u++,a.add(1,"month");l.push(s)}e.push(l)}return e}),[O,Y,o,t.date.year,t.date._format,m,M]);return a.default.createElement("div",{className:"".concat(M?"only ":"","rmdp-month-picker"),style:{display:S?"flex":"none"},onMouseLeave:function(){return s&&R()}},A.map((function(e,r){return a.default.createElement("div",{key:r,style:{margin:"0 5px",flex:1}},e.map((function(e,r){return a.default.createElement("div",{key:r,className:"rmdp-ym"},e.map((function(e,r){var t=e.date,n=e.name;return a.default.createElement("div",{key:r,className:L(t),onClick:function(){return T(t)},onMouseEnter:function(){return s&&R(t)}},a.default.createElement("span",{className:M?"sd":""},n))})))})))})));function T(e){var r=t.selectedDate,a=t.focused,o=e.year,d=e.monthIndex;if(!(b&&o<=b.year&&d<b.monthIndex||x&&o>=x.year&&d>x.monthIndex)){if(h.setMonth(d+1),M){var s=f(w(e,i,t),2);r=s[0],a=s[1]}else u(h);n(M?r:void 0,l(l({},t),{},{date:h,focused:a,selectedDate:r,mustShowMonthPicker:!1})),M&&c(a,e)}}function L(e){var r=["rmdp-day"],n=e.year,a=e.monthIndex,o=t.selectedDate,d=t.multiple;if((b&&(n<b.year||n===b.year&&a<b.monthIndex)||x&&(n>x.year||n===x.year&&a>x.monthIndex))&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!N)return v(y,e,!0)&&p&&r.push("rmdp-today"),M?C?(r.push(k(e,o,!0,d)),d||(r=r.concat(D(e,o,j,s,"month")))):[].concat(o).some((function(r){return v(r,e,!0)}))&&r.push("rmdp-selected"):h.monthIndex===a&&r.push("rmdp-selected"),r.join(" ")}}function N(e,r){return e.replace(/[0-9]/g,(function(e){return r[e]}))}function S(r){var t=r.state,n=r.onChange,o=r.sort,i=r.handleFocusedDate,u=r.onYearChange,c=r.rangeHover,s=r.highlightToday,p=t.date,m=t.today,h=t.minDate,y=t.maxDate,b=t.onlyYearPicker,v=t.range,x=t.onlyShowInRangeDates,k=t.year,D=t.mustShowYearPicker||b,O=p.digits,Y=f(e.useState(),2),M=Y[0],E=Y[1],P=m.year-4;P-=12*Math.ceil((P-k)/12);var C=e.useMemo((function(){for(var e=[],r=P,t=0;t<4;t++){for(var n=[],a=0;a<3;a++)n.push(r),r++;e.push(n)}return e}),[P]);return a.default.createElement("div",{className:"".concat(b?"only ":"","rmdp-year-picker"),style:{display:D?"block":"none"}},C.map((function(e,r){return a.default.createElement("div",{key:r,className:"rmdp-ym",onMouseLeave:function(){return c&&E()}},e.map((function(e,r){return a.default.createElement("div",{key:r,className:S(e),onClick:function(){return function(e){if(I(e))return;var r=new d.default(t.date).setYear(e),a=t.selectedDate,c=t.focused;if(b){var s=f(w(r,o,t),2);a=s[0],c=s[1]}else h&&r.monthIndex<h.monthIndex?r=r.setMonth(h.monthIndex+1):y&&r.monthIndex>y.monthIndex&&(r=r.setMonth(y.monthIndex+1)),null==u||u(r);n(b?a:void 0,l(l({},t),{},{date:r,focused:c,selectedDate:a,mustShowYearPicker:!1})),b&&i(c,r)}(e)},onMouseEnter:function(){return c&&E(e)}},a.default.createElement("span",{className:b?"sd":""},N(e.toString(),O)))})))})));function S(e){var r=["rmdp-day"],n=t.date,a=t.selectedDate,o=t.multiple;if(I(e)&&r.push("rmdp-disabled"),!r.includes("rmdp-disabled")||!x){if(m.year===e&&s&&r.push("rmdp-today"),b)if(v){var d=function(t){var n=t[0],a=t[1];if(1===t.length){if(e===n.year&&r.push("rmdp-range"),c){var o=t[0].year;(e>o&&e<=M||e<o&&e>=M)&&(r.push("rmdp-range-hover"),e===M&&r.push(M>o?"end":"start"))}}else 2===t.length&&(e>=n.year&&e<=a.year&&r.push("rmdp-range"),e===n.year&&r.push("start"),e===a.year&&r.push("end"))};o?(g(a)?a:[[a]]).forEach((function(e){return d(e)})):d(a)}else[].concat(a).some((function(r){return r&&r.year===e}))&&r.push("rmdp-selected");else e===n.year&&r.push("rmdp-selected");return r.join(" ")}}function I(e){return h&&e<h.year||y&&e>y.year}}function I(e,r,t){return t||(e?"MM/YYYY":r?"YYYY":"YYYY/MM/DD")}function j(e,r){return e instanceof d.default?e.setCalendar(r):e=new d.default({date:e,calendar:r}),e}function R(e){"_self"in a.default.createElement("div")&&console.warn(e.join("\n"))}var A=new d.default,T=A.calendar,L=A.locale;function F(e,r){return e&&e.constructor!==Object&&(R(W("calendar")),e=void 0),r&&r.constructor!==Object&&(R(W("locale")),r=void 0),[e||T,r||L]}function W(e){return["".concat(e," must be an object"),"https://shahabyazdi.github.io/react-multi-date-picker/calendars/"]}function B(e){return e&&e.name?e.name.split("_")[1]:""}function _(e){return["fa","ar"].includes(B(e))}function V(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}V(".rmdp-wrapper{background-color:#fff;border-radius:5px;direction:ltr;text-align:center;width:max-content}.rmdp-shadow{box-shadow:0 0 5px #8798ad}.rmdp-border{border:1px solid #cfd8e2}.rmdp-calendar{height:max-content;padding:4px}.rmdp-border-top{border-top:1px solid #cfd8e2}.rmdp-border-bottom{border-bottom:1px solid #cfd8e2}.rmdp-border-left{border-left:1px solid #cfd8e2}.rmdp-border-right{border-right:1px solid #cfd8e2}.rmdp-week,.rmdp-ym{display:flex;justify-content:space-between}.rmdp-ym{height:25%}.rmdp-day,.rmdp-week-day{color:#000;cursor:pointer;height:34px;position:relative;width:34px}.rmdp-week-day{color:#0074d9;cursor:default;font-size:13px;font-weight:500}.rmdp-day span,.rmdp-week-day{display:flex;flex-direction:column;justify-content:center}.rmdp-day span{border-radius:50%;bottom:3px;font-size:14px;left:3px;position:absolute;right:3px;top:3px}.rmdp-day.rmdp-today span{background-color:#7fdbff;color:#fff}.rmdp-day.rmdp-selected span:not(.highlight){background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-day.rmdp-deactive,.rmdp-day.rmdp-disabled{color:#8798ad}.rmdp-day.rmdp-deactive.rmdp-selected span{background-color:#4ca6f5;box-shadow:0 0 3px #bac5d3}.rmdp-ym .rmdp-day{flex:1;margin:auto}.rmdp-ym .rmdp-day span{border-radius:12px;padding:2px 0}.rmdp-range{background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-range-hover{background-color:#7ea6f0;color:#fff}.rmdp-range-hover.start,.rmdp-range.start{border-bottom-left-radius:50%;border-top-left-radius:50%}.rmdp-range-hover.end,.rmdp-range.end{border-bottom-right-radius:50%;border-top-right-radius:50%}.rmdp-ym .rmdp-range-hover.start,.rmdp-ym .rmdp-range.start{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-ym .rmdp-range-hover.end,.rmdp-ym .rmdp-range.end{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover{background-color:#7ea6f0;color:#fff}.rmdp-day-picker{padding:5px}.rmdp-header{font-size:14px;margin-top:5px;padding:9px 0}.rmdp-month-picker,.rmdp-year-picker{background-color:#fff;border-radius:0 0 5px 5px;bottom:2px;left:2px;position:absolute;right:2px;top:2px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:240px;position:static;width:240px}.rmdp-header-values{color:#000;margin:auto}.rmdp-header-values span{padding:0 0 0 5px}.rmdp-arrow{border:solid #0074d9;border-width:0 2px 2px 0;display:inline-block;height:3px;margin-top:5px;padding:2px;width:3px}.rmdp-right i{margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-left i{margin-left:3px;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-left{left:0}.rmdp-right{right:0}.rmdp-arrow-container{background:transparent;border:none;border-radius:50%;cursor:pointer;display:flex;height:20px;justify-content:center;margin:0 5px;padding:0;width:20px}.rmdp-arrow-container:hover{background-color:#0074d9;box-shadow:0 0 3px #8798ad}.rmdp-arrow-container:hover .rmdp-arrow{border:solid #fff;border-width:0 2px 2px 0}.rmdp-arrow-container.disabled{cursor:default}.rmdp-arrow-container.disabled:hover{background-color:inherit;box-shadow:inherit}.rmdp-arrow-container.disabled .rmdp-arrow,.rmdp-arrow-container.disabled:hover .rmdp-arrow{border:solid gray;border-width:0 2px 2px 0}.rmdp-rtl{direction:rtl}.rmdp-rtl .rmdp-left i{margin-left:0;margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-rtl .rmdp-right i{margin-left:3px;margin-right:0;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-rtl .rmdp-right{left:0;right:auto}.rmdp-rtl .rmdp-left{left:auto;right:0}.rmdp-rtl .rmdp-range-hover.start,.rmdp-rtl .rmdp-range.start{border-bottom-left-radius:unset;border-bottom-right-radius:50%;border-top-left-radius:unset;border-top-right-radius:50%}.rmdp-rtl .rmdp-range-hover.end,.rmdp-rtl .rmdp-range.end{border-bottom-left-radius:50%;border-bottom-right-radius:unset;border-top-left-radius:50%;border-top-right-radius:unset}.rmdp-rtl .rmdp-range.start.end{border-radius:50%}.rmdp-rtl .rmdp-ym .rmdp-range-hover.start,.rmdp-rtl .rmdp-ym .rmdp-range.start{border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-rtl .rmdp-ym .rmdp-range-hover.end,.rmdp-rtl .rmdp-ym .rmdp-range.end{border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-day-hidden,.rmdp-day.rmdp-disabled{cursor:default}.rmdp-selected .highlight{box-shadow:0 0 3px #8798ad}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-red:hover{background-color:#ff6687}.rmdp-day:not(.rmdp-deactive) .highlight-red{color:#cc0303}.rmdp-day.rmdp-deactive .highlight-red{color:#e08e8e}.rmdp-day.rmdp-selected .highlight-red{background-color:#ea0034;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-red{background-color:#e4b0ba;color:#fff}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-green:hover{background-color:#4db6ac}.rmdp-day:not(.rmdp-deactive) .highlight-green{color:#00796b}.rmdp-day.rmdp-deactive .highlight-green{color:#7ab3ac}.rmdp-day.rmdp-selected .highlight-green{background-color:#009688;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-green{background-color:#749c98;color:#fff}.rmdp-day-hidden,.rmdp-day-hidden:hover span{background-color:unset;color:transparent}.rmdp-month-name{cursor:default;font-size:14px;margin:3px 0}.rmdp-full-year{grid-template-columns:1fr 1fr 1fr}@media (max-height:450px),(max-width:450px){.rmdp-day,.rmdp-week-day{height:28px;width:28px}.rmdp-day span{font-size:12px;padding-left:.5px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:200px;width:230px}.rmdp-header{padding:3px 0 0}.rmdp-header,.rmdp-month-name{font-size:12px}.rmdp-full-year{grid-template-columns:1fr 1fr}}");var z=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","range","multiple","className","role","weekDays","months","children","onChange","showOtherDays","minDate","maxDate","mapDays","disableMonthPicker","disableYearPicker","formattingIgnoreList","onReady","onlyShowInRangeDates","zIndex","plugins","sort","numberOfMonths","currentDate","digits","buttons","renderButton","weekStartDayIndex","disableDayPicker","onPropsChange","onMonthChange","onYearChange","onFocusedDateChange","readOnly","disabled","hideMonth","hideYear","hideWeekDays","shadow","fullYear","displayWeekNumbers","weekNumber","weekPicker","rangeHover","monthYearSeparator","formatMonth","formatYear","highlightToday","headerOrder","style"],H=["datePickerProps","DatePicker"];function q(r,t){var n,o=r.value,i=r.calendar,u=r.locale,p=r.format,m=r.onlyMonthPicker,h=r.onlyYearPicker,y=r.range,b=void 0!==y&&y,v=r.multiple,x=void 0!==v&&v,w=r.className,k=r.role,D=r.weekDays,O=r.months,M=r.children,j=r.onChange,R=r.showOtherDays,A=r.minDate,T=r.maxDate,L=r.mapDays,W=r.disableMonthPicker,B=r.disableYearPicker,V=r.formattingIgnoreList,q=r.onReady,J=r.onlyShowInRangeDates,$=void 0===J||J,G=r.zIndex,Q=void 0===G?100:G,X=r.plugins,Z=void 0===X?[]:X,ee=r.sort,re=r.numberOfMonths,te=void 0===re?1:re,ne=r.currentDate,ae=r.digits,oe=r.buttons,de=void 0===oe||oe,ie=r.renderButton,le=r.weekStartDayIndex,ue=void 0===le?0:le,ce=r.disableDayPicker,se=r.onPropsChange,fe=r.onMonthChange,pe=r.onYearChange,me=r.onFocusedDateChange,he=r.readOnly,ye=r.disabled,ge=r.hideMonth,be=r.hideYear,ve=r.hideWeekDays,xe=r.shadow,we=void 0===xe||xe,ke=r.fullYear,De=r.displayWeekNumbers,Oe=r.weekNumber,Ye=r.weekPicker,Me=r.rangeHover,Ee=r.monthYearSeparator,Pe=r.formatMonth,Ce=r.formatYear,Ne=r.highlightToday,Se=void 0===Ne||Ne,Ie=r.headerOrder,je=void 0===Ie?["LEFT_BUTTON","MONTH_YEAR","RIGHT_BUTTON"]:Ie,Re=r.style,Ae=void 0===Re?{}:Re;s(r,z),!ne||ne instanceof d.default||(console.warn("currentDate must be instance of DateObject"),ne=void 0),("number"!=typeof ue||ue<0||ue>6)&&(ue=0),("number"!=typeof te||te<1||h)&&(te=1),!(x||b||g(o))||b||x||(x=!0),Ye&&(b=!0,x=!1),ke&&(te=12,m=!1,h=!1),h&&!ge&&(ge=!0);var Te=F(i,u),Le=f(Te,2);i=Le[0],u=Le[1],p=I(m,h,p),V=P(V),L=[].concat(L).filter(Boolean),Z=[].concat.apply([],Z);var Fe=e.useState({}),We=f(Fe,2),Be=We[0],_e=We[1],Ve={},ze=e.useRef({mustCallOnReady:!0,currentDate:ne});e.useEffect((function(){_e((function(e){var r=ze.current.currentDate,t=e.date,n=e.selectedDate,a=e.initialValue,c=e.focused,s=e.mustSortDates;function f(e){if(e)return e.calendar.name!==i.name&&e.setCalendar(i),e.locale.name!==u.name&&e.setLocale(u),e._format!==p&&e.setFormat(p),e.digits=ae,e.ignoreList=JSON.parse(V),e}function y(e){return new d.default(r||e)}if(o)if(g(n=U(o,i,u,p)))t||(t=y(n.flat()[0]));else if(t&&1!==te){var v=new d.default(t).toFirstOfMonth(),w=new d.default(t).add(te-1,m?"years":"months").toLastOfMonth();(n<v||n>w)&&(t=new d.default(n))}else t=y(n);else t||(t=y({calendar:i,locale:u,format:p})),a&&(n=void 0);if([].concat(n).flat().forEach(f),f(t),x||b||g(o)){if(n||(n=[]),g(n)||(n=x&&b?[[n]]:[n]),b&&!x&&n.length>2){var k=n[n.length-1];n=[n[0],k],c=k}x&&!b&&ee&&!s?(s=!0,n.sort((function(e,r){return e-r}))):b&&!x&&n.sort((function(e,r){return e-r}))}else g(n)&&(n=n.flat()[n.length-1]);return ke&&t.toFirstOfYear(),delete ze.current.currentDate,l(l({},e),{},{date:t,selectedDate:n,multiple:x,range:b,onlyMonthPicker:m,onlyYearPicker:h,initialValue:e.initialValue||o,value:o,focused:c,calendar:i,locale:u,format:p,mustSortDates:s,year:t.year,today:f(e.today)||new d.default({calendar:i}),weekPicker:Ye})}))}),[o,i,u,p,m,h,b,x,ee,te,ae,V,ke,Ye]),e.useEffect((function(){(A||T)&&_e((function(e){var r=e.calendar,t=e.locale,n=e.format,a=f(K(U(o,r,t,n),A,T,r),3),d=a[0],i=a[1],u=a[2];return l(l({},e),{},{inRangeDates:$?d:e.selectedDate,minDate:i,maxDate:u})}))}),[A,T,$,o]),Be.today&&!ze.current.isReady&&(ze.current.isReady=!0),e.useEffect((function(){ze.current.isReady&&ze.current.mustCallOnReady&&q instanceof Function&&(ze.current.mustCallOnReady=!1,q())}),[ze.current.isReady,q]);var He="rmdp-top-class "+nr(["top","bottom"]),qe={top:[],bottom:[],left:[],right:[]},Je=_(null===(n=Be.date)||void 0===n?void 0:n.locale),Ke={state:Be,setState:_e,onChange:Ze,sort:ee,handleFocusedDate:rr,isRTL:Je,fullYear:ke,monthAndYears:dr(),rangeHover:Me,highlightToday:Se,numberOfMonths:te},Ue=arguments[0],$e=Ue.datePickerProps,Ge=Ue.DatePicker,Qe=s(Ue,H);return Xe(),Be.today?a.default.createElement("div",{ref:or,role:k||"dialog",className:"rmdp-wrapper rmdp-".concat(we?"shadow":"border"," ").concat(w||""),style:l({zIndex:Q},Ae)},qe.top,a.default.createElement("div",{style:{display:"flex"},className:He},qe.left,!ce&&a.default.createElement("div",{className:"rmdp-calendar ".concat(Je?"rmdp-rtl":""," ").concat(nr(["left","right"]))},a.default.createElement(E,l(l({},Ke),{},{disableYearPicker:B,disableMonthPicker:W,buttons:de,renderButton:ie,handleMonthChange:tr,disabled:ye,hideMonth:ge,hideYear:be,monthYearSeparator:Ee,formatMonth:Pe,formatYear:Ce,headerOrder:je})),a.default.createElement("div",{style:{position:"relative"}},a.default.createElement(Y,l(l({},Ke),{},{showOtherDays:R,mapDays:L,onlyShowInRangeDates:$,customWeekDays:D,weekStartDayIndex:ue,hideWeekDays:ve,displayWeekNumbers:De,weekNumber:Oe})),!ke&&a.default.createElement(a.default.Fragment,null,!W&&a.default.createElement(C,c({},Ke,{customMonths:O,handleMonthChange:tr})),!B&&a.default.createElement(S,c({},Ke,{onYearChange:pe}))))),qe.right),qe.bottom,M):null;function Xe(){if(ze.current.isReady&&g(Z)){var r={state:Be,setState:_e,registerListener:ar,calendarProps:Qe,datePickerProps:$e,handleChange:Ze,Calendar:ze.current.Calendar,DatePicker:Ge,handlePropsChange:er,handleFocusedDate:function(e){return rr(e)}},t=function(e){return ce?"bottom":e.props.position||"right"};Z.forEach((function(n,a){if("string"!=typeof n.type){var o={},d=t(n);if(qe[d]&&!n.props.disabled){for(var i=0;i<Z.length;i++)if("string"!=typeof Z[i].type&&!Z[i].props.disabled){if(4===Object.keys(o).length)break;var u=t(Z[i]);["top","bottom"].includes(d)?(u===d&&i>a&&(o.bottom=!0),u===d&&i<a&&(o.top=!0)):(He.includes("border-top")&&(o.top=!0),He.includes("border-bottom")&&(o.bottom=!0),u===d&&i>a&&(o.right=!0),u===d&&i<a&&(o.left=!0))}qe[d].push(e.cloneElement(n,l({key:a,position:d,nodes:o},r)))}}else"mapDays"===n.type&&L.push(n.fn(r))}))}}function Ze(e,r){if(!ye){if(e||null===e){if(he)return;Ve.change&&Ve.change.forEach((function(r){return r(e)}))}if(e||null===e){var t=null==j?void 0:j(e);r&&!1!==t&&_e(r)}else r&&_e(r);er({value:e})}}function er(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!he&&!ye){var t=l(l(l(l({},Qe),$e),r),{},{value:null!==(e=r.value)&&void 0!==e?e:Be.selectedDate});delete t.onPropsChange,null==se||se(t)}}function rr(e,r){he||ye||null==me||me(e,r)}function tr(e){null==fe||fe(e)}function nr(e){return ce||!g(Z)?"":Array.from(new Set(Z.map((function(r){if(!r.props)return"";var t=r.props.position||"right";return e.includes(t)&&!r.props.disabled?"rmdp-border-"+t:""})))).join(" ")}function ar(e,r){Ve[e]||(Ve[e]=[]),Ve[e].push(r)}function or(e){if(e&&(e.date=Be.date,e.set=function(e,r){ye||_e(l(l({},Be),{},{date:new d.default(Be.date.set(e,r))}))}),ze.current.Calendar=e,t instanceof Function)return t(e);t&&(t.current=e)}function dr(){var e=Be.date;if(!e)return[];for(var r=[],t=[],n=e.digits,a=0;a<te;a++){var o=void 0,d=e.year,i=e.monthIndex+a;if(m&&(d+=a),i>11&&(i-=12,m||d++),g(O)&&O.length>=12){var l=O[i];o=g(l)?l[0]:l}else o=e.months[i].name;d=N(d.toString(),n),r.push(o),t.push(d)}return[r,t]}}var J=e.forwardRef(q);function K(e,r,t,n){return r&&(r=j(r,n).set({hour:0,minute:0,second:0,millisecond:0})),t&&(t=j(t,n).set({hour:23,minute:59,second:59,millisecond:999})),g(e)&&(e=e.filter((function(e){return!(r&&e<r)&&!(t&&e>t)}))),[e,r,t]}function U(e,r,t,n){var a=[].concat(e).map((function(e){return g(e)?e.map(o).filter(i):o(e)})).filter(i);return g(e)?a:a.flat()[0];function o(e){return e?e instanceof d.default?e:new d.default({date:e,calendar:r,locale:t,format:n}):{}}function i(e){return g(e)||e.isValid}}V('.rmdp-visible{visibility:visible}.rmdp-invisible{visibility:hidden}.rmdp-input{border:1px solid #c0c4d6;border-radius:5px;height:22px;margin:1px 0;padding:2px 5px}.rmdp-input:focus{border:1px solid #a4b3c5;box-shadow:0 0 2px #a4b3c5;outline:none!important}.rmdp-button{background-color:#0074d9;border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-block;padding:7px 16px;text-align:center;text-decoration:none;transition:.3s}.rmdp-button:hover{background-color:#143ac5;transition:.4s}.rmdp-button:disabled{background-color:#8798ad}.rmdp-action-button{border-radius:unset;color:#2682d3;float:right;font-weight:700;margin:15px 10px 15px 0}.rmdp-action-button,.rmdp-action-button:hover{background-color:transparent}.rmdp-ep-arrow{overflow:hidden;will-change:transform}.rmdp-ep-arrow:after{background-color:#fff;content:"";height:12px;position:absolute;transform:rotate(45deg);width:12px}.rmdp-ep-shadow:after{box-shadow:0 0 6px #8798ad}.rmdp-ep-border:after{border:1px solid #cfd8e2}.rmdp-ep-arrow[direction=top]{border-bottom:1px solid #fff}.rmdp-ep-arrow[direction=left]{border-right:1px solid #fff}.rmdp-ep-arrow[direction=right]{border-left:1px solid #fff;margin-left:-1px}.rmdp-ep-arrow[direction=bottom]{border-top:1px solid #fff;margin-top:-1.5px}.rmdp-ep-arrow[direction=top]:after{left:4px;top:5px}.rmdp-ep-arrow[direction=bottom]:after{left:4px;top:-6px}.rmdp-ep-arrow[direction=left]:after{left:5px;top:3px}.rmdp-ep-arrow[direction=right]:after{left:-6px;top:3px}');var $=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","onChange","range","multiple","name","id","title","placeholder","required","style","className","inputClass","disabled","render","weekDays","months","children","inputMode","scrollSensitive","hideOnScroll","minDate","maxDate","formattingIgnoreList","containerClassName","calendarPosition","editable","onOpen","onClose","arrowClassName","zIndex","arrow","fixMainPosition","onPositionChange","onPropsChange","digits","readOnly","shadow","onFocusedDateChange","type","weekPicker","mobileLabels","onOpenPickNewDate","mobileButtons","dateSeparator","multipleRangeSeparator"],G=["label"];function Q(r,t){var n=r.value,i=r.calendar,u=r.locale,p=r.format,m=r.onlyMonthPicker,h=r.onlyYearPicker,b=r.onChange,v=r.range,x=void 0!==v&&v,w=r.multiple,k=void 0!==w&&w,D=r.name,O=r.id,Y=r.title,M=r.placeholder,E=r.required,C=r.style,S=void 0===C?{}:C,j=r.className,R=void 0===j?"":j,A=r.inputClass,T=r.disabled,L=r.render,W=r.weekDays,V=r.months,z=r.children,H=r.inputMode,q=r.scrollSensitive,K=void 0===q||q,U=r.hideOnScroll,Q=r.minDate,X=r.maxDate,re=r.formattingIgnoreList,te=r.containerClassName,ne=void 0===te?"":te,ae=r.calendarPosition,oe=void 0===ae?"bottom-left":ae,de=r.editable,ie=void 0===de||de,le=r.onOpen,ue=r.onClose,ce=r.arrowClassName,se=void 0===ce?"":ce,fe=r.zIndex,pe=void 0===fe?100:fe,me=r.arrow,he=void 0===me||me,ye=r.fixMainPosition,ge=r.onPositionChange,be=r.onPropsChange,ve=r.digits,xe=r.readOnly,we=r.shadow,ke=void 0===we||we,De=r.onFocusedDateChange,Oe=r.type,Ye=r.weekPicker,Me=r.mobileLabels,Ee=r.onOpenPickNewDate,Pe=void 0===Ee||Ee,Ce=r.mobileButtons,Ne=void 0===Ce?[]:Ce,Se=r.dateSeparator,Ie=r.multipleRangeSeparator,je=void 0===Ie?",":Ie,Re=s(r,$),Ae=e.useState(),Te=f(Ae,2),Le=Te[0],Fe=Te[1],We=e.useState(),Be=f(We,2),_e=Be[0],Ve=Be[1],ze=e.useState(""),He=f(ze,2),qe=He[0],Je=He[1],Ke=e.useState(!1),Ue=f(Ke,2),$e=Ue[0],Ge=Ue[1],Qe=e.useState(!1),Xe=f(Qe,2),Ze=Xe[0],er=Xe[1],rr=e.useRef(),tr=e.useRef(),nr=e.useRef(),ar=e.useRef({}),or=Se||(x||Ye?" ~ ":", "),dr=arguments[0],ir=hr(),lr=e.useCallback((function(){if(!1!==(null==ue?void 0:ue())){var e=ee(tr);if(e&&e.forEach((function(e){return e.blur()})),ar.current.mobile){var r=nr.current.parentNode.parentNode;r.classList.remove("rmdp-calendar-container-mobile"),r.style.position="absolute",r.style.visibility="hidden"}Ge(!1),er(!1)}}),[ue]),ur=[{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){Ve(void 0),lr()},label:gr("CANCEL")},{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){_e&&(xr(_e,!0),Ve(void 0)),lr()},label:gr("OK")}];ir&&!ar.current.mobile&&(ar.current=l(l({},ar.current),{},{mobile:!0})),!ir&&ar.current.mobile&&(ar.current=l(l({},ar.current),{},{mobile:!1})),re=P(re),p=I(m,h,p);var cr=F(i,u),sr=f(cr,2);return i=sr[0],u=sr[1],e.useEffect((function(){function e(e){if($e&&!ar.current.mobile){var r=[];if([tr.current,nr.current].forEach((function(t){!t||t.contains(e.target)||e.target.classList.contains("b-deselect")||e.target.parentNode.classList.contains("b-deselect")||r.push(t)})),2===r.length)return lr();nr.current&&nr.current.contains(e.target)&&(rr.current.removeTransition(),rr.current.refreshPosition())}}function r(){U&&$e&&lr()}return document.addEventListener("click",e,!1),document.addEventListener("scroll",r,!0),function(){document.removeEventListener("click",e,!1),document.removeEventListener("scroll",r,!0)}}),[lr,t,$e,U]),e.useEffect((function(){var e=n,r=ar.current,t=r.date,a=r.initialValue,o=function(){return e[e.length-1]};function c(e){if(e)return e instanceof d.default||(e=new d.default({date:e,calendar:i,locale:u,format:p})),e.calendar!==i&&e.setCalendar(i),e.set({weekDays:W,months:V,digits:ve,locale:u,format:p,ignoreList:JSON.parse(re)}),e}n||a||!t?a&&!n&&(a=void 0):e=t;var s="";if(x||k||g(e)){var m=function(e){return e=e.map(c).filter((function(e){return void 0!==e})),x&&e.length>2&&(e=[e[0],o()]),[e,Z(e,or)]};if(g(e)||(e=x&&k?e?[[e]]:[]:[e]),k&&x)e=e.map((function(r,t){var n=f(m(g(r)?r:[r]),2),a=n[0],o=n[1];return s+=o+(t<e.length-1?" ".concat(je," "):""),a}));else{var h=f(m(e),2);e=h[0],s=h[1]}s=s.toString().replace(/\s,\s$/,"")}else g(e)&&(e=o()),(e=c(e))&&(s=e.format());ee(tr).every((function(e){return document.activeElement!==e}))&&Je(s),ar.current=l(l({},ar.current),{},{date:e,separator:or,initialValue:a||n}),ar.current.mobile&&rr.current.isOpen?Ve(e):Fe(e)}),[n,i,u,p,x,k,or,m,h,W,V,ve,re]),e.useEffect((function(){var e=ar.current.selection;if(e){var r=ee(tr);0!==r.length&&(r.forEach((function(r){document.activeElement===r&&(r.setSelectionRange(e,e),ar.current.selection=void 0)})),rr.current.refreshPosition())}}),[qe]),(k||x||g(Le)||!ie)&&(H="none"),a.default.createElement(o.default,c({ref:fr,element:pr(),popper:$e&&mr(),active:!ir&&Ze,position:oe,arrow:!ir&&he,fixMainPosition:!K||ye,zIndex:pe,onChange:!ir&&ge,containerClassName:"rmdp-container ".concat(ne),arrowClassName:["rmdp-ep-arrow","rmdp-ep-".concat(ke?"shadow":"border"),R,se].join(" ")},Re));function fr(e){if(e&&(e.openCalendar=function(){return setTimeout((function(){return br()}),10)},e.closeCalendar=lr,e.isOpen=$e&&Ze),rr.current=e,t instanceof Function)return t(e);t&&(t.current=e)}function pr(){return L?a.default.createElement("div",{ref:tr},e.isValidElement(L)?e.cloneElement(L,{value:qe,openCalendar:br,onFocus:br,handleValueChange:wr,onChange:wr,locale:u,separator:or}):L instanceof Function?L(qe,br,wr,u,or):null):a.default.createElement("input",{ref:tr,type:Oe||"text",name:D,id:O,title:Y,required:E,onFocus:br,className:A||"rmdp-input",placeholder:M,value:qe,onChange:wr,style:S,autoComplete:"off",disabled:!!T,inputMode:H||(ir?"none":void 0),readOnly:xe})}function mr(){return a.default.createElement(J,c({ref:nr,value:_e||Le,onChange:xr,range:x,multiple:k,calendar:i,locale:u,format:p,onlyMonthPicker:m,onlyYearPicker:h,className:R+(ir?" rmdp-mobile":""),weekDays:W,months:V,digits:ve,minDate:Q,maxDate:X,formattingIgnoreList:JSON.parse(re),onPropsChange:be,shadow:ke,onReady:kr,DatePicker:rr.current,datePickerProps:dr,onFocusedDateChange:Dr,weekPicker:Ye},Re),z,ir&&yr())}function hr(){return"string"==typeof R&&R.includes("rmdp-mobile")}function yr(){var e=[].concat.apply([],dr.plugins||[]).some((function(e){var r=e.props;return!(void 0===r?{}:r).disabled}));return g(Ne)&&a.default.createElement("div",{className:"rmdp-action-buttons ".concat(_(u)?"rmdp-rtl":""," ").concat(e?"rmdp-border-top":"")},Ne.concat(ur).map((function(e,r){var t=e.label,n=s(e,G);return a.default.createElement("button",c({key:r},n),t)})))}function gr(e){var r,t=u||(new d.default).locale;if("string"!=typeof t.name)return e;return(null==Me?void 0:Me[e])||(null===(r={en:{OK:"OK",CANCEL:"CANCEL"},fa:{OK:"تأیید",CANCEL:"لغو"},ar:{OK:"تأكيد",CANCEL:"الغاء"},hi:{OK:"पुष्टि",CANCEL:"रद्द करें"}}[B(t)])||void 0===r?void 0:r[e])||e}function br(){if(!T&&!xe&&!1!==(null==le?void 0:le())){if(vr()){var e=new d.default({calendar:i,locale:u,format:p,months:V,weekDays:W,digits:ve,ignoreList:JSON.parse(re)});(!Q||e>Q)&&(!X||e<X)&&(xr(e),null==be||be(l(l({},dr),{},{value:e})),ar.current.date=e)}var r=ee(tr);ir&&r.length>0&&r.forEach((function(e){return e.blur()})),r.length>0||!$e?Ge(!0):lr()}}function vr(){return Pe&&!n&&!ar.current.date&&!x&&!k&&!ir}function xr(e,r,t){if(ir&&!r)return Ve(e);var n="";if(e&&(n=k&&x&&g(e)?e.map((function(e){return Z(e,or)})).join(" ".concat(je," ")):Z(e,or)),!1===(null==b?void 0:b(e,{validatedValue:n,input:tr.current,isTyping:!!t})))return Je(qe),!1;Fe(e),Je(t||n.toString().replace(/\s,\s$/,"")),ar.current=l(l({},ar.current),{},{date:e})}function wr(e){if(ie){ar.current.selection=e.target.selectionStart;var r=e.target.value,t={calendar:i,locale:u,format:p,ignoreList:JSON.parse(re)};if(ve=g(ve)?ve:u.digits,!r)return Je(""),xr(null);if(ve){var n,a,o=y(ve);try{for(o.s();!(n=o.n()).done;){var c=n.value;r=r.replace(new RegExp(c,"g"),ve.indexOf(c))}}catch(e){o.e(e)}finally{o.f()}a=g(Le)?k&&x?(r||"").split(je).filter(Boolean).map(f):f(r):s(r),xr(g(Le)||a.isValid?a:null,void 0,N(r,ve))}}function s(e){return/(?=.*Y)(?=.*M)(?=.*D)/.test(p)?new d.default(l(l({},t),{},{date:e})):new d.default(t).parse(e)}function f(e){return(e||"").split(or).filter(Boolean).map((function(e){return s(e.trim())}))}}function kr(){if(er(!0),ir){var e=nr.current.parentNode.parentNode;e.className="rmdp-calendar-container-mobile",e.style.position="fixed",e.style.transform="",setTimeout((function(){e.style.visibility="visible"}),50)}}function Dr(e,r){g(ar.current.date)||!r||ir||lr(),null==De||De(e,r)}}var X=e.forwardRef(Q);function Z(e,r){var t=[].concat(e).map((function(e){return null!=e&&e.isValid?e.format():""}));return t.toString=function(){return this.filter(Boolean).join(r)},t}function ee(e){return e.current?"INPUT"===e.current.tagName?[e.current]:Array.from(e.current.querySelectorAll("input")):[]}Object.defineProperty(exports,"DateObject",{enumerable:!0,get:function(){return d.default}}),exports.Calendar=J,exports.default=X,exports.getAllDatesInRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var t=e[0],n=e[e.length-1],a=[];if(!(t instanceof d.default&&n instanceof d.default&&t.isValid&&n.isValid&&!(t>n)))return[];for(t=new d.default(t),n=new d.default(n);t<=n;t.day++)a.push(r?t.toDate():new d.default(t));return a},exports.toDateObject=j; |
{ | ||
"name": "react-multi-date-picker", | ||
"version": "4.2.3", | ||
"version": "4.2.4", | ||
"description": "A simple React datepicker component for working with gregorian, persian, arabic and indian calendars with the ability to select the date by single, multiple, range and multiple range pickers.", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-date-object");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e),a=r(t);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function p(e){return Array.isArray(e)}function u(e,t){var r=[];return["left","right"].includes(e)?(t.left&&r.push("rmdp-border-left"),t.right&&r.push("rmdp-border-right")):(t.top&&r.push("rmdp-border-top"),t.bottom&&r.push("rmdp-border-bottom")),r.join(" ")}var s=["state","setState","position","registerListener","calendarProps","datePickerProps","handleChange","nodes","Calendar","DatePicker","handlePropsChange","handleFocusedDate"];!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".rmdp-panel{min-width:125px}.rmdp-panel-body{left:0;list-style:none;margin:0;overflow:auto;padding:0 5px;position:absolute;right:0;text-align:center}.rmdp-panel-body li{border-radius:3px;box-shadow:0 0 2px #8798ad;margin:4px 1px;overflow:hidden;position:relative}.rmdp-panel-body li,.rmdp-panel-body li.bg-blue{background-color:#0074d9}.rmdp-panel-body li.bg-red{background-color:#ea0034}.rmdp-panel-body li.bg-green{background-color:#009688}.rmdp-panel-body li.bg-yellow{background-color:#fad817}.rmdp-panel-body li.rmdp-focused{box-shadow:0 0 2px 1px #8798ad}.rmdp-panel-body li button{color:#fff;cursor:pointer}.rmdp-panel-body li .b-deselect{background-color:#0074d9;border:none;font-size:17px}.rmdp-panel-body li .b-deselect span{display:block;transform:rotate(45deg)}.rmdp-panel-body li div{display:grid;flex:1}.rmdp-panel-body li .b-date{background-color:transparent;border:none;font-size:14px;padding:4px}.rmdp-panel-header{color:#000;font-size:14px;height:38px;line-height:37px;margin-bottom:5px;margin-top:8px}.rmdp-panel-body::-webkit-scrollbar{height:7px;width:7px}.rmdp-panel-body::-webkit-scrollbar-thumb{background:#0074d9;border-radius:3px}.rmdp-panel-body::-webkit-scrollbar-thumb:hover{background:#0263b8}.rmdp-rtl .rmdp-panel-body li .b-deselect{left:5px;right:unset}.rmdp-flat .rmdp-panel-header{border-bottom:none;margin-top:8px}.rmdp-flat .rmdp-panel-body li{border-radius:0}@media (max-height:400px),(max-width:400px){.rmdp-panel{min-width:103px}.rmdp-panel-body{padding:0 2px}.rmdp-panel-body li{font-size:12px;margin:4px}.rmdp-panel-header{font-size:12px;height:32px;line-height:32px}.rmdp-panel-body span{font-size:12px}}");var f=["state","setState","position","nodes","handleChange","eachDaysInRange","sort","style","className","onClickDate","removeButton","header","markFocused","focusedClassName","handleFocusedDate","formatFunction"];exports.default=function(e){var t=e.state,r=e.setState,o=e.position,l=e.nodes,m=e.handleChange,b=e.eachDaysInRange,h=e.sort,y=e.style,g=void 0===y?{}:y,v=e.className,x=void 0===v?"":v,O=e.onClickDate,w=e.removeButton,k=void 0===w||w,j=e.header,P=e.markFocused,D=e.focusedClassName,C=void 0===D?"":D,E=e.handleFocusedDate,N=e.formatFunction,S=c(e,f),F=[],z=t.multiple,A=t.range,T=t.inRangeDates,B=t.selectedDate,R=t.date.locale,_=["rmdp-panel",o,u(o,l)];if(R=R.name.split("_")[1],z||A&&!b)F=(T||B).map((function(e,t){return p(e)?e.map((function(e){return{date:e,format:e.format(),index:t}})):{date:e,format:e.format(),index:t}}));else if(A&&b){var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var r=e[0],n=e[e.length-1],o=[];if(!(r instanceof a.default&&n instanceof a.default&&r.isValid&&n.isValid)||r>n)return[];for(r=new a.default(r),n=new a.default(n);r<=n;r.day++)o.push(t?r.toDate():new a.default(r));return o}(T||B);F=I.map((function(e,t){return{date:0===t||t===I.length-1?e:void 0,format:e.format(),index:t}}))}else B&&!p(B)&&(F=[{date:B,format:B.format(),index:0}]);return z&&"date"===h&&F.sort((function(e,t){return e.date-t.date})),z&&"color"===h&&F.every((function(e){return e.date.color}))&&F.sort((function(e,t){return e.date.color<t.date.color?-1:e.date.color>t.date.color?1:0})),["fa","ar"].includes(function(e){return e&&e.name?e.name.split("_")[1]:""}(R))&&_.push("rmdp-rtl"),n.default.createElement("div",i({className:"".concat(_.join(" ")," ").concat(x),style:d({display:"grid",gridTemplateRows:"auto 1fr"},g)},function(e){return e.state,e.setState,e.position,e.registerListener,e.calendarProps,e.datePickerProps,e.handleChange,e.nodes,e.Calendar,e.DatePicker,e.handlePropsChange,e.handleFocusedDate,c(e,s)}(S)),n.default.createElement("div",{className:"rmdp-panel-header"},j||{en:"Dates",fa:"تاریخ ها",ar:"تواریخ",hi:"खजूर"}[R]),n.default.createElement("div",{style:{position:"relative",overflow:"auto",height:["top","bottom"].includes(o)?"100px":""}},n.default.createElement("ul",{className:"rmdp-panel-body"},p(F)&&F.map((function(e,o){var l,i,c,u,s,f=p(e)?e[0]:e;return n.default.createElement("li",{key:o,style:{display:"flex"},className:"".concat(null!==(l=e.date)&&void 0!==l&&l.color?"bg-".concat(e.date.color):""," ").concat(P&&(null===(i=e.date)||void 0===i||null===(c=i.valueOf)||void 0===c?void 0:c.call(i))===(null===(u=t.focused)||void 0===u||null===(s=u.valueOf)||void 0===s?void 0:s.call(u))?C||"rmdp-focused":"")},n.default.createElement("div",null,[e].flat().map((function(e,o){return n.default.createElement("button",{key:o,type:"button",className:"b-date",onClick:function(){return function(e,n){if(q(e?B[n]:void 0),!e)return;r(d(d({},t),{},{date:new a.default(e),focused:z&&A?e:B[n]})),E(B[n])}(e.date,e.index)},style:{cursor:e.date?"pointer":"default"}},N?N(e):e.format)}))),f&&k&&n.default.createElement("button",{type:"button",ariaDescription:"The date ".concat(e.format," has been selected. Click to deselect it."),className:"b-deselect",onClick:function(){return function(e){var r,n;z&&A?(n=B[e].some((function(e){return e===t.focused}))?void 0:t.focused,r=B.filter((function(t,r){return r!==e}))):A||z?n=(r=B.filter((function(t,r){return r!==e}))).find((function(e){var r,n;return e.valueOf()===(null===(r=t.focused)||void 0===r||null===(n=r.valueOf)||void 0===n?void 0:n.call(r))})):(r=null,n=void 0);m(r,d(d({},t),{},{selectedDate:r,focused:n})),q(),E(n)}(f.index)}},n.default.createElement("span",null,"+")))})))));function q(e){O instanceof Function&&O(e)}}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-date-object");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e),a=r(t);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function p(e){return Array.isArray(e)}function u(e,t){var r=[];return["left","right"].includes(e)?(t.left&&r.push("rmdp-border-left"),t.right&&r.push("rmdp-border-right")):(t.top&&r.push("rmdp-border-top"),t.bottom&&r.push("rmdp-border-bottom")),r.join(" ")}var s=["state","setState","position","registerListener","calendarProps","datePickerProps","handleChange","nodes","Calendar","DatePicker","handlePropsChange","handleFocusedDate"];!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".rmdp-panel{min-width:125px}.rmdp-panel-body{left:0;list-style:none;margin:0;overflow:auto;padding:0 5px;position:absolute;right:0;text-align:center}.rmdp-panel-body li{border-radius:3px;box-shadow:0 0 2px #8798ad;margin:4px 1px;overflow:hidden;position:relative}.rmdp-panel-body li,.rmdp-panel-body li.bg-blue{background-color:#0074d9}.rmdp-panel-body li.bg-red{background-color:#ea0034}.rmdp-panel-body li.bg-green{background-color:#009688}.rmdp-panel-body li.bg-yellow{background-color:#fad817}.rmdp-panel-body li.rmdp-focused{box-shadow:0 0 2px 1px #8798ad}.rmdp-panel-body li button{color:#fff;cursor:pointer}.rmdp-panel-body li .b-deselect{background-color:#0074d9;border:none;font-size:17px}.rmdp-panel-body li .b-deselect span{display:block;transform:rotate(45deg)}.rmdp-panel-body li div{display:grid;flex:1}.rmdp-panel-body li .b-date{background-color:transparent;border:none;font-size:14px;padding:4px}.rmdp-panel-header{color:#000;font-size:14px;height:38px;line-height:37px;margin-bottom:5px;margin-top:8px}.rmdp-panel-body::-webkit-scrollbar{height:7px;width:7px}.rmdp-panel-body::-webkit-scrollbar-thumb{background:#0074d9;border-radius:3px}.rmdp-panel-body::-webkit-scrollbar-thumb:hover{background:#0263b8}.rmdp-rtl .rmdp-panel-body li .b-deselect{left:5px;right:unset}.rmdp-flat .rmdp-panel-header{border-bottom:none;margin-top:8px}.rmdp-flat .rmdp-panel-body li{border-radius:0}@media (max-height:400px),(max-width:400px){.rmdp-panel{min-width:103px}.rmdp-panel-body{padding:0 2px}.rmdp-panel-body li{font-size:12px;margin:4px}.rmdp-panel-header{font-size:12px;height:32px;line-height:32px}.rmdp-panel-body li .b-date,.rmdp-panel-body span{font-size:12px}}");var f=["state","setState","position","nodes","handleChange","eachDaysInRange","sort","style","className","onClickDate","removeButton","header","markFocused","focusedClassName","handleFocusedDate","formatFunction"];exports.default=function(e){var t=e.state,r=e.setState,o=e.position,l=e.nodes,m=e.handleChange,b=e.eachDaysInRange,h=e.sort,y=e.style,g=void 0===y?{}:y,v=e.className,x=void 0===v?"":v,O=e.onClickDate,w=e.removeButton,k=void 0===w||w,j=e.header,P=e.markFocused,C=e.focusedClassName,D=void 0===C?"":C,E=e.handleFocusedDate,N=e.formatFunction,S=c(e,f),F=[],z=t.multiple,A=t.range,T=t.inRangeDates,B=t.selectedDate,R=t.date.locale,_=["rmdp-panel",o,u(o,l)];if(R=R.name.split("_")[1],z||A&&!b)F=(T||B).map((function(e,t){return p(e)?e.map((function(e){return{date:e,format:e.format(),index:t}})):{date:e,format:e.format(),index:t}}));else if(A&&b){var I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(e))return[];var r=e[0],n=e[e.length-1],o=[];if(!(r instanceof a.default&&n instanceof a.default&&r.isValid&&n.isValid)||r>n)return[];for(r=new a.default(r),n=new a.default(n);r<=n;r.day++)o.push(t?r.toDate():new a.default(r));return o}(T||B);F=I.map((function(e,t){return{date:0===t||t===I.length-1?e:void 0,format:e.format(),index:t}}))}else B&&!p(B)&&(F=[{date:B,format:B.format(),index:0}]);return z&&"date"===h&&F.sort((function(e,t){return e.date-t.date})),z&&"color"===h&&F.every((function(e){return e.date.color}))&&F.sort((function(e,t){return e.date.color<t.date.color?-1:e.date.color>t.date.color?1:0})),["fa","ar"].includes(function(e){return e&&e.name?e.name.split("_")[1]:""}(R))&&_.push("rmdp-rtl"),n.default.createElement("div",i({className:"".concat(_.join(" ")," ").concat(x),style:d({display:"grid",gridTemplateRows:"auto 1fr"},g)},function(e){return e.state,e.setState,e.position,e.registerListener,e.calendarProps,e.datePickerProps,e.handleChange,e.nodes,e.Calendar,e.DatePicker,e.handlePropsChange,e.handleFocusedDate,c(e,s)}(S)),n.default.createElement("div",{className:"rmdp-panel-header"},j||{en:"Dates",fa:"تاریخ ها",ar:"تواریخ",hi:"खजूर"}[R]),n.default.createElement("div",{style:{position:"relative",overflow:"auto",height:["top","bottom"].includes(o)?"100px":""}},n.default.createElement("ul",{className:"rmdp-panel-body"},p(F)&&F.map((function(e,o){var l,i,c,u,s,f=p(e)?e[0]:e;return n.default.createElement("li",{key:o,style:{display:"flex"},className:"".concat(null!==(l=e.date)&&void 0!==l&&l.color?"bg-".concat(e.date.color):""," ").concat(P&&(null===(i=e.date)||void 0===i||null===(c=i.valueOf)||void 0===c?void 0:c.call(i))===(null===(u=t.focused)||void 0===u||null===(s=u.valueOf)||void 0===s?void 0:s.call(u))?D||"rmdp-focused":"")},n.default.createElement("div",null,[e].flat().map((function(e,o){return n.default.createElement("button",{key:o,type:"button",className:"b-date",onClick:function(){return function(e,n){if(q(e?B[n]:void 0),!e)return;r(d(d({},t),{},{date:new a.default(e),focused:z&&A?e:B[n]})),E(B[n])}(e.date,e.index)},style:{cursor:e.date?"pointer":"default"}},N?N(e):e.format)}))),f&&k&&n.default.createElement("button",{type:"button","aria-roledescription":"The date ".concat(e.format," has been selected. Click to deselect it."),className:"b-deselect",onClick:function(){return function(e){var r,n;z&&A?(n=B[e].some((function(e){return e===t.focused}))?void 0:t.focused,r=B.filter((function(t,r){return r!==e}))):A||z?n=(r=B.filter((function(t,r){return r!==e}))).find((function(e){var r,n;return e.valueOf()===(null===(r=t.focused)||void 0===r||null===(n=r.valueOf)||void 0===n?void 0:n.call(r))})):(r=null,n=void 0);m(r,d(d({},t),{},{selectedDate:r,focused:n})),q(),E(n)}(f.index)}},n.default.createElement("span",null,"+")))})))));function q(e){O instanceof Function&&O(e)}}; |
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
348065
2611