/home/silvwabw/public_html/wp-content/plugins/gutenverse-form/assets/js/frontend/input-date.js
(()=>{"use strict";var e={896(){"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(t){t&&Object.keys(t).forEach(function(n){return e[n]=t[n]})},o=0,i=t;o<i.length;o++)a(i[o]);return e})}},t={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,a(o.key),o)}}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}const l=gutenverseCoreFrontend;var c=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],s={_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 t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.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:[],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},d={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 t=e%100;if(t>3&&t<21)return"th";switch(t%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};const u=d;var f=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},m=function(e){return!0===e?1:0};function g(e,t){var n;return function(){var a=this,o=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(a,o)},t)}}var p=function(e){return e instanceof Array?e:[e]};function h(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function v(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function D(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function b(e,t){return t(e)?e:e.parentNode?b(e.parentNode,t):void 0}function y(e,t){var n=v("div","numInputWrapper"),a=v("input","numInput "+e),o=v("span","arrowUp"),i=v("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(o),n.appendChild(i),n}function w(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var C=function(){},M=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},x={D:C,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*m(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var a=parseInt(t),o=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return o.setDate(o.getDate()-o.getDay()+n.firstDayOfWeek),o},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:C,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:C,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},E={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,t,n){return t.weekdays.shorthand[k.w(e,t,n)]},F:function(e,t,n){return M(k.n(e,t,n)-1,!1,t)},G:function(e,t,n){return f(k.h(e,t,n))},H:function(e){return f(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[m(e.getHours()>11)]},M:function(e,t){return M(e.getMonth(),!0,t)},S:function(e){return f(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return f(e.getFullYear(),4)},d:function(e){return f(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return f(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return f(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)}},T=function(e){var t=e.config,n=void 0===t?s:t,a=e.l10n,o=void 0===a?d:a,i=e.isMobile,r=void 0!==i&&i;return function(e,t,a){var i=a||o;return void 0===n.formatDate||r?t.split("").map(function(t,a,o){return k[t]&&"\\"!==o[a-1]?k[t](e,i,n):"\\"!==t?t:""}).join(""):n.formatDate(e,t,i)}},_=function(e){var t=e.config,n=void 0===t?s:t,a=e.l10n,o=void 0===a?d:a;return function(e,t,a,i){if(0===e||e){var r,l=i||o,c=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var d=t||(n||s).dateFormat,u=String(e).trim();if("today"===u)r=new Date,a=!0;else if(n&&n.parseDate)r=n.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))r=new Date(e);else{for(var f=void 0,m=[],g=0,p=0,h="";g<d.length;g++){var v=d[g],D="\\"===v,b="\\"===d[g-1]||D;if(E[v]&&!b){h+=E[v];var y=new RegExp(h).exec(e);y&&(f=!0)&&m["Y"!==v?"push":"unshift"]({fn:x[v],val:y[++p]})}else D||(h+=".")}r=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),m.forEach(function(e){var t=e.fn,n=e.val;return r=t(r,n,l)||r}),r=f?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===a&&r.setHours(0,0,0,0),r;n.errorHandler(new Error("Invalid date provided: "+c))}}};function S(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var O=function(e,t,n){return 3600*e+60*t+n};function I(e){var t=e.defaultHour,n=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var o=e.minDate.getHours(),i=e.minDate.getMinutes(),r=e.minDate.getSeconds();t<o&&(t=o),t===o&&n<i&&(n=i),t===o&&n===i&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(t=Math.min(t,l))===l&&(n=Math.min(c,n)),t===l&&n===c&&(a=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:a}}!function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}(896);var F=function(){return F=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},F.apply(this,arguments)},P=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var a=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],r=0,l=i.length;r<l;r++,o++)a[o]=i[r];return a};function A(e,t){var n={config:F(F({},s),j.defaultConfig),l10n:u};function a(){var e;return(null===(e=n.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function o(e){return e.bind(n)}function i(){var e=n.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==n.calendarContainer&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),void 0!==n.daysContainer){var t=(n.days.offsetWidth+1)*e.showMonths;n.daysContainer.style.width=t+"px",n.calendarContainer.style.width=t+(void 0!==n.weekWrapper?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function r(e){if(0===n.selectedDates.length){var t=void 0===n.config.minDate||S(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),a=I(n.config);t.setHours(a.hours,a.minutes,a.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,a=w(e),o=a;void 0!==n.amPM&&a===n.amPM&&(n.amPM.textContent=n.l10n.amPM[m(n.amPM.textContent===n.l10n.amPM[0])]);var i=parseFloat(o.getAttribute("min")),r=parseFloat(o.getAttribute("max")),l=parseFloat(o.getAttribute("step")),c=parseInt(o.value,10),s=c+l*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==o.value&&2===o.value.length){var d=o===n.hourElement,u=o===n.minuteElement;s<i?(s=r+s+m(!d)+(m(d)&&m(!n.amPM)),u&&H(void 0,-1,n.hourElement)):s>r&&(s=o===n.hourElement?s-r-m(!n.amPM):i,u&&H(void 0,1,n.hourElement)),n.amPM&&d&&(1===l?s+c===23:Math.abs(s-c)>l)&&(n.amPM.textContent=n.l10n.amPM[m(n.amPM.textContent===n.l10n.amPM[0])]),o.value=f(s)}}(e);var o=n._input.value;l(),Ce(),n._input.value!==o&&n._debouncedChange()}function l(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,a=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,o=(parseInt(n.minuteElement.value,10)||0)%60,i=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=a,t=n.amPM.textContent,a=e%12+12*m(t===n.l10n.amPM[1]));var r=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===S(n.latestSelectedDateObj,n.config.minDate,!0),l=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===S(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var c=O(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),s=O(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=O(a,o,i);if(d>s&&d<c){var u=function(e){var t=Math.floor(e/3600),n=(e-3600*t)/60;return[t,n,e-3600*t-60*n]}(c);a=u[0],o=u[1],i=u[2]}}else{if(l){var f=void 0!==n.config.maxTime?n.config.maxTime:n.config.maxDate;(a=Math.min(a,f.getHours()))===f.getHours()&&(o=Math.min(o,f.getMinutes())),o===f.getMinutes()&&(i=Math.min(i,f.getSeconds()))}if(r){var g=void 0!==n.config.minTime?n.config.minTime:n.config.minDate;(a=Math.max(a,g.getHours()))===g.getHours()&&o<g.getMinutes()&&(o=g.getMinutes()),o===g.getMinutes()&&(i=Math.max(i,g.getSeconds()))}}C(a,o,i)}}function d(e){var t=e||n.latestSelectedDateObj;t&&t instanceof Date&&C(t.getHours(),t.getMinutes(),t.getSeconds())}function C(e,t,a){void 0!==n.latestSelectedDateObj&&n.latestSelectedDateObj.setHours(e%24,t,a||0,0),n.hourElement&&n.minuteElement&&!n.isMobile&&(n.hourElement.value=f(n.config.time_24hr?e:(12+e)%12+12*m(e%12==0)),n.minuteElement.value=f(t),void 0!==n.amPM&&(n.amPM.textContent=n.l10n.amPM[m(e>=12)]),void 0!==n.secondElement&&(n.secondElement.value=f(a)))}function x(e){var t=w(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&X(n)}function k(e,t,a,o){return t instanceof Array?t.forEach(function(t){return k(e,t,a,o)}):e instanceof Array?e.forEach(function(e){return k(e,t,a,o)}):(e.addEventListener(t,a,o),void n._handlers.push({remove:function(){return e.removeEventListener(t,a,o)}}))}function A(){ve("onChange")}function N(e,t){var a=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),o=n.currentYear,i=n.currentMonth;try{void 0!==a&&(n.currentYear=a.getFullYear(),n.currentMonth=a.getMonth())}catch(e){e.message="Invalid date supplied: "+a,n.config.errorHandler(e)}t&&n.currentYear!==o&&(ve("onYearChange"),U()),!t||n.currentYear===o&&n.currentMonth===i||ve("onMonthChange"),n.redraw()}function Y(e){var t=w(e);~t.className.indexOf("arrow")&&H(e,t.classList.contains("arrowUp")?1:-1)}function H(e,t,n){var a=e&&w(e),o=n||a&&a.parentNode&&a.parentNode.firstChild,i=De("increment");i.delta=t,o&&o.dispatchEvent(i)}function L(e,t,a,o){var i=ee(t,!0),r=v("span",e,t.getDate().toString());return r.dateObj=t,r.$i=o,r.setAttribute("aria-label",n.formatDate(t,n.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===S(t,n.now)&&(n.todayDateElem=r,r.classList.add("today"),r.setAttribute("aria-current","date")),i?(r.tabIndex=-1,be(t)&&(r.classList.add("selected"),n.selectedDateElem=r,"range"===n.config.mode&&(h(r,"startRange",n.selectedDates[0]&&0===S(t,n.selectedDates[0],!0)),h(r,"endRange",n.selectedDates[1]&&0===S(t,n.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("flatpickr-disabled"),"range"===n.config.mode&&function(e){return!("range"!==n.config.mode||n.selectedDates.length<2)&&S(e,n.selectedDates[0])>=0&&S(e,n.selectedDates[1])<=0}(t)&&!be(t)&&r.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&o%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(t)+"</span>"),ve("onDayCreate",r),r}function R(e){e.focus(),"range"===n.config.mode&&oe(e)}function W(e){for(var t=e>0?0:n.config.showMonths-1,a=e>0?n.config.showMonths:-1,o=t;o!=a;o+=e)for(var i=n.daysContainer.children[o],r=e>0?0:i.children.length-1,l=e>0?i.children.length:-1,c=r;c!=l;c+=e){var s=i.children[c];if(-1===s.className.indexOf("hidden")&&ee(s.dateObj))return s}}function B(e,t){var o=a(),i=te(o||document.body),r=void 0!==e?e:i?o:void 0!==n.selectedDateElem&&te(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&te(n.todayDateElem)?n.todayDateElem:W(t>0?1:-1);void 0===r?n._input.focus():i?function(e,t){for(var a=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,o=t>0?n.config.showMonths:-1,i=t>0?1:-1,r=a-n.currentMonth;r!=o;r+=i)for(var l=n.daysContainer.children[r],c=a-n.currentMonth===r?e.$i+t:t<0?l.children.length-1:0,s=l.children.length,d=c;d>=0&&d<s&&d!=(t>0?s:-1);d+=i){var u=l.children[d];if(-1===u.className.indexOf("hidden")&&ee(u.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return R(u)}n.changeMonth(i),B(W(i),0)}(r,t):R(r)}function J(e,t){for(var a=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,o=n.utils.getDaysInMonth((t-1+12)%12,e),i=n.utils.getDaysInMonth(t,e),r=window.document.createDocumentFragment(),l=n.config.showMonths>1,c=l?"prevMonthDay hidden":"prevMonthDay",s=l?"nextMonthDay hidden":"nextMonthDay",d=o+1-a,u=0;d<=o;d++,u++)r.appendChild(L("flatpickr-day "+c,new Date(e,t-1,d),0,u));for(d=1;d<=i;d++,u++)r.appendChild(L("flatpickr-day",new Date(e,t,d),0,u));for(var f=i+1;f<=42-a&&(1===n.config.showMonths||u%7!=0);f++,u++)r.appendChild(L("flatpickr-day "+s,new Date(e,t+1,f%i),0,u));var m=v("div","dayContainer");return m.appendChild(r),m}function K(){if(void 0!==n.daysContainer){D(n.daysContainer),n.weekNumbers&&D(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<n.config.showMonths;t++){var a=new Date(n.currentYear,n.currentMonth,1);a.setMonth(n.currentMonth+t),e.appendChild(J(a.getFullYear(),a.getMonth()))}n.daysContainer.appendChild(e),n.days=n.daysContainer.firstChild,"range"===n.config.mode&&1===n.selectedDates.length&&oe()}}function U(){if(!(n.config.showMonths>1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&e<n.config.minDate.getMonth()||void 0!==n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()&&e>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var a=v("option","flatpickr-monthDropdown-month");a.value=new Date(n.currentYear,t).getMonth().toString(),a.textContent=M(t,n.config.shorthandCurrentMonth,n.l10n),a.tabIndex=-1,n.currentMonth===t&&(a.selected=!0),n.monthsDropdownContainer.appendChild(a)}}}function q(){var e,t=v("div","flatpickr-month"),a=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=v("span","cur-month"):(n.monthsDropdownContainer=v("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),k(n.monthsDropdownContainer,"change",function(e){var t=w(e),a=parseInt(t.value,10);n.changeMonth(a-n.currentMonth),ve("onMonthChange")}),U(),e=n.monthsDropdownContainer);var o=y("cur-year",{tabindex:"-1"}),i=o.getElementsByTagName("input")[0];i.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&i.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(i.setAttribute("max",n.config.maxDate.getFullYear().toString()),i.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var r=v("div","flatpickr-current-month");return r.appendChild(e),r.appendChild(o),a.appendChild(r),t.appendChild(a),{container:t,yearElement:i,monthElement:e}}function $(){D(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=q();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function V(){n.weekdayContainer?D(n.weekdayContainer):n.weekdayContainer=v("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=v("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return z(),n.weekdayContainer}function z(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=P(n.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=P(t.splice(e,t.length),t.splice(0,e)));for(var a=n.config.showMonths;a--;)n.weekdayContainer.children[a].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function G(e,t){void 0===t&&(t=!0);var a=t?e:e-n.currentMonth;a<0&&!0===n._hidePrevMonthArrow||a>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=a,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,ve("onYearChange"),U()),K(),ve("onMonthChange"),ye())}function Z(e){return n.calendarContainer.contains(e)}function Q(e){if(n.isOpen&&!n.config.inline){var t=w(e),a=Z(t),o=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||a||Z(e.relatedTarget)),i=!n.config.ignoredFocusElements.some(function(e){return e.contains(t)});o&&i&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&r(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function X(e){if(!(!e||n.config.minDate&&e<n.config.minDate.getFullYear()||n.config.maxDate&&e>n.config.maxDate.getFullYear())){var t=e,a=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),a&&(n.redraw(),ve("onYearChange"),U())}}function ee(e,t){var a;void 0===t&&(t=!0);var o=n.parseDate(e,void 0,t);if(n.config.minDate&&o&&S(o,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&o&&S(o,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===o)return!1;for(var i=!!n.config.enable,r=null!==(a=n.config.enable)&&void 0!==a?a:n.config.disable,l=0,c=void 0;l<r.length;l++){if("function"==typeof(c=r[l])&&c(o))return i;if(c instanceof Date&&void 0!==o&&c.getTime()===o.getTime())return i;if("string"==typeof c){var s=n.parseDate(c,void 0,!0);return s&&s.getTime()===o.getTime()?i:!i}if("object"==typeof c&&void 0!==o&&c.from&&c.to&&o.getTime()>=c.from.getTime()&&o.getTime()<=c.to.getTime())return i}return!i}function te(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function ne(e){var t=e.target===n._input,a=n._input.value.trimEnd()!==we();!t||!a||e.relatedTarget&&Z(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function ae(t){var o=w(t),i=n.config.wrap?e.contains(o):o===n._input,c=n.config.allowInput,s=n.isOpen&&(!c||!i),d=n.config.inline&&i&&!c;if(13===t.keyCode&&i){if(c)return n.setDate(n._input.value,!0,o===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),o.blur();n.open()}else if(Z(o)||s||d){var u=!!n.timeContainer&&n.timeContainer.contains(o);switch(t.keyCode){case 13:u?(t.preventDefault(),r(),ue()):fe(t);break;case 27:t.preventDefault(),ue();break;case 8:case 46:i&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(u||i)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var f=a();if(void 0!==n.daysContainer&&(!1===c||f&&te(f))){var m=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),G(m),B(W(1),0)):B(void 0,m)}}break;case 38:case 40:t.preventDefault();var g=40===t.keyCode?1:-1;n.daysContainer&&void 0!==o.$i||o===n.input||o===n.altInput?t.ctrlKey?(t.stopPropagation(),X(n.currentYear-g),B(W(1),0)):u||B(void 0,7*g):o===n.currentYearElement?X(n.currentYear-g):n.config.enableTime&&(!u&&n.hourElement&&n.hourElement.focus(),r(t),n._debouncedChange());break;case 9:if(u){var p=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(e){return e}),h=p.indexOf(o);if(-1!==h){var v=p[h+(t.shiftKey?-1:1)];t.preventDefault(),(v||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(o)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&o===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],l(),Ce();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],l(),Ce()}(i||Z(o))&&ve("onKeyDown",t)}function oe(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var a=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),o=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),i=Math.min(a,n.selectedDates[0].getTime()),r=Math.max(a,n.selectedDates[0].getTime()),l=!1,c=0,s=0,d=i;d<r;d+=864e5)ee(new Date(d),!0)||(l=l||d>i&&d<r,d<o&&(!c||d>c)?c=d:d>o&&(!s||d<s)&&(s=d));Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+t)).forEach(function(t){var i,r,d,u=t.dateObj.getTime(),f=c>0&&u<c||s>0&&u>s;if(f)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)});l&&!f||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==e&&(e.classList.add(a<=n.selectedDates[0].getTime()?"startRange":"endRange"),o<a&&u===o?t.classList.add("startRange"):o>a&&u===o&&t.classList.add("endRange"),u>=c&&(0===s||u<=s)&&(r=o,d=a,(i=u)>Math.min(r,d)&&i<Math.max(r,d))&&t.classList.add("inRange")))})}}function ie(){!n.isOpen||n.config.static||n.config.inline||se()}function re(e){return function(t){var a=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),o=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==a&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=a.getHours()>0||a.getMinutes()>0||a.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(e){return ee(e)}),n.selectedDates.length||"min"!==e||d(a),Ce()),n.daysContainer&&(de(),void 0!==a?n.currentYearElement[e]=a.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!o&&void 0!==a&&o.getFullYear()===a.getFullYear())}}function le(){return n.config.wrap?e.querySelector("[data-input]"):e}function ce(){"object"!=typeof n.config.locale&&void 0===j.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=F(F({},j.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?j.l10ns[n.config.locale]:void 0),E.D="("+n.l10n.weekdays.shorthand.join("|")+")",E.l="("+n.l10n.weekdays.longhand.join("|")+")",E.M="("+n.l10n.months.shorthand.join("|")+")",E.F="("+n.l10n.months.longhand.join("|")+")",E.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===F(F({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===j.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=T(n),n.parseDate=_({config:n.config,l10n:n.l10n})}function se(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){ve("onPreCalendarPosition");var t=e||n._positionElement,a=Array.prototype.reduce.call(n.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),o=n.calendarContainer.offsetWidth,i=n.config.position.split(" "),r=i[0],l=i.length>1?i[1]:null,c=t.getBoundingClientRect(),s=window.innerHeight-c.bottom,d="above"===r||"below"!==r&&s<a&&c.top>a,u=window.pageYOffset+c.top+(d?-a-2:t.offsetHeight+2);if(h(n.calendarContainer,"arrowTop",!d),h(n.calendarContainer,"arrowBottom",d),!n.config.inline){var f=window.pageXOffset+c.left,m=!1,g=!1;"center"===l?(f-=(o-c.width)/2,m=!0):"right"===l&&(f-=o-c.width,g=!0),h(n.calendarContainer,"arrowLeft",!m&&!g),h(n.calendarContainer,"arrowCenter",m),h(n.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+c.right),v=f+o>window.document.body.offsetWidth,D=p+o>window.document.body.offsetWidth;if(h(n.calendarContainer,"rightMost",v),!n.config.static)if(n.calendarContainer.style.top=u+"px",v)if(D){var b=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];if(n.cssRules){try{n.cssRules}catch(e){continue}e=n;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===b)return;var y=window.document.body.offsetWidth,w=Math.max(0,y/2-o/2),C=b.cssRules.length,M="{left:"+c.left+"px;right:auto;}";h(n.calendarContainer,"rightMost",!1),h(n.calendarContainer,"centerMost",!0),b.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+M,C),n.calendarContainer.style.left=w+"px",n.calendarContainer.style.right="auto"}else n.calendarContainer.style.left="auto",n.calendarContainer.style.right=p+"px";else n.calendarContainer.style.left=f+"px",n.calendarContainer.style.right="auto"}}}else n.config.position(n,e)}function de(){n.config.noCalendar||n.isMobile||(U(),ye(),K())}function ue(){n._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(n.close,0):n.close()}function fe(e){e.preventDefault(),e.stopPropagation();var t=b(w(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var a=t,o=n.latestSelectedDateObj=new Date(a.dateObj.getTime()),i=(o.getMonth()<n.currentMonth||o.getMonth()>n.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=a,"single"===n.config.mode)n.selectedDates=[o];else if("multiple"===n.config.mode){var r=be(o);r?n.selectedDates.splice(parseInt(r),1):n.selectedDates.push(o)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=o,n.selectedDates.push(o),0!==S(o,n.selectedDates[0],!0)&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(l(),i){var c=n.currentYear!==o.getFullYear();n.currentYear=o.getFullYear(),n.currentMonth=o.getMonth(),c&&(ve("onYearChange"),U()),ve("onMonthChange")}if(ye(),K(),Ce(),i||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():R(a),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var s="single"===n.config.mode&&!n.config.enableTime,d="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(s||d)&&ue()}A()}}n.parseDate=_({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=k,n._setHoursFromDate=d,n._positionCalendar=se,n.changeMonth=G,n.changeYear=X,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var a=I(n.config);C(a.hours,a.minutes,a.seconds)}n.redraw(),e&&ve("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),ve("onClose")},n.onMouseOver=oe,n._createElement=v,n.createDay=L,n.destroy=function(){void 0!==n.config&&ve("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.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 n[e]}catch(e){}})},n.isEnabled=ee,n.jumpToDate=N,n.updateValue=Ce,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var a=w(e);a&&a.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void ve("onOpen")}if(!n._input.disabled&&!n.config.inline){var o=n.isOpen;n.isOpen=!0,o||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),ve("onOpen"),se(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return n.hourElement.select()},50))}},n.redraw=de,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var a in Object.assign(n.config,e),e)void 0!==me[a]&&me[a].forEach(function(e){return e()});else n.config[e]=t,void 0!==me[e]?me[e].forEach(function(e){return e()}):c.indexOf(e)>-1&&(n.config[e]=p(t));n.redraw(),Ce(!0)},n.setDate=function(e,t,a){if(void 0===t&&(t=!1),void 0===a&&(a=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);ge(e,a),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),N(void 0,t),d(),0===n.selectedDates.length&&n.clear(!1),Ce(t),t&&ve("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var me={locale:[ce,z],showMonths:[$,i,V],minDate:[N],maxDate:[N],positionElement:[he],clickOpens:[function(){!0===n.config.clickOpens?(k(n._input,"focus",n.open),k(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function ge(e,t){var a=[];if(e instanceof Array)a=e.map(function(e){return n.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)a=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":a=[n.parseDate(e,t)];break;case"multiple":a=e.split(n.config.conjunction).map(function(e){return n.parseDate(e,t)});break;case"range":a=e.split(n.l10n.rangeSeparator).map(function(e){return n.parseDate(e,t)})}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?a:a.filter(function(e){return e instanceof Date&&ee(e,!1)}),"range"===n.config.mode&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function pe(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function he(){n._positionElement=n.config.positionElement||n._input}function ve(e,t){if(void 0!==n.config){var a=n.config[e];if(void 0!==a&&a.length>0)for(var o=0;a[o]&&o<a.length;o++)a[o](n.selectedDates,n.input.value,n,t);"onChange"===e&&(n.input.dispatchEvent(De("change")),n.input.dispatchEvent(De("input")))}}function De(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function be(e){for(var t=0;t<n.selectedDates.length;t++){var a=n.selectedDates[t];if(a instanceof Date&&0===S(a,e))return""+t}return!1}function ye(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(e,t){var a=new Date(n.currentYear,n.currentMonth,1);a.setMonth(n.currentMonth+t),n.config.showMonths>1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=M(a.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=a.getMonth().toString(),e.value=a.getFullYear().toString()}),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=void 0!==n.config.maxDate&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function we(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(e){return n.formatDate(e,t)}).filter(function(e,t,a){return"range"!==n.config.mode||n.config.enableTime||a.indexOf(e)===t}).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function Ce(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=we(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=we(n.config.altFormat)),!1!==e&&ve("onValueUpdate")}function Me(e){var t=w(e),a=n.prevMonthNav.contains(t),o=n.nextMonthNav.contains(t);a||o?G(a?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=F(F({},JSON.parse(JSON.stringify(e.dataset||{}))),t),r={};n.config.parseDate=i.parseDate,n.config.formatDate=i.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=pe(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=pe(e)}});var l="time"===i.mode;if(!i.dateFormat&&(i.enableTime||l)){var d=j.defaultConfig.dateFormat||s.dateFormat;r.dateFormat=i.noCalendar||l?"H:i"+(i.enableSeconds?":S":""):d+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||l)&&!i.altFormat){var u=j.defaultConfig.altFormat||s.altFormat;r.altFormat=i.noCalendar||l?"h:i"+(i.enableSeconds?":S K":" K"):u+" h:i"+(i.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:re("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:re("max")});var f=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:f("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:f("max")}),"time"===i.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,r,i);for(var m=0;m<a.length;m++)n.config[a[m]]=!0===n.config[a[m]]||"true"===n.config[a[m]];for(c.filter(function(e){return void 0!==n.config[e]}).forEach(function(e){n.config[e]=p(n.config[e]||[]).map(o)}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&"single"===n.config.mode&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),m=0;m<n.config.plugins.length;m++){var g=n.config.plugins[m](n)||{};for(var h in g)c.indexOf(h)>-1?n.config[h]=p(g[h]).map(o).concat(n.config[h]):void 0===i[h]&&(n.config[h]=g[h])}i.altInputClass||(n.config.altInputClass=le().className+" "+n.config.altInputClass),ve("onParseConfig")}(),ce(),n.input=le(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=v(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),he()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&ge(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=v("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=v("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=v("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=v("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,$(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(h(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(h(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],ye(),n.monthNav)),n.innerContainer=v("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=v("div","flatpickr-weekwrapper");e.appendChild(v("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=v("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),a=t.weekWrapper,o=t.weekNumbers;n.innerContainer.appendChild(a),n.weekNumbers=o,n.weekWrapper=a}n.rContainer=v("div","flatpickr-rContainer"),n.rContainer.appendChild(V()),n.daysContainer||(n.daysContainer=v("div","flatpickr-days"),n.daysContainer.tabIndex=-1),K(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=I(n.config);n.timeContainer=v("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=v("span","flatpickr-time-separator",":"),a=y("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=a.getElementsByTagName("input")[0];var o=y("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=o.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=f(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=f(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(a),n.timeContainer.appendChild(t),n.timeContainer.appendChild(o),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var i=y("flatpickr-second");n.secondElement=i.getElementsByTagName("input")[0],n.secondElement.value=f(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(v("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(i)}return n.config.time_24hr||(n.amPM=v("span","flatpickr-am-pm",n.l10n.amPM[m((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),h(n.calendarContainer,"rangeMode","range"===n.config.mode),h(n.calendarContainer,"animate",!0===n.config.animate),h(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var i=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!i&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var r=v("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(r,n.element),r.appendChild(n.element),n.altInput&&r.appendChild(n.altInput),r.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),function(t){return k(t,"click",n[e])})}),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=v("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}k(n.mobileInput,"change",function(e){n.setDate(w(e).value,!1,n.mobileFormatStr),ve("onChange"),ve("onClose")})}();else{var e=g(ie,50);if(n._debouncedChange=g(A,300),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&k(n.daysContainer,"mouseover",function(e){"range"===n.config.mode&&oe(w(e))}),k(n._input,"keydown",ae),void 0!==n.calendarContainer&&k(n.calendarContainer,"keydown",ae),n.config.inline||n.config.static||k(window,"resize",e),void 0!==window.ontouchstart?k(window.document,"touchstart",Q):k(window.document,"mousedown",Q),k(window.document,"focus",Q,{capture:!0}),!0===n.config.clickOpens&&(k(n._input,"focus",n.open),k(n._input,"click",n.open)),void 0!==n.daysContainer&&(k(n.monthNav,"click",Me),k(n.monthNav,["keyup","increment"],x),k(n.daysContainer,"click",fe)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){k(n.timeContainer,["increment"],r),k(n.timeContainer,"blur",r,{capture:!0}),k(n.timeContainer,"click",Y),k([n.hourElement,n.minuteElement],["focus","click"],function(e){return w(e).select()}),void 0!==n.secondElement&&k(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),void 0!==n.amPM&&k(n.amPM,"click",function(e){r(e)})}n.config.allowInput&&k(n._input,"blur",ne)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&d(n.config.noCalendar?n.latestSelectedDateObj:void 0),Ce(!1)),i();var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&a&&se(),ve("onReady")}(),n}function N(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],o=0;o<n.length;o++){var i=n[o];try{if(null!==i.getAttribute("data-fp-omit"))continue;void 0!==i._flatpickr&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=A(i,t||{}),a.push(i._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 N(this,e)},HTMLElement.prototype.flatpickr=function(e){return N([this],e)});var j=function(e,t){return"string"==typeof e?N(window.document.querySelectorAll(e),t):e instanceof Node?N([e],t):N(e,t)};j.defaultConfig={},j.l10ns={en:F({},u),default:F({},u)},j.localize=function(e){j.l10ns.default=F(F({},j.l10ns.default),e)},j.setDefaults=function(e){j.defaultConfig=F(F({},j.defaultConfig),e)},j.parseDate=_({}),j.formatDate=T({}),j.compareDates=S,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return N(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=j);const Y=j;function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}var L=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,o=arguments,a=i(a=t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,H()?Reflect.construct(a,o||[],i(e).constructor):a.apply(e,o));var e,a,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}(t,e),a=t,(c=[{key:"init",value:function(){var e=this;this._elements.map(function(t){e._dateItems(t)})}},{key:"_dateItems",value:function(e){var t=this;(0,l.u)(e).find(".gutenverse-input").map(function(e){t.__createDate(e)})}},{key:"__createDate",value:function(e){var t=JSON.parse((0,l.u)(e).data("date"));t.disableMobile="true",Y(e,t)}}])&&o(a.prototype,c),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,c}(l.Default),R=(0,l.u)(".guten-form-input-date");R&&new L(R)})();