flatpickr-ce 4.8.0 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- /* flatpickr v4.8.0,, @license MIT */
2
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=n()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};function n(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a}var t=["onChange","onClose","onDayCreate","onDaysBuilt","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],a={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDaysBuilt:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},o=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},r=function(e){return!0===e?1:0};function l(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var c=function(e){return e instanceof Array?e:[e]};function s(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function d(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,n){return n(e)?e:e.parentNode?f(e.parentNode,n):void 0}function m(e,n){var t=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var p=function(){},h=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},v={D:p,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n),1)},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*r(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n),1)},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:p,m:function(e,n){e.setMonth(parseFloat(n)-1,1)},n:function(e,n){e.setMonth(parseFloat(n)-1,1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:p,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},D={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},C={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[C.w(e,n,t)]},F:function(e,n,t){return h(C.n(e,n,t)-1,!1,n)},G:function(e,n,t){return o(C.h(e,n,t))},H:function(e){return o(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[r(e.getHours()>11)]},M:function(e,n){return h(e.getMonth(),!0,n)},S:function(e){return o(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return o(e.getFullYear(),4)},d:function(e){return o(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return o(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return o(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},b={Y:0,y:0,F:1,M:1,m:1,n:1},y=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,a){var i=a||r;return void 0===t.formatDate||c?n.split("").map((function(n,a,o){return C[n]&&"\\"!==o[a-1]?C[n](e,i,t):"\\"!==n?n:""})).join(""):t.formatDate(e,n,i)}},M=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o;return function(e,n,i,o){var l;if(0===e||e){var c,s=o||r,d=e;if(e instanceof Date)c=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)c=new Date(e);else if("string"==typeof e){var u=n||(t||a).dateFormat,f=String(e).trim();if("today"===f)c=new Date,i=!0;else if(t&&t.parseDate)c=t.parseDate(e,u);else if(/Z$/.test(f)||/GMT$/.test(f))c=new Date(e);else{for(var m=void 0,g=[[],[],[]],p=0,h=0,C="";p<u.length;p++){var y=u[p],M="\\"===y,w="\\"===u[p-1]||M;if(D[y]&&!w){C+=D[y];var E=new RegExp(C).exec(e);E&&(m=!0)&&g[null!==(l=b[y])&&void 0!==l?l:2].push({fn:v[y],val:E[++h]})}else M||(C+=".")}c=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),g.forEach((function(e){return e.forEach((function(e){var n=e.fn,t=e.val;return c=n(c,t,s)||c}))})),c=m?c:void 0}}if(c instanceof Date&&!isNaN(c.getTime()))return!0===i&&c.setHours(0,0,0,0),c;t.errorHandler(new Error("Invalid date provided: "+d))}}};function w(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var E=function(e,n,t){return 3600*e+60*n+t},x=864e5;function T(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=e.maxDate.getSeconds())}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach((function(t){return e[t]=n[t]}))},i=0,o=n;i<o.length;i++){var r=o[i];a(r)}return e});var k=0;function I(p,v){var C={config:e(e({},a),F.defaultConfig),l10n:i},b={},I="flatpickr-"+ ++k,S=p.ownerDocument.defaultView||window,_=S.document,O=[];function Y(){var e;return(null===(e=C.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||_.activeElement}function A(e){return e.bind(C)}function P(){var e=C.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&S.requestAnimationFrame((function(){if(void 0!==C.calendarContainer&&(C.calendarContainer.style.visibility="hidden",C.calendarContainer.style.display="block"),void 0!==C.daysContainer){var n=(C.days.offsetWidth+1)*e.showMonths;C.daysContainer.style.width=n+"px",C.calendarContainer.style.width=n+(void 0!==C.weekWrapper?C.weekWrapper.offsetWidth:0)+"px",C.calendarContainer.style.removeProperty("visibility"),C.calendarContainer.style.removeProperty("display")}}))}function N(e){if(0===C.selectedDates.length){var n=void 0===C.config.minDate||w(new Date,C.config.minDate)>=0?new Date:new Date(C.config.minDate.getTime()),t=T(C.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),C.selectedDates=[n],C.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=g(e),a=t;void 0!==C.amPM&&t===C.amPM&&(C.amPM.textContent=C.l10n.amPM[r(C.amPM.textContent===C.l10n.amPM[0])]);var i=parseFloat(a.getAttribute("min")),l=parseFloat(a.getAttribute("max")),c=parseFloat(a.getAttribute("step")),s=parseInt(a.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==a.value&&2===a.value.length){var f=a===C.hourElement,m=a===C.minuteElement;u<i?(u=l+u+r(!f)+(r(f)&&r(!C.amPM)),m&&X(void 0,-1,C.hourElement)):u>l&&(u=a===C.hourElement?u-l-r(!C.amPM):i,m&&X(void 0,1,C.hourElement)),C.amPM&&f&&(1===c?u+s===23:Math.abs(u-s)>c)&&(C.amPM.textContent=C.l10n.amPM[r(C.amPM.textContent===C.l10n.amPM[0])]),a.value=o(u)}}(e);var a=C._input.value;j(),Ue(),C._input.value!==a&&C._debouncedChange()}function j(){if(void 0!==C.hourElement&&void 0!==C.minuteElement){var e,n,t=(parseInt(C.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(C.minuteElement.value,10)||0)%60,i=void 0!==C.secondElement?(parseInt(C.secondElement.value,10)||0)%60:0;void 0!==C.amPM&&(e=t,n=C.amPM.textContent,t=e%12+12*r(n===C.l10n.amPM[1]));var o=void 0!==C.config.minTime||C.config.minDate&&C.minDateHasTime&&C.latestSelectedDateObj&&0===w(C.latestSelectedDateObj,C.config.minDate,!0),l=void 0!==C.config.maxTime||C.config.maxDate&&C.maxDateHasTime&&C.latestSelectedDateObj&&0===w(C.latestSelectedDateObj,C.config.maxDate,!0);if(void 0!==C.config.maxTime&&void 0!==C.config.minTime&&C.config.minTime>C.config.maxTime){var c=E(C.config.minTime.getHours(),C.config.minTime.getMinutes(),C.config.minTime.getSeconds()),s=E(C.config.maxTime.getHours(),C.config.maxTime.getMinutes(),C.config.maxTime.getSeconds()),d=E(t,a,i);if(d>s&&d<c){var u=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]}(c);t=u[0],a=u[1],i=u[2]}}else{if(l){var f=void 0!==C.config.maxTime?C.config.maxTime:C.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes())),a===f.getMinutes()&&(i=Math.min(i,f.getSeconds()))}if(o){var m=void 0!==C.config.minTime?C.config.minTime:C.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&a<m.getMinutes()&&(a=m.getMinutes()),a===m.getMinutes()&&(i=Math.max(i,m.getSeconds()))}}L(t,a,i)}}function H(e){var n=e||C.latestSelectedDateObj;n&&n instanceof Date&&L(n.getHours(),n.getMinutes(),n.getSeconds())}function L(e,n,t){void 0!==C.latestSelectedDateObj&&C.latestSelectedDateObj.setHours(e%24,n,t||0,0),C.hourElement&&C.minuteElement&&!C.isMobile&&(C.hourElement.value=o(C.config.time_24hr?e:(12+e)%12+12*r(e%12==0)),C.minuteElement.value=o(n),void 0!==C.amPM&&(C.amPM.textContent=C.l10n.amPM[r(e>=12)]),void 0!==C.secondElement&&(C.secondElement.value=o(t)))}function R(e){var n=g(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ge(t)}function W(e,n,t,a){return n instanceof Array?n.forEach((function(n){return W(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return W(e,n,t,a)})):(e.addEventListener(n,t,a),void C._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function B(){Re("onChange")}function K(){O.forEach((function(e){return e.remove()})),O=[]}function J(){if(void 0!==C.timeContainer&&void 0!==C.minuteElement&&void 0!==C.hourElement){W(C.timeContainer,["increment"],N),W(C.timeContainer,"blur",N,{capture:!0}),W(C.timeContainer,"click",V),W([C.hourElement,C.minuteElement],["focus","click"],(function(e){return g(e).select()})),void 0!==C.secondElement&&W(C.secondElement,"focus",(function(){return C.secondElement&&C.secondElement.select()})),void 0!==C.amPM&&W(C.amPM,"click",(function(e){N(e)}))}}function U(e,n){var t=void 0!==e?C.parseDate(e):C.latestSelectedDateObj||(C.config.minDate&&C.config.minDate>C.now?C.config.minDate:C.config.maxDate&&C.config.maxDate<C.now?C.config.maxDate:C.now),a=C.currentYear,i=C.currentMonth;try{void 0!==t&&(C.currentYear=t.getFullYear(),C.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,C.config.errorHandler(e)}n&&q(a,i),C.redraw()}function q(e,n){C.currentYear!==e&&Re("onYearChange"),C.currentYear===e&&C.currentMonth===n||Re("onMonthChange")}function V(e){var n=g(e);~n.className.indexOf("arrow")&&X(e,n.classList.contains("arrowUp")?1:-1)}function X(e,n,t){var a=e&&g(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=We("increment");o.delta=n,i&&i.dispatchEvent(o)}function z(e,n,t,a){var i=pe(n,!0),o=d("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",C.formatDate(n,C.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===w(n,C.now)&&(C.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?o.tabIndex=-1:o.classList.add("flatpickr-disabled"),Be(n)&&(o.classList.add("selected"),i&&(C.selectedDateElem=o),"range"===C.config.mode&&(s(o,"startRange",C.selectedDates[0]&&0===w(n,C.selectedDates[0],!0)),s(o,"endRange",C.selectedDates[1]&&0===w(n,C.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange"))),"range"===C.config.mode&&function(e){return!("range"!==C.config.mode||C.selectedDates.length<2)&&(w(e,C.selectedDates[0])>=0&&w(e,C.selectedDates[1])<=0)}(n)&&!Be(n)&&o.classList.add("inRange"),C.weekNumbers&&1===C.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&C.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+C.config.getWeek(n)+"</span>"),Re("onDayCreate",o),o}function G(e){e.focus(),"range"===C.config.mode&&Me(e)}function Z(e){for(var n=e>0?0:C.config.showMonths-1,t=e>0?C.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=C.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&pe(c.dateObj))return c}}function $(e,n){for(var t=n>0?C.config.maxDate:C.config.minDate,a=0;a<=3653;a++){var i=new Date(e.getFullYear(),e.getMonth(),e.getDate()+a*n);if(void 0!==t&&w(i,t)*n>0)return;if(pe(i))return i}}function Q(e){for(var n=C.daysContainer.querySelectorAll(".flatpickr-day:not(.hidden)"),t=0;t<n.length;t++)if(0===w(n[t].dateObj,e))return n[t]}function ee(e){if(void 0===Q(e)){var n=12*C.currentYear+C.currentMonth,t=12*e.getFullYear()+e.getMonth();ue(t<n?t-n:t-(n+C.config.showMonths-1))}var a=Q(e);void 0!==a&&G(a)}function ne(e,n){if(void 0!==C.daysContainer&&C.rContainer.contains(C.daysContainer)){var t=Y(),a=n>0?1:-1,i=null!==t&&t.classList.contains("flatpickr-day")&&he(t),o=void 0!==e?e:i?t:void 0!==C.selectedDateElem&&he(C.selectedDateElem)?C.selectedDateElem:void 0!==C.todayDateElem&&he(C.todayDateElem)?C.todayDateElem:Z(a);if(void 0===o)void 0!==(r=0!==n?$(a>0?new Date(C.currentYear,C.currentMonth+C.config.showMonths,1):new Date(C.currentYear,C.currentMonth,0),a):void 0)?ee(r):C.daysContainer.focus();else if(i){var r,l=o.dateObj;void 0!==(r=$(new Date(l.getFullYear(),l.getMonth(),l.getDate()+n),a))&&ee(r)}else G(o)}}function te(e,n){for(var t=(new Date(e,n,1).getDay()-C.l10n.firstDayOfWeek+7)%7,a=C.utils.getDaysInMonth((n-1+12)%12,e),i=C.utils.getDaysInMonth(n,e),o=_.createDocumentFragment(),r=C.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-t,u=0;s<=a;s++,u++)o.appendChild(z("flatpickr-day "+l,new Date(e,n-1,s),0,u));for(s=1;s<=i;s++,u++)o.appendChild(z("flatpickr-day",new Date(e,n,s),0,u));for(var f=i+1;f<=42-t&&(1===C.config.showMonths||u%7!=0);f++,u++)o.appendChild(z("flatpickr-day "+c,new Date(e,n+1,f%i),0,u));var m=d("div","dayContainer");return m.appendChild(o),m}function ae(){if(void 0!==C.daysContainer){u(C.daysContainer),C.weekNumbers&&u(C.weekNumbers);for(var e=_.createDocumentFragment(),n=0;n<C.config.showMonths;n++){var t=new Date(C.currentYear,C.currentMonth,1);t.setMonth(C.currentMonth+n),e.appendChild(te(t.getFullYear(),t.getMonth()))}C.daysContainer.appendChild(e),C.days=C.daysContainer.firstChild,"range"===C.config.mode&&1===C.selectedDates.length&&Me(),Re("onDaysBuilt")}}function ie(){if(!(void 0===C.monthsDropdownContainer||C.config.showMonths>1||"dropdown"!==C.config.monthSelectorType)){var e=function(e){return!(void 0!==C.config.minDate&&C.currentYear===C.config.minDate.getFullYear()&&e<C.config.minDate.getMonth())&&!(void 0!==C.config.maxDate&&C.currentYear===C.config.maxDate.getFullYear()&&e>C.config.maxDate.getMonth())};C.monthsDropdownContainer.tabIndex=-1,C.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=d("option","flatpickr-monthDropdown-month");t.value=new Date(C.currentYear,n).getMonth().toString(),t.textContent=h(n,C.config.shorthandCurrentMonth,C.l10n),t.tabIndex=-1,C.currentMonth===n&&(t.selected=!0),C.monthsDropdownContainer.appendChild(t)}}}function oe(e){var n,t=d("div","flatpickr-month"),a=_.createDocumentFragment();C.config.showMonths>1||"static"===C.config.monthSelectorType?n=d("span","cur-month"):(C.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),C.monthsDropdownContainer.id=I+"-month",C.monthsDropdownContainer.setAttribute("aria-label",C.l10n.monthAriaLabel),W(C.monthsDropdownContainer,"change",(function(e){var n=g(e),t=parseInt(n.value,10);C.changeMonth(t-C.currentMonth),Re("onMonthChange")})),ie(),n=C.monthsDropdownContainer);var i=m("cur-year",{id:I+"-year-"+e,tabindex:"-1"}),o=i.getElementsByTagName("input")[0];o.setAttribute("aria-label",C.l10n.yearAriaLabel),C.config.minDate&&o.setAttribute("min",C.config.minDate.getFullYear().toString()),C.config.maxDate&&(o.setAttribute("max",C.config.maxDate.getFullYear().toString()),o.disabled=!!C.config.minDate&&C.config.minDate.getFullYear()===C.config.maxDate.getFullYear());var r=d("div","flatpickr-current-month");return r.appendChild(n),r.appendChild(i),a.appendChild(r),t.appendChild(a),{container:t,yearElement:o,monthElement:n}}function re(){u(C.monthNav),C.monthNav.appendChild(C.prevMonthNav),C.config.showMonths&&(C.yearElements=[],C.monthElements=[]);for(var e=0;e<C.config.showMonths;e++){var n=oe(e);C.yearElements.push(n.yearElement),C.monthElements.push(n.monthElement),C.monthNav.appendChild(n.container)}C.monthNav.appendChild(C.nextMonthNav)}function le(){C.calendarContainer.classList.add("hasTime"),C.config.noCalendar&&C.calendarContainer.classList.add("noCalendar");var e=T(C.config);C.timeContainer=d("div","flatpickr-time"),C.timeContainer.tabIndex=-1;var n=d("span","flatpickr-time-separator",":"),t=m("flatpickr-hour",{id:I+"-hour","aria-label":C.l10n.hourAriaLabel});C.hourElement=t.getElementsByTagName("input")[0];var a=m("flatpickr-minute",{id:I+"-minute","aria-label":C.l10n.minuteAriaLabel});if(C.minuteElement=a.getElementsByTagName("input")[0],C.hourElement.tabIndex=C.minuteElement.tabIndex=-1,C.hourElement.value=o(C.latestSelectedDateObj?C.latestSelectedDateObj.getHours():C.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),C.minuteElement.value=o(C.latestSelectedDateObj?C.latestSelectedDateObj.getMinutes():e.minutes),C.hourElement.setAttribute("step",C.config.hourIncrement.toString()),C.minuteElement.setAttribute("step",C.config.minuteIncrement.toString()),C.hourElement.setAttribute("min",C.config.time_24hr?"0":"1"),C.hourElement.setAttribute("max",C.config.time_24hr?"23":"12"),C.hourElement.setAttribute("maxlength","2"),C.minuteElement.setAttribute("min","0"),C.minuteElement.setAttribute("max","59"),C.minuteElement.setAttribute("maxlength","2"),C.timeContainer.appendChild(t),C.timeContainer.appendChild(n),C.timeContainer.appendChild(a),C.config.time_24hr&&C.timeContainer.classList.add("time24hr"),C.config.enableSeconds){C.timeContainer.classList.add("hasSeconds");var i=m("flatpickr-second",{id:I+"-second"});C.secondElement=i.getElementsByTagName("input")[0],C.secondElement.value=o(C.latestSelectedDateObj?C.latestSelectedDateObj.getSeconds():e.seconds),C.secondElement.setAttribute("step",C.minuteElement.getAttribute("step")),C.secondElement.setAttribute("min","0"),C.secondElement.setAttribute("max","59"),C.secondElement.setAttribute("maxlength","2"),C.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),C.timeContainer.appendChild(i)}return C.config.time_24hr||(C.amPM=d("span","flatpickr-am-pm",C.l10n.amPM[r((C.latestSelectedDateObj?C.hourElement.value:C.config.defaultHour)>11)]),C.amPM.title=C.l10n.toggleTitle,C.amPM.tabIndex=-1,C.timeContainer.appendChild(C.amPM)),C.timeContainer}function ce(){if(C.isMobile)return Le();var e=C.timeContainer;C.timeContainer=C.hourElement=C.minuteElement=void 0,C.secondElement=C.amPM=void 0,C.calendarContainer.classList.remove("hasTime"),C.calendarContainer.classList.remove("noCalendar"),C.config.enableTime&&(C.calendarContainer.insertBefore(le(),e||(C.innerContainer?C.innerContainer.nextSibling:C.calendarContainer.firstChild)),J(),H()),e&&C.calendarContainer.removeChild(e)}function se(){C.weekdayContainer?u(C.weekdayContainer):C.weekdayContainer=d("div","flatpickr-weekdays");for(var e=C.config.showMonths;e--;){var n=d("div","flatpickr-weekdaycontainer");C.weekdayContainer.appendChild(n)}return de(),C.weekdayContainer}function de(){if(C.weekdayContainer){var e=C.l10n.firstDayOfWeek,t=n(C.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=n(t.splice(e,t.length),t.splice(0,e)));for(var a=C.config.showMonths;a--;)C.weekdayContainer.children[a].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function ue(e,n){void 0===n&&(n=!0);var t=n?e:e-C.currentMonth;t<0&&!0===C._hidePrevMonthArrow||t>0&&!0===C._hideNextMonthArrow||(C.currentMonth+=t,(C.currentMonth<0||C.currentMonth>11)&&(C.currentYear+=Math.floor(C.currentMonth/12),C.currentMonth=(C.currentMonth%12+12)%12,Re("onYearChange"),ie()),ae(),Re("onMonthChange"),Ke())}function fe(e){return C.calendarContainer.contains(e)}function me(e){var n=g(e),t=fe(n),a=!(n===C.input||n===C.altInput||C.element.contains(n))&&!t&&!fe(e.relatedTarget),i=!C.config.ignoredFocusElements.some((function(e){return e.contains(n)}));if(a&&i){var o=C.config.allowInput?De():void 0;if(void 0===o&&void 0!==C.timeContainer&&void 0!==C.minuteElement&&void 0!==C.hourElement&&""!==C.input.value&&void 0!==C.input.value&&N(),C.close(),void 0===C.config)return;"range"===C.config.mode&&1===C.selectedDates.length&&C.clear(!1),Ce(o)}}function ge(e){if(!(!e||C.config.minDate&&e<C.config.minDate.getFullYear()||C.config.maxDate&&e>C.config.maxDate.getFullYear())){var n=e,t=C.currentYear!==n;C.currentYear=n||C.currentYear,C.config.maxDate&&C.currentYear===C.config.maxDate.getFullYear()?C.currentMonth=Math.min(C.config.maxDate.getMonth(),C.currentMonth):C.config.minDate&&C.currentYear===C.config.minDate.getFullYear()&&(C.currentMonth=Math.max(C.config.minDate.getMonth(),C.currentMonth)),t&&(C.redraw(),Re("onYearChange"))}}function pe(e,n){var t;void 0===n&&(n=!0);var a=C.parseDate(e,void 0,n);if(C.config.minDate&&a&&w(a,C.config.minDate,void 0!==n?n:!C.minDateHasTime)<0||C.config.maxDate&&a&&w(a,C.config.maxDate,void 0!==n?n:!C.maxDateHasTime)>0)return!1;if(!C.config.enable&&0===C.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!C.config.enable,o=null!==(t=C.config.enable)&&void 0!==t?t:C.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=C.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function he(e){return void 0!==C.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&C.daysContainer.contains(e))}function ve(e){e.target!==C._input||e.relatedTarget&&fe(e.relatedTarget)||Ce(De())}function De(){if(C._input.value.trimEnd()!==Je()){var e={times:be(),year:C.currentYear,month:C.currentMonth};return C.setDate(C._input.value,!1,C.config.altInput?C.config.altFormat:C.config.dateFormat),void 0!==C.hourElement&&(j(),Ue(!1)),e}}function Ce(e){void 0!==e&&(q(e.year,e.month),be()!==e.times&&(C.selectedDates.length>0&&Re("onValueUpdate"),Re("onChange")))}function be(){return C.selectedDates.map((function(e){return e.getTime()})).join()}function ye(e){var n=g(e),t=C.config.wrap?p.contains(n):n===C._input,a=C.config.allowInput,i=C.isOpen&&(!a||!t),o=C.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return Ce(De()),C.close(),n.blur();C.open()}else if(fe(n)||i||o){var r=!!C.timeContainer&&C.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),N(),Oe()):Ye(e);break;case 27:e.preventDefault(),Oe();break;case 8:case 46:t&&!C.config.allowInput&&(e.preventDefault(),C.clear());break;case 37:case 39:if(r||t)C.hourElement&&C.hourElement.focus();else{e.preventDefault();var l=Y();if(void 0!==C.daysContainer&&(!1===a||l&&he(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),ue(c),ne(Z(1),0)):ne(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;C.daysContainer&&void 0!==n.$i||n===C.input||n===C.altInput||n===C.daysContainer?e.ctrlKey?(e.stopPropagation(),ge(C.currentYear-s),ne(Z(1),0)):r||ne(void 0,7*s):n===C.currentYearElement?ge(C.currentYear-s):C.config.enableTime&&(!r&&C.hourElement&&C.hourElement.focus(),N(e),C._debouncedChange());break;case 9:if(r){var d=[C.hourElement,C.minuteElement,C.secondElement,C.amPM].concat(C.pluginElements).filter((function(e){return e})),u=d.indexOf(n);if(-1!==u){var f=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(f||C._input).focus()}}else!C.config.noCalendar&&C.daysContainer&&C.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),C._input.focus())}}if(void 0!==C.amPM&&n===C.amPM)switch(e.key){case C.l10n.amPM[0].charAt(0):case C.l10n.amPM[0].charAt(0).toLowerCase():C.amPM.textContent=C.l10n.amPM[0],j(),Ue();break;case C.l10n.amPM[1].charAt(0):case C.l10n.amPM[1].charAt(0).toLowerCase():C.amPM.textContent=C.l10n.amPM[1],j(),Ue()}(t||fe(n))&&Re("onKeyDown",e)}function Me(e,n){if(void 0===n&&(n="flatpickr-day"),1===C.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():C.days.firstElementChild.dateObj.getTime(),a=C.parseDate(C.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,C.selectedDates[0].getTime()),o=Math.max(t,C.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=x)pe(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(C.rContainer.querySelectorAll("*:nth-child(-n+"+C.config.showMonths+") > ."+n)).forEach((function(n){var i,o,s,d=n.dateObj.getTime(),u=l>0&&d<l||c>0&&d>c;if(u)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!u||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=C.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&d===a?n.classList.add("startRange"):a>t&&d===a&&n.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=a,s=t,(i=d)>Math.min(o,s)&&i<Math.max(o,s))&&n.classList.add("inRange")))}))}}function we(){!C.isOpen||C.config.static||C.config.inline||Se()}function Ee(e){return function(n){var t=C.config["_"+e+"Date"]=C.parseDate(n,C.config.dateFormat),a=C.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(C["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),C.selectedDates&&(C.config.allowInvalidPreload||(C.selectedDates=Pe(C.selectedDates,!0)),C.selectedDates.length||"min"!==e||H(t),Ue()),C.daysContainer&&(_e(),void 0!==t?C.currentYearElement[e]=t.getFullYear().toString():C.currentYearElement.removeAttribute(e),C.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function xe(){var e=F.defaultConfig.dateFormat||a.dateFormat,n=F.defaultConfig.altFormat||a.altFormat,t="time"===b.mode;if(!b.enableTime&&!t)return{dateFormat:e,altFormat:n};var i=b.noCalendar||t,o=b.enableSeconds?":S":"";return{dateFormat:i?"H:i"+o:e+" H:i"+o,altFormat:b.altInput?i?"h:i"+o+" K":n+" h:i"+o+" K":n}}function Te(){var e=xe();void 0===b.dateFormat&&(C.config.dateFormat=e.dateFormat),void 0===b.altFormat&&(C.config.altFormat=e.altFormat)}function ke(){return C.config.wrap?p.querySelector("[data-input]"):p}function Ie(){"object"!=typeof C.config.locale&&void 0===F.l10ns[C.config.locale]&&C.config.errorHandler(new Error("flatpickr: invalid locale "+C.config.locale)),C.l10n=e(e({},F.l10ns.default),"object"==typeof C.config.locale?C.config.locale:"default"!==C.config.locale?F.l10ns[C.config.locale]:void 0),D.D="("+C.l10n.weekdays.shorthand.join("|")+")",D.l="("+C.l10n.weekdays.longhand.join("|")+")",D.M="("+C.l10n.months.shorthand.slice().sort((function(e,n){return n.length-e.length})).join("|")+")",D.F="("+C.l10n.months.longhand.slice().sort((function(e,n){return n.length-e.length})).join("|")+")",D.K="("+C.l10n.amPM[0]+"|"+C.l10n.amPM[1]+"|"+C.l10n.amPM[0].toLowerCase()+"|"+C.l10n.amPM[1].toLowerCase()+")",void 0===b.time_24hr&&void 0===F.defaultConfig.time_24hr&&(C.config.time_24hr=C.l10n.time_24hr),C.formatDate=y(C),C.parseDate=M({config:C.config,l10n:C.l10n})}function Se(e){if("function"!=typeof C.config.position){if(void 0!==C.calendarContainer){Re("onPreCalendarPosition");var n=e||C._positionElement,t=Array.prototype.reduce.call(C.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=C.calendarContainer.offsetWidth,i=C.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=n.getBoundingClientRect(),c=S.innerHeight-l.bottom,d="above"!==o&&"below"!==o,u=c>=t,f=l.top>t,m=d&&!u&&!f&&!C.config.static&&!C.config.inline,g=m?l.top>c:"above"===o||d&&!u&&f,p=S.pageYOffset+l.top+(g?-t-2:n.offsetHeight+2),h=m?Math.max(S.pageYOffset,Math.min(p,S.pageYOffset+S.innerHeight-t)):p;if(s(C.calendarContainer,"arrowTop",!m&&!g),s(C.calendarContainer,"arrowBottom",!m&&g),!C.config.inline){var v=S.pageXOffset+l.left,D=!1,b=!1;"center"===r?(v-=(a-l.width)/2,D=!0):"right"===r&&(v-=a-l.width,b=!0),s(C.calendarContainer,"arrowLeft",!D&&!b),s(C.calendarContainer,"arrowCenter",D),s(C.calendarContainer,"arrowRight",b);var y=_.body.offsetWidth,M=S.pageXOffset+l.right,w=v+a>y,E=w&&M<a;if(s(C.calendarContainer,"rightMost",w),!C.config.static){s(C.calendarContainer,"centerMost",E),E?(s(C.calendarContainer,"rightMost",!1),v=Math.max(0,y/2-a/2),C.calendarContainer.style.setProperty("--fp-arrow-left",S.pageXOffset+l.left-v+"px")):w&&(v=M-a);var x=function(){var e=C.calendarContainer.offsetParent;e===_.body&&Fe(_.body)&&(e=Fe(_.documentElement)?null:_.documentElement);if(null===e)return{top:0,left:0};var n=e.getBoundingClientRect(),t=e===_.documentElement;return{top:S.pageYOffset+n.top+e.clientTop-(t?0:e.scrollTop),left:S.pageXOffset+n.left+e.clientLeft-(t?0:e.scrollLeft)}}();C.calendarContainer.style.top=h-x.top+"px",C.calendarContainer.style.left=v-x.left+"px",C.calendarContainer.style.right="auto"}}}}else C.config.position(C,e)}function Fe(e){return"static"===S.getComputedStyle(e).position}function _e(){C.config.noCalendar||C.isMobile||(ie(),Ke(),ae())}function Oe(){C._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(C.close,0):C.close()}function Ye(e){e.preventDefault(),e.stopPropagation();var n=f(g(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==n){var t=n,a=C.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(a.getMonth()<C.currentMonth||a.getMonth()>C.currentMonth+C.config.showMonths-1)&&"range"!==C.config.mode;if(C.selectedDateElem=t,"single"===C.config.mode)C.selectedDates=[a];else if("multiple"===C.config.mode){var o=Be(a);o?C.selectedDates.splice(parseInt(o),1):C.selectedDates.push(a)}else"range"===C.config.mode&&(2===C.selectedDates.length&&C.clear(!1,!1),C.latestSelectedDateObj=a,C.selectedDates.push(a),0!==w(a,C.selectedDates[0],!0)&&C.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(j(),i){var r=C.currentYear!==a.getFullYear();C.currentYear=a.getFullYear(),C.currentMonth=a.getMonth(),r&&(Re("onYearChange"),ie()),Re("onMonthChange")}if(Ke(),ae(),Ue(),i||"range"===C.config.mode||1!==C.config.showMonths?void 0!==C.selectedDateElem&&void 0===C.hourElement&&C.selectedDateElem&&C.selectedDateElem.focus():G(t),void 0!==C.hourElement&&void 0!==C.hourElement&&C.hourElement.focus(),C.config.closeOnSelect){var l="single"===C.config.mode&&!C.config.enableTime,c="range"===C.config.mode&&2===C.selectedDates.length&&!C.config.enableTime;(l||c)&&Oe()}B()}}C.parseDate=M({config:C.config,l10n:C.l10n}),C._handlers=[],C.pluginElements=[],C.loadedPlugins=[],C._bind=W,C._setHoursFromDate=H,C._positionCalendar=Se,C.changeMonth=ue,C.changeYear=ge,C.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);C.input.value="",void 0!==C.altInput&&(C.altInput.value="");void 0!==C.mobileInput&&(C.mobileInput.value="");C.selectedDates=[],C.latestSelectedDateObj=void 0,!0===n&&(C.currentYear=C._initialDate.getFullYear(),C.currentMonth=C._initialDate.getMonth());if(!0===C.config.enableTime){var t=T(C.config),a=t.hours,i=t.minutes,o=t.seconds;L(a,i,o)}C.redraw(),e&&Re("onChange")},C.close=function(){C.isOpen=!1,K(),C.isMobile||(void 0!==C.calendarContainer&&C.calendarContainer.classList.remove("open"),void 0!==C._input&&C._input.classList.remove("active"));Re("onClose")},C.onMouseOver=Me,C._createElement=d,C.createDay=z,C.destroy=function(){void 0!==C.config&&Re("onDestroy");for(var e=C._handlers.length;e--;)C._handlers[e].remove();if(C._handlers=[],K(),C.mobileInput)C.mobileInput.parentNode&&C.mobileInput.parentNode.removeChild(C.mobileInput),C.mobileInput=void 0;else if(C.calendarContainer&&C.calendarContainer.parentNode)if(C.config.static&&C.calendarContainer.parentNode){var n=C.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else C.calendarContainer.parentNode.removeChild(C.calendarContainer);C.altInput&&(C.input.type="text",C.altInput.parentNode&&C.altInput.parentNode.removeChild(C.altInput),delete C.altInput);C.input&&(C.input.type=C.input._type,C.input.classList.remove("flatpickr-input"),C.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete C[e]}catch(e){}}))},C.isEnabled=pe,C.jumpToDate=U,C.updateValue=Ue,C.open=function(e,n){void 0===n&&(n=C._positionElement);if(!0===C.isMobile){if(e){e.preventDefault();var t=g(e);t&&t.blur()}return void 0!==C.mobileInput&&(C.mobileInput.focus(),C.mobileInput.click()),void Re("onOpen")}if(C._input.disabled||C.config.inline)return;var a=C.isOpen;C.isOpen=!0,a||(!function(){var e=function(e,n,t,a){e.addEventListener(n,t,a),O.push({remove:function(){return e.removeEventListener(n,t,a)}})};C.config.static||e(S,"resize",l(we,50));e(_,void 0!==S.ontouchstart?"touchstart":"mousedown",me),e(_,"focus",me,{capture:!0})}(),C.calendarContainer.classList.add("open"),C._input.classList.add("active"),Re("onOpen"),Se(n));!0===C.config.enableTime&&!0===C.config.noCalendar&&(!1!==C.config.allowInput||void 0!==e&&C.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return C.hourElement.select()}),50))},C.redraw=_e,C.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(C.config,e),Object.assign(b,e),e)void 0!==Ae[a]&&Ae[a].forEach((function(e){return e()}));else C.config[e]=n,b[e]=n,void 0!==Ae[e]?Ae[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(C.config[e]=c(n));C.redraw(),Ue(!0)},C.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=C.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return C.clear(n);Ne(e,t),C.latestSelectedDateObj=C.selectedDates[C.selectedDates.length-1],C.redraw(),U(void 0,n),H(),0===C.selectedDates.length&&C.clear(!1);Ue(n),n&&Re("onChange")},C.toggle=function(e){if(!0===C.isOpen)return C.close();C.open(e)};var Ae={locale:[Ie,de],showMonths:[re,P,se],minDate:[U],maxDate:[U],positionElement:[He],enableTime:[Te,ce],enableSeconds:[Te,ce],time_24hr:[ce],clickOpens:[function(){!0===C.config.clickOpens?(W(C._input,"focus",C.open),W(C._input,"click",C.open)):(C._input.removeEventListener("focus",C.open),C._input.removeEventListener("click",C.open))}]};function Pe(e,n){var t=e.filter((function(e){return pe(e,n)}));return"range"===C.config.mode&&t.length<e.length?[]:t}function Ne(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return C.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[C.parseDate(e,n)];else if("string"==typeof e)switch(C.config.mode){case"single":case"time":t=[C.parseDate(e,n)];break;case"multiple":t=e.split(C.config.conjunction).map((function(e){return C.parseDate(e,n)}));break;case"range":t=e.split(C.l10n.rangeSeparator).map((function(e){return C.parseDate(e,n)}))}else C.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));C.selectedDates=C.config.allowInvalidPreload?t:Pe(t.filter((function(e){return e instanceof Date})),!1),"range"===C.config.mode&&C.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function je(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?C.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:C.parseDate(e.from,void 0),to:C.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function He(){C._positionElement=C.config.positionElement||C._input}function Le(){var e=C.config.enableTime?C.config.noCalendar?"time":"datetime-local":"date";C.mobileInput.type=e,C.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S"}function Re(e,n){if(void 0!==C.config){var t=C.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](C.selectedDates,C.input.value,C,n);"onChange"===e&&(C.input.dispatchEvent(We("change")),C.input.dispatchEvent(We("input")))}}function We(e){var n=_.createEvent("Event");return n.initEvent(e,!0,!0),n}function Be(e){for(var n=0;n<C.selectedDates.length;n++){var t=C.selectedDates[n];if(t instanceof Date&&0===w(t,e))return""+n}return!1}function Ke(){C.config.noCalendar||C.isMobile||!C.monthNav||(C.yearElements.forEach((function(e,n){var t=new Date(C.currentYear,C.currentMonth,1);t.setMonth(C.currentMonth+n),C.config.showMonths>1||"static"===C.config.monthSelectorType?C.monthElements[n].textContent=h(t.getMonth(),C.config.shorthandCurrentMonth,C.l10n)+" ":C.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),C._hidePrevMonthArrow=void 0!==C.config.minDate&&(C.currentYear===C.config.minDate.getFullYear()?C.currentMonth<=C.config.minDate.getMonth():C.currentYear<C.config.minDate.getFullYear()),C._hideNextMonthArrow=void 0!==C.config.maxDate&&(C.currentYear===C.config.maxDate.getFullYear()?C.currentMonth+1>C.config.maxDate.getMonth():C.currentYear>C.config.maxDate.getFullYear()))}function Je(e){var n=e||(C.config.altInput?C.config.altFormat:C.config.dateFormat);return C.selectedDates.map((function(e){return C.formatDate(e,n)})).filter((function(e,n,t){return"range"!==C.config.mode||C.config.enableTime||t.indexOf(e)===n})).join("range"!==C.config.mode?C.config.conjunction:C.l10n.rangeSeparator)}function Ue(e){if(void 0===e&&(e=!0),void 0!==C.mobileInput&&C.mobileFormatStr){var n=void 0!==C.latestSelectedDateObj?C.formatDate(C.latestSelectedDateObj,C.mobileFormatStr):"",t=C.parseDate(C.mobileInput.value,C.mobileFormatStr);void 0!==t&&C.formatDate(t,C.mobileFormatStr)===n||(C.mobileInput.value=n)}C.input.value=Je(C.config.dateFormat),void 0!==C.altInput&&(C.altInput.value=Je(C.config.altFormat)),!1!==e&&Re("onValueUpdate")}function qe(e){var n=g(e),t=C.prevMonthNav.contains(n),a=C.nextMonthNav.contains(n);t||a?ue(t?-1:1):C.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?C.changeYear(C.currentYear+1):n.classList.contains("arrowDown")&&C.changeYear(C.currentYear-1)}return function(){C.element=C.input=p,C.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"];Object.assign(b,JSON.parse(JSON.stringify(p.dataset||{})),v),C.config.parseDate=b.parseDate,C.config.formatDate=b.formatDate,Object.defineProperty(C.config,"enable",{get:function(){return C.config._enable},set:function(e){C.config._enable=je(e)}}),Object.defineProperty(C.config,"disable",{get:function(){return C.config._disable},set:function(e){C.config._disable=je(e)}}),Object.defineProperty(C.config,"minDate",{get:function(){return C.config._minDate},set:Ee("min")}),Object.defineProperty(C.config,"maxDate",{get:function(){return C.config._maxDate},set:Ee("max")});var n=function(e){return function(n){C.config["min"===e?"_minTime":"_maxTime"]=C.parseDate(n,"H:i:S")}};Object.defineProperty(C.config,"minTime",{get:function(){return C.config._minTime},set:n("min")}),Object.defineProperty(C.config,"maxTime",{get:function(){return C.config._maxTime},set:n("max")}),"time"===b.mode&&(C.config.noCalendar=!0,C.config.enableTime=!0);Object.assign(C.config,xe(),b);for(var a=0;a<e.length;a++)C.config[e[a]]=!0===C.config[e[a]]||"true"===C.config[e[a]];t.filter((function(e){return void 0!==C.config[e]})).forEach((function(e){C.config[e]=c(C.config[e]||[]).map(A)}));for(a=0;a<C.config.plugins.length;a++){var i=C.config.plugins[a](C)||{};for(var o in i)t.indexOf(o)>-1?C.config[o]=c(i[o]).map(A).concat(C.config[o]):void 0===b[o]&&(C.config[o]=i[o])}C.isMobile=!C.config.disableMobile&&!C.config.inline&&"single"===C.config.mode&&!C.config.disable.length&&!C.config.enable&&!C.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),b.altInputClass||(C.config.altInputClass=ke().className+" "+C.config.altInputClass);Re("onParseConfig")}(),Ie(),function(){if(C.input=ke(),!C.input)return void C.config.errorHandler(new Error("Invalid input element specified"));C.input._type=C.input.type,C.input.type="text",C.input.classList.add("flatpickr-input"),C._input=C.input,C.config.altInput&&(C.altInput=d(C.input.nodeName,C.config.altInputClass),C._input=C.altInput,C.altInput.placeholder=C.input.placeholder,C.altInput.disabled=C.input.disabled,C.altInput.required=C.input.required,C.altInput.tabIndex=C.input.tabIndex,C.altInput.type="text",C.input.setAttribute("type","hidden"),!C.config.static&&C.input.parentNode&&C.input.parentNode.insertBefore(C.altInput,C.input.nextSibling));C.config.allowInput||C._input.setAttribute("readonly","readonly");He()}(),function(){C.selectedDates=[],C.now=C.parseDate(C.config.now)||new Date;var e=C.config.defaultDate||("INPUT"!==C.input.nodeName&&"TEXTAREA"!==C.input.nodeName||!C.input.placeholder||C.input.value!==C.input.placeholder?C.input.value:null);e&&Ne(e,C.config.dateFormat);C._initialDate=C.selectedDates.length>0?C.selectedDates[0]:C.config.minDate&&C.config.minDate.getTime()>C.now.getTime()?C.config.minDate:C.config.maxDate&&C.config.maxDate.getTime()<C.now.getTime()?C.config.maxDate:C.now,C.currentYear=C._initialDate.getFullYear(),C.currentMonth=C._initialDate.getMonth(),C.selectedDates.length>0&&(C.latestSelectedDateObj=C.selectedDates[0]);void 0!==C.config.minTime&&(C.config.minTime=C.parseDate(C.config.minTime,"H:i"));void 0!==C.config.maxTime&&(C.config.maxTime=C.parseDate(C.config.maxTime,"H:i"));C.minDateHasTime=!!C.config.minDate&&(C.config.minDate.getHours()>0||C.config.minDate.getMinutes()>0||C.config.minDate.getSeconds()>0),C.maxDateHasTime=!!C.config.maxDate&&(C.config.maxDate.getHours()>0||C.config.maxDate.getMinutes()>0||C.config.maxDate.getSeconds()>0)}(),C.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=C.currentMonth),void 0===n&&(n=C.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:C.l10n.daysInMonth[e]}},C.isMobile||function(){var e=_.createDocumentFragment();if(C.calendarContainer=d("div","flatpickr-calendar"),C.calendarContainer.tabIndex=-1,!C.config.noCalendar){if(e.appendChild((C.monthNav=d("div","flatpickr-months"),C.yearElements=[],C.monthElements=[],C.prevMonthNav=d("span","flatpickr-prev-month"),C.prevMonthNav.innerHTML=C.config.prevArrow,C.nextMonthNav=d("span","flatpickr-next-month"),C.nextMonthNav.innerHTML=C.config.nextArrow,re(),Object.defineProperty(C,"_hidePrevMonthArrow",{get:function(){return C.__hidePrevMonthArrow},set:function(e){C.__hidePrevMonthArrow!==e&&(s(C.prevMonthNav,"flatpickr-disabled",e),C.__hidePrevMonthArrow=e)}}),Object.defineProperty(C,"_hideNextMonthArrow",{get:function(){return C.__hideNextMonthArrow},set:function(e){C.__hideNextMonthArrow!==e&&(s(C.nextMonthNav,"flatpickr-disabled",e),C.__hideNextMonthArrow=e)}}),C.currentYearElement=C.yearElements[0],Ke(),C.monthNav)),C.innerContainer=d("div","flatpickr-innerContainer"),C.config.weekNumbers){var n=function(){C.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",C.l10n.weekAbbreviation));var n=d("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,a=n.weekNumbers;C.innerContainer.appendChild(t),C.weekNumbers=a,C.weekWrapper=t}C.rContainer=d("div","flatpickr-rContainer"),C.rContainer.appendChild(se()),C.daysContainer||(C.daysContainer=d("div","flatpickr-days"),C.daysContainer.tabIndex=-1),ae(),C.rContainer.appendChild(C.daysContainer),C.innerContainer.appendChild(C.rContainer),e.appendChild(C.innerContainer)}C.config.enableTime&&e.appendChild(le());s(C.calendarContainer,"rangeMode","range"===C.config.mode),s(C.calendarContainer,"animate",!0===C.config.animate),s(C.calendarContainer,"multiMonth",C.config.showMonths>1),C.calendarContainer.appendChild(e);var i=void 0!==C.config.appendTo&&void 0!==C.config.appendTo.nodeType;if((C.config.inline||C.config.static)&&(C.calendarContainer.classList.add(C.config.inline?"inline":"static"),C.config.inline&&(!i&&C.element.parentNode?C.element.parentNode.insertBefore(C.calendarContainer,C._input.nextSibling):void 0!==C.config.appendTo&&C.config.appendTo.appendChild(C.calendarContainer)),C.config.static)){var o=d("div","flatpickr-wrapper");C.element.parentNode&&C.element.parentNode.insertBefore(o,C.element),o.appendChild(C.element),C.altInput&&o.appendChild(C.altInput),o.appendChild(C.calendarContainer)}C.config.static||C.config.inline||(void 0!==C.config.appendTo?C.config.appendTo:_.body).appendChild(C.calendarContainer)}(),function(){C.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(C.element.querySelectorAll("[data-"+e+"]"),(function(n){return W(n,"click",C[e])}))}));if(C.isMobile)return void function(){C.mobileInput=d("input",C.input.className+" flatpickr-mobile"),C.mobileInput.tabIndex=1,Le(),C.mobileInput.disabled=C.input.disabled,C.mobileInput.required=C.input.required,C.mobileInput.placeholder=C.input.placeholder,C.selectedDates.length>0&&(C.mobileInput.defaultValue=C.mobileInput.value=C.formatDate(C.selectedDates[0],C.mobileFormatStr));C.config.minDate&&(C.mobileInput.min=C.formatDate(C.config.minDate,"Y-m-d"));C.config.maxDate&&(C.mobileInput.max=C.formatDate(C.config.maxDate,"Y-m-d"));C.input.getAttribute("step")&&(C.mobileInput.step=String(C.input.getAttribute("step")));C.input.type="hidden",void 0!==C.altInput&&(C.altInput.type="hidden");try{C.input.parentNode&&C.input.parentNode.insertBefore(C.mobileInput,C.input.nextSibling)}catch(e){}W(C.mobileInput,"change",(function(e){C.setDate(g(e).value,!1,C.mobileFormatStr),Re("onChange"),Re("onClose")}))}();C._debouncedChange=l(B,300),C.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&W(C.daysContainer,"mouseover",(function(e){"range"===C.config.mode&&Me(g(e))}));W(C._input,"keydown",ye),void 0!==C.calendarContainer&&W(C.calendarContainer,"keydown",ye);!0===C.config.clickOpens&&(W(C._input,"focus",C.open),W(C._input,"click",C.open));void 0!==C.daysContainer&&(W(C.monthNav,"click",qe),W(C.monthNav,["keyup","increment"],R),W(C.daysContainer,"click",Ye));J(),C.config.allowInput&&W(C._input,"blur",ve)}(),(C.selectedDates.length||C.config.noCalendar)&&(C.config.enableTime&&H(C.config.noCalendar?C.latestSelectedDateObj:void 0),Ue(!1)),P();var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!C.isMobile&&e&&Se(),Re("onReady")}(),C}function S(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e.nodeType===Node.ELEMENT_NODE})),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=I(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return S(this,e)},HTMLElement.prototype.flatpickr=function(e){return S([this],e)});var F=function(e,n){return"string"==typeof e?S(window.document.querySelectorAll(e),n):"number"==typeof(null===(t=e)||void 0===t?void 0:t.nodeType)?S([e],n):S(e,n);var t};return F.defaultConfig={},F.l10ns={en:e({},i),default:e({},i)},F.localize=function(n){F.l10ns.default=e(e({},F.l10ns.default),n)},F.setDefaults=function(n){F.defaultConfig=e(e({},F.defaultConfig),n)},F.parseDate=M({}),F.formatDate=y({}),F.compareDates=w,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return S(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=F),F}));
1
+ /* flatpickr v4.9.0,, @license MIT */
2
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=n()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};function n(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a}var t=["onChange","onClose","onDayCreate","onDaysBuilt","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],a={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDaysBuilt:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},o=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},r=function(e){return!0===e?1:0};function l(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var c=function(e){return e instanceof Array?e:[e]};function s(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function d(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,n){return n(e)?e:e.parentNode?f(e.parentNode,n):void 0}function m(e,n){var t=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var p=function(){},h=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},v=function(e,n){return e.map((function(e){return e.toUpperCase()})).indexOf(n.toUpperCase())},D=function(){return new Date(NaN)},C=function(e,n,t){return function(a,i){var o=parseFloat(i);if(o<e||o>n)return D();t(a,o)}},b=function(e,n){var t=parseFloat(n);if(e.setDate(t),e.getDate()!==t)return D()},y=C(1,12,(function(e,n){e.setMonth(n-1,1)})),M=C(0,23,(function(e,n){e.setHours(n)})),w=C(0,23,(function(e,n){e.setHours((e.getHours()>=12?12:0)+n)})),E=C(0,59,(function(e,n){e.setSeconds(n)})),x={D:p,F:function(e,n,t){e.setMonth(v(t.months.longhand,n),1)},G:w,H:M,J:b,K:function(e,n,t){e.setHours(e.getHours()%12+12*r(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(v(t.months.shorthand,n),1)},S:E,U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:b,h:w,i:C(0,59,(function(e,n){e.setMinutes(n)})),j:b,l:p,m:y,n:y,s:E,u:function(e,n){return new Date(parseFloat(n))},w:p,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},T={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},k={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[k.w(e,n,t)]},F:function(e,n,t){return h(k.n(e,n,t)-1,!1,n)},G:function(e,n,t){return o(k.h(e,n,t))},H:function(e){return o(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[r(e.getHours()>11)]},M:function(e,n){return h(e.getMonth(),!0,n)},S:function(e){return o(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return o(e.getFullYear(),4)},d:function(e){return o(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return o(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return o(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},S={Y:0,y:0,F:1,M:1,m:1,n:1},I=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,a){var i=a||r;return void 0===t.formatDate||c?n.split("").map((function(n,a,o){return k[n]&&"\\"!==o[a-1]?k[n](e,i,t):"\\"!==n?n:""})).join(""):t.formatDate(e,n,i)}},_=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o;return function(e,n,i,o){var l;if(0===e||e){var c,s=o||r,d=e;if(e instanceof Date)c=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)c=new Date(e);else if("string"==typeof e){var u=n||(t||a).dateFormat,f=String(e).trim();if("today"===f)c=new Date,i=!0;else if(t&&t.parseDate)c=t.parseDate(e,u);else if(/Z$/.test(f)||/GMT$/.test(f))c=new Date(e);else{for(var m=void 0,g=[[],[],[]],p=0,h=0,v="";p<u.length;p++){var D=u[p],C="\\"===D,b="\\"===u[p-1]||C;if(T[D]&&!b){v+=T[D];var y=new RegExp(v,"i").exec(e);y&&(m=!0)&&g[null!==(l=S[D])&&void 0!==l?l:2].push({fn:x[D],val:y[++h]})}else C||(v+=".")}c=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),g.forEach((function(e){return e.forEach((function(e){var n=e.fn,t=e.val;return c=n(c,t,s)||c}))})),c=m?c:void 0}}if(c instanceof Date&&!isNaN(c.getTime()))return!0===i&&c.setHours(0,0,0,0),c;t.errorHandler(new Error("Invalid date provided: "+d))}}};function O(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var F=function(e,n,t){return 3600*e+60*n+t},Y=864e5;function A(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=Math.min(a,e.maxDate.getSeconds()))}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach((function(t){return e[t]=n[t]}))},i=0,o=n;i<o.length;i++){var r=o[i];a(r)}return e});var N=0;function P(p,v){var D={config:e(e({},a),H.defaultConfig),l10n:i},C={},b="flatpickr-"+ ++N,y=p.ownerDocument.defaultView||window,M=y.document,w=[];function E(){var e;return(null===(e=D.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||M.activeElement}function x(e){return e.bind(D)}function k(){var e=D.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&y.requestAnimationFrame((function(){if(void 0!==D.calendarContainer&&(D.calendarContainer.style.visibility="hidden",D.calendarContainer.style.display="block"),void 0!==D.daysContainer){var n=(D.days.offsetWidth+1)*e.showMonths;D.daysContainer.style.width=n+"px",D.calendarContainer.style.width=n+(void 0!==D.weekWrapper?D.weekWrapper.offsetWidth:0)+"px",D.calendarContainer.style.removeProperty("visibility"),D.calendarContainer.style.removeProperty("display")}}))}function S(e){if(0===D.selectedDates.length){var n=void 0===D.config.minDate||O(new Date,D.config.minDate)>=0?new Date:new Date(D.config.minDate.getTime()),t=A(D.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),D.selectedDates=[n],D.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=g(e),a=t;void 0!==D.amPM&&t===D.amPM&&(D.amPM.textContent=D.l10n.amPM[r(D.amPM.textContent===D.l10n.amPM[0])]);var i=parseFloat(a.getAttribute("min")),l=parseFloat(a.getAttribute("max")),c=parseFloat(a.getAttribute("step")),s=parseInt(a.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==a.value&&2===a.value.length){var f=a===D.hourElement,m=a===D.minuteElement;u<i?(u=l+u+r(!f)+(r(f)&&r(!D.amPM)),m&&z(void 0,-1,D.hourElement)):u>l&&(u=a===D.hourElement?u-l-r(!D.amPM):i,m&&z(void 0,1,D.hourElement)),D.amPM&&f&&(1===c?u+s===23:Math.abs(u-s)>c)&&(D.amPM.textContent=D.l10n.amPM[r(D.amPM.textContent===D.l10n.amPM[0])]),a.value=o(u)}}(e);var a=D._input.value;P(),Ve(),D._input.value!==a&&D._debouncedChange()}function P(){if(void 0!==D.hourElement&&void 0!==D.minuteElement){var e,n,t=(parseInt(D.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(D.minuteElement.value,10)||0)%60,i=void 0!==D.secondElement?(parseInt(D.secondElement.value,10)||0)%60:0;void 0!==D.amPM&&(e=t,n=D.amPM.textContent,t=e%12+12*r(n===D.l10n.amPM[1]));var o=void 0!==D.config.minTime||D.config.minDate&&D.minDateHasTime&&D.latestSelectedDateObj&&0===O(D.latestSelectedDateObj,D.config.minDate,!0),l=void 0!==D.config.maxTime||D.config.maxDate&&D.maxDateHasTime&&D.latestSelectedDateObj&&0===O(D.latestSelectedDateObj,D.config.maxDate,!0);if(void 0!==D.config.maxTime&&void 0!==D.config.minTime&&D.config.minTime>D.config.maxTime){var c=F(D.config.minTime.getHours(),D.config.minTime.getMinutes(),D.config.minTime.getSeconds()),s=F(D.config.maxTime.getHours(),D.config.maxTime.getMinutes(),D.config.maxTime.getSeconds()),d=F(t,a,i);if(d>s&&d<c){var u=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]}(c);t=u[0],a=u[1],i=u[2]}}else{if(l){var f=void 0!==D.config.maxTime?D.config.maxTime:D.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes()))===f.getMinutes()&&(i=Math.min(i,f.getSeconds()))}if(o){var m=void 0!==D.config.minTime?D.config.minTime:D.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&(a=Math.max(a,m.getMinutes()))===m.getMinutes()&&(i=Math.max(i,m.getSeconds()))}}L(t,a,i)}}function j(e){var n=e||D.latestSelectedDateObj;n&&L(n.getHours(),n.getMinutes(),n.getSeconds())}function L(e,n,t){void 0!==D.latestSelectedDateObj&&D.latestSelectedDateObj.setHours(e%24,n,t||0,0),D.hourElement&&D.minuteElement&&!D.isMobile&&(D.hourElement.value=o(D.config.time_24hr?e:(12+e)%12+12*r(e%12==0)),D.minuteElement.value=o(n),void 0!==D.amPM&&(D.amPM.textContent=D.l10n.amPM[r(e>=12)]),void 0!==D.secondElement&&(D.secondElement.value=o(t)))}function R(e){var n=g(e);if(-1!==D.yearElements.indexOf(n)){var t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&pe(t)}}function W(e,n,t,a){return n instanceof Array?n.forEach((function(n){return W(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return W(e,n,t,a)})):(e.addEventListener(n,t,a),void D._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function B(){We("onChange")}function K(){w.forEach((function(e){return e.remove()})),w=[]}function U(){if(void 0!==D.timeContainer&&void 0!==D.minuteElement&&void 0!==D.hourElement){W(D.timeContainer,["increment"],S),W(D.timeContainer,"blur",S,{capture:!0}),W(D.timeContainer,"click",X),W([D.hourElement,D.minuteElement],["focus","click"],(function(e){return g(e).select()})),void 0!==D.secondElement&&W(D.secondElement,"focus",(function(){return D.secondElement&&D.secondElement.select()})),void 0!==D.amPM&&W(D.amPM,"click",(function(e){S(e)}))}}function J(e){var n=D.config,t=n.minDate,a=n.maxDate;return t&&t.getTime()>e.getTime()?t:a&&a.getTime()<e.getTime()?a:e}function V(e,n){var t=void 0!==e?D.parseDate(e):D.latestSelectedDateObj||J(D.now),a=D.currentYear,i=D.currentMonth;try{void 0!==t&&(D.currentYear=t.getFullYear(),D.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,D.config.errorHandler(e)}n&&q(a,i),D.redraw()}function q(e,n){D.currentYear!==e&&We("onYearChange"),D.currentYear===e&&D.currentMonth===n||We("onMonthChange")}function X(e){var n=g(e);~n.className.indexOf("arrow")&&z(e,n.classList.contains("arrowUp")?1:-1)}function z(e,n,t){var a=e&&g(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=Be("increment");o.delta=n,i&&i.dispatchEvent(o)}function G(e,n,t,a){var i=he(n,!0),o=d("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",D.formatDate(n,D.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===O(n,D.now)&&(D.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?o.tabIndex=-1:o.classList.add("flatpickr-disabled"),Ke(n)&&(o.classList.add("selected"),i&&(D.selectedDateElem=o),"range"===D.config.mode&&(s(o,"startRange",D.selectedDates[0]&&0===O(n,D.selectedDates[0],!0)),s(o,"endRange",D.selectedDates[1]&&0===O(n,D.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange"))),"range"===D.config.mode&&function(e){return!("range"!==D.config.mode||D.selectedDates.length<2)&&(O(e,D.selectedDates[0])>=0&&O(e,D.selectedDates[1])<=0)}(n)&&!Ke(n)&&o.classList.add("inRange"),D.weekNumbers&&1===D.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&D.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+D.config.getWeek(n)+"</span>"),We("onDayCreate",o),o}function Z(e){e.focus(),"range"===D.config.mode&&we(e)}function $(e){for(var n=e>0?0:D.config.showMonths-1,t=e>0?D.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=D.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&he(c.dateObj))return c}}function Q(e,n){for(var t=n>0?D.config.maxDate:D.config.minDate,a=0;a<=3653;a++){var i=new Date(e.getFullYear(),e.getMonth(),e.getDate()+a*n);if(void 0!==t&&O(i,t)*n>0)return;if(he(i))return i}}function ee(e){for(var n=D.daysContainer.querySelectorAll(".flatpickr-day:not(.hidden)"),t=0;t<n.length;t++)if(0===O(n[t].dateObj,e))return n[t]}function ne(e){if(void 0===ee(e)){var n=12*D.currentYear+D.currentMonth,t=12*e.getFullYear()+e.getMonth();fe(t<n?t-n:t-(n+D.config.showMonths-1))}var a=ee(e);void 0!==a&&Z(a)}function te(e,n){if(void 0!==D.daysContainer&&D.rContainer.contains(D.daysContainer)){var t=E(),a=n>0?1:-1,i=null!==t&&t.classList.contains("flatpickr-day")&&ve(t),o=void 0!==e?e:i?t:void 0!==D.selectedDateElem&&ve(D.selectedDateElem)?D.selectedDateElem:void 0!==D.todayDateElem&&ve(D.todayDateElem)?D.todayDateElem:$(a);if(void 0===o)void 0!==(r=0!==n?Q(a>0?new Date(D.currentYear,D.currentMonth+D.config.showMonths,1):new Date(D.currentYear,D.currentMonth,0),a):void 0)?ne(r):D.daysContainer.focus();else if(i){var r,l=o.dateObj;void 0!==(r=Q(new Date(l.getFullYear(),l.getMonth(),l.getDate()+n),a))&&ne(r)}else Z(o)}}function ae(e,n){for(var t=(new Date(e,n,1).getDay()-D.l10n.firstDayOfWeek+7)%7,a=D.utils.getDaysInMonth((n-1+12)%12,e),i=D.utils.getDaysInMonth(n,e),o=M.createDocumentFragment(),r=D.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-t,u=0;s<=a;s++,u++)o.appendChild(G("flatpickr-day "+l,new Date(e,n-1,s),0,u));for(s=1;s<=i;s++,u++)o.appendChild(G("flatpickr-day",new Date(e,n,s),0,u));for(var f=i+1;f<=42-t&&(1===D.config.showMonths||u%7!=0);f++,u++)o.appendChild(G("flatpickr-day "+c,new Date(e,n+1,f%i),0,u));var m=d("div","dayContainer");return m.appendChild(o),m}function ie(){if(void 0!==D.daysContainer){u(D.daysContainer),D.weekNumbers&&u(D.weekNumbers);for(var e=M.createDocumentFragment(),n=0;n<D.config.showMonths;n++){var t=new Date(D.currentYear,D.currentMonth,1);t.setMonth(D.currentMonth+n),e.appendChild(ae(t.getFullYear(),t.getMonth()))}D.daysContainer.appendChild(e),D.days=D.daysContainer.firstChild,"range"===D.config.mode&&1===D.selectedDates.length&&we(),We("onDaysBuilt")}}function oe(){if(!(void 0===D.monthsDropdownContainer||D.config.showMonths>1||"dropdown"!==D.config.monthSelectorType)){var e=function(e){return!(void 0!==D.config.minDate&&D.currentYear===D.config.minDate.getFullYear()&&e<D.config.minDate.getMonth())&&!(void 0!==D.config.maxDate&&D.currentYear===D.config.maxDate.getFullYear()&&e>D.config.maxDate.getMonth())};D.monthsDropdownContainer.tabIndex=-1,D.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=d("option","flatpickr-monthDropdown-month");t.value=new Date(D.currentYear,n).getMonth().toString(),t.textContent=h(n,D.config.shorthandCurrentMonth,D.l10n),t.tabIndex=-1,D.currentMonth===n&&(t.selected=!0),D.monthsDropdownContainer.appendChild(t)}}}function re(e){var n,t=d("div","flatpickr-month"),a=M.createDocumentFragment();D.config.showMonths>1||"static"===D.config.monthSelectorType?n=d("span","cur-month"):(D.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),D.monthsDropdownContainer.id=b+"-month",D.monthsDropdownContainer.setAttribute("aria-label",D.l10n.monthAriaLabel),W(D.monthsDropdownContainer,"change",(function(e){var n=g(e),t=parseInt(n.value,10);D.changeMonth(t-D.currentMonth),We("onMonthChange")})),oe(),n=D.monthsDropdownContainer);var i=m("cur-year",{id:b+"-year-"+e,tabindex:"-1"}),o=i.getElementsByTagName("input")[0];o.setAttribute("aria-label",D.l10n.yearAriaLabel),D.config.minDate&&o.setAttribute("min",D.config.minDate.getFullYear().toString()),D.config.maxDate&&(o.setAttribute("max",D.config.maxDate.getFullYear().toString()),o.disabled=!!D.config.minDate&&D.config.minDate.getFullYear()===D.config.maxDate.getFullYear());var r=d("div","flatpickr-current-month");return r.appendChild(n),r.appendChild(i),a.appendChild(r),t.appendChild(a),{container:t,yearElement:o,monthElement:n}}function le(){u(D.monthNav),D.monthNav.appendChild(D.prevMonthNav),D.config.showMonths&&(D.yearElements=[],D.monthElements=[]);for(var e=0;e<D.config.showMonths;e++){var n=re(e);D.yearElements.push(n.yearElement),D.monthElements.push(n.monthElement),D.monthNav.appendChild(n.container)}D.monthNav.appendChild(D.nextMonthNav)}function ce(){D.calendarContainer.classList.add("hasTime"),D.config.noCalendar&&D.calendarContainer.classList.add("noCalendar");var e=A(D.config);D.timeContainer=d("div","flatpickr-time"),D.timeContainer.tabIndex=-1;var n=d("span","flatpickr-time-separator",":"),t=m("flatpickr-hour",{id:b+"-hour","aria-label":D.l10n.hourAriaLabel});D.hourElement=t.getElementsByTagName("input")[0];var a=m("flatpickr-minute",{id:b+"-minute","aria-label":D.l10n.minuteAriaLabel});if(D.minuteElement=a.getElementsByTagName("input")[0],D.hourElement.tabIndex=D.minuteElement.tabIndex=-1,D.hourElement.value=o(D.latestSelectedDateObj?D.latestSelectedDateObj.getHours():D.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),D.minuteElement.value=o(D.latestSelectedDateObj?D.latestSelectedDateObj.getMinutes():e.minutes),D.hourElement.setAttribute("step",D.config.hourIncrement.toString()),D.minuteElement.setAttribute("step",D.config.minuteIncrement.toString()),D.hourElement.setAttribute("min",D.config.time_24hr?"0":"1"),D.hourElement.setAttribute("max",D.config.time_24hr?"23":"12"),D.hourElement.setAttribute("maxlength","2"),D.minuteElement.setAttribute("min","0"),D.minuteElement.setAttribute("max","59"),D.minuteElement.setAttribute("maxlength","2"),D.timeContainer.appendChild(t),D.timeContainer.appendChild(n),D.timeContainer.appendChild(a),D.config.time_24hr&&D.timeContainer.classList.add("time24hr"),D.config.enableSeconds){D.timeContainer.classList.add("hasSeconds");var i=m("flatpickr-second",{id:b+"-second"});D.secondElement=i.getElementsByTagName("input")[0],D.secondElement.value=o(D.latestSelectedDateObj?D.latestSelectedDateObj.getSeconds():e.seconds),D.secondElement.setAttribute("step",D.minuteElement.getAttribute("step")),D.secondElement.setAttribute("min","0"),D.secondElement.setAttribute("max","59"),D.secondElement.setAttribute("maxlength","2"),D.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),D.timeContainer.appendChild(i)}return D.config.time_24hr||(D.amPM=d("span","flatpickr-am-pm",D.l10n.amPM[r((D.latestSelectedDateObj?D.hourElement.value:D.config.defaultHour)>11)]),D.amPM.title=D.l10n.toggleTitle,D.amPM.tabIndex=-1,D.timeContainer.appendChild(D.amPM)),D.timeContainer}function se(){if(D.isMobile)return Re();var e=D.timeContainer;D.timeContainer=D.hourElement=D.minuteElement=void 0,D.secondElement=D.amPM=void 0,D.calendarContainer.classList.remove("hasTime"),D.calendarContainer.classList.remove("noCalendar"),D.config.enableTime&&(D.calendarContainer.insertBefore(ce(),e||(D.innerContainer?D.innerContainer.nextSibling:D.calendarContainer.firstChild)),U(),j()),e&&D.calendarContainer.removeChild(e)}function de(){D.weekdayContainer?u(D.weekdayContainer):D.weekdayContainer=d("div","flatpickr-weekdays");for(var e=D.config.showMonths;e--;){var n=d("div","flatpickr-weekdaycontainer");D.weekdayContainer.appendChild(n)}return ue(),D.weekdayContainer}function ue(){if(D.weekdayContainer){var e=D.l10n.firstDayOfWeek,t=n(D.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=n(t.splice(e,t.length),t.splice(0,e)));for(var a=D.config.showMonths;a--;)D.weekdayContainer.children[a].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function fe(e,n){void 0===n&&(n=!0);var t=n?e:e-D.currentMonth;t<0&&!0===D._hidePrevMonthArrow||t>0&&!0===D._hideNextMonthArrow||(D.currentMonth+=t,(D.currentMonth<0||D.currentMonth>11)&&(D.currentYear+=Math.floor(D.currentMonth/12),D.currentMonth=(D.currentMonth%12+12)%12,We("onYearChange"),oe()),ie(),We("onMonthChange"),Ue())}function me(e){return D.calendarContainer.contains(e)}function ge(e){var n=g(e),t=me(n),a=!(n===D.input||n===D.altInput||D.element.contains(n))&&!t&&!me(e.relatedTarget),i=!D.config.ignoredFocusElements.some((function(e){return e.contains(n)}));if(a&&i){var o=D.config.allowInput?Ce():void 0;if(void 0===o&&void 0!==D.timeContainer&&void 0!==D.minuteElement&&void 0!==D.hourElement&&""!==D.input.value&&void 0!==D.input.value&&S(),D.close(),void 0===D.config)return;"range"===D.config.mode&&1===D.selectedDates.length&&D.clear(!1),be(o)}}function pe(e){if(!(!e||D.config.minDate&&e<D.config.minDate.getFullYear()||D.config.maxDate&&e>D.config.maxDate.getFullYear())){var n=e,t=D.currentYear!==n;D.currentYear=n||D.currentYear,D.config.maxDate&&D.currentYear===D.config.maxDate.getFullYear()?D.currentMonth=Math.min(D.config.maxDate.getMonth(),D.currentMonth):D.config.minDate&&D.currentYear===D.config.minDate.getFullYear()&&(D.currentMonth=Math.max(D.config.minDate.getMonth(),D.currentMonth)),t&&(D.redraw(),We("onYearChange"))}}function he(e,n){var t;void 0===n&&(n=!0);var a=D.parseDate(e,void 0,n);if(D.config.minDate&&a&&O(a,D.config.minDate,void 0!==n?n:!D.minDateHasTime)<0||D.config.maxDate&&a&&O(a,D.config.maxDate,void 0!==n?n:!D.maxDateHasTime)>0)return!1;if(!D.config.enable&&0===D.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!D.config.enable,o=null!==(t=D.config.enable)&&void 0!==t?t:D.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=D.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function ve(e){return void 0!==D.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&D.daysContainer.contains(e))}function De(e){e.target!==D._input||e.relatedTarget&&me(e.relatedTarget)||be(Ce())}function Ce(){var e=D._typedValue();if(void 0!==e){var n={times:ye(),year:D.currentYear,month:D.currentMonth};return D.setDate(e,!1,D.config.altInput?D.config.altFormat:D.config.dateFormat),void 0!==D.hourElement&&(P(),Ve(!1)),n}}function be(e){void 0!==e&&(q(e.year,e.month),ye()!==e.times&&(D.selectedDates.length>0&&We("onValueUpdate"),We("onChange")))}function ye(){return D.selectedDates.map((function(e){return e.getTime()})).join()}function Me(e){var n=g(e),t=D.config.wrap?p.contains(n):n===D._input,a=D.config.allowInput,i=D.isOpen&&(!a||!t),o=D.config.inline&&t&&!a,r=n===D.monthsDropdownContainer&&e.keyCode>=37&&e.keyCode<=40;if(13===e.keyCode&&t){if(a)return be(Ce()),D.close(),n.blur();D.open()}else if(!r&&(me(n)||i||o)){var l=!!D.timeContainer&&D.timeContainer.contains(n);switch(e.keyCode){case 13:l?(e.preventDefault(),S(),Ye()):Ae(e);break;case 27:e.preventDefault(),Ye();break;case 8:case 46:t&&!D.config.allowInput&&(e.preventDefault(),D.clear());break;case 37:case 39:if(l||t)D.hourElement&&D.hourElement.focus();else{e.preventDefault();var c=E();if(void 0!==D.daysContainer&&(!1===a||c&&ve(c))){var s=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),fe(s),te($(1),0)):te(void 0,s)}}break;case 38:case 40:e.preventDefault();var d=40===e.keyCode?1:-1;D.daysContainer&&void 0!==n.$i||n===D.input||n===D.altInput||n===D.daysContainer?e.ctrlKey?(e.stopPropagation(),pe(D.currentYear-d),te($(1),0)):l||te(void 0,7*d):n===D.currentYearElement?pe(D.currentYear-d):D.config.enableTime&&(!l&&D.hourElement&&D.hourElement.focus(),S(e),D._debouncedChange());break;case 9:if(l){var u=[D.hourElement,D.minuteElement,D.secondElement,D.amPM].concat(D.pluginElements).filter((function(e){return e})),f=u.indexOf(n);if(-1!==f){var m=u[f+(e.shiftKey?-1:1)];e.preventDefault(),(m||D._input).focus()}}else!D.config.noCalendar&&D.daysContainer&&D.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),D._input.focus())}}if(void 0!==D.amPM&&n===D.amPM)switch(e.key){case D.l10n.amPM[0].charAt(0):case D.l10n.amPM[0].charAt(0).toLowerCase():D.amPM.textContent=D.l10n.amPM[0],P(),Ve();break;case D.l10n.amPM[1].charAt(0):case D.l10n.amPM[1].charAt(0).toLowerCase():D.amPM.textContent=D.l10n.amPM[1],P(),Ve()}(t||me(n))&&We("onKeyDown",e)}function we(e,n){if(void 0===n&&(n="flatpickr-day"),1===D.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():D.days.firstElementChild.dateObj.getTime(),a=D.parseDate(D.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,D.selectedDates[0].getTime()),o=Math.max(t,D.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=Y)he(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(D.rContainer.querySelectorAll("*:nth-child(-n+"+D.config.showMonths+") > ."+n)).forEach((function(n){var i,o,s,d=n.dateObj.getTime(),u=l>0&&d<l||c>0&&d>c;if(u)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!u||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=D.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&d===a?n.classList.add("startRange"):a>t&&d===a&&n.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=a,s=t,(i=d)>Math.min(o,s)&&i<Math.max(o,s))&&n.classList.add("inRange")))}))}}function Ee(){!D.isOpen||D.config.static||D.config.inline||_e()}function xe(e){return function(n){var t=D.config["_"+e+"Date"]=D.parseDate(n,D.config.dateFormat),a=D.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(D["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),D.selectedDates&&(D.config.allowInvalidPreload||(D.selectedDates=Pe(D.selectedDates,!0)),D.latestSelectedDateObj&&-1===D.selectedDates.indexOf(D.latestSelectedDateObj)&&(D.latestSelectedDateObj=D.selectedDates[D.selectedDates.length-1]),D.selectedDates.length||"min"!==e||j(t),Ve()),D.daysContainer&&(Fe(),void 0!==t?D.currentYearElement[e]=t.getFullYear().toString():D.currentYearElement.removeAttribute(e),D.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function Te(){var e=H.defaultConfig.dateFormat||a.dateFormat,n=H.defaultConfig.altFormat||a.altFormat,t="time"===C.mode;if(!C.enableTime&&!t)return{dateFormat:e,altFormat:n};var i=C.noCalendar||t,o=C.enableSeconds?":S":"";return{dateFormat:i?"H:i"+o:e+" H:i"+o,altFormat:C.altInput?i?"h:i"+o+" K":n+" h:i"+o+" K":n}}function ke(){var e=Te();void 0===C.dateFormat&&(D.config.dateFormat=e.dateFormat),void 0===C.altFormat&&(D.config.altFormat=e.altFormat)}function Se(){return D.config.wrap?p.querySelector("[data-input]"):p}function Ie(){"object"!=typeof D.config.locale&&void 0===H.l10ns[D.config.locale]&&D.config.errorHandler(new Error("flatpickr: invalid locale "+D.config.locale)),D.l10n=e(e({},H.l10ns.default),"object"==typeof D.config.locale?D.config.locale:"default"!==D.config.locale?H.l10ns[D.config.locale]:void 0),T.D="("+D.l10n.weekdays.shorthand.join("|")+")",T.l="("+D.l10n.weekdays.longhand.join("|")+")",T.M="("+D.l10n.months.shorthand.slice().sort((function(e,n){return n.length-e.length})).join("|")+")",T.F="("+D.l10n.months.longhand.slice().sort((function(e,n){return n.length-e.length})).join("|")+")",T.K="("+D.l10n.amPM[0]+"|"+D.l10n.amPM[1]+")",void 0===C.time_24hr&&void 0===H.defaultConfig.time_24hr&&(D.config.time_24hr=D.l10n.time_24hr),D.formatDate=I(D),D.parseDate=_({config:D.config,l10n:D.l10n})}function _e(e){if("function"!=typeof D.config.position){if(void 0!==D.calendarContainer){We("onPreCalendarPosition");var n=e||D._positionElement,t=Array.prototype.reduce.call(D.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=D.calendarContainer.offsetWidth,i=D.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=n.getBoundingClientRect(),c=y.innerHeight-l.bottom,d="above"!==o&&"below"!==o,u=c>=t,f=l.top>t,m=d&&!u&&!f&&!D.config.static&&!D.config.inline,g=m?l.top>c:"above"===o||d&&!u&&f,p=y.pageYOffset+l.top+(g?-t-2:n.offsetHeight+2),h=m?Math.max(y.pageYOffset,Math.min(p,y.pageYOffset+y.innerHeight-t)):p;if(s(D.calendarContainer,"arrowTop",!m&&!g),s(D.calendarContainer,"arrowBottom",!m&&g),!D.config.inline){var v=y.pageXOffset+l.left,C=!1,b=!1;"center"===r?(v-=(a-l.width)/2,C=!0):"right"===r&&(v-=a-l.width,b=!0),s(D.calendarContainer,"arrowLeft",!C&&!b),s(D.calendarContainer,"arrowCenter",C),s(D.calendarContainer,"arrowRight",b);var w=M.body.offsetWidth,E=y.pageXOffset+l.right,x=v+a>w,T=x&&E<a;if(s(D.calendarContainer,"rightMost",x),!D.config.static){s(D.calendarContainer,"centerMost",T),T?(s(D.calendarContainer,"rightMost",!1),v=Math.max(0,w/2-a/2),D.calendarContainer.style.setProperty("--fp-arrow-left",y.pageXOffset+l.left-v+"px")):x&&(v=E-a);var k=function(){var e=D.calendarContainer.offsetParent;e===M.body&&Oe(M.body)&&(e=Oe(M.documentElement)?null:M.documentElement);if(null===e)return{top:0,left:0};var n=e.getBoundingClientRect(),t=e===M.documentElement;return{top:y.pageYOffset+n.top+e.clientTop-(t?0:e.scrollTop),left:y.pageXOffset+n.left+e.clientLeft-(t?0:e.scrollLeft)}}();D.calendarContainer.style.top=h-k.top+"px",D.calendarContainer.style.left=v-k.left+"px",D.calendarContainer.style.right="auto"}}}}else D.config.position(D,e)}function Oe(e){return"static"===y.getComputedStyle(e).position}function Fe(){D.config.noCalendar||D.isMobile||(oe(),Ue(),ie())}function Ye(){D._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(D.close,0):D.close()}function Ae(e){e.preventDefault(),e.stopPropagation();var n=f(g(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==n){var t=n,a=D.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=12*D.currentYear+D.currentMonth,o=12*a.getFullYear()+a.getMonth(),r=(o<i||o>i+D.config.showMonths-1)&&"range"!==D.config.mode;if(D.selectedDateElem=t,"single"===D.config.mode)D.selectedDates=[a];else if("multiple"===D.config.mode){var l=Ke(a);l?D.selectedDates.splice(parseInt(l),1):D.selectedDates.push(a)}else"range"===D.config.mode&&(2===D.selectedDates.length&&D.clear(!1,!1),D.latestSelectedDateObj=a,D.selectedDates.push(a),0!==O(a,D.selectedDates[0],!0)&&D.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(P(),r){var c=D.currentYear!==a.getFullYear();D.currentYear=a.getFullYear(),D.currentMonth=a.getMonth(),c&&(We("onYearChange"),oe()),We("onMonthChange")}if(Ue(),ie(),Ve(),r||"range"===D.config.mode||1!==D.config.showMonths?void 0!==D.selectedDateElem&&void 0===D.hourElement&&D.selectedDateElem&&D.selectedDateElem.focus():Z(t),void 0!==D.hourElement&&void 0!==D.hourElement&&D.hourElement.focus(),D.config.closeOnSelect){var s="single"===D.config.mode&&!D.config.enableTime,d="range"===D.config.mode&&2===D.selectedDates.length&&!D.config.enableTime;(s||d)&&Ye()}B()}}D.parseDate=_({config:D.config,l10n:D.l10n}),D._handlers=[],D.pluginElements=[],D.loadedPlugins=[],D._bind=W,D._setHoursFromDate=j,D._positionCalendar=_e,D._showValue=function(){D.input.value=Je(D.config.dateFormat),void 0!==D.altInput&&(D.altInput.value=Je(D.config.altFormat))},D._typedValue=function(){return D._input.value.trimEnd()===Je()?void 0:D._input.value},D.changeMonth=fe,D.changeYear=pe,D.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);void 0!==D.mobileInput&&(D.mobileInput.value="");if(D.selectedDates=[],D.latestSelectedDateObj=void 0,D._showValue(),!0===n){var t=J(D._initialDate);D.currentYear=t.getFullYear(),D.currentMonth=t.getMonth()}if(!0===D.config.enableTime){var a=A(D.config),i=a.hours,o=a.minutes,r=a.seconds;L(i,o,r)}D.redraw(),e&&We("onChange")},D.close=function(){D.isOpen=!1,K(),D.isMobile||(void 0!==D.calendarContainer&&D.calendarContainer.classList.remove("open"),void 0!==D._input&&D._input.classList.remove("active"));We("onClose")},D.onMouseOver=we,D._createElement=d,D.createDay=G,D.destroy=function(){void 0!==D.config&&We("onDestroy");for(var e=D._handlers.length;e--;)D._handlers[e].remove();if(D._handlers=[],K(),D.mobileInput)D.mobileInput.parentNode&&D.mobileInput.parentNode.removeChild(D.mobileInput),D.mobileInput=void 0;else if(D.calendarContainer&&D.calendarContainer.parentNode)if(D.config.static&&D.calendarContainer.parentNode){var n=D.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else D.calendarContainer.parentNode.removeChild(D.calendarContainer);D.altInput&&(D.input.type="text",D.altInput.parentNode&&D.altInput.parentNode.removeChild(D.altInput),delete D.altInput);D.input&&(D.input.type=D.input._type,D.input.classList.remove("flatpickr-input"),D.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete D[e]}catch(e){}}))},D.isEnabled=he,D.jumpToDate=V,D.updateValue=Ve,D.open=function(e,n){void 0===n&&(n=D._positionElement);if(!0===D.isMobile){if(e){e.preventDefault();var t=g(e);t&&t.blur()}return void 0!==D.mobileInput&&(D.mobileInput.focus(),D.mobileInput.click()),void We("onOpen")}if(D._input.disabled||D.config.inline)return;var a=D.isOpen;D.isOpen=!0,a||(!function(){var e=function(e,n,t,a){e.addEventListener(n,t,a),w.push({remove:function(){return e.removeEventListener(n,t,a)}})};D.config.static||e(y,"resize",l(Ee,50));e(M,void 0!==y.ontouchstart?"touchstart":"mousedown",ge),e(M,"focus",ge,{capture:!0})}(),D.calendarContainer.classList.add("open"),D._input.classList.add("active"),We("onOpen"),_e(n));!0===D.config.enableTime&&!0===D.config.noCalendar&&(!1!==D.config.allowInput||void 0!==e&&D.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return D.hourElement.select()}),50))},D.redraw=Fe,D.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(D.config,e),Object.assign(C,e),e)void 0!==Ne[a]&&Ne[a].forEach((function(e){return e()}));else D.config[e]=n,C[e]=n,void 0!==Ne[e]?Ne[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(D.config[e]=c(n));D.redraw(),Ve(!0)},D.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=D.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return D.clear(n);je(e,t),D.latestSelectedDateObj=D.selectedDates[D.selectedDates.length-1],D.redraw(),V(void 0,n),j(),0===D.selectedDates.length&&D.clear(!1);Ve(n),n&&We("onChange")},D.toggle=function(e){if(!0===D.isOpen)return D.close();D.open(e)};var Ne={locale:[Ie,ue],showMonths:[le,k,de],minDate:[V],maxDate:[V],positionElement:[Le],enableTime:[ke,se],enableSeconds:[ke,se],time_24hr:[se],clickOpens:[function(){!0===D.config.clickOpens?(W(D._input,"focus",D.open),W(D._input,"click",D.open)):(D._input.removeEventListener("focus",D.open),D._input.removeEventListener("click",D.open))}]};function Pe(e,n){var t=e.filter((function(e){return he(e,n)}));return"range"===D.config.mode&&t.length<e.length?[]:t}function je(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return D.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[D.parseDate(e,n)];else if("string"==typeof e)switch(D.config.mode){case"single":case"time":t=[D.parseDate(e,n)];break;case"multiple":t=e.split(D.config.conjunction).map((function(e){return D.parseDate(e,n)}));break;case"range":1!==(t=e.split(D.l10n.rangeSeparator).map((function(e){return D.parseDate(e,n)}))).length||D.config.enableTime||t.push(D.parseDate(e,n))}else D.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));var a=t.filter((function(e){return e instanceof Date}));D.selectedDates=D.config.allowInvalidPreload?a:Pe(a,!1),"range"===D.config.mode&&D.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function He(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?D.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:D.parseDate(e.from,void 0),to:D.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function Le(){D._positionElement=D.config.positionElement||D._input}function Re(){var e=D.config.enableTime?D.config.noCalendar?"time":"datetime-local":"date";D.mobileInput.type=e,D.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S"}function We(e,n){if(void 0!==D.config){var t=D.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](D.selectedDates,D.input.value,D,n);"onChange"===e&&(D.input.dispatchEvent(Be("change")),D.input.dispatchEvent(Be("input")))}}function Be(e){var n=M.createEvent("Event");return n.initEvent(e,!0,!0),n}function Ke(e){for(var n=0;n<D.selectedDates.length;n++)if(0===O(D.selectedDates[n],e))return""+n;return!1}function Ue(){D.config.noCalendar||D.isMobile||!D.monthNav||(D.yearElements.forEach((function(e,n){var t=new Date(D.currentYear,D.currentMonth,1);t.setMonth(D.currentMonth+n),D.config.showMonths>1||"static"===D.config.monthSelectorType?D.monthElements[n].textContent=h(t.getMonth(),D.config.shorthandCurrentMonth,D.l10n)+" ":D.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),D._hidePrevMonthArrow=void 0!==D.config.minDate&&(D.currentYear===D.config.minDate.getFullYear()?D.currentMonth<=D.config.minDate.getMonth():D.currentYear<D.config.minDate.getFullYear()),D._hideNextMonthArrow=void 0!==D.config.maxDate&&(D.currentYear===D.config.maxDate.getFullYear()?D.currentMonth+1>D.config.maxDate.getMonth():D.currentYear>D.config.maxDate.getFullYear()))}function Je(e){var n=e||(D.config.altInput?D.config.altFormat:D.config.dateFormat);return D.selectedDates.map((function(e){return D.formatDate(e,n)})).filter((function(e,n,t){return"range"!==D.config.mode||D.config.enableTime||t.indexOf(e)===n})).join("range"!==D.config.mode?D.config.conjunction:D.l10n.rangeSeparator)}function Ve(e){if(void 0===e&&(e=!0),void 0!==D.mobileInput&&D.mobileFormatStr){var n=void 0!==D.latestSelectedDateObj?D.formatDate(D.latestSelectedDateObj,D.mobileFormatStr):"",t=D.parseDate(D.mobileInput.value,D.mobileFormatStr);void 0!==t&&D.formatDate(t,D.mobileFormatStr)===n||(D.mobileInput.value=n)}D._showValue(),!1!==e&&We("onValueUpdate")}function qe(e){var n=g(e),t=D.prevMonthNav.contains(n),a=D.nextMonthNav.contains(n);t||a?fe(t?-1:1):D.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?D.changeYear(D.currentYear+1):n.classList.contains("arrowDown")&&D.changeYear(D.currentYear-1)}return function(){D.element=D.input=p,D.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"];Object.assign(C,JSON.parse(JSON.stringify(p.dataset||{})),v),D.config.parseDate=C.parseDate,D.config.formatDate=C.formatDate,Object.defineProperty(D.config,"enable",{get:function(){return D.config._enable},set:function(e){D.config._enable=He(e)}}),Object.defineProperty(D.config,"disable",{get:function(){return D.config._disable},set:function(e){D.config._disable=He(e)}}),Object.defineProperty(D.config,"minDate",{get:function(){return D.config._minDate},set:xe("min")}),Object.defineProperty(D.config,"maxDate",{get:function(){return D.config._maxDate},set:xe("max")});var n=function(e){return function(n){D.config["min"===e?"_minTime":"_maxTime"]=D.parseDate(n,"H:i:S")}};Object.defineProperty(D.config,"minTime",{get:function(){return D.config._minTime},set:n("min")}),Object.defineProperty(D.config,"maxTime",{get:function(){return D.config._maxTime},set:n("max")}),"time"===C.mode&&(D.config.noCalendar=!0,D.config.enableTime=!0);Object.assign(D.config,Te(),C);for(var a=0;a<e.length;a++)D.config[e[a]]=!0===D.config[e[a]]||"true"===D.config[e[a]];t.filter((function(e){return void 0!==D.config[e]})).forEach((function(e){D.config[e]=c(D.config[e]||[]).map(x)}));for(a=0;a<D.config.plugins.length;a++){var i=D.config.plugins[a](D)||{};for(var o in i)t.indexOf(o)>-1?D.config[o]=c(i[o]).map(x).concat(D.config[o]):void 0===C[o]&&(D.config[o]=i[o])}D.isMobile=!D.config.disableMobile&&!D.config.inline&&"single"===D.config.mode&&!D.config.disable.length&&!D.config.enable&&!D.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),C.altInputClass||(D.config.altInputClass=Se().className+" "+D.config.altInputClass);We("onParseConfig")}(),Ie(),function(){if(D.input=Se(),!D.input)return void D.config.errorHandler(new Error("Invalid input element specified"));D.input._type=D.input.type,D.input.type="text",D.input.classList.add("flatpickr-input"),D._input=D.input,D.config.altInput&&(D.altInput=d(D.input.nodeName,D.config.altInputClass),D._input=D.altInput,D.altInput.placeholder=D.input.placeholder,D.altInput.disabled=D.input.disabled,D.altInput.required=D.input.required,D.altInput.tabIndex=D.input.tabIndex,D.altInput.type="text",D.input.setAttribute("type","hidden"),!D.config.static&&D.input.parentNode&&D.input.parentNode.insertBefore(D.altInput,D.input.nextSibling));D.config.allowInput||D._input.setAttribute("readonly","readonly");Le()}(),function(){D.selectedDates=[],D.now=D.parseDate(D.config.now)||new Date;var e=D.config.defaultDate||("INPUT"!==D.input.nodeName&&"TEXTAREA"!==D.input.nodeName||!D.input.placeholder||D.input.value!==D.input.placeholder?D.input.value:null);e&&je(e,D.config.dateFormat);D._initialDate=D.selectedDates.length>0?D.selectedDates[0]:J(D.now),D.currentYear=D._initialDate.getFullYear(),D.currentMonth=D._initialDate.getMonth(),D.selectedDates.length>0&&(D.latestSelectedDateObj=D.selectedDates[0]);void 0!==D.config.minTime&&(D.config.minTime=D.parseDate(D.config.minTime,"H:i"));void 0!==D.config.maxTime&&(D.config.maxTime=D.parseDate(D.config.maxTime,"H:i"));D.minDateHasTime=!!D.config.minDate&&(D.config.minDate.getHours()>0||D.config.minDate.getMinutes()>0||D.config.minDate.getSeconds()>0),D.maxDateHasTime=!!D.config.maxDate&&(D.config.maxDate.getHours()>0||D.config.maxDate.getMinutes()>0||D.config.maxDate.getSeconds()>0)}(),D.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=D.currentMonth),void 0===n&&(n=D.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:D.l10n.daysInMonth[e]}},D.isMobile||function(){var e=M.createDocumentFragment();if(D.calendarContainer=d("div","flatpickr-calendar"),D.calendarContainer.tabIndex=-1,!D.config.noCalendar){if(e.appendChild((D.monthNav=d("div","flatpickr-months"),D.yearElements=[],D.monthElements=[],D.prevMonthNav=d("span","flatpickr-prev-month"),D.prevMonthNav.innerHTML=D.config.prevArrow,D.nextMonthNav=d("span","flatpickr-next-month"),D.nextMonthNav.innerHTML=D.config.nextArrow,le(),Object.defineProperty(D,"_hidePrevMonthArrow",{get:function(){return D.__hidePrevMonthArrow},set:function(e){D.__hidePrevMonthArrow!==e&&(s(D.prevMonthNav,"flatpickr-disabled",e),D.__hidePrevMonthArrow=e)}}),Object.defineProperty(D,"_hideNextMonthArrow",{get:function(){return D.__hideNextMonthArrow},set:function(e){D.__hideNextMonthArrow!==e&&(s(D.nextMonthNav,"flatpickr-disabled",e),D.__hideNextMonthArrow=e)}}),D.currentYearElement=D.yearElements[0],Ue(),D.monthNav)),D.innerContainer=d("div","flatpickr-innerContainer"),D.config.weekNumbers){var n=function(){D.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",D.l10n.weekAbbreviation));var n=d("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,a=n.weekNumbers;D.innerContainer.appendChild(t),D.weekNumbers=a,D.weekWrapper=t}D.rContainer=d("div","flatpickr-rContainer"),D.rContainer.appendChild(de()),D.daysContainer||(D.daysContainer=d("div","flatpickr-days"),D.daysContainer.tabIndex=-1),ie(),D.rContainer.appendChild(D.daysContainer),D.innerContainer.appendChild(D.rContainer),e.appendChild(D.innerContainer)}D.config.enableTime&&e.appendChild(ce());s(D.calendarContainer,"rangeMode","range"===D.config.mode),s(D.calendarContainer,"animate",!0===D.config.animate),s(D.calendarContainer,"multiMonth",D.config.showMonths>1),D.calendarContainer.appendChild(e);var i=void 0!==D.config.appendTo&&void 0!==D.config.appendTo.nodeType;if((D.config.inline||D.config.static)&&(D.calendarContainer.classList.add(D.config.inline?"inline":"static"),D.config.inline&&(!i&&D.element.parentNode?D.element.parentNode.insertBefore(D.calendarContainer,D._input.nextSibling):void 0!==D.config.appendTo&&D.config.appendTo.appendChild(D.calendarContainer)),D.config.static)){var o=d("div","flatpickr-wrapper");D.element.parentNode&&D.element.parentNode.insertBefore(o,D.element),o.appendChild(D.element),D.altInput&&D.input.parentNode&&D.input.parentNode.insertBefore(D.altInput,D.input.nextSibling),o.appendChild(D.calendarContainer)}D.config.static||D.config.inline||(void 0!==D.config.appendTo?D.config.appendTo:M.body).appendChild(D.calendarContainer)}(),function(){D.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(D.element.querySelectorAll("[data-"+e+"]"),(function(n){return W(n,"click",D[e])}))}));if(D.isMobile)return void function(){D.mobileInput=d("input",D.input.className+" flatpickr-mobile"),D.mobileInput.tabIndex=1,Re(),D.mobileInput.disabled=D.input.disabled,D.mobileInput.required=D.input.required,D.mobileInput.placeholder=D.input.placeholder,D.selectedDates.length>0&&(D.mobileInput.defaultValue=D.mobileInput.value=D.formatDate(D.selectedDates[0],D.mobileFormatStr));D.config.minDate&&(D.mobileInput.min=D.formatDate(D.config.minDate,"Y-m-d"));D.config.maxDate&&(D.mobileInput.max=D.formatDate(D.config.maxDate,"Y-m-d"));D.input.getAttribute("step")&&(D.mobileInput.step=String(D.input.getAttribute("step")));D.input.type="hidden",void 0!==D.altInput&&(D.altInput.type="hidden");try{D.input.parentNode&&D.input.parentNode.insertBefore(D.mobileInput,D.input.nextSibling)}catch(e){}W(D.mobileInput,"change",(function(e){D.setDate(g(e).value,!1,D.mobileFormatStr),We("onChange"),We("onClose")}))}();D._debouncedChange=l(B,300),D.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&W(D.daysContainer,"mouseover",(function(e){"range"===D.config.mode&&we(g(e))}));W(D._input,"keydown",Me),void 0!==D.calendarContainer&&W(D.calendarContainer,"keydown",Me);!0===D.config.clickOpens&&(W(D._input,"focus",D.open),W(D._input,"click",D.open));void 0!==D.daysContainer&&(W(D.monthNav,"click",qe),W(D.monthNav,["keyup","increment"],R),W(D.daysContainer,"click",Ae));U(),D.config.allowInput&&W(D._input,"blur",De)}(),(D.selectedDates.length||D.config.noCalendar)&&(D.config.enableTime&&j(D.config.noCalendar?D.latestSelectedDateObj:void 0),Ve(!1)),k();var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!D.isMobile&&e&&_e(),We("onReady")}(),D}function j(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e.nodeType===Node.ELEMENT_NODE})),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=P(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return j(this,e)},HTMLElement.prototype.flatpickr=function(e){return j([this],e)});var H=function(e,n){return"string"==typeof e?j(window.document.querySelectorAll(e),n):"number"==typeof(null===(t=e)||void 0===t?void 0:t.nodeType)?j([e],n):j(e,n);var t};return H.defaultConfig={},H.l10ns={en:e({},i),default:e({},i)},H.localize=function(n){H.l10ns.default=e(e({},H.l10ns.default),n)},H.setDefaults=function(n){H.defaultConfig=e(e({},H.defaultConfig),n)},H.parseDate=_({}),H.formatDate=I({}),H.compareDates=O,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return j(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=H),H}));
package/dist/l10n/br.js CHANGED
@@ -17,7 +17,7 @@
17
17
  "Disul",
18
18
  "Dilun",
19
19
  "Dimeurzh",
20
- "Dimerc'hed",
20
+ "Dimerc'her",
21
21
  "Diriaou",
22
22
  "Digwener",
23
23
  "Disadorn",
package/dist/l10n/he.js CHANGED
@@ -44,7 +44,7 @@
44
44
  "דצמבר",
45
45
  ],
46
46
  },
47
- rangeSeparator: " אל ",
47
+ rangeSeparator: " עד ",
48
48
  time_24hr: true,
49
49
  };
50
50
  fp.l10ns.he = Hebrew;
@@ -334,7 +334,7 @@
334
334
  "Disul",
335
335
  "Dilun",
336
336
  "Dimeurzh",
337
- "Dimerc'hed",
337
+ "Dimerc'her",
338
338
  "Diriaou",
339
339
  "Digwener",
340
340
  "Disadorn",
@@ -1571,7 +1571,7 @@
1571
1571
  "דצמבר",
1572
1572
  ],
