text: !function(t,e){if("function"==typeof define&&define.amd)define(["moment","jquery","exports"],function(a,i,s){t.daterangepicker=e(t,s,a,i)});else if("undefined"!=typeof exports){var a=require("moment"),i=window.jQuery;if(void 0===i)try{i=require("jquery")}catch(s){if(!i)throw new Error("jQuery dependency not found")}e(t,exports,a,i)}else t.daterangepicker=e(t,{},t.moment||moment,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,a,i){var s=function(t,e,s){if(this.parentEl="body",this.element=i(t),this.startDate=a().startOf("day"),this.endDate=a().endOf("day"),this.timeZone=a().utcOffset(),this.minDate=!1,this.maxDate=!1,this.dateLimit=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.showWeekNumbers=!1,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyClass="btn-success",this.cancelClass="btn-default",this.locale={format:"MM/DD/YYYY",separator:" - ",applyLabel:"Apply",startLabel:"Start date:",endLabel:"End date:",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:a.weekdaysMin(),monthNames:a.monthsShort(),firstDay:a.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},("object"!=typeof e||null===e)&&(e={}),e=i.extend(this.element.data(),e),"string"!=typeof e.template&&(e.template='<div class="daterangepicker dropdown-menu"><div class="calendars"><div class="calendar left"><div class="calendar-table"></div><div class="daterangepicker_input"><div class="calendar-time"><div></div></div></div></div><div class="calendar right"><div class="calendar-table"></div><div class="daterangepicker_input"><div class="calendar-time"><div></div></div></div></div></div><div class="ranges"><div class="daterangepicker-inputs"><div class="daterangepicker_input"><span class="start-date-label"></span><input class="form-control" type="text" name="daterangepicker_start" value="" /><i class="icon-calendar3"></i></div><div class="daterangepicker_input"><span class="end-date-label"></span><input class="form-control" type="text" name="daterangepicker_end" value="" /><i class="icon-calendar3"></i></div></div><div class="range_inputs"><button class="applyBtn" disabled="disabled" type="button"></button> <button class="cancelBtn" type="button"></button></div></div></div>'),this.parentEl=i(e.parentEl&&i(e.parentEl).length?e.parentEl:this.parentEl),this.container=i(e.template).appendTo(this.parentEl),"object"==typeof e.locale&&("string"==typeof e.locale.format&&(this.locale.format=e.locale.format),"string"==typeof e.locale.separator&&(this.locale.separator=e.locale.separator),"object"==typeof e.locale.daysOfWeek&&(this.locale.daysOfWeek=e.locale.daysOfWeek.slice()),"object"==typeof e.locale.monthNames&&(this.locale.monthNames=e.locale.monthNames.slice()),"number"==typeof e.locale.firstDay&&(this.locale.firstDay=e.locale.firstDay),"string"==typeof e.locale.applyLabel&&(this.locale.applyLabel=e.locale.applyLabel),"string"==typeof e.locale.startLabel&&(this.locale.startLabel=e.locale.startLabel),"string"==typeof e.locale.endLabel&&(this.locale.endLabel=e.locale.endLabel),"string"==typeof e.locale.cancelLabel&&(this.locale.cancelLabel=e.locale.cancelLabel),"string"==typeof e.locale.weekLabel&&(this.locale.weekLabel=e.locale.weekLabel),"string"==typeof e.locale.customRangeLabel&&(this.locale.customRangeLabel=e.locale.customRangeLabel)),"string"==typeof e.startDate&&(this.startDate=a(e.startDate,this.locale.format)),"string"==typeof e.endDate&&(this.endDate=a(e.endDate,this.locale.format)),"string"==typeof e.minDate&&(this.minDate=a(e.minDate,this.locale.format)),"string"==typeof e.maxDate&&(this.maxDate=a(e.maxDate,this.locale.format)),"object"==typeof e.startDate&&(this.startDate=a(e.startDate)),"object"==typeof e.endDate&&(this.endDate=a(e.endDate)),"object"==typeof e.minDate&&(this.minDate=a(e.minDate)),"object"==typeof e.maxDate&&(this.maxDate=a(e.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),"string"==typeof e.applyClass&&(this.applyClass=e.applyClass),"string"==typeof e.cancelClass&&(this.cancelClass=e.cancelClass),"object"==typeof e.dateLimit&&(this.dateLimit=e.dateLimit),"string"==typeof e.opens&&(this.opens=e.opens),"string"==typeof e.drops&&(this.drops=e.drops),"boolean"==typeof e.showWeekNumbers&&(this.showWeekNumbers=e.showWeekNumbers),"string"==typeof e.buttonClasses&&(this.buttonClasses=e.buttonClasses),"object"==typeof e.buttonClasses&&(this.buttonClasses=e.buttonClasses.join(" ")),"boolean"==typeof e.showDropdowns&&(this.showDropdowns=e.showDropdowns),"boolean"==typeof e.singleDatePicker&&(this.singleDatePicker=e.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof e.timePicker&&(this.timePicker=e.timePicker),"boolean"==typeof e.timePickerSeconds&&(this.timePickerSeconds=e.timePickerSeconds),"number"==typeof e.timePickerIncrement&&(this.timePickerIncrement=e.timePickerIncrement),"boolean"==typeof e.timePicker24Hour&&(this.timePicker24Hour=e.timePicker24Hour),"boolean"==typeof e.autoApply&&(this.autoApply=e.autoApply),0!=this.locale.firstDay)for(var n=this.locale.firstDay;n>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),n--;var r,l,o;if("undefined"==typeof e.startDate&&"undefined"==typeof e.endDate&&i(this.element).is("input[type=text]")){var h=i(this.element).val(),c=h.split(this.locale.separator);r=l=null,2==c.length?(r=a(c[0],this.locale.format),l=a(c[1],this.locale.format)):this.singleDatePicker&&""!==h&&(r=a(h,this.locale.format),l=a(h,this.locale.format)),null!==r&&null!==l&&(this.setStartDate(r),this.setEndDate(l))}if("string"==typeof e.timeZone||"number"==typeof e.timeZone?(this.timeZone="string"==typeof e.timeZone&&"undefined"!=typeof a.tz?-1*a.tz.zone(e.timeZone).parse(new Date):e.timeZone,this.startDate.utcOffset(this.timeZone),this.endDate.utcOffset(this.timeZone)):this.timeZone=a(this.startDate).utcOffset(),"object"==typeof e.ranges){for(o in e.ranges){r="string"==typeof e.ranges[o][0]?a(e.ranges[o][0],this.locale.format):a(e.ranges[o][0]),l="string"==typeof e.ranges[o][1]?a(e.ranges[o][1],this.locale.format):a(e.ranges[o][1]),this.minDate&&r.isBefore(this.minDate)&&(r=this.minDate.clone());var d=this.maxDate;this.dateLimit&&r.clone().add(this.dateLimit).isAfter(d)&&(d=r.clone().add(this.dateLimit)),d&&l.isAfter(d)&&(l=d.clone()),this.minDate&&l.isBefore(this.minDate)||d&&r.isAfter(d)||(this.ranges[o]=[r,l])}var m="<ul>";for(o in this.ranges)m+="<li>"+o+"</li>";m+="<li>"+this.locale.customRangeLabel+"</li>",m+="</ul>",this.container.find(".ranges ul").remove(),this.container.find(".ranges").prepend(m)}"function"==typeof s&&(this.callback=s),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&"object"!=typeof e.ranges?this.container.find(".ranges").hide():this.autoApply&&this.container.find(".applyBtn, .cancelBtn").addClass("hide"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".calendar.left").addClass("single"),this.container.find(".calendar.left").show(),this.container.find(".calendar.right").hide(),this.container.find(".daterangepicker_input input, .daterangepicker_input i").hide(),this.timePicker||this.container.find(".ranges").hide()),"undefined"!=typeof e.ranges||this.singleDatePicker||this.container.addClass("show-calendar"),this.container.removeClass("opensleft opensright").addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyClass.length&&this.container.find(".applyBtn").addClass(this.applyClass),this.cancelClass.length&&this.container.find(".cancelBtn").addClass(this.cancelClass),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".start-date-label").html(this.locale.startLabel),this.container.find(".end-date-label").html(this.locale.endLabel),this.container.find(".calendar").on("click.daterangepicker",".prev",i.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",i.proxy(this.clickNext,this)).on("click.daterangepicker","td.available",i.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",i.proxy(this.hoverDate,this)).on("mouseleave.daterangepicker","td.available",i.proxy(this.updateFormInputs,this)).on("change.daterangepicker","select.yearselect",i.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",i.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",i.proxy(this.timeChanged,this)).on("click.daterangepicker",".daterangepicker_input input",i.proxy(this.showCalendars,this)).on("keyup.daterangepicker",".daterangepicker_input input",i.proxy(this.formInputsChanged,this)).on("change.daterangepicker",".daterangepicker_input input",i.proxy(this.updateFormInputs,this)),this.container.find(".daterangepicker-inputs").on("click.daterangepicker",".daterangepicker_input input",i.proxy(this.showCalendars,this)).on("keyup.daterangepicker",".daterangepicker_input input",i.proxy(this.formInputsChanged,this)).on("change.daterangepicker",".daterangepicker_input input",i.proxy(this.updateFormInputs,this)),this.container.find(".ranges").on("click.daterangepicker","button.applyBtn",i.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",i.proxy(this.clickCancel,this)).on("click.daterangepicker","li",i.proxy(this.clickRange,this)).on("mouseenter.daterangepicker","li",i.proxy(this.hoverRange,this)).on("mouseleave.daterangepicker","li",i.proxy(this.updateFormInputs,this)),this.element.is("input")?this.element.on({"click.daterangepicker":i.proxy(this.show,this),"focus.daterangepicker":i.proxy(this.show,this),"keyup.daterangepicker":i.proxy(this.controlChanged,this),"keydown.daterangepicker":i.proxy(this.keydown,this)}):this.element.on("click.daterangepicker",i.proxy(this.toggle,this)),this.element.is("input")&&!this.singleDatePicker?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))};s.prototype={constructor:s,setStartDate:function(t){"string"==typeof t&&(this.startDate=a(t,this.locale.format).utcOffset(this.timeZone)),"object"==typeof t&&(this.startDate=a(t)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate),this.updateMonthsInView()},setEndDate:function(t){"string"==typeof t&&(this.endDate=a(t,this.locale.format).utcOffset(this.timeZone)),"object"==typeof t&&(this.endDate=a(t)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate),this.dateLimit&&this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.dateLimit)),this.updateMonthsInView()},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").removeAttr("disabled").removeClass("disabled"):this.container.find(".right .calendar-time select").attr("disabled","disabled").addClass("disabled")),this.endDate?(this.container.find('input[name="daterangepicker_end"]').removeClass("active"),this.container.find('input[name="daterangepicker_start"]').addClass("active")):(this.container.find('input[name="daterangepicker_end"]').addClass("active"),this.container.find('input[name="daterangepicker_start"]').removeClass("active")),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){this.endDate?(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.endDate.month()!=this.startDate.month()||this.endDate.year()!=this.startDate.year()?this.endDate.clone().date(2):this.startDate.clone().date(2).add(1,"month")):this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"))},updateCalendars:function(){if(this.timePicker){var t,e,a;if(this.endDate){if(t=parseInt(this.container.find(".left .hourselect").val(),10),e=parseInt(this.container.find(".left .minuteselect").val(),10),a=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,!this.timePicker24Hour){var i=this.container.find(".left .ampmselect").val();"PM"===i&&12>t&&(t+=12),"AM"===i&&12===t&&(t=0)}}else if(t=parseInt(this.container.find(".right .hourselect").val(),10),e=parseInt(this.container.find(".right .minuteselect").val(),10),a=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,!this.timePicker24Hour){var i=this.container.find(".left .ampmselect").val();"PM"===i&&12>t&&(t+=12),"AM"===i&&12===t&&(t=0)}this.leftCalendar.month.hour(t).minute(e).second(a),this.rightCalendar.month.hour(t).minute(e).second(a)}if(this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate){var s=!0,n=0;for(var r in this.ranges){if(this.timePicker){if(this.startDate.isSame(this.ranges[r][0])&&this.endDate.isSame(this.ranges[r][1])){s=!1,this.chosenLabel=this.container.find(".ranges li:eq("+n+")").addClass("active").html();break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[r][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[r][1].format("YYYY-MM-DD")){s=!1,this.chosenLabel=this.container.find(".ranges li:eq("+n+")").addClass("active").html();break}n++}s&&(this.chosenLabel=this.container.find(".ranges li:last").addClass("active").html(),this.showCalendars())}},renderCalendar:function(t){var e="left"==t?this.leftCalendar:this.rightCalendar,s=e.month.month(),n=e.month.year(),r=e.month.hour(),l=e.month.minute(),o=e.month.second(),h=a([n,s]).daysInMonth(),c=a([n,s,1]),d=a([n,s,h]),m=a(c).subtract(1,"month").month(),f=a(c).subtract(1,"month").year(),p=a([f,m]).daysInMonth(),u=c.day(),e=[];e.firstDay=c,e.lastDay=d;for(var D=0;6>D;D++)e[D]=[];var g=p-u+this.locale.firstDay+1;g>p&&(g-=7),u==this.locale.firstDay&&(g=p-6);for(var k,y,v=a([f,m,g,12,l,o]),D=0,k=0,y=0;42>D;D++,k++,v=a(v).add(24,"hour"))D>0&&k%7===0&&(k=0,y++),e[y][k]=v.clone().hour(r).minute(l).second(o),v.hour(12),this.minDate&&e[y][k].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&e[y][k].isBefore(this.minDate)&&"left"==t&&(e[y][k]=this.minDate.clone()),this.maxDate&&e[y][k].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&e[y][k].isAfter(this.maxDate)&&"right"==t&&(e[y][k]=this.maxDate.clone());"left"==t?this.leftCalendar.calendar=e:this.rightCalendar.calendar=e;var b="left"==t?this.minDate:this.startDate,C=this.maxDate,P=("left"==t?this.startDate:this.endDate,'<table class="table-condensed">');P+="<thead>",P+="<tr>",this.showWeekNumbers&&(P+="<th></th>"),P+=!b||b.isBefore(e.firstDay)?'<th class="prev available"><i class="icon-arrow-left32"></i></th>':"<th></th>";var w=this.locale.monthNames[e[1][1].month()]+e[1][1].format(" YYYY");if(this.showDropdowns){for(var Y=e[1][1].month(),x=e[1][1].year(),M=C&&C.year()||x+5,L=b&&b.year()||x-50,I=x==L,A=x==M,S='<select class="monthselect form-control input-sm">',_=0;12>_;_++)(!I||_>=b.month())&&(!A||_<=C.month())&&(S+="<option value='"+_+"'"+(_===Y?" selected='selected'":"")+">"+this.locale.monthNames[_]+"</option>");S+="</select>";for(var B='<select class="yearselect  form-control input-sm">',O=L;M>=O;O++)B+='<option value="'+O+'"'+(O===x?' selected="selected"':"")+">"+O+"</option>";B+="</select>",w=S+B}if(P+='<th colspan="5" class="month">'+w+"</th>",P+=!C||C.isAfter(e.lastDay)?'<th class="next available"><i class="icon-arrow-right32"></i></th>':"<th></th>",P+="</tr>",P+="<tr>",this.showWeekNumbers&&(P+='<th class="week">'+this.locale.weekLabel+"</th>"),i.each(this.locale.daysOfWeek,function(t,e){P+="<th>"+e+"</th>"}),P+="</tr>",P+="</thead>",P+="<tbody>",null==this.endDate&&this.dateLimit){var E=this.startDate.clone().add(this.dateLimit).endOf("day");(!C||E.isBefore(C))&&(C=E)}for(var y=0;6>y;y++){P+="<tr>",this.showWeekNumbers&&(P+='<td class="week">'+e[y][0].week()+"</td>");for(var k=0;7>k;k++){var W=[];e[y][k].isSame(new Date,"day")&&W.push("today"),e[y][k].isoWeekday()>5&&W.push("weekend"),e[y][k].month()!=e[1][1].month()&&W.push("off"),this.minDate&&e[y][k].isBefore(this.minDate,"day")&&W.push("off","disabled"),C&&e[y][k].isAfter(C,"day")&&W.push("off","disabled"),e[y][k].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&W.push("active","start-date"),null!=this.endDate&&e[y][k].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&W.push("active","end-date"),null!=this.endDate&&e[y][k]>this.startDate&&e[y][k]<this.endDate&&W.push("in-range");for(var j="",H=!1,D=0;D<W.length;D++)j+=W[D]+" ","disabled"==W[D]&&(H=!0);H||(j+="available"),P+='<td class="'+j.replace(/^\s+|\s+$/g,"")+'" data-title="r'+y+"c"+k+'">'+e[y][k].date()+"</td>"}P+="</tr>"}P+="</tbody>",P+="</table>",this.container.find(".calendar."+t+" .calendar-table").html(P)},renderTimePicker:function(t){var e,a,i=this.maxDate;!this.dateLimit||this.maxDate&&!this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate)||(i=this.startDate.clone().add(this.dateLimit)),"left"==t?(e=this.startDate.clone(),a=this.minDate):"right"==t&&(e=this.endDate?this.endDate.clone():this.startDate.clone(),a=this.startDate),html='<select class="hourselect form-control input-sm">';for(var s=this.timePicker24Hour?0:1,n=this.timePicker24Hour?23:12,r=s;n>=r;r++){var l=r;this.timePicker24Hour||(l=e.hour()>=12?12==r?12:r+12:12==r?0:r);var o=e.clone().hour(l),h=!1;a&&o.minute(59).isBefore(a)&&(h=!0),i&&o.minute(0).isAfter(i)&&(h=!0),html+=l!=e.hour()||h?h?'<option value="'+r+'" disabled="disabled" class="disabled">'+r+"</option>":'<option value="'+r+'">'+r+"</option>":'<option value="'+r+'" selected="selected">'+r+"</option>"}html+="</select> ",html+=': <select class="minuteselect form-control input-sm">';for(var r=0;60>r;r+=this.timePickerIncrement){var c=10>r?"0"+r:r,o=e.clone().minute(r),h=!1;a&&o.second(59).isBefore(a)&&(h=!0),i&&o.second(0).isAfter(i)&&(h=!0),html+=e.minute()!=r||h?h?'<option value="'+r+'" disabled="disabled" class="disabled">'+c+"</option>":'<option value="'+r+'">'+c+"</option>":'<option value="'+r+'" selected="selected">'+c+"</option>"}if(html+="</select> ",this.timePickerSeconds){html+=': <select class="secondselect form-control input-sm">';for(var r=0;60>r;r++){var c=10>r?"0"+r:r,o=e.clone().second(r),h=!1;a&&o.isBefore(a)&&(h=!0),i&&o.isAfter(i)&&(h=!0),html+=e.second()!=r||h?h?'<option value="'+r+'" disabled="disabled" class="disabled">'+c+"</option>":'<option value="'+r+'">'+c+"</option>":'<option value="'+r+'" selected="selected">'+c+"</option>"}html+="</select> "}if(!this.timePicker24Hour){html+='<select class="ampmselect form-control input-sm">';var d="",m="";a&&e.clone().hour(12).minute(0).second(0).isBefore(a)&&(d=' disabled="disabled" class="disabled"'),i&&e.clone().hour(0).minute(0).second(0).isAfter(i)&&(m=' disabled="disabled" class="disabled"'),html+=e.hour()>=12?'<option value="AM"'+d+'>AM</option><option value="PM" selected="selected"'+m+">PM</option>":'<option value="AM" selected="selected"'+d+'>AM</option><option value="PM"'+m+">PM</option>",html+="</select>"}this.container.find(".calendar."+t+" .calendar-time div").html(html)},updateFormInputs:function(){this.container.find("input[name=daterangepicker_start]").val(this.startDate.format(this.locale.format)),this.endDate&&this.container.find("input[name=daterangepicker_end]").val(this.endDate.format(this.locale.format)),this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").removeAttr("disabled"):this.container.find("button.applyBtn").attr("disabled","disabled")},move:function(){var t,e={top:0,left:0},a=i(window).width();this.parentEl.is("body")||(e={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},a=this.parentEl[0].clientWidth+this.parentEl.offset().left),t="up"==this.drops?this.element.offset().top-this.container.outerHeight()-e.top:this.element.offset().top+this.element.outerHeight()-e.top,this.container["up"==this.drops?"addClass":"removeClass"]("dropup"),"left"==this.opens?(this.container.css({top:t,right:a-this.element.offset().left-this.element.outerWidth(),left:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):"center"==this.opens?(this.container.css({top:t,left:this.element.offset().left-e.left+this.element.outerWidth()/2-this.container.outerWidth()/2,right:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):(this.container.css({top:t,left:this.element.offset().left-e.left,right:"auto"}),this.container.offset().left+this.container.outerWidth()>i(window).width()&&this.container.css({left:"auto",right:0}))},show:function(){this.isShowing||(this._outsideClickProxy=i.proxy(function(t){this.outsideClick(t)},this),i(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0,i(".daterange-custom").addClass("is-opened"))},hide:function(){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate,this.endDate,this.chosenLabel),this.element.is("input")&&!this.singleDatePicker?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change")),i(document).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1,i(".daterange-custom").removeClass("is-opened"))},toggle:function(){this.isShowing?this.hide():this.show()},outsideClick:function(t){var e=i(t.target);"focusin"==t.type||e.closest(this.element).length||e.closest(this.container).length||e.closest(".calendar-table").length||this.hide()},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},hoverRange:function(t){var e=t.target.innerHTML;if(e==this.locale.customRangeLabel)this.updateView();else{var a=this.ranges[e];this.container.find("input[name=daterangepicker_start]").val(a[0].format(this.locale.format)),this.container.find("input[name=daterangepicker_end]").val(a[1].format(this.locale.format))}},clickRange:function(t){var e=t.target.innerHTML;if(this.chosenLabel=e,e==this.locale.customRangeLabel)this.showCalendars();else{var a=this.ranges[e];this.startDate=a[0],this.endDate=a[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.hideCalendars(),this.clickApply()}},clickPrev:function(t){var e=i(t.target).parents(".calendar");e.hasClass("left")?this.leftCalendar.month.subtract(1,"month"):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(t){var e=i(t.target).parents(".calendar");e.hasClass("left")?this.leftCalendar.month.add(1,"month"):this.rightCalendar.month.add(1,"month"),this.updateCalendars()},hoverDate:function(t){if(i(t.target).hasClass("available")){var e=i(t.target).attr("data-title"),a=e.substr(1,1),s=e.substr(3,1),n=i(t.target).parents(".calendar"),r=n.hasClass("left")?this.leftCalendar.calendar[a][s]:this.rightCalendar.calendar[a][s];this.endDate?this.container.find("input[name=daterangepicker_start]").val(r.format(this.locale.format)):this.container.find("input[name=daterangepicker_end]").val(r.format(this.locale.format));var l=this.leftCalendar,o=this.rightCalendar,h=this.startDate;this.endDate||this.container.find(".calendar td").each(function(t,e){if(!i(e).hasClass("week")){var a=i(e).attr("data-title"),s=a.substr(1,1),n=a.substr(3,1),c=i(e).parents(".calendar"),d=c.hasClass("left")?l.calendar[s][n]:o.calendar[s][n];d.isAfter(h)&&d.isBefore(r)?i(e).addClass("in-range"):i(e).removeClass("in-range")}})}},clickDate:function(t){if(i(t.target).hasClass("available")){var e=i(t.target).attr("data-title"),a=e.substr(1,1),s=e.substr(3,1),n=i(t.target).parents(".calendar"),r=n.hasClass("left")?this.leftCalendar.calendar[a][s]:this.rightCalendar.calendar[a][s];if(this.endDate||r.isBefore(this.startDate)){if(this.timePicker){var l=parseInt(this.container.find(".left .hourselect").val(),10);if(!this.timePicker24Hour){var o=n.find(".ampmselect").val();"PM"===o&&12>l&&(l+=12),"AM"===o&&12===l&&(l=0)}var h=parseInt(this.container.find(".left .minuteselect").val(),10),c=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;r=r.clone().hour(l).minute(h).second(c)}this.endDate=null,this.setStartDate(r.clone())}else{if(this.timePicker){var l=parseInt(this.container.find(".right .hourselect").val(),10);if(!this.timePicker24Hour){var o=this.container.find(".right .ampmselect").val();"PM"===o&&12>l&&(l+=12),"AM"===o&&12===l&&(l=0)}var h=parseInt(this.container.find(".right .minuteselect").val(),10),c=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0;r=r.clone().hour(l).minute(h).second(c)}this.setEndDate(r.clone()),this.autoApply&&this.clickApply()}this.singleDatePicker&&(this.setEndDate(this.startDate),this.timePicker||this.clickApply()),this.updateView()}},clickApply:function(){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(t){var e=i(t.target).closest(".calendar").hasClass("left"),a=e?"left":"right",s=this.container.find(".calendar."+a),n=parseInt(s.find(".monthselect").val(),10),r=s.find(".yearselect").val();e||(r<this.startDate.year()||r==this.startDate.year()&&n<this.startDate.month())&&(n=this.startDate.month(),r=this.startDate.year()),this.minDate&&(r<this.minDate.year()||r==this.minDate.year()&&n<this.minDate.month())&&(n=this.minDate.month(),r=this.minDate.year()),this.maxDate&&(r>this.maxDate.year()||r==this.maxDate.year()&&n>this.maxDate.month())&&(n=this.maxDate.month(),r=this.maxDate.year()),this[a+"Calendar"].month.month(n).year(r),this.updateCalendars()},timeChanged:function(t){var e=i(t.target).closest(".calendar"),a=e.hasClass("left"),s=parseInt(e.find(".hourselect").val(),10),n=parseInt(e.find(".minuteselect").val(),10),r=this.timePickerSeconds?parseInt(e.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var l=e.find(".ampmselect").val();"PM"===l&&12>s&&(s+=12),"AM"===l&&12===s&&(s=0)}if(a){var o=this.startDate.clone();o.hour(s),o.minute(n),o.second(r),this.setStartDate(o),this.singleDatePicker&&(this.endDate=this.startDate.clone())}else if(this.endDate){var h=this.endDate.clone();h.hour(s),h.minute(n),h.second(r),this.setEndDate(h)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},formInputsChanged:function(t){var e=i(t.target).closest(".calendar").hasClass("right"),s=a(this.container.find('input[name="daterangepicker_start"]').val(),this.locale.format),n=a(this.container.find('input[name="daterangepicker_end"]').val(),this.locale.format);s.isValid()&&n.isValid()&&(e&&n.isBefore(s)&&(s=n.clone()),this.setStartDate(s),this.setEndDate(n),e?this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format)):this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format))),this.updateCalendars(),this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"))},controlChanged:function(){if(this.element.is("input")&&this.element.val().length){var t=this.element.val().split(this.locale.separator),e=null,i=null;2===t.length&&(e=a(t[0],this.locale.format).utcOffset(this.timeZone),i=a(t[1],this.locale.format).utcOffset(this.timeZone)),(this.singleDatePicker||null===e||null===i)&&(e=a(this.element.val(),this.locale.format).utcOffset(this.timeZone),i=e),this.setStartDate(e),this.setEndDate(i),this.updateView()}},keydown:function(t){(9===t.keyCode||13===t.keyCode)&&this.hide()},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},i.fn.daterangepicker=function(t,e){return this.each(function(){var a=i(this);a.data("daterangepicker")&&a.data("daterangepicker").remove(),a.data("daterangepicker",new s(a,t,e))}),this}});