jtsage-datebox-jqm
Advanced tools
Comparing version 5.1.3 to 5.1.4
@@ -1,4 +0,4 @@ | ||
/* JTSage-DateBox-5.1.3 (jqm) | 2019-05-30T19:08:01.724Z | (c) 2010,2019 JTSage | https://github.com/jtsage/jtsage-datebox/blob/master/LICENSE.txt */ | ||
/* JTSage-DateBox-5.1.4 (jqm) | 2019-06-10T16:40:38.813Z | (c) 2010,2019 JTSage | https://github.com/jtsage/jtsage-datebox/blob/master/LICENSE.txt */ | ||
!function(y){y.widget("jtsage.datebox",{initSelector:"input[data-role='datebox']",options:{mode:!1,hideInput:!1,lockInput:!0,safeEdit:!0,controlWidth:"290px",controlWidthImp:"",breakpointWidth:"567px",zindex:"1100",clickEvent:"vclick",disableWheel:!1,useKinetic:!0,flipSizeOverride:!1,defaultValue:!1,showInitialValue:!1,linkedField:!1,linkedFieldFormat:"%J",displayMode:"dropdown",displayDropdownPosition:"bottomRight",displayInlinePosition:"center",displayForcePosition:!1,dismissOutsideClick:!0,dismissOnEscape:!1,useHeader:!0,useImmediate:!1,useButton:!0,buttonIcon:!1,useFocus:!1,useSetButton:!0,useCancelButton:!1,useTodayButton:!1,closeTodayButton:!1,useTomorrowButton:!1,closeTomorrowButton:!1,useClearButton:!1,useCollapsedBut:!1,usePlaceholder:!1,beforeOpenCallback:!1,beforeOpenCallbackArgs:[],openCallback:!1,openCallbackArgs:[],closeCallback:!1,closeCallbackArgs:[],runOnBlurCallback:!1,startOffsetYears:!1,startOffsetMonths:!1,startOffsetDays:!1,afterToday:!1,beforeToday:!1,notToday:!1,maxDate:!1,minDate:!1,maxDays:!1,minDays:!1,maxYear:!1,minYear:!1,blackDates:!1,blackDatesRec:!1,blackDays:!1,whiteDates:!1,enableDates:!1,validHours:!1,minHour:!1,maxHour:!1,minTime:!1,maxTime:!1,maxDur:!1,minDur:!1,minuteStep:1,minuteStepRound:0,twoDigitYearCutoff:38,flipboxLensAdjust:!1,rolloverMode:{m:!0,d:!0,h:!0,i:!0,s:!0},useLang:"default",lang:{default:{setDateButtonLabel:"Set Date",setTimeButtonLabel:"Set Time",setDurationButtonLabel:"Set Duration",todayButtonLabel:"Jump to Today",tomorrowButtonLabel:"Jump to Tomorrow",titleDateDialogLabel:"Set Date",titleTimeDialogLabel:"Set Time",daysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysOfWeekShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthsOfYear:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsOfYearShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],durationLabel:["Days","Hours","Minutes","Seconds"],durationDays:["Day","Days"],timeFormat:24,headerFormat:"%A, %B %-d, %Y",tooltip:"Open Date Picker",nextMonth:"Next Month",prevMonth:"Previous Month",dateFieldOrder:["m","d","y"],timeFieldOrder:["h","i","a"],datetimeFieldOrder:["y","m","d","h","i","s","a"],slideFieldOrder:["y","m","d"],dateFormat:"%Y-%m-%d",datetimeFormat:"%Y-%m-%dT%k:%M:%S",useArabicIndic:!1,isRTL:!1,calStartDay:0,clearButton:"Clear",cancelButton:"Cancel",durationOrder:["d","h","i","s"],meridiem:["AM","PM"],timeOutput:"%k:%M",durationFormat:"%Dd %DA, %Dl:%DM:%DS",calDateListLabel:"Other Dates",calHeaderFormat:"%B %Y"}},theme_clearBtn:["recycle","a"],theme_closeBtn:["check","a"],theme_cancelBtn:["delete","a"],theme_tomorrowBtn:["action","a"],theme_todayBtn:["action","a"],theme_dropdownContainer:"ui-body-a",theme_modalContainer:"ui-body-a",theme_inlineContainer:"ui-body-a",theme_headerTheme:"inherit",theme_headerBtn:["delete","a"],theme_openButton:!1,theme_cal_Today:"b",theme_cal_DayHigh:"b",theme_cal_Selected:"active",theme_cal_DateHigh:"b",theme_cal_DateHighAlt:"b",theme_cal_DateHighRec:"b",theme_cal_Default:"a",theme_cal_OutOfBounds:"a",theme_cal_NextBtn:["plus","a"],theme_cal_PrevBtn:["minus","a"],theme_cal_Pickers:"a",theme_cal_DateList:"a",theme_dbox_NextBtn:["plus","a"],theme_dbox_PrevBtn:["minus","a"],theme_dbox_Inputs:"inherit",theme_fbox_Selected:"a ui-flipswitch-active",theme_fbox_Default:"a",theme_fbox_Forbidden:"a ui-disabled",theme_fbox_RollHeight:"135px",theme_slide_Today:"b",theme_slide_DayHigh:"b",theme_slide_Selected:"active",theme_slide_DateHigh:"b",theme_slide_DateHighAlt:"b",theme_slide_DateHighRec:"b",theme_slide_Default:"a",theme_slide_NextBtn:["plus","a"],theme_slide_PrevBtn:["minus","a"],theme_slide_NextDateBtn:["carat-r","a"],theme_slide_PrevDateBtn:["carat-l","a"],theme_slide_Pickers:"a",theme_slide_DateList:"a",theme_backgroundMask:{position:"fixed",left:0,top:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,.4)"},theme_headStyle:" .center { text-align: center !important; } .p0 { padding: 0 !important; }.m0 { margin: 0 !important; } .w-100 { width: 100% !important; }",theme_spanStyle:!1,buttonIconDate:"calendar",buttonIconTime:"clock",disabledState:"ui-disabled",tranDone:"webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",calHighToday:!0,calHighPick:!0,calHighOutOfBounds:!0,calSelectedOutOfBounds:!0,calShowDays:!0,calOnlyMonth:!1,calShowWeek:!1,calUsePickers:!1,calNoHeader:!1,calYearPickMin:-6,calYearPickMax:6,calYearPickRelative:!0,calFormatter:!1,calBeforeAppendFunc:function(e){return e},highDays:!1,highDates:!1,highDatesRec:!1,highDatesAlt:!1,calDateList:!1,calShowDateList:!1,durationStep:1,durationSteppers:{d:1,h:1,i:1,s:1},flen:{y:25,m:24,d:40,h:24,i:30,s:30,a:30},fboxNatural:"default",slideHighToday:!0,slideHighPick:!0,slideUsePickers:!1,slideNoHeader:!1,slideYearPickMin:-6,slideYearPickMax:6,slideYearPickRelative:!0,slideDateList:!1,slideShowDateList:!1},icons:{getIcon:function(e){var t=this,a=t.options.iconFactory;return!1!==e&&("function"==typeof a?a.call(t,e):"<svg"===e.substr(0,4)?e:void 0!==t.icons[e]?t.icons[e]:t.icons.cancel)},next:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M9.8 6L4 11.8l-1.8-1.7L6.6 6 2.2 2 4 .1 9.8 6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',prev:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M2.2 6L8 .2l1.8 1.7L5.4 6l4.4 4L8 11.9 2.2 6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',plus:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5v2h12V5H0z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 0H5v12h2V0z" fill="currentColor"/></svg>',minus:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M0 5v2h12V5H0z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',check:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M12 2.8l-8 8-4-4 1.5-1.5L4 7.8l6.5-6.5L12 2.6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',cancel:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M11 2.5L9.4 1 1.1 9.5 2.5 11l8.4-8.4z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="currentColor" d="M2.5 1L1 2.6l8.4 8.4L11 9.5 2.5 1.1z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',goto:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M7 3.3C3.8 3.6.4 5.9.4 11.7c2-4.3 4-5 6.8-5v2.9l4.6-4.7L7.1.3v3z" fill-rule="evenodd"/></svg>',clear:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.8 1H8.1c0-.5-.4-1-.8-1H4.7C4.3 0 4 .6 4 1H2.2c-.4 0-.8.3-.8.8v.8c0 .5.4.8.8.8V11c0 .5.4.9.9.9H9c.4 0 .8-.4.8-.9V3.4c.5 0 .8-.3.8-.8v-.8c0-.5-.3-.9-.8-.9zM9 11H3V3.6H4v6.7h.8V3.5h.9v6.7h.8V3.5h.9v6.7H8V3.5h.8V11zm.8-8.4H2.2v-.8h7.6v.8z" fill="currentColor"/></svg>',clock:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M6.8 6h2.5v1.7H5.9a.8.8 0 0 1-.8-.8V2.6h1.7V6zM6 1.2a4.8 4.8 0 1 1 0 9.6 4.8 4.8 0 0 1 0-9.6zM6 .1a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',calendar:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M10.5 1h-.8v1.3c0 .2-.2.4-.4.4H7.6a.4.4 0 0 1-.4-.4V1H4.7v1.3c0 .2-.2.4-.4.4H2.6a.4.4 0 0 1-.4-.4V1h-.8c-.5 0-.8.4-.8.8V11c0 .5.4.8.8.8h9.3c.5 0 .8-.4.8-.8V1.8c0-.5-.4-.8-.8-.8zm0 10.1H1.2V3.5h9.3v7.6zM3.7 1.9h-.8V.2h.8v1.7zm5.1 0H8V.2h.8v1.7zM4.5 5.3h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zM2.8 7H2v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zM2.8 8.7H2v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm-6.8 1.7H2v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8z"/></svg>'},styleFunctions:{},_getLongOptions:function(e){var t,a,i={};for(t in e.data())"datebox"===t.substr(0,7)&&7<t.length&&"options"!==(a=(a=t.substr(7)).charAt(0).toLowerCase()+a.slice(1))&&(i[a]=e.data(t));return i},_setOption:function(){y.Widget.prototype._setOption.apply(this,arguments),this.refresh()},getOption:function(e){var t=this.__(e);return"Err:NotFound"!==t?t:this.options[e]},style_attach:function(e){var t=this,a=t.d.wrap.parent(),i=y("body").find("#"+t.baseID+"-dbAttach");return 1===i.length?i:e?a.hasClass("ui-field-contain")?a:t.d.wrap:1===(a=y(".ui-page-active")).length?a:1===(a=t.d.input.closest("[data-role='page']")).length?a:y("body")},style_btn:function(e,t){var a;return t=void 0===t?"":t,a="<a href='#' role='button' class='ui-btn ui-mini ui-btn-"+e[1],a+=!1!==e[0]?" ui-icon-"+e[0]:"",a+=""===t?" ui-corner-all ui-btn-icon-notext":" ui-btn-icon-left",a+="'>"+t+"</a>"},style_btnGrp:function(e){return y("<div style='"+(e?"margin: 0 auto;":"margin: 0 .446em")+"' class='ui-controlgroup-controls'>")},style_btnGrpOut:function(e,t){var a=!0===e?"ui-controlgroup-horizontal":"ui-controlgroup-vertical",i=!0===e?"style='text-align:center'":"";return t.find(".ui-btn").last().addClass("ui-last-child"),t.find(".ui-btn").first().addClass("ui-first-child"),y("<div "+i+" class='ui-controlgroup "+a+"'>").append(t)},style_inWrap:function(e){return e.parent().enhanceWithin(),e.parent().addClass("ui-input-has-clear")},style_inBtn:function(e,t){return"<a href='javascript: return false;' class='dbOpenButton ui-input-clear ui-btn ui-icon-"+e+" ui-btn-icon-notext ui-corner-all' title='"+t+"'>"+t+"</a>"},style_inNoBtn:function(e){e.parent().removeClass("ui-has-clear")},style_inHide:function(){var e=this.d.wrap.parent();e.hasClass("ui-field-contain")?e.hide():this.d.wrap.hide()},style_mainHead:function(e,t,a){return"<div class='ui-header ui-bar-"+t+"'><h1 class='ui-title'>"+e+"</h1>"+this.style_btn([a[0],a[1]+" dbCloser ui-btn-right"])+"</div>"},style_subHead:function(e){return y("<div class='dbHeader'><h3 class='center'>"+e+"</h3></div>")},style_pnHead:function(e,t,a,i,n){var o=y("<div class='ui-header' style='border:0; padding: 0 3px 8px;'>");return y(this.style_btn([t[0],t[1]+" ui-btn-left "+i])).appendTo(o),y("<h3 class='ui-title' style='margin: 0 15%'>"+e+"</h3>").appendTo(o),y(this.style_btn([a[0],a[1]+" ui-btn-right "+n])).appendTo(o),o},style_picker:function(e,t,a,i){var n=0,o="<div style='padding-bottom: 8px' class='ui-controlgroup ui-controlgroup-horizontal ui-corner-all ui-mini'>";for(o+="<div class='ui-controlgroup-controls w-100'>",o+="<div class='ui-select' style='width:60%'>",o+="<div id='"+a+"-button' class='ui-btn-"+t+" ui-btn ui-icon-carat-d ui-btn-icon-right ui-corner-all ui-shadow ui-first-child'>",n=0;n<e.month.length;n++)!0===e.month[n][2]&&(o+="<span>"+e.month[n][1]+"</span>");for(o+=this._stdSel(e.month,a,""),o+="</div></div>",o+="<div class='ui-select' style='width:40%'>",o+="<div id='"+i+"-button' class='ui-btn-"+t+" ui-btn ui-icon-carat-d ui-btn-icon-right ui-corner-all ui-shadow ui-last-child'>",n=0;n<e.year.length;n++)!0===e.year[n][2]&&(o+="<span>"+e.year[n][1]+"</span>");return o+=this._stdSel(e.year,i,""),o+="</div></div>",y(o+="</div></div>")},style_dateList:function(e,t,a,i){var n="",o=t.slice();return o.unshift([!1,e,!0]),n+="<div class='ui-select'>",n+="<div id='"+i+"-button' style='margin: 0 .446em 8px;' class='ui-mini ui-btn ui-icon-carat-d ui-btn-"+a+" ui-btn-icon-right ui-corner-all'>",n+="<span>"+e+"</span>",n+=this._stdSel(o,i,""),y(n+="</div></div>")},style_calGrid:function(){return y("<div><table class='dbCalGrid w-100'></table></div>")},style_calRow:function(){return y("<tr>")},style_calBtn:function(e,t){var a="width:"+100/t+"%",i=["dbEvent","ui-btn","ui-mini","m0","ui-btn-"+e.theme,e.bad?"ui-disabled":""],n=e.bad?"disabled='disabled'":"";return y("<td class='p0 m0' style='"+a+"'><a style='"+["padding-right:0","padding-left:0"].join(";")+"' class='"+i.join(" ")+"' href='#' "+n+">"+e.displayText+"</a></td>")},style_calTxt:function(e,t,a){return y("<td class='p0 m0 center' style='"+["width:"+100/a+"%",t?"font-weight:bold":""].join(";")+"'>"+e+"</td>")},style_dboxCtr:function(){return y("<table class='w-100'>")},style_dboxRow:function(){return y("<tr>")},style_dboxCtrl:function(e,t,a,i,n){var o="";return o+="<td class='dbBox"+a+"'>",o+="<a href='#' role='button' class='ui-corner-all ui-btn ui-mini ui-btn-",o+=t[1]+" ui-icon-"+t[0]+" ui-btn-icon-top dbBoxNext m0' ",o+="style='padding-top:2.1em; border-bottom-left-radius:0;border-bottom-right-radius:0;'>",o+="</a>",null!==i&&(o+="<div class='m0 center ui-input-text ui-body-inherit' style='height:auto; padding: .3em 0;'>"+i+"</div>"),o+="<div class='m0 ui-input-text ui-mini ui-body-"+n+"'>",o+="<input class='p0 center' type='text'></div>",o+="<a href='#' role='button' class='ui-corner-all ui-btn ui-mini ui-btn-",o+=e[1]+" ui-icon-"+e[0]+" ui-btn-icon-top dbBoxPrev m0' ",o+="style='padding-top:2.1em; border-top-left-radius:0;border-top-right-radius:0;'>",o+="</a>",y(o+="</div>")},style_slideGrid:function(){return y("<div><table class='dbSlideGrid w-100'></table></div>")},style_slideRow:function(){return y("<tr>")},style_slideBtn:function(e){var t=e.bad?"disabled='disabled'":"",a="class='m0 dbEventS w-100 ui-btn ui-mini ui-btn-"+e.theme+(e.bad?" disabled":"")+"'";return y("<td class='m-0 p-0 text-center' style='width: 12.5%'><a style='padding:.7em 0;' href='#' "+a+" "+t+"><small>"+this.__("daysOfWeekShort")[e.dateObj.getDay()]+"</small><br>"+e.dateObj.getDate()+"</a></td>")},style_slideCtrl:function(e,t){var a="class='m0 ui-corner-all ui-btn ui-mini ui-btn-icon-notext ui-btn-"+t[1]+" "+e+" ui-icon-"+t[0]+"'";return y("<td style='width: 6.25%'><a href='#' "+a+"></a></td>")},style_fboxCtr:function(e){return y("<div style='margin: 0 5px 8px; height: "+e+"; overflow: hidden'>")},style_fboxDurLbls:function(){return y("<div style='margin: 5px;'>")},style_fboxDurLbl:function(e,t){return y("<div class='center' style='display:inline-block; width: "+100/t+"%'>"+e+"</div>")},style_fboxRollCtr:function(e){return y("<div style='float:left; width:"+100/e+"%'>")},style_fboxRollPrt:function(){return y("<ul style='list-style-type: none; display: inline;'>")},style_fboxRollCld:function(e,t){return y("<li style='height: 30px; line-height: 30px;' class='center ui-body-"+t+"'>"+e+"</li>")},style_fboxLens:function(){return y("<div style='width: 96%; height: 40px; border: 1px solid #eee; margin: 0 1.5%;' class='ui-overlay-shadow'>")},style_fboxPos:function(){var e,t,a,i,n=this.options,o=this.d.intHTML.find(".dbRollerV").outerHeight(),s=this.d.intHTML.find(".dbLens").first(),r=s.outerHeight();i=-1*(o/2+r/2),s.css({top:i+-3,marginBottom:-1*r}),this.d.intHTML.find(".dbRoller").each(function(){e=y(this),"0px"===(t=e.children().first()).css("marginTop")&&(a=(e.children().length+1)*t.outerHeight(),i=a/2*-1+o/2,!1!==n.flipboxLensAdjust&&(i+=n.flipboxLensAdjust),t.css("margin-top",i))})},_enhanceDate:function(){Object.assign(this._date.prototype,{copy:function(e,t){return e=Object.assign([0,0,0,0,0,0,0],e),t=Object.assign([0,0,0,0,0,0,0],t),new Date(0<t[0]?t[0]:this.get(0)+e[0],0<t[1]?t[1]:this.get(1)+e[1],0<t[2]?t[2]:this.get(2)+e[2],0<t[3]?t[3]:this.get(3)+e[3],0<t[4]?t[4]:this.get(4)+e[4],0<t[5]?t[5]:this.get(5)+e[5],0<t[6]?t[5]:this.get(6)+e[6])},adj:function(e,t){if("number"!=typeof t||"number"!=typeof e)throw new Error("Invalid Arguments");switch(e){case 0:this.setD(0,this.get(0)+t);break;case 1:this.setD(1,this.get(1)+t);break;case 2:this.setD(2,this.get(2)+t);break;case 3:t*=60;case 4:t*=60;case 5:t*=1e3;case 6:this.setTime(this.getTime()+t)}return this},setD:function(e,t){switch(e){case 0:this.setFullYear(t);break;case 1:this.setMonth(t);break;case 2:this.setDate(t);break;case 3:this.setHours(t);break;case 4:this.setMinutes(t);break;case 5:this.setSeconds(t);break;case 6:this.setMilliseconds(t)}return this},get:function(e){switch(e){case 0:return this.getFullYear();case 1:return this.getMonth();case 2:return this.getDate();case 3:return this.getHours();case 4:return this.getMinutes();case 5:return this.getSeconds();case 6:return this.getMilliseconds()}return!1},get12hr:function(){return 0===this.get(3)?12:this.get(3)<13?this.get(3):this.get(3)-12},iso:function(){var e=[0,0,0],t=0;for(t=0;t<3;t++)e[t]=this.get(t),1===t&&e[t]++,e[t]<10&&(e[t]="0"+String(e[t]));return e.join("-")},comp:function(){return parseInt(this.iso().replace(/-/g,""),10)},getEpoch:function(){return Math.floor(this.getTime()/1e3)},getEpochDays:function(){return Math.floor(this.getTime()/864e5)},getArray:function(){var e=[0,0,0,0,0,0],t=0;for(t=0;t<6;t++)e[t]=this.get(t);return e},setFirstDay:function(e){return this.setD(2,1).adj(2,e-this.getDay()),10<this.get(2)&&this.adj(2,7),this},setDWeek:function(e,t){return 4===e?this.setD(1,0).setD(2,1).setFirstDay(4).adj(2,-3).adj(2,7*(t-1)):this.setD(1,0).setD(2,1).setFirstDay(e).adj(2,7*(t-1))},getDWeek:function(e){var t,a;switch(e){case 0:return t=this.copy([0,-1*this.getMonth()]).setFirstDay(0),Math.floor((this.getTime()-(t.getTime()+6e4*(this.getTimezoneOffset()-t.getTimezoneOffset())))/6048e5)+1;case 1:return t=this.copy([0,-1*this.getMonth()]).setFirstDay(1),Math.floor((this.getTime()-(t.getTime()+6e4*(this.getTimezoneOffset()-t.getTimezoneOffset())))/6048e5)+1;case 4:return 11===this.getMonth()&&28<this.getDate()?1:(t=this.copy([0,-1*this.getMonth()],!0).setFirstDay(4).adj(2,-3),(a=Math.floor((this.getTime()-(t.getTime()+6e4*(this.getTimezoneOffset()-t.getTimezoneOffset())))/6048e5)+1)<1?(t=this.copy([-1,-1*this.getMonth()]).setFirstDay(4).adj(2,-3),Math.floor((this.getTime()-t.getTime())/6048e5)+1):a);default:return 0}}})},_ord:{default:function(e){var t=e%10;return 9<e&&e<21||3<t?"th":["th","st","nd","rd"][t]}},_customformat:{default:function(e,t,a){return!1}},_formatter:function(e,i,t){var n,o=this,s=this.options,r=0;return void 0===t&&(t=!0),"dura"===s.mode.substr(0,4)&&(r=o._dur(this.theDate.getTime()-this.initDate.getTime()),e.match(/%Dd/)||(r[1]+=24*r[0]),e.match(/%Dl/)||(r[2]+=60*r[1]),e.match(/%DM/)||(r[3]+=60*r[2])),e=e.replace(/%(D|X|0|-)*([1-9a-zA-Z])/g,function(e,t,a){if("X"===t)return"function"==typeof o._customformat[s.mode]?o._customformat[s.mode](a,i,s):e;if("D"===t)switch(a){case"d":return r[0];case"l":return o._zPad(r[1]);case"M":return o._zPad(r[2]);case"S":return o._zPad(r[3]);case"A":return o.__("durationDays")[1===r[0]?0:1];default:return e}switch(a){case"a":return o.__("daysOfWeekShort")[i.getDay()];case"A":return o.__("daysOfWeek")[i.getDay()];case"b":return o.__("monthsOfYearShort")[i.getMonth()];case"B":return o.__("monthsOfYear")[i.getMonth()];case"C":return parseInt(i.getFullYear()/100);case"d":return o._zPad(i.getDate(),t);case"H":case"k":return o._zPad(i.getHours(),t);case"I":case"l":return o._zPad(i.get12hr(),t);case"m":return o._zPad(i.getMonth()+1,t);case"M":return o._zPad(i.getMinutes(),t);case"p":case"P":return n=o.__("meridiem")[i.get(3)<12?0:1].toUpperCase(),"P"===a?n.toLowerCase():n;case"s":return i.getEpoch();case"S":return o._zPad(i.getSeconds(),t);case"u":return o._zPad(i.getDay()+1,t);case"w":return i.getDay();case"y":return o._zPad(i.getFullYear()%100);case"Y":return i.getFullYear();case"E":return i.getFullYear()+543;case"V":return o._zPad(i.getDWeek(4),t);case"U":return o._zPad(i.getDWeek(0),t);case"W":return o._zPad(i.getDWeek(1),t);case"o":return"function"==typeof o._ord[s.useLang]?o._ord[s.useLang](i.getDate()):o._ord.default(i.getDate());case"j":return n=new o._date(i.getFullYear(),0,1),(n="000"+String(Math.ceil((i-n)/864e5)+1)).slice(-3);case"J":return i.toJSON();case"G":return n=i.getFullYear(),1===i.getDWeek(4)&&0<i.getMonth()?n+1:51<i.getDWeek(4)&&i.getMonth()<11?n-1:n;case"g":return n=i.getFullYear%100,1===i.getDWeek(4)&&0<i.getMonth()&&++n,51<i.getDWeek(4)&&i.getMonth()<11&&--n,o._zpad(n);default:return e}}),!0===o.__("useArabicIndic")&&!0===t&&(e=o._dRep(e)),e},_minStepFix:function(){var e=this.theDate.get(4),t=this.options.minuteStep,a=this.options.minStepRound,i=e%t;1<t&&0<i&&(a<0?e-=i:0<a?e+=t-i:e%t<t/2?e-=i:e+=t-i,this.theDate.setMinutes(e))},_newDateCheck:{enableDate:function(e){return-1<this.options.enableDates.indexOf(e.iso)},whiteDate:function(e){return!1!==this.options.whiteDates&&-1<this.options.whiteDates.indexOf(e.iso)},notToday:function(e){return!1!==this.options.notToday&&this.realToday.comp()===e.comp()},maxYear:function(e){var t=this.options.maxYear;return!1!==t&&e.get(0)>t},minYear:function(e){var t=this.options.minYear;return!1!==t&&e.get(0)<t},minDate:function(e){var t=this.options.minDate;return!1!==t&&e<(t=this.parseISO(t))},maxDate:function(e){var t=this.options.maxDate;return!1!==t&&((t=this.parseISO(t)).adj(2,1),t<e)},afterToday:function(e){return!1!==this.options.afterToday&&e<this.realToday},beforeToday:function(e){return!1!==this.options.beforeToday&&e>this.realToday},minmaxDays:function(e){var t,a,i=this.options.minDays,n=this.options.maxDays;return(!1!==i||!1!==n)&&(t=!1===i||this.realToday.getEpochDays()-(i+1)<e.getEpochDays(),a=!1===n||this.realToday.getEpochDays()+(n+1)>e.getEpochDays(),!(t&&a))},minHour:function(e){var t=this.options.minHour;return!1!==t&&e.get(3)<t},maxHour:function(e){var t=this.options.maxHour;return!1!==t&&e.get(3)>t},minTime:function(e){var t,a=this.options.minTime,i=e.get(3);return!1!==a&&(i<(t=this.options.minTime.split(":",2))[0]||!(i>t[0])&&e.get(4)<t[1])},maxTime:function(e){var t,a=this.options.maxTime,i=e.get(3);return!1!==a&&(!(i<(t=this.options.maxTime.split(":",2))[0])&&(i>t[0]||e.get(4)>t[1]))},validHours:function(e){return-1<this.options.validHours.indexOf(e.get(3))},blackDays:function(e){var t=this.options.blackDays;return!1!==t&&-1<t.indexOf(e.getDay())},blackDates:function(e){var t=this.options.blackDates;return!1!==t&&-1<t.indexOf(e.iso())},blackDatesRec:function(e){var t,a=this.options.blackDatesRec;if(!1===a)return!1;for(t=0;t<a.length;t++)if(!(-1!==a[t][0]&&a[t][0]!==e.get(0)||-1!==a[t][1]&&a[t][1]!==e.get(1)||-1!==a[t][2]&&a[t][2]!==e.get(2)))return!0;return!1}},_newDateChecker:function(e){var t,a=this,i=!1,n={good:!0,bad:!1,failrule:!1,passrule:!1,dateObj:e.copy()},o=["blackDays","blackDates","blackDatesRec","notToday","maxYear","minYear","afterToday","beforeToday","maxDate","minDate","minmaxDays","minHour","maxHour","minTime","maxTime"];if(a.realToday=new a._date,!1!==this.options.enableDates)return a._newDateCheck.whiteDate.call(a,e)?n.passrule="enableDates":(n.bad=!0,n.good=!1,n.failrule="enableDates"),n;if(!1!==this.options.validHours)return a._newDateCheck.validHours.call(a,e)?n.passrule="validHours":(n.bad=!0,n.good=!1,n.failrule="validHours"),n;if(a._newDateCheck.whiteDate.call(a,e))return n.passrule="whiteDates",n;for(t=0;t<o.length&&!i;t++)a._newDateCheck[o[t]].call(a,e)&&(n.bad=!0,n.good=!1,n.failrule=o[t],i=!0);return n},_getCleanDur:function(){var e=this,t=this,a=e.theDate.getEpoch()-e.initDate.getEpoch();return a<0&&(a=0,e.theDate=e.initDate.copy()),!1!==t.minDur&&a<t.minDur&&(e.theDate=new e._date(e.initDate.getTime()+1e3*t.minDur),a=t.minDur),!1!==t.maxDur&&a>t.maxDur&&(e.theDate=new e._date(e.initDate.getTime()+1e3*t.maxDur),a=t.maxDur),e.lastDuration=a,e.lastDurationA=e._dur(1e3*a),[a,e._dur(1e3*a)]},_check:function(){var e=this._newDateChecker(this.theDate);return this.dateOK=!0===e.good,e.good},_fixstepper:function(e){var t=this.options.durationSteppers,a=this.options.durationStep;-1<e.indexOf("d")&&(t.d=a),-1<e.indexOf("h")&&(t.d=1,t.h=a),-1<e.indexOf("i")&&(t.h=1,t.i=a),-1<e.indexOf("s")&&(t.i=1,t.s=a)},_ThemeDateCK:{selected:function(e){return!1!==this.options.slideHighPick&&(void 0!==this.originalDate&&this.originalDate.iso()===e.iso())},today:function(e){return!1!==this.options.slideHighToday&&this.realToday.iso()===e.iso()},highDates:function(e){var t=this.options.highDates;return!1!==t&&-1<t.indexOf(e.iso())},highDatesAlt:function(e){var t=this.options.highDatesAlt;return!1!==t&&-1<t.indexOf(e.iso())},highDatesRec:function(e){var t,a=this.options.highDatesRec;if(!1===a)return!1;for(t=0;t<a.length;t++)if(!(-1!==a[t][0]&&a[t][0]!==e.get(0)||-1!==a[t][1]&&a[t][1]!==e.get(1)||-1!==a[t][2]&&a[t][2]!==e.get(2)))return!0;return!1},highDays:function(e){var t=this.options.highDays;return!1!==t&&-1<t.indexOf(e.getDay())}},_parser:{default:function(e){return e}},_makeDate:function(e,t){var a,i,n,o,s=this,r=this.options,d=this.options.defaultValue,l=s.__fmt(),c=null,h=[],u=!1,p=new s._date,f={year:-1,mont:-1,date:-1,hour:-1,mins:-1,secs:-1,week:!1,wtyp:4,wday:!1,yday:!1,meri:0};if(void 0===t&&(t=!1),e=(!0===s.__("useArabicIndic")&&void 0!==e?s._dRep(e,-1):e).trim(),void 0===r.mode)return p;if(void 0!==s._parser[r.mode])return s._parser[r.mode].call(s,e);if("durationbox"===r.mode||"durationflipbox"===r.mode){if(l=l.replace(/%D([a-z])/gi,function(e,t){switch(t){case"d":case"l":case"M":case"S":return"("+e+"|[0-9]+)";default:return".+?"}}),c=(l=new RegExp("^"+l+"$")).exec(e),n=l.exec(s.__fmt()),null===c||c.length!==n.length)return"number"==typeof d&&0<d?new s._date(1e3*(s.initDate.getEpoch()+parseInt(d,10))):new s._date(s.initDate.getTime());for(i=s.initDate.getEpoch(),a=1;a<c.length;a++)o=parseInt(c[a],10),n[a].match(/^%Dd$/i)&&(i+=86400*o),n[a].match(/^%Dl$/i)&&(i+=3600*o),n[a].match(/^%DM$/i)&&(i+=60*o),n[a].match(/^%DS$/i)&&(i+=o);return new s._date(1e3*i)}if("%J"===l)return p=new s._date(e),isNaN(p.getDate())&&(p=new s._date),p;if(l=l.replace(/%(0|-)*([a-z])/gi,function(e,t,a){switch(h.push(a),a){case"p":case"P":case"b":case"B":return"("+e+"|.+?)";case"H":case"k":case"I":case"l":case"m":case"M":case"S":case"V":case"U":case"u":case"W":case"d":return"("+e+"|[0-9]{"+("-"===t?"1,":"")+"2})";case"j":return"("+e+"|[0-9]{3})";case"s":return"("+e+"|[0-9]+)";case"g":case"y":return"("+e+"|[0-9]{2})";case"E":case"G":case"Y":return"("+e+"|[0-9]{1,4})";default:return h.pop(),".+?"}}),c=(l=new RegExp("^"+l+"$")).exec(e),n=l.exec(s.__fmt()),null===c||c.length!==n.length){if(""!==e&&(u=!0),!1!==d&&""!==d)switch(typeof d){case"object":"function"==typeof d.getDay?p=d:3===d.length&&(p=s._pa(d,"time"===r.mode.substr(0,4)&&p));break;case"number":p=new s._date(1e3*d);break;case"string":p="time"===r.mode.substr(0,4)?(i=Object.assign([0,0,0],d.split(":",3)),s._pa(i,p)):((i=Object.assign([0,0,0],d.split("-",3)))[1]--,s._pa(i,!1))}isNaN(p.getDate())&&(p=new s._date)}else{for(a=1;a<c.length;a++)switch(o=parseInt(c[a],10),h[a-1]){case"s":return new s._date(1e3*parseInt(c[a],10));case"Y":case"G":f.year=o;break;case"E":f.year=o-543;break;case"y":case"g":r.afterToday||o<r.twoDigitYearCutoff?f.year=2e3+o:f.year=1900+o;break;case"m":f.mont=o-1;break;case"d":f.date=o;break;case"H":case"k":case"I":case"l":f.hour=o;break;case"M":f.mins=o;break;case"S":f.secs=o;break;case"u":f.wday=o-1;break;case"w":f.wday=o;break;case"j":f.yday=o;break;case"V":f.week=o,f.wtyp=4;break;case"U":f.week=o,f.wtyp=0;break;case"W":f.week=o,f.wtyp=1;break;case"p":case"P":o=new RegExp("^"+c[a]+"$","i"),f.meri=o.test(s.__("meridiem")[0])?-1:1;break;case"b":-1<(i=s.__("monthsOfYearShort").indexOf(c[a]))&&(f.mont=i);break;case"B":-1<(i=s.__("monthsOfYear").indexOf(c[a]))&&(f.mont=i)}if(0!==f.meri&&(-1===f.meri&&12===f.hour&&(f.hour=0),1===f.meri&&12!==f.hour&&(f.hour=f.hour+12)),p=new s._date(s._n(f.year,0),s._n(f.mont,0),s._n(f.date,1),s._n(f.hour,0),s._n(f.mins,0),s._n(f.secs,0),0),f.year<100&&-1!==f.year&&p.setFullYear(f.year),-1<f.mont&&-1<f.date||-1<f.hour&&-1<f.mins&&-1<f.secs)return!0===t?[p,u]:p;!1!==f.week&&(p.setDWeek(f.wtyp,f.week),-1<f.date&&p.setDate(f.date)),!1!==f.yday&&p.setD(1,0).setD(2,1).adj(2,f.yday-1),!1!==f.wday&&p.adj(2,f.wday-p.getDay())}return!0===t?[p,u]:p},_event:function(e,t){var a,i,n=y(this).data("jtsage-datebox"),o=y(this).data("jtsage-datebox").options;if(!e.isPropagationStopped())switch(t.method){case"close":void 0===t.closeCancel&&(t.closeCancel=!1),n.cancelClose=t.closeCancel,n.close();break;case"open":n.open();break;case"set":if("object"==typeof t.value)n.theDate=t.value,n._t({method:"doset"});else{if("inline"!==o.displayMode&&"blind"!==o.displayMode||(n.originalDate=n.theDate),y(this).val(t.value),!1!==o.linkedField)if("string"==typeof o.linkedField)y(o.linkedField).val(n.callFormat(o.linkedFieldFormat,n.theDate,!1));else for(i=0;i<o.linkedField.length;i++)y(o.linkedField[i].id).val(n.callFormat(o.linkedField[i].format,n.theDate,!1));n.skipChange=!0,y(this).trigger("change")}break;case"doset":"function"==typeof n[a="_"+n.options.mode+"DoSet"]?n[a].call(n):n._t({method:"set",value:n._formatter(n.__fmt(),n.theDate),date:n.theDate});break;case"dooffset":t.type&&n._offset(t.type,t.amount,!0);break;case"dorefresh":n.refresh();break;case"doclear":y(this).val("").trigger("change");break;case"clear":y(this).trigger("change")}},_build:{default:function(){!(this.d.headerText="Error")!==this.d.intHTML&&this.d.intHTML.remove().empty(),this.d.intHTML=y("<div style='width:100%'><h2 style='text-align:center;color:red;'>Unknown Mode</h2></div>")},calbox:function(){var e,t,a,i=this,n=this.options,o=new i._date,s=i.theDate.copy(!1,[0,0,1,12,1,1,1]),r=s.copy([0,1]).adj(2,-1),d=s.get(1),l=s.get(0),c=i.__("calStartDay")-s.getDay(),h=i.__("calStartDay")-r.getDay()+6,u=s.copy([0,0,c]),p=r.copy([0,0,h]),f=(p.getEpochDays()-u.getEpochDays()+1)/7,m=u.copy(),_=n.calShowWeek?8:7,b="",g="",D={},v="";if(i.firstOfGrid=u,i.lastOfGrid=p,i.firstOfMonth=s,i.lastOfMonth=r,"boolean"!=typeof i.d.intHTML&&(i.d.intHTML.remove(),i.d.intHTML=null),i.d.headerText=i._grabLabel(i.__("titleDateDialogLabel")),i.d.intHTML=y("<span>"),i.d.intHTML.addClass(n.theme_spanStyle),!1===n.calNoHeader&&(b=i.style_pnHead(i._formatter(i.__("calHeaderFormat"),i.theDate),!0===i.__("isRTL")?n.theme_cal_NextBtn:n.theme_cal_PrevBtn,!0===i.__("isRTL")?n.theme_cal_PrevBtn:n.theme_cal_NextBtn,"dbCalPrev","dbCalNext"),!0===i.__("isRTL")&&b.children().each(function(e,t){b.prepend(t)}),b.appendTo(i.d.intHTML),i.d.intHTML.on(n.clickEvent,".dbCalNext",function(e){return e.preventDefault(),e.stopPropagation(),28<i.theDate.getDate()&&i.theDate.setDate(1),i._offset("m",1),!1}).on(n.clickEvent,".dbCalPrev",function(e){return e.preventDefault(),e.stopPropagation(),28<i.theDate.getDate()&&i.theDate.setDate(1),i._offset("m",-1),!1})),!1!==n.calUsePickers&&(b=i.style_picker(i._pickRanges(d,l,o.get(0),n.calYearPickRelative),n.theme_cal_Pickers,"dbCalPickMonth","dbCalPickYear"),!0===i.__("isRTL")&&b.children().each(function(e,t){b.prepend(t)}),b.appendTo(i.d.intHTML),i.d.intHTML.on("change","#dbCalPickMonth, #dbCalPickYear",function(){28<i.theDate.get(2)&&i.theDate.setD(2,1),i.theDate.setD(1,y("#dbCalPickMonth").val()),i.theDate.setD(0,y("#dbCalPickYear").val()),i._t({method:"displayChange",selectedDate:i.originalDate,shownDate:i.theDate,thisChange:"p",thisChangeAmount:null,gridStart:i.firstOfGrid,gridEnd:i.lastOfGrid,selectedInGrid:i.isSelectedInCalGrid(),selectedInBounds:i.isSelectedInBounds()}),i.refresh()})),b=y(i.style_calGrid()).appendTo(i.d.intHTML).find(".dbCalGrid").first(),n.calShowDays){for(i._cal_days=i.__("daysOfWeekShort").concat(i.__("daysOfWeekShort")),v=i.style_calRow(),n.calShowWeek&&v.append(i.style_calTxt(" ",!1,8)),e=0;e<=6;e++)v.append(i.style_calTxt(i._cal_days[(e+i.__("calStartDay"))%7],!0,_));v.appendTo(b),!0===i.__("isRTL")&&v.children().each(function(e,t){v.prepend(t)})}for(n.calFormatter=i._prepFunc(n.calFormatter),n.calBeforeAppendFunc=i._prepFunc(n.calBeforeAppendFunc),t=0;t<f;t++){for(g=i.style_calRow(),n.calShowWeek&&g.append(i.style_calTxt(m.getDWeek(4),!1,8)),a=0;a<7;a++)(D=Object.assign(i._newDateChecker(m),i._cal_ThemeDate(m,d))).displayText=!1===n.calFormatter?D.dateObj.get(2):n.calFormatter.call(i,D),D.htmlObj=i.style_calBtn(D,_),D.eventObj=D.htmlObj.find(".dbEvent").first(),D.eventObj.data(D),!1!==n.calBeforeAppendFunc&&(D=n.calBeforeAppendFunc.call(i,D)),!1===n.calOnlyMonth||!0===D.inBounds?g.append(D.htmlObj):g.append(i.style_calTxt(" ",!1,_)),m.adj(2,1);!0===i.__("isRTL")&&g.children().each(function(e,t){g.prepend(t)}),g.appendTo(b)}!1!==n.calShowDateList&&!1!==n.calDateList&&(i.style_dateList(i.__("calDateListLabel"),n.calDateList,n.theme_cal_DateList,"dbCalPickList").appendTo(i.d.intHTML),i.d.intHTML.on("change","#dbCalPickList",function(){var e=y(this).val().split("-");i.theDate=new i._date(e[0],e[1]-1,e[2],12,1,1,1),i._t({method:"doset"})})),i.d.intHTML.append(i._doBottomButtons.call(i,!1)),i.d.intHTML.on(n.clickEvent,".dbEvent",function(e){e.preventDefault(),y(this).data("good")&&(i.theDate=y(this).data("dateObj").copy(),i._t({method:"set",value:i._formatter(i.__fmt(),i.theDate),date:i.theDate}),i._t({method:"close"}))}).on(i.wheelEvent,function(e,t){e.preventDefault(),t=void 0===t?Math.sign(e.originalEvent.wheelDelta):t,i.theDate.setD(2,1),i._offset("m",0<t?1:-1)})},timebox:function(){this._build.datebox.call(this)},datetimebox:function(){this._build.datebox.call(this)},durationbox:function(){this._build.datebox.apply(this,[])},datebox:function(){var e,t,a,i,n=this,o=this.options,s=n.style_dboxCtr(),r="durationbox"===o.mode,d=["d","h","i","s"];for("boolean"!=typeof n.d.intHTML&&n.d.intHTML.empty().remove(),n.d.headerText=n._grabLabel("datebox"===o.mode||"datetimebox"===o.mode?n.__("titleDateDialogLabel"):n.__("titleTimeDialogLabel")),n.d.intHTML=y("<span>"),n.d.intHTML.addClass(o.theme_spanStyle),n.fldOrder=n._getFldOrder(o.mode),r?(n.dateOK=!0,n._fixstepper(n.fldOrder)):(n._check(),n._minStepFix()),"datebox"!==o.mode&&"datetimebox"!==o.mode||n.style_subHead(n._formatter(n.__("headerFormat"),n.theDate)).appendTo(n.d.intHTML),i=n.style_dboxRow(),t=0;t<n.fldOrder.length;t++)"a"===n.fldOrder[t]&&12!==n.__("timeFormat")||(e=r?o.durationSteppers[n.fldOrder[t]]:"i"===n.fldOrder[t]?o.minuteStep:1,(a=n.style_dboxCtrl(o.theme_dbox_PrevBtn,o.theme_dbox_NextBtn,n.fldOrder[t],r?n.__("durationLabel")[d.indexOf(n.fldOrder[t])]:null,o.theme_dbox_Inputs)).find("input").data({field:n.fldOrder[t],amount:e}),a.find(".dbBoxNext").data({field:n.fldOrder[t],amount:e}),a.find(".dbBoxPrev").data({field:n.fldOrder[t],amount:-1*e}),i.append(a));!0===n.__("isRTL")&&i.children().each(function(e,t){i.prepend(t)}),s.append(i),s.appendTo(n.d.intHTML),n._dbox_run_update(!0),n.d.intHTML.append(n._doBottomButtons.call(n,!0)),n.d.intHTML.on("change","input",function(){n._dbox_enter(y(this))}).on("keypress","input",function(e){13===e.which&&!0===n.dateOK&&(n._dbox_enter(y(this)),n._t({method:"set",value:n._formatter(n.__fmt(),n.theDate),date:n.theDate}),n._t({method:"close"}))}).on(n.wheelEvent,"input",function(e,t){e.preventDefault(),t=void 0===t?Math.sign(e.originalEvent.wheelDelta):t,n._offset(y(this).data("field"),(t<0?-1:1)*y(this).data("amount"))}).on(o.clickEvent,".dbBoxPrev, .dbBoxNext",function(e){n.d.intHTML.find(":focus").blur(),e.preventDefault(),n._offset(y(this).data("field"),y(this).data("amount"))})},timeflipbox:function(){this._build.flipbox.call(this)},datetimeflipbox:function(){this._build.flipbox.call(this)},durationflipbox:function(){this._build.flipbox.call(this)},flipbox:function(){var e,t,a,i=this,n=this.options,o=this.drag,s=i.style_fboxCtr(n.theme_fbox_RollHeight).addClass("dbRollerV "),r="",d="",l="durationflipbox"===n.mode;if("boolean"!=typeof i.d.intHTML?i.d.intHTML.empty().remove():i.d.input.on("datebox",function(e,t){"postrefresh"===t.method&&i.style_fboxPos()}),i.d.headerText=i._grabLabel("datebox"===n.mode||"datetimebox"===n.mode?i.__("titleDateDialogLabel"):i.__("titleTimeDialogLabel")),i.d.intHTML=y("<span>"),i.d.intHTML.addClass(n.theme_spanStyle),i.fldOrder=i._getFldOrder(n.mode),l?(i.dateOK=!0,i._getCleanDur(),i._fixstepper(i.fldOrder)):(i._check(),i._minStepFix()),n.fboxNatural="default"===n.fboxNatural?!!l:n.fboxNatural,"flipbox"!==n.mode&&"datetimeflipbox"!==n.mode||i.style_subHead(i._formatter(i.__("headerFormat"),i.theDate)).appendTo(i.d.intHTML),l){for(r=i.style_fboxDurLbls(),t=0;t<i.fldOrder.length;t++)e=i.fldOrder[t],r.append(i.style_fboxDurLbl(i.__("durationLabel")[["d","h","i","s"].indexOf(e)],i.fldOrder.length));!0===i.__("isRTL")&&r.css({direction:"rtl"}),i.d.intHTML.append(r)}for(t=0;t<i.fldOrder.length;t++){for(e=i.fldOrder[t],r=i.style_fboxRollCtr(i.fldOrder.length).addClass("dbRollerC"),d=i.style_fboxRollPrt().addClass("dbRoller"),r.data({field:e,amount:l?n.durationSteppers[e]:"i"===e?n.minuteStep:1}),a=-1*n.flen[e];a<n.flen[e]+1;a++)l?d.append(i.style_fboxRollCld(i._fbox_do_dur_math(e,a,t),0===a?n.theme_fbox_Selected:n.theme_fbox_Default)):d.append(i.style_fboxRollCld(i._fbox_do_roll_math(e,a),0===a?i.dateOK?n.theme_fbox_Selected:n.theme_fbox_Forbidden:n.theme_fbox_Default));n.fboxNatural&&d.children().each(function(e,t){d.prepend(t)}),r.append(d),!0===i.__("isRTL")?s.prepend(r):s.append(r)}i.d.intHTML.append(s),i.style_fboxLens().addClass("dbLens").css({pointerEvents:"none",position:"relative"}).appendTo(i.d.intHTML),i.d.intHTML.append(i._doBottomButtons.call(i,!0)),i.d.intHTML.on(o.eStart,".dbRoller",function(e,t){o.move||(void 0!==t&&(e=t),o.move=!0,o.target=y(this).children().first(),o.pos=parseInt(o.target.css("marginTop").replace(/px/i,""),10),o.start="touch"===e.type.substr(0,5)?e.originalEvent.changedTouches[0].pageY:e.pageY,o.end=!1,o.direc=n.fboxNatural?-1:1,o.velocity=0,o.time=Date.now(),e.stopPropagation(),e.preventDefault())})},slidebox:function(){var e,t,a=this,i=this.options,n=new a._date,o=a.theDate.get(1),s=a.theDate.get(0),r=a.theDate.copy(!1,[0,0,0,12,1,1,1]).adj(2,-3),d="",l={};for("boolean"!=typeof a.d.intHTML&&(a.d.intHTML.remove(),a.d.intHTML=null),a.dateOK=!0,a.d.headerText=a._grabLabel(a.__("titleDateDialogLabel")),a.d.intHTML=y("<span>"),a.d.intHTML.addClass(i.theme_spanStyle),!1===i.slideNoHeader&&(a.style_pnHead(a._formatter(a.__("calHeaderFormat"),a.theDate),i.theme_slide_PrevBtn,i.theme_slide_NextBtn,"dbSlidePrev","dbSlideNext").appendTo(a.d.intHTML),a.d.intHTML.on(i.clickEvent,".dbSlideNext",function(e){return e.preventDefault(),e.stopPropagation(),28<a.theDate.getDate()&&a.theDate.setDate(1),a._offset("m",1),!1}).on(i.clickEvent,".dbSlidePrev",function(e){return e.preventDefault(),e.stopPropagation(),28<a.theDate.getDate()&&a.theDate.setDate(1),a._offset("m",-1),!1})),!1!==i.slideUsePickers&&(a.style_picker(a._pickRanges(o,s,n.get(0),i.slideYearPickRelative),i.theme_slide_Pickers,"dbSlidePickMonth","dbSlidePickYear").appendTo(a.d.intHTML),a.d.intHTML.on("change","#dbSlidePickMonth, #dbSlidePickYear",function(){28<a.theDate.get(2)&&a.theDate.setD(2,1),a.theDate.setD(1,y("#dbSlidePickMonth").val()),a.theDate.setD(0,y("#dbSlidePickYear").val()),a.refresh()})),e=y(a.style_slideGrid()).appendTo(a.d.intHTML).find(".dbSlideGrid").first(),(d=a.style_slideRow()).append(a.style_slideCtrl("dbSlideWkPrev",!0===a.__("isRTL")?i.theme_slide_NextDateBtn:i.theme_slide_PrevDateBtn)),t=-3;t<=3;t++)(l=Object.assign(a._newDateChecker(r),a._slide_ThemeDate(r))).htmlObj=a.style_slideBtn(l),l.eventObj=l.htmlObj.find(".dbEventS").first(),l.eventObj.data(l),d.append(l.htmlObj),r.adj(2,1);d.append(a.style_slideCtrl("dbSlideWkNext",!0===a.__("isRTL")?i.theme_slide_PrevDateBtn:i.theme_slide_NextDateBtn)),!0===a.__("isRTL")&&d.children().each(function(e,t){d.prepend(t)}),d.appendTo(e),!1!==i.slideShowDateList&&!1!==i.slideDateList&&(a.style_dateList(a.__("calDateListLabel"),i.slideDateList,i.theme_slide_DateList,"dbSlidePickList").appendTo(a.d.intHTML),a.d.intHTML.on("change","#dbSlidePickList",function(){var e=y(this).val().split("-");a.theDate=new a._date(e[0],e[1]-1,e[2],12,1,1,1),a._t({method:"doset"})})),a.d.intHTML.append(a._doBottomButtons.call(a,!1)),a.d.intHTML.on(i.clickEvent,".dbEventS",function(e){e.preventDefault(),y(this).data("good")&&(a.theDate=y(this).data("dateObj").copy(),a._t({method:"set",value:a._formatter(a.__fmt(),a.theDate),date:a.theDate}),a._t({method:"close"}))}).on(i.clickEvent,".dbSlideWkNext",function(e){return e.preventDefault(),e.stopPropagation(),a._offset("d",7),!1}).on(i.clickEvent,".dbSlideWkPrev",function(e){return e.preventDefault(),e.stopPropagation(),a._offset("d",-7),!1}).on(a.wheelEvent,function(e,t){e.preventDefault(),t=void 0===t?Math.sign(e.originalEvent.wheelDelta):t,a._offset("d",0<t?7:-7)})}},_drag:{default:function(){return!1},timeflipbox:function(){this._drag.flipbox.call(this)},datetimeflipbox:function(){this._drag.flipbox.call(this)},durationflipbox:function(){this._drag.flipbox.call(this)},flipbox:function(){var d=this,l=this.options,c=this.drag;y(document).on(c.eMove,function(e){if(c.move&&"flipbox"===l.mode.slice(-7))return c.end="touch"===e.type.substr(0,5)?e.originalEvent.changedTouches[0].pageY:e.pageY,c.target.css("margin-top",c.pos+c.end-c.start),c.elapsed=Date.now()-c.time,c.velocity=100*(c.end-c.start)/(1+c.elapsed)*.8+.2*c.velocity,e.preventDefault(),e.stopPropagation(),!1}),y(document).on(c.eEnd,function(e){var t,a,i,n,o,s,r;c.move&&"flipbox"===l.mode.slice(-7)&&(c.velocity<15&&-15<c.velocity||!l.useKinetic?((c.move=!1)!==c.end&&(e.preventDefault(),e.stopPropagation(),c.tmp=c.target.closest(".dbRollerC"),t=!1!==l.flipSizeOverride?l.flipSizeOverride:c.target[0].getBoundingClientRect().height,d._offset(c.tmp.data("field"),parseInt((c.start-c.end)/t,10)*c.tmp.data("amount")*c.direc)),c.start=!1,c.end=!1):(c.move=!1,c.start=!1,c.end=!1,c.tmp=c.target.closest(".dbRollerC"),t=!1!==l.flipSizeOverride?l.flipSizeOverride:c.target[0].getBoundingClientRect().height,a=-.8*c.velocity*Math.exp(-c.elapsed/325)*8*-1,i=parseInt(c.target.css("marginTop").replace(/px/i,""),10),n=parseInt(i+a,10),o=c.pos-n,s=Math.round(o/t),r=s*c.tmp.data("amount")*c.direc,c.target.animate({marginTop:n},parseInt(1e4/c.velocity)+1e3,function(){d._offset(c.tmp.data("field"),r)}),e.preventDefault(),e.stopPropagation()))})}},_offset:function(e,t,a){var i,n,o,s,r=this,d=r.options,l=["y","m","d","h","i","s"].indexOf(e),c=32-r.theDate.copy([0],[0,0,32,13]).getDate(),h=[31,32-r.theDate.copy([0],[0,1,32,13]).getDate(),31,30,31,30,31,31,30,31,30,31],u="a"!==e&&("y"===e||void 0===d.rolloverMode[e]||!0===d.rolloverMode[e]);if(void 0===a&&(a=!0),"y"===e&&1===r.theDate.get(1)&&29===r.theDate.get(2)&&r.theDate.setD(2,28),"a"===e)t%2!=0&&(i=11<r.theDate.get(3)?-12:12,r.theDate.adj(3,i));else if(u)r.theDate.adj(l,t);else{switch(e){case"m":n=11,o=0,s=12;break;case"d":o=1,s=n=c;break;case"h":n=23,o=0,s=24;break;case"i":case"s":n=59,o=0,s=60}(i=r.theDate.get(l)+t)<o?i=i%s+s:n<i&&(i%=s),"m"===e&&r.theDate.get(2)>h[i]&&r.theDate.setD(2,h[i]),r.theDate.setD(l,i)}!0===a&&r.refresh(),d.useImmediate&&r._t({method:"doset"}),"calbox"===d.mode&&r._t({method:"displayChange",selectedDate:r.originalDate,shownDate:r.theDate,thisChange:e,thisChangeAmount:t,gridStart:r.getCalStartGrid(),gridEnd:r.getCalEndGrid(),selectedInGrid:r.isSelectedInCalGrid(),selectedInBounds:r.isSelectedInBounds()}),r._t({method:"offset",type:e,amount:t,newDate:r.theDate})},_startOffset:function(e){var t=this.options;return!1!==t.startOffsetYears&&e.adj(0,t.startOffsetYears),!1!==t.startOffsetMonths&&e.adj(1,t.startOffsetMonths),!1!==t.startOffsetDays&&e.adj(2,t.startOffsetDays),e},_posZero:function(e){return e<0?0:e},getModalPosition:function(){var e=this.options.displayForcePosition,t=this.d.mainWrap[0].getBoundingClientRect();return!1!==e?{position:"absolute",top:e[0],left:e[1]}:{position:"fixed",top:"50%",left:"50%","margin-left":t.width/2*-1,"margin-top":t.height/2*-1}},getDropPosition:function(e){var t,a=this,i=this.options,n=this.options.displayForcePosition,o=a.d.wrap[0].getBoundingClientRect(),s=a.d.mainWrap[0].getBoundingClientRect(),r=window.pageYOffset,d=window.pageXOffset,l=Math.max(document.documentElement.clientWidth,window.innerWidth||0)<=i.breakpointWidth.replace("px","");return void 0===(t={centerLeft:{top:a._posZero(r+o.top+o.height/2-s.height/2),left:a._posZero(d+o.left)},centerRight:{top:a._posZero(r+o.top+o.height/2-s.height/2),left:a._posZero(d+o.left+o.width-s.width)},centerMiddle:{top:a._posZero(r+o.top+o.height/2-s.height/2),left:a._posZero(d+o.left+o.width/2-s.width/2)},topLeft:{top:a._posZero(r+o.top-s.height-1),left:a._posZero(d+o.left)},topRight:{top:a._posZero(r+o.top-s.height-1),left:a._posZero(d+o.left+o.width-s.width)},topMiddle:{top:a._posZero(r+o.top-s.height-1),left:a._posZero(d+o.left+o.width/2-s.width/2)},bottomLeft:{top:a._posZero(r+o.top+o.height),left:a._posZero(d+o.left)},bottomRight:{top:a._posZero(r+o.top+o.height),left:a._posZero(d+o.left+o.width-s.width)},bottomMiddle:{top:a._posZero(r+o.top+o.height),left:a._posZero(d+o.left+o.width/2-s.width/2)}})[e]&&(e="bottomRight"),!1!==n?{position:"absolute",top:n[0],left:n[1]}:{position:"absolute",top:t[e].top,left:l?0:t[e].left}},getTheDate:function(){return this.theDate},getSelectedDate:function(){return this.originalDate},getLastDur:function(){return this.lastDuration},dateVisible:function(){return void 0===this.isSelectedInCalGrid||this.isSelectedInCalGrid()},setTheDate:function(e){this.theDate="object"==typeof e?e:this._makeDate(e),this.refresh(),this._t({method:"doset"})},parseDate:function(e,t){var a;return this.fmtOver=e,a=this._makeDate(t),this.fmtOver=!1,a},parseISO:function(e){return this.parseDate("%Y-%m-%d",e)},callFormat:function(e,t,a){return void 0===a&&(a=!1),this._formatter(e,t,a)},refresh:function(){var e=this,t=this.options;"function"!=typeof e._build[t.mode]?e._build.default.call(e):e._build[t.mode].call(e),!0===e.__("useArabicIndic")&&e._doIndic(),e.d.mainWrap.append(e.d.intHTML),e._t({method:"postrefresh"})},applyMinMax:function(e,t){var a,i=this.options,n=RegExp(/\d\d\d\d-\d\d-\d\d/);void 0===e&&(e=!0),void 0===t&&(t=!0),!0!==t&&!1!==i.minDate||(a=this.d.input.attr("min"),n.test(a)&&(i.minDate=a)),!0!==t&&!1!==i.maxDate||(a=this.d.input.attr("max"),n.test(a)&&(i.maxDate=a)),!0===e&&this._t({method:"refresh"})},_dur:function(e){return[Math.max(0,Math.floor(e/864e5)),Math.max(0,Math.floor(e/36e5%24)),Math.max(0,Math.floor(e/6e4%60)),Math.max(0,Math.floor(e/1e3%60))]},__:function(e){var t=this.options,a=t.lang[t.useLang],i=t[t.mode+"lang"],n="override"+e.charAt(0).toUpperCase()+e.slice(1);return void 0!==t[n]?t[n]:void 0!==a&&void 0!==a[e]?a[e]:void 0!==i&&void 0!==i[e]?i[e]:void 0!==t.lang.default[e]?t.lang.default[e]:"Err:NotFound"},__fmt:function(){var e=this,t=this.options;if(void 0!==e.fmtOver&&!1!==e.fmtOver)return e.fmtOver;switch(t.mode){case"timebox":case"timeflipbox":return e.__("timeOutput");case"durationbox":case"durationflipbox":return e.__("durationFormat");case"datetimebox":case"datetimeflipbox":return e.__("datetimeFormat");default:return e.__("dateFormat")}},_zPad:function(e,t){return void 0!==t&&"-"===t?String(e):(e<10?"0":"")+String(e)},_dRep:function(e,t){var a,i,n=48,o=57,s=1584,r="";for(-1===t&&(n+=s,o+=s,s=-1584),i=0;i<e.length;i++)r+=n<=(a=e.charCodeAt(i))&&a<=o?String.fromCharCode(a+s):String.fromCharCode(a);return r},_doIndic:function(){var e=this;e.d.intHTML.find("*").each(function(){y(this).children().length<1&&y(this).html(e._dRep(y(this).html()))}),e.d.intHTML.find("input").each(function(){y(this).val(e._dRep(y(this).val()))})},_n:function(e,t){return e<0?t:e},_pa:function(e,t){return"boolean"==typeof t?new this._date(e[0],e[1],e[2],0,0,0,0):new this._date(t.get(0),t.get(1),t.get(2),e[0],e[1],e[2],0)},_btwn:function(e,t,a){return t<e&&e<a},_grabLabel:function(e){var t,a,i=this.options,n=!1;return void 0===i.overrideDialogLabel?(t=this.d.input.attr("placeholder"),a=this.d.input.attr("title"),void 0!==t?t:void 0!==a?a:""===(n=y(document).find("label[for='"+this.d.input.attr("id")+"']").text())?e:n):i.overrideDialogLabel},_getFldOrder:function(e){switch(e){case"durationbox":case"durationflipbox":return this.__("durationOrder");case"timebox":case"timeflipbox":return this.__("timeFieldOrder");case"datetimebox":case"datetimeflipbox":return this.__("datetimeFieldOrder");default:return this.__("dateFieldOrder")}},_t:function(e){this.d.input.trigger("datebox",e)},_prepFunc:function(e){return!1===e||"function"==typeof e?e:"function"==typeof window[e]&&window[e]},_pickRanges:function(e,t,a,i){var n,o=this.options,s=!1===i?a:t,r=0,d=0,l={month:[],year:[]};for(n=0;n<=11;n++)n===e?l.month.push([n,this.__("monthsOfYear")[n],!0]):l.month.push([n,this.__("monthsOfYear")[n],!1]);for(r=o.calYearPickMin<1?s+o.calYearPickMin:o.calYearPickMin<1800?s-o.calYearPickMin:"NOW"===o.calYearPickMin?a:o.calYearPickMin,d=o.calYearPickMax<1800?s+o.calYearPickMax:"NOW"===o.calYearPickMax?a:o.calYearPickMax,n=r;n<=d;n++)n===t?l.year.push([n,n,!0]):l.year.push([n,n,!1]);return l},_stdSel:function(e,t,a){var i,n="<select class='"+a+"' id='"+t+"'>";for(i=0;i<e.length;i++)n+="<option value='"+e[i][0]+"'"+(!0===e[i][2]?" selected='selected'":"")+">"+e[i][1]+"</option>";return n+="</select>"},_stdBtn:{cancel:function(){var t=this,e=this.options;return y(t.style_btn(e.theme_cancelBtn,t.__("cancelButton"))).on(e.clickEvent,function(e){e.preventDefault(),t._t({method:"close",closeCancel:!0})})},clear:function(){var t=this,e=this.options;return y(t.style_btn(e.theme_clearBtn,t.__("clearButton"))).on(e.clickEvent,function(e){e.preventDefault(),t.d.input.val(""),t._t({method:"clear"}),t._t({method:"close",closeCancel:!0})})},close:function(e,t){var a=this,i=this.options;return void 0===t&&(t=!1),y(a.style_btn(i.theme_closeBtn,e)).addClass(!0===a.dateOK?"":"disabled").on(i.clickEvent,function(e){e.preventDefault(),!0===a.dateOK&&(!1===t?a._t({method:"set",value:a._formatter(a.__fmt(),a.theDate),date:a.theDate}):a._t(t),a._t({method:"close"}))})},today:function(){var t=this,a=this.options;return y(t.style_btn(a.theme_todayBtn,t.__("todayButtonLabel"))).on(a.clickEvent,function(e){e.preventDefault(),t.theDate=t._pa([0,0,0],new t._date),t._t({method:"doset"}),!1!==a.closeTodayButton&&t._t({method:"close"})})},tomorrow:function(){var t=this,a=this.options;return y(t.style_btn(a.theme_tomorrowBtn,t.__("tomorrowButtonLabel"))).on(a.clickEvent,function(e){e.preventDefault(),t.theDate=t._pa([0,0,0],new t._date).adj(2,1),t._t({method:"doset"}),!1!==a.closeTomorrowButton&&t._t({method:"close"})})}},_doBottomButtons:function(e){var t,a,i=this,n=this.options;if(!(n.useSetButton&&e||n.useTodayButton||n.useTomorrowButton||n.useClearButton||n.useCancelButton))return"";if(t=i.style_btnGrp(n.useCollapsedBut),n.useSetButton&&e){switch(n.mode){case"timebox":case"timeflipbox":a=i.__("setTimeButtonLabel");break;case"durationbox":case"duartionflipbox":a=i.__("setDurationButtonLabel");break;default:a=i.__("setDateButtonLabel")}i.setBut=i._stdBtn.close.call(i,a),i.setBut.appendTo(t)}return n.useTodayButton&&t.append(i._stdBtn.today.call(i)),n.useTomorrowButton&&t.append(i._stdBtn.tomorrow.call(i)),n.useClearButton&&t.append(i._stdBtn.clear.call(i)),n.useCancelButton&&t.append(i._stdBtn.cancel.call(i)),"function"==typeof i.style_btnGrpOut&&(t=i.style_btnGrpOut(n.useCollapsedBut,t)),t},close:function(){var e,t=this,a=this.options,i={};switch(a.closeCallback=t._prepFunc(a.closeCallback),!1!==a.closeCallback?i.afterclose=function(){a.closeCallback.apply(t,[{initDate:t.initDate,date:t.theDate,duration:t.lastDuration,cancelClose:t.cancelClose}].concat(a.closeCallbackArgs))}:i.afterclose=function(){return!0},a.displayMode){case"blind":t.d.mainWrap.slideUp();case"inline":return i.afterclose.call(),!0;default:y(".jtsage-datebox-backdrop-div").remove(),t.d.mainWrap.removeClass("db-show"),i.afterclose.call(),t.d.mainWrap.hide(),t.d.mainWrap.detach()}y(document).off(t.drag.eMove).off(t.drag.eEnd).off(t.drag.eEndA).off("resize"+t.eventNamespace).off("keydown"+t.eventNamespace),a.useFocus&&(t.fastReopen=!0,setTimeout((e=t,function(){e.fastReopen=!1}),300))},_create:function(){y(document).trigger("dateboxcreate");var e,t,a=this,i=Object.assign(this.options,this._getLongOptions(this.element),this.element.data("options")),n={input:this.element,wrap:this.element.parent(),mainWrap:y("<div class='dbContainer_"+this.uuid+"'>").css("zIndex",i.zindex),intHTML:!1},o="<style>.dbContainer_"+this.uuid+" { touch-action: none; width: "+i.controlWidth+i.controlWidthImp+"} @media (max-width: "+i.breakpointWidth+") { .dbContainer_"+this.uuid+" { width: 100% "+i.controlWidthImp+"} } "+(!1!==i.theme_headStyle?i.theme_headStyle:"")+"</style>",s=".datebox"+this.uuid,r={eStart:"touchstart"+s+" mousedown"+s,eMove:"touchmove"+s+" mousemove"+s,eEnd:"touchend"+s+" mouseup"+s,eEndA:["mouseup","touchend","touchcancel","touchmove"].join(s+" ")+s,move:!1,start:!1,end:!1,pos:!1,target:!1,delta:!1,tmp:!1};y("head").append(y(o)),a.d=n,a.drag=r,a.icons=this.icons,!1!==i.usePlaceholder&&a.d.input.attr("placeholder",a._grabLabel("string"==typeof i.usePlaceholder?i.usePlaceholder:"")),a.wheelEvent=i.disableWheel?"nonsenseEvent":void 0!==y.event.special.mousewheel?"mousewheel":"wheel",a.firstOfGrid=!1,a.lastOfGrid=!1,a.selectedInGrid=!1,a.skipChange=!1,a.cancelClose=!1,a.disabled=!1,a._date=window.Date,a._enhanceDate(),a.baseID=a.d.input.attr("id"),a.initDate=new a._date,a.initDate.setMilliseconds(0),a.theDate=i.defaultValue?a._makeDate():""!==a.d.input.val()?a._makeDate(a.d.input.val()):new a._date,""===a.d.input.val()&&a._startOffset(a.theDate),a.initDone=!1,i.showInitialValue&&a.d.input.val(a._formatter(a.__fmt(),a.theDate)),a.d.wrap=a.style_inWrap(a.d.input,i.theme_openButton),!1!==i.mode&&!1===i.buttonIcon&&(i.buttonIcon="time"===i.mode.substr(0,4)||"dur"===i.mode.substr(0,3)?i.buttonIconTime:i.buttonIconDate),i.useButton?(y(a.style_inBtn(i.buttonIcon,a.__("tooltip"),i.theme_openButton)).appendTo(a.d.wrap),a.d.wrap.on(i.clickEvent,".dbOpenButton",function(e){e.preventDefault(),i.useFocus?a.d.input.focus():a.disabled||a._t({method:"open"})})):a.style_inNoBtn(a.d.wrap),i.hideInput&&a.style_inHide(),i.runOnBlurCallback=a._prepFunc(i.runOnBlurCallback),a.d.input.on("focus.datebox",function(){!1===a.disabled&&i.useFocus&&a._t({method:"open"})}).on("change.datebox",function(){if(a.skipChange)return!(a.skipChange=!1);!1===i.runOnBlurCallback?!0===i.safeEdit?!1===(e=a._makeDate(a.d.input.val(),!0))[1]?a.theDate=e[0]:(a.theDate=a.originalDate,a._t({method:"doset"})):a.theDate=a._makeDate(a.d.input.val()):(e=a._makeDate(a.d.input.val(),!0),"object"!=typeof(t=i.runOnBlurCallback.call(a,{origDate:a.originalDate,input:a.d.input.val(),oldDate:a.theDate,newDate:e[0],isGood:!e[1],isBad:e[1]}))?a.theDate=e[0]:(a.theDate=t,a._t({method:"doset"}))),a.originalDate=a.theDate.copy(),a.refresh()}).on("datebox",a._event),i.lockInput&&a.d.input.attr("readonly","readonly"),a.d.input.is(":disabled")&&a.disable(),a.applyMinMax(!1,!1),"inline"!==i.displayMode&&"blind"!==i.displayMode||a.open(),y(document).trigger("dateboxaftercreate")},_destroy:function(){var e=this,t=this.options,a=e.d.wrap.find("dbOpenButton");!0===t.useButton&&(a.remove(),e.d.input.unwrap()),t.lockInput&&e.d.input.removeAttr("readonly"),e.d.input.off("datebox").off("focus.datebox").off("blur.datebox").off("change.datebox"),y(document).off(e.drag.eMove).off(e.drag.eStart).off(e.drag.eEnd).off(e.drag.eEndA).off("resize"+e.eventNamespace)},disable:function(){this.d.input.attr("disabled",!0),this.disabled=!0,this._t({method:"disable"})},enable:function(){this.d.input.attr("disabled",!1),this.disabled=!1,this._t({method:"enable"})},open:function(){var t=this,a=this.options,e=a.displayMode,i={};if(a.useFocus&&!0===t.fastReopen)return t.d.input.blur(),!1;if(t.theDate=t._makeDate(t.d.input.val()),t.originalDate=t.theDate.copy(),""===t.d.input.val()&&t._startOffset(t.theDate),t.d.input.blur(),"function"!=typeof t._build[a.mode]?t._build.default.call(t):t._build[a.mode].call(t),"function"==typeof t._drag[a.mode]&&t._drag[a.mode].call(t),t._t({method:"refresh"}),!0===t.__("useArabicIndic")&&t._doIndic(),t.d.intHTML.is(":visible"))return!1;if(t.d.mainWrap.empty(),a.useHeader&&t.d.mainWrap.append(y(t.style_mainHead(t.d.headerText,a.theme_headerTheme,a.theme_headerBtn))).find(".dbCloser").on(a.clickEvent,function(e){e.preventDefault(),t._t({method:"close",closeCancel:!0})}),t.d.mainWrap.append(t.d.intHTML).css("zIndex",a.zindex),t._t({method:"postrefresh"}),a.openCallback=t._prepFunc(a.openCallback),!1!==a.openCallback?i.afteropen=function(){t._t({method:"postrefresh"}),!1===a.openCallback.apply(t,[{initDate:t.initDate,date:t.theDate,duration:t.lastDuration}].concat(a.openCallbackArgs))&&t._t({method:"close"})}:i.afteropen=function(){t._t({method:"postrefresh"})},a.beforeOpenCallback=t._prepFunc(a.beforeOpenCallback),!1!==a.beforeOpenCallback&&!1===a.beforeOpenCallback.apply(t,[{initDate:t.initDate,date:t.theDate,duration:t.lastDuration}].concat(a.beforeOpenCallbackArgs)))return!1;switch(a.displayMode){case"inline":case"blind":t.initDone?"blind"===a.displayMode&&(t.refresh(),t.d.mainWrap.slideDown()):(t.d.mainWrap.insertAfter(t.style_attach(!0)).addClass(a.theme_inlineContainer).css({zIndex:"auto",marginRight:"right"===a.displayInlinePosition?0:"auto",marginLeft:"left"===a.displayInlinePosition?0:"auto"}),"blind"===a.displayMode&&t.d.mainWrap.hide(),t.initDone=!0),t._t({method:"postrefresh"});break;default:t.d.mainWrap.show().css("zIndex",a.zindex).appendTo(t.style_attach(!1)).addClass(a.theme_modalContainer).one(a.tranDone,function(){t.d.mainWrap.is(":visible")?i.afteropen.call():(i.afterclose.call(),t.d.mainWrap.removeClass("db-show"))}),t.d.backdrop=y("<div class='jtsage-datebox-backdrop-div'></div>").css(a.theme_backgroundMask).css("zIndex",a.zindex-1).appendTo("modal"===a.displayMode?t.style_attach(!1):"body").on(a.clickEvent,function(e){e.preventDefault(),a.dismissOutsideClick&&t._t({method:"close",closeCancel:!0})}),t.d.mainWrap.css("modal"===a.displayMode?t.getModalPosition.call(t):t.getDropPosition.call(this,a.displayDropdownPosition))}"modal"!==e&&"dropdown"!==e||(y(document).on("resize"+t.eventNamespace,function(){this.d.mainWarp.css("modal"===e?this.getModalPosition.call(this):this.getDropPosition.call(this,this.options.displayDropdownPosition))}.bind(t)),a.dismissOnEscape&&y(document).on("keydown"+t.eventNamespace,function(e){("key"in e?"Escape"===e.key||"Esc"===e.key:27===e.keyCode)&&this._t({method:"close",closeCancel:!0})}.bind(t))),window.setTimeout(function(){t.d.mainWrap.addClass("db-show")},0),window.setTimeout(function(){t.d.mainWrap.trigger("oTransitionEnd")},200)},getCalStartGrid:function(){return this.firstOfGrid},getCalEndGrid:function(){return this.lastOfGrid},isSelectedInCalGrid:function(){var e=this;return!1!==e.firstOfGrid&&!1!==e.lastOfGrid&&(e.firstOfGrid.comp()<=e.originalDate.comp()&&e.originalDate.comp()<=e.lastOfGrid.comp())},isSelectedInBounds:function(){var e=this;return!1!==e.firstOfMonth&&!1!==e.lastOfMonth&&(e.firstOfMonth.comp()<=e.originalDate.comp()&&e.originalDate.comp()<=e.lastOfMonth.comp())},isInCalGrid:function(e){return!1!==this.firstOfGrid&&!1!==this.lastOfGrid&&(this.firstOfGrid.comp()<=e.comp()&&e.comp()<=this.lastOfGrid.comp())},_cal_ThemeDate:function(e,t){var a,i=this,n=this.options,o=!1,s={theme:n.theme_cal_Default,inBounds:!0},r=[["selected","theme_cal_Selected"],["today","theme_cal_Today"],["highDates","theme_cal_DateHigh"],["highDatesAlt","theme_cal_DateHighAlt"],["highDatesRec","theme_cal_DateHighRec"],["highDays","theme_cal_DayHigh"]];for(i.realToday=new i._date,e.get(1)!==t&&(s.inBounds=!1)!==n.calHighOutOfBounds&&(s.theme=n.theme_cal_OutOfBounds,!(o=!0)!==n.calSelectedOutOfBounds&&i._ThemeDateCK.selected.call(i,e)&&(s.theme=n.theme_cal_Selected)),a=0;a<r.length&&!o;a++)i._ThemeDateCK[r[a][0]].call(i,e)&&(s.theme=n[r[a][1]],o=!0);return s},_dbox_run_update:function(e){var t=this,a=this.options,i="durationbox"===a.mode;i&&t._getCleanDur(),!0!==e&&!0!==i&&(t._check(),"datebox"!==a.mode&&"datetimebox"!==a.mode||t.d.intHTML.find(".dbHeader").childern().first().text(t._formatter(t.__("headerFormat"),t.theDate)),a.useSetButton&&(!1===t.dateOK?t.setBut.addClass(a.disabledState):t.setBut.removeClass(a.disabledState))),t.d.intHTML.find("input").each(function(){switch(y(this).data("field")){case"y":y(this).val(t.theDate.get(0));break;case"m":y(this).val(t.theDate.get(1)+1);break;case"d":y(this).val(i?t.lastDurationA[0]:t.theDate.get(2));break;case"h":i?y(this).val(t.lastDurationA[1]):12===t.__("timeFormat")?y(this).val(t.theDate.get12hr()):y(this).val(t.theDate.get(3));break;case"i":i?y(this).val(t.lastDurationA[2]):y(this).val(t._zPad(t.theDate.get(4)));break;case"M":y(this).val(t.__("monthsOfYearShort")[t.theDate.get(1)]);break;case"a":y(this).val(t.__("meridiem")[11<t.theDate.get(3)?1:0]);break;case"s":i?y(this).val(t.lastDurationA[3]):y(this).val(t._zPad(t.theDate.get(5)))}}),!0===t.__("useArabicIndic")&&t._doIndic()},_dbox_enter:function(e){var t,a=parseInt(e.val(),10),i=this,n=0;if("M"===e.data("field")&&-1<(t=i.__("monthsOfYearShort").indexOf(e.val()))&&i.theDate.setMonth(t),""!==e.val()&&0===e.val().toString().search(/^[0-9]+$/))switch(e.data("field")){case"y":i.theDate.setD(0,a);break;case"m":i.theDate.setD(1,a-1);break;case"d":i.theDate.setD(2,a),n+=86400*a;break;case"h":i.theDate.setD(3,a),n+=3600*a;break;case"i":i.theDate.setD(4,a),n+=60*a;break;case"s":i.theDate.setD(5,a),n+=a}"durationbox"===this.options.mode&&i.theDate.setTime(i.initDate.getTime()+1e3*n),setTimeout(function(){i.refresh()},150)},_fbox_do_dur_math:function(e,t,a){var i,n=this,o={d:Number.MAX_SAFE_INTEGER,h:24,i:60,s:60}[e];if(0===a&&"d"!==e)switch(e){case"h":n.lastDurationA[1]+24*n.lastDurationA[0];break;case"i":n.lastDurationA[2]+60*n.lastDurationA[1]+24*n.lastDurationA[0]*60;break;case"s":n.lastDuration}else i=n.lastDurationA[["d","h","i","s"].indexOf(e)]+t;if(0===a)return i<0?" ":i;for(i<0&&(i+=o);o-1<i;)i-=o;return i},_fbox_do_roll_math:function(e,t){var a,i,n=this,o=this.options,s=[],r=0,d=0,l=null;switch(e){case"y":return n.theDate.get(0)+t;case"m":return i=n.theDate.copy(!1,[0,0,1]).adj(1,t),n.__("monthsOfYearShort")[i.get(1)];case"d":if(!1!==o.rolloverMode.d)return n.theDate.copy([0,0,t]).get(2);for(d=32-n.theDate.copy([0],[0,0,32,13]).getDate(),r=n.theDate.get(3),a=0;a<d;a++)d<a+r?s.push(a+r-d):s.push(a+r);return(l=t%d)<0?s[s.length+l]:s[l];case"h":return i=n.theDate.copy([0,0,0,t]),12===n.__("timeFormat")?i.get12hr():i.get(3);case"i":return n._zPad(n.theDate.copy([0,0,0,0,t*o.minuteStep]).get(4));case"s":return n._zPad(n.theDate.copy([0,0,0,0,0,t]).get(5));case"a":return 11<n.theDate.get(3)?n.__("meridiem")[t%2==0?1:0]:n.__("meridiem")[t%2==0?0:1]}},_slide_ThemeDate:function(e){var t,a=this.options,i=!1,n={theme:a.theme_slide_Default},o=[["selected","theme_slide_Selected"],["today","theme_slide_Today"],["highDates","theme_slide_DateHigh"],["highDatesAlt","theme_slide_DateHighAlt"],["highDatesRec","theme_slide_DateHighRec"],["highDays","theme_slide_DayHigh"]];for(this.realToday=new this._date,t=0;t<o.length&&!i;t++)this._ThemeDateCK[o[t][0]].call(this,e)&&(n.theme=a[o[t][1]],i=!0);return n}})}(jQuery),function(e){e(document).ready(function(){e("[data-role='datebox']").each(function(){e(this).datebox()})})}(jQuery); | ||
//# sourceMappingURL=jtsage-datebox-5.1.3.jqm.min.js.map | ||
"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(a[o]=n[o])}return a},writable:!0,configurable:!0}),function(y){y.widget("jtsage.datebox",{initSelector:"input[data-role='datebox']",options:{mode:!1,hideInput:!1,lockInput:!0,safeEdit:!0,controlWidth:"290px",controlWidthImp:"",breakpointWidth:"567px",zindex:"1100",clickEvent:"vclick",disableWheel:!1,useKinetic:!0,flipSizeOverride:!1,defaultValue:!1,showInitialValue:!1,linkedField:!1,linkedFieldFormat:"%J",displayMode:"dropdown",displayDropdownPosition:"bottomRight",displayInlinePosition:"center",displayForcePosition:!1,dismissOutsideClick:!0,dismissOnEscape:!1,useHeader:!0,useImmediate:!1,useButton:!0,buttonIcon:!1,useFocus:!1,useSetButton:!0,useCancelButton:!1,useTodayButton:!1,closeTodayButton:!1,useTomorrowButton:!1,closeTomorrowButton:!1,useClearButton:!1,useCollapsedBut:!1,usePlaceholder:!1,beforeOpenCallback:!1,beforeOpenCallbackArgs:[],openCallback:!1,openCallbackArgs:[],closeCallback:!1,closeCallbackArgs:[],runOnBlurCallback:!1,startOffsetYears:!1,startOffsetMonths:!1,startOffsetDays:!1,afterToday:!1,beforeToday:!1,notToday:!1,maxDate:!1,minDate:!1,maxDays:!1,minDays:!1,maxYear:!1,minYear:!1,blackDates:!1,blackDatesRec:!1,blackDays:!1,whiteDates:!1,enableDates:!1,validHours:!1,minHour:!1,maxHour:!1,minTime:!1,maxTime:!1,maxDur:!1,minDur:!1,minuteStep:1,minuteStepRound:0,twoDigitYearCutoff:38,flipboxLensAdjust:!1,rolloverMode:{m:!0,d:!0,h:!0,i:!0,s:!0},useLang:"default",lang:{default:{setDateButtonLabel:"Set Date",setTimeButtonLabel:"Set Time",setDurationButtonLabel:"Set Duration",todayButtonLabel:"Jump to Today",tomorrowButtonLabel:"Jump to Tomorrow",titleDateDialogLabel:"Set Date",titleTimeDialogLabel:"Set Time",daysOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysOfWeekShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthsOfYear:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsOfYearShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],durationLabel:["Days","Hours","Minutes","Seconds"],durationDays:["Day","Days"],timeFormat:24,headerFormat:"%A, %B %-d, %Y",tooltip:"Open Date Picker",nextMonth:"Next Month",prevMonth:"Previous Month",dateFieldOrder:["m","d","y"],timeFieldOrder:["h","i","a"],datetimeFieldOrder:["y","m","d","h","i","s","a"],slideFieldOrder:["y","m","d"],dateFormat:"%Y-%m-%d",datetimeFormat:"%Y-%m-%dT%k:%M:%S",useArabicIndic:!1,isRTL:!1,calStartDay:0,clearButton:"Clear",cancelButton:"Cancel",durationOrder:["d","h","i","s"],meridiem:["AM","PM"],timeOutput:"%k:%M",durationFormat:"%Dd %DA, %Dl:%DM:%DS",calDateListLabel:"Other Dates",calHeaderFormat:"%B %Y"}},theme_clearBtn:["recycle","a"],theme_closeBtn:["check","a"],theme_cancelBtn:["delete","a"],theme_tomorrowBtn:["action","a"],theme_todayBtn:["action","a"],theme_dropdownContainer:"ui-body-a",theme_modalContainer:"ui-body-a",theme_inlineContainer:"ui-body-a",theme_headerTheme:"inherit",theme_headerBtn:["delete","a"],theme_openButton:!1,theme_cal_Today:"b",theme_cal_DayHigh:"b",theme_cal_Selected:"active",theme_cal_DateHigh:"b",theme_cal_DateHighAlt:"b",theme_cal_DateHighRec:"b",theme_cal_Default:"a",theme_cal_OutOfBounds:"a",theme_cal_NextBtn:["plus","a"],theme_cal_PrevBtn:["minus","a"],theme_cal_Pickers:"a",theme_cal_DateList:"a",theme_dbox_NextBtn:["plus","a"],theme_dbox_PrevBtn:["minus","a"],theme_dbox_Inputs:"inherit",theme_fbox_Selected:"a ui-flipswitch-active",theme_fbox_Default:"a",theme_fbox_Forbidden:"a ui-disabled",theme_fbox_RollHeight:"135px",theme_slide_Today:"b",theme_slide_DayHigh:"b",theme_slide_Selected:"active",theme_slide_DateHigh:"b",theme_slide_DateHighAlt:"b",theme_slide_DateHighRec:"b",theme_slide_Default:"a",theme_slide_NextBtn:["plus","a"],theme_slide_PrevBtn:["minus","a"],theme_slide_NextDateBtn:["carat-r","a"],theme_slide_PrevDateBtn:["carat-l","a"],theme_slide_Pickers:"a",theme_slide_DateList:"a",theme_backgroundMask:{position:"fixed",left:0,top:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,.4)"},theme_headStyle:" .center { text-align: center !important; } .p0 { padding: 0 !important; }.m0 { margin: 0 !important; } .w-100 { width: 100% !important; }",theme_spanStyle:!1,buttonIconDate:"calendar",buttonIconTime:"clock",disabledState:"ui-disabled",tranDone:"webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",calHighToday:!0,calHighPick:!0,calHighOutOfBounds:!0,calSelectedOutOfBounds:!0,calShowDays:!0,calOnlyMonth:!1,calShowWeek:!1,calUsePickers:!1,calNoHeader:!1,calYearPickMin:-6,calYearPickMax:6,calYearPickRelative:!0,calFormatter:!1,calBeforeAppendFunc:function(e){return e},highDays:!1,highDates:!1,highDatesRec:!1,highDatesAlt:!1,calDateList:!1,calShowDateList:!1,durationStep:1,durationSteppers:{d:1,h:1,i:1,s:1},flen:{y:25,m:24,d:40,h:24,i:30,s:30,a:30},fboxNatural:"default",slideHighToday:!0,slideHighPick:!0,slideUsePickers:!1,slideNoHeader:!1,slideYearPickMin:-6,slideYearPickMax:6,slideYearPickRelative:!0,slideDateList:!1,slideShowDateList:!1},icons:{getIcon:function(e){var t=this,a=t.options.iconFactory;return!1!==e&&("function"==typeof a?a.call(t,e):"<svg"===e.substr(0,4)?e:void 0!==t.icons[e]?t.icons[e]:t.icons.cancel)},next:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M9.8 6L4 11.8l-1.8-1.7L6.6 6 2.2 2 4 .1 9.8 6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',prev:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M2.2 6L8 .2l1.8 1.7L5.4 6l4.4 4L8 11.9 2.2 6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',plus:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5v2h12V5H0z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 0H5v12h2V0z" fill="currentColor"/></svg>',minus:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M0 5v2h12V5H0z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',check:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M12 2.8l-8 8-4-4 1.5-1.5L4 7.8l6.5-6.5L12 2.6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',cancel:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M11 2.5L9.4 1 1.1 9.5 2.5 11l8.4-8.4z" clip-rule="evenodd" fill-rule="evenodd"/><path fill="currentColor" d="M2.5 1L1 2.6l8.4 8.4L11 9.5 2.5 1.1z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',goto:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M7 3.3C3.8 3.6.4 5.9.4 11.7c2-4.3 4-5 6.8-5v2.9l4.6-4.7L7.1.3v3z" fill-rule="evenodd"/></svg>',clear:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.8 1H8.1c0-.5-.4-1-.8-1H4.7C4.3 0 4 .6 4 1H2.2c-.4 0-.8.3-.8.8v.8c0 .5.4.8.8.8V11c0 .5.4.9.9.9H9c.4 0 .8-.4.8-.9V3.4c.5 0 .8-.3.8-.8v-.8c0-.5-.3-.9-.8-.9zM9 11H3V3.6H4v6.7h.8V3.5h.9v6.7h.8V3.5h.9v6.7H8V3.5h.8V11zm.8-8.4H2.2v-.8h7.6v.8z" fill="currentColor"/></svg>',clock:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M6.8 6h2.5v1.7H5.9a.8.8 0 0 1-.8-.8V2.6h1.7V6zM6 1.2a4.8 4.8 0 1 1 0 9.6 4.8 4.8 0 0 1 0-9.6zM6 .1a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',calendar:'<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M10.5 1h-.8v1.3c0 .2-.2.4-.4.4H7.6a.4.4 0 0 1-.4-.4V1H4.7v1.3c0 .2-.2.4-.4.4H2.6a.4.4 0 0 1-.4-.4V1h-.8c-.5 0-.8.4-.8.8V11c0 .5.4.8.8.8h9.3c.5 0 .8-.4.8-.8V1.8c0-.5-.4-.8-.8-.8zm0 10.1H1.2V3.5h9.3v7.6zM3.7 1.9h-.8V.2h.8v1.7zm5.1 0H8V.2h.8v1.7zM4.5 5.3h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zM2.8 7H2v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zm1.7 0h-.8v-.8h.8V7zM2.8 8.7H2v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm-6.8 1.7H2v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8zm1.7 0h-.8v-.8h.8v.8z"/></svg>'},styleFunctions:{},_getLongOptions:function(e){var t,a,i={};for(t in e.data())"datebox"===t.substr(0,7)&&7<t.length&&"options"!==(a=(a=t.substr(7)).charAt(0).toLowerCase()+a.slice(1))&&(i[a]=e.data(t));return i},_setOption:function(){y.Widget.prototype._setOption.apply(this,arguments),this.refresh()},getOption:function(e){var t=this.__(e);return"Err:NotFound"!==t?t:this.options[e]},style_attach:function(e){var t=this,a=t.d.wrap.parent(),i=y("body").find("#"+t.baseID+"-dbAttach");return 1===i.length?i:e?a.hasClass("ui-field-contain")?a:t.d.wrap:1===(a=y(".ui-page-active")).length?a:1===(a=t.d.input.closest("[data-role='page']")).length?a:y("body")},style_btn:function(e,t){var a;return t=void 0===t?"":t,a="<a href='#' role='button' class='ui-btn ui-mini ui-btn-"+e[1],a+=!1!==e[0]?" ui-icon-"+e[0]:"",a+=""===t?" ui-corner-all ui-btn-icon-notext":" ui-btn-icon-left",a+="'>"+t+"</a>"},style_btnGrp:function(e){return y("<div style='"+(e?"margin: 0 auto;":"margin: 0 .446em")+"' class='ui-controlgroup-controls'>")},style_btnGrpOut:function(e,t){var a=!0===e?"ui-controlgroup-horizontal":"ui-controlgroup-vertical",i=!0===e?"style='text-align:center'":"";return t.find(".ui-btn").last().addClass("ui-last-child"),t.find(".ui-btn").first().addClass("ui-first-child"),y("<div "+i+" class='ui-controlgroup "+a+"'>").append(t)},style_inWrap:function(e){return e.parent().enhanceWithin(),e.parent().addClass("ui-input-has-clear")},style_inBtn:function(e,t){return"<a href='javascript: return false;' class='dbOpenButton ui-input-clear ui-btn ui-icon-"+e+" ui-btn-icon-notext ui-corner-all' title='"+t+"'>"+t+"</a>"},style_inNoBtn:function(e){e.parent().removeClass("ui-has-clear")},style_inHide:function(){var e=this.d.wrap.parent();e.hasClass("ui-field-contain")?e.hide():this.d.wrap.hide()},style_mainHead:function(e,t,a){return"<div class='ui-header ui-bar-"+t+"'><h1 class='ui-title'>"+e+"</h1>"+this.style_btn([a[0],a[1]+" dbCloser ui-btn-right"])+"</div>"},style_subHead:function(e){return y("<div class='dbHeader'><h3 class='center'>"+e+"</h3></div>")},style_pnHead:function(e,t,a,i,n){var o=y("<div class='ui-header' style='border:0; padding: 0 3px 8px;'>");return y(this.style_btn([t[0],t[1]+" ui-btn-left "+i])).appendTo(o),y("<h3 class='ui-title' style='margin: 0 15%'>"+e+"</h3>").appendTo(o),y(this.style_btn([a[0],a[1]+" ui-btn-right "+n])).appendTo(o),o},style_picker:function(e,t,a,i){var n=0,o="<div style='padding-bottom: 8px' class='ui-controlgroup ui-controlgroup-horizontal ui-corner-all ui-mini'>";for(o+="<div class='ui-controlgroup-controls w-100'>",o+="<div class='ui-select' style='width:60%'>",o+="<div id='"+a+"-button' class='ui-btn-"+t+" ui-btn ui-icon-carat-d ui-btn-icon-right ui-corner-all ui-shadow ui-first-child'>",n=0;n<e.month.length;n++)!0===e.month[n][2]&&(o+="<span>"+e.month[n][1]+"</span>");for(o+=this._stdSel(e.month,a,""),o+="</div></div>",o+="<div class='ui-select' style='width:40%'>",o+="<div id='"+i+"-button' class='ui-btn-"+t+" ui-btn ui-icon-carat-d ui-btn-icon-right ui-corner-all ui-shadow ui-last-child'>",n=0;n<e.year.length;n++)!0===e.year[n][2]&&(o+="<span>"+e.year[n][1]+"</span>");return o+=this._stdSel(e.year,i,""),o+="</div></div>",y(o+="</div></div>")},style_dateList:function(e,t,a,i){var n="",o=t.slice();return o.unshift([!1,e,!0]),n+="<div class='ui-select'>",n+="<div id='"+i+"-button' style='margin: 0 .446em 8px;' class='ui-mini ui-btn ui-icon-carat-d ui-btn-"+a+" ui-btn-icon-right ui-corner-all'>",n+="<span>"+e+"</span>",n+=this._stdSel(o,i,""),y(n+="</div></div>")},style_calGrid:function(){return y("<div><table class='dbCalGrid w-100'></table></div>")},style_calRow:function(){return y("<tr>")},style_calBtn:function(e,t){var a="width:"+100/t+"%",i=["dbEvent","ui-btn","ui-mini","m0","ui-btn-"+e.theme,e.bad?"ui-disabled":""],n=e.bad?"disabled='disabled'":"";return y("<td class='p0 m0' style='"+a+"'><a style='"+["padding-right:0","padding-left:0"].join(";")+"' class='"+i.join(" ")+"' href='#' "+n+">"+e.displayText+"</a></td>")},style_calTxt:function(e,t,a){return y("<td class='p0 m0 center' style='"+["width:"+100/a+"%",t?"font-weight:bold":""].join(";")+"'>"+e+"</td>")},style_dboxCtr:function(){return y("<table class='w-100'>")},style_dboxRow:function(){return y("<tr>")},style_dboxCtrl:function(e,t,a,i,n){var o="";return o+="<td class='dbBox"+a+"'>",o+="<a href='#' role='button' class='ui-corner-all ui-btn ui-mini ui-btn-",o+=t[1]+" ui-icon-"+t[0]+" ui-btn-icon-top dbBoxNext m0' ",o+="style='padding-top:2.1em; border-bottom-left-radius:0;border-bottom-right-radius:0;'>",o+="</a>",null!==i&&(o+="<div class='m0 center ui-input-text ui-body-inherit' style='height:auto; padding: .3em 0;'>"+i+"</div>"),o+="<div class='m0 ui-input-text ui-mini ui-body-"+n+"'>",o+="<input class='p0 center' type='text'></div>",o+="<a href='#' role='button' class='ui-corner-all ui-btn ui-mini ui-btn-",o+=e[1]+" ui-icon-"+e[0]+" ui-btn-icon-top dbBoxPrev m0' ",o+="style='padding-top:2.1em; border-top-left-radius:0;border-top-right-radius:0;'>",o+="</a>",y(o+="</div>")},style_slideGrid:function(){return y("<div><table class='dbSlideGrid w-100'></table></div>")},style_slideRow:function(){return y("<tr>")},style_slideBtn:function(e){var t=e.bad?"disabled='disabled'":"",a="class='m0 dbEventS w-100 ui-btn ui-mini ui-btn-"+e.theme+(e.bad?" disabled":"")+"'";return y("<td class='m-0 p-0 text-center' style='width: 12.5%'><a style='padding:.7em 0;' href='#' "+a+" "+t+"><small>"+this.__("daysOfWeekShort")[e.dateObj.getDay()]+"</small><br>"+e.dateObj.getDate()+"</a></td>")},style_slideCtrl:function(e,t){var a="class='m0 ui-corner-all ui-btn ui-mini ui-btn-icon-notext ui-btn-"+t[1]+" "+e+" ui-icon-"+t[0]+"'";return y("<td style='width: 6.25%'><a href='#' "+a+"></a></td>")},style_fboxCtr:function(e){return y("<div style='margin: 0 5px 8px; height: "+e+"; overflow: hidden'>")},style_fboxDurLbls:function(){return y("<div style='margin: 5px;'>")},style_fboxDurLbl:function(e,t){return y("<div class='center' style='display:inline-block; width: "+100/t+"%'>"+e+"</div>")},style_fboxRollCtr:function(e){return y("<div style='float:left; width:"+100/e+"%'>")},style_fboxRollPrt:function(){return y("<ul style='list-style-type: none; display: inline;'>")},style_fboxRollCld:function(e,t){return y("<li style='height: 30px; line-height: 30px;' class='center ui-body-"+t+"'>"+e+"</li>")},style_fboxLens:function(){return y("<div style='width: 96%; height: 40px; border: 1px solid #eee; margin: 0 1.5%;' class='ui-overlay-shadow'>")},style_fboxPos:function(){var e,t,a,i,n=this.options,o=this.d.intHTML.find(".dbRollerV").outerHeight(),s=this.d.intHTML.find(".dbLens").first(),r=s.outerHeight();i=-1*(o/2+r/2),s.css({top:i+-3,marginBottom:-1*r}),this.d.intHTML.find(".dbRoller").each(function(){e=y(this),"0px"===(t=e.children().first()).css("marginTop")&&(a=(e.children().length+1)*t.outerHeight(),i=a/2*-1+o/2,!1!==n.flipboxLensAdjust&&(i+=n.flipboxLensAdjust),t.css("margin-top",i))})},_enhanceDate:function(){Object.assign(this._date.prototype,{copy:function(e,t){return e=Object.assign([0,0,0,0,0,0,0],e),t=Object.assign([0,0,0,0,0,0,0],t),new Date(0<t[0]?t[0]:this.get(0)+e[0],0<t[1]?t[1]:this.get(1)+e[1],0<t[2]?t[2]:this.get(2)+e[2],0<t[3]?t[3]:this.get(3)+e[3],0<t[4]?t[4]:this.get(4)+e[4],0<t[5]?t[5]:this.get(5)+e[5],0<t[6]?t[5]:this.get(6)+e[6])},adj:function(e,t){if("number"!=typeof t||"number"!=typeof e)throw new Error("Invalid Arguments");switch(e){case 0:this.setD(0,this.get(0)+t);break;case 1:this.setD(1,this.get(1)+t);break;case 2:this.setD(2,this.get(2)+t);break;case 3:t*=60;case 4:t*=60;case 5:t*=1e3;case 6:this.setTime(this.getTime()+t)}return this},setD:function(e,t){switch(e){case 0:this.setFullYear(t);break;case 1:this.setMonth(t);break;case 2:this.setDate(t);break;case 3:this.setHours(t);break;case 4:this.setMinutes(t);break;case 5:this.setSeconds(t);break;case 6:this.setMilliseconds(t)}return this},get:function(e){switch(e){case 0:return this.getFullYear();case 1:return this.getMonth();case 2:return this.getDate();case 3:return this.getHours();case 4:return this.getMinutes();case 5:return this.getSeconds();case 6:return this.getMilliseconds()}return!1},get12hr:function(){return 0===this.get(3)?12:this.get(3)<13?this.get(3):this.get(3)-12},iso:function(){var e=[0,0,0],t=0;for(t=0;t<3;t++)e[t]=this.get(t),1===t&&e[t]++,e[t]<10&&(e[t]="0"+String(e[t]));return e.join("-")},comp:function(){return parseInt(this.iso().replace(/-/g,""),10)},getEpoch:function(){return Math.floor(this.getTime()/1e3)},getEpochDays:function(){return Math.floor(this.getTime()/864e5)},getArray:function(){var e=[0,0,0,0,0,0],t=0;for(t=0;t<6;t++)e[t]=this.get(t);return e},setFirstDay:function(e){return this.setD(2,1).adj(2,e-this.getDay()),10<this.get(2)&&this.adj(2,7),this},setDWeek:function(e,t){return 4===e?this.setD(1,0).setD(2,1).setFirstDay(4).adj(2,-3).adj(2,7*(t-1)):this.setD(1,0).setD(2,1).setFirstDay(e).adj(2,7*(t-1))},getDWeek:function(e){var t,a;switch(e){case 0:return t=this.copy([0,-1*this.getMonth()]).setFirstDay(0),Math.floor((this.getTime()-(t.getTime()+6e4*(this.getTimezoneOffset()-t.getTimezoneOffset())))/6048e5)+1;case 1:return t=this.copy([0,-1*this.getMonth()]).setFirstDay(1),Math.floor((this.getTime()-(t.getTime()+6e4*(this.getTimezoneOffset()-t.getTimezoneOffset())))/6048e5)+1;case 4:return 11===this.getMonth()&&28<this.getDate()?1:(t=this.copy([0,-1*this.getMonth()],!0).setFirstDay(4).adj(2,-3),(a=Math.floor((this.getTime()-(t.getTime()+6e4*(this.getTimezoneOffset()-t.getTimezoneOffset())))/6048e5)+1)<1?(t=this.copy([-1,-1*this.getMonth()]).setFirstDay(4).adj(2,-3),Math.floor((this.getTime()-t.getTime())/6048e5)+1):a);default:return 0}}})},_ord:{default:function(e){var t=e%10;return 9<e&&e<21||3<t?"th":["th","st","nd","rd"][t]}},_customformat:{default:function(e,t,a){return!1}},_formatter:function(e,i,t){var n,o=this,s=this.options,r=0;return void 0===t&&(t=!0),"dura"===s.mode.substr(0,4)&&(r=o._dur(this.theDate.getTime()-this.initDate.getTime()),e.match(/%Dd/)||(r[1]+=24*r[0]),e.match(/%Dl/)||(r[2]+=60*r[1]),e.match(/%DM/)||(r[3]+=60*r[2])),e=e.replace(/%(D|X|0|-)*([1-9a-zA-Z])/g,function(e,t,a){if("X"===t)return"function"==typeof o._customformat[s.mode]?o._customformat[s.mode](a,i,s):e;if("D"===t)switch(a){case"d":return r[0];case"l":return o._zPad(r[1]);case"M":return o._zPad(r[2]);case"S":return o._zPad(r[3]);case"A":return o.__("durationDays")[1===r[0]?0:1];default:return e}switch(a){case"a":return o.__("daysOfWeekShort")[i.getDay()];case"A":return o.__("daysOfWeek")[i.getDay()];case"b":return o.__("monthsOfYearShort")[i.getMonth()];case"B":return o.__("monthsOfYear")[i.getMonth()];case"C":return parseInt(i.getFullYear()/100);case"d":return o._zPad(i.getDate(),t);case"H":case"k":return o._zPad(i.getHours(),t);case"I":case"l":return o._zPad(i.get12hr(),t);case"m":return o._zPad(i.getMonth()+1,t);case"M":return o._zPad(i.getMinutes(),t);case"p":case"P":return n=o.__("meridiem")[i.get(3)<12?0:1].toUpperCase(),"P"===a?n.toLowerCase():n;case"s":return i.getEpoch();case"S":return o._zPad(i.getSeconds(),t);case"u":return o._zPad(i.getDay()+1,t);case"w":return i.getDay();case"y":return o._zPad(i.getFullYear()%100);case"Y":return i.getFullYear();case"E":return i.getFullYear()+543;case"V":return o._zPad(i.getDWeek(4),t);case"U":return o._zPad(i.getDWeek(0),t);case"W":return o._zPad(i.getDWeek(1),t);case"o":return"function"==typeof o._ord[s.useLang]?o._ord[s.useLang](i.getDate()):o._ord.default(i.getDate());case"j":return n=new o._date(i.getFullYear(),0,1),(n="000"+String(Math.ceil((i-n)/864e5)+1)).slice(-3);case"J":return i.toJSON();case"G":return n=i.getFullYear(),1===i.getDWeek(4)&&0<i.getMonth()?n+1:51<i.getDWeek(4)&&i.getMonth()<11?n-1:n;case"g":return n=i.getFullYear%100,1===i.getDWeek(4)&&0<i.getMonth()&&++n,51<i.getDWeek(4)&&i.getMonth()<11&&--n,o._zpad(n);default:return e}}),!0===o.__("useArabicIndic")&&!0===t&&(e=o._dRep(e)),e},_minStepFix:function(){var e=this.theDate.get(4),t=this.options.minuteStep,a=this.options.minStepRound,i=e%t;1<t&&0<i&&(a<0?e-=i:0<a?e+=t-i:e%t<t/2?e-=i:e+=t-i,this.theDate.setMinutes(e))},_newDateCheck:{enableDate:function(e){return-1<this.options.enableDates.indexOf(e.iso)},whiteDate:function(e){return!1!==this.options.whiteDates&&-1<this.options.whiteDates.indexOf(e.iso)},notToday:function(e){return!1!==this.options.notToday&&this.realToday.comp()===e.comp()},maxYear:function(e){var t=this.options.maxYear;return!1!==t&&e.get(0)>t},minYear:function(e){var t=this.options.minYear;return!1!==t&&e.get(0)<t},minDate:function(e){var t=this.options.minDate;return!1!==t&&e<(t=this.parseISO(t))},maxDate:function(e){var t=this.options.maxDate;return!1!==t&&((t=this.parseISO(t)).adj(2,1),t<e)},afterToday:function(e){return!1!==this.options.afterToday&&e<this.realToday},beforeToday:function(e){return!1!==this.options.beforeToday&&e>this.realToday},minmaxDays:function(e){var t,a,i=this.options.minDays,n=this.options.maxDays;return(!1!==i||!1!==n)&&(t=!1===i||this.realToday.getEpochDays()-(i+1)<e.getEpochDays(),a=!1===n||this.realToday.getEpochDays()+(n+1)>e.getEpochDays(),!(t&&a))},minHour:function(e){var t=this.options.minHour;return!1!==t&&e.get(3)<t},maxHour:function(e){var t=this.options.maxHour;return!1!==t&&e.get(3)>t},minTime:function(e){var t,a=this.options.minTime,i=e.get(3);return!1!==a&&(i<(t=this.options.minTime.split(":",2))[0]||!(i>t[0])&&e.get(4)<t[1])},maxTime:function(e){var t,a=this.options.maxTime,i=e.get(3);return!1!==a&&(!(i<(t=this.options.maxTime.split(":",2))[0])&&(i>t[0]||e.get(4)>t[1]))},validHours:function(e){return-1<this.options.validHours.indexOf(e.get(3))},blackDays:function(e){var t=this.options.blackDays;return!1!==t&&-1<t.indexOf(e.getDay())},blackDates:function(e){var t=this.options.blackDates;return!1!==t&&-1<t.indexOf(e.iso())},blackDatesRec:function(e){var t,a=this.options.blackDatesRec;if(!1===a)return!1;for(t=0;t<a.length;t++)if(!(-1!==a[t][0]&&a[t][0]!==e.get(0)||-1!==a[t][1]&&a[t][1]!==e.get(1)||-1!==a[t][2]&&a[t][2]!==e.get(2)))return!0;return!1}},_newDateChecker:function(e){var t,a=this,i=!1,n={good:!0,bad:!1,failrule:!1,passrule:!1,dateObj:e.copy()},o=["blackDays","blackDates","blackDatesRec","notToday","maxYear","minYear","afterToday","beforeToday","maxDate","minDate","minmaxDays","minHour","maxHour","minTime","maxTime"];if(a.realToday=new a._date,!1!==this.options.enableDates)return a._newDateCheck.whiteDate.call(a,e)?n.passrule="enableDates":(n.bad=!0,n.good=!1,n.failrule="enableDates"),n;if(!1!==this.options.validHours)return a._newDateCheck.validHours.call(a,e)?n.passrule="validHours":(n.bad=!0,n.good=!1,n.failrule="validHours"),n;if(a._newDateCheck.whiteDate.call(a,e))return n.passrule="whiteDates",n;for(t=0;t<o.length&&!i;t++)a._newDateCheck[o[t]].call(a,e)&&(n.bad=!0,n.good=!1,n.failrule=o[t],i=!0);return n},_getCleanDur:function(){var e=this,t=this,a=e.theDate.getEpoch()-e.initDate.getEpoch();return a<0&&(a=0,e.theDate=e.initDate.copy()),!1!==t.minDur&&a<t.minDur&&(e.theDate=new e._date(e.initDate.getTime()+1e3*t.minDur),a=t.minDur),!1!==t.maxDur&&a>t.maxDur&&(e.theDate=new e._date(e.initDate.getTime()+1e3*t.maxDur),a=t.maxDur),e.lastDuration=a,e.lastDurationA=e._dur(1e3*a),[a,e._dur(1e3*a)]},_check:function(){var e=this._newDateChecker(this.theDate);return this.dateOK=!0===e.good,e.good},_fixstepper:function(e){var t=this.options.durationSteppers,a=this.options.durationStep;-1<e.indexOf("d")&&(t.d=a),-1<e.indexOf("h")&&(t.d=1,t.h=a),-1<e.indexOf("i")&&(t.h=1,t.i=a),-1<e.indexOf("s")&&(t.i=1,t.s=a)},_ThemeDateCK:{selected:function(e){return!1!==this.options.slideHighPick&&(void 0!==this.originalDate&&this.originalDate.iso()===e.iso())},today:function(e){return!1!==this.options.slideHighToday&&this.realToday.iso()===e.iso()},highDates:function(e){var t=this.options.highDates;return!1!==t&&-1<t.indexOf(e.iso())},highDatesAlt:function(e){var t=this.options.highDatesAlt;return!1!==t&&-1<t.indexOf(e.iso())},highDatesRec:function(e){var t,a=this.options.highDatesRec;if(!1===a)return!1;for(t=0;t<a.length;t++)if(!(-1!==a[t][0]&&a[t][0]!==e.get(0)||-1!==a[t][1]&&a[t][1]!==e.get(1)||-1!==a[t][2]&&a[t][2]!==e.get(2)))return!0;return!1},highDays:function(e){var t=this.options.highDays;return!1!==t&&-1<t.indexOf(e.getDay())}},_parser:{default:function(e){return e}},_makeDate:function(e,t){var a,i,n,o,s=this,r=this.options,d=this.options.defaultValue,l=s.__fmt(),c=null,h=[],u=!1,p=new s._date,f={year:-1,mont:-1,date:-1,hour:-1,mins:-1,secs:-1,week:!1,wtyp:4,wday:!1,yday:!1,meri:0};if(void 0===t&&(t=!1),e=(!0===s.__("useArabicIndic")&&void 0!==e?s._dRep(e,-1):e).trim(),void 0===r.mode)return p;if(void 0!==s._parser[r.mode])return s._parser[r.mode].call(s,e);if("durationbox"===r.mode||"durationflipbox"===r.mode){if(l=l.replace(/%D([a-z])/gi,function(e,t){switch(t){case"d":case"l":case"M":case"S":return"("+e+"|[0-9]+)";default:return".+?"}}),c=(l=new RegExp("^"+l+"$")).exec(e),n=l.exec(s.__fmt()),null===c||c.length!==n.length)return"number"==typeof d&&0<d?new s._date(1e3*(s.initDate.getEpoch()+parseInt(d,10))):new s._date(s.initDate.getTime());for(i=s.initDate.getEpoch(),a=1;a<c.length;a++)o=parseInt(c[a],10),n[a].match(/^%Dd$/i)&&(i+=86400*o),n[a].match(/^%Dl$/i)&&(i+=3600*o),n[a].match(/^%DM$/i)&&(i+=60*o),n[a].match(/^%DS$/i)&&(i+=o);return new s._date(1e3*i)}if("%J"===l)return p=new s._date(e),isNaN(p.getDate())&&(p=new s._date),p;if(l=l.replace(/%(0|-)*([a-z])/gi,function(e,t,a){switch(h.push(a),a){case"p":case"P":case"b":case"B":return"("+e+"|.+?)";case"H":case"k":case"I":case"l":case"m":case"M":case"S":case"V":case"U":case"u":case"W":case"d":return"("+e+"|[0-9]{"+("-"===t?"1,":"")+"2})";case"j":return"("+e+"|[0-9]{3})";case"s":return"("+e+"|[0-9]+)";case"g":case"y":return"("+e+"|[0-9]{2})";case"E":case"G":case"Y":return"("+e+"|[0-9]{1,4})";default:return h.pop(),".+?"}}),c=(l=new RegExp("^"+l+"$")).exec(e),n=l.exec(s.__fmt()),null===c||c.length!==n.length){if(""!==e&&(u=!0),!1!==d&&""!==d)switch(typeof d){case"object":"function"==typeof d.getDay?p=d:3===d.length&&(p=s._pa(d,"time"===r.mode.substr(0,4)&&p));break;case"number":p=new s._date(1e3*d);break;case"string":p="time"===r.mode.substr(0,4)?(i=Object.assign([0,0,0],d.split(":",3)),s._pa(i,p)):((i=Object.assign([0,0,0],d.split("-",3)))[1]--,s._pa(i,!1))}isNaN(p.getDate())&&(p=new s._date)}else{for(a=1;a<c.length;a++)switch(o=parseInt(c[a],10),h[a-1]){case"s":return new s._date(1e3*parseInt(c[a],10));case"Y":case"G":f.year=o;break;case"E":f.year=o-543;break;case"y":case"g":r.afterToday||o<r.twoDigitYearCutoff?f.year=2e3+o:f.year=1900+o;break;case"m":f.mont=o-1;break;case"d":f.date=o;break;case"H":case"k":case"I":case"l":f.hour=o;break;case"M":f.mins=o;break;case"S":f.secs=o;break;case"u":f.wday=o-1;break;case"w":f.wday=o;break;case"j":f.yday=o;break;case"V":f.week=o,f.wtyp=4;break;case"U":f.week=o,f.wtyp=0;break;case"W":f.week=o,f.wtyp=1;break;case"p":case"P":o=new RegExp("^"+c[a]+"$","i"),f.meri=o.test(s.__("meridiem")[0])?-1:1;break;case"b":-1<(i=s.__("monthsOfYearShort").indexOf(c[a]))&&(f.mont=i);break;case"B":-1<(i=s.__("monthsOfYear").indexOf(c[a]))&&(f.mont=i)}if(0!==f.meri&&(-1===f.meri&&12===f.hour&&(f.hour=0),1===f.meri&&12!==f.hour&&(f.hour=f.hour+12)),p=new s._date(s._n(f.year,0),s._n(f.mont,0),s._n(f.date,1),s._n(f.hour,0),s._n(f.mins,0),s._n(f.secs,0),0),f.year<100&&-1!==f.year&&p.setFullYear(f.year),-1<f.mont&&-1<f.date||-1<f.hour&&-1<f.mins&&-1<f.secs)return!0===t?[p,u]:p;!1!==f.week&&(p.setDWeek(f.wtyp,f.week),-1<f.date&&p.setDate(f.date)),!1!==f.yday&&p.setD(1,0).setD(2,1).adj(2,f.yday-1),!1!==f.wday&&p.adj(2,f.wday-p.getDay())}return!0===t?[p,u]:p},_event:function(e,t){var a,i,n=y(this).data("jtsage-datebox"),o=y(this).data("jtsage-datebox").options;if(!e.isPropagationStopped())switch(t.method){case"close":void 0===t.closeCancel&&(t.closeCancel=!1),n.cancelClose=t.closeCancel,n.close();break;case"open":n.open();break;case"set":if("object"==typeof t.value)n.theDate=t.value,n._t({method:"doset"});else{if("inline"!==o.displayMode&&"blind"!==o.displayMode||(n.originalDate=n.theDate),y(this).val(t.value),!1!==o.linkedField)if("string"==typeof o.linkedField)y(o.linkedField).val(n.callFormat(o.linkedFieldFormat,n.theDate,!1));else for(i=0;i<o.linkedField.length;i++)y(o.linkedField[i].id).val(n.callFormat(o.linkedField[i].format,n.theDate,!1));n.skipChange=!0,y(this).trigger("change")}break;case"doset":"function"==typeof n[a="_"+n.options.mode+"DoSet"]?n[a].call(n):n._t({method:"set",value:n._formatter(n.__fmt(),n.theDate),date:n.theDate});break;case"dooffset":t.type&&n._offset(t.type,t.amount,!0);break;case"dorefresh":n.refresh();break;case"doclear":y(this).val("").trigger("change");break;case"clear":y(this).trigger("change")}},_build:{default:function(){!(this.d.headerText="Error")!==this.d.intHTML&&this.d.intHTML.remove().empty(),this.d.intHTML=y("<div style='width:100%'><h2 style='text-align:center;color:red;'>Unknown Mode</h2></div>")},calbox:function(){var e,t,a,i=this,n=this.options,o=new i._date,s=i.theDate.copy(!1,[0,0,1,12,1,1,1]),r=s.copy([0,1]).adj(2,-1),d=s.get(1),l=s.get(0),c=i.__("calStartDay")-s.getDay(),h=i.__("calStartDay")-r.getDay()+6,u=s.copy([0,0,c]),p=r.copy([0,0,h]),f=(p.getEpochDays()-u.getEpochDays()+1)/7,m=u.copy(),_=n.calShowWeek?8:7,b="",g="",D={},v="";if(i.firstOfGrid=u,i.lastOfGrid=p,i.firstOfMonth=s,i.lastOfMonth=r,"boolean"!=typeof i.d.intHTML&&(i.d.intHTML.remove(),i.d.intHTML=null),i.d.headerText=i._grabLabel(i.__("titleDateDialogLabel")),i.d.intHTML=y("<span>"),i.d.intHTML.addClass(n.theme_spanStyle),!1===n.calNoHeader&&(b=i.style_pnHead(i._formatter(i.__("calHeaderFormat"),i.theDate),!0===i.__("isRTL")?n.theme_cal_NextBtn:n.theme_cal_PrevBtn,!0===i.__("isRTL")?n.theme_cal_PrevBtn:n.theme_cal_NextBtn,"dbCalPrev","dbCalNext"),!0===i.__("isRTL")&&b.children().each(function(e,t){b.prepend(t)}),b.appendTo(i.d.intHTML),i.d.intHTML.on(n.clickEvent,".dbCalNext",function(e){return e.preventDefault(),e.stopPropagation(),28<i.theDate.getDate()&&i.theDate.setDate(1),i._offset("m",1),!1}).on(n.clickEvent,".dbCalPrev",function(e){return e.preventDefault(),e.stopPropagation(),28<i.theDate.getDate()&&i.theDate.setDate(1),i._offset("m",-1),!1})),!1!==n.calUsePickers&&(b=i.style_picker(i._pickRanges(d,l,o.get(0),n.calYearPickRelative),n.theme_cal_Pickers,"dbCalPickMonth","dbCalPickYear"),!0===i.__("isRTL")&&b.children().each(function(e,t){b.prepend(t)}),b.appendTo(i.d.intHTML),i.d.intHTML.on("change","#dbCalPickMonth, #dbCalPickYear",function(){28<i.theDate.get(2)&&i.theDate.setD(2,1),i.theDate.setD(1,y("#dbCalPickMonth").val()),i.theDate.setD(0,y("#dbCalPickYear").val()),i._t({method:"displayChange",selectedDate:i.originalDate,shownDate:i.theDate,thisChange:"p",thisChangeAmount:null,gridStart:i.firstOfGrid,gridEnd:i.lastOfGrid,selectedInGrid:i.isSelectedInCalGrid(),selectedInBounds:i.isSelectedInBounds()}),i.refresh()})),b=y(i.style_calGrid()).appendTo(i.d.intHTML).find(".dbCalGrid").first(),n.calShowDays){for(i._cal_days=i.__("daysOfWeekShort").concat(i.__("daysOfWeekShort")),v=i.style_calRow(),n.calShowWeek&&v.append(i.style_calTxt(" ",!1,8)),e=0;e<=6;e++)v.append(i.style_calTxt(i._cal_days[(e+i.__("calStartDay"))%7],!0,_));v.appendTo(b),!0===i.__("isRTL")&&v.children().each(function(e,t){v.prepend(t)})}for(n.calFormatter=i._prepFunc(n.calFormatter),n.calBeforeAppendFunc=i._prepFunc(n.calBeforeAppendFunc),t=0;t<f;t++){for(g=i.style_calRow(),n.calShowWeek&&g.append(i.style_calTxt(m.getDWeek(4),!1,8)),a=0;a<7;a++)(D=Object.assign(i._newDateChecker(m),i._cal_ThemeDate(m,d))).displayText=!1===n.calFormatter?D.dateObj.get(2):n.calFormatter.call(i,D),D.htmlObj=i.style_calBtn(D,_),D.eventObj=D.htmlObj.find(".dbEvent").first(),D.eventObj.data(D),!1!==n.calBeforeAppendFunc&&(D=n.calBeforeAppendFunc.call(i,D)),!1===n.calOnlyMonth||!0===D.inBounds?g.append(D.htmlObj):g.append(i.style_calTxt(" ",!1,_)),m.adj(2,1);!0===i.__("isRTL")&&g.children().each(function(e,t){g.prepend(t)}),g.appendTo(b)}!1!==n.calShowDateList&&!1!==n.calDateList&&(i.style_dateList(i.__("calDateListLabel"),n.calDateList,n.theme_cal_DateList,"dbCalPickList").appendTo(i.d.intHTML),i.d.intHTML.on("change","#dbCalPickList",function(){var e=y(this).val().split("-");i.theDate=new i._date(e[0],e[1]-1,e[2],12,1,1,1),i._t({method:"doset"})})),i.d.intHTML.append(i._doBottomButtons.call(i,!1)),i.d.intHTML.on(n.clickEvent,".dbEvent",function(e){e.preventDefault(),y(this).data("good")&&(i.theDate=y(this).data("dateObj").copy(),i._t({method:"set",value:i._formatter(i.__fmt(),i.theDate),date:i.theDate}),i._t({method:"close"}))}).on(i.wheelEvent,function(e,t){e.preventDefault(),t=void 0===t?Math.sign(e.originalEvent.wheelDelta):t,i.theDate.setD(2,1),i._offset("m",0<t?1:-1)})},timebox:function(){this._build.datebox.call(this)},datetimebox:function(){this._build.datebox.call(this)},durationbox:function(){this._build.datebox.apply(this,[])},datebox:function(){var e,t,a,i,n=this,o=this.options,s=n.style_dboxCtr(),r="durationbox"===o.mode,d=["d","h","i","s"];for("boolean"!=typeof n.d.intHTML&&n.d.intHTML.empty().remove(),n.d.headerText=n._grabLabel("datebox"===o.mode||"datetimebox"===o.mode?n.__("titleDateDialogLabel"):n.__("titleTimeDialogLabel")),n.d.intHTML=y("<span>"),n.d.intHTML.addClass(o.theme_spanStyle),n.fldOrder=n._getFldOrder(o.mode),r?(n.dateOK=!0,n._fixstepper(n.fldOrder)):(n._check(),n._minStepFix()),"datebox"!==o.mode&&"datetimebox"!==o.mode||n.style_subHead(n._formatter(n.__("headerFormat"),n.theDate)).appendTo(n.d.intHTML),i=n.style_dboxRow(),t=0;t<n.fldOrder.length;t++)"a"===n.fldOrder[t]&&12!==n.__("timeFormat")||(e=r?o.durationSteppers[n.fldOrder[t]]:"i"===n.fldOrder[t]?o.minuteStep:1,(a=n.style_dboxCtrl(o.theme_dbox_PrevBtn,o.theme_dbox_NextBtn,n.fldOrder[t],r?n.__("durationLabel")[d.indexOf(n.fldOrder[t])]:null,o.theme_dbox_Inputs)).find("input").data({field:n.fldOrder[t],amount:e}),a.find(".dbBoxNext").data({field:n.fldOrder[t],amount:e}),a.find(".dbBoxPrev").data({field:n.fldOrder[t],amount:-1*e}),i.append(a));!0===n.__("isRTL")&&i.children().each(function(e,t){i.prepend(t)}),s.append(i),s.appendTo(n.d.intHTML),n._dbox_run_update(!0),n.d.intHTML.append(n._doBottomButtons.call(n,!0)),n.d.intHTML.on("change","input",function(){n._dbox_enter(y(this))}).on("keypress","input",function(e){13===e.which&&!0===n.dateOK&&(n._dbox_enter(y(this)),n._t({method:"set",value:n._formatter(n.__fmt(),n.theDate),date:n.theDate}),n._t({method:"close"}))}).on(n.wheelEvent,"input",function(e,t){e.preventDefault(),t=void 0===t?Math.sign(e.originalEvent.wheelDelta):t,n._offset(y(this).data("field"),(t<0?-1:1)*y(this).data("amount"))}).on(o.clickEvent,".dbBoxPrev, .dbBoxNext",function(e){n.d.intHTML.find(":focus").blur(),e.preventDefault(),n._offset(y(this).data("field"),y(this).data("amount"))})},timeflipbox:function(){this._build.flipbox.call(this)},datetimeflipbox:function(){this._build.flipbox.call(this)},durationflipbox:function(){this._build.flipbox.call(this)},flipbox:function(){var e,t,a,i=this,n=this.options,o=this.drag,s=i.style_fboxCtr(n.theme_fbox_RollHeight).addClass("dbRollerV "),r="",d="",l="durationflipbox"===n.mode;if("boolean"!=typeof i.d.intHTML?i.d.intHTML.empty().remove():i.d.input.on("datebox",function(e,t){"postrefresh"===t.method&&i.style_fboxPos()}),i.d.headerText=i._grabLabel("datebox"===n.mode||"datetimebox"===n.mode?i.__("titleDateDialogLabel"):i.__("titleTimeDialogLabel")),i.d.intHTML=y("<span>"),i.d.intHTML.addClass(n.theme_spanStyle),i.fldOrder=i._getFldOrder(n.mode),l?(i.dateOK=!0,i._getCleanDur(),i._fixstepper(i.fldOrder)):(i._check(),i._minStepFix()),n.fboxNatural="default"===n.fboxNatural?l:n.fboxNatural,"flipbox"!==n.mode&&"datetimeflipbox"!==n.mode||i.style_subHead(i._formatter(i.__("headerFormat"),i.theDate)).appendTo(i.d.intHTML),l){for(r=i.style_fboxDurLbls(),t=0;t<i.fldOrder.length;t++)e=i.fldOrder[t],r.append(i.style_fboxDurLbl(i.__("durationLabel")[["d","h","i","s"].indexOf(e)],i.fldOrder.length));!0===i.__("isRTL")&&r.css({direction:"rtl"}),i.d.intHTML.append(r)}for(t=0;t<i.fldOrder.length;t++){for(e=i.fldOrder[t],r=i.style_fboxRollCtr(i.fldOrder.length).addClass("dbRollerC"),d=i.style_fboxRollPrt().addClass("dbRoller"),r.data({field:e,amount:l?n.durationSteppers[e]:"i"===e?n.minuteStep:1}),a=-1*n.flen[e];a<n.flen[e]+1;a++)l?d.append(i.style_fboxRollCld(i._fbox_do_dur_math(e,a,t),0===a?n.theme_fbox_Selected:n.theme_fbox_Default)):d.append(i.style_fboxRollCld(i._fbox_do_roll_math(e,a),0===a?i.dateOK?n.theme_fbox_Selected:n.theme_fbox_Forbidden:n.theme_fbox_Default));n.fboxNatural&&d.children().each(function(e,t){d.prepend(t)}),r.append(d),!0===i.__("isRTL")?s.prepend(r):s.append(r)}i.d.intHTML.append(s),i.style_fboxLens().addClass("dbLens").css({pointerEvents:"none",position:"relative"}).appendTo(i.d.intHTML),i.d.intHTML.append(i._doBottomButtons.call(i,!0)),i.d.intHTML.on(o.eStart,".dbRoller",function(e,t){o.move||(void 0!==t&&(e=t),o.move=!0,o.target=y(this).children().first(),o.pos=parseInt(o.target.css("marginTop").replace(/px/i,""),10),o.start="touch"===e.type.substr(0,5)?e.originalEvent.changedTouches[0].pageY:e.pageY,o.end=!1,o.direc=n.fboxNatural?-1:1,o.velocity=0,o.time=Date.now(),e.stopPropagation(),e.preventDefault())})},slidebox:function(){var e,t,a=this,i=this.options,n=new a._date,o=a.theDate.get(1),s=a.theDate.get(0),r=a.theDate.copy(!1,[0,0,0,12,1,1,1]).adj(2,-3),d="",l={};for("boolean"!=typeof a.d.intHTML&&(a.d.intHTML.remove(),a.d.intHTML=null),a.dateOK=!0,a.d.headerText=a._grabLabel(a.__("titleDateDialogLabel")),a.d.intHTML=y("<span>"),a.d.intHTML.addClass(i.theme_spanStyle),!1===i.slideNoHeader&&(a.style_pnHead(a._formatter(a.__("calHeaderFormat"),a.theDate),i.theme_slide_PrevBtn,i.theme_slide_NextBtn,"dbSlidePrev","dbSlideNext").appendTo(a.d.intHTML),a.d.intHTML.on(i.clickEvent,".dbSlideNext",function(e){return e.preventDefault(),e.stopPropagation(),28<a.theDate.getDate()&&a.theDate.setDate(1),a._offset("m",1),!1}).on(i.clickEvent,".dbSlidePrev",function(e){return e.preventDefault(),e.stopPropagation(),28<a.theDate.getDate()&&a.theDate.setDate(1),a._offset("m",-1),!1})),!1!==i.slideUsePickers&&(a.style_picker(a._pickRanges(o,s,n.get(0),i.slideYearPickRelative),i.theme_slide_Pickers,"dbSlidePickMonth","dbSlidePickYear").appendTo(a.d.intHTML),a.d.intHTML.on("change","#dbSlidePickMonth, #dbSlidePickYear",function(){28<a.theDate.get(2)&&a.theDate.setD(2,1),a.theDate.setD(1,y("#dbSlidePickMonth").val()),a.theDate.setD(0,y("#dbSlidePickYear").val()),a.refresh()})),e=y(a.style_slideGrid()).appendTo(a.d.intHTML).find(".dbSlideGrid").first(),(d=a.style_slideRow()).append(a.style_slideCtrl("dbSlideWkPrev",!0===a.__("isRTL")?i.theme_slide_NextDateBtn:i.theme_slide_PrevDateBtn)),t=-3;t<=3;t++)(l=Object.assign(a._newDateChecker(r),a._slide_ThemeDate(r))).htmlObj=a.style_slideBtn(l),l.eventObj=l.htmlObj.find(".dbEventS").first(),l.eventObj.data(l),d.append(l.htmlObj),r.adj(2,1);d.append(a.style_slideCtrl("dbSlideWkNext",!0===a.__("isRTL")?i.theme_slide_PrevDateBtn:i.theme_slide_NextDateBtn)),!0===a.__("isRTL")&&d.children().each(function(e,t){d.prepend(t)}),d.appendTo(e),!1!==i.slideShowDateList&&!1!==i.slideDateList&&(a.style_dateList(a.__("calDateListLabel"),i.slideDateList,i.theme_slide_DateList,"dbSlidePickList").appendTo(a.d.intHTML),a.d.intHTML.on("change","#dbSlidePickList",function(){var e=y(this).val().split("-");a.theDate=new a._date(e[0],e[1]-1,e[2],12,1,1,1),a._t({method:"doset"})})),a.d.intHTML.append(a._doBottomButtons.call(a,!1)),a.d.intHTML.on(i.clickEvent,".dbEventS",function(e){e.preventDefault(),y(this).data("good")&&(a.theDate=y(this).data("dateObj").copy(),a._t({method:"set",value:a._formatter(a.__fmt(),a.theDate),date:a.theDate}),a._t({method:"close"}))}).on(i.clickEvent,".dbSlideWkNext",function(e){return e.preventDefault(),e.stopPropagation(),a._offset("d",7),!1}).on(i.clickEvent,".dbSlideWkPrev",function(e){return e.preventDefault(),e.stopPropagation(),a._offset("d",-7),!1}).on(a.wheelEvent,function(e,t){e.preventDefault(),t=void 0===t?Math.sign(e.originalEvent.wheelDelta):t,a._offset("d",0<t?7:-7)})}},_drag:{default:function(){return!1},timeflipbox:function(){this._drag.flipbox.call(this)},datetimeflipbox:function(){this._drag.flipbox.call(this)},durationflipbox:function(){this._drag.flipbox.call(this)},flipbox:function(){var d=this,l=this.options,c=this.drag;y(document).on(c.eMove,function(e){if(c.move&&"flipbox"===l.mode.slice(-7))return c.end="touch"===e.type.substr(0,5)?e.originalEvent.changedTouches[0].pageY:e.pageY,c.target.css("margin-top",c.pos+c.end-c.start),c.elapsed=Date.now()-c.time,c.velocity=100*(c.end-c.start)/(1+c.elapsed)*.8+.2*c.velocity,e.preventDefault(),e.stopPropagation(),!1}),y(document).on(c.eEnd,function(e){var t,a,i,n,o,s,r;c.move&&"flipbox"===l.mode.slice(-7)&&(c.velocity<15&&-15<c.velocity||!l.useKinetic?((c.move=!1)!==c.end&&(e.preventDefault(),e.stopPropagation(),c.tmp=c.target.closest(".dbRollerC"),t=!1!==l.flipSizeOverride?l.flipSizeOverride:c.target[0].getBoundingClientRect().height,d._offset(c.tmp.data("field"),parseInt((c.start-c.end)/t,10)*c.tmp.data("amount")*c.direc)),c.start=!1,c.end=!1):(c.move=!1,c.start=!1,c.end=!1,c.tmp=c.target.closest(".dbRollerC"),t=!1!==l.flipSizeOverride?l.flipSizeOverride:c.target[0].getBoundingClientRect().height,a=-.8*c.velocity*Math.exp(-c.elapsed/325)*8*-1,i=parseInt(c.target.css("marginTop").replace(/px/i,""),10),n=parseInt(i+a,10),o=c.pos-n,s=Math.round(o/t),r=s*c.tmp.data("amount")*c.direc,c.target.animate({marginTop:n},parseInt(1e4/c.velocity)+1e3,function(){d._offset(c.tmp.data("field"),r)}),e.preventDefault(),e.stopPropagation()))})}},_offset:function(e,t,a){var i,n,o,s,r=this,d=r.options,l=["y","m","d","h","i","s"].indexOf(e),c=32-r.theDate.copy([0],[0,0,32,13]).getDate(),h=[31,32-r.theDate.copy([0],[0,1,32,13]).getDate(),31,30,31,30,31,31,30,31,30,31],u="a"!==e&&("y"===e||void 0===d.rolloverMode[e]||!0===d.rolloverMode[e]);if(void 0===a&&(a=!0),"y"===e&&1===r.theDate.get(1)&&29===r.theDate.get(2)&&r.theDate.setD(2,28),"a"===e)t%2!=0&&(i=11<r.theDate.get(3)?-12:12,r.theDate.adj(3,i));else if(u)r.theDate.adj(l,t);else{switch(e){case"m":n=11,o=0,s=12;break;case"d":o=1,s=n=c;break;case"h":n=23,o=0,s=24;break;case"i":case"s":n=59,o=0,s=60}(i=r.theDate.get(l)+t)<o?i=i%s+s:n<i&&(i%=s),"m"===e&&r.theDate.get(2)>h[i]&&r.theDate.setD(2,h[i]),r.theDate.setD(l,i)}!0===a&&r.refresh(),d.useImmediate&&r._t({method:"doset"}),"calbox"===d.mode&&r._t({method:"displayChange",selectedDate:r.originalDate,shownDate:r.theDate,thisChange:e,thisChangeAmount:t,gridStart:r.getCalStartGrid(),gridEnd:r.getCalEndGrid(),selectedInGrid:r.isSelectedInCalGrid(),selectedInBounds:r.isSelectedInBounds()}),r._t({method:"offset",type:e,amount:t,newDate:r.theDate})},_startOffset:function(e){var t=this.options;return!1!==t.startOffsetYears&&e.adj(0,t.startOffsetYears),!1!==t.startOffsetMonths&&e.adj(1,t.startOffsetMonths),!1!==t.startOffsetDays&&e.adj(2,t.startOffsetDays),e},_posZero:function(e){return e<0?0:e},getModalPosition:function(){var e=this.options.displayForcePosition,t=this.d.mainWrap[0].getBoundingClientRect();return!1!==e?{position:"absolute",top:e[0],left:e[1]}:{position:"fixed",top:"50%",left:"50%","margin-left":t.width/2*-1,"margin-top":t.height/2*-1}},getDropPosition:function(e){var t,a=this,i=this.options,n=this.options.displayForcePosition,o=a.d.wrap[0].getBoundingClientRect(),s=a.d.mainWrap[0].getBoundingClientRect(),r=window.pageYOffset,d=window.pageXOffset,l=Math.max(document.documentElement.clientWidth,window.innerWidth||0)<=i.breakpointWidth.replace("px","");return void 0===(t={centerLeft:{top:a._posZero(r+o.top+o.height/2-s.height/2),left:a._posZero(d+o.left)},centerRight:{top:a._posZero(r+o.top+o.height/2-s.height/2),left:a._posZero(d+o.left+o.width-s.width)},centerMiddle:{top:a._posZero(r+o.top+o.height/2-s.height/2),left:a._posZero(d+o.left+o.width/2-s.width/2)},topLeft:{top:a._posZero(r+o.top-s.height-1),left:a._posZero(d+o.left)},topRight:{top:a._posZero(r+o.top-s.height-1),left:a._posZero(d+o.left+o.width-s.width)},topMiddle:{top:a._posZero(r+o.top-s.height-1),left:a._posZero(d+o.left+o.width/2-s.width/2)},bottomLeft:{top:a._posZero(r+o.top+o.height),left:a._posZero(d+o.left)},bottomRight:{top:a._posZero(r+o.top+o.height),left:a._posZero(d+o.left+o.width-s.width)},bottomMiddle:{top:a._posZero(r+o.top+o.height),left:a._posZero(d+o.left+o.width/2-s.width/2)}})[e]&&(e="bottomRight"),!1!==n?{position:"absolute",top:n[0],left:n[1]}:{position:"absolute",top:t[e].top,left:l?0:t[e].left}},getTheDate:function(){return this.theDate},getSelectedDate:function(){return this.originalDate},getLastDur:function(){return this.lastDuration},dateVisible:function(){return void 0===this.isSelectedInCalGrid||this.isSelectedInCalGrid()},setTheDate:function(e){this.theDate="object"==typeof e?e:this._makeDate(e),this.refresh(),this._t({method:"doset"})},parseDate:function(e,t){var a;return this.fmtOver=e,a=this._makeDate(t),this.fmtOver=!1,a},parseISO:function(e){return this.parseDate("%Y-%m-%d",e)},callFormat:function(e,t,a){return void 0===a&&(a=!1),this._formatter(e,t,a)},refresh:function(){var e=this,t=this.options;"function"!=typeof e._build[t.mode]?e._build.default.call(e):e._build[t.mode].call(e),!0===e.__("useArabicIndic")&&e._doIndic(),e.d.mainWrap.append(e.d.intHTML),e._t({method:"postrefresh"})},applyMinMax:function(e,t){var a,i=this.options,n=RegExp(/\d\d\d\d-\d\d-\d\d/);void 0===e&&(e=!0),void 0===t&&(t=!0),!0!==t&&!1!==i.minDate||(a=this.d.input.attr("min"),n.test(a)&&(i.minDate=a)),!0!==t&&!1!==i.maxDate||(a=this.d.input.attr("max"),n.test(a)&&(i.maxDate=a)),!0===e&&this._t({method:"refresh"})},_dur:function(e){return[Math.max(0,Math.floor(e/864e5)),Math.max(0,Math.floor(e/36e5%24)),Math.max(0,Math.floor(e/6e4%60)),Math.max(0,Math.floor(e/1e3%60))]},__:function(e){var t=this.options,a=t.lang[t.useLang],i=t[t.mode+"lang"],n="override"+e.charAt(0).toUpperCase()+e.slice(1);return void 0!==t[n]?t[n]:void 0!==a&&void 0!==a[e]?a[e]:void 0!==i&&void 0!==i[e]?i[e]:void 0!==t.lang.default[e]?t.lang.default[e]:"Err:NotFound"},__fmt:function(){var e=this,t=this.options;if(void 0!==e.fmtOver&&!1!==e.fmtOver)return e.fmtOver;switch(t.mode){case"timebox":case"timeflipbox":return e.__("timeOutput");case"durationbox":case"durationflipbox":return e.__("durationFormat");case"datetimebox":case"datetimeflipbox":return e.__("datetimeFormat");default:return e.__("dateFormat")}},_zPad:function(e,t){return void 0!==t&&"-"===t?String(e):(e<10?"0":"")+String(e)},_dRep:function(e,t){var a,i,n=48,o=57,s=1584,r="";for(-1===t&&(n+=s,o+=s,s=-1584),i=0;i<e.length;i++)r+=n<=(a=e.charCodeAt(i))&&a<=o?String.fromCharCode(a+s):String.fromCharCode(a);return r},_doIndic:function(){var e=this;e.d.intHTML.find("*").each(function(){y(this).children().length<1&&y(this).html(e._dRep(y(this).html()))}),e.d.intHTML.find("input").each(function(){y(this).val(e._dRep(y(this).val()))})},_n:function(e,t){return e<0?t:e},_pa:function(e,t){return"boolean"==typeof t?new this._date(e[0],e[1],e[2],0,0,0,0):new this._date(t.get(0),t.get(1),t.get(2),e[0],e[1],e[2],0)},_btwn:function(e,t,a){return t<e&&e<a},_grabLabel:function(e){var t,a,i=this.options,n=!1;return void 0===i.overrideDialogLabel?(t=this.d.input.attr("placeholder"),a=this.d.input.attr("title"),void 0!==t?t:void 0!==a?a:""===(n=y(document).find("label[for='"+this.d.input.attr("id")+"']").text())?e:n):i.overrideDialogLabel},_getFldOrder:function(e){switch(e){case"durationbox":case"durationflipbox":return this.__("durationOrder");case"timebox":case"timeflipbox":return this.__("timeFieldOrder");case"datetimebox":case"datetimeflipbox":return this.__("datetimeFieldOrder");default:return this.__("dateFieldOrder")}},_t:function(e){this.d.input.trigger("datebox",e)},_prepFunc:function(e){return!1===e||"function"==typeof e?e:"function"==typeof window[e]&&window[e]},_pickRanges:function(e,t,a,i){var n,o=this.options,s=!1===i?a:t,r=0,d=0,l={month:[],year:[]};for(n=0;n<=11;n++)n===e?l.month.push([n,this.__("monthsOfYear")[n],!0]):l.month.push([n,this.__("monthsOfYear")[n],!1]);for(r=o.calYearPickMin<1?s+o.calYearPickMin:o.calYearPickMin<1800?s-o.calYearPickMin:"NOW"===o.calYearPickMin?a:o.calYearPickMin,d=o.calYearPickMax<1800?s+o.calYearPickMax:"NOW"===o.calYearPickMax?a:o.calYearPickMax,n=r;n<=d;n++)n===t?l.year.push([n,n,!0]):l.year.push([n,n,!1]);return l},_stdSel:function(e,t,a){var i,n="<select class='"+a+"' id='"+t+"'>";for(i=0;i<e.length;i++)n+="<option value='"+e[i][0]+"'"+(!0===e[i][2]?" selected='selected'":"")+">"+e[i][1]+"</option>";return n+="</select>"},_stdBtn:{cancel:function(){var t=this,e=this.options;return y(t.style_btn(e.theme_cancelBtn,t.__("cancelButton"))).on(e.clickEvent,function(e){e.preventDefault(),t._t({method:"close",closeCancel:!0})})},clear:function(){var t=this,e=this.options;return y(t.style_btn(e.theme_clearBtn,t.__("clearButton"))).on(e.clickEvent,function(e){e.preventDefault(),t.d.input.val(""),t._t({method:"clear"}),t._t({method:"close",closeCancel:!0})})},close:function(e,t){var a=this,i=this.options;return void 0===t&&(t=!1),y(a.style_btn(i.theme_closeBtn,e)).addClass(!0===a.dateOK?"":"disabled").on(i.clickEvent,function(e){e.preventDefault(),!0===a.dateOK&&(!1===t?a._t({method:"set",value:a._formatter(a.__fmt(),a.theDate),date:a.theDate}):a._t(t),a._t({method:"close"}))})},today:function(){var t=this,a=this.options;return y(t.style_btn(a.theme_todayBtn,t.__("todayButtonLabel"))).on(a.clickEvent,function(e){e.preventDefault(),t.theDate=t._pa([0,0,0],new t._date),t._t({method:"doset"}),!1!==a.closeTodayButton&&t._t({method:"close"})})},tomorrow:function(){var t=this,a=this.options;return y(t.style_btn(a.theme_tomorrowBtn,t.__("tomorrowButtonLabel"))).on(a.clickEvent,function(e){e.preventDefault(),t.theDate=t._pa([0,0,0],new t._date).adj(2,1),t._t({method:"doset"}),!1!==a.closeTomorrowButton&&t._t({method:"close"})})}},_doBottomButtons:function(e){var t,a,i=this,n=this.options;if(!(n.useSetButton&&e||n.useTodayButton||n.useTomorrowButton||n.useClearButton||n.useCancelButton))return"";if(t=i.style_btnGrp(n.useCollapsedBut),n.useSetButton&&e){switch(n.mode){case"timebox":case"timeflipbox":a=i.__("setTimeButtonLabel");break;case"durationbox":case"duartionflipbox":a=i.__("setDurationButtonLabel");break;default:a=i.__("setDateButtonLabel")}i.setBut=i._stdBtn.close.call(i,a),i.setBut.appendTo(t)}return n.useTodayButton&&t.append(i._stdBtn.today.call(i)),n.useTomorrowButton&&t.append(i._stdBtn.tomorrow.call(i)),n.useClearButton&&t.append(i._stdBtn.clear.call(i)),n.useCancelButton&&t.append(i._stdBtn.cancel.call(i)),"function"==typeof i.style_btnGrpOut&&(t=i.style_btnGrpOut(n.useCollapsedBut,t)),t},close:function(){var e,t=this,a=this.options,i={};switch(a.closeCallback=t._prepFunc(a.closeCallback),!1!==a.closeCallback?i.afterclose=function(){a.closeCallback.apply(t,[{initDate:t.initDate,date:t.theDate,duration:t.lastDuration,cancelClose:t.cancelClose}].concat(a.closeCallbackArgs))}:i.afterclose=function(){return!0},a.displayMode){case"blind":t.d.mainWrap.slideUp();case"inline":return i.afterclose.call(),!0;default:y(".jtsage-datebox-backdrop-div").remove(),t.d.mainWrap.removeClass("db-show"),i.afterclose.call(),t.d.mainWrap.hide(),t.d.mainWrap.detach()}y(document).off(t.drag.eMove).off(t.drag.eEnd).off(t.drag.eEndA).off("resize"+t.eventNamespace).off("keydown"+t.eventNamespace),a.useFocus&&(t.fastReopen=!0,setTimeout((e=t,function(){e.fastReopen=!1}),300))},_create:function(){y(document).trigger("dateboxcreate");var e,t,a=this,i=Object.assign(this.options,this._getLongOptions(this.element),this.element.data("options")),n={input:this.element,wrap:this.element.parent(),mainWrap:y("<div class='dbContainer_"+this.uuid+"'>").css("zIndex",i.zindex),intHTML:!1},o="<style>.dbContainer_"+this.uuid+" { touch-action: none; width: "+i.controlWidth+i.controlWidthImp+"} @media (max-width: "+i.breakpointWidth+") { .dbContainer_"+this.uuid+" { width: 100% "+i.controlWidthImp+"} } "+(!1!==i.theme_headStyle?i.theme_headStyle:"")+"</style>",s=".datebox"+this.uuid,r={eStart:"touchstart"+s+" mousedown"+s,eMove:"touchmove"+s+" mousemove"+s,eEnd:"touchend"+s+" mouseup"+s,eEndA:["mouseup","touchend","touchcancel","touchmove"].join(s+" ")+s,move:!1,start:!1,end:!1,pos:!1,target:!1,delta:!1,tmp:!1};y("head").append(y(o)),a.d=n,a.drag=r,a.icons=this.icons,!1!==i.usePlaceholder&&a.d.input.attr("placeholder",a._grabLabel("string"==typeof i.usePlaceholder?i.usePlaceholder:"")),a.wheelEvent=i.disableWheel?"nonsenseEvent":void 0!==y.event.special.mousewheel?"mousewheel":"wheel",a.firstOfGrid=!1,a.lastOfGrid=!1,a.selectedInGrid=!1,a.skipChange=!1,a.cancelClose=!1,a.disabled=!1,a._date=window.Date,a._enhanceDate(),a.baseID=a.d.input.attr("id"),a.initDate=new a._date,a.initDate.setMilliseconds(0),a.theDate=i.defaultValue?a._makeDate():""!==a.d.input.val()?a._makeDate(a.d.input.val()):new a._date,""===a.d.input.val()&&a._startOffset(a.theDate),a.initDone=!1,i.showInitialValue&&a.d.input.val(a._formatter(a.__fmt(),a.theDate)),a.d.wrap=a.style_inWrap(a.d.input,i.theme_openButton),!1!==i.mode&&!1===i.buttonIcon&&(i.buttonIcon="time"===i.mode.substr(0,4)||"dur"===i.mode.substr(0,3)?i.buttonIconTime:i.buttonIconDate),i.useButton?(y(a.style_inBtn(i.buttonIcon,a.__("tooltip"),i.theme_openButton)).appendTo(a.d.wrap),a.d.wrap.on(i.clickEvent,".dbOpenButton",function(e){e.preventDefault(),i.useFocus?a.d.input.focus():a.disabled||a._t({method:"open"})})):a.style_inNoBtn(a.d.wrap),i.hideInput&&a.style_inHide(),i.runOnBlurCallback=a._prepFunc(i.runOnBlurCallback),a.d.input.on("focus.datebox",function(){!1===a.disabled&&i.useFocus&&a._t({method:"open"})}).on("change.datebox",function(){if(a.skipChange)return!(a.skipChange=!1);!1===i.runOnBlurCallback?!0===i.safeEdit?!1===(e=a._makeDate(a.d.input.val(),!0))[1]?a.theDate=e[0]:(a.theDate=a.originalDate,a._t({method:"doset"})):a.theDate=a._makeDate(a.d.input.val()):(e=a._makeDate(a.d.input.val(),!0),"object"!=typeof(t=i.runOnBlurCallback.call(a,{origDate:a.originalDate,input:a.d.input.val(),oldDate:a.theDate,newDate:e[0],isGood:!e[1],isBad:e[1]}))?a.theDate=e[0]:(a.theDate=t,a._t({method:"doset"}))),a.originalDate=a.theDate.copy(),a.refresh()}).on("datebox",a._event),i.lockInput&&a.d.input.attr("readonly","readonly"),a.d.input.is(":disabled")&&a.disable(),a.applyMinMax(!1,!1),"inline"!==i.displayMode&&"blind"!==i.displayMode||a.open(),y(document).trigger("dateboxaftercreate")},_destroy:function(){var e=this,t=this.options,a=e.d.wrap.find("dbOpenButton");!0===t.useButton&&(a.remove(),e.d.input.unwrap()),t.lockInput&&e.d.input.removeAttr("readonly"),e.d.input.off("datebox").off("focus.datebox").off("blur.datebox").off("change.datebox"),y(document).off(e.drag.eMove).off(e.drag.eStart).off(e.drag.eEnd).off(e.drag.eEndA).off("resize"+e.eventNamespace)},disable:function(){this.d.input.attr("disabled",!0),this.disabled=!0,this._t({method:"disable"})},enable:function(){this.d.input.attr("disabled",!1),this.disabled=!1,this._t({method:"enable"})},open:function(){var t=this,a=this.options,e=a.displayMode,i={};if(a.useFocus&&!0===t.fastReopen)return t.d.input.blur(),!1;if(t.theDate=t._makeDate(t.d.input.val()),t.originalDate=t.theDate.copy(),""===t.d.input.val()&&t._startOffset(t.theDate),t.d.input.blur(),"function"!=typeof t._build[a.mode]?t._build.default.call(t):t._build[a.mode].call(t),"function"==typeof t._drag[a.mode]&&t._drag[a.mode].call(t),t._t({method:"refresh"}),!0===t.__("useArabicIndic")&&t._doIndic(),t.d.intHTML.is(":visible"))return!1;if(t.d.mainWrap.empty(),a.useHeader&&t.d.mainWrap.append(y(t.style_mainHead(t.d.headerText,a.theme_headerTheme,a.theme_headerBtn))).find(".dbCloser").on(a.clickEvent,function(e){e.preventDefault(),t._t({method:"close",closeCancel:!0})}),t.d.mainWrap.append(t.d.intHTML).css("zIndex",a.zindex),t._t({method:"postrefresh"}),a.openCallback=t._prepFunc(a.openCallback),!1!==a.openCallback?i.afteropen=function(){t._t({method:"postrefresh"}),!1===a.openCallback.apply(t,[{initDate:t.initDate,date:t.theDate,duration:t.lastDuration}].concat(a.openCallbackArgs))&&t._t({method:"close"})}:i.afteropen=function(){t._t({method:"postrefresh"})},a.beforeOpenCallback=t._prepFunc(a.beforeOpenCallback),!1!==a.beforeOpenCallback&&!1===a.beforeOpenCallback.apply(t,[{initDate:t.initDate,date:t.theDate,duration:t.lastDuration}].concat(a.beforeOpenCallbackArgs)))return!1;switch(a.displayMode){case"inline":case"blind":t.initDone?"blind"===a.displayMode&&(t.refresh(),t.d.mainWrap.slideDown()):(t.d.mainWrap.insertAfter(t.style_attach(!0)).addClass(a.theme_inlineContainer).css({zIndex:"auto",marginRight:"right"===a.displayInlinePosition?0:"auto",marginLeft:"left"===a.displayInlinePosition?0:"auto"}),"blind"===a.displayMode&&t.d.mainWrap.hide(),t.initDone=!0),t._t({method:"postrefresh"});break;default:t.d.mainWrap.show().css("zIndex",a.zindex).appendTo(t.style_attach(!1)).addClass(a.theme_modalContainer).one(a.tranDone,function(){t.d.mainWrap.is(":visible")?i.afteropen.call():(i.afterclose.call(),t.d.mainWrap.removeClass("db-show"))}),t.d.backdrop=y("<div class='jtsage-datebox-backdrop-div'></div>").css(a.theme_backgroundMask).css("zIndex",a.zindex-1).appendTo("modal"===a.displayMode?t.style_attach(!1):"body").on(a.clickEvent,function(e){e.preventDefault(),a.dismissOutsideClick&&t._t({method:"close",closeCancel:!0})}),t.d.mainWrap.css("modal"===a.displayMode?t.getModalPosition.call(t):t.getDropPosition.call(this,a.displayDropdownPosition))}"modal"!==e&&"dropdown"!==e||(y(document).on("resize"+t.eventNamespace,function(){this.d.mainWarp.css("modal"===e?this.getModalPosition.call(this):this.getDropPosition.call(this,this.options.displayDropdownPosition))}.bind(t)),a.dismissOnEscape&&y(document).on("keydown"+t.eventNamespace,function(e){("key"in e?"Escape"===e.key||"Esc"===e.key:27===e.keyCode)&&this._t({method:"close",closeCancel:!0})}.bind(t))),window.setTimeout(function(){t.d.mainWrap.addClass("db-show")},0),window.setTimeout(function(){t.d.mainWrap.trigger("oTransitionEnd")},200)},getCalStartGrid:function(){return this.firstOfGrid},getCalEndGrid:function(){return this.lastOfGrid},isSelectedInCalGrid:function(){var e=this;return!1!==e.firstOfGrid&&!1!==e.lastOfGrid&&(e.firstOfGrid.comp()<=e.originalDate.comp()&&e.originalDate.comp()<=e.lastOfGrid.comp())},isSelectedInBounds:function(){var e=this;return!1!==e.firstOfMonth&&!1!==e.lastOfMonth&&(e.firstOfMonth.comp()<=e.originalDate.comp()&&e.originalDate.comp()<=e.lastOfMonth.comp())},isInCalGrid:function(e){return!1!==this.firstOfGrid&&!1!==this.lastOfGrid&&(this.firstOfGrid.comp()<=e.comp()&&e.comp()<=this.lastOfGrid.comp())},_cal_ThemeDate:function(e,t){var a,i=this,n=this.options,o=!1,s={theme:n.theme_cal_Default,inBounds:!0},r=[["selected","theme_cal_Selected"],["today","theme_cal_Today"],["highDates","theme_cal_DateHigh"],["highDatesAlt","theme_cal_DateHighAlt"],["highDatesRec","theme_cal_DateHighRec"],["highDays","theme_cal_DayHigh"]];for(i.realToday=new i._date,e.get(1)!==t&&(s.inBounds=!1)!==n.calHighOutOfBounds&&(s.theme=n.theme_cal_OutOfBounds,!(o=!0)!==n.calSelectedOutOfBounds&&i._ThemeDateCK.selected.call(i,e)&&(s.theme=n.theme_cal_Selected)),a=0;a<r.length&&!o;a++)i._ThemeDateCK[r[a][0]].call(i,e)&&(s.theme=n[r[a][1]],o=!0);return s},_dbox_run_update:function(e){var t=this,a=this.options,i="durationbox"===a.mode;i&&t._getCleanDur(),!0!==e&&!0!=i&&(t._check(),"datebox"!==a.mode&&"datetimebox"!==a.mode||t.d.intHTML.find(".dbHeader").childern().first().text(t._formatter(t.__("headerFormat"),t.theDate)),a.useSetButton&&(!1===t.dateOK?t.setBut.addClass(a.disabledState):t.setBut.removeClass(a.disabledState))),t.d.intHTML.find("input").each(function(){switch(y(this).data("field")){case"y":y(this).val(t.theDate.get(0));break;case"m":y(this).val(t.theDate.get(1)+1);break;case"d":y(this).val(i?t.lastDurationA[0]:t.theDate.get(2));break;case"h":i?y(this).val(t.lastDurationA[1]):12===t.__("timeFormat")?y(this).val(t.theDate.get12hr()):y(this).val(t.theDate.get(3));break;case"i":i?y(this).val(t.lastDurationA[2]):y(this).val(t._zPad(t.theDate.get(4)));break;case"M":y(this).val(t.__("monthsOfYearShort")[t.theDate.get(1)]);break;case"a":y(this).val(t.__("meridiem")[11<t.theDate.get(3)?1:0]);break;case"s":i?y(this).val(t.lastDurationA[3]):y(this).val(t._zPad(t.theDate.get(5)))}}),!0===t.__("useArabicIndic")&&t._doIndic()},_dbox_enter:function(e){var t,a=parseInt(e.val(),10),i=this,n=0;if("M"===e.data("field")&&-1<(t=i.__("monthsOfYearShort").indexOf(e.val()))&&i.theDate.setMonth(t),""!==e.val()&&0===e.val().toString().search(/^[0-9]+$/))switch(e.data("field")){case"y":i.theDate.setD(0,a);break;case"m":i.theDate.setD(1,a-1);break;case"d":i.theDate.setD(2,a),n+=86400*a;break;case"h":i.theDate.setD(3,a),n+=3600*a;break;case"i":i.theDate.setD(4,a),n+=60*a;break;case"s":i.theDate.setD(5,a),n+=a}"durationbox"===this.options.mode&&i.theDate.setTime(i.initDate.getTime()+1e3*n),setTimeout(function(){i.refresh()},150)},_fbox_do_dur_math:function(e,t,a){var i,n=this,o={d:Number.MAX_SAFE_INTEGER,h:24,i:60,s:60}[e];if(0===a&&"d"!==e)switch(e){case"h":n.lastDurationA[1]+24*n.lastDurationA[0];break;case"i":n.lastDurationA[2]+60*n.lastDurationA[1]+24*n.lastDurationA[0]*60;break;case"s":n.lastDuration}else i=n.lastDurationA[["d","h","i","s"].indexOf(e)]+t;if(0===a)return i<0?" ":i;for(i<0&&(i+=o);o-1<i;)i-=o;return i},_fbox_do_roll_math:function(e,t){var a,i,n=this,o=this.options,s=[],r=0,d=0,l=null;switch(e){case"y":return n.theDate.get(0)+t;case"m":return i=n.theDate.copy(!1,[0,0,1]).adj(1,t),n.__("monthsOfYearShort")[i.get(1)];case"d":if(!1!==o.rolloverMode.d)return n.theDate.copy([0,0,t]).get(2);for(d=32-n.theDate.copy([0],[0,0,32,13]).getDate(),r=n.theDate.get(3),a=0;a<d;a++)d<a+r?s.push(a+r-d):s.push(a+r);return(l=t%d)<0?s[s.length+l]:s[l];case"h":return i=n.theDate.copy([0,0,0,t]),12===n.__("timeFormat")?i.get12hr():i.get(3);case"i":return n._zPad(n.theDate.copy([0,0,0,0,t*o.minuteStep]).get(4));case"s":return n._zPad(n.theDate.copy([0,0,0,0,0,t]).get(5));case"a":return 11<n.theDate.get(3)?n.__("meridiem")[t%2==0?1:0]:n.__("meridiem")[t%2==0?0:1]}},_slide_ThemeDate:function(e){var t,a=this.options,i=!1,n={theme:a.theme_slide_Default},o=[["selected","theme_slide_Selected"],["today","theme_slide_Today"],["highDates","theme_slide_DateHigh"],["highDatesAlt","theme_slide_DateHighAlt"],["highDatesRec","theme_slide_DateHighRec"],["highDays","theme_slide_DayHigh"]];for(this.realToday=new this._date,t=0;t<o.length&&!i;t++)this._ThemeDateCK[o[t][0]].call(this,e)&&(n.theme=a[o[t][1]],i=!0);return n}})}(jQuery),function(e){e(document).ready(function(){e("[data-role='datebox']").each(function(){e(this).datebox()})})}(jQuery); | ||
//# sourceMappingURL=jtsage-datebox-5.1.4.jqm.min.js.map |
@@ -5,3 +5,3 @@ { | ||
"description": "Plugin to provide a framework agnostic Date and Time Picker (jQueryMobile Version)", | ||
"version": "5.1.3", | ||
"version": "5.1.4", | ||
"supports": { | ||
@@ -8,0 +8,0 @@ "jqm": "1.4.5" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
281075
3341