/** * minified by jsdelivr using terser v3.14.1. * original file: /npm/daterangepicker@3.1.0/daterangepicker.js * * do not use sri with dynamically generated files! more information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(t, e) { if ("function" == typeof define && define.amd) define(["moment", "jquery"], function(t, a) { return a.fn || (a.fn = {}), "function" != typeof t && t.hasownproperty("default") && (t = t.default), e(t, a) }); else if ("object" == typeof module && module.exports) { var a = "undefined" != typeof window ? window.jquery : void 0; a || (a = require("jquery")).fn || (a.fn = {}); var i = "undefined" != typeof window && void 0 !== window.moment ? window.moment : require("moment"); module.exports = e(i, a) } else t.daterangepicker = e(t.moment, t.jquery) }(this, function(t, e) { var a = function(a, i, s) { if (this.parentel = "body", this.element = e(a), this.startdate = t().startof("day"), this.enddate = t().endof("day"), this.mindate = !1, this.maxdate = !1, this.maxspan = !1, this.autoapply = !1, this.singledatepicker = !1, this.showdropdowns = !1, this.minyear = t().subtract(100, "year").format("yyyy"), this.maxyear = t().add(100, "year").format("yyyy"), this.showweeknumbers = !1, this.showisoweeknumbers = !1, this.showcustomrangelabel = !0, this.timepicker = !1, this.timepicker24hour = !1, this.timepickerincrement = 1, this.timepickerseconds = !1, this.linkedcalendars = !0, this.autoupdateinput = !0, this.alwaysshowcalendars = !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.applybuttonclasses = "btn-primary", this.cancelbuttonclasses = "btn-default", this.locale = { direction: "ltr", format: t.localedata().longdateformat("l"), separator: " - ", applylabel: "apply", cancellabel: "cancel", weeklabel: "w", customrangelabel: "custom range", daysofweek: t.weekdaysmin(), monthnames: t.monthsshort(), firstday: t.localedata().firstdayofweek() }, this.callback = function() {} , this.isshowing = !1, this.leftcalendar = {}, this.rightcalendar = {}, "object" == typeof i && null !== i || (i = {}), "string" == typeof (i = e.extend(this.element.data(), i)).template || i.template instanceof e || (i.template = '
'), this.parentel = i.parentel && e(i.parentel).length ? e(i.parentel) : e(this.parentel), this.container = e(i.template).appendto(this.parentel), "object" == typeof i.locale && ("string" == typeof i.locale.direction && (this.locale.direction = i.locale.direction), "string" == typeof i.locale.format && (this.locale.format = i.locale.format), "string" == typeof i.locale.separator && (this.locale.separator = i.locale.separator), "object" == typeof i.locale.daysofweek && (this.locale.daysofweek = i.locale.daysofweek.slice()), "object" == typeof i.locale.monthnames && (this.locale.monthnames = i.locale.monthnames.slice()), "number" == typeof i.locale.firstday && (this.locale.firstday = i.locale.firstday), "string" == typeof i.locale.applylabel && (this.locale.applylabel = i.locale.applylabel), "string" == typeof i.locale.cancellabel && (this.locale.cancellabel = i.locale.cancellabel), "string" == typeof i.locale.weeklabel && (this.locale.weeklabel = i.locale.weeklabel), "string" == typeof i.locale.customrangelabel)) { (p = document.createelement("textarea")).innerhtml = i.locale.customrangelabel; var n = p.value; this.locale.customrangelabel = n } if (this.container.addclass(this.locale.direction), "string" == typeof i.startdate && (this.startdate = t(i.startdate, this.locale.format)), "string" == typeof i.enddate && (this.enddate = t(i.enddate, this.locale.format)), "string" == typeof i.mindate && (this.mindate = t(i.mindate, this.locale.format)), "string" == typeof i.maxdate && (this.maxdate = t(i.maxdate, this.locale.format)), "object" == typeof i.startdate && (this.startdate = t(i.startdate)), "object" == typeof i.enddate && (this.enddate = t(i.enddate)), "object" == typeof i.mindate && (this.mindate = t(i.mindate)), "object" == typeof i.maxdate && (this.maxdate = t(i.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 i.applybuttonclasses && (this.applybuttonclasses = i.applybuttonclasses), "string" == typeof i.applyclass && (this.applybuttonclasses = i.applyclass), "string" == typeof i.cancelbuttonclasses && (this.cancelbuttonclasses = i.cancelbuttonclasses), "string" == typeof i.cancelclass && (this.cancelbuttonclasses = i.cancelclass), "object" == typeof i.maxspan && (this.maxspan = i.maxspan), "object" == typeof i.datelimit && (this.maxspan = i.datelimit), "string" == typeof i.opens && (this.opens = i.opens), "string" == typeof i.drops && (this.drops = i.drops), "boolean" == typeof i.showweeknumbers && (this.showweeknumbers = i.showweeknumbers), "boolean" == typeof i.showisoweeknumbers && (this.showisoweeknumbers = i.showisoweeknumbers), "string" == typeof i.buttonclasses && (this.buttonclasses = i.buttonclasses), "object" == typeof i.buttonclasses && (this.buttonclasses = i.buttonclasses.join(" ")), "boolean" == typeof i.showdropdowns && (this.showdropdowns = i.showdropdowns), "number" == typeof i.minyear && (this.minyear = i.minyear), "number" == typeof i.maxyear && (this.maxyear = i.maxyear), "boolean" == typeof i.showcustomrangelabel && (this.showcustomrangelabel = i.showcustomrangelabel), "boolean" == typeof i.singledatepicker && (this.singledatepicker = i.singledatepicker, this.singledatepicker && (this.enddate = this.startdate.clone())), "boolean" == typeof i.timepicker && (this.timepicker = i.timepicker), "boolean" == typeof i.timepickerseconds && (this.timepickerseconds = i.timepickerseconds), "number" == typeof i.timepickerincrement && (this.timepickerincrement = i.timepickerincrement), "boolean" == typeof i.timepicker24hour && (this.timepicker24hour = i.timepicker24hour), "boolean" == typeof i.autoapply && (this.autoapply = i.autoapply), "boolean" == typeof i.autoupdateinput && (this.autoupdateinput = i.autoupdateinput), "boolean" == typeof i.linkedcalendars && (this.linkedcalendars = i.linkedcalendars), "function" == typeof i.isinvaliddate && (this.isinvaliddate = i.isinvaliddate), "function" == typeof i.iscustomdate && (this.iscustomdate = i.iscustomdate), "boolean" == typeof i.alwaysshowcalendars && (this.alwaysshowcalendars = i.alwaysshowcalendars), 0 != this.locale.firstday) for (var r = this.locale.firstday; r > 0; ) this.locale.daysofweek.push(this.locale.daysofweek.shift()), r--; var o, h, l; if (void 0 === i.startdate && void 0 === i.enddate && e(this.element).is(":text")) { var c = e(this.element).val() , d = c.split(this.locale.separator); o = h = null, 2 == d.length ? (o = t(d[0], this.locale.format), h = t(d[1], this.locale.format)) : this.singledatepicker && "" !== c && (o = t(c, this.locale.format), h = t(c, this.locale.format)), null !== o && null !== h && (this.setstartdate(o), this.setenddate(h)) } if ("object" == typeof i.ranges) { for (l in i.ranges) { o = "string" == typeof i.ranges[l][0] ? t(i.ranges[l][0], this.locale.format) : t(i.ranges[l][0]), h = "string" == typeof i.ranges[l][1] ? t(i.ranges[l][1], this.locale.format) : t(i.ranges[l][1]), this.mindate && o.isbefore(this.mindate) && (o = this.mindate.clone()); var m = this.maxdate; if (this.maxspan && m && o.clone().add(this.maxspan).isafter(m) && (m = o.clone().add(this.maxspan)), m && h.isafter(m) && (h = m.clone()), !(this.mindate && h.isbefore(this.mindate, this.timepicker ? "minute" : "day") || m && o.isafter(m, this.timepicker ? "minute" : "day"))) { var p; (p = document.createelement("textarea")).innerhtml = l; n = p.value; this.ranges[n] = [o, h] } } var f = "", this.container.find(".ranges").prepend(f) } "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 && this.container.addclass("auto-apply"), "object" == typeof i.ranges && this.container.addclass("show-ranges"), this.singledatepicker && (this.container.addclass("single"), this.container.find(".drp-calendar.left").addclass("single"), this.container.find(".drp-calendar.left").show(), this.container.find(".drp-calendar.right").hide(), !this.timepicker && this.autoapply && this.container.addclass("auto-apply")), (void 0 === i.ranges && !this.singledatepicker || this.alwaysshowcalendars) && this.container.addclass("show-calendar"), this.container.addclass("opens" + this.opens), this.container.find(".applybtn, .cancelbtn").addclass(this.buttonclasses), this.applybuttonclasses.length && this.container.find(".applybtn").addclass(this.applybuttonclasses), this.cancelbuttonclasses.length && this.container.find(".cancelbtn").addclass(this.cancelbuttonclasses), this.container.find(".applybtn").html(this.locale.applylabel), this.container.find(".cancelbtn").html(this.locale.cancellabel), this.container.find(".drp-calendar").on("click.daterangepicker", ".prev", e.proxy(this.clickprev, this)).on("click.daterangepicker", ".next", e.proxy(this.clicknext, this)).on("mousedown.daterangepicker", "td.available", e.proxy(this.clickdate, this)).on("mouseenter.daterangepicker", "td.available", e.proxy(this.hoverdate, this)).on("change.daterangepicker", "select.yearselect", e.proxy(this.monthoryearchanged, this)).on("change.daterangepicker", "select.monthselect", e.proxy(this.monthoryearchanged, this)).on("change.daterangepicker", "select.hourselect,select.minuteselect,select.secondselect,select.ampmselect", e.proxy(this.timechanged, this)), this.container.find(".ranges").on("click.daterangepicker", "li", e.proxy(this.clickrange, this)), this.container.find(".drp-buttons").on("click.daterangepicker", "button.applybtn", e.proxy(this.clickapply, this)).on("click.daterangepicker", "button.cancelbtn", e.proxy(this.clickcancel, this)), this.element.is("input") || this.element.is("button") ? this.element.on({ "click.daterangepicker": e.proxy(this.show, this), "focus.daterangepicker": e.proxy(this.show, this), "keyup.daterangepicker": e.proxy(this.elementchanged, this), "keydown.daterangepicker": e.proxy(this.keydown, this) }) : (this.element.on("click.daterangepicker", e.proxy(this.toggle, this)), this.element.on("keydown.daterangepicker", e.proxy(this.toggle, this))), this.updateelement() }; return a.prototype = { constructor: a, setstartdate: function(e) { "string" == typeof e && (this.startdate = t(e, this.locale.format)), "object" == typeof e && (this.startdate = t(e)), 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.clone(), this.timepicker && this.timepickerincrement && this.startdate.minute(math.round(this.startdate.minute() / this.timepickerincrement) * this.timepickerincrement)), this.maxdate && this.startdate.isafter(this.maxdate) && (this.startdate = this.maxdate.clone(), this.timepicker && this.timepickerincrement && this.startdate.minute(math.floor(this.startdate.minute() / this.timepickerincrement) * this.timepickerincrement)), this.isshowing || this.updateelement(), this.updatemonthsinview() }, setenddate: function(e) { "string" == typeof e && (this.enddate = t(e, this.locale.format)), "object" == typeof e && (this.enddate = t(e)), 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.clone()), this.maxspan && this.startdate.clone().add(this.maxspan).isbefore(this.enddate) && (this.enddate = this.startdate.clone().add(this.maxspan)), this.previousrighttime = this.enddate.clone(), this.container.find(".drp-selected").html(this.startdate.format(this.locale.format) + this.locale.separator + this.enddate.format(this.locale.format)), this.isshowing || this.updateelement(), this.updatemonthsinview() }, isinvaliddate: function() { return !1 }, iscustomdate: function() { return !1 }, updateview: function() { this.timepicker && (this.rendertimepicker("left"), this.rendertimepicker("right"), this.enddate ? this.container.find(".right .calendar-time select").prop("disabled", !1).removeclass("disabled") : this.container.find(".right .calendar-time select").prop("disabled", !0).addclass("disabled")), this.enddate && this.container.find(".drp-selected").html(this.startdate.format(this.locale.format) + this.locale.separator + this.enddate.format(this.locale.format)), this.updatemonthsinview(), this.updatecalendars(), this.updateforminputs() }, updatemonthsinview: function() { if (this.enddate) { if (!this.singledatepicker && this.leftcalendar.month && this.rightcalendar.month && (this.startdate.format("yyyy-mm") == this.leftcalendar.month.format("yyyy-mm") || this.startdate.format("yyyy-mm") == this.rightcalendar.month.format("yyyy-mm")) && (this.enddate.format("yyyy-mm") == this.leftcalendar.month.format("yyyy-mm") || this.enddate.format("yyyy-mm") == this.rightcalendar.month.format("yyyy-mm"))) return; this.leftcalendar.month = this.startdate.clone().date(2), this.linkedcalendars || this.enddate.month() == this.startdate.month() && this.enddate.year() == this.startdate.year() ? this.rightcalendar.month = this.startdate.clone().date(2).add(1, "month") : this.rightcalendar.month = this.enddate.clone().date(2) } else 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")); this.maxdate && this.linkedcalendars && !this.singledatepicker && this.rightcalendar.month > this.maxdate && (this.rightcalendar.month = this.maxdate.clone().date(2), this.leftcalendar.month = this.maxdate.clone().date(2).subtract(1, "month")) }, updatecalendars: function() { if (this.timepicker) { var t, e, a, i; if (this.enddate) { if (t = parseint(this.container.find(".left .hourselect").val(), 10), e = parseint(this.container.find(".left .minuteselect").val(), 10), isnan(e) && (e = parseint(this.container.find(".left .minuteselect option:last").val(), 10)), a = this.timepickerseconds ? parseint(this.container.find(".left .secondselect").val(), 10) : 0, !this.timepicker24hour) "pm" === (i = this.container.find(".left .ampmselect").val()) && t < 12 && (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), isnan(e) && (e = parseint(this.container.find(".right .minuteselect option:last").val(), 10)), a = this.timepickerseconds ? parseint(this.container.find(".right .secondselect").val(), 10) : 0, !this.timepicker24hour) "pm" === (i = this.container.find(".right .ampmselect").val()) && t < 12 && (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) } this.rendercalendar("left"), this.rendercalendar("right"), this.container.find(".ranges li").removeclass("active"), null != this.enddate && this.calculatechosenlabel() }, rendercalendar: function(a) { var i, s = (i = "left" == a ? this.leftcalendar : this.rightcalendar).month.month(), n = i.month.year(), r = i.month.hour(), o = i.month.minute(), h = i.month.second(), l = t([n, s]).daysinmonth(), c = t([n, s, 1]), d = t([n, s, l]), m = t(c).subtract(1, "month").month(), p = t(c).subtract(1, "month").year(), f = t([p, m]).daysinmonth(), u = c.day(); (i = []).firstday = c, i.lastday = d; for (var d = 0; d < 6; d++) i[d] = []; var g = f - u + this.locale.firstday + 1; g > f && (g -= 7), u == this.locale.firstday && (g = f - 6); for (var y = t([p, m, g, 12, o, h]), k = (d = 0, 0), b = 0; d < 42; d++, k++, y = t(y).add(24, "hour")) d > 0 && k % 7 == 0 && (k = 0, b++), i[b][k] = y.clone().hour(r).minute(o).second(h), y.hour(12), this.mindate && i[b][k].format("yyyy-mm-dd") == this.mindate.format("yyyy-mm-dd") && i[b][k].isbefore(this.mindate) && "left" == a && (i[b][k] = this.mindate.clone()), this.maxdate && i[b][k].format("yyyy-mm-dd") == this.maxdate.format("yyyy-mm-dd") && i[b][k].isafter(this.maxdate) && "right" == a && (i[b][k] = this.maxdate.clone()); "left" == a ? this.leftcalendar.calendar = i : this.rightcalendar.calendar = i; var v = "left" == a ? this.mindate : this.startdate , c = this.maxdate , y = ("left" == a ? this.startdate : this.enddate, this.locale.direction, ''); y += "", y += "", (this.showweeknumbers || this.showisoweeknumbers) && (y += ""), v && !v.isbefore(i.firstday) || this.linkedcalendars && "left" != a ? y += "" : y += ''; var w = this.locale.monthnames[i[1][1].month()] + i[1][1].format(" yyyy"); if (this.showdropdowns) { for (var p = i[1][1].month(), x = i[1][1].year(), m = c && c.year() || this.maxyear, i = v && v.year() || this.minyear, s = x == i, b = x == m, a = '"; for (var n = '") } if (y += '", c && !c.isafter(i.lastday) || this.linkedcalendars && "right" != a && !this.singledatepicker ? y += "" : y += '', y += "", y += "", (this.showweeknumbers || this.showisoweeknumbers) && (y += '"), e.each(this.locale.daysofweek, function(t, e) { y += "" }), y += "", y += "", y += "", null == this.enddate && this.maxspan) { var o = this.startdate.clone().add(this.maxspan).endof("day"); c && !o.isbefore(c) || (c = o) } for (b = 0; b < 6; b++) { y += "", this.showweeknumbers ? y += '" : this.showisoweeknumbers && (y += '"); for (k = 0; k < 7; k++) { var w = []; i[b][k].issame(new date, "day") && w.push("today"), i[b][k].isoweekday() > 5 && w.push("weekend"), i[b][k].month() != i[1][1].month() && w.push("off", "ends"), this.mindate && i[b][k].isbefore(this.mindate, "day") && w.push("off", "disabled"), c && i[b][k].isafter(c, "day") && w.push("off", "disabled"), this.isinvaliddate(i[b][k]) && w.push("off", "disabled"), i[b][k].format("yyyy-mm-dd") == this.startdate.format("yyyy-mm-dd") && w.push("active", "start-date"), null != this.enddate && i[b][k].format("yyyy-mm-dd") == this.enddate.format("yyyy-mm-dd") && w.push("active", "end-date"), null != this.enddate && i[b][k] > this.startdate && i[b][k] < this.enddate && w.push("in-range"); var h = this.iscustomdate(i[b][k]); !1 !== h && ("string" == typeof h ? w.push(h) : array.prototype.push.apply(w, h)); var j = "" , r = !1; for (d = 0; d < w.length; d++) j += w[d] + " ", "disabled" == w[d] && (r = !0); r || (j += "available"), y += '" } y += "" } y += "", y += "
' + w + "
' + this.locale.weeklabel + "" + e + "
' + i[b][0].week() + "' + i[b][0].isoweek() + "' + i[b][k].date() + "
", this.container.find(".drp-calendar." + a + " .calendar-table").html(y) }, rendertimepicker: function(t) { if ("right" != t || this.enddate) { var e, a, i, s = this.maxdate; if (!this.maxspan || this.maxdate && !this.startdate.clone().add(this.maxspan).isbefore(this.maxdate) || (s = this.startdate.clone().add(this.maxspan)), "left" == t) a = this.startdate.clone(), i = this.mindate; else if ("right" == t) { a = this.enddate.clone(), i = this.startdate; var n = this.container.find(".drp-calendar.right .calendar-time"); if ("" != n.html() && (a.hour(isnan(a.hour()) ? n.find(".hourselect option:selected").val() : a.hour()), a.minute(isnan(a.minute()) ? n.find(".minuteselect option:selected").val() : a.minute()), a.second(isnan(a.second()) ? n.find(".secondselect option:selected").val() : a.second()), !this.timepicker24hour)) { var r = n.find(".ampmselect option:selected").val(); "pm" === r && a.hour() < 12 && a.hour(a.hour() + 12), "am" === r && 12 === a.hour() && a.hour(0) } a.isbefore(this.startdate) && (a = this.startdate.clone()), s && a.isafter(s) && (a = s.clone()) } e = ' ", e += ': ", this.timepickerseconds) { e += ': " } if (!this.timepicker24hour) { e += '" } this.container.find(".drp-calendar." + t + " .calendar-time").html(e) } }, updateforminputs: function() { this.singledatepicker || this.enddate && (this.startdate.isbefore(this.enddate) || this.startdate.issame(this.enddate)) ? this.container.find("button.applybtn").prop("disabled", !1) : this.container.find("button.applybtn").prop("disabled", !0) }, move: function() { var t, a = { top: 0, left: 0 }, i = this.drops, s = e(window).width(); switch (this.parentel.is("body") || (a = { top: this.parentel.offset().top - this.parentel.scrolltop(), left: this.parentel.offset().left - this.parentel.scrollleft() }, s = this.parentel[0].clientwidth + this.parentel.offset().left), i) { case "auto": (t = this.element.offset().top + this.element.outerheight() - a.top) + this.container.outerheight() >= this.parentel[0].scrollheight && (t = this.element.offset().top - this.container.outerheight() - a.top, i = "up"); break; case "up": t = this.element.offset().top - this.container.outerheight() - a.top; break; default: t = this.element.offset().top + this.element.outerheight() - a.top } this.container.css({ top: 0, left: 0, right: "auto" }); var n = this.container.outerwidth(); if (this.container.toggleclass("drop-up", "up" == i), "left" == this.opens) { var r = s - this.element.offset().left - this.element.outerwidth(); n + r > e(window).width() ? this.container.css({ top: t, right: "auto", left: 9 }) : this.container.css({ top: t, right: r, left: "auto" }) } else if ("center" == this.opens) { (o = this.element.offset().left - a.left + this.element.outerwidth() / 2 - n / 2) < 0 ? this.container.css({ top: t, right: "auto", left: 9 }) : o + n > e(window).width() ? this.container.css({ top: t, left: "auto", right: 0 }) : this.container.css({ top: t, left: o, right: "auto" }) } else { var o; (o = this.element.offset().left - a.left) + n > e(window).width() ? this.container.css({ top: t, left: "auto", right: 0 }) : this.container.css({ top: t, left: o, right: "auto" }) } }, show: function(t) { this.isshowing || (this._outsideclickproxy = e.proxy(function(t) { this.outsideclick(t) }, this), e(document).on("mousedown.daterangepicker", this._outsideclickproxy).on("touchend.daterangepicker", this._outsideclickproxy).on("click.daterangepicker", "[data-toggle=dropdown]", this._outsideclickproxy).on("focusin.daterangepicker", this._outsideclickproxy), e(window).on("resize.daterangepicker", e.proxy(function(t) { this.move(t) }, this)), this.oldstartdate = this.startdate.clone(), this.oldenddate = this.enddate.clone(), this.previousrighttime = this.enddate.clone(), this.updateview(), this.container.show(), this.move(), this.element.trigger("show.daterangepicker", this), this.isshowing = !0) }, hide: function(t) { 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.clone(), this.enddate.clone(), this.chosenlabel), this.updateelement(), e(document).off(".daterangepicker"), e(window).off(".daterangepicker"), this.container.hide(), this.element.trigger("hide.daterangepicker", this), this.isshowing = !1) }, toggle: function(t) { this.isshowing ? this.hide() : this.show() }, outsideclick: function(t) { var a = e(t.target); "focusin" == t.type || a.closest(this.element).length || a.closest(this.container).length || a.closest(".calendar-table").length || (this.hide(), this.element.trigger("outsideclick.daterangepicker", this)) }, 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) }, clickrange: function(t) { var e = t.target.getattribute("data-range-key"); 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.alwaysshowcalendars || this.hidecalendars(), this.clickapply() } }, clickprev: function(t) { e(t.target).parents(".drp-calendar").hasclass("left") ? (this.leftcalendar.month.subtract(1, "month"), this.linkedcalendars && this.rightcalendar.month.subtract(1, "month")) : this.rightcalendar.month.subtract(1, "month"), this.updatecalendars() }, clicknext: function(t) { e(t.target).parents(".drp-calendar").hasclass("left") ? this.leftcalendar.month.add(1, "month") : (this.rightcalendar.month.add(1, "month"), this.linkedcalendars && this.leftcalendar.month.add(1, "month")), this.updatecalendars() }, hoverdate: function(t) { if (e(t.target).hasclass("available")) { var a = e(t.target).attr("data-title") , i = a.substr(1, 1) , s = a.substr(3, 1) , n = e(t.target).parents(".drp-calendar").hasclass("left") ? this.leftcalendar.calendar[i][s] : this.rightcalendar.calendar[i][s] , r = this.leftcalendar , o = this.rightcalendar , h = this.startdate; this.enddate || this.container.find(".drp-calendar tbody td").each(function(t, a) { if (!e(a).hasclass("week")) { var i = e(a).attr("data-title") , s = i.substr(1, 1) , l = i.substr(3, 1) , c = e(a).parents(".drp-calendar").hasclass("left") ? r.calendar[s][l] : o.calendar[s][l]; c.isafter(h) && c.isbefore(n) || c.issame(n, "day") ? e(a).addclass("in-range") : e(a).removeclass("in-range") } }) } }, clickdate: function(t) { if (e(t.target).hasclass("available")) { var a = e(t.target).attr("data-title") , i = a.substr(1, 1) , s = a.substr(3, 1) , n = e(t.target).parents(".drp-calendar").hasclass("left") ? this.leftcalendar.calendar[i][s] : this.rightcalendar.calendar[i][s]; if (this.enddate || n.isbefore(this.startdate, "day")) { if (this.timepicker) { var r = parseint(this.container.find(".left .hourselect").val(), 10); if (!this.timepicker24hour) "pm" === (l = this.container.find(".left .ampmselect").val()) && r < 12 && (r += 12), "am" === l && 12 === r && (r = 0); var o = parseint(this.container.find(".left .minuteselect").val(), 10); isnan(o) && (o = parseint(this.container.find(".left .minuteselect option:last").val(), 10)); var h = this.timepickerseconds ? parseint(this.container.find(".left .secondselect").val(), 10) : 0; n = n.clone().hour(r).minute(o).second(h) } this.enddate = null, this.setstartdate(n.clone()) } else if (!this.enddate && n.isbefore(this.startdate)) this.setenddate(this.startdate.clone()); else { if (this.timepicker) { var l; r = parseint(this.container.find(".right .hourselect").val(), 10); if (!this.timepicker24hour) "pm" === (l = this.container.find(".right .ampmselect").val()) && r < 12 && (r += 12), "am" === l && 12 === r && (r = 0); o = parseint(this.container.find(".right .minuteselect").val(), 10); isnan(o) && (o = parseint(this.container.find(".right .minuteselect option:last").val(), 10)); h = this.timepickerseconds ? parseint(this.container.find(".right .secondselect").val(), 10) : 0; n = n.clone().hour(r).minute(o).second(h) } this.setenddate(n.clone()), this.autoapply && (this.calculatechosenlabel(), this.clickapply()) } this.singledatepicker && (this.setenddate(this.startdate), !this.timepicker && this.autoapply && this.clickapply()), this.updateview(), t.stoppropagation() } }, calculatechosenlabel: function() { var t = !0 , e = 0; for (var a in this.ranges) { if (this.timepicker) { var i = this.timepickerseconds ? "yyyy-mm-dd hh:mm:ss" : "yyyy-mm-dd hh:mm"; if (this.startdate.format(i) == this.ranges[a][0].format(i) && this.enddate.format(i) == this.ranges[a][1].format(i)) { t = !1, this.chosenlabel = this.container.find(".ranges li:eq(" + e + ")").addclass("active").attr("data-range-key"); break } } else if (this.startdate.format("yyyy-mm-dd") == this.ranges[a][0].format("yyyy-mm-dd") && this.enddate.format("yyyy-mm-dd") == this.ranges[a][1].format("yyyy-mm-dd")) { t = !1, this.chosenlabel = this.container.find(".ranges li:eq(" + e + ")").addclass("active").attr("data-range-key"); break } e++ } t && (this.showcustomrangelabel ? this.chosenlabel = this.container.find(".ranges li:last").addclass("active").attr("data-range-key") : this.chosenlabel = null, this.showcalendars()) }, clickapply: function(t) { this.hide(), this.element.trigger("apply.daterangepicker", this) }, clickcancel: function(t) { this.startdate = this.oldstartdate, this.enddate = this.oldenddate, this.hide(), this.element.trigger("cancel.daterangepicker", this) }, monthoryearchanged: function(t) { var a = e(t.target).closest(".drp-calendar").hasclass("left") , i = a ? "left" : "right" , s = this.container.find(".drp-calendar." + i) , n = parseint(s.find(".monthselect").val(), 10) , r = s.find(".yearselect").val(); a || (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()), a ? (this.leftcalendar.month.month(n).year(r), this.linkedcalendars && (this.rightcalendar.month = this.leftcalendar.month.clone().add(1, "month"))) : (this.rightcalendar.month.month(n).year(r), this.linkedcalendars && (this.leftcalendar.month = this.rightcalendar.month.clone().subtract(1, "month"))), this.updatecalendars() }, timechanged: function(t) { var a = e(t.target).closest(".drp-calendar") , i = a.hasclass("left") , s = parseint(a.find(".hourselect").val(), 10) , n = parseint(a.find(".minuteselect").val(), 10); isnan(n) && (n = parseint(a.find(".minuteselect option:last").val(), 10)); var r = this.timepickerseconds ? parseint(a.find(".secondselect").val(), 10) : 0; if (!this.timepicker24hour) { var o = a.find(".ampmselect").val(); "pm" === o && s < 12 && (s += 12), "am" === o && 12 === s && (s = 0) } if (i) { var h = this.startdate.clone(); h.hour(s), h.minute(n), h.second(r), this.setstartdate(h), this.singledatepicker ? this.enddate = this.startdate.clone() : this.enddate && this.enddate.format("yyyy-mm-dd") == h.format("yyyy-mm-dd") && this.enddate.isbefore(h) && this.setenddate(h.clone()) } else if (this.enddate) { var l = this.enddate.clone(); l.hour(s), l.minute(n), l.second(r), this.setenddate(l) } this.updatecalendars(), this.updateforminputs(), this.rendertimepicker("left"), this.rendertimepicker("right") }, elementchanged: function() { if (this.element.is("input") && this.element.val().length) { var e = this.element.val().split(this.locale.separator) , a = null , i = null; 2 === e.length && (a = t(e[0], this.locale.format), i = t(e[1], this.locale.format)), (this.singledatepicker || null === a || null === i) && (i = a = t(this.element.val(), this.locale.format)), a.isvalid() && i.isvalid() && (this.setstartdate(a), this.setenddate(i), this.updateview()) } }, keydown: function(t) { 9 !== t.keycode && 13 !== t.keycode || this.hide(), 27 === t.keycode && (t.preventdefault(), t.stoppropagation(), this.hide()) }, updateelement: function() { if (this.element.is("input") && this.autoupdateinput) { var t = this.startdate.format(this.locale.format); this.singledatepicker || (t += this.locale.separator + this.enddate.format(this.locale.format)), t !== this.element.val() && this.element.val(t).trigger("change") } }, remove: function() { this.container.remove(), this.element.off(".daterangepicker"), this.element.removedata() } }, e.fn.daterangepicker = function(t, i) { var s = e.extend(!0, {}, e.fn.daterangepicker.defaultoptions, t); return this.each(function() { var t = e(this); t.data("daterangepicker") && t.data("daterangepicker").remove(), t.data("daterangepicker", new a(t,s,i)) }), this } , a }); //# sourcemappingurl=/sm/f07d8d7b2652873f485707eab4f3d300bf1f6f3b42912e189c8933b1b9b3dfde.map