Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Created July 13, 2016 11:10
Show Gist options
  • Save remcotolsma/27fb505619fd89843f1713365ef3e90b to your computer and use it in GitHub Desktop.
Save remcotolsma/27fb505619fd89843f1713365ef3e90b to your computer and use it in GitHub Desktop.
Holiday Media JavaScript framework, version 2.0.7 from https://lib.hmcms.nl/js/2/libloader.js?load=ha.booking.widget unminified with http://unminify.com/.
/*! Holiday Media JavaScript framework, version 2.0.7 (c) 2006-2015 Holiday Media Author: Wim Latour (@wimlatour) */
window.hm_libloader_preloaded = 'async,ha.booking.widget,hm.cache,hm.storage,hm.widget,jquery.ui.core,jquery.ui.datepicker,ui.datepicker,ui.datepicker-config,ui.datepicker-i18n';
! function(e, n, r) {
if (e === r) throw "Holiday Media JavaScript framework requires jQuery";
if (!e.hm || !e.hm.libloader) {
var t = function() {
function n() {
this.init.apply(this, arguments)
}
return e.extend(n.prototype, {
VERSION: "2.0.7",
init: function() {},
extend: function(r) {
e.extend(n.prototype, r)
},
add: function() {
var n, r = e.Deferred(),
t = e.Deferred();
return function() {
var e = this,
i = arguments;
return n || (n = 1, e.requireJS(e.absolute("async.js")).done(r.resolve)), r.promise().done(function() {
e.add.apply(e, i).done(t.resolve)
}), t.promise()
}
}(),
absolute: function(n) {
var r = this,
t = (n || "").replace(/^\//, "");
return r.B || e('script[src*="libloader.js"]').each(function(e, n) {
return n._parsed ? !0 : (n._parsed = !0, r.B = n.src.replace(/(?:\/[0-9a-f\-]{32,36})?\/[^/]+\.js(.*)$/, "/"), !1)
}), r.B + t
},
requireJS: function(n) {
return e.ajax({
type: "get",
dataType: "script",
cache: !0,
url: n
}).fail(function() {
console.error("Failed to load script: ", n)
})
},
requireCSS: function(e) {
var n, t = function(n) {
return e.getElementsByTagName(n)[0]
},
i = function() {
return n === r && (n = t("link") || t("style") || null), n
};
return function(n, r) {
var o = e.createElement("link"),
a = i();
o.rel = "stylesheet", o.href = n, o.media = "only x", (a ? a.parentNode : t("head") || e.documentElement).insertBefore(o, a), setTimeout(function() {
o.media = r || "all"
})
}
}(document),
warn: function(e) {
console.warn(e)
}
}), n
}();
e.hm = e.hm || {}, e.hm.libloader = new t,
function() {
for (var e, r = function() {}, t = n.console = n.console || {}, i = ["clear", "debug", "dir", "error", "info", "log", "table", "warn"], o = i.length; o--;) e = i[o], t[e] || (t[e] = r)
}(), e.fn.identify || (e.fn.identify = function(e) {
var n, r = 0;
return this.each(function() {
if (!this.id) {
do r++, n = e + "_" + r; while (null !== document.getElementById(n));
this.id = n
}
})
})
}
}(jQuery, window);
! function(e, i, l) {
if (!e.hm || !e.hm.libloader) throw "Async plugin loading requires the Holiday Media JavaScript framework";
if (e.hm.libloader.load) return void e.hm.libloader.load();
var r = e.hm.libloader;
r.extend({
D: {},
R: {},
addDependencies: function(i) {
if (e.isPlainObject(i)) {
for (var l in i) "string" == typeof i[l] && (i[l] = i[l].split(","));
e.extend(this.D, i)
}
},
load: function() {
var r = this;
i.hm_libloader_preloaded !== l && (e.each(i.hm_libloader_preloaded.split(","), function() {
r.R[this] = !0
}), i.hm_libloader_preloaded = l)
},
add: function() {
var e;
return "function" == typeof arguments[arguments.length - 1] && (e = Array.prototype.pop.call(arguments, 1)), this._loadPlugins(arguments, e)
},
_loadPlugins: function(i, l, r) {
var n = this,
d = e.Deferred(),
t = [],
o = function(e) {
return r && t.length > 0 ? t[0] = t[0].then(e) : t.push(e()), t[t.length - 1]
};
return i && i.length && (e.each(i, function(i, r) {
if (r = e.trim(r)) {
var d = function() {
"function" == typeof l && l.call(n, r)
};
if (r.indexOf(",") > -1) return void o(function() {
return n._loadPlugins(r.split(","), null, !0)
});
if (n.R[r]) return void(n.R[r] === !0 ? d() : o(function() {
return n.R[r].done(d)
}));
if (n.D["!" + r]) return void(n.R[r] = o(function() {
return n._loadPlugins(n.D["!" + r]).done(d)
}));
var t = function() {
return n._loadPlugin(r).done(d)
};
return n.D[r] ? void(n.R[r] = o(function() {
return n._loadPlugins(n.D[r]).then(t)
})) : void(n.R[r] = o(t))
}
}), e.when.apply(e, t).done(d.resolve)), d.promise()
},
_loadPlugin: function(e) {
var i = this.absolute(e.replace(/\./g, "/") + ".js");
return this.requireJS(i)
}
}), r.addDependencies({
"hm.cache": ["hm.storage"],
"hm.cookie.control": ["hm.cookie"],
"hm.form.datepicker": ["pikaday.moment,pikaday.moment-nl,pikaday.pikaday"],
"hm.jwplayer": ["jwplayer7.jwplayer"],
"hm.leaflet.custom": ["leaflet"],
"hm.leaflet.map": ["leaflet"],
"hm.pbo": ["hm.widget"],
"hm.pbo.default": ["hm.pbo"],
"hm.rotr.slider": ["hm.rotr"],
"hm.widget": ["hm.cache"],
"!flexslider": ["flexslider.flexslider", "flexslider.config"],
"!flexslider.full": ["flexslider.flexslider", "flexslider.config", "jquery.easing", "jquery.mousewheel"],
"!highslide": ["highslide.highslide-custom,highslide.config"],
"!highslide.html": ["highslide.highslide-html,highslide.config"],
"!highslide.full": ["highslide.highslide-full,highslide.config"],
"!highslide.gallery": ["highslide.highslide-gallery,highslide.config"],
"!highslide.fancy": ["highslide.easing,highslide.highslide-fancy,highslide.config,highslide.config-fancy"],
"!leaflet": ["leaflet.leaflet,leaflet.config"],
"leaflet.markercluster": ["leaflet.markercluster-config"],
"!plupload": ["plupload.plupload", "plupload.html5", "plupload.flash"],
"!tipped": ["tipped.spinners", "tipped.tipped", "tipped.config"],
"!tipped4": ["tipped4.tipped"],
"!ui.datepicker": ["jquery.ui.core,jquery.ui.datepicker,ui.datepicker-i18n,ui.datepicker-config"],
"!ui.tabs": ["jquery.ui.core,jquery.ui.widget,jquery.ui.tabs"]
}), r.load()
}(jQuery, window);
/*! jQuery UI - v1.10.2 - 2013-03-22
* http://jqueryui.com
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
(function(e, t) {
function i(t, i) {
var a, n, r, o = t.nodeName.toLowerCase();
return "area" === o ? (a = t.parentNode, n = a.name, t.href && n && "map" === a.nodeName.toLowerCase() ? (r = e("img[usemap=#" + n + "]")[0], !!r && s(r)) : !1) : (/input|select|textarea|button|object/.test(o) ? !t.disabled : "a" === o ? t.href || i : i) && s(t)
}
function s(t) {
return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() {
return "hidden" === e.css(this, "visibility")
}).length
}
var a = 0,
n = /^ui-id-\d+$/;
e.ui = e.ui || {}, e.extend(e.ui, {
version: "1.10.2",
keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
}
}), e.fn.extend({
focus: function(t) {
return function(i, s) {
return "number" == typeof i ? this.each(function() {
var t = this;
setTimeout(function() {
e(t).focus(), s && s.call(t)
}, i)
}) : t.apply(this, arguments)
}
}(e.fn.focus),
scrollParent: function() {
var t;
return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function() {
return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
}).eq(0) : this.parents().filter(function() {
return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
}).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t
},
zIndex: function(i) {
if (i !== t) return this.css("zIndex", i);
if (this.length)
for (var s, a, n = e(this[0]); n.length && n[0] !== document;) {
if (s = n.css("position"), ("absolute" === s || "relative" === s || "fixed" === s) && (a = parseInt(n.css("zIndex"), 10), !isNaN(a) && 0 !== a)) return a;
n = n.parent()
}
return 0
},
uniqueId: function() {
return this.each(function() {
this.id || (this.id = "ui-id-" + ++a)
})
},
removeUniqueId: function() {
return this.each(function() {
n.test(this.id) && e(this).removeAttr("id")
})
}
}), e.extend(e.expr[":"], {
data: e.expr.createPseudo ? e.expr.createPseudo(function(t) {
return function(i) {
return !!e.data(i, t)
}
}) : function(t, i, s) {
return !!e.data(t, s[3])
},
focusable: function(t) {
return i(t, !isNaN(e.attr(t, "tabindex")))
},
tabbable: function(t) {
var s = e.attr(t, "tabindex"),
a = isNaN(s);
return (a || s >= 0) && i(t, !a)
}
}), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function(i, s) {
function a(t, i, s, a) {
return e.each(n, function() {
i -= parseFloat(e.css(t, "padding" + this)) || 0, s && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), a && (i -= parseFloat(e.css(t, "margin" + this)) || 0)
}), i
}
var n = "Width" === s ? ["Left", "Right"] : ["Top", "Bottom"],
r = s.toLowerCase(),
o = {
innerWidth: e.fn.innerWidth,
innerHeight: e.fn.innerHeight,
outerWidth: e.fn.outerWidth,
outerHeight: e.fn.outerHeight
};
e.fn["inner" + s] = function(i) {
return i === t ? o["inner" + s].call(this) : this.each(function() {
e(this).css(r, a(this, i) + "px")
})
}, e.fn["outer" + s] = function(t, i) {
return "number" != typeof t ? o["outer" + s].call(this, t) : this.each(function() {
e(this).css(r, a(this, t, !0, i) + "px")
})
}
}), e.fn.addBack || (e.fn.addBack = function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
}), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) {
return function(i) {
return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this)
}
}(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({
disableSelection: function() {
return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(e) {
e.preventDefault()
})
},
enableSelection: function() {
return this.unbind(".ui-disableSelection")
}
}), e.extend(e.ui, {
plugin: {
add: function(t, i, s) {
var a, n = e.ui[t].prototype;
for (a in s) n.plugins[a] = n.plugins[a] || [], n.plugins[a].push([i, s[a]])
},
call: function(e, t, i) {
var s, a = e.plugins[t];
if (a && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType)
for (s = 0; a.length > s; s++) e.options[a[s][0]] && a[s][1].apply(e.element, i)
}
},
hasScroll: function(t, i) {
if ("hidden" === e(t).css("overflow")) return !1;
var s = i && "left" === i ? "scrollLeft" : "scrollTop",
a = !1;
return t[s] > 0 ? !0 : (t[s] = 1, a = t[s] > 0, t[s] = 0, a)
}
})
})(jQuery);
/*! jQuery UI - v1.10.2 - 2013-03-22
* http://jqueryui.com
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
(function(t, e) {
function i() {
this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = {
closeText: "Done",
prevText: "Prev",
nextText: "Next",
currentText: "Today",
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
weekHeader: "Wk",
dateFormat: "mm/dd/yy",
firstDay: 0,
isRTL: !1,
showMonthAfterYear: !1,
yearSuffix: ""
}, this._defaults = {
showOn: "focus",
showAnim: "fadeIn",
showOptions: {},
defaultDate: null,
appendText: "",
buttonText: "...",
buttonImage: "",
buttonImageOnly: !1,
hideIfNoPrevNext: !1,
navigationAsDateFormat: !1,
gotoCurrent: !1,
changeMonth: !1,
changeYear: !1,
yearRange: "c-10:c+10",
showOtherMonths: !1,
selectOtherMonths: !1,
showWeek: !1,
calculateWeek: this.iso8601Week,
shortYearCutoff: "+10",
minDate: null,
maxDate: null,
duration: "fast",
beforeShowDay: null,
beforeShow: null,
onSelect: null,
onChangeMonthYear: null,
onClose: null,
numberOfMonths: 1,
showCurrentAtPos: 0,
stepMonths: 1,
stepBigMonths: 12,
altField: "",
altFormat: "",
constrainInput: !0,
showButtonPanel: !1,
autoSize: !1,
disabled: !1
}, t.extend(this._defaults, this.regional[""]), this.dpDiv = s(t("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
}
function s(e) {
var i = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
return e.delegate(i, "mouseout", function() {
t(this).removeClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && t(this).removeClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && t(this).removeClass("ui-datepicker-next-hover")
}).delegate(i, "mouseover", function() {
t.datepicker._isDisabledDatepicker(a.inline ? e.parent()[0] : a.input[0]) || (t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), t(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && t(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && t(this).addClass("ui-datepicker-next-hover"))
})
}
function n(e, i) {
t.extend(e, i);
for (var s in i) null == i[s] && (e[s] = i[s]);
return e
}
t.extend(t.ui, {
datepicker: {
version: "1.10.2"
}
});
var a, r = "datepicker",
o = (new Date).getTime();
t.extend(i.prototype, {
markerClassName: "hasDatepicker",
maxRows: 4,
_widgetDatepicker: function() {
return this.dpDiv
},
setDefaults: function(t) {
return n(this._defaults, t || {}), this
},
_attachDatepicker: function(e, i) {
var s, n, a;
s = e.nodeName.toLowerCase(), n = "div" === s || "span" === s, e.id || (this.uuid += 1, e.id = "dp" + this.uuid), a = this._newInst(t(e), n), a.settings = t.extend({}, i || {}), "input" === s ? this._connectDatepicker(e, a) : n && this._inlineDatepicker(e, a)
},
_newInst: function(e, i) {
var n = e[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
return {
id: n,
input: e,
selectedDay: 0,
selectedMonth: 0,
selectedYear: 0,
drawMonth: 0,
drawYear: 0,
inline: i,
dpDiv: i ? s(t("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) : this.dpDiv
}
},
_connectDatepicker: function(e, i) {
var s = t(e);
i.append = t([]), i.trigger = t([]), s.hasClass(this.markerClassName) || (this._attachments(s, i), s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp), this._autoSize(i), t.data(e, r, i), i.settings.disabled && this._disableDatepicker(e))
},
_attachments: function(e, i) {
var s, n, a, r = this._get(i, "appendText"),
o = this._get(i, "isRTL");
i.append && i.append.remove(), r && (i.append = t("<span class='" + this._appendClass + "'>" + r + "</span>"), e[o ? "before" : "after"](i.append)), e.unbind("focus", this._showDatepicker), i.trigger && i.trigger.remove(), s = this._get(i, "showOn"), ("focus" === s || "both" === s) && e.focus(this._showDatepicker), ("button" === s || "both" === s) && (n = this._get(i, "buttonText"), a = this._get(i, "buttonImage"), i.trigger = t(this._get(i, "buttonImageOnly") ? t("<img/>").addClass(this._triggerClass).attr({
src: a,
alt: n,
title: n
}) : t("<button type='button'></button>").addClass(this._triggerClass).html(a ? t("<img/>").attr({
src: a,
alt: n,
title: n
}) : n)), e[o ? "before" : "after"](i.trigger), i.trigger.click(function() {
return t.datepicker._datepickerShowing && t.datepicker._lastInput === e[0] ? t.datepicker._hideDatepicker() : t.datepicker._datepickerShowing && t.datepicker._lastInput !== e[0] ? (t.datepicker._hideDatepicker(), t.datepicker._showDatepicker(e[0])) : t.datepicker._showDatepicker(e[0]), !1
}))
},
_autoSize: function(t) {
if (this._get(t, "autoSize") && !t.inline) {
var e, i, s, n, a = new Date(2009, 11, 20),
r = this._get(t, "dateFormat");
r.match(/[DM]/) && (e = function(t) {
for (i = 0, s = 0, n = 0; t.length > n; n++) t[n].length > i && (i = t[n].length, s = n);
return s
}, a.setMonth(e(this._get(t, r.match(/MM/) ? "monthNames" : "monthNamesShort"))), a.setDate(e(this._get(t, r.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - a.getDay())), t.input.attr("size", this._formatDate(t, a).length)
}
},
_inlineDatepicker: function(e, i) {
var s = t(e);
s.hasClass(this.markerClassName) || (s.addClass(this.markerClassName).append(i.dpDiv), t.data(e, r, i), this._setDate(i, this._getDefaultDate(i), !0), this._updateDatepicker(i), this._updateAlternate(i), i.settings.disabled && this._disableDatepicker(e), i.dpDiv.css("display", "block"))
},
_dialogDatepicker: function(e, i, s, a, o) {
var h, l, c, u, d, p = this._dialogInst;
return p || (this.uuid += 1, h = "dp" + this.uuid, this._dialogInput = t("<input type='text' id='" + h + "' style='position: absolute; top: -100px; width: 0px;'/>"), this._dialogInput.keydown(this._doKeyDown), t("body").append(this._dialogInput), p = this._dialogInst = this._newInst(this._dialogInput, !1), p.settings = {}, t.data(this._dialogInput[0], r, p)), n(p.settings, a || {}), i = i && i.constructor === Date ? this._formatDate(p, i) : i, this._dialogInput.val(i), this._pos = o ? o.length ? o : [o.pageX, o.pageY] : null, this._pos || (l = document.documentElement.clientWidth, c = document.documentElement.clientHeight, u = document.documentElement.scrollLeft || document.body.scrollLeft, d = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [l / 2 - 100 + u, c / 2 - 150 + d]), this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), p.settings.onSelect = s, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), t.blockUI && t.blockUI(this.dpDiv), t.data(this._dialogInput[0], r, p), this
},
_destroyDatepicker: function(e) {
var i, s = t(e),
n = t.data(e, r);
s.hasClass(this.markerClassName) && (i = e.nodeName.toLowerCase(), t.removeData(e, r), "input" === i ? (n.append.remove(), n.trigger.remove(), s.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : ("div" === i || "span" === i) && s.removeClass(this.markerClassName).empty())
},
_enableDatepicker: function(e) {
var i, s, n = t(e),
a = t.data(e, r);
n.hasClass(this.markerClassName) && (i = e.nodeName.toLowerCase(), "input" === i ? (e.disabled = !1, a.trigger.filter("button").each(function() {
this.disabled = !1
}).end().filter("img").css({
opacity: "1.0",
cursor: ""
})) : ("div" === i || "span" === i) && (s = n.children("." + this._inlineClass), s.children().removeClass("ui-state-disabled"), s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !1)), this._disabledInputs = t.map(this._disabledInputs, function(t) {
return t === e ? null : t
}))
},
_disableDatepicker: function(e) {
var i, s, n = t(e),
a = t.data(e, r);
n.hasClass(this.markerClassName) && (i = e.nodeName.toLowerCase(), "input" === i ? (e.disabled = !0, a.trigger.filter("button").each(function() {
this.disabled = !0
}).end().filter("img").css({
opacity: "0.5",
cursor: "default"
})) : ("div" === i || "span" === i) && (s = n.children("." + this._inlineClass), s.children().addClass("ui-state-disabled"), s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !0)), this._disabledInputs = t.map(this._disabledInputs, function(t) {
return t === e ? null : t
}), this._disabledInputs[this._disabledInputs.length] = e)
},
_isDisabledDatepicker: function(t) {
if (!t) return !1;
for (var e = 0; this._disabledInputs.length > e; e++)
if (this._disabledInputs[e] === t) return !0;
return !1
},
_getInst: function(e) {
try {
return t.data(e, r)
} catch (i) {
throw "Missing instance data for this datepicker"
}
},
_optionDatepicker: function(i, s, a) {
var r, o, h, l, c = this._getInst(i);
return 2 === arguments.length && "string" == typeof s ? "defaults" === s ? t.extend({}, t.datepicker._defaults) : c ? "all" === s ? t.extend({}, c.settings) : this._get(c, s) : null : (r = s || {}, "string" == typeof s && (r = {}, r[s] = a), c && (this._curInst === c && this._hideDatepicker(), o = this._getDateDatepicker(i, !0), h = this._getMinMaxDate(c, "min"), l = this._getMinMaxDate(c, "max"), n(c.settings, r), null !== h && r.dateFormat !== e && r.minDate === e && (c.settings.minDate = this._formatDate(c, h)), null !== l && r.dateFormat !== e && r.maxDate === e && (c.settings.maxDate = this._formatDate(c, l)), "disabled" in r && (r.disabled ? this._disableDatepicker(i) : this._enableDatepicker(i)), this._attachments(t(i), c), this._autoSize(c), this._setDate(c, o), this._updateAlternate(c), this._updateDatepicker(c)), e)
},
_changeDatepicker: function(t, e, i) {
this._optionDatepicker(t, e, i)
},
_refreshDatepicker: function(t) {
var e = this._getInst(t);
e && this._updateDatepicker(e)
},
_setDateDatepicker: function(t, e) {
var i = this._getInst(t);
i && (this._setDate(i, e), this._updateDatepicker(i), this._updateAlternate(i))
},
_getDateDatepicker: function(t, e) {
var i = this._getInst(t);
return i && !i.inline && this._setDateFromField(i, e), i ? this._getDate(i) : null
},
_doKeyDown: function(e) {
var i, s, n, a = t.datepicker._getInst(e.target),
r = !0,
o = a.dpDiv.is(".ui-datepicker-rtl");
if (a._keyEvent = !0, t.datepicker._datepickerShowing) switch (e.keyCode) {
case 9:
t.datepicker._hideDatepicker(), r = !1;
break;
case 13:
return n = t("td." + t.datepicker._dayOverClass + ":not(." + t.datepicker._currentClass + ")", a.dpDiv), n[0] && t.datepicker._selectDay(e.target, a.selectedMonth, a.selectedYear, n[0]), i = t.datepicker._get(a, "onSelect"), i ? (s = t.datepicker._formatDate(a), i.apply(a.input ? a.input[0] : null, [s, a])) : t.datepicker._hideDatepicker(), !1;
case 27:
t.datepicker._hideDatepicker();
break;
case 33:
t.datepicker._adjustDate(e.target, e.ctrlKey ? -t.datepicker._get(a, "stepBigMonths") : -t.datepicker._get(a, "stepMonths"), "M");
break;
case 34:
t.datepicker._adjustDate(e.target, e.ctrlKey ? +t.datepicker._get(a, "stepBigMonths") : +t.datepicker._get(a, "stepMonths"), "M");
break;
case 35:
(e.ctrlKey || e.metaKey) && t.datepicker._clearDate(e.target), r = e.ctrlKey || e.metaKey;
break;
case 36:
(e.ctrlKey || e.metaKey) && t.datepicker._gotoToday(e.target), r = e.ctrlKey || e.metaKey;
break;
case 37:
(e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, o ? 1 : -1, "D"), r = e.ctrlKey || e.metaKey, e.originalEvent.altKey && t.datepicker._adjustDate(e.target, e.ctrlKey ? -t.datepicker._get(a, "stepBigMonths") : -t.datepicker._get(a, "stepMonths"), "M");
break;
case 38:
(e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, -7, "D"), r = e.ctrlKey || e.metaKey;
break;
case 39:
(e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, o ? -1 : 1, "D"), r = e.ctrlKey || e.metaKey, e.originalEvent.altKey && t.datepicker._adjustDate(e.target, e.ctrlKey ? +t.datepicker._get(a, "stepBigMonths") : +t.datepicker._get(a, "stepMonths"), "M");
break;
case 40:
(e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, 7, "D"), r = e.ctrlKey || e.metaKey;
break;
default:
r = !1
} else 36 === e.keyCode && e.ctrlKey ? t.datepicker._showDatepicker(this) : r = !1;
r && (e.preventDefault(), e.stopPropagation())
},
_doKeyPress: function(i) {
var s, n, a = t.datepicker._getInst(i.target);
return t.datepicker._get(a, "constrainInput") ? (s = t.datepicker._possibleChars(t.datepicker._get(a, "dateFormat")), n = String.fromCharCode(null == i.charCode ? i.keyCode : i.charCode), i.ctrlKey || i.metaKey || " " > n || !s || s.indexOf(n) > -1) : e
},
_doKeyUp: function(e) {
var i, s = t.datepicker._getInst(e.target);
if (s.input.val() !== s.lastVal) try {
i = t.datepicker.parseDate(t.datepicker._get(s, "dateFormat"), s.input ? s.input.val() : null, t.datepicker._getFormatConfig(s)), i && (t.datepicker._setDateFromField(s), t.datepicker._updateAlternate(s), t.datepicker._updateDatepicker(s))
} catch (n) {}
return !0
},
_showDatepicker: function(e) {
if (e = e.target || e, "input" !== e.nodeName.toLowerCase() && (e = t("input", e.parentNode)[0]), !t.datepicker._isDisabledDatepicker(e) && t.datepicker._lastInput !== e) {
var i, s, a, r, o, h, l;
i = t.datepicker._getInst(e), t.datepicker._curInst && t.datepicker._curInst !== i && (t.datepicker._curInst.dpDiv.stop(!0, !0), i && t.datepicker._datepickerShowing && t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])), s = t.datepicker._get(i, "beforeShow"), a = s ? s.apply(e, [e, i]) : {}, a !== !1 && (n(i.settings, a), i.lastVal = null, t.datepicker._lastInput = e, t.datepicker._setDateFromField(i), t.datepicker._inDialog && (e.value = ""), t.datepicker._pos || (t.datepicker._pos = t.datepicker._findPos(e), t.datepicker._pos[1] += e.offsetHeight), r = !1, t(e).parents().each(function() {
return r |= "fixed" === t(this).css("position"), !r
}), o = {
left: t.datepicker._pos[0],
top: t.datepicker._pos[1]
}, t.datepicker._pos = null, i.dpDiv.empty(), i.dpDiv.css({
position: "absolute",
display: "block",
top: "-1000px"
}), t.datepicker._updateDatepicker(i), o = t.datepicker._checkOffset(i, o, r), i.dpDiv.css({
position: t.datepicker._inDialog && t.blockUI ? "static" : r ? "fixed" : "absolute",
display: "none",
left: o.left + "px",
top: o.top + "px"
}), i.inline || (h = t.datepicker._get(i, "showAnim"), l = t.datepicker._get(i, "duration"), i.dpDiv.zIndex(t(e).zIndex() + 1), t.datepicker._datepickerShowing = !0, t.effects && t.effects.effect[h] ? i.dpDiv.show(h, t.datepicker._get(i, "showOptions"), l) : i.dpDiv[h || "show"](h ? l : null), i.input.is(":visible") && !i.input.is(":disabled") && i.input.focus(), t.datepicker._curInst = i))
}
},
_updateDatepicker: function(e) {
this.maxRows = 4, a = e, e.dpDiv.empty().append(this._generateHTML(e)), this._attachHandlers(e), e.dpDiv.find("." + this._dayOverClass + " a").mouseover();
var i, s = this._getNumberOfMonths(e),
n = s[1],
r = 17;
e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), n > 1 && e.dpDiv.addClass("ui-datepicker-multi-" + n).css("width", r * n + "em"), e.dpDiv[(1 !== s[0] || 1 !== s[1] ? "add" : "remove") + "Class"]("ui-datepicker-multi"), e.dpDiv[(this._get(e, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), e === t.datepicker._curInst && t.datepicker._datepickerShowing && e.input && e.input.is(":visible") && !e.input.is(":disabled") && e.input[0] !== document.activeElement && e.input.focus(), e.yearshtml && (i = e.yearshtml, setTimeout(function() {
i === e.yearshtml && e.yearshtml && e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml), i = e.yearshtml = null
}, 0))
},
_getBorders: function(t) {
var e = function(t) {
return {
thin: 1,
medium: 2,
thick: 3
}[t] || t
};
return [parseFloat(e(t.css("border-left-width"))), parseFloat(e(t.css("border-top-width")))]
},
_checkOffset: function(e, i, s) {
var n = e.dpDiv.outerWidth(),
a = e.dpDiv.outerHeight(),
r = e.input ? e.input.outerWidth() : 0,
o = e.input ? e.input.outerHeight() : 0,
h = document.documentElement.clientWidth + (s ? 0 : t(document).scrollLeft()),
l = document.documentElement.clientHeight + (s ? 0 : t(document).scrollTop());
return i.left -= this._get(e, "isRTL") ? n - r : 0, i.left -= s && i.left === e.input.offset().left ? t(document).scrollLeft() : 0, i.top -= s && i.top === e.input.offset().top + o ? t(document).scrollTop() : 0, i.left -= Math.min(i.left, i.left + n > h && h > n ? Math.abs(i.left + n - h) : 0), i.top -= Math.min(i.top, i.top + a > l && l > a ? Math.abs(a + o) : 0), i
},
_findPos: function(e) {
for (var i, s = this._getInst(e), n = this._get(s, "isRTL"); e && ("hidden" === e.type || 1 !== e.nodeType || t.expr.filters.hidden(e));) e = e[n ? "previousSibling" : "nextSibling"];
return i = t(e).offset(), [i.left, i.top]
},
_hideDatepicker: function(e) {
var i, s, n, a, o = this._curInst;
!o || e && o !== t.data(e, r) || this._datepickerShowing && (i = this._get(o, "showAnim"), s = this._get(o, "duration"), n = function() {
t.datepicker._tidyDialog(o)
}, t.effects && (t.effects.effect[i] || t.effects[i]) ? o.dpDiv.hide(i, t.datepicker._get(o, "showOptions"), s, n) : o.dpDiv["slideDown" === i ? "slideUp" : "fadeIn" === i ? "fadeOut" : "hide"](i ? s : null, n), i || n(), this._datepickerShowing = !1, a = this._get(o, "onClose"), a && a.apply(o.input ? o.input[0] : null, [o.input ? o.input.val() : "", o]), this._lastInput = null, this._inDialog && (this._dialogInput.css({
position: "absolute",
left: "0",
top: "-100px"
}), t.blockUI && (t.unblockUI(), t("body").append(this.dpDiv))), this._inDialog = !1)
},
_tidyDialog: function(t) {
t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")
},
_checkExternalClick: function(e) {
if (t.datepicker._curInst) {
var i = t(e.target),
s = t.datepicker._getInst(i[0]);
(i[0].id !== t.datepicker._mainDivId && 0 === i.parents("#" + t.datepicker._mainDivId).length && !i.hasClass(t.datepicker.markerClassName) && !i.closest("." + t.datepicker._triggerClass).length && t.datepicker._datepickerShowing && (!t.datepicker._inDialog || !t.blockUI) || i.hasClass(t.datepicker.markerClassName) && t.datepicker._curInst !== s) && t.datepicker._hideDatepicker()
}
},
_adjustDate: function(e, i, s) {
var n = t(e),
a = this._getInst(n[0]);
this._isDisabledDatepicker(n[0]) || (this._adjustInstDate(a, i + ("M" === s ? this._get(a, "showCurrentAtPos") : 0), s), this._updateDatepicker(a))
},
_gotoToday: function(e) {
var i, s = t(e),
n = this._getInst(s[0]);
this._get(n, "gotoCurrent") && n.currentDay ? (n.selectedDay = n.currentDay, n.drawMonth = n.selectedMonth = n.currentMonth, n.drawYear = n.selectedYear = n.currentYear) : (i = new Date, n.selectedDay = i.getDate(), n.drawMonth = n.selectedMonth = i.getMonth(), n.drawYear = n.selectedYear = i.getFullYear()), this._notifyChange(n), this._adjustDate(s)
},
_selectMonthYear: function(e, i, s) {
var n = t(e),
a = this._getInst(n[0]);
a["selected" + ("M" === s ? "Month" : "Year")] = a["draw" + ("M" === s ? "Month" : "Year")] = parseInt(i.options[i.selectedIndex].value, 10), this._notifyChange(a), this._adjustDate(n)
},
_selectDay: function(e, i, s, n) {
var a, r = t(e);
t(n).hasClass(this._unselectableClass) || this._isDisabledDatepicker(r[0]) || (a = this._getInst(r[0]), a.selectedDay = a.currentDay = t("a", n).html(), a.selectedMonth = a.currentMonth = i, a.selectedYear = a.currentYear = s, this._selectDate(e, this._formatDate(a, a.currentDay, a.currentMonth, a.currentYear)))
},
_clearDate: function(e) {
var i = t(e);
this._selectDate(i, "")
},
_selectDate: function(e, i) {
var s, n = t(e),
a = this._getInst(n[0]);
i = null != i ? i : this._formatDate(a), a.input && a.input.val(i), this._updateAlternate(a), s = this._get(a, "onSelect"), s ? s.apply(a.input ? a.input[0] : null, [i, a]) : a.input && a.input.trigger("change"), a.inline ? this._updateDatepicker(a) : (this._hideDatepicker(), this._lastInput = a.input[0], "object" != typeof a.input[0] && a.input.focus(), this._lastInput = null)
},
_updateAlternate: function(e) {
var i, s, n, a = this._get(e, "altField");
a && (i = this._get(e, "altFormat") || this._get(e, "dateFormat"), s = this._getDate(e), n = this.formatDate(i, s, this._getFormatConfig(e)), t(a).each(function() {
t(this).val(n)
}))
},
noWeekends: function(t) {
var e = t.getDay();
return [e > 0 && 6 > e, ""]
},
iso8601Week: function(t) {
var e, i = new Date(t.getTime());
return i.setDate(i.getDate() + 4 - (i.getDay() || 7)), e = i.getTime(), i.setMonth(0), i.setDate(1), Math.floor(Math.round((e - i) / 864e5) / 7) + 1
},
parseDate: function(i, s, n) {
if (null == i || null == s) throw "Invalid arguments";
if (s = "object" == typeof s ? "" + s : s + "", "" === s) return null;
var a, r, o, h, l = 0,
c = (n ? n.shortYearCutoff : null) || this._defaults.shortYearCutoff,
u = "string" != typeof c ? c : (new Date).getFullYear() % 100 + parseInt(c, 10),
d = (n ? n.dayNamesShort : null) || this._defaults.dayNamesShort,
p = (n ? n.dayNames : null) || this._defaults.dayNames,
f = (n ? n.monthNamesShort : null) || this._defaults.monthNamesShort,
m = (n ? n.monthNames : null) || this._defaults.monthNames,
g = -1,
v = -1,
_ = -1,
b = -1,
y = !1,
w = function(t) {
var e = i.length > a + 1 && i.charAt(a + 1) === t;
return e && a++, e
},
k = function(t) {
var e = w(t),
i = "@" === t ? 14 : "!" === t ? 20 : "y" === t && e ? 4 : "o" === t ? 3 : 2,
n = RegExp("^\\d{1," + i + "}"),
a = s.substring(l).match(n);
if (!a) throw "Missing number at position " + l;
return l += a[0].length, parseInt(a[0], 10)
},
x = function(i, n, a) {
var r = -1,
o = t.map(w(i) ? a : n, function(t, e) {
return [
[e, t]
]
}).sort(function(t, e) {
return -(t[1].length - e[1].length)
});
if (t.each(o, function(t, i) {
var n = i[1];
return s.substr(l, n.length).toLowerCase() === n.toLowerCase() ? (r = i[0], l += n.length, !1) : e
}), -1 !== r) return r + 1;
throw "Unknown name at position " + l
},
D = function() {
if (s.charAt(l) !== i.charAt(a)) throw "Unexpected literal at position " + l;
l++
};
for (a = 0; i.length > a; a++)
if (y) "'" !== i.charAt(a) || w("'") ? D() : y = !1;
else switch (i.charAt(a)) {
case "d":
_ = k("d");
break;
case "D":
x("D", d, p);
break;
case "o":
b = k("o");
break;
case "m":
v = k("m");
break;
case "M":
v = x("M", f, m);
break;
case "y":
g = k("y");
break;
case "@":
h = new Date(k("@")), g = h.getFullYear(), v = h.getMonth() + 1, _ = h.getDate();
break;
case "!":
h = new Date((k("!") - this._ticksTo1970) / 1e4), g = h.getFullYear(), v = h.getMonth() + 1, _ = h.getDate();
break;
case "'":
w("'") ? D() : y = !0;
break;
default:
D()
}
if (s.length > l && (o = s.substr(l), !/^\s+/.test(o))) throw "Extra/unparsed characters found in date: " + o;
if (-1 === g ? g = (new Date).getFullYear() : 100 > g && (g += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (u >= g ? 0 : -100)), b > -1)
for (v = 1, _ = b;;) {
if (r = this._getDaysInMonth(g, v - 1), r >= _) break;
v++, _ -= r
}
if (h = this._daylightSavingAdjust(new Date(g, v - 1, _)), h.getFullYear() !== g || h.getMonth() + 1 !== v || h.getDate() !== _) throw "Invalid date";
return h
},
ATOM: "yy-mm-dd",
COOKIE: "D, dd M yy",
ISO_8601: "yy-mm-dd",
RFC_822: "D, d M y",
RFC_850: "DD, dd-M-y",
RFC_1036: "D, d M y",
RFC_1123: "D, d M yy",
RFC_2822: "D, d M yy",
RSS: "D, d M y",
TICKS: "!",
TIMESTAMP: "@",
W3C: "yy-mm-dd",
_ticksTo1970: 1e7 * 60 * 60 * 24 * (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)),
formatDate: function(t, e, i) {
if (!e) return "";
var s, n = (i ? i.dayNamesShort : null) || this._defaults.dayNamesShort,
a = (i ? i.dayNames : null) || this._defaults.dayNames,
r = (i ? i.monthNamesShort : null) || this._defaults.monthNamesShort,
o = (i ? i.monthNames : null) || this._defaults.monthNames,
h = function(e) {
var i = t.length > s + 1 && t.charAt(s + 1) === e;
return i && s++, i
},
l = function(t, e, i) {
var s = "" + e;
if (h(t))
for (; i > s.length;) s = "0" + s;
return s
},
c = function(t, e, i, s) {
return h(t) ? s[e] : i[e]
},
u = "",
d = !1;
if (e)
for (s = 0; t.length > s; s++)
if (d) "'" !== t.charAt(s) || h("'") ? u += t.charAt(s) : d = !1;
else switch (t.charAt(s)) {
case "d":
u += l("d", e.getDate(), 2);
break;
case "D":
u += c("D", e.getDay(), n, a);
break;
case "o":
u += l("o", Math.round((new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime() - new Date(e.getFullYear(), 0, 0).getTime()) / 864e5), 3);
break;
case "m":
u += l("m", e.getMonth() + 1, 2);
break;
case "M":
u += c("M", e.getMonth(), r, o);
break;
case "y":
u += h("y") ? e.getFullYear() : (10 > e.getYear() % 100 ? "0" : "") + e.getYear() % 100;
break;
case "@":
u += e.getTime();
break;
case "!":
u += 1e4 * e.getTime() + this._ticksTo1970;
break;
case "'":
h("'") ? u += "'" : d = !0;
break;
default:
u += t.charAt(s)
}
return u
},
_possibleChars: function(t) {
var e, i = "",
s = !1,
n = function(i) {
var s = t.length > e + 1 && t.charAt(e + 1) === i;
return s && e++, s
};
for (e = 0; t.length > e; e++)
if (s) "'" !== t.charAt(e) || n("'") ? i += t.charAt(e) : s = !1;
else switch (t.charAt(e)) {
case "d":
case "m":
case "y":
case "@":
i += "0123456789";
break;
case "D":
case "M":
return null;
case "'":
n("'") ? i += "'" : s = !0;
break;
default:
i += t.charAt(e)
}
return i
},
_get: function(t, i) {
return t.settings[i] !== e ? t.settings[i] : this._defaults[i]
},
_setDateFromField: function(t, e) {
if (t.input.val() !== t.lastVal) {
var i = this._get(t, "dateFormat"),
s = t.lastVal = t.input ? t.input.val() : null,
n = this._getDefaultDate(t),
a = n,
r = this._getFormatConfig(t);
try {
a = this.parseDate(i, s, r) || n
} catch (o) {
s = e ? "" : s
}
t.selectedDay = a.getDate(), t.drawMonth = t.selectedMonth = a.getMonth(), t.drawYear = t.selectedYear = a.getFullYear(), t.currentDay = s ? a.getDate() : 0, t.currentMonth = s ? a.getMonth() : 0, t.currentYear = s ? a.getFullYear() : 0, this._adjustInstDate(t)
}
},
_getDefaultDate: function(t) {
return this._restrictMinMax(t, this._determineDate(t, this._get(t, "defaultDate"), new Date))
},
_determineDate: function(e, i, s) {
var n = function(t) {
var e = new Date;
return e.setDate(e.getDate() + t), e
},
a = function(i) {
try {
return t.datepicker.parseDate(t.datepicker._get(e, "dateFormat"), i, t.datepicker._getFormatConfig(e))
} catch (s) {}
for (var n = (i.toLowerCase().match(/^c/) ? t.datepicker._getDate(e) : null) || new Date, a = n.getFullYear(), r = n.getMonth(), o = n.getDate(), h = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, l = h.exec(i); l;) {
switch (l[2] || "d") {
case "d":
case "D":
o += parseInt(l[1], 10);
break;
case "w":
case "W":
o += 7 * parseInt(l[1], 10);
break;
case "m":
case "M":
r += parseInt(l[1], 10), o = Math.min(o, t.datepicker._getDaysInMonth(a, r));
break;
case "y":
case "Y":
a += parseInt(l[1], 10), o = Math.min(o, t.datepicker._getDaysInMonth(a, r))
}
l = h.exec(i)
}
return new Date(a, r, o)
},
r = null == i || "" === i ? s : "string" == typeof i ? a(i) : "number" == typeof i ? isNaN(i) ? s : n(i) : new Date(i.getTime());
return r = r && "Invalid Date" == "" + r ? s : r, r && (r.setHours(0), r.setMinutes(0), r.setSeconds(0), r.setMilliseconds(0)), this._daylightSavingAdjust(r)
},
_daylightSavingAdjust: function(t) {
return t ? (t.setHours(t.getHours() > 12 ? t.getHours() + 2 : 0), t) : null
},
_setDate: function(t, e, i) {
var s = !e,
n = t.selectedMonth,
a = t.selectedYear,
r = this._restrictMinMax(t, this._determineDate(t, e, new Date));
t.selectedDay = t.currentDay = r.getDate(), t.drawMonth = t.selectedMonth = t.currentMonth = r.getMonth(), t.drawYear = t.selectedYear = t.currentYear = r.getFullYear(), n === t.selectedMonth && a === t.selectedYear || i || this._notifyChange(t), this._adjustInstDate(t), t.input && t.input.val(s ? "" : this._formatDate(t))
},
_getDate: function(t) {
var e = !t.currentYear || t.input && "" === t.input.val() ? null : this._daylightSavingAdjust(new Date(t.currentYear, t.currentMonth, t.currentDay));
return e
},
_attachHandlers: function(e) {
var i = this._get(e, "stepMonths"),
s = "#" + e.id.replace(/\\\\/g, "\\");
e.dpDiv.find("[data-handler]").map(function() {
var e = {
prev: function() {
window["DP_jQuery_" + o].datepicker._adjustDate(s, -i, "M")
},
next: function() {
window["DP_jQuery_" + o].datepicker._adjustDate(s, +i, "M")
},
hide: function() {
window["DP_jQuery_" + o].datepicker._hideDatepicker()
},
today: function() {
window["DP_jQuery_" + o].datepicker._gotoToday(s)
},
selectDay: function() {
return window["DP_jQuery_" + o].datepicker._selectDay(s, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1
},
selectMonth: function() {
return window["DP_jQuery_" + o].datepicker._selectMonthYear(s, this, "M"), !1
},
selectYear: function() {
return window["DP_jQuery_" + o].datepicker._selectMonthYear(s, this, "Y"), !1
}
};
t(this).bind(this.getAttribute("data-event"), e[this.getAttribute("data-handler")])
})
},
_generateHTML: function(t) {
var e, i, s, n, a, r, o, h, l, c, u, d, p, f, m, g, v, _, b, y, w, k, x, D, T, C, S, M, N, I, P, A, z, H, E, F, O, W, j, R = new Date,
L = this._daylightSavingAdjust(new Date(R.getFullYear(), R.getMonth(), R.getDate())),
Y = this._get(t, "isRTL"),
B = this._get(t, "showButtonPanel"),
J = this._get(t, "hideIfNoPrevNext"),
Q = this._get(t, "navigationAsDateFormat"),
K = this._getNumberOfMonths(t),
V = this._get(t, "showCurrentAtPos"),
U = this._get(t, "stepMonths"),
q = 1 !== K[0] || 1 !== K[1],
X = this._daylightSavingAdjust(t.currentDay ? new Date(t.currentYear, t.currentMonth, t.currentDay) : new Date(9999, 9, 9)),
G = this._getMinMaxDate(t, "min"),
$ = this._getMinMaxDate(t, "max"),
Z = t.drawMonth - V,
te = t.drawYear;
if (0 > Z && (Z += 12, te--), $)
for (e = this._daylightSavingAdjust(new Date($.getFullYear(), $.getMonth() - K[0] * K[1] + 1, $.getDate())), e = G && G > e ? G : e; this._daylightSavingAdjust(new Date(te, Z, 1)) > e;) Z--, 0 > Z && (Z = 11, te--);
for (t.drawMonth = Z, t.drawYear = te, i = this._get(t, "prevText"), i = Q ? this.formatDate(i, this._daylightSavingAdjust(new Date(te, Z - U, 1)), this._getFormatConfig(t)) : i, s = this._canAdjustMonth(t, -1, te, Z) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "e" : "w") + "'>" + i + "</span></a>" : J ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "e" : "w") + "'>" + i + "</span></a>", n = this._get(t, "nextText"), n = Q ? this.formatDate(n, this._daylightSavingAdjust(new Date(te, Z + U, 1)), this._getFormatConfig(t)) : n, a = this._canAdjustMonth(t, 1, te, Z) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + n + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "w" : "e") + "'>" + n + "</span></a>" : J ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + n + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "w" : "e") + "'>" + n + "</span></a>", r = this._get(t, "currentText"), o = this._get(t, "gotoCurrent") && t.currentDay ? X : L, r = Q ? this.formatDate(r, o, this._getFormatConfig(t)) : r, h = t.inline ? "" : "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(t, "closeText") + "</button>", l = B ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (Y ? h : "") + (this._isInRange(t, o) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + r + "</button>" : "") + (Y ? "" : h) + "</div>" : "", c = parseInt(this._get(t, "firstDay"), 10), c = isNaN(c) ? 0 : c, u = this._get(t, "showWeek"), d = this._get(t, "dayNames"), p = this._get(t, "dayNamesMin"), f = this._get(t, "monthNames"), m = this._get(t, "monthNamesShort"), g = this._get(t, "beforeShowDay"), v = this._get(t, "showOtherMonths"), _ = this._get(t, "selectOtherMonths"), b = this._getDefaultDate(t), y = "", k = 0; K[0] > k; k++) {
for (x = "", this.maxRows = 4, D = 0; K[1] > D; D++) {
if (T = this._daylightSavingAdjust(new Date(te, Z, t.selectedDay)), C = " ui-corner-all", S = "", q) {
if (S += "<div class='ui-datepicker-group", K[1] > 1) switch (D) {
case 0:
S += " ui-datepicker-group-first", C = " ui-corner-" + (Y ? "right" : "left");
break;
case K[1] - 1:
S += " ui-datepicker-group-last", C = " ui-corner-" + (Y ? "left" : "right");
break;
default:
S += " ui-datepicker-group-middle", C = ""
}
S += "'>"
}
for (S += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + C + "'>" + (/all|left/.test(C) && 0 === k ? Y ? a : s : "") + (/all|right/.test(C) && 0 === k ? Y ? s : a : "") + this._generateMonthYearHeader(t, Z, te, G, $, k > 0 || D > 0, f, m) + "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>", M = u ? "<th class='ui-datepicker-week-col'>" + this._get(t, "weekHeader") + "</th>" : "", w = 0; 7 > w; w++) N = (w + c) % 7, M += "<th" + ((w + c + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + d[N] + "'>" + p[N] + "</span></th>";
for (S += M + "</tr></thead><tbody>", I = this._getDaysInMonth(te, Z), te === t.selectedYear && Z === t.selectedMonth && (t.selectedDay = Math.min(t.selectedDay, I)), P = (this._getFirstDayOfMonth(te, Z) - c + 7) % 7, A = Math.ceil((P + I) / 7), z = q ? this.maxRows > A ? this.maxRows : A : A, this.maxRows = z, H = this._daylightSavingAdjust(new Date(te, Z, 1 - P)), E = 0; z > E; E++) {
for (S += "<tr>", F = u ? "<td class='ui-datepicker-week-col'>" + this._get(t, "calculateWeek")(H) + "</td>" : "", w = 0; 7 > w; w++) O = g ? g.apply(t.input ? t.input[0] : null, [H]) : [!0, ""], W = H.getMonth() !== Z, j = W && !_ || !O[0] || G && G > H || $ && H > $, F += "<td class='" + ((w + c + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (W ? " ui-datepicker-other-month" : "") + (H.getTime() === T.getTime() && Z === t.selectedMonth && t._keyEvent || b.getTime() === H.getTime() && b.getTime() === T.getTime() ? " " + this._dayOverClass : "") + (j ? " " + this._unselectableClass + " ui-state-disabled" : "") + (W && !v ? "" : " " + O[1] + (H.getTime() === X.getTime() ? " " + this._currentClass : "") + (H.getTime() === L.getTime() ? " ui-datepicker-today" : "")) + "'" + (W && !v || !O[2] ? "" : " title='" + O[2].replace(/'/g, "&#39;") + "'") + (j ? "" : " data-handler='selectDay' data-event='click' data-month='" + H.getMonth() + "' data-year='" + H.getFullYear() + "'") + ">" + (W && !v ? "&#xa0;" : j ? "<span class='ui-state-default'>" + H.getDate() + "</span>" : "<a class='ui-state-default" + (H.getTime() === L.getTime() ? " ui-state-highlight" : "") + (H.getTime() === X.getTime() ? " ui-state-active" : "") + (W ? " ui-priority-secondary" : "") + "' href='#'>" + H.getDate() + "</a>") + "</td>", H.setDate(H.getDate() + 1), H = this._daylightSavingAdjust(H);
S += F + "</tr>"
}
Z++, Z > 11 && (Z = 0, te++), S += "</tbody></table>" + (q ? "</div>" + (K[0] > 0 && D === K[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : ""), x += S
}
y += x
}
return y += l, t._keyEvent = !1, y
},
_generateMonthYearHeader: function(t, e, i, s, n, a, r, o) {
var h, l, c, u, d, p, f, m, g = this._get(t, "changeMonth"),
v = this._get(t, "changeYear"),
_ = this._get(t, "showMonthAfterYear"),
b = "<div class='ui-datepicker-title'>",
y = "";
if (a || !g) y += "<span class='ui-datepicker-month'>" + r[e] + "</span>";
else {
for (h = s && s.getFullYear() === i, l = n && n.getFullYear() === i, y += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>", c = 0; 12 > c; c++)(!h || c >= s.getMonth()) && (!l || n.getMonth() >= c) && (y += "<option value='" + c + "'" + (c === e ? " selected='selected'" : "") + ">" + o[c] + "</option>");
y += "</select>"
}
if (_ || (b += y + (!a && g && v ? "" : "&#xa0;")), !t.yearshtml)
if (t.yearshtml = "", a || !v) b += "<span class='ui-datepicker-year'>" + i + "</span>";
else {
for (u = this._get(t, "yearRange").split(":"), d = (new Date).getFullYear(), p = function(t) {
var e = t.match(/c[+\-].*/) ? i + parseInt(t.substring(1), 10) : t.match(/[+\-].*/) ? d + parseInt(t, 10) : parseInt(t, 10);
return isNaN(e) ? d : e
}, f = p(u[0]), m = Math.max(f, p(u[1] || "")), f = s ? Math.max(f, s.getFullYear()) : f, m = n ? Math.min(m, n.getFullYear()) : m, t.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; m >= f; f++) t.yearshtml += "<option value='" + f + "'" + (f === i ? " selected='selected'" : "") + ">" + f + "</option>";
t.yearshtml += "</select>", b += t.yearshtml, t.yearshtml = null
}
return b += this._get(t, "yearSuffix"), _ && (b += (!a && g && v ? "" : "&#xa0;") + y), b += "</div>"
},
_adjustInstDate: function(t, e, i) {
var s = t.drawYear + ("Y" === i ? e : 0),
n = t.drawMonth + ("M" === i ? e : 0),
a = Math.min(t.selectedDay, this._getDaysInMonth(s, n)) + ("D" === i ? e : 0),
r = this._restrictMinMax(t, this._daylightSavingAdjust(new Date(s, n, a)));
t.selectedDay = r.getDate(), t.drawMonth = t.selectedMonth = r.getMonth(), t.drawYear = t.selectedYear = r.getFullYear(), ("M" === i || "Y" === i) && this._notifyChange(t)
},
_restrictMinMax: function(t, e) {
var i = this._getMinMaxDate(t, "min"),
s = this._getMinMaxDate(t, "max"),
n = i && i > e ? i : e;
return s && n > s ? s : n
},
_notifyChange: function(t) {
var e = this._get(t, "onChangeMonthYear");
e && e.apply(t.input ? t.input[0] : null, [t.selectedYear, t.selectedMonth + 1, t])
},
_getNumberOfMonths: function(t) {
var e = this._get(t, "numberOfMonths");
return null == e ? [1, 1] : "number" == typeof e ? [1, e] : e
},
_getMinMaxDate: function(t, e) {
return this._determineDate(t, this._get(t, e + "Date"), null)
},
_getDaysInMonth: function(t, e) {
return 32 - this._daylightSavingAdjust(new Date(t, e, 32)).getDate()
},
_getFirstDayOfMonth: function(t, e) {
return new Date(t, e, 1).getDay()
},
_canAdjustMonth: function(t, e, i, s) {
var n = this._getNumberOfMonths(t),
a = this._daylightSavingAdjust(new Date(i, s + (0 > e ? e : n[0] * n[1]), 1));
return 0 > e && a.setDate(this._getDaysInMonth(a.getFullYear(), a.getMonth())), this._isInRange(t, a)
},
_isInRange: function(t, e) {
var i, s, n = this._getMinMaxDate(t, "min"),
a = this._getMinMaxDate(t, "max"),
r = null,
o = null,
h = this._get(t, "yearRange");
return h && (i = h.split(":"), s = (new Date).getFullYear(), r = parseInt(i[0], 10), o = parseInt(i[1], 10), i[0].match(/[+\-].*/) && (r += s), i[1].match(/[+\-].*/) && (o += s)), (!n || e.getTime() >= n.getTime()) && (!a || e.getTime() <= a.getTime()) && (!r || e.getFullYear() >= r) && (!o || o >= e.getFullYear())
},
_getFormatConfig: function(t) {
var e = this._get(t, "shortYearCutoff");
return e = "string" != typeof e ? e : (new Date).getFullYear() % 100 + parseInt(e, 10), {
shortYearCutoff: e,
dayNamesShort: this._get(t, "dayNamesShort"),
dayNames: this._get(t, "dayNames"),
monthNamesShort: this._get(t, "monthNamesShort"),
monthNames: this._get(t, "monthNames")
}
},
_formatDate: function(t, e, i, s) {
e || (t.currentDay = t.selectedDay, t.currentMonth = t.selectedMonth, t.currentYear = t.selectedYear);
var n = e ? "object" == typeof e ? e : this._daylightSavingAdjust(new Date(s, i, e)) : this._daylightSavingAdjust(new Date(t.currentYear, t.currentMonth, t.currentDay));
return this.formatDate(this._get(t, "dateFormat"), n, this._getFormatConfig(t))
}
}), t.fn.datepicker = function(e) {
if (!this.length) return this;
t.datepicker.initialized || (t(document).mousedown(t.datepicker._checkExternalClick), t.datepicker.initialized = !0), 0 === t("#" + t.datepicker._mainDivId).length && t("body").append(t.datepicker.dpDiv);
var i = Array.prototype.slice.call(arguments, 1);
return "string" != typeof e || "isDisabled" !== e && "getDate" !== e && "widget" !== e ? "option" === e && 2 === arguments.length && "string" == typeof arguments[1] ? t.datepicker["_" + e + "Datepicker"].apply(t.datepicker, [this[0]].concat(i)) : this.each(function() {
"string" == typeof e ? t.datepicker["_" + e + "Datepicker"].apply(t.datepicker, [this].concat(i)) : t.datepicker._attachDatepicker(this, e)
}) : t.datepicker["_" + e + "Datepicker"].apply(t.datepicker, [this[0]].concat(i))
}, t.datepicker = new i, t.datepicker.initialized = !1, t.datepicker.uuid = (new Date).getTime(), t.datepicker.version = "1.10.2", window["DP_jQuery_" + o] = t
})(jQuery);
(function(a) {
a.datepicker.regional.nl = {
closeText: "Sluiten",
prevText: "←",
nextText: "→",
currentText: "Vandaag",
monthNames: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"],
monthNamesShort: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
dayNames: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"],
dayNamesShort: ["zon", "maa", "din", "woe", "don", "vri", "zat"],
dayNamesMin: ["zo", "ma", "di", "wo", "do", "vr", "za"],
weekHeader: "Wk",
dateFormat: "dd-mm-yy",
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
a.datepicker.regional.de = {
closeText: "schließen",
prevText: "&#x3c;zurück",
nextText: "Vor&#x3e;",
currentText: "heute",
monthNames: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
weekHeader: "Wo",
dateFormat: "dd.mm.yy",
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
a.datepicker.regional.fr = {
closeText: "Fermer",
prevText: "Précédent",
nextText: "Suivant",
currentText: "Aujourd'hui",
monthNames: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
monthNamesShort: ["Janv.", "Févr.", "Mars", "Avril", "Mai", "Juin", "Juil.", "Août", "Sept.", "Oct.", "Nov.", "Déc."],
dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
dayNamesShort: ["Dim.", "Lun.", "Mar.", "Mer.", "Jeu.", "Ven.", "Sam."],
dayNamesMin: ["D", "L", "M", "M", "J", "V", "S"],
weekHeader: "Sem.",
dateFormat: "dd/mm/yy",
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
a(function() {
var b = document.documentElement.lang;
if (b && a.datepicker.regional[b] !== undefined) {
a.datepicker.setDefaults(a.datepicker.regional[b]);
}
});
}(jQuery));
(function(b) {
var a = document.documentElement.lang;
if (a && b.datepicker.regional[a] !== undefined) {
b.datepicker.setDefaults(b.datepicker.regional[a]);
}
}(jQuery));
(function(c, b, d) {
c.hm = c.hm || {};
var a = (function() {
function f() {
this.init.apply(this, arguments)
}
var e;
f.getInstance = function() {
if (e === d) {
e = new f()
}
return e
};
c.extend(f.prototype, {
init: function(g) {
if (g === d || !g.match(/^(local|session)(Storage|Cookie)$/)) {
g = "localStorage"
}
this._initStorage(g)
},
_initStorage: function(h) {
if (h.match(/Storage$/)) {
this.storage = (function() {
var j = new Date,
l, i;
try {
(l = b[h]).setItem(j, j);
i = l.getItem(j) == j;
l.removeItem(j);
return i && l
} catch (k) {}
}());
if (!this.storage) {
h = h.replace("Storage", "Cookie")
}
}
var g;
if (h.match(/Cookie$/) && (g = c.hm.cookie)) {
if (h === "localCookie") {
g.options.persistent = true
}
this.storage = {
length: 0,
getItem: function(i) {
return g.getItem(i)
},
setItem: function(i, j) {
if (!i) {
return
}
g.setItem(i, j);
this.length = document.cookie.match(/\=/g).length
},
key: function(i) {
return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[i])
},
removeItem: function(i) {
if (g.removeItem(i)) {
this.length--
}
},
hasOwnProperty: function(i) {
g.hasItem(i)
},
clear: function() {
while (this.length > 0) {
this.removeItem(this.key(0))
}
}
};
this.storage.length = (document.cookie.match(/\=/g) || this.storage).length
}
this.type = h
},
setItem: function(g, h) {
return this.storage.setItem(g, h)
},
getItem: function(g) {
return this.storage.getItem(g)
},
removeItem: function(g) {
return this.storage.removeItem(g)
},
setObject: function(g, h) {
return this.storage.setItem(g, JSON.stringify(h))
},
getObject: function(g) {
try {
return jQuery.parseJSON(this.storage.getItem(g))
} catch (h) {
return null
}
},
removeObject: function(g) {
return this.storage.removeItem(g)
},
clear: function() {
return this.storage.clear()
}
});
return f
}());
c.extend(c.hm, {
Storage: a,
storage: a.getInstance()
})
}(jQuery, window));
(function(b, a, d) {
b.hm = b.hm || {};
if (!(b.hm.storage)) {
throw ("Cache plugin requires the Storage plugin")
}
var c = (function() {
function f() {
this.init.apply(this, arguments)
}
var e;
f.getInstance = function() {
if (e === d) {
e = new f()
}
return e
};
b.extend(f.prototype, {
init: function(h, g) {
this.key = h || "cache";
this.options = b.extend({
timeout: 300
}, g);
this.storage = new b.hm.Storage(this.options.storageType)
},
now: function() {
return (new Date()).getTime()
},
getItem: function() {
return this.storage.getItem(this.key + "#data")
},
setItem: function(g) {
this.touch();
return this.storage.setItem(this.key + "#data", g)
},
get: function() {
return this.storage.getObject(this.key + "#data")
},
set: function(g) {
if (typeof g === "string") {
return this.setItem(g)
}
this.touch();
return this.storage.setObject(this.key + "#data", g)
},
remove: function() {
this.storage.removeItem(this.key + "#data");
this.storage.removeItem(this.key + "#expires")
},
touch: function() {
this.storage.setItem(this.key + "#expires", this.now() + this.options.timeout * 1000)
},
purge: function() {
this.options.purge = true
},
expiry: function() {
return Number(this.storage.getItem(this.key + "#expires")) || this.now() - 1
},
ttl: function() {
return this.expiry() - this.now()
},
isExpired: function() {
return !!(this.ttl() <= 0 || this.options.purge)
}
});
return f
}());
b.extend(b.hm, {
Cache: c,
cache: c.getInstance()
})
}(jQuery, window));
! function(e, t, a) {
var n = function() {
function n() {
this.init.apply(this, arguments)
}
return e.extend(n.prototype, {
init: function(a, n) {
var r = this;
r.$element = e(a);
r.options = e.extend({
cache: !0,
cacheStorageType: "sessionStorage",
cacheTimeout: 3600,
prefixClass: "widget",
prefixData: "widget",
updateClass: "updating"
}, n || {}), r.options.tag = r.options.prefixData + ("" + Math.random()).replace(/\D/g, ""), r.fragments = {}, r.options.cache && r.options.cacheStorageType && t[r.options.cacheStorageType] && setTimeout(function() {
r._cleanupCache()
}, 2e3)
},
on: function(a, n) {
var r = this;
return "popstate" == a && "function" == typeof n ? e(t).on(a, function(e) {
var t = e.originalEvent.state;
null !== t && t._tag == r.options.tag && n.call(this, e, t)
}) : r.$element.on(a, n)
},
trigger: function(e) {
this.$element.trigger(e)
},
pushState: function(e, n, r, o) {
var i = o ? "replaceState" : "pushState";
"object" == typeof e && t.history[i] && (e._tag = this.options.tag, r !== a ? t.history[i](e, n || "", r) : t.history[i](e, n || ""))
},
replaceState: function(e, t, a) {
this.pushState(e, t, a, !0)
},
getData: function() {
var t = this,
n = t.$element,
r = t.options.prefixData,
o = n.data(r ? r + "-param" : "param") || {},
i = r ? new RegExp("^" + r + "([A-Z])") : a;
return e.each(n.data(), function(e, t) {
e != (r ? r + "Param" : "param") && (i && i.test(e) ? (e = e.replace(i, r + "_$1").toLowerCase(), o[e] = t) : r || (o[e] = t))
}), o
},
createFragment: function(t) {
var a = this,
n = a.$element,
r = a.options.prefixClass ? a.options.prefixClass + "-" + t : t,
o = n.find("." + r);
return o = o[0] ? o.first() : e("<div>", {
"class": r
}).appendTo(n), a.fragments[t] = o, o
},
getFragment: function(e) {
return this.fragments[e]
},
_createCache: function(t) {
var a, n = this;
return n.options.cache && e.hm.Cache && (a = new e.hm.Cache(n.options.prefixData + "-cache-" + t, {
storageType: n.options.cacheStorageType,
timeout: n.options.cacheTimeout
}), a.storage.type != n.options.cacheStorageType && (a = !1)), a
},
_cleanupCache: function() {
var e, a = t[this.options.cacheStorageType],
n = new RegExp("^(" + this.options.prefixData + "-cache-[-\\d]+)#expires$"),
r = (new Date).getTime(),
o = [];
for (e = 0; e < a.length; e++) {
var i = a.key(e);
if (n.test(i) && Number(a.getItem(i)) < r) {
var s = i.replace(n, "$1");
o.push(s)
}
}
for (e = 0; e < o.length; e++) a.removeItem(o[e] + "#data"), a.removeItem(o[e] + "#expires")
},
updateFragment: function(t, a, n) {
var r = this,
o = e.Deferred(),
i = r.getFragment(t),
s = r.options.updateClass,
p = n || {},
c = r.generateHash({
handler: a,
param: p
}),
h = r._createCache(c);
return i ? (s && i.addClass(s), o.done(function(e, t) {
e.html(t), s && e.removeClass(s)
}), h && !h.isExpired() ? o.resolve(i, h.getItem()) : e.ajax({
url: a,
method: "GET",
dataType: "json",
crossDomain: !0,
xhrFields: {
withCredentials: !0
},
data: p
}).done(function(t) {
var a;
return t && (a = t.response ? t.response.html : t.html), a ? (h && h.setItem(a), void o.resolve(i, a)) : void e.error("No response from " + this.url)
}), o.promise()) : void e.error("Fragment does not exist: ", t)
},
toQueryParams: function(e) {
e = e.replace(/^\s+/, "").replace(/\s+$/, "");
var t = e.match(/([^?#]*)(#.*)?$/);
if (!t) return {};
for (var n = t[1].split("&"), r = {}, o = 0; o < n.length; ++o) {
var i = n[o].split("="),
s = decodeURIComponent(i.shift()),
p = i.length > 1 ? i.join("=") : i[0];
p !== a && (p = decodeURIComponent(p.replace(/\+/g, " "))), s in r ? (jQuery.isArray(r[s]) || (r[s] = [r[s]]), r[s].push(p)) : r[s] = p
}
return r
},
generateHash: function(e) {
var t = function(e) {
var t, a = 5381;
for (i = 0; i < e.length; i++) t = e.charCodeAt(i), a = (a << 5) + a + t;
return a
},
a = [];
for (var n in e) {
var r = e[n];
"object" == typeof r && (r = this.generateHash(e[n])), a.push(n + r + n.length + ("string" == typeof r ? r.length : 0))
}
return a.sort(), t(a.join("|"))
}
}), n
}();
e.hm = e.hm || {}, e.extend(e.hm, {
Widget: n
})
}(jQuery, window);
! function(e, t, n) {
"use strict";
if (e.ha === n) {
e.booking = e.booking || {};
var i = function() {
function i() {
return this.init.apply(this, arguments)
}
return e.extend(i.prototype, {
init: function(n, i) {
var o = this,
a = t.location.search.split("?")[1],
r = t.location.href.split("#?")[1],
c = e.Deferred(),
d = ["information", "datepicker", "levels", "map", "offers", "pbo", "periods", "quicksearch", "search", "receipt", "reservation", "mybooking", "survey"],
l = function(t) {
return e.each(t, function(e) {
var n = e; - 1 !== e.indexOf("_") && (e = e.replace(/(_[a-z]+)/g, function(e) {
return e.charAt(1).toUpperCase().toUpperCase() + e.slice(2)
})), delete t[n], "bookingCriteria" == e ? t[e] = this.split(",") : t[e] = String(this)
}), t
};
c.promise(o);
var s = e(n);
o.widget = new e.hm.Widget(s, e.extend({
cache: !0,
cacheStorageType: "sessionStorage",
prefixClass: "booking-widget",
prefixData: "booking",
updateClass: "updating",
handler: "https://api.holidayagent.nl",
trace: !1
}, i)), o.widget.name = "main", s.data(e.extend({
bookingReceipt: null,
bookingResort: null,
bookingToken: null,
bookingBooking: null,
bookingLevel: null,
bookingArrival: null,
bookingDeparture: null,
bookingDuration: null,
bookingPersons: {
adults: null,
young_adults: 0,
children: 0,
babys: 0
},
bookingCriteria: [],
bookingPets: 0,
bookingArrangement: null,
bookingDiscounts: [],
bookingPreferred: !1,
bookingExtend: 0,
bookingLng: "" !== e("html").prop("lang") ? e("html").prop("lang") : "nl",
bookingPage: 1,
bookingUid: Number((new Date).valueOf() + Math.round(1e3 * Math.random()))
}, s.data())), a && s.data(e.extend(s.data(), l(o.widget.toQueryParams(a)))), r && s.data(e.extend(s.data(), l(o.widget.toQueryParams(r)))), -1 === e.inArray(s.data("bookingLng"), ["nl", "en", "de", "fr"]) && s.data("bookingLng", "nl"), s.data("bookingAdults") && (o.params("persons.adults", s.data("bookingAdults")), s.removeData("bookingAdults")), s.data("bookingChildren") && (o.params("persons.children", s.data("bookingChildren")), s.removeData("bookingChildren")), e.datepicker && (e.datepicker.regional.en = e.datepicker.regional[""], e.datepicker.setDefaults(e.datepicker.regional[s.data("booking-lng")])), o.uid = s.data("booking-uid"), o.collection = {}, Boolean(s.data("booking-options-trace")) === !0 && (o.widget.options.trace = !0), o.widget.options.trace !== !1 && e.hm.libloader.requireJS("//" + t.location.host + "/js/booking.widget.debug.js").done(function() {
e.booking.trace.apply(o)
});
var g = o.widget.$element.find('[class*="booking-widget-"]').length,
u = 0;
return o.widget.$element.find('[class*="booking-widget-"]').each(function() {
var n = e(this).prop("class").match(/\s?booking-widget-[a-z-]+/);
if (n) {
var i = e(this),
a = e.trim(n[0].replace("booking-widget-", ""));
if (-1 === e.inArray(a, d)) return g--, !0;
"undefined" == typeof o.collection[a] && (o.collection[a] = [], o.on("booking:" + a + ":done", function() {
u++, u === g && c.resolve(o)
}));
var r = function() {
o.collection[a].push(e.booking[a].apply(o, [i])), o.on("booking:" + a + ":ready", function() {
o.collection[a][o.collection[a].length - 1].ready = !0
}), o.trigger("booking:" + a + ":done")
},
l = function() {
g--, u === g && c.resolve(o)
};
o.widget.options.trace !== !1 ? "file:" == document.location.protocol ? e.hm.libloader.requireJS(o.widget.options.handler + "/js/ha/booking/widget/" + a + ".js").done(r).fail(l) : e.hm.libloader.requireJS("//" + t.location.host + "/js/ha/booking/widget/" + a + ".js").done(r).fail(l) : e.hm.libloader.add("ha.booking.widget." + a).done(r).fail(l)
}
}), o.done(function() {
var n = function() {
t.XDomainRequest && (o.widget.options.handler = o.widget.options.handler.replace(/^https?:/, "")), o.get("loader").length > 0 && e.each(o.get("loader"), function() {
this.$element.show()
}), o.widget.on("popstate", function(t, n) {
n = n || {}, n.widgets && "object" == typeof n.widgets && (e.each(o.collection, function(t, n) {
e.each(n, function() {
this.$element.hide()
})
}), e.each(n.widgets, function(t, n) {
o.widget.$element.data(e.extend(o.widget.$element.data(), n)), e.each(o.get(t), function(e, t) {
t.load(n)
})
}))
})
};
e.support && e.support.cors === !1 ? e.hm.libloader.add("compat.xdomainrequest").done(n) : n()
}), o
},
on: function(e, t) {
this.widget.on(e, t)
},
trigger: function() {
var e, t, n, i;
this.widget.$element.trigger("*", arguments), i = Array.prototype.slice.call(arguments), e = arguments[0].split(":"), e.length > 1 && (n = e.slice(2).join(":"), t = e[0] + ":" + e[1] + ":*", i.unshift(n), this.widget.$element.trigger(t, i), i.shift()), e = i.splice(0, 1)[0], this.widget.$element.trigger(e, i)
},
one: function() {
var e, t, n, i;
this.widget.$element.one("*", arguments), i = Array.prototype.slice.call(arguments), e = arguments[0].split(":"), e.length > 1 && (n = e.slice(2).join(":"), t = e[0] + ":" + e[1] + ":*", i.unshift(n), this.widget.$element.one(t, i), i.shift()), e = i.splice(0, 1)[0], this.widget.$element.one(e, i)
},
extend: function(t) {
e.extend(this, t)
},
get: function(t, n) {
if ("undefined" != typeof this.collection[t]) {
if ("undefined" != typeof n) {
if (e.isNumeric(n)) return "first" === n ? n = 0 : "last" === n && (n = this.collection[t].length - 1), "undefined" == typeof this.collection[t][n] ? void e.error("Widget " + t + " with index " + n + " not available on collection") : this.collection[t][n];
if (e.isPlainObject(n)) {
var i = [],
o = n;
return e.each(this.collection[t], function(t, n) {
i.push(n), e.each(o, function(e, t) {
return "undefined" == typeof n.$element.data(e) || n.$element.data(e) !== o[e] ? void i.pop() : void 0
})
}), i
}
}
return this.collection[t]
}
return []
},
add: function(t, i, o) {
var a = this;
if (t !== n) {
t = t.toLowerCase();
var r = function() {
var n = a.widget.createFragment(t);
o && a.widget.$element.find(o).length > 0 && n.appendTo(e(o));
var i = e.booking[t].apply(a, [n]);
"undefined" == typeof a.collection[t] && (a.collection[t] = []), a.collection[t].push(i), i.init(i.$element.data())
};
a.widget.options.trace !== !1 ? e.hm.libloader.requireJS(a.widget.options.handler + "/js/ha/booking/widget/" + t + ".js").done(r) : e.hm.libloader.add("ha.booking.widget." + t).done(r)
}
},
params: function(t, i) {
var o, a = this;
if ("undefined" != typeof t) {
if ("string" === e.type(t)) {
if (0 !== t.indexOf("booking") && (t = "booking-" + t.toLowerCase()), -1 !== t.indexOf(".")) {
if ("undefined" != typeof i) {
var r = t.split("."),
c = r.length - 1,
d = r[0].split("-");
r[0] = d[0] + d[1].charAt(0).toUpperCase() + d[1].slice(1), o = a.widget.$element.data();
for (var l = 0; c > l; l++) o = o[r[l]];
return o[r[c]] = i, a.widget.$element.data(o)
}
return t = t.split("."), o = a.widget.$element.data(t.splice(0, 1)[0]), o && e.each(t, function(e, t) {
o = "undefined" != typeof o[t] ? o[t] : n
}), o
}
return "undefined" != typeof i ? a.widget.$element.data(t, i) : a.widget.$element.data(t)
}
return o = {}, e.each(t, function() {
o[String(this)] = a.widget.$element.data(String(this))
}), o
}
return a.widget.$element.data()
},
module: function(t, n, i) {
var o = this;
if ("function" !== e.type(n) && (n = function() {}), "undefined" != typeof e.booking.modules[t]) return void n();
var a = function() {
return "function" !== e.type(e.booking.modules[t]) ? void console.warn("Module '" + t + "' can not be initialized, casted as invalid type") : void n()
};
o.widget.options.trace !== !1 ? e.hm.libloader.requireJS(o.widget.options.handler + "/js/ha/booking/modules/" + t + ".js").done(a) : e.hm.libloader.add("ha.booking.modules." + t).done(a)
},
history: function(e, t) {
if ("file:" != document.location.protocol) {
var n = this;
e = (e || "replace") + "State", "object" != typeof t && (t = {}), n.widget[e]({
widgets: t
}, null, document.URL)
}
},
track: function(n, i) {
"event" == n ? this.trigger("booking:track:event", i) : "location" == n ? this.trigger("booking:track:navigation", i) : "ecommerce" == n && this.trigger("booking:track:ecommerce", i), "no" != this.widget.$element.data("booking-google-tracking") && (t.ga && e.booking.ga(n, i), t._gaq && e.booking.gaq(n, i))
},
run: function() {
e.each(this.collection, function() {
e.each(this, function() {
this.init(this.$element.data())
})
})
}
}), i
}();
e.extend(e.booking, {
setup: function(e, t) {
var n = this;
t = t || {};
var o = new i(e, t);
return n.collection[o.uid] = o, o
},
uids: function() {
var t = [];
return e.each(this.collection, function(e) {
t.push(e)
}), t
},
extend: function(t) {
e.extend(this, t)
},
widget: function(t, n, i, o) {
var a = new e.hm.Widget(t, e.extend({
cache: o && o.widget.options.trace === !0 ? !1 : !0,
cacheStorageType: "sessionStorage",
prefixClass: "booking-widget-" + n,
prefixData: "booking"
}, i));
return a.name = n, a.ready = !1, a
},
module: function(t) {
var n = this,
i = Array.prototype.slice.call(arguments);
return i.shift(), e.booking.modules[t].apply(n, i)
},
trace: function(n) {
var i = this;
if ("undefined" == typeof t.trace) {
var o = i.collection[i.uids().slice(0, 1)[0]];
n = n || "*", e.hm.libloader.requireJS("//" + t.location.host + "/js/booking.widget.debug.js").done(function() {
e.booking.trace.apply(o, [n])
})
}
},
collection: {},
modules: {},
vars: {}
}), e.booking.modules.extend = function(t) {
e.extend(this, t)
}, e.extend(e.booking, {
methods: {
widget: function(t) {
var n;
return e.each(this, function() {
e(this).data("booking-uid") === t && (n = e(this))
}), n
},
addPart: function(t, n, i, o) {
return e.booking.methods.addWidget(t, n, i)
},
getData: function(t, n, i) {
var o = {};
n || (n = ""), i = i || e.booking.uids().slice(0, 1)[0], "undefined" == typeof e.booking.collection[i] && e.error("Widget with uid " + i + " not defined on collection");
var a = e.booking.collection[i];
if ("undefined" == typeof t || null === t) o = a.params(["bookingUid", "bookingResort", "bookingLevel", "bookingArrival", "bookingDeparture", "bookingDuration", "bookingLng", "bookingCriteria", "bookingPersons", "bookingPets"]), e.each(o, function(e, t) {
var i = n + e.replace("booking", "").toLowerCase();
"criteria" == i && t && (t = t.join(",")), delete o[e], o[i] = t
});
else if (a.get(t).length > 0) {
var r = a.get(t);
e.each(r, function(t, i) {
"undefined" != typeof i.getData && (o = e.extend(o, i.getData(n)))
})
}
return o
},
parseURI: function(t, n) {
var i = document.createElement("a"),
o = "";
return i.href = t, o = i.protocol && ":" != i.protocol ? i.protocol : document.location.protocol, (i.hostname || document.location.hostname) && (o += "//" + (i.hostname || document.location.hostname)), i.pathname && (o += i.pathname.match("^/") ? i.pathname : "/" + i.pathname), o += i.search ? i.search + "&" + e.param(n) : "?" + e.param(n), i.hash && (o += i.hash), o
},
checkCriteria: function(t, n) {
var i = !0;
return n = n.sort(function(e, t) {
return e = e.split("|"), t = t.split("|"), Number(e[0]) - Number(t[0])
}).join(","), "" !== t && (n.length > 0 && (i = !1), e.each(t.split(","), function() {
var t = 0,
o = String(this).split("|");
return n.length > 0 && String(this).split("|").length >= n.split(",").length && (e.each(String(n).split(","), function() {
e.each(String(this).split("|"), function() {
-1 !== e.inArray(String(this), o) && t++
})
}), t === n.split(",").length) ? void(i = !0) : void 0
})), i
}
}
});
var o = {
booking: function(t) {
var i = this,
o = {},
a = 0,
r = e.Deferred();
if ("string" == typeof t) {
var c = Array.prototype.slice.call(arguments);
return c = c.slice(1), "function" == typeof i[t] ? i[t].apply(i, c) : !1
}
return "file:" == document.location.protocol ? e.hm.libloader.requireCSS("http://lib.hmcms.nl/css/jquery/ui/datepicker.min.1.css") : e.hm.libloader.requireCSS("//lib.hmcms.nl/css/jquery/ui/datepicker.min.1.css"), r.promise(o), o.done(function() {
e.each(e.booking.methods, function(t) {
i[t] === n && (i[t] = function() {
return e.booking.methods[t].apply(i, arguments)
})
}), i.each(function() {
e.booking.collection[e(this).data("booking-uid")].run()
}), e.each(e.booking.uids(), function() {
i[String(this)] = {}
}), i.trigger("booking:widget:init"), i.trigger("booking:widget:ready"), "object" == typeof e.datepicker && "function" == typeof e.datepicker._updateDatepicker && e.hm.libloader.requireJS("https://lib.hmcms.nl/js/2/ha/booking/addons/jquery.ui.datepicker.monthyearpicker.min.js")
}), i.each(function() {
if (e.data(this, "booking-uid") === n) {
var c = e.booking.setup(this, t);
e.data(this, "booking-uid", c.uid), i[c.uid] = e(this), c.done(function() {
a++, a === i.length && r.resolve(o)
})
}
}), i
}
};
e.fn.extend(o), e.booking.extend({
ga: function(n, i) {
if (t.ga && "function" == typeof t.ga.getAll) {
var o = t.ga.getAll();
o.length > 0 && e.each(o, function() {
var e = this.get("name");
return "hmlib" == e ? !0 : void("event" == n && i.category && i.action ? t.ga(e + ".send", "event", i.category, i.action, i.label, i.value, {
nonInteraction: i.noninteraction
}) : "ecommerce" == n ? (t.ga(e + ".require", "ecommerce"), t.ga(e + ".ecommerce:addTransaction", {
id: i.reservation,
affiliation: i.resort,
revenue: i.amount,
tax: i.tax,
shipping: i.shipping
}), t.ga(e + ".ecommerce:addItem", {
id: i.reservation,
sku: i.oid,
name: i.object,
category: i.type,
price: i.amount,
quantity: i.quantity || 1
}), t.ga(e + ".ecommerce:send")) : i.location && t.ga(e + ".send", "pageview", i.location))
})
}
},
gaq: function(e, n) {
t._gaq && ("event" == e && n.category && n.action ? t._gaq.push(["_trackEvent", n.category, n.action, n.label, n.value, n.noninteraction]) : "ecommerce" == e ? (t._gaq.push(["_addTrans", n.reservation, n.resort, n.amount, n.tax, n.shipping, n.city, n.state, n.country]), t._gaq.push(["_addItem", n.reservation, n.oid, n.object, n.type, n.amount, n.quantity || 1]), t._gaq.push(["_trackTrans"])) : n.location && t._gaq.push(["_trackPageview", n.location]))
},
tipped: function(n) {
t.Tipped ? e.isFunction(n) && n() : e.hm.libloader.add("tipped4").done(function() {
"file:" == document.location.protocol ? e.hm.libloader.requireCSS("http://lib.hmcms.nl/js/2/tipped4/css/tipped.1.css") : e.hm.libloader.requireCSS("//lib.hmcms.nl/js/2/tipped4/css/tipped.1.css"), t.Tipped && e.isFunction(n) && n()
})
},
higslide: function(n) {
t.hs ? e.isFunction(n) && n() : e.hm.libloader.add("highslide").done(function() {
t.hs && e.isFunction(n) && n()
})
},
translate: function(e, t, n) {
return n = n || "en", "undefined" == typeof e[t] && (t = n), "undefined" != typeof e[t] ? e[t] : void 0
},
date: {
format: function(t, n, i) {
var o = ["nl", "en", "de", "fr"],
a = new Date;
return i = i || "dd-mm-yy", a = e.datepicker.formatDate(i, new Date), e.each(o, function() {
if (n == String(this)) try {
return a = e.datepicker.formatDate(i, e.datepicker.parseDate(e.datepicker.regional[String(this)].dateFormat, t)), !0
} catch (o) {}
}), a
},
parse: function(t) {
if ("string" != typeof t || 0 === t.length) return n;
var i = e.booking.date.format(t, "nl", "dd-mm-yy");
return i = i.split("-"), new Date(Number(i[2]), Number(i[1]) - 1, Number(i[0]), 0, 0, 0)
},
flatten: function(t) {
var n = [];
return "undefined" != typeof t[0] ? t : (e.each(t, function(t, i) {
e.each(i, function(e, t) {
n = n.concat(this)
})
}), n)
}
},
dp: {
arrival: function(t, n) {
var i, o = n.getFullYear(),
a = n.getMonth() + 1,
r = n.getDate(),
c = [o, a >= 10 ? a : "0" + a, r >= 10 ? r : "0" + r].join("");
return t = e.booking.date.flatten(t), e.each(t, function() {
return c === this.stamp ? (i = this, !1) : void 0
}), i
},
available: function(t, n) {
var i, o = n.getFullYear(),
a = n.getMonth() + 1,
r = n.getDate(),
c = [o, a >= 10 ? a : "0" + a, r >= 10 ? r : "0" + r].join("");
return t = e.booking.date.flatten(t), e.each(t, function() {
return c >= this.stamp && this.available && c <= this.available.stamp ? (i = this, !1) : void 0
}), i
},
departure: function(t, n) {
var i, o = n.getFullYear(),
a = n.getMonth() + 1,
r = n.getDate(),
c = [o, a >= 10 ? a : "0" + a, r >= 10 ? r : "0" + r].join("");
return e.each(t, function() {
return c == this.stamp ? (i = this, !1) : void 0
}), i
}
}
})
}
}(jQuery, window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment