(function (h) {
function m() {
var s = h();
if (
(h.each(k, function (o, t) {
var u = t.data.selector,
c = t.$element;
s = s.add(u ? c.find(u) : c);
}),
s.length)
) {
for (var p = 0; s.length > p; p++) {
if (s[p]) {
if (h.contains(l, s[p])) {
var d = h(s[p]),
e = d.data("inview"),
q = d[0].getBoundingClientRect(),
r = d.height() + 600,
n = d.width();
q.top >= 0 - r &&
q.left >= 0 - n &&
q.bottom <= (g.innerHeight || l.clientHeight) + (r - 600) &&
q.right <= (g.innerWidth || l.clientWidth) + n
? e || d.data("inview", !0).trigger("inview", [!0])
: e && d.data("inview", !1).trigger("inview", [!1]);
} else {
delete s[p];
}
}
}
}
}
var j,
k = {},
b = document,
g = window,
l = b.documentElement,
f = h.expando;
h.event.special.inview = {
add: function (c) {
(k[c.guid + "-" + this[f]] = { data: c, $element: h(this) }),
j || h.isEmptyObject(k) || (j = setInterval(m, 333));
},
remove: function (d) {
try {
delete k[d.guid + "-" + this[f]];
} catch (c) {}
h.isEmptyObject(k) && (clearInterval(j), (j = null));
},
};
})(jQuery);
var pageUrl = location.href;
var hostName = location.hostname;
function setPrinterText() {
$(".page-url").text(pageUrl);
}
if ($("#floatingDesktopISI #isiCopy").length) {
$("#isiCopyMobile").bind("inview", function (a, b) {
if (b) {
$("#floatingDesktopISI #isiCopy").fadeOut();
} else {
$("#floatingDesktopISI #isiCopy").fadeIn();
}
});
}
$("#floatingDesktopISI #isiCopy h2").click(function () {
$("html, body")
.removeAttr("style")
.animate({ scrollTop: $("#isiCopyMobile").offset().top }, 2000);
$("#floatingDesktopISI #isiCopy").fadeOut();
});
$(window).scroll(function () {
var b = $(window).scrollTop();
var a = $(window).height();
});
function toggleISI(a) {
$(".isi-main-copy-mobile").toggle();
$(".isi-main-copy").toggle();
if ($("#isiCopy").attr("style")) {
$("#isiCopy").height("");
$(".isi-main-copy").height("");
} else {
$("#isiCopy").height(window.innerHeight - 40);
$(".isi-main-copy").height(window.innerHeight - 85);
}
$(a).toggleClass("glyphicon-plus");
$(a).toggleClass("glyphicon-minus");
}
$(".glyphicon-minus").click(function () {
$("#isiCopy").removeAttr("style");
});
function createCookie(b, c) {
var a = "";
document.cookie = b + "=" + c + "; " + a + "; path=/";
}
function readCookie(e) {
var f = e + "=";
var b = document.cookie.split(";");
for (var d = 0; d < b.length; d++) {
var a = b[d];
while (a.charAt(0) == " ") {
a = a.substring(1, a.length);
}
if (a.indexOf(f) == 0) {
return a.substring(f.length, a.length);
}
}
return null;
}
function eraseCookie(a) {
createCookie(a, "", -1);
}
function setFont(a) {
var b;
$(".font-selector span").each(function () {
$(this).removeClass("selected");
});
$(a).addClass("selected");
if (a.hasClass("font-med")) {
$(
"body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div"
).css({ "font-size": "18px" });
b = "18px";
} else {
if (a.hasClass("font-lg")) {
$(
"body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div"
).css({ "font-size": "21px" });
b = "21px";
} else {
$(
"body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div"
).css({ "font-size": "14px" });
b = "14px";
}
}
createCookie("font_size", b);
createCookie("ISI_font_size", b);
}
function populateAnchorTag(e, f, d, b, c, a) {
var g = !!JSON.parse(e.toLowerCase()) ? "_blank" : "_self";
if (!!JSON.parse(d.toLowerCase())) {
jQuery("div.imgDiv").wrap(
''
);
}
if (!!JSON.parse(b.toLowerCase())) {
jQuery("div.textimagebox").wrap(
''
);
}
if (!!JSON.parse(c.toLowerCase())) {
jQuery("div.textHeading").wrap(
''
);
}
if (!!JSON.parse(a.toLowerCase())) {
jQuery("div.buttonText").wrap(
''
);
}
}
function SetBrandName(a) {
if (a != "" && a != undefined) {
hostName = a + ".com";
}
}
function SearchFocus(a) {
a.removeAttr("placeholder");
if (a.val() != "") {
a.val("");
}
}
function SearchBlur(a) {
a.attr("placeholder", "Search");
if (Modernizr.input.placeholder) {
} else {
if (a.val() == "" || a.val() == "Search") {
a.val("Search");
}
}
}
function SetSearchText() {
$(
"#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveoMobileSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox"
).blur();
if (Modernizr.input.placeholder) {
} else {
$(
"#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox"
).val("Search");
}
}
var pfHeaderImgUrl = "";
var pfHeaderTagline = "";
var pfdisableClickToDel = 1;
var pfHideImages = 0;
var pfImageDisplayStyle = "none";
var pfDisablePDF = 0;
var pfDisableEmail = 1;
var pfDisablePrint = 1;
var pfCustomCSS =
"http://" +
hostName +
"/areas/globalcomponents/css/brands/" +
hostName +
"/print.css";
var pfBtVersion = "1";
function printFriendly(a) {
$("script[src='http://cdn.printfriendly.com/printfriendly.js']").remove();
if (a == "noPrint") {
pfDisablePrint = 1;
} else {
pfDisablePrint = 0;
}
$.getScript("http://cdn.printfriendly.com/printfriendly.js", function () {
window.print();
});
}
$(document).ready(function () {
processCoachUrls();
$(".print-btn").click(function () {
window.print();
});
setPrinterText();
SetSearchText();
$(
"#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveoMobileSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox"
).focus(function () {
var e = $(this);
SearchFocus(e);
});
$(
"#EMSCoveoDesktopSearchBox .CoveoQueryBox, #EMSCoveoMobileSearchBox .CoveoQueryBox, #EMSCoveo404Search .CoveoQueryBox"
).blur(function () {
var e = $(this);
SearchBlur(e);
});
if ($("#brandName") != undefined) {
SetBrandName($("#brandName").val());
}
$(".nav-tabs .dropdown-menu").hover(
function () {
$(this).prev().toggleClass("active-submenu");
},
function () {
$(this).prev().toggleClass("active-submenu");
}
);
$(".isi-button .glyphicon").click(function () {
toggleISI($(this));
});
$(".font-selector span").click(function () {
setFont($(this));
});
if (readCookie("font_size") == "14px") {
$(
"body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div"
).css({ "font-size": "14px" });
$(".font-selector span").each(function () {
$(this).removeClass("selected");
});
$(".font-selector span:eq(0)").addClass("selected");
} else {
if (readCookie("font_size") == "18px") {
$(
"body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div"
).css({ "font-size": "18px" });
$(".font-selector span").each(function () {
$(this).removeClass("selected");
});
$(".font-selector span:eq(1)").addClass("selected");
} else {
if (readCookie("font_size") == "21px") {
$(
"body .text-component, body .text-component p, body .text-component div, body .isi-main-copy, body .isi-main-copy p, body .isi-main-copy div"
).css({ "font-size": "21px" });
$(".font-selector span").each(function () {
$(this).removeClass("selected");
});
$(".font-selector span:eq(2)").addClass("selected");
}
}
}
$(".share-btn").click(function () {
if ($(this).hasClass("selected")) {
$(".share-show-hide").hide();
$(this).removeClass("selected");
} else {
$(".share-show-hide").show();
$(this).addClass("selected");
}
return false;
});
$(".share-show-hide li").click(function () {
$(".share-show-hide").hide();
$(".share-btn").removeClass("selected");
});
$(".share-show-hide .social-pop-up").click(function () {
var f = $(this).attr("product-name");
var e = $(this).attr("brand-name");
var h = $(this).attr("website-name");
var g = $(this).attr("url-path");
$("#myModal .product-name").text(f);
$("#myModal .brand-name").text(e);
$("#myModal .website-name").text(h);
$("#myModal .goToSite").attr("website-path", g);
});
$(".goToSite").click(function () {
var e = $(this).attr("website-path");
window.open(e);
});
if ($("#hdnHCPLinks").length) {
lstHCPLinks = $("#hdnHCPLinks")
.val()
.replace(/http:\/\//g, "")
.replace(/https:\/\//g, "")
.replace(/www./g, "")
.replace(/\\/g, "/");
var b = [];
if (lstHCPLinks.length > 0) {
b = lstHCPLinks.split(",");
for (i = 0; i < b.length; i++) {
if (b[i].slice(-1) == "/") {
b[i] = b[i].slice(0, -1);
}
b[i] = b[i].toLowerCase();
}
}
}
if ($("#hdnExternalLinks").length) {
lstExternalLinks = $("#hdnExternalLinks")
.val()
.replace(/http:\/\//g, "")
.replace(/https:\/\//g, "")
.replace(/www./g, "");
var a = [];
if (lstExternalLinks.length > 0) {
a = lstExternalLinks.split(",");
for (i = 0; i < a.length; i++) {
a[i] = $.trim(a[i]);
if (a[i].slice(-1) == "/") {
a[i] = a[i].slice(0, -1);
}
a[i] = a[i].toLowerCase();
}
}
}
if ($("#hdnRegionLinks").length) {
lstRegionLinks = $("#hdnRegionLinks")
.val()
.replace(/http:\/\//g, "")
.replace(/https:\/\//g, "")
.replace(/www./g, "")
.replace(/\\/g, "/");
var c = [];
if (lstRegionLinks.length > 0) {
c = lstRegionLinks.split(",");
for (i = 0; i < c.length; i++) {
if (c[i].slice(-1) == "/") {
c[i] = c[i].slice(0, -1);
}
c[i] = c[i].toLowerCase();
}
}
}
if ($("#hdnUnbrandedLinks").length) {
lstUnbrandedLinks = $("#hdnUnbrandedLinks")
.val()
.replace(/http:\/\//g, "")
.replace(/https:\/\//g, "")
.replace(/www./g, "")
.replace(/\\/g, "/");
var d = [];
if (lstUnbrandedLinks.length > 0) {
d = lstUnbrandedLinks.split(",");
for (i = 0; i < d.length; i++) {
if (d[i].slice(-1) == "/") {
d[i] = d[i].slice(0, -1);
}
d[i] = d[i].toLowerCase();
}
}
}
if ($(".panel-group")) {
$(".panel-group div:first-child div.panel-heading h4 a").trigger("click");
}
$("a").each(function () {
if (b != undefined) {
if (typeof $(this).attr("href") != "undefined") {
if (
$(this).attr("href").indexOf("http") == 0 ||
$(this).attr("href").indexOf("www") == 0
) {
var e = $.trim($(this).attr("href"));
e = $.trim(
$(this)
.attr("href")
.replace(/http:\/\//g, "")
.replace(/https:\/\//g, "")
)
.replace(/www./g, "")
.replace(/\\/g, "/");
if (e.slice(-1) == "/") {
e = e.slice(0, -1);
}
e = e.toLowerCase();
var g = false;
if (hostName == "") {
hostName = location.hostname;
}
if (e.length > 1) {
var f = [];
f = e.split("/");
for (i = 0; i < b.length; i++) {
if (e.toLowerCase() === b[i].toLowerCase()) {
g = true;
$(this).addClass("lnkHCP");
$(this).attr("brand-name", hostName);
$(this).attr("website-name", f[0]);
$(this).attr("data-toggle", "modal");
$(this).attr("data-target", "#hcpMod");
break;
}
}
if (!g) {
for (i = 0; i < a.length; i++) {
if (f[0].toLowerCase() === a[i].toLowerCase()) {
g = true;
$(this).addClass("lnkExternal");
$(this).attr("brand-name", hostName);
$(this).attr("website-name", f[0]);
$(this).attr("data-toggle", "modal");
$(this).attr("data-target", "#thirdPartyMod");
break;
}
}
}
if (!g) {
for (i = 0; i < c.length; i++) {
if (e.toLowerCase() === c[i].toLowerCase()) {
g = true;
$(this).addClass("lnkRegion");
$(this).attr("brand-name", hostName);
$(this).attr("website-name", f[0]);
$(this).attr("data-toggle", "modal");
$(this).attr("data-target", "#regionMod");
break;
}
}
}
if (!g) {
for (i = 0; i < d.length; i++) {
if (e.toLowerCase() === d[i].toLowerCase()) {
g = true;
$(this).addClass("lnkUnbranded");
$(this).attr("brand-name", hostName);
$(this).attr("website-name", f[0]);
$(this).attr("data-toggle", "modal");
$(this).attr("data-target", "#unbrandedMod");
break;
}
}
}
}
}
}
}
});
$(".lnkHCP,.lnkExternal,.lnkRegion, .lnkUnbranded").each(function () {
$(this).on("click", function (g) {
g.preventDefault();
var f = $(this).attr("brand-name");
var h = $(this).attr("href");
if ($(this).attr("data-targethost") != undefined) {
var j = $(this).attr("data-targethost");
} else {
var j = $(this).attr("website-name");
}
if ($(this).attr("class").indexOf("lnkHCP") > -1) {
$("#hcpMod .brand-name").text(f);
$("#hcpMod .website-name").text(j);
$("#hcpMod .websiteBtn").attr("website-path", h);
} else {
if ($(this).attr("class").indexOf("lnkExternal") > -1) {
$("#thirdPartyMod .brand-name").text(f);
$("#thirdPartyMod .website-name").text(j);
$("#thirdPartyMod .websiteBtn").attr("website-path", h);
} else {
if ($(this).attr("class").indexOf("lnkRegion") > -1) {
$("#regionMod .brand-name").text(f);
$("#regionMod .website-name").text(j);
$("#regionMod .websiteBtn").attr("website-path", h);
} else {
if ($(this).attr("class").indexOf("lnkUnbranded") > -1) {
$("#unbrandedMod .brand-name").text(f);
$("#unbrandedMod .website-name").text(j);
$("#unbrandedMod .websiteBtn").attr("website-path", h);
}
}
}
}
});
});
$(".websiteBtn").each(function () {
$(this).on("click", function (f) {
var g = $(this).attr("website-path");
$(this).attr("data-dismiss", "modal");
window.open(g);
});
});
$.ajaxPrefilter(function (e) {
var f = $("#RequestTokenID").val();
if (!e.beforeSend) {
e.beforeSend = function (g) {
g.setRequestHeader("RequestVerificationToken", f);
};
}
});
if (
$("#enablePrintCanvas")[0] != null &&
$("#enablePrintCanvas")[0] != undefined
) {
$(".print-btn").unbind("click");
$(".print-btn").click(function () {
$.getScript(
"/areas/globalcomponents/js/global/vendor/html2canvas.min.js",
function () {
html2canvas($("body"), {
onrendered: function (e) {
var f = e.toDataURL("image/png");
var g = window.open(f, "_self");
g.document.write('');
g.print();
g.location.reload();
},
});
}
);
});
}
});
function processCoachUrls() {
var b = location.hostname + ".utmz";
if (readCookie(b) != null) {
$('a[href*="coach.toujeo.com"]').each(function () {
var j = $(this).attr("href");
j += (j.match(/\?/) ? "&" : "?") + readCookie(b);
$(this).attr("href", j);
});
} else {
var c = "";
var h = getParameterByName("utm_campaign");
var d = getParameterByName("utm_medium");
var a = getParameterByName("utm_content");
var f = getParameterByName("utm_source");
var g = getParameterByName("utm_term");
var e = getParameterByName("moc");
if ($.trim(h) != "") {
c += "utm_campaign=" + h + "&";
}
if ($.trim(d) != "") {
c += "utm_medium=" + d + "&";
}
if ($.trim(a) != "") {
c += "utm_content=" + a + "&";
}
if ($.trim(f) != "") {
c += "utm_source=" + f + "&";
}
if ($.trim(g) != "") {
c += "utm_term=" + g + "&";
if ($.trim(e) != "") {
c += "moc=" + e + "&";
} else {
if ($.trim(g).split("_").length > 1) {
c += "moc=" + $.trim(g).split("_")[1] + "&";
}
}
}
if ($.trim(c) != "") {
createCookie(b, c.substring(0, c.length - 1));
$('a[href*="coach.toujeo.com"]').each(function () {
var j = $(this).attr("href");
j += (j.match(/\?/) ? "&" : "?") + readCookie(b);
$(this).attr("href", j);
});
}
}
}
function getParameterByName(a) {
a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var b = new RegExp("[\\?&]" + a + "=([^]*)"),
c = b.exec(location.search);
return c === null ? "" : decodeURIComponent(c[1].replace(/\+/g, " "));
}
function LoadDTSearchResults() {
$(".CoveoSearchBox").addClass("coveo-executing-query");
if ($("#brandSearchDT #searchtextbox").val().length > 0) {
window.location.href =
window.location.protocol +
"//" +
window.location.hostname +
$("#hdnSearchPageUrl").val() +
"#q=" +
$("#brandSearchDT #searchtextbox").val();
} else {
window.location.href =
window.location.protocol +
"//" +
window.location.hostname +
$("#hdnSearchPageUrl").val() +
"#";
}
$(".CoveoSearchBox").removeClass("coveo-executing-query");
}
function LoadMBSearchResults() {
$(".CoveoSearchBox").addClass("coveo-executing-query");
if ($("#brandSearchMB #searchtextbox").val().length > 0) {
window.location.href =
window.location.protocol +
"//" +
window.location.hostname +
$("#hdnSearchPageUrl").val() +
"#q=" +
$("#brandSearchMB #searchtextbox").val();
} else {
window.location.href =
window.location.protocol +
"//" +
window.location.hostname +
$("#hdnSearchPageUrl").val() +
"#";
}
$(".CoveoSearchBox").removeClass("coveo-executing-query");
}
$("#brandSearchDT #searchbutton").click(function () {
LoadDTSearchResults();
});
$("#brandSearchMB #searchbutton").click(function () {
LoadMBSearchResults();
});
$("#brandSearchDT #searchtextbox").keypress(function (a) {
if (a.keyCode == 13) {
LoadDTSearchResults();
}
});
$("#brandSearchMB #searchtextbox").keypress(function (a) {
if (a.keyCode == 13) {
LoadMBSearchResults();
}
});
$("#brandSearchDT #searchtextbox").keyup(function () {
if ($("#brandSearchDT #searchtextbox").val().length > 0) {
$(".coveo-query-box-clear").css("display", "block");
} else {
$(".coveo-query-box-clear").css("display", "none");
}
});
$("#brandSearchMB #searchtextbox").keyup(function () {
if ($("#brandSearchMB #searchtextbox").val().length > 0) {
$(".coveo-query-box-clear").css("display", "block");
} else {
$(".coveo-query-box-clear").css("display", "none");
}
});
$(".coveo-query-box-clear").click(function () {
$("#brandSearchDT #searchtextbox").val("");
$("#brandSearchMB #searchtextbox").val("");
$(".coveo-query-box-clear").css("display", "none");
});
(function (a) {
window.cookiePolicy = (function () {
!(function (f, h) {
var g = function () {
return g.get.apply(g, arguments);
};
(g.utils = utils = {
isArray:
Array.isArray ||
function (j) {
return Object.prototype.toString.call(j) === "[object Array]";
},
isPlainObject: function (j) {
return !!j && Object.prototype.toString.call(j) === "[object Object]";
},
toArray: function (j) {
return Array.prototype.slice.call(j);
},
getKeys:
Object.keys ||
function (j) {
var l = [],
k = "";
for (k in j) {
j.hasOwnProperty(k) && l.push(k);
}
return l;
},
escape: function (j) {
return String(j).replace(/[,;"\\=\s%]/g, function (k) {
return encodeURIComponent(k);
});
},
retrieve: function (j, k) {
return j == null ? k : j;
},
}),
(g.defaults = {}),
(g.expiresMultiplier = 86400),
(g.set = function (q, v, m) {
if (utils.isPlainObject(q)) {
for (var w in q) {
q.hasOwnProperty(w) && this.set(w, q[w], v);
}
} else {
m = utils.isPlainObject(m) ? m : { expires: m };
var t = m.expires !== h ? m.expires : this.defaults.expires || "",
x = typeof t;
x === "string" && t !== ""
? (t = new Date(t))
: x === "number" &&
(t = new Date(+new Date() + 1000 * this.expiresMultiplier * t)),
t !== "" &&
"toGMTString" in t &&
(t = ";expires=" + t.toGMTString());
var j = this.defaults.path;
j = ";path=/";
var k = m.domain || this.defaults.domain;
k = k ? ";domain=" + k : "";
var p = m.secure || this.defaults.secure ? ";secure" : "";
f.cookie = utils.escape(q) + "=" + utils.escape(v) + t + j + k + p;
}
return this;
}),
(g.remove = function (j) {
j = utils.isArray(j) ? j : utils.toArray(arguments);
for (var l = 0, k = j.length; l < k; l++) {
this.set(j[l], "", -1);
}
return this;
}),
(g.empty = function () {
return this.remove(utils.getKeys(this.all()));
}),
(g.get = function (j, l) {
l = l || h;
var p = this.all();
if (utils.isArray(j)) {
var k = {};
for (var q = 0, m = j.length; q < m; q++) {
var t = j[q];
k[t] = utils.retrieve(p[t], l);
}
return k;
}
return utils.retrieve(p[j], l);
}),
(g.all = function () {
if (f.cookie === "") {
return {};
}
var o = f.cookie.split("; "),
k = {};
for (var l = 0, j = o.length; l < j; l++) {
var m = o[l].split("=");
k[decodeURIComponent(m[0])] = decodeURIComponent(m[1]);
}
return k;
}),
(g.enabled = function () {
if (navigator.cookieEnabled) {
return !0;
}
var j = g.set("_", "_").get("_") === "_";
return g.remove("_"), j;
}),
typeof define == "function" && define.amd
? define(function () {
return g;
})
: typeof exports != "undefined"
? (exports.cookie = g)
: (window.cookie = g);
})(document);
function e() {
b();
a(".cookie-alert .cookie-close").on("click", function (f) {
f.preventDefault();
c();
});
}
function b() {
if (cookie.get("cookie-alert") !== "true") {
d();
}
}
function d() {
setTimeout(function () {
a(".cookie-alert").addClass("show");
}, 1000);
}
function c() {
a(".cookie-alert").removeClass("show");
cookie.set("cookie-alert", "true");
}
return { init: e, close: c };
})();
a(document).ready(function () {
cookiePolicy.init();
});
})(jQuery);
if (cookie.get("WhiteLBLCookie")) {
$("#divCookiclose").remove();
} else {
$("#divCookiclose").removeClass("hide-cookie");
$("#btnCookieClose").click(function () {
cookie.set("WhiteLBLCookie", "true", 180);
$("#divCookiclose").remove();
});
}
$(document).ready(function () {
$(".sub-child-list").each(function () {
if ($(this).children().length < 1) {
$(this).closest("li.hasChildren").removeClass("hasChildren");
}
});
$(".child-list").each(function () {
if ($(this).children().length < 1) {
$(this).closest("li.hasChildren").removeClass("hasChildren");
}
});
$(".lastItemParent").each(function () {
if ($(this).next("ul.sub-child-list").children().length < 1) {
var a = $(this).find("span.lastItem").text();
$(this).find("span.lastItem").parent().remove();
$(this).html(a);
}
});
});
/* jQuery Validation Plugin - v1.11.0 - 2/4/2013
* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */
(function (a) {
a.extend(a.fn, {
validate: function (c) {
if (!this.length) {
c &&
c.debug &&
window.console &&
console.warn("Nothing selected, can't validate, returning nothing.");
return;
}
var b = a.data(this[0], "validator");
return b
? b
: (this.attr("novalidate", "novalidate"),
(b = new a.validator(c, this[0])),
a.data(this[0], "validator", b),
b.settings.onsubmit &&
(this.validateDelegate(":submit", "click", function (d) {
b.settings.submitHandler && (b.submitButton = d.target),
a(d.target).hasClass("cancel") && (b.cancelSubmit = !0);
}),
this.submit(function (e) {
function d() {
var f;
return b.settings.submitHandler
? (b.submitButton &&
(f = a("")
.attr("name", b.submitButton.name)
.val(b.submitButton.value)
.appendTo(b.currentForm)),
b.settings.submitHandler.call(b, b.currentForm, e),
b.submitButton && f.remove(),
!1)
: !0;
}
return (
b.settings.debug && e.preventDefault(),
b.cancelSubmit
? ((b.cancelSubmit = !1), d())
: b.form()
? b.pendingRequest
? ((b.formSubmitted = !0), !1)
: d()
: (b.focusInvalid(), !1)
);
})),
b);
},
valid: function () {
if (a(this[0]).is("form")) {
return this.validate().form();
}
var c = !0,
b = a(this[0].form).validate();
return (
this.each(function () {
c &= b.element(this);
}),
c
);
},
removeAttrs: function (d) {
var b = {},
c = this;
return (
a.each(d.split(/\s/), function (f, g) {
(b[g] = c.attr(g)), c.removeAttr(g);
}),
b
);
},
rules: function (k, e) {
var h = this[0];
if (k) {
var d = a.data(h.form, "validator").settings,
j = d.rules,
g = a.validator.staticRules(h);
switch (k) {
case "add":
a.extend(g, a.validator.normalizeRule(e)),
(j[h.name] = g),
e.messages &&
(d.messages[h.name] = a.extend(d.messages[h.name], e.messages));
break;
case "remove":
if (!e) {
return delete j[h.name], g;
}
var l = {};
return (
a.each(e.split(/\s/), function (f, m) {
(l[m] = g[m]), delete g[m];
}),
l
);
}
}
var b = a.validator.normalizeRules(
a.extend(
{},
a.validator.classRules(h),
a.validator.attributeRules(h),
a.validator.dataRules(h),
a.validator.staticRules(h)
),
h
);
if (b.required) {
var c = b.required;
delete b.required, (b = a.extend({ required: c }, b));
}
return b;
},
}),
a.extend(a.expr[":"], {
blank: function (b) {
return !a.trim("" + b.value);
},
filled: function (b) {
return !!a.trim("" + b.value);
},
unchecked: function (b) {
return !b.checked;
},
}),
(a.validator = function (c, b) {
(this.settings = a.extend(!0, {}, a.validator.defaults, c)),
(this.currentForm = b),
this.init();
}),
(a.validator.format = function (c, b) {
return arguments.length === 1
? function () {
var d = a.makeArray(arguments);
return d.unshift(c), a.validator.format.apply(this, d);
}
: (arguments.length > 2 &&
b.constructor !== Array &&
(b = a.makeArray(arguments).slice(1)),
b.constructor !== Array && (b = [b]),
a.each(b, function (d, f) {
c = c.replace(new RegExp("\\{" + d + "\\}", "g"), function () {
return f;
});
}),
c);
}),
a.extend(a.validator, {
defaults: {
messages: {},
groups: {},
rules: {},
errorClass: "error",
validClass: "valid",
errorElement: "label",
focusInvalid: !0,
errorContainer: a([]),
errorLabelContainer: a([]),
onsubmit: !0,
ignore: ":hidden",
ignoreTitle: !1,
onfocusin: function (b, c) {
(this.lastActive = b),
this.settings.focusCleanup &&
!this.blockFocusCleanup &&
(this.settings.unhighlight &&
this.settings.unhighlight.call(
this,
b,
this.settings.errorClass,
this.settings.validClass
),
this.addWrapper(this.errorsFor(b)).hide());
},
onfocusout: function (b, c) {
!this.checkable(b) &&
(b.name in this.submitted || !this.optional(b)) &&
this.element(b);
},
onkeyup: function (b, c) {
if (c.which === 9 && this.elementValue(b) === "") {
return;
}
(b.name in this.submitted || b === this.lastElement) &&
this.element(b);
},
onclick: function (b, c) {
b.name in this.submitted
? this.element(b)
: b.parentNode.name in this.submitted && this.element(b.parentNode);
},
highlight: function (d, b, c) {
d.type === "radio"
? this.findByName(d.name).addClass(b).removeClass(c)
: a(d).addClass(b).removeClass(c);
},
unhighlight: function (d, b, c) {
d.type === "radio"
? this.findByName(d.name).removeClass(b).addClass(c)
: a(d).removeClass(b).addClass(c);
},
},
setDefaults: function (b) {
a.extend(a.validator.defaults, b);
},
messages: {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
maxlength: a.validator.format(
"Please enter no more than {0} characters."
),
minlength: a.validator.format("Please enter at least {0} characters."),
rangelength: a.validator.format(
"Please enter a value between {0} and {1} characters long."
),
range: a.validator.format("Please enter a value between {0} and {1}."),
max: a.validator.format(
"Please enter a value less than or equal to {0}."
),
min: a.validator.format(
"Please enter a value greater than or equal to {0}."
),
},
autoCreateRanges: !1,
prototype: {
init: function () {
function c(g) {
var e = a.data(this[0].form, "validator"),
f = "on" + g.type.replace(/^validate/, "");
e.settings[f] && e.settings[f].call(e, this[0], g);
}
(this.labelContainer = a(this.settings.errorLabelContainer)),
(this.errorContext =
(this.labelContainer.length && this.labelContainer) ||
a(this.currentForm)),
(this.containers = a(this.settings.errorContainer).add(
this.settings.errorLabelContainer
)),
(this.submitted = {}),
(this.valueCache = {}),
(this.pendingRequest = 0),
(this.pending = {}),
(this.invalid = {}),
this.reset();
var d = (this.groups = {});
a.each(this.settings.groups, function (e, f) {
typeof f == "string" && (f = f.split(/\s/)),
a.each(f, function (g, h) {
d[h] = e;
});
});
var b = this.settings.rules;
a.each(b, function (f, e) {
b[f] = a.validator.normalizeRule(e);
}),
a(this.currentForm)
.validateDelegate(
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ",
"focusin focusout keyup",
c
)
.validateDelegate(
"[type='radio'], [type='checkbox'], select, option",
"click",
c
),
this.settings.invalidHandler &&
a(this.currentForm).bind(
"invalid-form.validate",
this.settings.invalidHandler
);
},
form: function () {
return (
this.checkForm(),
a.extend(this.submitted, this.errorMap),
(this.invalid = a.extend({}, this.errorMap)),
this.valid() ||
a(this.currentForm).triggerHandler("invalid-form", [this]),
this.showErrors(),
this.valid()
);
},
checkForm: function () {
this.prepareForm();
for (
var b = 0, c = (this.currentElements = this.elements());
c[b];
b++
) {
this.check(c[b]);
}
return this.valid();
},
element: function (c) {
(c = this.validationTargetFor(this.clean(c))),
(this.lastElement = c),
this.prepareElement(c),
(this.currentElements = a(c));
var b = this.check(c) !== !1;
return (
b ? delete this.invalid[c.name] : (this.invalid[c.name] = !0),
this.numberOfInvalids() ||
(this.toHide = this.toHide.add(this.containers)),
this.showErrors(),
b
);
},
showErrors: function (c) {
if (c) {
a.extend(this.errorMap, c), (this.errorList = []);
for (var b in c) {
this.errorList.push({
message: c[b],
element: this.findByName(b)[0],
});
}
this.successList = a.grep(this.successList, function (d) {
return !(d.name in c);
});
}
this.settings.showErrors
? this.settings.showErrors.call(this, this.errorMap, this.errorList)
: this.defaultShowErrors();
},
resetForm: function () {
a.fn.resetForm && a(this.currentForm).resetForm(),
(this.submitted = {}),
(this.lastElement = null),
this.prepareForm(),
this.hideErrors(),
this.elements()
.removeClass(this.settings.errorClass)
.removeData("previousValue");
},
numberOfInvalids: function () {
return this.objectLength(this.invalid);
},
objectLength: function (b) {
var d = 0;
for (var c in b) {
d++;
}
return d;
},
hideErrors: function () {
this.addWrapper(this.toHide).hide();
},
valid: function () {
return this.size() === 0;
},
size: function () {
return this.errorList.length;
},
focusInvalid: function () {
if (this.settings.focusInvalid) {
try {
a(
this.findLastActive() ||
(this.errorList.length && this.errorList[0].element) ||
[]
)
.filter(":visible")
.focus()
.trigger("focusin");
} catch (b) {}
}
},
findLastActive: function () {
var b = this.lastActive;
return (
b &&
a.grep(this.errorList, function (c) {
return c.element.name === b.name;
}).length === 1 &&
b
);
},
elements: function () {
var c = this,
b = {};
return a(this.currentForm)
.find("input, select, textarea")
.not(":submit, :reset, :image, [disabled]")
.not(this.settings.ignore)
.filter(function () {
return (
!this.name &&
c.settings.debug &&
window.console &&
console.error("%o has no name assigned", this),
this.name in b || !c.objectLength(a(this).rules())
? !1
: ((b[this.name] = !0), !0)
);
});
},
clean: function (b) {
return a(b)[0];
},
errors: function () {
var b = this.settings.errorClass.replace(" ", ".");
return a(this.settings.errorElement + "." + b, this.errorContext);
},
reset: function () {
(this.successList = []),
(this.errorList = []),
(this.errorMap = {}),
(this.toShow = a([])),
(this.toHide = a([])),
(this.currentElements = a([]));
},
prepareForm: function () {
this.reset(), (this.toHide = this.errors().add(this.containers));
},
prepareElement: function (b) {
this.reset(), (this.toHide = this.errorsFor(b));
},
elementValue: function (d) {
var b = a(d).attr("type"),
c = a(d).val();
return b === "radio" || b === "checkbox"
? a("input[name='" + a(d).attr("name") + "']:checked").val()
: typeof c == "string"
? c.replace(/\r/g, "")
: c;
},
check: function (h) {
h = this.validationTargetFor(this.clean(h));
var d = a(h).rules(),
f = !1,
c = this.elementValue(h),
g;
for (var e in d) {
var j = { method: e, parameters: d[e] };
try {
g = a.validator.methods[e].call(this, c, h, j.parameters);
if (g === "dependency-mismatch") {
f = !0;
continue;
}
f = !1;
if (g === "pending") {
this.toHide = this.toHide.not(this.errorsFor(h));
return;
}
if (!g) {
return this.formatAndAdd(h, j), !1;
}
} catch (b) {
throw (
(this.settings.debug &&
window.console &&
console.log(
"Exception occured when checking element " +
h.id +
", check the '" +
j.method +
"' method.",
b
),
b)
);
}
}
if (f) {
return;
}
return this.objectLength(d) && this.successList.push(h), !0;
},
customDataMessage: function (c, b) {
return (
a(c).data("msg-" + b.toLowerCase()) ||
(c.attributes && a(c).attr("data-msg-" + b.toLowerCase()))
);
},
customMessage: function (b, d) {
var c = this.settings.messages[b];
return c && (c.constructor === String ? c : c[d]);
},
findDefined: function () {
for (var b = 0; b < arguments.length; b++) {
if (arguments[b] !== undefined) {
return arguments[b];
}
}
return undefined;
},
defaultMessage: function (c, b) {
return this.findDefined(
this.customMessage(c.name, b),
this.customDataMessage(c, b),
(!this.settings.ignoreTitle && c.title) || undefined,
a.validator.messages[b],
"Warning: No message defined for " + c.name + ""
);
},
formatAndAdd: function (e, c) {
var d = this.defaultMessage(e, c.method),
b = /\$?\{(\d+)\}/g;
typeof d == "function"
? (d = d.call(this, c.parameters, e))
: b.test(d) &&
(d = a.validator.format(d.replace(b, "{$1}"), c.parameters)),
this.errorList.push({ message: d, element: e }),
(this.errorMap[e.name] = d),
(this.submitted[e.name] = d);
},
addWrapper: function (b) {
return (
this.settings.wrapper &&
(b = b.add(b.parent(this.settings.wrapper))),
b
);
},
defaultShowErrors: function () {
var b, d;
for (b = 0; this.errorList[b]; b++) {
var c = this.errorList[b];
this.settings.highlight &&
this.settings.highlight.call(
this,
c.element,
this.settings.errorClass,
this.settings.validClass
),
this.showLabel(c.element, c.message);
}
this.errorList.length &&
(this.toShow = this.toShow.add(this.containers));
if (this.settings.success) {
for (b = 0; this.successList[b]; b++) {
this.showLabel(this.successList[b]);
}
}
if (this.settings.unhighlight) {
for (b = 0, d = this.validElements(); d[b]; b++) {
this.settings.unhighlight.call(
this,
d[b],
this.settings.errorClass,
this.settings.validClass
);
}
}
(this.toHide = this.toHide.not(this.toShow)),
this.hideErrors(),
this.addWrapper(this.toShow).show();
},
validElements: function () {
return this.currentElements.not(this.invalidElements());
},
invalidElements: function () {
return a(this.errorList).map(function () {
return this.element;
});
},
showLabel: function (d, b) {
var c = this.errorsFor(d);
c.length
? (c
.removeClass(this.settings.validClass)
.addClass(this.settings.errorClass),
c.html(b))
: ((c = a("<" + this.settings.errorElement + ">")
.attr("for", this.idOrName(d))
.addClass(this.settings.errorClass)
.html(b || "")),
this.settings.wrapper &&
(c = c
.hide()
.show()
.wrap("<" + this.settings.wrapper + "/>")
.parent()),
this.labelContainer.append(c).length ||
(this.settings.errorPlacement
? this.settings.errorPlacement(c, a(d))
: c.insertAfter(d))),
!b &&
this.settings.success &&
(c.text(""),
typeof this.settings.success == "string"
? c.addClass(this.settings.success)
: this.settings.success(c, d)),
(this.toShow = this.toShow.add(c));
},
errorsFor: function (c) {
var b = this.idOrName(c);
return this.errors().filter(function () {
return a(this).attr("for") === b;
});
},
idOrName: function (b) {
return (
this.groups[b.name] || (this.checkable(b) ? b.name : b.id || b.name)
);
},
validationTargetFor: function (b) {
return (
this.checkable(b) &&
(b = this.findByName(b.name).not(this.settings.ignore)[0]),
b
);
},
checkable: function (b) {
return /radio|checkbox/i.test(b.type);
},
findByName: function (b) {
return a(this.currentForm).find("[name='" + b + "']");
},
getLength: function (c, b) {
switch (b.nodeName.toLowerCase()) {
case "select":
return a("option:selected", b).length;
case "input":
if (this.checkable(b)) {
return this.findByName(b.name).filter(":checked").length;
}
}
return c.length;
},
depend: function (b, c) {
return this.dependTypes[typeof b]
? this.dependTypes[typeof b](b, c)
: !0;
},
dependTypes: {
boolean: function (b, c) {
return b;
},
string: function (c, b) {
return !!a(c, b.form).length;
},
function: function (b, c) {
return b(c);
},
},
optional: function (c) {
var b = this.elementValue(c);
return (
!a.validator.methods.required.call(this, b, c) &&
"dependency-mismatch"
);
},
startRequest: function (b) {
this.pending[b.name] ||
(this.pendingRequest++, (this.pending[b.name] = !0));
},
stopRequest: function (c, b) {
this.pendingRequest--,
this.pendingRequest < 0 && (this.pendingRequest = 0),
delete this.pending[c.name],
b && this.pendingRequest === 0 && this.formSubmitted && this.form()
? (a(this.currentForm).submit(), (this.formSubmitted = !1))
: !b &&
this.pendingRequest === 0 &&
this.formSubmitted &&
(a(this.currentForm).triggerHandler("invalid-form", [this]),
(this.formSubmitted = !1));
},
previousValue: function (b) {
return (
a.data(b, "previousValue") ||
a.data(b, "previousValue", {
old: null,
valid: !0,
message: this.defaultMessage(b, "remote"),
})
);
},
},
classRuleSettings: {
required: { required: !0 },
email: { email: !0 },
url: { url: !0 },
date: { date: !0 },
dateISO: { dateISO: !0 },
number: { number: !0 },
digits: { digits: !0 },
creditcard: { creditcard: !0 },
},
addClassRules: function (c, b) {
c.constructor === String
? (this.classRuleSettings[c] = b)
: a.extend(this.classRuleSettings, c);
},
classRules: function (d) {
var b = {},
c = a(d).attr("class");
return (
c &&
a.each(c.split(" "), function () {
this in a.validator.classRuleSettings &&
a.extend(b, a.validator.classRuleSettings[this]);
}),
b
);
},
attributeRules: function (f) {
var c = {},
d = a(f);
for (var b in a.validator.methods) {
var e;
b === "required"
? ((e = d.get(0).getAttribute(b)), e === "" && (e = !0), (e = !!e))
: (e = d.attr(b)),
e ? (c[b] = e) : d[0].getAttribute("type") === b && (c[b] = !0);
}
return (
c.maxlength &&
/-1|2147483647|524288/.test(c.maxlength) &&
delete c.maxlength,
c
);
},
dataRules: function (f) {
var c,
d,
b = {},
e = a(f);
for (c in a.validator.methods) {
(d = e.data("rule-" + c.toLowerCase())),
d !== undefined && (b[c] = d);
}
return b;
},
staticRules: function (d) {
var b = {},
c = a.data(d.form, "validator");
return (
c.settings.rules &&
(b = a.validator.normalizeRule(c.settings.rules[d.name]) || {}),
b
);
},
normalizeRules: function (c, b) {
return (
a.each(c, function (e, d) {
if (d === !1) {
delete c[e];
return;
}
if (d.param || d.depends) {
var f = !0;
switch (typeof d.depends) {
case "string":
f = !!a(d.depends, b.form).length;
break;
case "function":
f = d.depends.call(b, b);
}
f ? (c[e] = d.param !== undefined ? d.param : !0) : delete c[e];
}
}),
a.each(c, function (e, d) {
c[e] = a.isFunction(d) ? d(b) : d;
}),
a.each(["minlength", "maxlength"], function () {
c[this] && (c[this] = Number(c[this]));
}),
a.each(["rangelength"], function () {
var d;
c[this] &&
(a.isArray(c[this])
? (c[this] = [Number(c[this][0]), Number(c[this][1])])
: typeof c[this] == "string" &&
((d = c[this].split(/[\s,]+/)),
(c[this] = [Number(d[0]), Number(d[1])])));
}),
a.validator.autoCreateRanges &&
(c.min &&
c.max &&
((c.range = [c.min, c.max]), delete c.min, delete c.max),
c.minlength &&
c.maxlength &&
((c.rangelength = [c.minlength, c.maxlength]),
delete c.minlength,
delete c.maxlength)),
c
);
},
normalizeRule: function (c) {
if (typeof c == "string") {
var b = {};
a.each(c.split(/\s/), function () {
b[this] = !0;
}),
(c = b);
}
return c;
},
addMethod: function (d, b, c) {
(a.validator.methods[d] = b),
(a.validator.messages[d] =
c !== undefined ? c : a.validator.messages[d]),
b.length < 3 &&
a.validator.addClassRules(d, a.validator.normalizeRule(d));
},
methods: {
required: function (e, c, d) {
if (!this.depend(d, c)) {
return "dependency-mismatch";
}
if (c.nodeName.toLowerCase() === "select") {
var b = a(c).val();
return b && b.length > 0;
}
return this.checkable(c)
? this.getLength(e, c) > 0
: a.trim(e).length > 0;
},
remote: function (g, c, e) {
if (this.optional(c)) {
return "dependency-mismatch";
}
var b = this.previousValue(c);
this.settings.messages[c.name] ||
(this.settings.messages[c.name] = {}),
(b.originalMessage = this.settings.messages[c.name].remote),
(this.settings.messages[c.name].remote = b.message),
(e = (typeof e == "string" && { url: e }) || e);
if (b.old === g) {
return b.valid;
}
b.old = g;
var f = this;
this.startRequest(c);
var d = {};
return (
(d[c.name] = g),
a.ajax(
a.extend(
!0,
{
url: e,
mode: "abort",
port: "validate" + c.name,
dataType: "json",
data: d,
success: function (l) {
f.settings.messages[c.name].remote = b.originalMessage;
var k = l === !0 || l === "true";
if (k) {
var m = f.formSubmitted;
f.prepareElement(c),
(f.formSubmitted = m),
f.successList.push(c),
delete f.invalid[c.name],
f.showErrors();
} else {
var h = {},
j = l || f.defaultMessage(c, "remote");
(h[c.name] = b.message = a.isFunction(j) ? j(g) : j),
(f.invalid[c.name] = !0),
f.showErrors(h);
}
(b.valid = k), f.stopRequest(c, k);
},
},
e
)
),
"pending"
);
},
minlength: function (e, c, d) {
var b = a.isArray(e) ? e.length : this.getLength(a.trim(e), c);
return this.optional(c) || b >= d;
},
maxlength: function (e, c, d) {
var b = a.isArray(e) ? e.length : this.getLength(a.trim(e), c);
return this.optional(c) || b <= d;
},
rangelength: function (e, c, d) {
var b = a.isArray(e) ? e.length : this.getLength(a.trim(e), c);
return this.optional(c) || (b >= d[0] && b <= d[1]);
},
min: function (b, d, c) {
return this.optional(d) || b >= c;
},
max: function (b, d, c) {
return this.optional(d) || b <= c;
},
range: function (b, d, c) {
return this.optional(d) || (b >= c[0] && b <= c[1]);
},
email: function (b, c) {
return (
this.optional(c) ||
/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(
b
)
);
},
url: function (b, c) {
return (
this.optional(c) ||
/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(
b
)
);
},
date: function (b, c) {
return (
this.optional(c) || !/Invalid|NaN/.test(new Date(b).toString())
);
},
dateISO: function (b, c) {
return (
this.optional(c) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(b)
);
},
number: function (b, c) {
return (
this.optional(c) ||
/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(b)
);
},
digits: function (b, c) {
return this.optional(c) || /^\d+$/.test(b);
},
creditcard: function (b, j) {
if (this.optional(j)) {
return "dependency-mismatch";
}
if (/[^0-9 \-]+/.test(b)) {
return !1;
}
var d = 0,
g = 0,
c = !1;
b = b.replace(/\D/g, "");
for (var h = b.length - 1; h >= 0; h--) {
var f = b.charAt(h);
(g = parseInt(f, 10)),
c && (g *= 2) > 9 && (g -= 9),
(d += g),
(c = !c);
}
return d % 10 === 0;
},
equalTo: function (e, c, d) {
var b = a(d);
return (
this.settings.onfocusout &&
b
.unbind(".validate-equalTo")
.bind("blur.validate-equalTo", function () {
a(c).valid();
}),
e === b.val()
);
},
},
}),
(a.format = a.validator.format);
})(jQuery),
(function (a) {
var c = {};
if (a.ajaxPrefilter) {
a.ajaxPrefilter(function (d, g, h) {
var f = d.port;
d.mode === "abort" && (c[f] && c[f].abort(), (c[f] = h));
});
} else {
var b = a.ajax;
a.ajax = function (e) {
var d = ("mode" in e ? e : a.ajaxSettings).mode,
f = ("port" in e ? e : a.ajaxSettings).port;
return d === "abort"
? (c[f] && c[f].abort(), (c[f] = b.apply(this, arguments)))
: b.apply(this, arguments);
};
}
})(jQuery),
(function (a) {
a.extend(a.fn, {
validateDelegate: function (d, b, c) {
return this.bind(b, function (f) {
var e = a(f.target);
if (e.is(d)) {
return c.apply(e, arguments);
}
});
},
});
})(jQuery);
/*
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
(function (a) {
var b = a.validator,
c,
e = "unobtrusiveValidation";
function m(p, q, r) {
p.rules[q] = r;
if (p.message) {
p.messages[q] = p.message;
}
}
function n(p) {
return p.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
}
function f(p) {
return p.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
}
function g(p) {
return p.substr(0, p.lastIndexOf(".") + 1);
}
function d(q, p) {
if (q.indexOf("*.") === 0) {
q = q.replace("*.", p);
}
return q;
}
function h(q, r) {
var p = a(this).find("[data-valmsg-for='" + f(r[0].name) + "']"),
t = p.attr("data-valmsg-replace"),
s = t ? a.parseJSON(t) !== false : null;
p.removeClass("field-validation-valid").addClass("field-validation-error");
q.data("unobtrusiveContainer", p);
if (s) {
p.empty();
q.removeClass("input-validation-error").appendTo(p);
} else {
q.hide();
}
}
function j(q, s) {
var p = a(this).find("[data-valmsg-summary=true]"),
r = p.find("ul");
if (r && r.length && s.errorList.length) {
r.empty();
p.addClass("validation-summary-errors").removeClass(
"validation-summary-valid"
);
a.each(s.errorList, function () {
a("