var TheDatepicker;(h=>{(t=n=h.ClassNameType||(h.ClassNameType={}))[t.Container=0]="Container",t[t.ContainerOver=1]="ContainerOver",t[t.ContainerLeft=2]="ContainerLeft",t[t.ContainerResponsive=3]="ContainerResponsive",t[t.Main=4]="Main",t[t.Body=5]="Body",t[t.BodySwipeable=6]="BodySwipeable",t[t.Tables=7]="Tables",t[t.Header=8]="Header",t[t.HeaderTop=9]="HeaderTop",t[t.HeaderControl=10]="HeaderControl",t[t.HeaderNavigation=11]="HeaderNavigation",t[t.HeaderState=12]="HeaderState",t[t.HeaderMonth=13]="HeaderMonth",t[t.HeaderYear=14]="HeaderYear",t[t.HeaderMonthYear=15]="HeaderMonthYear",t[t.HeaderYearsToggle=16]="HeaderYearsToggle",t[t.Button=17]="Button",t[t.ButtonContent=18]="ButtonContent",t[t.SelectInput=19]="SelectInput",t[t.Deselect=20]="Deselect",t[t.DeselectButton=21]="DeselectButton",t[t.HeaderTitle=22]="HeaderTitle",t[t.HeaderTitleContent=23]="HeaderTitleContent",t[t.Reset=24]="Reset",t[t.Close=25]="Close",t[t.Go=26]="Go",t[t.GoNext=27]="GoNext",t[t.GoPrevious=28]="GoPrevious",t[t.Table=29]="Table",t[t.TableRow=30]="TableRow",t[t.TableCell=31]="TableCell",t[t.TableCellUnavailable=32]="TableCellUnavailable",t[t.TableCellHighlighted=33]="TableCellHighlighted",t[t.TableCellSelected=34]="TableCellSelected",t[t.CalendarTable=35]="CalendarTable",t[t.CalendarTableHeader=36]="CalendarTableHeader",t[t.CalendarTableHeaderCell=37]="CalendarTableHeaderCell",t[t.CalendarTableBody=38]="CalendarTableBody",t[t.YearsTable=39]="YearsTable",t[t.YearsTableBody=40]="YearsTableBody",t[t.WeekDayWeekend=41]="WeekDayWeekend",t[t.Day=42]="Day",t[t.DayToday=43]="DayToday",t[t.DayPast=44]="DayPast",t[t.DayWeekend=45]="DayWeekend",t[t.DayUnavailable=46]="DayUnavailable",t[t.DayOutside=47]="DayOutside",t[t.DayHighlighted=48]="DayHighlighted",t[t.DaySelected=49]="DaySelected",t[t.DayButton=50]="DayButton",t[t.DayButtonContent=51]="DayButtonContent",t[t.YearCellButton=52]="YearCellButton",t[t.YearCellButtonContent=53]="YearCellButtonContent",t[t.Animated=54]="Animated",t[t.AnimateFadeOutLeft=55]="AnimateFadeOutLeft",t[t.AnimateFadeInRight=56]="AnimateFadeInRight",t[t.AnimateFadeOutUp=57]="AnimateFadeOutUp",t[t.AnimateFadeInDown=58]="AnimateFadeInDown",t[t.AnimateFadeOutRight=59]="AnimateFadeOutRight",t[t.AnimateFadeInLeft=60]="AnimateFadeInLeft",t[t.AnimateFadeOutDown=61]="AnimateFadeOutDown",t[t.AnimateFadeInUp=62]="AnimateFadeInUp",t[t.ContainerDarkMode=63]="ContainerDarkMode",t[t.MainDarkMode=64]="MainDarkMode",s.prototype.clone=function(){for(var t=new s,i=0;i<this.t.length;i++)t.t=this.t.slice(0);return t},s.prototype.setClassName=function(t,i){t===n.ContainerDarkMode&&(h.h.i("ClassNameType.ContainerDarkMode",["ClassNameType.MainDarkMode"]),this.setClassName(n.MainDarkMode,i)),this.t[this.u(t)]=this.o(i)},s.prototype.addClassName=function(t,i){this.t[this.u(t)].concat(this.o(i))},s.prototype.getClassName=function(t){return this.t[t].slice(0)},s.prototype.u=function(t){return h.h.l("Class name type",t,0,this.t.length-1)},s.prototype.o=function(t){for(var i="Class name",n=("object"==typeof t&&t.constructor===Array||(t=h.h.v(i,t).split(/\s+/)),[]),s=0;s<t.length;s++){var e=h.h.v(i,t[s]);e&&n.push(e)}return n};var n,t=s;function s(){this.t=[["container"],["container--over"],["container--left"],["container--responsive"],["main"],["body"],["body--swipeable"],["tables"],["header"],["top"],["control"],["navigation"],["state"],["month"],["year"],["month-year"],["year-button"],["button"],["button-content"],["select"],["deselect"],["deselect-button"],["title"],["title-content"],["reset"],["close"],["go"],["go-next"],["go-previous"],["table"],["row"],["cell"],["cell--unavailable"],["cell--highlighted"],["cell--selected"],["calendar"],["calendar-header"],["week-day"],["calendar-body"],["years"],["years-body"],["week-day--weekend"],["day"],["day--today"],["day--past"],["day--weekend"],["day--unavailable"],["day--outside"],["day--highlighted"],["day--selected"],["day--button"],["day-content"],["year-cell-button"],["year-cell-content"],["animated"],["fade-out-left"],["fade-in-right"],["fade-out-up"],["fade-in-down"],["fade-out-right"],["fade-in-left"],["fade-out-down"],["fade-in-up"],["container--darkmode"],["main--darkmode"]]}h.ClassNames=t})(TheDatepicker=TheDatepicker||{}),(t=>{var a=function(){},f=(t.CannotParseDateException=a,i.prototype.createDate=function(){if(null===this.day||null===this.month||null===this.year)throw new a;var t=new Date(this.year,this.month-1,this.day);if(isNaN(t.getTime()))throw new a;for(;t.getDate()!==this.day||t.getMonth()!==this.month-1||t.getFullYear()!==this.year;){if(!(28<this.day))throw new a;this.day--,t=new Date(this.year,this.month-1,this.day)}return t},i);function i(){this.day=null,this.month=null,this.year=null}function c(){}c.p=function(t,i,n){if(!t)return null;n=(n=void 0===n?null:n)||i.getInputFormat();for(var s=!1,e="",h=0;h<n.length;h++){var r,u=n.substring(h,h+1);s?(e+=u,s=!1):u===c.m?s=!0:e+=(r=c.D(u))?r.call(null,t,i):u}return e},c.k=function(i,t){if(""===(i.trim?i.trim():i))return null;for(var n=t.getInputFormat(),s=new f,e=!1,h=0,r=0;r<n.length;r++){var u=n.substring(r,r+1);if(e)e=!1;else{if(u===c.m){e=!0;continue}var o=c.T(u);if(o){try{h+=o.call(null,i.substring(h),s,t)}catch(t){if(!(t instanceof a))throw t;if(" "!==i.substring(h,h+1))throw t;h++,r--;continue}continue}}o=i.substring(h,h+1);if(o!==u){if(" "!==u){if(" "!==o)throw new a;h++,r--}}else h++}return s.createDate()},c.g=function(t,i){if(""===t||/[0-9-]/.test(t))return!0;for(var n=i.getInputFormat(),s=!1,e=0;e<n.length;e++){var h=n.substring(e,e+1);if(s)s=!1;else{if(h===c.m){s=!0;continue}var r=c.C(h,i);if(r){for(var u=t.toLowerCase(),o=0;o<r.length;o++)if(-1<r[o].toLowerCase().indexOf(u))return!0;continue}}if(t===h)return!0}return!1},c.D=function(t){switch(t){case"j":return c.M;case"d":return c.A;case"D":return c.O;case"l":return c.R;case"n":return c.I;case"m":return c.S;case"F":return c.H;case"M":return c.B;case"Y":return c.F;case"y":return c.L;default:return null}},c.M=function(t){return t.getDate()+""},c.A=function(t){return("0"+t.getDate()).slice(-2)},c.O=function(t,i){return i.translator.translateDayOfWeek(t.getDay())},c.R=function(t,i){return i.translator.translateDayOfWeekFull(t.getDay())},c.I=function(t){return t.getMonth()+1+""},c.S=function(t){return("0"+(t.getMonth()+1)).slice(-2)},c.H=function(t,i){return i.translator.translateMonth(t.getMonth())},c.B=function(t,i){return i.translator.translateMonthShort(t.getMonth())},c.F=function(t){return t.getFullYear()+""},c.L=function(t){t=t.getFullYear()+"";return t.substring(t.length-2)},c.T=function(t){switch(t){case"j":case"d":return c.N;case"D":return c.j;case"l":return c.Y;case"n":case"m":return c.J;case"F":return c.G;case"M":return c.P;case"Y":return c.U;case"y":return c.W;default:return null}},c.N=function(t,i){for(var n=0;"0"===t.substring(0,1);)t=t.substring(1),n++;var s=t.substring(0,2);if(/[12][0-9]|3[01]/.test(s)||(s=s.substring(0,1),/[1-9]/.test(s)))return i.day=parseInt(s,10),n+s.length;throw new a},c.j=function(t,i,n){return c._(t,function(t){return n.translator.translateDayOfWeek(t)})},c.Y=function(t,i,n){return c._(t,function(t){return n.translator.translateDayOfWeekFull(t)})},c._=function(t,i){for(var n=0,s=0,e=0;e<7;e++){var h=i(e),n=Math.max(n,h.length);t.substring(0,h.length).toLowerCase()===h.toLowerCase()&&h.length>s&&(s=h.length)}if(0<s)return s;for(var r=0;/[a-zA-Z]/.test(t.substring(0,1))&&(t=t.substring(1),++r!==n););return r},c.J=function(t,i){for(var n=0;"0"===t.substring(0,1);)t=t.substring(1),n++;var s=t.substring(0,2);if("10"===s||"11"===s||"12"===s||(s=s.substring(0,1),/[1-9]/.test(s)))return i.month=parseInt(s,10),n+s.length;throw new a},c.G=function(t,i,n){return c.Z(t,i,function(t){return n.translator.translateMonth(t)})},c.P=function(t,i,n){return c.Z(t,i,function(t){return n.translator.translateMonthShort(t)})},c.Z=function(t,i,n){for(var s=null,e=0,h=1;h<=12;h++){var r=n(h-1);t.substring(0,r.length).toLowerCase()===r.toLowerCase()&&r.length>e&&(s=h,e=r.length)}if(null===s)throw new a;return i.month=s,e},c.U=function(t,i,n){for(var s=!1,e=("-"===t.substring(0,1)&&(s=!0,t=t.substring(1)),n.q()),n=n.K(),h=0<n.getFullYear()?(n.getFullYear()+"").length:0,r=e.getFullYear()<0?(-e.getFullYear()+"").length:0,u=0;/[0-9]/.test(t.substring(u,u+1))&&!(s&&r<u+1||!s&&h<u+1);)u++;if(0===u)throw new a;n=parseInt(t.substring(0,u),10);return i.year=n=s?-n:n,u+(s?1:0)},c.W=function(t,i,n){t=t.substring(0,2);if(/[0-9]{2}/.test(t))return n=(n=n.getToday().getFullYear()+"").substring(0,n.length-2),i.year=parseInt(n+t,10),2;throw new a},c.C=function(t,i){switch(t){case"j":case"d":case"n":case"m":case"Y":case"y":return[];case"D":return i.translator.V;case"l":return i.translator.X;case"F":return i.translator.$;case"M":return i.translator.tt;default:return null}},c.m="\\",t.it=c})(TheDatepicker=TheDatepicker||{}),(d=>{(t=s=s||{})[t.Untouched=0]="Untouched",t[t.Waiting=1]="Waiting",t[t.Ready=2]="Ready",t[t.Initialized=3]="Initialized",t[t.Destroyed=4]="Destroyed",v.prototype.render=function(){var i=this;switch(this.nt){case s.Ready:return this.st(),this.nt=s.Initialized,void this.render();case s.Waiting:return(this.et(),this.options.isHiddenOnBlur())?void(this.rt.ht()||this.ut()):void this.open();case s.Untouched:return(this.ot(),this.et(),this.rt.ft(null)||this.ut(),this.ct&&this.options.isHiddenOnBlur())?this.ct===v.lt.activeElement?(this.nt=s.Ready,this.render(),void this.open()):(this.dt=d.h.vt(this.ct,d.wt.Focus,function(t){i.open(t)}),void(this.nt=s.Waiting)):(this.nt=s.Ready,void this.render());default:return void this.rt.yt()}},v.prototype.open=function(t){return void 0===t&&(t=null),this.nt===s.Untouched&&this.render(),this.nt===s.Waiting&&(this.nt=s.Ready,this.render(),v.bt=!0),!!v.Dt(t,this)&&(this.ct&&this.ct.focus(),!0)},v.prototype.isOpened=function(){return this.rt.kt()},v.prototype.close=function(t){if(void 0===t&&(t=null),this.rt.kt()){if(!v.Dt(t,null))return!1;this.ct&&this.ct.blur()}return!0},v.prototype.reset=function(t){return this.rt.Tt(t=void 0===t?null:t)},v.prototype.destroy=function(){if(this.nt!==s.Destroyed){for(var t=0;t<this.gt.length;t++)this.gt[t]();this.gt=[],this.Ct?this.container.innerHTML="":this.container.parentNode.removeChild(this.container),delete this.container.datepicker,this.input&&(this.Mt&&(this.Mt.autocomplete="",this.Mt.readOnly=!1),delete this.input.datepicker,this.At(),this.input=null),this.Ot&&(this.Ot.parentNode.removeChild(this.Ot),this.Ot=null),this.nt=s.Destroyed}},v.prototype.isDestroyed=function(){return this.nt===s.Destroyed},v.prototype.selectDate=function(t,i,n){return void 0===i&&(i=!0),this.rt.Rt(n=void 0===n?null:n,d.h.Et("Date",t,!0,this.options),!!i)},v.prototype.getSelectedDate=function(){return this.rt.It?new Date(this.rt.It.getTime()):null},v.prototype.getSelectedDateFormatted=function(t){return d.it.p(this.rt.It,this.options,d.h.v("Format",t=void 0===t?null:t))},v.prototype.getCurrentMonth=function(){return new Date(this.rt.St().getTime())},v.prototype.goToMonth=function(t,i){return this.rt.Ht(i=void 0===i?null:i,d.h.Et("Month",t,!1,this.options))},v.prototype.parseRawInput=function(){return this.Mt?d.it.k(this.Mt.value,this.options):null},v.prototype.getHtmlInput=function(){return this.ct},v.prototype.getDay=function(t){return this.rt.Bt(d.h.Et("Date",t,!1,this.options))},v.prototype.Ft=function(t){return!(this.Mt&&!this.options.isAllowedInputAnyChar())||d.it.g(t,this.options)},v.prototype.xt=function(t){if(void 0===t&&(t=null),this.Mt)try{var i=this.parseRawInput();if(i?this.rt.Lt(t,i):this.rt.Nt(t))return this.jt(),!0}catch(t){if(!(t instanceof d.CannotParseDateException))throw t}return!1},v.prototype.ut=function(){this.Mt&&this.Mt!==v.lt.activeElement&&(this.Mt.value=d.it.p(this.rt.It,this.options)||"",this.jt())},v.onDatepickerReady=function(t,i){if(void 0===i&&(i=null),!d.h.Yt(t))throw new Error("Element was expected to be an HTMLElement.");i=d.h.Jt("Callback",i);var n=null,s=null;return"undefined"!=typeof Promise&&(n=new Promise(function(t){s=t})),t.datepicker&&t.datepicker instanceof v?(t.datepicker.Gt(i,t),s&&s(t.datepicker)):v.Pt.push({promiseResolve:s,element:t,callback:i}),n},v.prototype.Ut=function(){return d.zt.Wt(d.ClassNameType.Container,this.options)},v.prototype.et=function(){var i=this;if(!this.Mt||!this.options.isDeselectButtonShown()||this.Ot)return null;var n=d.zt._t(function(t){n.focus(),i.rt.Nt(t)},this.options,d.ClassNameType.DeselectButton),t=(n.innerHTML=this.options.getDeselectHtml(),this.options.translator.translateTitle(d.TitleName.Deselect)),t=(""!==t&&(n.title=t),d.zt.Zt());d.zt.qt(t,d.ClassNameType.Deselect,this.options),t.appendChild(n),this.Mt.parentNode.insertBefore(t,this.Mt.nextSibling),this.Ot=t,this.Kt=n},v.prototype.jt=function(){var t;this.Ot&&(t=this.options.isDeselectButtonShown()&&this.rt.It,this.Ot.style.visibility=t?"visible":"hidden")},v.prototype.ot=function(){if(this.Mt)try{var t=this.parseRawInput();t&&this.options.setInitialDate(t)}catch(t){if(!(t instanceof d.CannotParseDateException))throw t}},v.prototype.st=function(){var t,n=this,i=(v.Qt||(d.h.vt(v.lt,d.wt.MouseDown,t=function(t){v.bt?v.bt=!1:v.Dt(t,null)}),d.h.vt(v.lt,d.wt.FocusIn,t),d.h.vt(v.lt,d.wt.KeyDown,function(t){v.Vt&&v.Vt.Xt(t)}),v.Qt=!0),this.At(),function(t){v.Dt(t,n),v.bt=!0});this.gt.push(d.h.vt(this.container,d.wt.MouseDown,i)),this.gt.push(d.h.vt(this.container,d.wt.FocusIn,i)),this.Kt&&(this.gt.push(d.h.vt(this.Kt,d.wt.MouseDown,t=function(t){n.rt.kt()&&i(t)})),this.gt.push(d.h.vt(this.Kt,d.wt.Focus,t))),this.ct&&(this.gt.push(d.h.vt(this.ct,d.wt.MouseDown,i)),this.gt.push(d.h.vt(this.ct,d.wt.Focus,i)),this.gt.push(d.h.vt(this.ct,d.wt.Blur,function(){n.ut()}))),this.Mt&&(this.gt.push(d.h.vt(this.Mt,d.wt.KeyDown,function(t){d.h.$t(t),t.keyCode===d.ti.Esc&&n.options.isClosedOnEscPress()&&n.close(t)})),this.gt.push(d.h.vt(this.Mt,d.wt.KeyUp,function(t){n.xt(t)})),this.gt.push(d.h.vt(this.Mt,d.wt.KeyPress,function(t){var i=t.charCode||t.keyCode;i&&!n.Ft(String.fromCharCode(i))&&d.h.ii(t)})))},v.prototype.At=function(){this.dt&&(this.dt(),this.dt=null)},v.prototype.ni=function(t){for(var i=v.Pt.length-1;0<=i;i--){var n=v.Pt[i];n.element===t&&(this.Gt(n.callback,t),n.promiseResolve&&n.promiseResolve(this),v.Pt.splice(i,1))}},v.prototype.Gt=function(t,i){t&&t.call(i,this,i)},v.prototype.si=function(){this.nt!==s.Destroyed&&(this.ei(),this.Mt)&&(this.Mt.readOnly=!this.options.isKeyboardOnMobile()&&d.h.hi())},v.prototype.ei=function(){var t,i,n,s,e,h,r,u,o,a,f,c,l;this.Ct||(this.container.className="",d.zt.qt(this.container,d.ClassNameType.Container,this.options),this.options.isDarkModeEnabled()&&d.zt.qt(this.container,d.ClassNameType.ContainerDarkMode,this.options),this.options.isFullScreenOnMobile()&&d.zt.qt(this.container,d.ClassNameType.ContainerResponsive,this.options),0!==this.container.childNodes.length&&(c=(l=this.options.getPosition())===d.Position.TopRight||l===d.Position.TopLeft,l=l===d.Position.BottomLeft||l===d.Position.TopLeft,(t=this.container.childNodes[0]).style.position="",t.style.top="",t.style.left="",i=this.input.offsetWidth,n=this.input.offsetHeight,s=this.container.offsetWidth,e=this.container.offsetHeight,this.options.isPositionFixingEnabled()&&(a=v.lt,u=window.scrollY||window.pageYOffset||a.documentElement.scrollTop||a.body.scrollTop||0,f=window.scrollX||window.pageXOffset||a.documentElement.scrollLeft||a.body.scrollLeft||0,h="CSS1Compat"===a.compatMode,o=u+(window.innerHeight||(h?a.documentElement:a.body).clientHeight||0),h=f+(window.innerWidth||(h?a.documentElement:a.body).clientWidth||0),u=e<(r=(a=this.input.getBoundingClientRect()).top+u)-u,o=e<o-(r+n),a=s-i<(r=a.left+f)-f,f=s-i<h-(r+i),c=c&&(u||!o)||u&&!o,l=l&&(a||!f)||a&&!f),t.style.position=c||l?"absolute":"",c&&(d.zt.qt(this.container,d.ClassNameType.ContainerOver,this.options),t.style.top="-"+(n+e)+"px"),l)&&(d.zt.qt(this.container,d.ClassNameType.ContainerLeft,this.options),t.style.left="-"+(s-i)+"px"))},v.ri=function(t){var i="the-datepicker-page",n=v.lt.body,s=n.className,e=-1<s.indexOf(i);!e&&t?n.className+=(0<s.length?" ":"")+i:e&&!t&&(-1<s.indexOf(" "+(e=i))?e=" "+i:-1<s.indexOf(i+" ")&&(e=i+" "),n.className=s.replace(e,""))},v.Dt=function(t,i){var n=i?i.rt:null,s=v.Vt;if(s!==n){if(s&&!s.ui(t,!1))return!1;if(v.Vt===s){if(!n)return v.ri(!1),!(v.Vt=null);if(!n.ui(t,!0))return!1;v.Vt===s&&(i.si(),v.ri(!i.Ct&&i.options.isFullScreenOnMobile()),v.Vt=n)}}return!0},v.Pt=[],v.Qt=!1,v.Vt=null,v.bt=!1;var s,t=v;function v(t,i,n){if(void 0===i&&(i=null),void 0===n&&(n=null),this.ct=null,this.Mt=null,this.nt=s.Untouched,this.dt=null,this.gt=[],this.Ot=null,this.Kt=null,!(this instanceof v))throw new Error('Creation must be performed by "new" keyword.');if(t&&!d.h.Yt(t))throw new Error("Input was expected to be null or an HTMLElement.");if(i&&!d.h.Yt(i))throw new Error("Container was expected to be null or an HTMLElement.");if(!t&&!i)throw new Error("At least one of input or container is mandatory.");if(n&&!(n instanceof d.Options))throw new Error("Options was expected to be an instance of Options");v.lt=document,this.options=n?n.clone():new d.Options;n="There is already a datepicker present on ";if(this.Ct=!!i,i){if(i.datepicker)throw new Error(n+"container.")}else i=this.Ut(),t&&t.parentNode.insertBefore(i,t.nextSibling);if(i.setAttribute("data-credits","TheDatepicker - Pure JavaScript Datepicker by Slevomat.cz"),i.setAttribute("data-url","https://thedatepicker.github.io/thedatepicker/"),t){if(t.datepicker)throw new Error(n+"input.");t.datepicker=this,t&&"undefined"!=typeof HTMLInputElement&&t instanceof HTMLInputElement&&"text"===(this.ct=t).type&&((this.Mt=t).autocomplete="off")}(i.datepicker=this).input=t,this.container=i,this.rt=new d.oi(this.options,this),this.ni(t),this.ni(i)}d.Datepicker=t,d.onDatepickerReady=t.onDatepickerReady})(TheDatepicker=TheDatepicker||{}),(s=>{function i(t,i,n){this.isToday=!1,this.isPast=!1,this.isAvailable=!0,this.isInValidity=!0,this.isVisible=!1,this.isInCurrentMonth=!1,this.isSelected=!1,this.isHighlighted=!1,this.isFocused=!1,this.dayNumber=t.getDate(),this.month=t.getMonth()+1,this.year=t.getFullYear(),this.dayOfWeek=t.getDay(),this.isWeekend=this.dayOfWeek===s.DayOfWeek.Saturday||this.dayOfWeek===s.DayOfWeek.Sunday,this.Bt=i,this.p=n}i.prototype.getDate=function(){return new Date(this.year,this.month-1,this.dayNumber,0,0,0,0)},i.prototype.getFormatted=function(){return this.year+"-"+("0"+this.month).slice(-2)+"-"+("0"+this.dayNumber).slice(-2)},i.prototype.getInputFormatted=function(t){return void 0===t&&(t=null),this.p(this.getDate(),s.h.v("Format",t))},i.prototype.isEqualToDate=function(t){return s.h.ai(t)&&this.dayNumber===t.getDate()&&this.month===t.getMonth()+1&&this.year===t.getFullYear()},i.prototype.isEqualToDay=function(t){return t instanceof i&&this.dayNumber===t.dayNumber&&this.month===t.month&&this.year===t.year},i.prototype.getSibling=function(t){void 0===t&&(t=1);var i=this.getDate();return i.setDate(i.getDate()+s.h.l("Shift",t)),this.Bt(i)},s.Day=i})(TheDatepicker=TheDatepicker||{}),(d=>{(i=d.DayOfWeek||(d.DayOfWeek={}))[i.Monday=1]="Monday",i[i.Tuesday=2]="Tuesday",i[i.Wednesday=3]="Wednesday",i[i.Thursday=4]="Thursday",i[i.Friday=5]="Friday",i[i.Saturday=6]="Saturday",i[i.Sunday=0]="Sunday",(i=d.Month||(d.Month={}))[i.January=0]="January",i[i.February=1]="February",i[i.March=2]="March",i[i.April=3]="April",i[i.May=4]="May",i[i.June=5]="June",i[i.July=6]="July",i[i.August=7]="August",i[i.September=8]="September",i[i.October=9]="October",i[i.November=10]="November",i[i.December=11]="December",(i=d.Align||(d.Align={}))[i.Left=1]="Left",i[i.Right=2]="Right",i[i.Center=3]="Center",(i=d.Position||(d.Position={}))[i.BottomRight=1]="BottomRight",i[i.BottomLeft=2]="BottomLeft",i[i.TopRight=3]="TopRight",i[i.TopLeft=4]="TopLeft",(i=d.ti||(d.ti={}))[i.Enter=13]="Enter",i[i.Space=32]="Space",i[i.Left=37]="Left",i[i.Up=38]="Up",i[i.Right=39]="Right",i[i.Down=40]="Down",i[i.Esc=27]="Esc",(i=t=d.wt||(d.wt={})).MouseDown="mousedown",i.Focus="focus",i.FocusIn="focusin",i.Blur="blur",i.KeyDown="keydown",i.KeyUp="keyup",i.KeyPress="keypress",i.TouchStart="touchstart",i.TouchMove="touchmove",i.AnimationEnd="animationend",v.fi=function(t){return t?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t):null},v.Et=function(t,i,n,s){if(!i){if(n)return null;throw new Error(t+" cannot be empty.")}if(i instanceof d.Day)return i.getDate();if("string"==typeof i){if("today"===(i=i.trim?i.trim():i)||"now"===i)return s.getToday();var e;if("tomorrow"===i)return(e=s.getToday()).setDate(e.getDate()+1),e;if("yesterday"===i)return(e=s.getToday()).setDate(e.getDate()-1),e;var h=s.getToday(),r=i,u=i.match(new RegExp("^\\s*([0-9]+).?\\s*("+v.ci.join("|")+")\\s*","i"));if(u){for(var o=parseInt(u[1],10),a=void 0,a=0;a<v.ci.length;a++)if(u[2].toLowerCase()===v.ci[a]){h.setMonth(a),h.setDate(o);break}r=r.substring(u[0].length)}for(var f=!0;r;){var c=r.match(/^\s*([+-]?)\s*([0-9]+)\s*(day|week|month|year)s?\s*/i);if(!c)break;switch(c[1]){case"+":f=!0;break;case"-":f=!1}var l=parseInt(c[2],10)*(f?1:-1);switch(c[3].toLowerCase()){case"day":case"days":h.setDate(h.getDate()+l);break;case"week":case"weeks":h.setDate(h.getDate()+7*l);break;case"month":case"months":h.setMonth(h.getMonth()+l);break;case"year":case"years":h.setFullYear(h.getFullYear()+l)}if(!(r=r.substring(c[0].length)))return h}if(h=v.fi(new Date(i)),!isNaN(h.getTime()))return h}else if(v.ai(i)){h=v.fi(new Date(i.getTime()));if(!isNaN(h.getTime()))return h}throw new Error(t+" was expected to be a valid Date string or valid Date or TheDatepicker.Day"+(n?" or null.":"."))},v.Yt=function(t){return"object"==typeof t&&1===t.nodeType&&"object"==typeof t.style&&"object"==typeof t.ownerDocument},v.ai=function(t){return"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t.getTime())},v.li=function(t,i){for(var n=0;n<t.length;n++)if(t[n]===i)return!0;return!1},v.vt=function(i,t,n,s){var e,h,r;return void 0===s&&(s=!1),i.addEventListener?(e=void 0,s&&v.di()&&(e={passive:!0}),i.addEventListener(t,n,e),function(){i.removeEventListener(t,n)}):(r=i[h="on"+t]||null,i[h]=function(t){t=t||window.event,r&&r.call(i,t),n(t)},function(){i[h]=r})},v.ii=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},v.$t=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},v.v=function(t,i,n){if(!(n=void 0===n?!1:n)&&!i)return"";if("string"!=typeof i||n&&""===i)throw new Error(t+" was expected to be a"+(n?" non empty":"")+" string.");return i},v.l=function(t,i,n,s){if(void 0===n&&(n=null),void 0===s&&(s=null),"number"!=typeof(i="string"==typeof i?parseInt(i,10):i)||isNaN(i)||null!==n&&i<n||null!==s&&s<i)throw new Error(t+" was expected to be a valid number"+(null!==n?" from "+n:"")+(null!==s?" to "+s:"")+".");return i},v.Jt=function(t,i,n){if((n=void 0===n?!0:n)&&!i)return null;if("function"!=typeof i)throw new Error(t+" was expected to be a function"+(n?" or null":"")+".");return i},v.i=function(t,i){if(window.console){for(var n=0;n<v.vi.length;n++)if(t===v.vi[0])return;window.console.warn("TheDatepicker: "+t+" is deprecated, use "+i.join(" or ")),v.vi.push(t)}},v.wi=function(i,e){var h,r=null;v.vt(i,t.TouchStart,function(t){r={x:t.touches[0].clientX,y:t.touches[0].clientY},h={x:i.offsetWidth/5,y:i.offsetHeight/5}},!0),v.vt(i,t.TouchMove,function(t){var i,n,s;r&&(i=t.touches[0].clientX-r.x,n=t.touches[0].clientY-r.y,s=null,Math.abs(i)>h.x?s=0<i?d.pi.Right:d.pi.Left:Math.abs(n)>h.x&&(s=0<n?d.pi.Down:d.pi.Up),s)&&(e(t,s),r=null)},!0)},v.yi=function(){var t;return null===v.bi&&(t=document.createElement("div"),v.bi=""===t.style.animationName),v.bi},v.di=function(){if(null===v.mi){var t=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return!(t=!0)}});window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch(t){}v.mi=t}return v.mi},v.hi=function(){var t=window.matchMedia||window.msMatchMedia;return!!t&&!!(t=t("only all and (max-width: 37.5em)"))&&!!t.matches},v.ci=["january","february","march","april","may","june","july","august","september","october","november","december"],v.vi=[],v.bi=null,v.mi=null;var t,i=v;function v(){}d.h=i})(TheDatepicker=TheDatepicker||{}),(h=>{function r(){}r.Wt=function(t,i){var n=document.createElement("div");return r.qt(n,t,i),n},r._t=function(i,t,n){void 0===n&&(n=h.ClassNameType.Button);var s=document.createElement("a");return r.qt(s,n,t),s.href="#",s.onclick=function(t){t=t||window.event,h.h.ii(t),i(t)},s.onkeydown=function(t){t=t||window.event,h.h.li([h.ti.Enter,h.ti.Space],t.keyCode)&&(h.h.ii(t),i(t))},s},r.Zt=function(){return document.createElement("span")},r.Di=function(t,i,n,s){var e=document.createElement("table");return r.qt(e,n,s),t&&e.appendChild(t),e.appendChild(i),e},r.ki=function(t,i,n){for(var s=document.createElement("thead"),e=(r.qt(s,i,n),document.createElement("tr")),h=0;h<t.length;h++)e.appendChild(t[h]);return s.appendChild(e),s},r.Ti=function(t,i){var n=document.createElement("th");return n.scope="col",r.qt(n,t,i),n},r.gi=function(t,i,n){var s=document.createElement("tbody");r.qt(s,i,n);for(var e=0;e<t.length;e++)s.appendChild(t[e]);return s},r.Ci=function(t,i){var n=document.createElement("tr");r.qt(n,h.ClassNameType.TableRow,i);for(var s=0;s<t.length;s++)n.appendChild(t[s]);return n},r.Mi=function(){return document.createElement("td")},r.Ai=function(t,i,n){var s=document.createElement("select");r.qt(s,h.ClassNameType.SelectInput,n);for(var e=0;e<t.length;e++)s.appendChild(r.Oi(t[e].value,t[e].label));return s.onchange=function(t){i(t||window.event,s.value)},s.onkeydown=function(t){t=t||window.event,h.h.$t(t)},s},r.Oi=function(t,i){var n=document.createElement("option");return n.value=t,n.innerText=i,n},r.qt=function(t,i,n){var s=n.classNames.getClassName(i);if(s.length){for(var e=0;e<s.length;e++)s[e]=n.Ri(s[e]);t.className+=(t.className?" ":"")+s.join(" ")}},r.Ei=function(t,i){i&&t.appendChild(i)},h.zt=r})(TheDatepicker=TheDatepicker||{}),(h=>{(t=i=h.Ii||(h.Ii={})).BeforeSelect="beforeSelect",t.Select="select",t.BeforeOpen="beforeOpen",t.Open="open",t.BeforeClose="beforeClose",t.Close="close",t.BeforeMonthChange="beforeMonthChange",t.MonthChange="monthChange",t.Focus="focus",t.BeforeFocus="beforeFocus";var i,n=function(){},t=(h.AvailableDateNotFoundException=n,s.prototype.clone=function(){var t=new s(this.translator.clone(),this.classNames.clone());return t.Si=this.Si,t.Hi=this.Hi,t.Bi=this.Bi,t.Fi=this.Fi,t.xi=this.xi,t.Li=this.Li,t.Ni=this.Ni,t.ji=this.ji,t.Yi=this.Yi.slice(0),t.Ji=this.Ji,t.Gi=this.Gi,t.Pi=this.Pi,t.Ui=this.Ui,t.Wi=this.Wi.slice(0),t.zi=this.zi.slice(0),t._i=this._i,t.Zi=this.Zi,t.qi=this.qi,t.Ki=this.Ki,t.Qi=this.Qi,t.Vi=this.Vi,t.Xi=this.Xi,t.$i=this.$i,t.tn=this.tn,t.nn=this.nn,t.sn=this.sn,t.en=this.en,t.hn=this.hn,t.rn=this.rn,t.un=this.un,t.on=this.on,t.an=this.an,t.fn=this.fn,t.cn=this.cn,t.ln=this.ln,t.dn=this.dn,t.vn=this.vn,t.wn=this.wn,t.pn=this.pn,t.yn=this.yn,t.bn=this.bn,t.mn=this.mn,t.Dn=this.Dn,t.kn=this.kn,t.Tn=this.Tn,t.gn=this.gn,t.Cn=this.Cn,t.Mn=this.Mn,t.An=this.An,t.On=this.On,t.Rn=this.Rn,t.En.beforeSelect=this.En.beforeSelect.slice(0),t.En.select=this.En.select.slice(0),t.En.beforeOpen=this.En.beforeOpen.slice(0),t.En.open=this.En.open.slice(0),t.En.beforeClose=this.En.beforeClose.slice(0),t.En.close=this.En.close.slice(0),t.En.beforeMonthChange=this.En.beforeMonthChange.slice(0),t.En.monthChange=this.En.monthChange.slice(0),t.En.beforeFocus=this.En.beforeFocus.slice(0),t.En.focus=this.En.focus.slice(0),t},s.prototype.setHideOnBlur=function(t){this.Si=!!t},s.prototype.setHideOnSelect=function(t){this.Hi=!!t},s.prototype.setMinDate=function(t){t=h.h.Et("Min date",t,!0,this);this.In(t,this.Fi),this.Bi=t},s.prototype.setMaxDate=function(t){t=h.h.Et("Max date",t,!0,this);this.In(this.Bi,t),this.Fi=t},s.prototype.setInitialMonth=function(t){this.Li=h.h.Et("Initial month",t,!0,this)},s.prototype.setInitialDate=function(t){this.xi=h.h.Et("Initial date",t,!0,this)},s.prototype.setInitialDatePriority=function(t){this.Ni=!!t},s.prototype.setFirstDayOfWeek=function(t){this.ji=h.h.l("First day of week",t,0,6)},s.prototype.setDateAvailabilityResolver=function(t){h.h.i("setDateAvailabilityResolver",["addDateAvailabilityResolver"]),this.removeDateAvailabilityResolver(),t&&this.addDateAvailabilityResolver(t)},s.prototype.addDateAvailabilityResolver=function(t){this.Yi.push(h.h.Jt("Resolver",t,!1))},s.prototype.removeDateAvailabilityResolver=function(t){this.Sn(this.Yi,"Resolver",t=void 0===t?null:t)},s.prototype.setCellContentResolver=function(t){this.Ji=h.h.Jt("Resolver",t)},s.prototype.setCellContentStructureResolver=function(t,i){void 0===i&&(i=null),t=h.h.Jt("Resolver (init)",t),i=h.h.Jt("Resolver (update)",i),this.Gi=t?{init:t,update:i}:null},s.prototype.setHeaderStructureResolver=function(t){this.Pi=h.h.Jt("Resolver",t)},s.prototype.setFooterStructureResolver=function(t){this.Ui=h.h.Jt("Resolver",t)},s.prototype.addCellClassesResolver=function(t){this.Wi.push(h.h.Jt("Resolver",t,!1))},s.prototype.removeCellClassesResolver=function(t){this.Sn(this.Wi,"Resolver",t=void 0===t?null:t)},s.prototype.addDayModifier=function(t){this.zi.push(h.h.Jt("Modifier",t,!1))},s.prototype.removeDayModifier=function(t){this.Sn(this.zi,"Modifier",t=void 0===t?null:t)},s.prototype.setInputFormat=function(t){this._i=h.h.v("Input format",t,!0)},s.prototype.setAllowInputAnyChar=function(t){this.Zi=!!t},s.prototype.setDaysOutOfMonthVisible=function(t){this.qi=!!t},s.prototype.setFixedRowsCount=function(t){this.Ki=!!t},s.prototype.setToggleSelection=function(t){this.Qi=!!t},s.prototype.setShowDeselectButton=function(t){this.Xi=!!t},s.prototype.setAllowEmpty=function(t){this.Vi=!!t},s.prototype.setShowResetButton=function(t){this.$i=!!t},s.prototype.setMonthAsDropdown=function(t){this.tn=!!t},s.prototype.setYearAsDropdown=function(t){this.nn=!!t},s.prototype.setBindSelectedDateWithMonth=function(t){this.sn=!!t},s.prototype.setYearSelectedFromTableOfYears=function(t){this.en=!!t},s.prototype.setTableOfYearsRowsCount=function(t){this.hn=h.h.l("Rows count",t,1)},s.prototype.setTableOfYearsAlign=function(t){this.rn=t?h.h.l("Align",t,1,3):null},s.prototype.setTableOfYearsOnSwipeDown=function(t){this.un=!!t},s.prototype.setYearsOutOfTableOfYearsVisible=function(t){this.Hn=!!t},s.prototype.setMonthAndYearSeparated=function(t){this.on=!!t},s.prototype.setMonthShort=function(t){this.an=!!t},s.prototype.setChangeMonthOnSwipe=function(t){this.fn=!!t},s.prototype.setAnimateMonthChange=function(t){h.h.i("setAnimateMonthChange",["setSlideAnimation"]),this.setSlideAnimation(t)},s.prototype.setSlideAnimation=function(t){this.cn=!!t},s.prototype.setClassesPrefix=function(t){this.ln=h.h.v("Prefix",t)},s.prototype.setDarkMode=function(t){this.dn=!!t},s.prototype.setShowCloseButton=function(t){this.vn=!!t},s.prototype.setCloseOnEscPress=function(t){this.wn=!!t},s.prototype.setTitle=function(t){this.pn=h.h.v("Title",t)},s.prototype.setDropdownItemsLimit=function(t){this.yn=h.h.l("Items limit",t,1)},s.prototype.setHideDropdownWithOneItem=function(t){this.bn=!!t},s.prototype.setGoBackHtml=function(t){this.mn=h.h.v("Html",t)},s.prototype.setGoForwardHtml=function(t){this.Dn=h.h.v("Html",t)},s.prototype.setCloseHtml=function(t){this.kn=h.h.v("Html",t)},s.prototype.setResetHtml=function(t){this.Tn=h.h.v("Html",t)},s.prototype.setDeselectHtml=function(t){this.gn=h.h.v("Html",t)},s.prototype.setPosition=function(t){this.Cn=h.h.l("Position",t,1,4)},s.prototype.setPositionFixing=function(t){this.Mn=!!t},s.prototype.setFullScreenOnMobile=function(t){this.An=!!t},s.prototype.setKeyboardOnMobile=function(t){this.On=!!t},s.prototype.setIncludeAria=function(t){this.Rn=!!t},s.prototype.setToday=function(t){this.Bn=h.h.Et("Today",t,!0,this)},s.prototype.onBeforeSelect=function(t){this.Fn(i.BeforeSelect,t)},s.prototype.offBeforeSelect=function(t){this.xn(i.BeforeSelect,t=void 0===t?null:t)},s.prototype.onSelect=function(t){this.Fn(i.Select,t)},s.prototype.offSelect=function(t){this.xn(i.Select,t=void 0===t?null:t)},s.prototype.onBeforeOpen=function(t){this.Fn(i.BeforeOpen,t)},s.prototype.offBeforeOpen=function(t){this.xn(i.BeforeOpen,t=void 0===t?null:t)},s.prototype.onOpen=function(t){this.Fn(i.Open,t)},s.prototype.offOpen=function(t){this.xn(i.Open,t=void 0===t?null:t)},s.prototype.onBeforeClose=function(t){this.Fn(i.BeforeClose,t)},s.prototype.offBeforeClose=function(t){this.xn(i.BeforeClose,t=void 0===t?null:t)},s.prototype.onClose=function(t){this.Fn(i.Close,t)},s.prototype.offClose=function(t){this.xn(i.Close,t=void 0===t?null:t)},s.prototype.onBeforeOpenAndClose=function(t){h.h.i("onBeforeOpenAndClose",["onBeforeOpen","onBeforeClose"]),this.onBeforeOpen(t),this.onBeforeClose(t)},s.prototype.offBeforeOpenAndClose=function(t){void 0===t&&(t=null),h.h.i("offBeforeOpenAndClose",["offBeforeOpen","offBeforeClose"]),this.offBeforeOpen(t),this.offBeforeClose(t)},s.prototype.onOpenAndClose=function(t){h.h.i("onOpenAndClose",["onOpen","onClose"]),this.onOpen(t),this.onClose(t)},s.prototype.offOpenAndClose=function(t){void 0===t&&(t=null),h.h.i("offOpenAndClose",["offOpen","offClose"]),this.offOpen(t),this.offClose(t)},s.prototype.onBeforeMonthChange=function(t){this.Fn(i.BeforeMonthChange,t)},s.prototype.offBeforeMonthChange=function(t){this.xn(i.BeforeMonthChange,t=void 0===t?null:t)},s.prototype.onMonthChange=function(t){this.Fn(i.MonthChange,t)},s.prototype.offMonthChange=function(t){this.xn(i.MonthChange,t=void 0===t?null:t)},s.prototype.onBeforeFocus=function(t){this.Fn(i.BeforeFocus,t)},s.prototype.offBeforeFocus=function(t){this.xn(i.BeforeFocus,t=void 0===t?null:t)},s.prototype.onFocus=function(t){this.Fn(i.Focus,t)},s.prototype.offFocus=function(t){this.xn(i.Focus,t=void 0===t?null:t)},s.prototype.getInitialMonth=function(){var t=this.Ni?this.xi:this.Li,i=this.Ni?this.Li:this.xi,t=t?new Date(t.getTime()):i?new Date(i.getTime()):this.getToday();return t.setDate(1),this.correctMonth(t)},s.prototype.isMonthInValidity=function(t){return!this.Ln(t)},s.prototype.correctMonth=function(t){return this.Ln(t)||t},s.prototype.getInitialDate=function(){return this.findPossibleAvailableDate(this.xi)},s.prototype.findPossibleAvailableDate=function(t){if(this.isAllowedEmpty())return t&&this.isDateInValidity(t)&&this.isDateAvailable(t)?new Date(t.getTime()):null;if(t=t?new Date(t.getTime()):this.getToday(),t=this.findNearestAvailableDate(t))return t;throw new n},s.prototype.findNearestAvailableDate=function(t){return this.Nn(t)},s.prototype.Nn=function(t,i,n){void 0===i&&(i=null),void 0===n&&(n=null),t=this.jn(t);var s=this.q().getTime(),e=this.K().getTime(),h=i?Math.max(s,i.getTime()):s,r=n?Math.min(e,n.getTime()):e;if(this.isDateAvailable(t))return h<=(i=t.getTime())&&i<=r?t:null;var u=1e3,o=t,a=new Date(t.getTime());do{if(o)if(o.setDate(o.getDate()+1),o.getTime()>r)o=null;else if(this.isDateAvailable(o))return o;if(a)if(a.setDate(a.getDate()-1),a.getTime()<h)a=null;else if(this.isDateAvailable(a))return a}while(u--,(o||a)&&0<u);return null},s.prototype.isDateInValidity=function(t){return!this.Yn(t)},s.prototype.jn=function(t){return this.Yn(t)||t},s.prototype.getFirstDayOfWeek=function(){return this.ji},s.prototype.areDaysOutOfMonthVisible=function(){return this.qi},s.prototype.hasFixedRowsCount=function(){return this.Ki},s.prototype.hasToggleSelection=function(){return this.Vi&&this.Qi},s.prototype.isAllowedEmpty=function(){return this.Vi},s.prototype.isDeselectButtonShown=function(){return this.Vi&&this.Xi},s.prototype.isResetButtonShown=function(){return this.$i},s.prototype.isMonthAsDropdown=function(){return this.tn},s.prototype.isYearAsDropdown=function(){return this.nn},s.prototype.isYearSelectedFromTableOfYears=function(){return this.nn&&this.en},s.prototype.isSelectedDateBoundWithMonth=function(){return this.sn},s.prototype.getTableOfYearsRowsCount=function(){return this.hn},s.prototype.getTableOfYearsColumnsCount=function(){return 4},s.prototype.getTableOfYearsAlign=function(){return this.rn},s.prototype.isTableOfYearsOnSwipeDownEnabled=function(){return this.un},s.prototype.areYearsOutOfTableOfYearsVisible=function(){return this.Hn},s.prototype.isMonthAndYearSeparated=function(){return this.isYearSelectedFromTableOfYears()||this.on},s.prototype.isMonthShort=function(){return this.an},s.prototype.isMonthChangeOnSwipeEnabled=function(){return this.fn},s.prototype.isMonthChangeAnimated=function(){return h.h.i("isMonthChangeAnimated",["isSlideAnimationEnabled"]),this.isSlideAnimationEnabled()},s.prototype.isSlideAnimationEnabled=function(){return this.cn},s.prototype.getClassesPrefix=function(){return this.ln},s.prototype.isDarkModeEnabled=function(){return this.dn},s.prototype.isCloseButtonShown=function(){return this.Si&&this.vn},s.prototype.isClosedOnEscPress=function(){return this.Si&&this.wn},s.prototype.getTitle=function(){return this.pn},s.prototype.getMinDate=function(){return this.Bi?new Date(this.Bi.getTime()):null},s.prototype.getMaxDate=function(){return this.Fi?new Date(this.Fi.getTime()):null},s.prototype.q=function(){var t=this.getMinDate();return t||new Date(-271821,4,1)},s.prototype.K=function(){var t=this.getMaxDate();return t||new Date(275760,7,31)},s.prototype.getMinMonth=function(){var t;return this.Bi?((t=new Date(this.Bi.getTime())).setDate(1),t):null},s.prototype.getMaxMonth=function(){var t;return this.Fi?((t=new Date(this.Fi.getTime())).setDate(1),t):null},s.prototype.Jn=function(){return this.getMinMonth()||this.q()},s.prototype.Gn=function(){var t=this.getMaxMonth();return t||(t=this.K()).setDate(1),t},s.prototype.isDropdownWithOneItemHidden=function(){return this.bn},s.prototype.getDropdownItemsLimit=function(){return this.yn},s.prototype.isDateAvailable=function(t){for(var i=this.Yi.slice(0),n=0;n<i.length;n++)if(!i[n](new Date(t.getTime())))return!1;return!0},s.prototype.getCellContent=function(t){return this.Ji?this.Ji(t):t.dayNumber+""},s.prototype.Ri=function(t){return this.ln+t},s.prototype.Pn=function(){return this.Gi?this.Gi.init():h.zt.Zt()},s.prototype.Un=function(t,i){this.Gi?this.Gi.update(t,i):t.innerText=this.getCellContent(i)},s.prototype.Wn=function(){return this.Pi?this.Pi():null},s.prototype.zn=function(){return this.Ui?this.Ui():null},s.prototype.getCellClasses=function(t){for(var i=[],n=this.Wi.slice(0),s=0;s<n.length;s++){var e=n[s](t);"string"==typeof e?i.push(e):"object"==typeof e&&e.constructor===Array&&(i=i.concat(e))}return i},s.prototype.modifyDay=function(t){for(var i=this.zi.slice(0),n=0;n<i.length;n++)i[n](t)},s.prototype.getGoBackHtml=function(){return this.mn},s.prototype.getGoForwardHtml=function(){return this.Dn},s.prototype.getCloseHtml=function(){return this.kn},s.prototype.getResetHtml=function(){return this.Tn},s.prototype.getDeselectHtml=function(){return this.gn},s.prototype.isHiddenOnBlur=function(){return this.Si},s.prototype.isHiddenOnSelect=function(){return this.Si&&this.Hi},s.prototype.getInputFormat=function(){return this._i},s.prototype.isAllowedInputAnyChar=function(){return this.Zi},s.prototype.getPosition=function(){return this.Cn},s.prototype.isPositionFixingEnabled=function(){return this.Si&&this.Mn},s.prototype.isFullScreenOnMobile=function(){return this.Si&&this.An},s.prototype.isKeyboardOnMobile=function(){return this.On},s.prototype.isAriaIncluded=function(){return this.Rn},s.prototype.getToday=function(){return this.Bn?new Date(this.Bn.getTime()):h.h.fi(new Date)},s.prototype.getDateAvailabilityResolver=function(){return h.h.i("getDateAvailabilityResolver",["getDateAvailabilityResolvers"]),0<this.Yi.length?this.Yi[0]:null},s.prototype.getDateAvailabilityResolvers=function(){return this.Yi.slice(0)},s.prototype.getCellContentResolver=function(){return this.Ji},s.prototype.getCellContentStructureResolver=function(){return this.Gi},s.prototype.getHeaderStructureResolver=function(){return this.Pi},s.prototype.getFooterStructureResolver=function(){return this.Ui},s.prototype.getCellClassesResolvers=function(){return this.Wi.slice(0)},s.prototype.getDayModifiers=function(){return this.zi.slice(0)},s.prototype.getBeforeSelectListeners=function(){return this.En.beforeSelect.slice(0)},s.prototype.getSelectListeners=function(){return this.En.select.slice(0)},s.prototype.getBeforeOpenListeners=function(){return this.En.beforeOpen.slice(0)},s.prototype.getOpenListeners=function(){return this.En.open.slice(0)},s.prototype.getBeforeCloseListeners=function(){return this.En.beforeClose.slice(0)},s.prototype.getCloseListeners=function(){return this.En.close.slice(0)},s.prototype.getBeforeOpenAndCloseListeners=function(){return h.h.i("getBeforeOpenAndCloseListeners",["getBeforeOpenListeners","getBeforeCloseListeners"]),this.En.beforeOpen.concat(this.En.beforeClose)},s.prototype.getOpenAndCloseListeners=function(){return h.h.i("getOpenAndCloseListeners",["getOpenListeners","getCloseListeners"]),this.En.open.concat(this.En.close)},s.prototype.getBeforeMonthChangeListeners=function(){return this.En.beforeMonthChange.slice(0)},s.prototype.getMonthChangeListeners=function(){return this.En.monthChange.slice(0)},s.prototype.getBeforeFocusListeners=function(){return this.En.beforeFocus.slice(0)},s.prototype.getFocusListeners=function(){return this.En.focus.slice(0)},s.prototype.In=function(t,i){if(t&&i&&t.getTime()>i.getTime())throw new Error("Min date cannot be higher then max date.")},s.prototype.Ln=function(t){var i=this.Jn();return t.getTime()<i.getTime()||(i=this.Gn(),t.getTime()>i.getTime())?i:null},s.prototype.Yn=function(t){var i=this.q();return t.getTime()<i.getTime()||(i=this.K(),t.getTime()>i.getTime())?i:null},s.prototype.Sn=function(t,i,n){if(n=h.h.Jt(i,n))for(var s=t.slice(0),e=s.length-1;0<=e;e--)s[e]===n&&t.splice(e,1);else t.splice(0,t.length)},s.prototype.Fn=function(t,i){this.En[t].push(h.h.Jt("Event listener",i,!1))},s.prototype.xn=function(t,i){if(i=h.h.Jt("Event listener",i)){for(var n=[],s=0;s<this.En[t].length;s++)this.En[t][s]!==i&&n.push(this.En[t][s]);this.En[t]=n}else this.En[t]=[]},s.prototype._n=function(t,i){for(var n=this.En[t].slice(0),s=0;s<n.length;s++)if(!1===i(n[s]))return!1;return!0},s);function s(t,i){void 0===t&&(t=null),void 0===i&&(i=null),this.Si=!0,this.Hi=!0,this.Bi=null,this.Fi=null,this.xi=null,this.Li=null,this.Ni=!0,this.ji=h.DayOfWeek.Monday,this.Yi=[],this.Ji=null,this.Gi=null,this.Pi=null,this.Ui=null,this.Wi=[],this.zi=[],this._i="j. n. Y",this.Zi=!1,this.qi=!1,this.Ki=!1,this.Qi=!1,this.Vi=!0,this.Xi=!0,this.$i=!1,this.tn=!0,this.nn=!0,this.sn=!1,this.en=!0,this.hn=6,this.rn=null,this.un=!0,this.Hn=!0,this.on=!0,this.an=!1,this.fn=!0,this.cn=!0,this.ln="the-datepicker__",this.dn=!1,this.vn=!0,this.wn=!0,this.pn="",this.yn=200,this.bn=!0,this.mn="&lt;",this.Dn="&gt;",this.kn="&times;",this.Tn="&olarr;",this.gn="&times;",this.Cn=h.Position.BottomRight,this.Mn=!0,this.An=!0,this.On=!1,this.Rn=!0,this.Bn=null,this.En={beforeSelect:[],select:[],beforeOpen:[],open:[],beforeClose:[],close:[],beforeMonthChange:[],monthChange:[],beforeFocus:[],focus:[]},this.translator=t||new h.Translator,this.classNames=i||new h.ClassNames}h.Options=t})(TheDatepicker=TheDatepicker||{}),(f=>{function t(t,i,n){this.Zn=t,this.qn=i,this.Kn=n,this.Qn=null,this.Vn=null,this.Xn=null,this.$n=null,this.ts=null,this.ns=null,this.ss=null,this.es=null,this.hs=null,this.rs=null,this.us=null,this.os=null,this.fs=null,this.cs=null,this.ls=null,this.ds=null,this.vs=null,this.ws=null,this.ps=null,this.ys=null,this.bs=[],this.Ds=[],this.ks=[],this.Ts=[],this.gs=[],this.Cs=[],this.Ms=[],this.As=null}f.Os=function(t){this.yearNumber=t,this.isAvailable=!0,this.isSelected=!1,this.isHighlighted=!1,this.isFocused=!1},t.prototype.yt=function(t){if(!this.Qn){if(this.Kn&&this.Zn.isHiddenOnBlur()&&!t.kt())return;this.qn.innerHTML="",this.qn.appendChild(this.Rs(t))}this.Es(t),this.Is(t),this.Ss(t),this.Hs(t),this.Bs(t),this.Fs(t),this.xs(t,!1),this.xs(t,!0),this.Ls(t),this.Ns(t),this.js(t),this.Ys(t),this.Js(t)},t.prototype.Rs=function(t){var i=f.zt.Wt(f.ClassNameType.Main,this.Zn);return f.zt.Ei(i,this.Zn.Wn()),i.appendChild(this.Gs(t)),i.appendChild(this.Ps(t)),f.zt.Ei(i,this.Zn.zn()),this.Qn=i},t.prototype.Es=function(t){this.Qn.style.display=this.Kn&&!t.kt()&&this.Zn.isHiddenOnBlur()?"none":"",this.Qn.className="",f.zt.qt(this.Qn,f.ClassNameType.Main,this.Zn),this.Zn.isDarkModeEnabled()&&f.zt.qt(this.Qn,f.ClassNameType.MainDarkMode,this.Zn)},t.prototype.Is=function(t){this.$n.style.display=t.Us?"none":"",this.ts&&(this.ts.style.display=t.Us?"":"none")},t.prototype.Ps=function(e){var h=this,t=f.zt.Wt(f.ClassNameType.Body,this.Zn),i=f.zt.Wt(f.ClassNameType.Tables,this.Zn),n=(t.appendChild(i),(this.Zn.isMonthChangeOnSwipeEnabled()||this.Zn.isTableOfYearsOnSwipeDownEnabled())&&(f.zt.qt(t,f.ClassNameType.BodySwipeable,this.Zn),f.h.wi(t,function(t,i){var n=!1,s=null;switch(i){case f.pi.Down:n=!0;case f.pi.Up:h.ts&&h.Zn.isTableOfYearsOnSwipeDownEnabled()&&e.Ws(n)&&(s=function(){e.zs(n)});break;case f.pi.Left:n=!0;case f.pi.Right:h.Zn.isMonthChangeOnSwipeEnabled()&&e._s(n)&&(s=function(){e.Zs(t,n)})}s&&h.qs(e,i,s)})),this.Ks(e));return i.appendChild(n),this.$n=n,this.Zn.isYearSelectedFromTableOfYears()&&(n=this.Qs(e),i.appendChild(n),this.ts=n),this.Vn=t,this.Xn=i,t},t.prototype.Gs=function(t){var i=f.zt.Wt(f.ClassNameType.Header,this.Zn),n=f.zt.Wt(f.ClassNameType.HeaderTop,this.Zn),s=(i.appendChild(n),n.appendChild(this.Vs(t)),f.zt.Wt(f.ClassNameType.HeaderControl,this.Zn)),n=(n.appendChild(s),s.appendChild(this.Xs(t)),s.appendChild(this.$s(t)),f.zt.Wt(f.ClassNameType.HeaderNavigation,this.Zn)),e=(i.appendChild(n),n.appendChild(this.te(t,!1)),f.zt.Wt(f.ClassNameType.HeaderState,this.Zn));return n.appendChild(e),this.Zn.isMonthAndYearSeparated()?(e.appendChild(this.ie(t)),e.appendChild(this.ne(t))):e.appendChild(this.se(t)),n.appendChild(this.te(t,!0)),this.ns=s,i},t.prototype.Ss=function(t){var i=""!==this.Zn.getTitle()||this.Zn.isResetButtonShown()||this.Kn&&this.Zn.isCloseButtonShown();this.ns.style.display=i?"":"none",this.hs.style.display=i?"":"none"},t.prototype.Vs=function(t){var i=f.zt.Wt(f.ClassNameType.HeaderTitle,this.Zn),n=f.zt.Zt();return i.appendChild(n),f.zt.qt(n,f.ClassNameType.HeaderTitleContent,this.Zn),this.hs=i,this.rs=n,i},t.prototype.Hs=function(t){var i=this.Zn.getTitle();this.rs.style.display=""!==i?"":"none",this.rs.innerText=i},t.prototype.Xs=function(i){var t=f.zt.Wt(f.ClassNameType.Reset,this.Zn),n=f.zt._t(function(t){i.Tt(t)},this.Zn);return n.innerHTML=this.Zn.getResetHtml(),t.appendChild(n),this.os=n,this.us=t},t.prototype.Fs=function(t){this.us.style.display=this.Zn.isResetButtonShown()?"":"none",this.ee(this.os,f.TitleName.Reset)},t.prototype.$s=function(i){var t=f.zt.Wt(f.ClassNameType.Close,this.Zn),n=f.zt._t(function(t){i.he(t)},this.Zn);return n.innerHTML=this.Zn.getCloseHtml(),t.appendChild(n),this.cs=n,this.fs=t},t.prototype.Bs=function(t){this.fs.style.display=this.Kn&&this.Zn.isCloseButtonShown()?"":"none",this.ee(this.cs,f.TitleName.Close)},t.prototype.te=function(n,s){var e=this,t=f.zt.Wt(f.ClassNameType.Go,this.Zn),i=(f.zt.qt(t,s?f.ClassNameType.GoNext:f.ClassNameType.GoPrevious,this.Zn),f.zt._t(function(t){var i=s?f.pi.Left:f.pi.Right;n._s(s)&&e.qs(n,i,function(){n.Zs(t,s)})},this.Zn));return i.innerHTML=s?this.Zn.getGoForwardHtml():this.Zn.getGoBackHtml(),t.appendChild(i),s?this.es=i:this.ss=i,t},t.prototype.xs=function(t,i){var n=i?this.es:this.ss;n.style.visibility=t._s(i)?"visible":"hidden",this.ee(n,t.Us?i?f.TitleName.GoForwardTableOfYears:f.TitleName.GoBackTableOfYears:i?f.TitleName.GoForward:f.TitleName.GoBack)},t.prototype.ie=function(e){for(var h=this,t=[],i=0;i<12;i++)t.push({value:i+"",label:this.re(i)});var n=f.zt.Ai(t,function(t,i){var n=e.St(),s=new Date(n.getTime());s.setMonth(parseInt(i,10)),e.Ht(t,s)||(h.ls.value=n.getMonth()+"")},this.Zn),s=f.zt.Wt(f.ClassNameType.HeaderMonth,this.Zn),r=f.zt.Zt();return s.appendChild(n),s.appendChild(r),this.ds=r,this.ls=n,s},t.prototype.Ls=function(t){if(this.ds){var i=t.St().getMonth();if(this.ds.innerText=this.re(i),this.ee(this.ls,f.TitleName.Month),this.Zn.isMonthAsDropdown()){for(var n=0,s=0;s<12;s++){var e=new Date(t.St().getTime()),h=(e.setMonth(s),this.ls.getElementsByTagName("option")[s]),e=t.ue(e);h.disabled=!e,h.style.display=e?"":"none",n+=e?1:0}this.ls.value=i+"";i=!this.Zn.isDropdownWithOneItemHidden()||1<n;this.ls.style.display=i?"":"none",this.ds.style.display=i?"none":""}else this.ls.style.display="none",this.ds.style.display=""}},t.prototype.ne=function(h){var t,r=this,i=f.zt.Wt(f.ClassNameType.HeaderYear,this.Zn),n=(this.Zn.isYearSelectedFromTableOfYears()?(t=f.zt._t(function(){r.qs(h,h.Us?f.pi.Up:f.pi.Down,function(){h.zs(!h.Us)})},this.Zn),f.zt.qt(t,f.ClassNameType.HeaderYearsToggle,this.Zn)):t=f.zt.Ai([],function(t,i){var n=h.St(),s=new Date(n.getTime()),i=(s.setFullYear(parseInt(i,10)),r.Zn.Jn()),e=r.Zn.Gn();(s=s.getTime()<i.getTime()?i:s).getTime()>e.getTime()&&(s=e),h.Ht(t,s)||(r.vs.value=n.getFullYear()+"")},this.Zn),f.zt.Zt());return i.appendChild(t),i.appendChild(n),this.ws=n,this.vs=t,i},t.prototype.Ns=function(t){if(this.ws){var i=t.St().getFullYear(),n=(this.ws.innerText=i+"",this.ee(this.vs,f.TitleName.Year),this.Zn.q().getFullYear()),s=this.Zn.K().getFullYear();if(this.ts)this.vs.innerText=i+"",t.oe&&(this.vs.focus(),t.oe=!1);else{if(!this.Zn.isYearAsDropdown())return this.vs.style.display="none",void(this.ws.style.display="");for(var t=this.ae(i,n,s),e=this.vs.getElementsByTagName("option"),h=this.fe(e,t,function(t){return parseInt(t,10)}),r=0;r<h.remove.length;r++)this.vs.removeChild(h.remove[r]);for(r=h.prepend.length-1;0<=r;r--)this.vs.insertBefore(f.zt.Oi(h.prepend[r]+"",h.prepend[r]+""),this.vs.firstChild);for(r=0;r<h.append.length;r++)this.vs.appendChild(f.zt.Oi(h.append[r]+"",h.append[r]+""));this.vs.value=i+""}e=!this.Zn.isDropdownWithOneItemHidden()||n!==s;this.vs.style.display=e?"":"none",this.ws.style.display=e?"none":""}},t.prototype.se=function(e){var h=this,t=f.zt.Wt(f.ClassNameType.HeaderMonthYear,this.Zn),i=f.zt.Ai([],function(t,i){var n=e.St(),s=new Date(n.getTime()),i=h.ce(i);s.setFullYear(i.year),s.setMonth(i.month),e.Ht(t,s)||(h.ps.value=h.le({month:n.getMonth(),year:n.getFullYear()}))},this.Zn),n=f.zt.Zt();return this.ys=n,this.ps=i,t.appendChild(n),t.appendChild(i),t},t.prototype.js=function(t){var i=this;if(this.ys){var t=t.St(),t={month:t.getMonth(),year:t.getFullYear()},n=this.de(t);if(this.ys.innerText=this.ve(t),this.Zn.isYearAsDropdown()&&this.Zn.isMonthAsDropdown()){for(var s=this.Zn.q(),e=this.Zn.K(),s=12*s.getFullYear()+s.getMonth(),e=12*e.getFullYear()+e.getMonth(),n=this.ae(n,s,e),s=this.ps.getElementsByTagName("option"),h=this.fe(s,n,function(t){return i.de(i.ce(t))}),r=0;r<h.remove.length;r++)this.ps.removeChild(h.remove[r]);for(r=h.prepend.length-1;0<=r;r--){var u=this.we(h.prepend[r]);this.ps.insertBefore(f.zt.Oi(this.le(u),this.ve(u)),this.ps.firstChild)}for(r=0;r<h.append.length;r++){u=this.we(h.append[r]);this.ps.appendChild(f.zt.Oi(this.le(u),this.ve(u)))}this.ps.value=this.le(t);e=!this.Zn.isDropdownWithOneItemHidden()||n.from<n.to;this.ps.style.display=e?"":"none",this.ys.style.display=e?"none":""}else this.ps.style.display="none",this.ys.style.display=""}},t.prototype.ve=function(t){return this.re(t.month)+" "+t.year},t.prototype.de=function(t){return 12*t.year+t.month},t.prototype.we=function(t){return{year:Math.floor(t/12),month:t%12}},t.prototype.le=function(t){return t.year+"-"+t.month},t.prototype.ce=function(t){t=t.split("-");return{month:parseInt(t[1],10),year:parseInt(t[0],10)}},t.prototype.ae=function(t,i,n){var s=this.Zn.getDropdownItemsLimit()-1,e=Math.ceil(s/2),s=t-(s-e),t=t+e;return s<i?(n<(t+=i-s)&&(t=n),s=i):n<t&&((s-=t-n)<i&&(s=i),t=n),{from:s,to:t}},t.prototype.fe=function(t,i,n){for(var s=0<t.length?n(t[0].value):null,e=0<t.length?n(t[t.length-1].value):null,h=[],r=[],u=[],o=i.from;o<=i.to;o++)null===s||o<s?h.push(o):e<o&&r.push(o);for(var a=0;a<t.length;a++)((o=n(t[a].value))<i.from||o>i.to)&&u.push(t[a]);return{prepend:h,append:r,remove:u}},t.prototype.Ks=function(t){var i=this.pe(t),t=this.ye(t),i=f.zt.Di(i,t,f.ClassNameType.CalendarTable,this.Zn);return f.zt.qt(i,f.ClassNameType.Table,this.Zn),i},t.prototype.pe=function(t){for(var i=t.be(),n=[],s=0;s<i.length;s++){var e=i[s];n.push(this.me(t,e))}return f.zt.ki(n,f.ClassNameType.CalendarTableHeader,this.Zn)},t.prototype.me=function(t,i){var n=f.zt.Ti(f.ClassNameType.CalendarTableHeaderCell,this.Zn);return i!==f.DayOfWeek.Saturday&&i!==f.DayOfWeek.Sunday||f.zt.qt(n,f.ClassNameType.WeekDayWeekend,this.Zn),n.innerText=this.Zn.translator.translateDayOfWeek(i),n},t.prototype.ye=function(t){this.Ds=[],this.ks=[],this.Ts=[];for(var i=[],n=0;n<6;n++)i.push(this.De(t));return this.bs=i,f.zt.gi(i,f.ClassNameType.CalendarTableBody,this.Zn)},t.prototype.Ys=function(t){if(!t.Us)for(var i=t.ke(),n=0;n<this.bs.length;n++){var s=this.bs[n],e=i.length>n?i[n]:null;if(s.style.display=e?"":"none",e)for(var h=0;h<this.Ds[n].length;h++)this.Te(t,this.Ds[n][h],this.ks[n][h],this.Ts[n][h],e[h])}},t.prototype.De=function(t){for(var i=[],n=[],s=[],e=0;e<7;e++){var h=f.zt.Mi(),r=this.ge(t),u=this.Ce(t);i.push(h),n.push(r),s.push(u),h.appendChild(r),r.appendChild(u)}return this.Ds.push(i),this.ks.push(n),this.Ts.push(s),f.zt.Ci(i,this.Zn)},t.prototype.Te=function(t,i,n,s,e){if(n.day=e,i.setAttribute("data-date",e.getFormatted()),i.className="",f.zt.qt(i,f.ClassNameType.TableCell,this.Zn),this.Zn.Un(s,e),e.isVisible){f.zt.qt(i,f.ClassNameType.Day,this.Zn),e.isToday&&f.zt.qt(i,f.ClassNameType.DayToday,this.Zn),e.isPast&&f.zt.qt(i,f.ClassNameType.DayPast,this.Zn),e.isWeekend&&f.zt.qt(i,f.ClassNameType.DayWeekend,this.Zn),e.isAvailable||(f.zt.qt(i,f.ClassNameType.TableCellUnavailable,this.Zn),f.zt.qt(i,f.ClassNameType.DayUnavailable,this.Zn)),e.isInCurrentMonth||f.zt.qt(i,f.ClassNameType.DayOutside,this.Zn),e.isHighlighted&&(f.zt.qt(i,f.ClassNameType.TableCellHighlighted,this.Zn),f.zt.qt(i,f.ClassNameType.DayHighlighted,this.Zn)),e.isSelected&&(f.zt.qt(i,f.ClassNameType.TableCellSelected,this.Zn),f.zt.qt(i,f.ClassNameType.DaySelected,this.Zn));for(var h=this.Zn.getCellClasses(e),r=0;r<h.length;r++)i.className+=" "+h[r];n.style.visibility="visible",e.isAvailable?n.href="#":n.removeAttribute("href"),e.isFocused&&n.focus()}else n.removeAttribute("href"),n.style.visibility="hidden"},t.prototype.ge=function(s){var e=this,h=f.zt._t(function(t){var i=s.It,n=s.Rt(t,h.day,!1,!0,!0);e.Zn.isHiddenOnSelect()&&(n||i&&h.day.isEqualToDate(i))&&s.he(t)},this.Zn);return f.zt.qt(h,f.ClassNameType.DayButton,this.Zn),h.onfocus=function(t){s.Me(t||window.event,h.day)},h.onmouseenter=function(t){0<e.Zn.getBeforeFocusListeners().length||0<e.Zn.getFocusListeners().length?s.Me(t||window.event,h.day,!1,!1):s.Ae(t||window.event)},h.onmouseleave=function(t){s.Ae(t||window.event)},h},t.prototype.Ce=function(t){var i=this.Zn.Pn();return f.zt.qt(i,f.ClassNameType.ButtonContent,this.Zn),f.zt.qt(i,f.ClassNameType.DayButtonContent,this.Zn),i},t.prototype.Qs=function(t){t=this.Oe(t),t=f.zt.Di(null,t,f.ClassNameType.YearsTable,this.Zn);return f.zt.qt(t,f.ClassNameType.Table,this.Zn),t},t.prototype.Oe=function(t){this.gs=[],this.Cs=[],this.Ms=[];for(var i=[],n=0;n<this.Zn.getTableOfYearsRowsCount();n++)i.push(this.Re(t));return f.zt.gi(i,f.ClassNameType.YearsTableBody,this.Zn)},t.prototype.Js=function(t){if(t.Us)for(var i=t.Ee(),n=0;n<this.gs.length;n++){var s=i.length>n?i[n]:null;if(s)for(var e=0;e<this.gs[n].length;e++)this.Ie(t,this.gs[n][e],this.Cs[n][e],this.Ms[n][e],s[e])}},t.prototype.Ie=function(t,i,n,s,e){if(n.yearCellData=e,i.setAttribute("data-year",e.yearNumber+""),i.className="",f.zt.qt(i,f.ClassNameType.TableCell,this.Zn),s.innerText=e.yearNumber+"",e.isAvailable)n.href="#";else{if(n.removeAttribute("href"),!this.Zn.areYearsOutOfTableOfYearsVisible())return void(n.style.visibility="hidden");f.zt.qt(i,f.ClassNameType.TableCellUnavailable,this.Zn)}e.isHighlighted&&f.zt.qt(i,f.ClassNameType.TableCellHighlighted,this.Zn),e.isSelected&&f.zt.qt(i,f.ClassNameType.TableCellSelected,this.Zn),n.style.visibility="visible",e.isFocused&&n.focus()},t.prototype.Re=function(t){for(var i=[],n=[],s=[],e=0;e<this.Zn.getTableOfYearsColumnsCount();e++){var h=f.zt.Mi(),r=this.Se(t),u=this.He(t);i.push(h),n.push(r),s.push(u),h.appendChild(r),r.appendChild(u)}return this.gs.push(i),this.Cs.push(n),this.Ms.push(s),f.zt.Ci(i,this.Zn)},t.prototype.Se=function(s){var e=this,h=f.zt._t(function(t){var i=new Date(h.yearCellData.yearNumber,s.St().getMonth(),1),n=e.Zn.correctMonth(i);n.getFullYear()===i.getFullYear()&&(s.Ht(t,n),s.oe=!0,e.qs(s,f.pi.Up,function(){s.zs(!1)}))},this.Zn);return f.zt.qt(h,f.ClassNameType.YearCellButton,this.Zn),h.onfocus=function(){s.Be(h.yearCellData.yearNumber)},h.onmouseenter=function(){s.Fe()},h.onmouseleave=function(){s.Fe()},h},t.prototype.He=function(t){var i=f.zt.Zt();return f.zt.qt(i,f.ClassNameType.ButtonContent,this.Zn),f.zt.qt(i,f.ClassNameType.YearCellButtonContent,this.Zn),i},t.prototype.qs=function(t,u,o){var i,a=this;this.Zn.isSlideAnimationEnabled()&&f.h.yi()?(i=function(){var t,i;switch(u){case f.pi.Left:t=f.ClassNameType.AnimateFadeOutLeft,i=f.ClassNameType.AnimateFadeInRight;break;case f.pi.Up:t=f.ClassNameType.AnimateFadeOutUp,i=f.ClassNameType.AnimateFadeInDown;break;case f.pi.Right:t=f.ClassNameType.AnimateFadeOutRight,i=f.ClassNameType.AnimateFadeInLeft;break;case f.pi.Down:t=f.ClassNameType.AnimateFadeOutDown,i=f.ClassNameType.AnimateFadeInUp}function n(t){f.zt.qt(a.Xn,f.ClassNameType.Animated,a.Zn),f.zt.qt(a.Xn,t,a.Zn)}function s(){0<a.As.length?a.As.shift()():a.As=null}var e=a.Xn.className,h=window.setTimeout(function(){r(),o(),s()},150),r=f.h.vt(a.Xn,f.wt.AnimationEnd,function(){window.clearTimeout(h),o(),r(),a.Xn.className=e,n(i),r=f.h.vt(a.Xn,f.wt.AnimationEnd,function(){r(),a.Xn.className=e,s()})});n(t)},this.As?this.As.push(i):(this.As=[],i())):o()},t.prototype.re=function(t){return this.Zn.isMonthShort()?this.Zn.translator.translateMonthShort(t):this.Zn.translator.translateMonth(t)},t.prototype.ee=function(t,i){i=this.Zn.translator.translateTitle(i);""!==i?(t.title=i,this.Zn.isAriaIncluded()&&t.setAttribute("aria-label",i)):(t.removeAttribute("title"),t.removeAttribute("aria-label"))},f.xe=t})(TheDatepicker=TheDatepicker||{}),(n=>{(t=n.TitleName||(n.TitleName={}))[t.GoBack=0]="GoBack",t[t.GoForward=1]="GoForward",t[t.Close=2]="Close",t[t.Reset=3]="Reset",t[t.Deselect=4]="Deselect",t[t.Month=5]="Month",t[t.Year=6]="Year",t[t.GoBackTableOfYears=7]="GoBackTableOfYears",t[t.GoForwardTableOfYears=8]="GoForwardTableOfYears",s.prototype.clone=function(){for(var t=new s,i=0;i<this.X.length;i++)t.X=this.X.slice(0);for(i=0;i<this.V.length;i++)t.V=this.V.slice(0);for(i=0;i<this.$.length;i++)t.$=this.$.slice(0);for(i=0;i<this.tt.length;i++)t.tt=this.tt.slice(0);for(i=0;i<this.Le.length;i++)t.Le=this.Le.slice(0);return t},s.prototype.setDayOfWeekTranslation=function(t,i){this.V[n.h.l("Day of week",t,0,6)]=n.h.v("Translation",i,!0)},s.prototype.setDayOfWeekFullTranslation=function(t,i){this.X[n.h.l("Day of week",t,0,6)]=n.h.v("Translation",i,!0)},s.prototype.setMonthTranslation=function(t,i){this.$[n.h.l("Month",t,0,11)]=n.h.v("Translation",i,!0)},s.prototype.setMonthShortTranslation=function(t,i){this.tt[n.h.l("Month",t,0,11)]=n.h.v("Translation",i,!0)},s.prototype.setTitleTranslation=function(t,i){this.Le[n.h.l("Title",t,0,this.Le.length-1)]=n.h.v("Translation",i)},s.prototype.translateDayOfWeek=function(t){return this.V[t]},s.prototype.translateDayOfWeekFull=function(t){return this.X[t]},s.prototype.translateMonth=function(t){return this.$[t]},s.prototype.translateMonthShort=function(t){return this.tt[t]},s.prototype.translateTitle=function(t){return this.Le[t]};var t=s;function s(){this.X=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.V=["Su","Mo","Tu","We","Th","Fr","Sa"],this.$=["January","February","March","April","May","June","July","August","September","October","November","December"],this.tt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.Le=["Go to previous month","Go to next month","Close calendar","Reset calendar","Deselect date","Month selection","Year selection","Show earlier years","Show later years"]}n.Translator=t})(TheDatepicker=TheDatepicker||{}),(a=>{(t=r=a.pi||(a.pi={}))[t.Left=1]="Left",t[t.Up=2]="Up",t[t.Right=3]="Right",t[t.Down=4]="Down",i.prototype.getPage=function(){return this.page},i.prototype.canShiftPage=function(t){t=this.page+t;return 0<=t&&t<=this.maxPage},i.prototype.shiftPage=function(t){return!!this.canShiftPage(t)&&(this.page+=t,!0)},i.prototype.getFirstYear=function(){return this.lowestYear+this.page*this.cellsCount},i.prototype.getLastYear=function(){return this.lowestYear+this.page*this.cellsCount+this.cellsCount-1},i.prototype.highlightYear=function(t,i){return void 0===i&&(i=!0),!(!this||t===this.highlightedYear||(this.highlightedYear=t,i&&(this.isHighlightedYearFocused=!0),t<this.getFirstYear()&&this.shiftPage(-1),t>this.getLastYear()&&this.shiftPage(1),0))},i.prototype.cancelHighlight=function(){return!!this.highlightedYear&&!(this.highlightedYear=null)};var r,t,f=i;function i(t,i,n,s){this.cellsCount=t,this.lowestYear=i,this.maxPage=n,this.page=s,this.highlightedYear=null,this.isHighlightedYearFocused=!1,this.initialPage=s}function n(t,i){this.Zn=t,this.Ne=i,this.It=null,this.Us=null,this.oe=!1,this.je=null,this.Li=null,this.Ye=null,this.Je=null,this.Ge=null,this.Pe=!1,this.Ue=!1,this.We=new a.xe(this.Zn,i.container,!!i.input)}n.prototype.yt=function(){var t;this.Ne.isDestroyed()||this.ht()||(t=this.Zn.correctMonth(this.St()),this.Ht(null,t))||(this.je||(this.je={rowsCount:this.Zn.getTableOfYearsRowsCount(),columnsCount:this.Zn.getTableOfYearsColumnsCount()}),this.We.yt(this),this.Ne.ut())},n.prototype.ui=function(t,i){if(this.Ue!==i){if(i&&!this.ze(t)||!i&&!this._e(t))return!1;(!(this.Ue=i)&&!this.zs(!1)||i)&&this.Zn.isHiddenOnBlur()&&this.yt(),i?this.Ze(t):this.qe(t)}return!0},n.prototype.kt=function(){return this.Ue},n.prototype.he=function(t){return this.Ne.close(t)},n.prototype.St=function(){return this.Ye||this.Ke(this.Qe()),this.Ye},n.prototype._s=function(t){var i,t=t?1:-1;return this.Us?this.Us.canShiftPage(t):((i=new Date(this.St().getTime())).setMonth(i.getMonth()+t),this.ue(i))},n.prototype.ue=function(t){return!!a.h.ai(t)&&this.Zn.isMonthInValidity(t)},n.prototype.Zs=function(t,i){var n,i=i?1:-1;if(!this.Us)return(n=new Date(this.St().getTime())).setMonth(n.getMonth()+i),this.Ht(t,n);this.Us.shiftPage(i)&&this.yt()},n.prototype.Ht=function(t,i,n){return void 0===n&&(n=!0),(i=a.h.fi(new Date(i.getTime()))).setDate(1),!(i.getTime()===this.St().getTime()||!this.ue(i)||!this.Ve(t,i,this.Ye)||(this.Ke(i),n&&this.Ae(t)||this.yt(),this.Xe(t,i,this.Ye),this.It&&this.Zn.isSelectedDateBoundWithMonth()&&(n=new Date(i.getFullYear(),i.getMonth()+1,0),i=this.Zn.Nn(new Date(i.getFullYear(),i.getMonth(),Math.min(this.It.getDate(),n.getDate())),i,n))&&this.Rt(t,i),0))},n.prototype.Tt=function(t){this.Li=null;var i=this.Ht(t,this.Qe()),t=this.ft(t);return i||t},n.prototype.Rt=function(t,i,n,s,e){var h;return void 0===n&&(n=!0),void 0===s&&(s=!1),void 0===e&&(e=!1),i?(i instanceof a.Day?i=(h=i).getDate():h=this.Bt(i),!!h.isAvailable&&(h.isEqualToDate(this.It)?!(!e||!this.Zn.hasToggleSelection())&&this.Nt(t):(e=this.It?this.Bt(this.It):null,!!this.$e(t,h,e)&&(this.It=h.getDate(),s&&this.Me(t,h),(n=n||this.Zn.isSelectedDateBoundWithMonth())&&this.Ht(t,i)||this.yt(),this.th(t,h,e),!0)))):this.Nt(t)},n.prototype.Ws=function(t){return!!this.Us!==t&&(!t||this.Zn.q().getFullYear()!==this.Zn.K().getFullYear())},n.prototype.zs=function(t){return!!this.Ws(t)&&(this.Us=t?this.ih():null,this.yt(),!0)},n.prototype.Lt=function(t,i){return this.Rt(t,this.Zn.findNearestAvailableDate(i))},n.prototype.ht=function(){try{return this.Rt(null,this.Zn.findPossibleAvailableDate(this.It),!1)}catch(t){if(t instanceof a.AvailableDateNotFoundException)return this.Nt(null,!0);throw t}},n.prototype.ft=function(t){try{return this.Rt(t,this.Zn.getInitialDate(),!1)}catch(t){if(t instanceof a.AvailableDateNotFoundException)return this.Nt(null,!0);throw t}},n.prototype.Me=function(t,i,n,s){if(void 0===n&&(n=!1),void 0===s&&(s=!0),!i.isAvailable)return!1;if(i.isEqualToDay(this.Ge))return!1;var e=this.Ge;if(!this.nh(t,i,e))return!1;this.Ge=i,s&&(this.Pe=!0);s=i.getDate();return n&&this.Ht(t,s,!1)||this.yt(),this.sh(t,i,e),!0},n.prototype.eh=function(t){for(var i=this.Zn.K(),n=this.Bt(new Date(this.St().getTime()));!n.isAvailable;){var s=n.getSibling();if(1===s.dayNumber)break;if(s.getDate().getTime()>i.getTime())break;n=s}return this.Me(t,n)},n.prototype.hh=function(t,i,n){var s;switch(n){case r.Left:s=-1;break;case r.Up:s=-7;break;case r.Right:s=1;break;case r.Down:s=7}for(var e=i,h=1e3;(e=e.getSibling(s)).isInValidity&&(h--,!e.isAvailable)&&0<h;);return this.Me(t,e,!0)},n.prototype.Nt=function(t,i){return void 0===i&&(i=!1),!(!this.Zn.isAllowedEmpty()&&!i||!this.It||(i=this.Bt(this.It),!this.$e(t,null,i))||(this.It=null,this.yt(),this.th(t,null,i),0))},n.prototype.Ae=function(t){var i;return!!this.Ge&&(i=this.Ge,!!this.nh(t,null,i))&&(this.Ge=null,this.yt(),this.sh(t,null,i),!0)},n.prototype.Be=function(t,i){return void 0===i&&(i=!0),!(!this.Us||!this.Us.highlightYear(t,i)||(this.yt(),0))},n.prototype.rh=function(t,i){var n;switch(i){case r.Left:n=-1;break;case r.Up:n=-this.je.columnsCount;break;case r.Right:n=1;break;case r.Down:n=this.je.columnsCount}i=t+n;if(!(i<this.Zn.q().getFullYear()||i>this.Zn.K().getFullYear()))return this.Be(i,!0)},n.prototype.Fe=function(){return this.Us&&this.Us.cancelHighlight()&&this.yt(),!0},n.prototype.be=function(){for(var t=[],i=0;i<7;i++)t.push((this.Zn.getFirstDayOfWeek()+i)%7);return t},n.prototype.ke=function(){for(var t=[],i=this.St(),n=this.uh(),s=0;s<n.prepend.length;s++){var e=this.Bt(n.prepend[s]);t.push(e)}for(var h=new Date(i.getFullYear(),i.getMonth()+1,0).getDate(),r=1;r<=h;r++)t.push(this.Bt(new Date(i.getFullYear(),i.getMonth(),r)));for(s=0;s<n.append.length;s++){e=this.Bt(n.append[s]);t.push(e)}for(var u=[],o=0;o<t.length;o+=7)u.push(t.slice(o,o+7));return this.Pe=!1,u},n.prototype.Ee=function(){if(!this.Us)return[];for(var t=[],i=this.Zn.q().getFullYear(),n=this.Zn.K().getFullYear(),s=this.St().getFullYear(),e=this.Us.getFirstYear(),h=e;h<=e+this.Us.cellsCount;h++){var r=new a.Os(h);n<h||h<i?r.isAvailable=!1:(h===s&&(r.isSelected=!0),h===this.Us.highlightedYear&&(r.isHighlighted=!0,this.Us.isHighlightedYearFocused)&&(r.isFocused=!0)),t.push(r)}for(var u=[],o=0;o<t.length;o+=this.je.columnsCount)u.push(t.slice(o,o+this.je.columnsCount));return this.Us.isHighlightedYearFocused,u},n.prototype.ih=function(){var t=this.Zn.getTableOfYearsAlign(),i=this.Zn.getMinDate(),n=this.Zn.getMaxDate(),s=this.Qe().getFullYear(),e=(t=(t=t===a.Align.Left&&null===i||t===a.Align.Right&&null===n?null:t)||(i&&n?(o=s-i.getFullYear(),n.getFullYear()-s<o?a.Align.Right:a.Align.Left):i?a.Align.Left:n?a.Align.Right:a.Align.Center),this.je.rowsCount*this.je.columnsCount),h=this.Zn.q().getFullYear(),r=this.Zn.K().getFullYear();switch(t){case a.Align.Left:u=h;break;case a.Align.Right:u=h-(e-(r-h)%e-1);break;case a.Align.Center:var u=h-(e-(s+(Math.floor(this.je.rowsCount/2)*this.je.columnsCount+Math.floor(this.je.columnsCount/2))-h)%e-1);break;default:throw new Error("Invalid align: "+t)}var o=this.St().getFullYear(),i=Math.floor((o-u)/e);return new f(e,u,Math.floor((r-u)/e),i)},n.prototype.Xt=function(t){var i;a.h.li([a.ti.Left,a.ti.Up,a.ti.Right,a.ti.Down],t.keyCode)?(a.h.ii(t),i=this.oh(t.keyCode),this.Us?this.Us.highlightedYear?this.rh(this.Us.highlightedYear,i):this.Us.getPage()===this.Us.initialPage?this.rh(this.St().getFullYear(),i):this.Be(0===this.Us.getPage()?this.Us.lowestYear:this.Us.getFirstYear()):this.Ge?this.hh(t,this.Ge,i):this.It&&this.It.getFullYear()===this.St().getFullYear()&&this.It.getMonth()===this.St().getMonth()?this.hh(t,this.Bt(this.It),i):this.eh(t)):t.keyCode===a.ti.Esc&&this.Zn.isClosedOnEscPress()&&(this.Us?(this.oe=!0,this.zs(!1)):this.Ne.close(t))},n.prototype.Bt=function(t){var n=this,i=(t=a.h.fi(new Date(t.getTime())),this.Zn.getToday()),s=this.St(),e=new a.Day(t,function(t){return n.Bt(t)},function(t,i){return a.it.p(t,n.Zn,i=void 0===i?null:i)});if(e.isToday=t.getTime()===i.getTime(),e.isPast=t.getTime()<i.getTime(),e.isInValidity=this.Zn.isDateInValidity(t),e.isAvailable=e.isInValidity&&this.Zn.isDateAvailable(t),e.isInCurrentMonth=t.getMonth()===s.getMonth(),e.isInCurrentMonth)e.isVisible=!0;else if(this.Zn.areDaysOutOfMonthVisible())for(var i=this.uh(),h=i.prepend.concat(i.append),r=0;r<h.length;r++)if(t.getTime()===h[r].getTime()){e.isVisible=!0;break}return e.isAvailable&&(e.isEqualToDate(this.It)&&(e.isSelected=!0),e.isEqualToDay(this.Ge))&&(e.isHighlighted=!0,this.Pe)&&(e.isFocused=!0),this.Zn.modifyDay(e),e},n.prototype.$e=function(i,n,s){var e=this;return this.Zn._n(a.Ii.BeforeSelect,function(t){return t.call(e.Ne,i,n,s)})},n.prototype.th=function(i,n,s){var e=this;this.Zn._n(a.Ii.Select,function(t){return t.call(e.Ne,i,n,s)})},n.prototype.ze=function(i){var n=this;return this.Zn._n(a.Ii.BeforeOpen,function(t){return t.call(n.Ne,i,!0)})},n.prototype.Ze=function(i){var n=this;this.Zn._n(a.Ii.Open,function(t){return t.call(n.Ne,i,!0)})},n.prototype._e=function(i){var n=this;return this.Zn._n(a.Ii.BeforeClose,function(t){return t.call(n.Ne,i,!1)})},n.prototype.qe=function(i){var n=this;this.Zn._n(a.Ii.Close,function(t){return t.call(n.Ne,i,!1)})},n.prototype.Ve=function(i,n,s){var e=this;return this.Zn._n(a.Ii.BeforeMonthChange,function(t){return t.call(e.Ne,i,n,s)})},n.prototype.Xe=function(i,n,s){var e=this;this.Zn._n(a.Ii.MonthChange,function(t){return t.call(e.Ne,i,n,s)})},n.prototype.nh=function(i,n,s){var e=this;return this.Zn._n(a.Ii.BeforeFocus,function(t){return t.call(e.Ne,i,n,s)})},n.prototype.sh=function(i,n,s){var e=this;this.Zn._n(a.Ii.Focus,function(t){return t.call(e.Ne,i,n,s)})},n.prototype.Ke=function(t){this.Ye=t,this.Je=null},n.prototype.uh=function(){if(!this.Je){for(var t=this.St(),i=this.Zn.getFirstDayOfWeek(),n=new Date(t.getFullYear(),t.getMonth(),1),s=new Date(t.getFullYear(),t.getMonth(),0).getDate(),e=(n.getDay()-i+7)%7,h=[],r=s-e+1;r<=s;r++)h.push(new Date(t.getFullYear(),t.getMonth()-1,r));for(var n=new Date(t.getFullYear(),t.getMonth()+1,0),u=6-(n.getDay()-i+7)%7,o=[],r=1;r<=u;r++)o.push(new Date(t.getFullYear(),t.getMonth()+1,r));if(this.Zn.hasFixedRowsCount())for(var a=n.getDate(),r=1+u;e+a+o.length<42;r++)o.push(new Date(t.getFullYear(),t.getMonth()+1,r));this.Je={prepend:h,append:o}}return this.Je},n.prototype.Qe=function(){return this.Li||(this.Li=this.Zn.getInitialMonth()),this.Li},n.prototype.oh=function(t){switch(t){case a.ti.Left:return r.Left;case a.ti.Up:return r.Up;case a.ti.Right:return r.Right;case a.ti.Down:return r.Down;default:throw new Error("Invalid key code: "+t)}},a.oi=n})(TheDatepicker=TheDatepicker||{});