text: /** 
   *	@license PikaJS DatePicker plugin 1.0.1
   *	© 2022 Scott Ogrin
   * 	MIT License
   */
  !function(t,e,s,n){function a(e,s){t.t(s,"o")||(s={}),t.extend(this,t.datePicker.defaults,s),this.input=t(e),this.input.wrap('<div class="datepicker_w">'),this.cal=this.input.up(".datepicker_w"),this.randID=t.R(),this.pauseEvents=!1,this.build(),this.selectDate(),this.hideCal()}t.datePicker={Version:"1.0.1",defaults:{month_names:["January","February","March","April","May","June","July","August","September","October","November","December"],short_month_names:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short_day_names:["S","M","T","W","T","F","S"],start_of_week:0,selectable_days:[0,1,2,3,4,5,6],weekend_days:[0,6],non_selectable:[],short_non_selectable:[],date_format:"dd MM YYYY",date_min:"",date_max:"",error_out_of_range:"Selected date is out of range",on_show:null,on_open:null,on_select:null,on_close:null}},a.prototype={build:function(){var e=this;this.reg=this.dateSetReg(),this.date_max=""!=this.date_max&&this.date_max.match(this.reg)?this.dateDecode(this.date_max.match(this.reg)):"",this.date_min=""!=this.date_min&&this.date_min.match(this.reg)?this.dateDecode(this.date_min.match(this.reg)):"";this.cal.append('<div class="date_selector"><div class="nav"><div class="error_msg" style="display: none;"></div><p class="month_nav"><span class="button prev" title="[Page-Up]">&#8249;</span> <span class="month_name"></span> <span class="button next" title="[Page-Down]">&#8250;</span></p><p class="year_nav"><span class="button prev" title="[Ctrl+Page-Up]">&#8249;</span> <span class="year_name"></span> <span class="button next" title="[Ctrl+Page-Down]">&#8250;</span></p></div><div class="calendar"><div class="head"></div><div class="body"></div></div></div><div class="cal-btn"></div></div>');var a="";t.each(this.adjustDays(this.short_day_names),function(t,e){a+="<div>"+e+"</div>"}),this.cal.find(".head").html(a),this.selectDate(),datsel=this.cal.find(".date_selector"),t(window).on("resize",function(){if(datsel.css({opacity:0}).show(),e.input.width()>210){var t=parseInt(datsel.css("padding-right"))+parseInt(datsel.css("padding-left"))+parseInt(datsel.css("border-right-width"))+parseInt(datsel.css("border-left-width"));datsel.css({width:e.input.width()-t+"px"});var s=datsel.find(".selectable_day").first().height();s>30&&e.cal.css({"font-size":1+.02*(s-30)+"em"})}datsel.hide().css({opacity:""})}),window.dispatchEvent(new Event("resize")),this.cal._on("mousedown",".month_nav .prev",function(){return e.moveMonthBy(-1),!1}),this.cal._on("mousedown",".month_nav .next",function(){return e.moveMonthBy(1),!1}),this.cal._on("mousedown",".month_name",function(){return 0==this.down("select").length&&(e.pauseEvents=!0,e.cal.find(".month_name").html(e.getMonthSelect())),!1}),this.cal._on("change",".month_name select",function(){return e.moveMonthBy(parseInt(this.val())-e.currentMonth[s]()),e.pauseEvents=!1,!1}),this.cal._on("mousedown",".year_name",function(){return 0==this.down("select").length&&(e.pauseEvents=!0,e.cal.find(".year_name").html(e.getYearSelect())),!1}),this.cal._on("change",".year_name select",function(){return e.moveMonthBy(12*(parseInt(this.val())-e.currentMonth[n]())),e.pauseEvents=!1,!1}),this.cal._on("mousedown",".year_nav .prev",function(){return e.moveMonthBy(-12),!1}),this.cal._on("mousedown",".year_nav .next",function(){return e.moveMonthBy(12),!1}),this.cal._on("mousedown",".selectable_day",function(){return e.changeInput(this.data("date")),!1}),this.cal._on("mouseover",".selectable_day",function(){return this.addClass("hover"),!1}),this.cal._on("mouseout",".selectable_day",function(){return this.removeClass("hover"),!1}),this.cal._on("input","input:first-of-type",function(){return null!=this.val().match(e.reg)&&e.selectDate(),!1}),this.cal.find(".cal-btn").on("click.calBtn"+this.randID,function(t){e.cal.find(".date_selector").visible()?e.hideCal():e.showCal()})},selectMonth:function(t){var a=new Date(t[n](),t[s](),t[e]());if(this.dateAllowed(a)){if(!this.currentMonth||this.currentMonth[n]()!=a[n]()||this.currentMonth[s]()!=a[s]()){this.currentMonth=a;for(var i=this.rangeStart(t),d=this.rangeEnd(t),o=this.daysBetween(i,d),h="",r=0;r<=o;r++){var c=new Date(i[n](),i[s](),i[e]()+r,12,0);if(c.getDay()==this.start_of_week){new Date(c[n](),c[s](),c[e]()+6,12,0);h+='<div class="week">'}var l="unselected_month";c[s]()==t[s]()&&this.dateAllowed(c)&&!this.isHoliday(c)&&(l="selectable_day",this.weekend_days.indexOf(c.getDay())>-1&&(l+=" weekend")),h+='<div class="'+l+'" data-date="'+this.dateToString(c)+'">'+c[e]()+"</div>",c.getDay()==(this.start_of_week+6)%7&&(h+="</div>")}this.cal.find(".body").html(h),this.cal.find(".month_name").html(this.month_names[t[s]()]),this.cal.find(".year_name").html(this.currentMonth[n]()),this.cal.find("div[data-date='"+this.dateToString(new Date)+"']").addClass("today")}this.cal.find(".selected").each(function(){this.removeClass("selected")}),this.cal.find('div[data-date="'+this.selectedDateString+'"], div[data-date="'+this.selectedDateString+'"]').each(function(){this.addClass("selected")})}else this.show_error(this.error_out_of_range)},selectDate:function(e){t.t(e)&&(e=this.stringToDate(this.input.val())),e||(e=new Date),this.dateAllowed(e)?(this.selectedDate=e,this.currentYear=e[n](),this.selectedDateString=this.dateToString(this.selectedDate),this.selectMonth(this.selectedDate)):this.date_min&&this.daysBetween(this.date_min,e)<0?(this.selectedDate=this.date_min,this.selectMonth(this.date_min),this.input.val("")):(this.selectedDate=this.date_max,this.selectMonth(this.selectedDate),this.input.val(""))},dateAllowed:function(t){return(!this.date_min||this.daysBetween(this.date_min,t)>=0)&&(!this.date_max||this.daysBetween(t,this.date_max)>=0)},isHoliday:function(t){return-1==this.selectable_days.indexOf(t.getDay())||this.non_selectable.indexOf(this.dateToString(t))>-1||this.short_non_selectable.indexOf(this.dateToShortString(t))>-1},changeInput:function(e){this.input.val(e),this.input.blur(),this.selectDate(),"hidden"!=this.input.attr("type")&&this.hideCal(),t.t(this.on_select,"f")&&this.on_select.call(this,this.selectedDate)},showCal:function(){var e=this;if(this.pauseEvents=e.pauseEvents=!1,this.cal.find(".error_msg").css({display:"none"}),this.input.off("focus.cal"+this.randID),this.input.attr("readonly",!0),t.t(this.on_show,"f"))this.on_show.call(this,this.cal.find(".date_selector"));else{var s=this.cal.find(".date_selector"),n=this.input.position();s.css({opacity:0}).show(),s.css({top:n.top+this.input[0].offsetHeight+"px",left:n.left+"px"}),s.offset().top+s.height()>document.documentElement.clientHeight&&s.css({top:n.top-s.height()+"px",left:n.left+"px"}),s.css({opacity:""}),t.animate&&s.scrollTo()}t(document).on("mousedown.calClose"+this.randID,function(s){return!!e.pauseEvents||(s.target==e.input[0]||e.insideCal(s)||t(s.target).hasClass("cal-btn")||e.hideCal(),!1)}),t(document).on("keydown.cal"+this.randID,function(t){if(e.pauseEvents)return!0;switch(t.keyCode){case 9:case 27:return void e.hideCal();case 13:e.dateAllowed(e.stringToDate(e.selectedDateString))&&!e.isHoliday(e.stringToDate(e.selectedDateString))&&e.changeInput(e.selectedDateString);break;case 33:e.moveDateMonthBy(-1);break;case 34:e.moveDateMonthBy(1);break;case 38:e.moveDateBy(-7);break;case 40:e.moveDateBy(7);break;case 37:e.moveDateBy(-1);break;case 39:e.moveDateBy(1);break;default:return!0}return!1}),t.t(e.on_open,"f")&&e.on_open.call(e)},hideCal:function(){var e=this;"hidden"!=this.input.attr("type")&&(this.input.removeAttr("readonly"),this.cal.find(".date_selector").hide(),t(document).off("mousedown.calClose"+this.randID),t(document).off("keydown.cal"+this.randID),this.input.on("focus.cal"+this.randID,function(){e.showCal()}),t.t(e.on_close,"f")&&e.on_close.call(e))},insideCal:function(t){var e=this.cal.find(".date_selector"),s=e.offset();return s.right=s.left+e[0].offsetWidth,s.bottom=s.top+e[0].offsetHeight,t.pageY<s.bottom&&t.pageY>s.top&&t.pageX<s.right&&t.pageX>s.left},dateSetReg:function(){switch(this.date_format){case"dd/mm/YYYY":return RegExp(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);case"FF dd YYYY":return new RegExp(/^([a-zA-Z]+) (\d{1,2}) (\d{4})$/);case"MM dd YYYY":return new RegExp(/^([a-zA-Z]{3}) (\d{1,2}) (\d{4})$/);case"dd FF YYYY":return new RegExp(/^(\d{1,2}) ([a-zA-Z]+) (\d{4})$/);case"YYYY/mm/dd":return new RegExp(/^(\d{4})\/(\d{1,2})\/(\d{1,2})$/);case"dd MM YYYY":default:return new RegExp(/^(\d{1,2}) ([a-zA-Z]{3}) (\d{4})$/)}},dateDecode:function(t){switch(this.date_format){case"dd/mm/YYYY":return new Date(t[3],parseInt(t[2]-1),t[1]);case"FF dd YYYY":return new Date(t[3],this.month_names.indexOf(t[1]),t[2]);case"MM dd YYYY":return new Date(t[3],this.short_month_names.indexOf(t[1]),t[2]);case"dd FF YYYY":return new Date(t[3],this.month_names.indexOf(t[2]),t[1]);case"YYYY/mm/dd":return new Date(t[1],parseInt(t[2]-1),t[3]);case"dd MM YYYY":default:return new Date(t[3],this.short_month_names.indexOf(t[2]),t[1])}},stringToDate:function(t){var e=t.match(this.reg);return null!=e?0==e[3]&&0==e[2]&&0==e[1]?null:this.dateDecode(e):null},dateToString:function(t){var a=this.strpad(t[e]()),i=this.month_names[t[s]()],d=this.strpad(t[s]()+1),o=this.short_month_names[t[s]()],h=t[n]();switch(this.date_format){case"dd/mm/YYYY":return a+"/"+d+"/"+h;case"FF dd YYYY":return i+" "+a+" "+h;case"MM dd YYYY":return o+" "+a+" "+h;case"dd FF YYYY":return a+" "+i+" "+h;case"YYYY/mm/dd":return h+"/"+d+"/"+a;case"dd MM YYYY":default:return a+" "+o+" "+h}},dateToShortString:function(t){var n=this.strpad(t[e]()),a=this.month_names[t[s]()],i=this.strpad(t[s]()+1),d=this.short_month_names[t[s]()];switch(this.date_format){case"dd/mm/YYYY":return n+"/"+i;case"FF dd YYYY":return a+" "+n;case"MM dd YYYY":return d+" "+n;case"dd FF YYYY":return n+" "+a;case"YYYY/mm/dd":return i+"/"+n;case"dd MM YYYY":default:return n+" "+d}},moveDateBy:function(t){var a=new Date(this.selectedDate[n](),this.selectedDate[s](),this.selectedDate[e]()+t);this.selectDate(a)},moveDateMonthBy:function(t){var a=new Date(this.selectedDate[n](),this.selectedDate[s]()+t,this.selectedDate[e]());a[s]()==this.selectedDate[s]()+t+1&&a.setDate(0),this.selectDate(a)},moveMonthBy:function(t){var e=t<0?t+1:t,a=t<0?-1:1;this.selectMonth(new Date(this.currentMonth[n](),this.currentMonth[s]()+e,a))},getMonthSelect:function(){for(var t="<select>",e="",n=0;n<this.month_names.length;n++)n==this.currentMonth[s]()&&(e=' selected="selected"'),t+='<option value="'+n+'"'+e+">"+this.month_names[n]+"</option>";return t+"</select>"},getYearSelect:function(){for(var t="<select>",e=this.date_min?this.date_min[n]():1970;e<=(this.date_max?this.date_max[n]():2100);e++)t+='<option value="'+e+'"'+(e==this.currentMonth[n]()?' selected="selected"':"")+">"+e+"</option>";return t+"</select>"},daysBetween:function(t,a){return t=Date.UTC(t[n](),t[s](),t[e]()),((a=Date.UTC(a[n](),a[s](),a[e]()))-t)/864e5},changeDayTo:function(t,a,i){var d=i*(Math.abs(a.getDay()-t-7*i)%7);return new Date(a[n](),a[s](),a[e]()+d)},rangeStart:function(t){return this.changeDayTo(this.start_of_week,new Date(t[n](),t[s]()),-1)},rangeEnd:function(t){return this.changeDayTo((this.start_of_week-1)%7,new Date(t[n](),t[s]()+1,0),1)},show_error:function(t){var e=this;this.cal.find(".error_msg").html(t).show(),setTimeout(function(){e.cal.find(".error_msg").html("").hide()},3e3)},adjustDays:function(t){for(var e=[],s=0;s<t.length;s++)e[s]=t[(s+this.start_of_week)%7];return e},strpad:function(t){return t<10?"0"+t:t}},t.extend(t.fn,{datePicker:function(t){return this.each(function(){new a(this,t)})}})}(Pika,"getDate","getMonth","getFullYear");