var __extends,Bnet;!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.flatpickr=t()}(this,function(){"use strict";function p(n,t,i){var r;return void 0===i&&(i=!1),function(){var u=this,f=arguments;null!==r&&clearTimeout(r);r=window.setTimeout(function(){r=null;i||n.apply(u,f)},t);i&&!r&&n.apply(u,f)}}function r(n,t,i){return void 0===i&&(i=!0),!1!==i?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}function f(n,t,i){if(!0===i)return n.classList.add(t);n.classList.remove(t)}function n(n,t,i){var r=window.document.createElement(n);return t=t||"",i=i||"",r.className=t,void 0!==i&&(r.textContent=i),r}function d(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function c(t,i){var r=n("div","numInputWrapper"),u=n("input","numInput "+t),e=n("span","arrowUp"),o=n("span","arrowDown"),f;if(u.type="text",u.pattern="\\d*",void 0!==i)for(f in i)u.setAttribute(f,i[f]);return r.appendChild(u),r.appendChild(e),r.appendChild(o),r}function it(e,s){function ui(n){return n.bind(h)}function lt(n){0!==h.selectedDates.length&&(!function(n){var l,t,f,c;n.preventDefault();l="keydown"===n.type;t=n.target;void 0!==h.amPM&&n.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[u(h.amPM.textContent===h.l10n.amPM[0])]);var a=parseFloat(t.getAttribute("data-min")),e=parseFloat(t.getAttribute("data-max")),o=parseFloat(t.getAttribute("data-step")),s=parseInt(t.value,10),v=n.delta||(l?38===n.which?1:-1:0),r=s+o*v;void 0!==t.value&&2===t.value.length&&(f=t===h.hourElement,c=t===h.minuteElement,r<a?(r=e+r+u(!f)+(u(f)&&u(!h.amPM)),c&&pt(void 0,-1,h.hourElement)):e<r&&(r=t===h.hourElement?r-e-u(!h.amPM):a,c&&pt(void 0,1,h.hourElement)),h.amPM&&f&&(1===o?r+s===23:Math.abs(r-s)>o)&&(h.amPM.textContent=h.l10n.amPM[u(h.amPM.textContent===h.l10n.amPM[0])]),t.value=i(r))}(n),"input"!==n.type?(rt(),it()):setTimeout(function(){rt();it()},y))}function rt(){var c,i,f;if(void 0!==h.hourElement&&void 0!==h.minuteElement){var o,s,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,t=(parseInt(h.minuteElement.value,10)||0)%60,e=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(o=n,s=h.amPM.textContent,n=o%12+12*u(s===h.l10n.amPM[1]));c=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===r(h.latestSelectedDateObj,h.config.minDate,!0);(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===r(h.latestSelectedDateObj,h.config.maxDate,!0))&&(i=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate,(n=Math.min(n,i.getHours()))===i.getHours()&&(t=Math.min(t,i.getMinutes())),t===i.getMinutes()&&(e=Math.min(e,i.getSeconds())));c&&(f=void 0!==h.config.minTime?h.config.minTime:h.config.minDate,(n=Math.max(n,f.getHours()))===f.getHours()&&(t=Math.max(t,f.getMinutes())),t===f.getMinutes()&&(e=Math.max(e,f.getSeconds())));at(n,t,e)}}function ut(n){var t=n||h.latestSelectedDateObj;t&&at(t.getHours(),t.getMinutes(),t.getSeconds())}function at(n,t,r){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(n%24,t,r||0,0);h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=i(h.config.time_24hr?n:(12+n)%12+12*u(n%12==0)),h.minuteElement.value=i(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[u(12<=n)]),void 0!==h.secondElement&&(h.secondElement.value=i(r)))}function yi(n){var t=parseInt(n.target.value)+(n.delta||0);4!==t.toString().length&&"Enter"!==n.key||(n.target.blur(),/[^\d]/.test(t.toString())||gt(t))}function l(n,t,i,r){return t instanceof Array?t.forEach(function(t){return l(n,t,i,r)}):n instanceof Array?n.forEach(function(n){return l(n,t,i,r)}):(n.addEventListener(t,i,r),void h._handlers.push({element:n,event:t,handler:i}))}function ft(n){return function(t){1===t.which&&n(t)}}function vt(){g("onChange")}function yt(n){var t=void 0!==n?h.parseDate(n):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate<h.now?h.config.maxDate:h.now);try{void 0!==t&&(h.currentYear=t.getFullYear(),h.currentMonth=t.getMonth())}catch(n){n.message="Invalid date supplied: "+t;h.config.errorHandler(n)}h.redraw()}function pi(n){~n.target.className.indexOf("arrow")&&pt(n,n.target.classList.contains("arrowUp")?1:-1)}function pt(n,t,i){var r=n&&n.target,u=i||r&&r.parentNode&&r.parentNode.firstChild,f=ii("increment");f.delta=t;u&&u.dispatchEvent(f)}function wt(t,i,u,e){var s,c=et(i,!0),o=n("span","flatpickr-day "+t,i.getDate().toString());return o.dateObj=i,o.$i=e,o.setAttribute("aria-label",h.formatDate(i,h.config.ariaDateFormat)),0===r(i,h.now)&&(h.todayDateElem=o).classList.add("today"),c?(o.tabIndex=-1,ri(i)&&(o.classList.add("selected"),h.selectedDateElem=o,"range"===h.config.mode&&(f(o,"startRange",h.selectedDates[0]&&0===r(i,h.selectedDates[0],!0)),f(o,"endRange",h.selectedDates[1]&&0===r(i,h.selectedDates[1],!0)),"nextMonthDay"===t&&o.classList.add("inRange")))):o.classList.add("disabled"),"range"===h.config.mode&&(s=i,!("range"!==h.config.mode||h.selectedDates.length<2)&&0<=r(s,h.selectedDates[0])&&r(s,h.selectedDates[1])<=0&&!ri(i)&&o.classList.add("inRange")),h.weekNumbers&&"prevMonthDay"!==t&&u%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+h.config.getWeek(i)+"<\/span>"),g("onDayCreate",o),o}function ot(n,t){var r=((void 0!==n?n:document.activeElement.$i)||0)+t||0,i=Array.prototype.find.call(h.days.children,function(n,t){return r<=t&&-1===n.className.indexOf("MonthDay")&&et(n.dateObj)});void 0!==i&&(i.focus(),"range"===h.config.mode&&ni(i))}function wi(t,i){for(var f,s,c=(new Date(t,i,1).getDay()-h.l10n.firstDayOfWeek+7)%7,l=h.utils.getDaysInMonth((i- -11)%12),o=h.utils.getDaysInMonth(i),e=window.document.createDocumentFragment(),r=l+1-c,u=0;r<=l;r++,u++)e.appendChild(wt("prevMonthDay",new Date(t,i-1,r),r,u));for(r=1;r<=o;r++,u++)e.appendChild(wt("",new Date(t,i,r),r,u));for(f=o+1;f<=42-c&&(1===h.config.showMonths||u%7!=0);f++,u++)e.appendChild(wt("nextMonthDay",new Date(t,i+1,f%o),f,u));return s=n("div","dayContainer"),s.appendChild(e),s}function st(){var i,n,t;if(void 0!==h.daysContainer){for(d(h.daysContainer),h.weekNumbers&&h.weekNumbers.firstChild&&d(h.weekNumbers),i=document.createDocumentFragment(),n=0;n<h.config.showMonths;n++)t=new Date(h.currentYear,h.currentMonth,1),t.setMonth(h.currentMonth+n),i.appendChild(wi(t.getFullYear(),t.getMonth()));h.daysContainer.appendChild(i);h.days=h.daysContainer.firstChild}}function bi(){var f=n("div","flatpickr-month"),e=window.document.createDocumentFragment(),r=n("span","cur-month"),u,t,i;return r.title=h.l10n.scrollTitle,u=c("cur-year",{tabindex:"-1"}),t=u.childNodes[0],t.title=h.l10n.scrollTitle,t.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&t.setAttribute("data-min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(t.setAttribute("data-max",h.config.maxDate.getFullYear().toString()),t.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear()),i=n("div","flatpickr-current-month"),i.appendChild(r),i.appendChild(u),e.appendChild(i),f.appendChild(e),{container:f,yearElement:t,monthElement:r}}function fi(){var t=h.l10n.firstDayOfWeek,n=h.l10n.weekdays.shorthand.concat(),i;for(0<t&&t<n.length&&(n=n.splice(t,n.length).concat(n.splice(0,t))),i=h.config.showMonths;i--;)h.weekdayContainer.children[i].innerHTML="\n      <span class=flatpickr-weekday>\n        "+n.join("<\/span><span class=flatpickr-weekday>")+"\n      <\/span>\n      "}function bt(n,t,i){void 0===t&&(t=!0);void 0===i&&(i=!1);var r=t?n:n-h.currentMonth;r<0&&!0===h._hidePrevMonthArrow||0<r&&!0===h._hideNextMonthArrow||(h.currentMonth+=r,(h.currentMonth<0||11<h.currentMonth)&&(h.currentYear+=11<h.currentMonth?1:-1,h.currentMonth=(h.currentMonth+12)%12,g("onYearChange")),st(),g("onMonthChange"),ct(),!0===i&&ot(void 0,0))}function kt(n){return!(!h.config.appendTo||!h.config.appendTo.contains(n))||h.calendarContainer.contains(n)}function dt(n){if(h.isOpen&&!h.config.inline){var i=kt(n.target),t=n.target===h.input||n.target===h.altInput||h.element.contains(n.target)||n.path&&n.path.indexOf&&(~n.path.indexOf(h.input)||~n.path.indexOf(h.altInput)),r="blur"===n.type?t&&n.relatedTarget&&!kt(n.relatedTarget):!t&&!i,u=!h.config.ignoredFocusElements.some(function(t){return t.contains(n.target)});r&&u&&(h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}}function gt(n){if(!(!n||h.config.minDate&&n<h.config.minDate.getFullYear()||h.config.maxDate&&n>h.config.maxDate.getFullYear())){var t=n,i=h.currentYear!==t;h.currentYear=t||h.currentYear;h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth));i&&(h.redraw(),g("onYearChange"))}}function et(n,t){var i,o;if(void 0===t&&(t=!0),i=h.parseDate(n,void 0,t),h.config.minDate&&i&&r(i,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&i&&0<r(i,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime))return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===i)return!1;for(var u,f=0<h.config.enable.length,s=f?h.config.enable:h.config.disable,e=0;e<s.length;e++){if("function"==typeof(u=s[e])&&u(i)||u instanceof Date&&void 0!==i&&u.getTime()===i.getTime())return f;if("string"==typeof u&&void 0!==i)return o=h.parseDate(u,void 0,!0),o&&o.getTime()===i.getTime()?f:!f;if("object"==typeof u&&void 0!==i&&u.from&&u.to&&i.getTime()>=u.from.getTime()&&i.getTime()<=u.to.getTime())return f}return!f}function ei(n){var t=n.target===h._input,e=kt(n.target),r=h.config.allowInput,o=h.isOpen&&(!r||!t),s=h.config.inline&&t&&!r,i,u,f;if(13===n.keyCode&&t){if(r)return h.setDate(h._input.value,!0,n.target===h.altInput?h.config.altFormat:h.config.dateFormat),n.target.blur();h.open()}else if(e||o||s){i=!!h.timeContainer&&h.timeContainer.contains(n.target);switch(n.keyCode){case 13:i?it():li(n);break;case 27:n.preventDefault();ci();break;case 8:case 46:t&&!h.config.allowInput&&(n.preventDefault(),h.clear());break;case 37:case 39:i?h.hourElement&&h.hourElement.focus():(n.preventDefault(),h.daysContainer)&&(u=t?0:39===n.keyCode?1:-1,n.ctrlKey?bt(u,!0,!0):ot(void 0,u));break;case 38:case 40:n.preventDefault();f=40===n.keyCode?1:-1;h.daysContainer&&void 0!==n.target.$i?n.ctrlKey?(gt(h.currentYear-f),ot(n.target.$i,0)):i||ot(n.target.$i,7*f):h.config.enableTime&&(!i&&h.hourElement&&h.hourElement.focus(),lt(n),h._debouncedChange());break;case 9:n.target===h.hourElement?(n.preventDefault(),h.minuteElement.select()):n.target===h.minuteElement&&(h.secondElement||h.amPM)?(n.preventDefault(),void 0!==h.secondElement?h.secondElement.focus():void 0!==h.amPM&&h.amPM.focus()):n.target===h.secondElement&&h.amPM&&(n.preventDefault(),h.amPM.focus())}switch(n.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():void 0!==h.amPM&&n.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[0],rt(),it());break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():void 0!==h.amPM&&n.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[1],rt(),it())}g("onKeyDown",n)}}function ni(n){var e;if(1===h.selectedDates.length&&n.classList.contains("flatpickr-day")&&!n.classList.contains("disabled")){for(var u=n.dateObj.getTime(),i=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),v=Math.min(u,h.selectedDates[0].getTime()),y=Math.max(u,h.selectedDates[0].getTime()),o=h.daysContainer.children,p=o[0].children[0].dateObj.getTime(),w=o[o.length-1].lastChild.dateObj.getTime(),s=!1,f=0,r=0,t=p;t<w;t+=tt.DAY)et(new Date(t),!0)||(s=s||v<t&&t<y,t<i&&(!f||f<t)?f=t:i<t&&(!r||t<r)&&(r=t));for(e=0;e<h.config.showMonths;e++)for(var c=h.daysContainer.children[e],a=h.daysContainer.children[e-1],b=function(t){var l=c.children[t],o=l.dateObj.getTime(),v=0<f&&o<f||0<r&&r<o;return v?(l.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(n){l.classList.remove(n)}),"continue"):s&&!v?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(n){l.classList.remove(n)}),n.classList.add(u<h.selectedDates[0].getTime()?"startRange":"endRange"),void(!c.contains(n)&&0<e&&a&&a.lastChild.dateObj.getTime()>=o||(i<u&&o===i?l.classList.add("startRange"):u<i&&o===i&&l.classList.add("endRange"),f<=o&&(0===r||o<=r)&&nt(o,i,u)&&l.classList.add("inRange"))))},l=0,k=c.children.length;l<k;l++)b(l)}}function ki(){!h.isOpen||h.config.static||h.config.inline||ht()}function oi(n){return function(t){var i=h.config["_"+n+"Date"]=h.parseDate(t,h.config.dateFormat),r=h.config["_"+("min"===n?"max":"min")+"Date"];void 0!==i&&(h["min"===n?"minDateHasTime":"maxDateHasTime"]=0<i.getHours()||0<i.getMinutes()||0<i.getSeconds());h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(n){return et(n)}),h.selectedDates.length||"min"!==n||ut(i),it());h.daysContainer&&(hi(),void 0!==i?h.currentYearElement[n]=i.getFullYear().toString():h.currentYearElement.removeAttribute(n),h.currentYearElement.disabled=!!r&&void 0!==i&&r.getFullYear()===i.getFullYear())}}function si(){"object"!=typeof h.config.locale&&void 0===t.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale));h.l10n=Object.assign({},t.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?t.l10ns[h.config.locale]:void 0);v.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")";h.formatDate=b(h)}function ht(n){if(void 0!==h.calendarContainer){g("onPreCalendarPosition");var u=n||h._positionElement,i=Array.prototype.reduce.call(h.calendarContainer.children,function(n,t){return n+t.offsetHeight},0),c=h.calendarContainer.offsetWidth,e=h.config.position,t=u.getBoundingClientRect(),l=window.innerHeight-t.bottom,r="above"===e||"below"!==e&&l<i&&t.top>i,a=window.pageYOffset+t.top+(r?-i-2:u.offsetHeight+2);if(f(h.calendarContainer,"arrowTop",!r),f(h.calendarContainer,"arrowBottom",r),!h.config.inline){var o=window.pageXOffset+t.left,v=window.document.body.offsetWidth-t.right,s=o+c>window.document.body.offsetWidth;f(h.calendarContainer,"rightMost",s);h.config.static||(h.calendarContainer.style.top=a+"px",s?(h.calendarContainer.style.left="auto",h.calendarContainer.style.right=v+"px"):(h.calendarContainer.style.left=o+"px",h.calendarContainer.style.right="auto"))}}}function hi(){h.config.noCalendar||h.isMobile||(fi(),ct(),st())}function ci(){h._input.focus();-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function li(n){var u,f,o,s,c;if(n.preventDefault(),n.stopPropagation(),u=function n(t,i){return i(t)?t:t.parentNode?n(t.parentNode,i):void 0}(n.target,function(n){return n.classList&&n.classList.contains("flatpickr-day")&&!n.classList.contains("disabled")&&!n.classList.contains("notAllowed")}),void 0!==u){var i=u,t=h.latestSelectedDateObj=new Date(i.dateObj.getTime()),e=t.getMonth()!==h.currentMonth&&"range"!==h.config.mode;(h.selectedDateElem=i,"single"===h.config.mode)?h.selectedDates=[t]:"multiple"===h.config.mode?(f=ri(t),f?h.selectedDates.splice(parseInt(f),1):h.selectedDates.push(t)):"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1),h.selectedDates.push(t),0!==r(t,h.selectedDates[0],!0)&&h.selectedDates.sort(function(n,t){return n.getTime()-t.getTime()}));(rt(),e)&&(o=h.currentYear!==t.getFullYear(),h.currentYear=t.getFullYear(),h.currentMonth=t.getMonth(),o&&g("onYearChange"),g("onMonthChange"));(st(),h.config.minDate&&h.minDateHasTime&&h.config.enableTime&&0===r(t,h.config.minDate)&&ut(h.config.minDate),it(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),"range"===h.config.mode&&(1===h.selectedDates.length?ni(i):ct()),e||"range"===h.config.mode?h.selectedDateElem&&h.selectedDateElem.focus():ot(i.$i,0),void 0!==h.hourElement&&setTimeout(function(){return void 0!==h.hourElement&&h.hourElement.select()},451),h.config.closeOnSelect)&&(s="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime,(s||c)&&ci());vt()}}function ai(n,t){var i=[];if(n instanceof Array)i=n.map(function(n){return h.parseDate(n,t)});else if(n instanceof Date||"number"==typeof n)i=[h.parseDate(n,t)];else if("string"==typeof n)switch(h.config.mode){case"single":i=[h.parseDate(n,t)];break;case"multiple":i=n.split(h.config.conjunction).map(function(n){return h.parseDate(n,t)});break;case"range":i=n.split(h.l10n.rangeSeparator).map(function(n){return h.parseDate(n,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));h.selectedDates=i.filter(function(n){return n instanceof Date&&et(n,!1)});"range"===h.config.mode&&h.selectedDates.sort(function(n,t){return n.getTime()-t.getTime()})}function vi(n){return n.map(function(n){return"string"==typeof n||"number"==typeof n||n instanceof Date?h.parseDate(n,void 0,!0):n&&"object"==typeof n&&n.from&&n.to?{from:h.parseDate(n.from,void 0),to:h.parseDate(n.to,void 0)}:n}).filter(function(n){return n})}function g(n,t){var i=h.config[n],r;if(void 0!==i&&0<i.length)for(r=0;i[r]&&r<i.length;r++)i[r](h.selectedDates,h.input.value,h,t);"onChange"===n&&(h.input.dispatchEvent(ii("change")),h.input.dispatchEvent(ii("input")))}function ii(n){var t=document.createEvent("Event");return t.initEvent(n,!0,!0),t}function ri(n){for(var t=0;t<h.selectedDates.length;t++)if(0===r(h.selectedDates[t],n))return""+t;return!1}function ct(){h.config.noCalendar||h.isMobile||!h.monthNav||(h.yearElements.forEach(function(n,t){var i=new Date(h.currentYear,h.currentMonth,1);i.setMonth(h.currentMonth+t);h.monthElements[t].textContent=a(i.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ";n.value=i.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYear<h.config.minDate.getFullYear()),h._hideNextMonthArrow=void 0!==h.config.maxDate&&(h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth+1>h.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function it(n){if(void 0===n&&(n=!0),0===h.selectedDates.length)return h.clear(n);void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):"");var t="range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator;h.input.value=h.selectedDates.map(function(n){return h.formatDate(n,h.config.dateFormat)}).join(t);void 0!==h.altInput&&(h.altInput.value=h.selectedDates.map(function(n){return h.formatDate(n,h.config.altFormat)}).join(t));!1!==n&&g("onValueUpdate")}function di(n){var t=h.prevMonthNav.contains(n.target),i=h.nextMonthNav.contains(n.target);t||i?bt(t?-1:1):0<=h.yearElements.indexOf(n.target)?(n.preventDefault(),n.target.select()):n.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):n.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}var h={config:Object.assign({},t.defaultConfig),l10n:o},ti;return h.parseDate=k({config:h.config,l10n:h.l10n}),h._handlers=[],h._bind=l,h._setHoursFromDate=ut,h.changeMonth=bt,h.changeYear=gt,h.clear=function(n){void 0===n&&(n=!0);h.input.value="";void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[];h.latestSelectedDateObj=void 0;!(h.showTimeInput=!1)===h.config.enableTime&&(void 0!==h.config.minDate?ut(h.config.minDate):at(h.config.defaultHour,h.config.defaultMinute,h.config.defaultSeconds));h.redraw();n&&g("onChange")},h.close=function(){h.isOpen=!1;h.isMobile||(h.calendarContainer.classList.remove("open"),h._input.classList.remove("active"));g("onClose")},h._createElement=n,h.destroy=function(){var t,n;for(void 0!==h.config&&g("onDestroy"),t=h._handlers.length;t--;)n=h._handlers[t],n.element.removeEventListener(n.event,n.handler);h._handlers=[];h.mobileInput?(h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0):h.calendarContainer&&h.calendarContainer.parentNode&&h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(n){try{delete h[n]}catch(n){}})},h.isEnabled=et,h.jumpToDate=yt,h.open=function(n,t){if(void 0===t&&(t=h._input),!0===h.isMobile)return n&&(n.preventDefault(),n.target&&n.target.blur()),setTimeout(function(){void 0!==h.mobileInput&&h.mobileInput.click()},0),void g("onOpen");if(!h._input.disabled&&!h.config.inline){var i=h.isOpen;h.isOpen=!0;i||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),g("onOpen"),ht(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&(h.setDate(void 0!==h.config.minDate?new Date(h.config.minDate.getTime()):(new Date).setHours(h.config.defaultHour,h.config.defaultMinute,h.config.defaultSeconds,0),!1),rt(),it()),setTimeout(function(){return h.hourElement.select()},50))}},h.redraw=hi,h.set=function(n,t){null!==n&&"object"==typeof n?Object.assign(h.config,n):(h.config[n]=t,void 0!==ti[n]&&ti[n].forEach(function(n){return n()}));h.redraw();yt()},h.setDate=function(n,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=h.config.dateFormat),0!==n&&!n)return h.clear(t);ai(n,i);h.showTimeInput=0<h.selectedDates.length;h.latestSelectedDateObj=h.selectedDates[0];h.redraw();yt();ut();it(t);t&&g("onChange")},h.toggle=function(){if(h.isOpen)return h.close();h.open()},ti={locale:[si]},function(){var r,o;(h.element=h.input=e,h.isOpen=!1,function(){var o=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],u=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n=Object.assign({},s,JSON.parse(JSON.stringify(e.dataset||{}))),a={},v,r,f,c,l,i;for(h.config.parseDate=n.parseDate,h.config.formatDate=n.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(n){h.config._enable=vi(n)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(n){h.config._disable=vi(n)}}),!n.dateFormat&&n.enableTime&&(a.dateFormat=n.noCalendar?"H:i"+(n.enableSeconds?":S":""):t.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&n.enableTime&&!n.altFormat&&(a.altFormat=n.noCalendar?"h:i"+(n.enableSeconds?":S K":" K"):t.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:oi("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:oi("max")}),v=function(n){return function(t){h.config["min"===n?"_minTime":"_maxTime"]=h.parseDate(t,"H:i")}},Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:v("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:v("max")}),Object.assign(h.config,a,n),r=0;r<o.length;r++)h.config[o[r]]=!0===h.config[o[r]]||"true"===h.config[o[r]];for(f=u.length;f--;)void 0!==h.config[u[f]]&&(h.config[u[f]]=w(h.config[u[f]]||[]).map(ui));for("time"===h.config.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),c=0;c<h.config.plugins.length;c++){l=h.config.plugins[c](h)||{};for(i in l)~u.indexOf(i)?h.config[i]=w(l[i]).map(ui).concat(h.config[i]):void 0===n[i]&&(h.config[i]=l[i])}h.isMobile=!h.config.disableMobile&&!h.config.inline&&"single"===h.config.mode&&!h.config.disable.length&&!h.config.enable.length&&!h.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);g("onParseConfig")}(),si(),function(){if(h.input=h.config.wrap?e.querySelector("[data-input]"):e,!h.input)return h.config.errorHandler(new Error("Invalid input element specified"));h.input._type=h.input.type;h.input.type="text";h.input.classList.add("flatpickr-input");h._input=h.input;h.config.altInput&&(h.altInput=n(h.input.nodeName,h.input.className+" "+h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.type="hidden",!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling));h.config.allowInput||h._input.setAttribute("readonly","readonly");h._positionElement=h.config.positionElement||h._input}(),function(){var n,t;h.selectedDates=[];h.now=h.parseDate(h.config.now)||new Date;n=h.config.defaultDate||h.input.value;n&&ai(n,h.config.dateFormat);t=0<h.selectedDates.length?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()<h.now.getTime()?h.config.maxDate:h.now;h.currentYear=t.getFullYear();h.currentMonth=t.getMonth();0<h.selectedDates.length&&(h.latestSelectedDateObj=h.selectedDates[0]);void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i"));void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i"));h.minDateHasTime=!!h.config.minDate&&(0<h.config.minDate.getHours()||0<h.config.minDate.getMinutes()||0<h.config.minDate.getSeconds());h.maxDateHasTime=!!h.config.maxDate&&(0<h.config.maxDate.getHours()||0<h.config.maxDate.getMinutes()||0<h.config.maxDate.getSeconds());Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(n){h._showTimeInput=n;h.calendarContainer&&f(h.calendarContainer,"showTimeInput",n);h.isOpen&&ht()}})}(),h.utils={getDaysInMonth:function(n,t){return void 0===n&&(n=h.currentMonth),void 0===t&&(t=h.currentYear),1===n&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[n]}},h.isMobile||function(){var r=window.document.createDocumentFragment(),s,t;if(h.calendarContainer=n("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(r.appendChild(function(){var i,t;for(h.monthNav=n("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=n("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=n("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,h.monthNav.appendChild(h.prevMonthNav),i=h.config.showMonths;i--;)t=bi(),h.yearElements.push(t.yearElement),h.monthElements.push(t.monthElement),h.monthNav.appendChild(t.container);return h.monthNav.appendChild(h.nextMonthNav),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(n){h.__hidePrevMonthArrow!==n&&(f(h.prevMonthNav,"disabled",n),h.__hidePrevMonthArrow=n)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(n){h.__hideNextMonthArrow!==n&&(f(h.nextMonthNav,"disabled",n),h.__hideNextMonthArrow=n)}}),h.currentYearElement=h.yearElements[0],ct(),h.monthNav}()),h.innerContainer=n("div","flatpickr-innerContainer"),h.config.weekNumbers){var e=function(){var t,i;return h.calendarContainer.classList.add("hasWeeks"),t=n("div","flatpickr-weekwrapper"),t.appendChild(n("span","flatpickr-weekday",h.l10n.weekAbbreviation)),i=n("div","flatpickr-weeks"),t.appendChild(i),{weekWrapper:t,weekNumbers:i}}(),o=e.weekWrapper,l=e.weekNumbers;h.innerContainer.appendChild(o);h.weekNumbers=l;h.weekWrapper=o}h.rContainer=n("div","flatpickr-rContainer");h.rContainer.appendChild(function(){var t,i;for(h.weekdayContainer||(h.weekdayContainer=n("div","flatpickr-weekdays")),t=h.config.showMonths;t--;)i=n("div","flatpickr-weekdaycontainer"),h.weekdayContainer.appendChild(i);return fi(),h.weekdayContainer}());h.daysContainer||(h.daysContainer=n("div","flatpickr-days"),h.daysContainer.tabIndex=-1);st();h.rContainer.appendChild(h.daysContainer);h.innerContainer.appendChild(h.rContainer);r.appendChild(h.innerContainer)}h.config.enableTime&&r.appendChild(function(){var e,t,r,f;return h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=n("div","flatpickr-time"),h.timeContainer.tabIndex=-1,e=n("span","flatpickr-time-separator",":"),t=c("flatpickr-hour"),h.hourElement=t.childNodes[0],r=c("flatpickr-minute"),(h.minuteElement=r.childNodes[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(n){switch(n%24){case 0:case 12:return 12;default:return n%12}}(h.config.defaultHour)),h.minuteElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("data-step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("data-step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("data-min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("data-max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("data-min","0"),h.minuteElement.setAttribute("data-max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(r),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds)&&(h.timeContainer.classList.add("hasSeconds"),f=c("flatpickr-second"),h.secondElement=f.childNodes[0],h.secondElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("data-step",h.minuteElement.getAttribute("data-step")),h.secondElement.setAttribute("data-min",h.minuteElement.getAttribute("data-min")),h.secondElement.setAttribute("data-max",h.minuteElement.getAttribute("data-max")),h.timeContainer.appendChild(n("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(f)),h.config.time_24hr||(h.amPM=n("span","flatpickr-am-pm",h.l10n.amPM[u(11<(h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour))]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}());f(h.calendarContainer,"rangeMode","range"===h.config.mode);f(h.calendarContainer,"animate",!0===h.config.animate);f(h.calendarContainer,"multiMonth",1<h.config.showMonths);h.calendarContainer.appendChild(r);s=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;(h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!s&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)&&(t=n("div","flatpickr-wrapper"),h.element.parentNode&&h.element.parentNode.insertBefore(t,h.element),t.appendChild(h.element),h.altInput&&t.appendChild(h.altInput),t.appendChild(h.calendarContainer));h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(n){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+n+"]"),function(t){return l(t,"click",h[n])})}),h.isMobile)return function(){var t=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=n("input",h.input.className+" flatpickr-mobile");h.mobileInput.step=h.input.getAttribute("step")||"any";h.mobileInput.tabIndex=1;h.mobileInput.type=t;h.mobileInput.disabled=h.input.disabled;h.mobileInput.required=h.input.required;h.mobileInput.placeholder=h.input.placeholder;h.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S";0<h.selectedDates.length&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr));h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d"));h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d"));h.input.type="hidden";void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(t){}l(h.mobileInput,"change",function(n){h.setDate(n.target.value,!1,h.mobileFormatStr);g("onChange");g("onClose")})}();var t=p(ki,50);h._debouncedChange=p(vt,y);h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&l(h.daysContainer,"mouseover",function(n){"range"===h.config.mode&&ni(n.target)});l(window.document.body,"keydown",ei);h.config.static||l(h._input,"keydown",ei);h.config.inline||h.config.static||l(window,"resize",t);void 0!==window.ontouchstart&&l(window.document,"touchstart",dt);l(window.document,"mousedown",ft(dt));l(window.document,"focus",dt,{capture:!0});!0===h.config.clickOpens&&(l(h._input,"focus",h.open),l(h._input,"mousedown",ft(h.open)));void 0!==h.daysContainer&&(l(h.monthNav,"mousedown",ft(di)),l(h.monthNav,["keyup","increment"],yi),l(h.daysContainer,"mousedown",ft(li)));void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(l(h.timeContainer,["input","increment"],lt),l(h.timeContainer,"mousedown",ft(pi)),l(h.timeContainer,["input","increment"],h._debouncedChange,{passive:!0}),l([h.hourElement,h.minuteElement],["focus","click"],function(n){return n.target.select()}),void 0!==h.secondElement&&l(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&l(h.amPM,"mousedown",ft(function(n){lt(n);vt()})))}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&ut(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),it(!1)),h.showTimeInput=0<h.selectedDates.length||h.config.noCalendar,void 0!==h.daysContainer)&&(h.calendarContainer.style.visibility="hidden",h.calendarContainer.style.display="block",r=(h.calendarContainer.clientWidth+1)*h.config.showMonths+"px",h.daysContainer.style.width=r,h.calendarContainer.style.width=r,void 0!==h.weekWrapper&&(h.calendarContainer.style.width=r+h.weekWrapper.offsetWidth+"px"),h.calendarContainer.style.visibility="visible",h.calendarContainer.style.display=null);o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&o&&ht();g("onReady")}(),h}function s(n,t){for(var i,f=Array.prototype.slice.call(n),r=[],u=0;u<f.length;u++){i=f[u];try{if(null!==i.getAttribute("data-fp-omit"))continue;void 0!==i._flatpickr&&(i._flatpickr.destroy(),i._flatpickr=void 0);i._flatpickr=it(i,t||{});r.push(i._flatpickr)}catch(n){console.error(n)}}return 1===r.length?r[0]:r}var i=function(n){return("0"+n).slice(-2)},u=function(n){return!0===n?1:0},w=function(n){return n instanceof Array?n:[n]},l=function(){},a=function(n,t,i){return i.months[t?"shorthand":"longhand"][n]},g={D:l,F:function(n,t,i){n.setMonth(i.months.longhand.indexOf(t))},G:function(n,t){n.setHours(parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,i){n.setHours(n.getHours()%12+12*u(new RegExp(i.amPM[1],"i").test(t)))},M:function(n,t,i){n.setMonth(i.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(1e3*parseFloat(t))},W:function(n,t){var i=parseInt(t);return new Date(n.getFullYear(),0,2+7*(i-1),0,0,0,0)},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours(parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:l,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},w:l,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},v={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",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:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},e={Z:function(n){return n.toISOString()},D:function(n,t,i){return t.weekdays.shorthand[e.w(n,t,i)]},F:function(n,t,i){return a(e.n(n,t,i)-1,!1,t)},G:function(n,t,r){return i(e.h(n,t,r))},H:function(n){return i(n.getHours())},J:function(n,t){return void 0!==t.ordinal?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[u(11<n.getHours())]},M:function(n,t){return a(n.getMonth(),!0,t)},S:function(n){return i(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,i){return i.getWeek(n)},Y:function(n){return n.getFullYear()},d:function(n){return i(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return i(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return i(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},o={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(n){var t=n%100;if(3<t&&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"},b=function(n){var i=n.config,t=void 0===i?h:i,r=n.l10n,u=void 0===r?o:r;return function(n,i,r){if(void 0!==t.formatDate)return t.formatDate(n,i);var f=r||u;return i.split("").map(function(i,r,u){return e[i]&&"\\"!==u[r-1]?e[i](n,f,t):"\\"!==i?i:""}).join("")}},k=function(n){var i=n.config,t=void 0===i?h:i,r=n.l10n,u=void 0===r?o:r;return function(n,i,r){var f,y,e,s,a;if(0===n||n){if(y=n,n instanceof Date)f=new Date(n.getTime());else if("string"!=typeof n&&void 0!==n.toFixed)f=new Date(n);else if("string"==typeof n)if(e=i||(t||h).dateFormat,s=String(n).trim(),"today"===s)f=new Date,r=!0;else if(/Z$/.test(s)||/GMT$/.test(s))f=new Date(n);else if(t&&t.parseDate)f=t.parseDate(n,e);else{f=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var p,w=[],c=0,k=0,l="";c<e.length;c++){var o=e[c],b="\\"===o,d="\\"===e[c-1]||b;v[o]&&!d?(l+=v[o],a=new RegExp(l).exec(n),a&&(p=!0)&&w["Y"!==o?"push":"unshift"]({fn:g[o],val:a[++k]})):b||(l+=".");w.forEach(function(n){var t=n.fn,i=n.val;return f=t(f,i,u)||f})}f=p?f:void 0}if(f instanceof Date)return!0===r&&f.setHours(0,0,0,0),f;t.errorHandler(new Error("Invalid date provided: "+y))}}},nt=function(n,t,i){return n>Math.min(t,i)&&n<Math.max(t,i)},tt={DAY:864e5},h={_disable:[],_enable:[],allowInput:!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",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:console.warn,getWeek:function(n){var t=new Date(n.getTime()),i;return t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7),i=new Date(t.getFullYear(),0,4),1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",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},y,t;return"function"!=typeof Object.assign&&(Object.assign=function(n){var f,i;if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=arguments.length,u=new Array(1<r?r-1:0),t=1;t<r;t++)u[t-1]=arguments[t];for(f=function(t){t&&Object.keys(t).forEach(function(i){return n[i]=t[i]})},i=0;i<u.length;i++)f(u[i]);return n}),y=300,"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return s(this,n)},HTMLElement.prototype.flatpickr=function(n){return s([this],n)}),t=function(n,t){return n instanceof NodeList?s(n,t):s("string"==typeof n?window.document.querySelectorAll(n):[n],t)},t.defaultConfig=h,t.l10ns={en:Object.assign({},o),"default":Object.assign({},o)},t.localize=function(n){t.l10ns.default=Object.assign({},t.l10ns.default,n)},t.setDefaults=function(n){t.defaultConfig=Object.assign({},t.defaultConfig,n)},t.parseDate=k({}),t.formatDate=b({}),t.compareDates=r,"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(n){return s(this,n)}),Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof n?parseInt(n,10):n))},t}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.de={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["So","Mo","Di","Mi","Do","Fr","Sa"],longhand:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},months:{shorthand:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],longhand:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},firstDayOfWeek:1,weekAbbreviation:"KW",rangeSeparator:" bis ",scrollTitle:"Zum Ändern scrollen",toggleTitle:"Zum Umschalten klicken"},r;t.l10ns.de=i;r=t.l10ns;n.German=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.es={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],longhand:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},months:{shorthand:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],longhand:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},ordinal:function(){return"º"},firstDayOfWeek:1},r;t.l10ns.es=i;r=t.l10ns;n.Spanish=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.fr={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={firstDayOfWeek:1,weekdays:{shorthand:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],longhand:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"]},months:{shorthand:["Janv","Févr","Mars","Avr","Mai","Juin","Juil","Août","Sept","Oct","Nov","Déc"],longhand:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]},ordinal:function(n){return n>1?"ème":"er"},rangeSeparator:" au ",weekAbbreviation:"Sem",scrollTitle:"Défiler pour augmenter la valeur",toggleTitle:"Cliquer pour basculer"},r;t.l10ns.fr=i;r=t.l10ns;n.French=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.it={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],longhand:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},months:{shorthand:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],longhand:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},firstDayOfWeek:1,ordinal:function(){return"°"},rangeSeparator:" al ",weekAbbreviation:"Se",scrollTitle:"Scrolla per aumentare",toggleTitle:"Clicca per cambiare"},r;t.l10ns.it=i;r=t.l10ns;n.Italian=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.ja={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["日","月","火","水","木","金","土"],longhand:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},months:{shorthand:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],longhand:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]}},r;t.l10ns.ja=i;r=t.l10ns;n.Japanese=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t({})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["일","월","화","수","목","금","토"],longhand:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},months:{shorthand:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],longhand:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},ordinal:function(){return"일"}},r;t.l10ns.ko=i;r=t.l10ns;n.Korean=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.pl={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Nd","Pn","Wt","Śr","Cz","Pt","So"],longhand:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"]},months:{shorthand:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],longhand:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"]},firstDayOfWeek:1,ordinal:function(){return"."}},r;t.l10ns.pl=i;r=t.l10ns;n.Polish=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.pt={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],longhand:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"]},months:{shorthand:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],longhand:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},rangeSeparator:" até "},r;t.l10ns.pt=i;r=t.l10ns;n.Portuguese=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.ru={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],longhand:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"]},months:{shorthand:["Янв","Фев","Март","Апр","Май","Июнь","Июль","Авг","Сен","Окт","Ноя","Дек"],longhand:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"]},firstDayOfWeek:1,ordinal:function(){return""},rangeSeparator:" — ",weekAbbreviation:"Нед.",scrollTitle:"Прокрутите для увеличения",toggleTitle:"Нажмите для переключения",amPM:["ДП","ПП"],yearAriaLabel:"Год"},r;t.l10ns.ru=i;r=t.l10ns;n.Russian=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.zh={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["周日","周一","周二","周三","周四","周五","周六"],longhand:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},months:{shorthand:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],longhand:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},rangeSeparator:" 至 ",weekAbbreviation:"周",scrollTitle:"滚动切换",toggleTitle:"点击切换 12/24 小时时制"},r;t.l10ns.zh=i;r=t.l10ns;n.Mandarin=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})});__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(n){function i(t){return n.call(this,t)||this}return __extends(i,n),i.prototype.addPages=function(n){n.add("body.User.Register",function(){return new t.Register});n.add("body.Privacy",function(){return new t.Privacy});n.add("body.Confirmation",function(){return new t.Confirmation});n.add("body.ReverseLink",function(){return new t.ReverseLinkReady});n.add("body.SelectDestiny",function(){return new t.SelectDestinyAccount});n.add("body.LinkPreview",function(){return new t.LinkPreview});n.add("body.CountryBDay",function(){return new t.CountryBirthday})},i.Instance=new i("User"),i}(n.Site.Area);t.UserArea=i;n.Site.setCurrentArea(i.Instance)})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.initialize=function(){},t.prototype.addListeners=function(){this.eventBinder.for($(".close-window")).on("click",function(){window.close()})},t}(n.Site.PageInitializer);t.Confirmation=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){var n=t!==null&&t.apply(this,arguments)||this;return n.handlePageShow=function(){n.isBirthdayInputFilledIn()&&n.isBirthdayInputValid(n.getBirthdayString())&&($("input[name=confirm]").prop("checked",!0),n.updateButtonState())},n}return __extends(i,t),i.prototype.initialize=function(){if(this.returnLocation=n.Site.getPageData("returnLocation"),this.existingUser=n.Site.getPageData("existingUser"),this.existingUser&&this.existingUser.birthDate){var i=this.existingUser.birthDate,r=$("input[name=day]"),u=$("select[name=month]"),f=$("input[name=year]"),t=moment(i);r.val(t.date());u.val(t.month()+1);f.val(t.year())}this.createConfirmationCheckbox();$(".js-continue").prop("disabled",!0);$(".js-btn-update").prop("disabled",!0)},i.prototype.signOut=function(){var n=window.opener;n.location.assign("/"+Localizer.CurrentCultureName+"/User/SignOut?bru="+n.location.pathname)},i.prototype.createConfirmationCheckbox=function(){var t=this,n=this.getBirthdayString(),i=this.isBirthdayInputValid(n),r=i?this.calculateAge(n):0,u=$(".checkbox-container"),f=Localizer.Format(Localizer.Webauth.IConfirmThatIAmAgeYears,{age:r});u.html('<input type="checkbox" name="confirm" id="confirm" required/>\n\t\t\t<label id="confirm-label" for="confirm">'+f+'<\/label><div class="error error-not-checked">'+Localizer.Webauth.PleaseConfirmYourAge+"<\/div>").show();$("input[name=confirm]").on("change",function(){t.updateButtonState()})},i.prototype.toggleBirthdayError=function(n){var t=$(".error-birthday");t.toggle(n)},i.prototype.toggleCountryError=function(n){var t=$(".error-country");t.toggle(n)},i.prototype.toggleConfirmationError=function(n){var t=$(".error-not-checked");t.toggle(n)},i.prototype.calculateAge=function(n){var t=moment(n,"YYYY-MM-DD").utc(),i=moment.utc(),r=i.year()-t.year(),u=i.month()-t.month(),f=i.date()-t.date();return(u<0||u===0&&f<0)&&r--,r},i.prototype.getBirthdayString=function(){var r="",u=$("input[name=day]"),f=$("select[name=month]"),e=$("input[name=year]"),n=u.val(),t=f.val(),i=e.val();return!Number.isInteger(parseInt(n))||!Number.isInteger(parseInt(t))||!Number.isInteger(parseInt(i))?r:!n.length||!t.length||i.length!==4?r:i+"-"+t.padStart(2,"0")+"-"+n.padStart(2,"0")},i.prototype.isBirthdayInputFilledIn=function(){var t=$("input[name=day]"),i=$("select[name=month]"),n=$("input[name=year]");return t.val()!==""&&i.val()!==""&&n.val()!==""&&n.val().length===4},i.prototype.isBirthdayInputValid=function(n){var t,i,r;return!n||n===""?!1:(t=moment(n,"YYYY-MM-DD"),!t.isValid())?!1:(i=moment().subtract(1,"years"),r=moment().subtract(100,"years"),t.isBetween(r,i))},i.prototype.onBirthdayInputChanged=function(){if(this.isBirthdayInputFilledIn()){if(this.isBirthdayInputFilledIn()){var n=this.isBirthdayInputValid(this.getBirthdayString());this.toggleBirthdayError(!n)}}else this.toggleBirthdayError(!1);this.createConfirmationCheckbox();this.updateButtonState()},i.prototype.updateButtonState=function(){var t=this.getBirthdayString(),i=$("select[name=country]").val(),r=$("input[name=confirm]").is(":checked"),n=this.isBirthdayInputValid(t)&&i&&r;$(".js-continue").prop("disabled",!n);$(".js-btn-update").prop("disabled",!n)},i.prototype.validateAndContinue=function(){var t=this.getBirthdayString(),n=$("select[name=country]"),r=n.val(),i=$("input[name=confirm]").is(":checked");return!this.isBirthdayInputValid(t)||!n.is(":valid")||!i?(this.isBirthdayInputValid(t)||this.toggleBirthdayError(!0),n.is(":valid")&&r!==""||this.toggleCountryError(!0),i||this.toggleConfirmationError(!0),!1):!0},i.prototype.addListeners=function(){var t=this,i,r;$(window).bind("pageshow",function(){this.handlePageShow();var i=$("select[name=country]"),n=i.val(),t=$(".js-country .current-option");t.find("[data-value]").attr("data-value",n);t.find(".option-label").html(n!=""?Localizer.Countries[n]:Localizer.Webauth.EnterYourCountry);t.find(".select-option").removeClass("current")});i=function(){var n=t.existingUser&&t.existingUser.birthDate===null,i=t.existingUser&&t.existingUser.countryOfResidence===null;(!t.isSubmitted||n&&i)&&t.signOut()};this.existingUser&&($(window).bind("beforeunload",i),$(window).bind("unload",i));this.eventBinder.for(".js-country").on("click",function(){var n=$(".error-country");n.is(":visible")&&n.hide()});r=$(".birthdayInputs input");r.on("input change",function(){t.onBirthdayInputChanged()});$("select[name=month]").on("change",function(){t.onBirthdayInputChanged()});$("select[name=country]").on("change",function(){t.updateButtonState()});this.eventBinder.for(r).on("click",function(){var n=$(".error-birthday");n.is(":visible")&&t.toggleBirthdayError(!1)});this.eventBinder.for($(".checkbox-container").find("input")).on("click",function(){$(".checkbox-container").find("input").is(":checked")&&$(".error-not-checked").hide()});this.eventBinder.for(".js-continue").on("click",function(n){if(n.stopImmediatePropagation(),n.preventDefault(),t.validateAndContinue()){var i=t.getBirthdayString();i!==""&&t.isBirthdayInputValid(i)&&($("input[name=birthday]").val(i),$(".country-birthday-form").submit())}});this.eventBinder.for(".js-btn-update").on("click",function(i){var r;if(i.stopImmediatePropagation(),i.preventDefault(),i.stopPropagation(),t.validateAndContinue()){r=t.getBirthdayString();t.isBirthdayInputValid(r);var u=$("select[name=country]"),f=u.val(),e={country:f,birthday:r};bungieNetPlatform.userService.EditBirthdayAndCountry(e,function(){if(t.isSubmitted=!0,t.returnLocation){window.location.href=t.returnLocation.replace(/&amp;/g,"&");return}window.close()},function(i){var r=new n.Modal("errorModal",i.errorMessage+"("+i.errorCode+")");r.afterCloseCallback=function(){window.close()};r.open();t.signOut()})}})},i}(n.Site.PageInitializer);t.CountryBirthday=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.initialize=function(){},t.prototype.addListeners=function(){this.eventBinder.for($("#confirm input")).on("keyup",function(n){var t=$(".js-confirm-link"),i=t.attr("data-displayname"),r=$(n.currentTarget);r.val()===i?t.removeClass("disabled").addClass("gold"):t.addClass("disabled").removeClass("gold")})},t}(n.Site.PageInitializer);t.LinkPreview=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){var n=t!==null&&t.apply(this,arguments)||this;return n.userPath="/"+Localizer.CurrentCultureName+"/User/",n}return __extends(i,t),i.prototype.initialize=function(){var t=this;this.privacyGate=new n.PrivacyStatementGate(!0,function(){t.removeUnloadListener();t.gotoAcceptPage()},function(){t.removeUnloadListener();window.close();t.signOut()})},i.prototype.addListeners=function(){this.addUnloadListener()},i.prototype.gotoDeclinePage=function(){window.location.assign(this.userPath+"PrivacyUpdateDeny")},i.prototype.signOut=function(){var n=window.opener;n.location.assign("/"+Localizer.CurrentCultureName+"/User/SignOut?bru="+n.location.pathname)},i.prototype.gotoAcceptPage=function(){window.location.assign(this.userPath+"PrivacyUpdateAccept")},i.prototype.addUnloadListener=function(){var n=this;$(window).on("beforeunload",function(t){t.preventDefault();console.log("hit");n.signOut()})},i.prototype.removeUnloadListener=function(){$(window).off("beforeunload")},i}(n.Site.PageInitializer);t.Privacy=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.initialize=function(){$("#email input").focus()},i.prototype.addListeners=function(){var t=this;this.eventBinder.for($(".js-next")).on("click",function(){t.createAccount($("input[name=ischild]").val()==="true")});this.eventBinder.for(".js-ur-optin").on("click",function(){var i=new n.UiKit.FormKit.CheckboxItem("ur-optin"),t;i.isChecked?($(".container-traveloption").hide(),t=new n.UiKit.FormKit.CheckboxItem("ur-travel"),t.setChecked(!1)):$(".container-traveloption").show()})},i.prototype.getEmailUsage=function(t){var r=Globals.OptInFlags.None,f,i,e,o,u;return t?undefined:(f=new n.UiKit.FormKit.CheckboxItem("opt-out"),i=Globals.OptInFlags,f.isChecked&&(r=i.CustomerService|i.Marketing|i.Newsletter|i.Social|i.System|i.UserResearch),e=new n.UiKit.FormKit.CheckboxItem("ur-optin"),e.isChecked&&(r=r|i.PlayTests),o=new n.UiKit.FormKit.CheckboxItem("ur-travel"),o.isChecked&&(r=r|i.PlayTestsLocal),u=new n.UiKit.FormKit.CheckboxItem("careers-optin"),u&&u.isChecked&&(r=r|i.Careers),r.toString())},i.prototype.createAccount=function(t){var r=this;if(this.isValidInput($(".container-window input[type=text]").add(".container-window input[type=checkbox]"))){var i,u=n.Site.getPageData("AuthType"),f=$("input[name=birthday]").val(),e=$("input[name=country]").val(),o=$("#email input").val(),s=n.Site.getPageData("EmailSubscriptions");i={email:t?null:o,emailUsage:this.getEmailUsage(t),credentialPublic:!0,termsAccepted:!0,authProviderType:u,locale:Localizer.CurrentCultureName,offer:null,emailSubscriptions:t?null:s.toString(),birthDate:f,countryOfResidence:e};bungieNetPlatform.userService.CreateUser(i,function(){window.location.href="/"+Localizer.CurrentCultureName+"/User/PrivacyUpdateAccept"},function(n){r.handleError(n)})}},i.prototype.handleError=function(n){$(".js-error-box").removeClass("hide");$(".js-error-box p").html(n.errorMessage);$(".intro").addClass("hide")},i.prototype.isValidInput=function(t){var i=n.Utilities.Validation.getErrors(t);return n.Utilities.Validation.renderErrors(i),i.length===0},i}(n.Site.PageInitializer);t.Register=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.initialize=function(){},t.prototype.addListeners=function(){var n=this;this.eventBinder.forDocument(".button-gotoPcMove").on("click",function(t){t.preventDefault();n.gotoPcMove()})},t.prototype.gotoPcMove=function(){opener.location.href="/"+Localizer.CurrentCultureName+"/PcMove";setTimeout(function(){window.close()},1e3)},t}(n.Site.PageInitializer);t.ReverseLinkReady=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.initialize=function(){this.replaceDatesLocalTime()},i.prototype.addListeners=function(){},i.prototype.replaceDatesLocalTime=function(){var t=$(".js-replaceTime[data-datetime]"),i=t.attr("data-datetime"),r;t.length&&typeof i!="undefined"&&(r=n.Utilities.DateTime.localizeTimesToCorrectTimezone(i),t.text(this.formatTime(r)))},i.prototype.formatTime=function(n){return n.format("lll")},i}(n.Site.PageInitializer);t.SelectDestinyAccount=i})(t=n.User||(n.User={}))}(Bnet||(Bnet={}))