1573
1573
  },
1574
- rangeSeparator: " אל ",
1574
+ rangeSeparator: " עד ",
1575
1575
  time_24hr: true,
1576
1576
  };
1577
1577
  fp$n.l10ns.he = Hebrew;
@@ -33,6 +33,35 @@
33
33
  var dateFormat = "", secondInput, _secondInputFocused, _prevDates = [];
34
34
  // the anchor flatpickr itself uses for fp._input
35
35
  var firstInputAnchor = function () { return fp.config.positionElement || fp._input; };
36
+ // the selected dates as the inputs show them: the start in fp._input and
37
+ // the end in the second input
38
+ var shownValue = function () {
39
+ var _a = fp.selectedDates.map(function (d) {
40
+ return fp.formatDate(d, dateFormat);
41
+ }), _b = _a[0], first = _b === void 0 ? "" : _b, _c = _a[1], second = _c === void 0 ? "" : _c;
42
+ return [first, second];
43
+ };
44
+ // What was typed into the inputs since they showed the selected dates, if
45
+ // anything, as the range flatpickr commits: both ends, or none
46
+ var typedValue = function () {
47
+ var shown = shownValue();
48
+ var ends = [fp._input.value, secondInput.value];
49
+ var typed = [0, 1].filter(function (i) { return ends[i] !== shown[i]; });
50
+ if (typed.length === 0)
51
+ return undefined;
52
+ var dates = ends.map(function (text) { return fp.parseDate(text, dateFormat); });
53
+ // a typed end that was emptied or doesn't parse leaves the other end as
54
+ // both ends, or none when that one doesn't parse either
55
+ typed.forEach(function (i) {
56
+ if (!dates[i])
57
+ ends[i] = dates[1 - i] ? ends[1 - i] : "";
58
+ });
59
+ // one end typed past the other takes it along, as a day picked past it
60
+ // does in onValueUpdate
61
+ if (typed.length === 1 && dates[0] && dates[1] && dates[0] > dates[1])
62
+ ends[1 - typed[0]] = ends[typed[0]];
63
+ return ends.join(fp.l10n.rangeSeparator);
64
+ };
36
65
  var createSecondInput = function () {
37
66
  if (config.input) {
38
67
  secondInput =
@@ -57,10 +86,12 @@
57
86
  // like flatpickr's own input, it only preloads without a defaultDate
58
87
  if (!fp.config.defaultDate && secondInput.value) {
59
88
  var parsedDate = fp.parseDate(secondInput.value, dateFormat);
60
- // the inputs preload as one range: this end only pairs with a kept
61
- // start, and onReady's setDate then checks the pair (#3108)
62
- if (parsedDate && fp.selectedDates.length === 1)
63
- fp.selectedDates.push(parsedDate);
89
+ // the inputs preload as one range: this end replaces the one flatpickr
90
+ // read from the first input (a lone date is read as both, #3010) and
91
+ // only pairs with a kept start; onReady's setDate then checks the
92
+ // pair (#3108)
93
+ if (parsedDate && fp.selectedDates.length > 0)
94
+ fp.selectedDates = [fp.selectedDates[0], parsedDate];
64
95
  }
65
96
  secondInput.setAttribute("data-fp-omit", "");
66
97
  if (fp.config.clickOpens) {
@@ -84,7 +115,9 @@
84
115
  if (fp.config.allowInput)
85
116
  fp._bind(secondInput, "keydown", function (e) {
86
117
  if (e.key === "Enter") {
87
- fp.setDate([fp.selectedDates[0], secondInput.value], true, dateFormat);
118
+ var typed = typedValue();
119
+ if (typed !== undefined)
120
+ fp.setDate(typed, true, dateFormat);
88
121
  secondInput.click();
89
122
  }
90
123
  });
@@ -108,6 +141,15 @@
108
141
  else {
109
142
  secondInput.setAttribute("readonly", "readonly");
110
143
  }
144
+ // flatpickr's own write keeps the whole range in fp.input with altInput
145
+ var showValue = fp._showValue;
146
+ fp._showValue = function () {
147
+ showValue();
148
+ var _a = shownValue(), first = _a[0], second = _a[1];
149
+ fp._input.value = first;
150
+ secondInput.value = second;
151
+ };
152
+ fp._typedValue = typedValue;
111
153
  // flatpickr itself opens the calendar from fp._input, before this runs
112
154
  fp._bind(fp._input, "focus", function () {
113
155
  var anchor = firstInputAnchor();
@@ -120,11 +162,6 @@
120
162
  _secondInputFocused = false;
121
163
  fp.jumpToDate(fp.selectedDates[0]);
122
164
  });
123
- if (fp.config.allowInput)
124
- fp._bind(fp._input, "keydown", function (e) {
125
- if (e.key === "Enter")
126
- fp.setDate([fp._input.value, fp.selectedDates[1]], true, dateFormat);
127
- });
128
165
  fp.setDate(fp.selectedDates, false);
129
166
  plugin.onValueUpdate(fp.selectedDates);
130
167
  fp.loadedPlugins.push("range");
@@ -138,7 +175,6 @@
138
175
  setTimeout(function () {
139
176
  if (fp.selectedDates.length)
140
177
  return;
141
- secondInput.value = "";
142
178
  _prevDates = [];
143
179
  }, 10);
144
180
  }
@@ -156,8 +192,9 @@
156
192
  if (!secondInput)
157
193
  return;
158
194
  // one side of the range is left, from a day picked on the calendar or
159
- // a typed side that didn't parse: keep the other side (a range ruled
160
- // out, or dropping both, leaves nothing to keep)
195
+ // setDate with one date: keep the other side (a range ruled out, or
196
+ // dropping both, leaves nothing to keep). Typed ends come in pairs
197
+ // from typedValue
161
198
  var isEdit = selDates.length === 1 && _prevDates.length === 2;
162
199
  if (isEdit) {
163
200
  var newSelectedDate = selDates[0];
@@ -178,11 +215,6 @@
178
215
  else {
179
216
  _prevDates = __spreadArrays(selDates);
180
217
  }
181
- var _a = fp.selectedDates.map(function (d) {
182
- return fp.formatDate(d, dateFormat);
183
- }), _b = _a[0], first = _b === void 0 ? "" : _b, _c = _a[1], second = _c === void 0 ? "" : _c;
184
- fp._input.value = first;
185
- secondInput.value = second;
186
218
  },
187
219
  };
188
220
  return plugin;
@@ -0,0 +1,14 @@
1
+ import { Plugin } from "../../types/options";
2
+ export interface Config {
3
+ yearsPerPage: number;
4
+ columns: number;
5
+ dateFormat: string;
6
+ altFormat: string;
7
+ theme: string;
8
+ }
9
+ export declare type YearElement = HTMLSpanElement & {
10
+ dateObj: Date;
11
+ $year: number;
12
+ };
13
+ declare function yearSelectPlugin(pluginConfig?: Partial<Config>): Plugin;
14
+ export default yearSelectPlugin;