/*! nice-validator 1.0.6 * (c) 2012-2016 jony zhang , mit licensed * https://github.com/niceue/nice-validator */ !function (e) { "object" == typeof module && module.exports ? module.exports = e(require("jquery")) : "function" == typeof define && define.amd ? define(["jquery"], e) : e(jquery) }(function (e, t) { "use strict"; function i(t, n) { function s() { a._init(a.$el[0], n, !!arguments[0]) } var a = this; return a instanceof i ? (a.$el = e(t), void (a.$el.length ? (s(), i.pending && e(window).on("validatorready", s)) : j(t) && (g[t] = n))) : new i(t, n) } function n(t) { function i() { var t = this.options; for (var i in t) i in y && (this[i] = t[i]); e.extend(this, { _valhook: function () { return "true" === this.element.contenteditable ? "text" : "val" }, getvalue: function () { var t = this.element; return "number" === t.type && t.validity && t.validity.badinput ? "nan" : e(t)[this._valhook()]() }, setvalue: function (t) { e(this.element)[this._valhook()](this.value = t) }, getrangemsg: function (e, t, i) { function n(e, t) { return o ? e > t : e >= t } if (t) { var s, a = this, r = a.messages[a._r] || "", l = t[0].split("~"), o = "false" === t[1], u = l[0], d = l[1], c = "rg", f = [""], g = u(e) && +e === +e; return 2 === l.length ? u && d ? (g && n(e, +u) && n(+d, e) && (s = !0), f = f.concat(l), c = o ? "gtlt" : "rg") : u && !d ? (g && n(e, +u) && (s = !0), f.push(u), c = o ? "gt" : "gte") : !u && d && (g && n(+d, e) && (s = !0), f.push(d), c = o ? "lt" : "lte") : (e === +u && (s = !0), f.push(u), c = "eq"), r && (i && r[c + i] && (c += i), f[0] = r[c]), s || a._rules && (a._rules[a._i].msg = a.rendermsg.apply(null, f)) } }, rendermsg: function () { var e = arguments, t = e[0], i = e.length; if (t) { for (; --i;) t = t.replace("{" + i + "}", e[i]); return t } } }) } function n(i, n, s) { this.key = i, this.validator = t, e.extend(this, s, n) } return i.prototype = t, n.prototype = new i, n } function s(e, t) { if (q(e)) { var i, n = t ? t === !0 ? this : t : s.prototype; for (i in e) g(i) && (n[i] = r(e[i])) } } function a(e, t) { if (q(e)) { var i, n = t ? t === !0 ? this : t : a.prototype; for (i in e) n[i] = e[i] } } function r(t) { switch (e.type(t)) { case "function": return t; case "array": var i = function () { return t[0].test(this.value) || t[1] || !1 }; return i.msg = t[1], i; case "regexp": return function () { return t.test(this.value) } } } function l(t) { var i, n, s; if (t && t.tagname) { switch (t.tagname) { case "input": case "select": case "textarea": case "button": case "fieldset": i = t.form || e(t).closest("." + k); break; case "form": i = t; break; default: i = e(t).closest("." + k) } for (n in g) if (e(i).is(n)) { s = g[n]; break } return e(i).data(p) || e(i)[p](s).data(p) } } function o(e, t) { var i = u(z(e, m + "-" + t)); if (i && (i = new function("return " + i)())) return r(i) } function u(e, t, i) { var n = t.msg, s = t._r; return q(n) && (n = n[s]), j(n) || (n = z(e, o + "-" + s) || z(e, o) || (i ? j(i) ? i : i[s] : "")), n } function d(e) { var t; return e && (t = i.exec(e)), t && t[0] } function c(e) { return "input" === e.tagname && "checkbox" === e.type || "radio" === e.type } function f(e) { return date.parse(e.replace(/\.|\-/g, "/")) } function g(e) { return /^\w+$/.test(e) } function m(e) { var t = "#" === e.charat(0); return e = e.replace(/([:.{(|)}\/\[\]])/g, "\\$1"), t ? e : '[name="' + e + '"]:first' } var h, p = "validator", v = "." + p, _ = ".rule", y = ".field", b = ".form", k = "nice-" + p, w = "msg-box", x = "aria-required", v = "aria-invalid", m = "data-rule", o = "data-msg", $ = "data-tip", f = "data-ok", e = "data-timely", c = "data-target", a = "data-display", j = "data-must", t = "novalidate", n = ":verifiable", s = /(&)?(!)?\b(\w+)(?:\[\s*(.*?\]?)\s*\]|\(\s*(.*?\)?)\s*\))?\s*(;|\|)?/g, q = /(\w+)(?:\[\s*(.*?\]?)\s*\]|\(\s*(.*?\)?)\s*\))?/, r = /(?:([^:;\(\[]*):)?(.*)/, d = /[^\x00-\xff]/g, i = /top|right|bottom|left/, h = /(?:(cors|jsonp):)?(?:(post|get):)?(.+)/i, l = /[<>'"`\\]|&#x?\d+[a-f]?;?|%3[a-f]/gim, b = e.noop, p = e.proxy, u = e.trim, w = e.isfunction, j = function (e) { return "string" == typeof e }, q = function (e) { return e && "[object object]" === object.prototype.tostring.call(e) }, x = document.documentmode || +(navigator.useragent.match(/msie (\d+)/) && regexp.$1), z = function (e, i, n) { return e && e.tagname ? n === t ? e.getattribute(i) : void (null === n ? e.removeattribute(i) : e.setattribute(i, "" + n)) : null }, g = {}, k = { debug: 0, theme: "default", ignore: "", focusinvalid: !0, focuscleanup: !1, stoponerror: !1, beforesubmit: null, valid: null, invalid: null, validation: null, formclass: "n-default", validclass: "n-valid", invalidclass: "n-invalid", bindclassto: null }, y = { timely: 1, display: null, target: null, ignoreblank: !1, showok: !0, datafilter: function (e) { if (j(e) || q(e) && ("error" in e || "ok" in e)) return e }, msgmaker: function (t) { var i; return i = '' + t.arrow, t.result ? e.each(t.result, function (e, n) { i += '' + t.icon + '' + n.msg + "" }) : i += t.icon + '' + t.msg + "", i += "" }, msgwrapper: "span", msgarrow: "", msgicon: '', msgclass: "n-right", msgstyle: "", msgshow: null, msghide: null }, z = {}; return e.fn.validator = function (t) { var n = this, s = arguments; return n.is(n) ? n : (n.is("form") || (n = this.find("form")), n.length || (n = this), n.each(function () { var n = e(this).data(p); if (n) if (j(t)) { if ("_" === t.charat(0)) return; n[t].apply(n, [].slice.call(s, 1)) } else t && (n._reset(!0), n._init(this, t)); else new i(this, t) }), this) }, e.fn.isvalid = function (e, i) { var n, s, a = l(this[0]), r = w(e); return !a || (r || i !== t || (i = e), a.checkonly = !!i, s = a.options, n = a._multivalidate(this.is(n) ? this : this.find(n), function (t) { t || !s.focusinvalid || a.checkonly || a.$el.find("[" + v + "]:first").focus(), r && (e.length ? e(t) : t && e()), a.checkonly = !1 }), r ? this : n) }, e.expr.pseudos.verifiable = function (e) { var t = e.nodename.tolowercase(); return ("input" === t && !{ submit: 1, button: 1, reset: 1, image: 1 }[e.type] || "select" === t || "textarea" === t || "true" === e.contenteditable) && !e.disabled }, e.expr.pseudos.filled = function (t) { return !!u(e(t).val()) }, i.prototype = { _init: function (t, i, r) { var l, o, u, d = this; w(i) && (i = { valid: i }), i = d._opt = i || {}, u = z(t, "data-" + p + "-option"), u = d._dataopt = u && "{" === u.charat(0) ? new function("return " + u)() : {}, o = d._themeopt = z[i.theme || u.theme || k.theme], l = d.options = e.extend({}, k, y, o, d.options, i, u), r || (d.rules = new s(l.rules, (!0)), d.messages = new a(l.messages, (!0)), d.field = n(d), d.elements = d.elements || {}, d.deferred = {}, d.errors = {}, d.fields = {}, d._initfields(l.fields)), d.$el.data(p) || (d.$el.data(p, d).addclass(k + " " + l.formclass).on("form-submit-validate", function (e, t, i, n, s) { d.vetoed = s.veto = !d.isvalid, d.ajaxformoptions = n }).on("submit" + v + " validate" + v, p(d, "_submit")).on("reset" + v, p(d, "_reset")).on("showmsg" + v, p(d, "_showmsg")).on("hidemsg" + v, p(d, "_hidemsg")).on("focusin" + v + " click" + v, n, p(d, "_focusin")).on("focusout" + v + " validate" + v, n, p(d, "_focusout")).on("keyup" + v + " input" + v + " compositionstart compositionend", n, p(d, "_focusout")).on("click" + v, ":radio,:checkbox", "click", p(d, "_focusout")).on("change" + v, 'select,input[type="file"]', "change", p(d, "_focusout")), d._novalidate = z(t, t), z(t, t, t)), j(l.target) && d.$el.find(l.target).addclass("msg-container") }, _guessajax: function (t) { function i(t, i, n) { return !!(t && t[i] && e.map(t[i], function (e) { return ~e.namespace.indexof(n) ? 1 : null }).length) } var n = this; if (!(n.isajaxsubmit = !!n.options.valid)) { var s = (e._data || e.data)(t, "events"); n.isajaxsubmit = i(s, "valid", "form") || i(s, "submit", "form-plugin") } }, _initfields: function (e) { function t(e, t) { if (null === t || r) { var i = a.elements[e]; i && a._resetelement(i, !0), delete a.fields[e] } else a.fields[e] = new a.field(e, j(t) ? { rule: t } : t, a.fields[e]) } var i, n, s, a = this, r = null === e; if (r && (e = a.fields), q(e)) for (i in e) if (~i.indexof(",")) for (n = i.split(","), s = n.length; s--;) t(u(n[s]), e[i]); else t(i, e[i]); a.$el.find(n).each(function () { a._parse(this) }) }, _parse: function (e) { var t, i, n, s = this, a = e.name, r = z(e, m); if (r && z(e, m, null), e.id && ("#" + e.id in s.fields || !a || null !== r && (t = s.fields[a]) && r !== t.rule && e.id !== t.key) && (a = "#" + e.id), a) return t = s.getfield(a, !0), t.rule = r || t.rule, (i = z(e, a)) && (t.display = i), t.rule && ((null !== z(e, j) || /\b(?:match|checked)\b/.test(t.rule)) && (t.must = !0), /\brequired\b/.test(t.rule) && (t.required = !0, z(e, x, !0)), (n = z(e, e)) ? t.timely = +n : t.timely > 3 && z(e, e, t.timely), s._parserule(t), t.old = {}), j(t.target) && z(e, c, t.target), j(t.tip) && z(e, $, t.tip), s.fields[a] = t }, _parserule: function (i) { var n = r.exec(i.rule); n && (i._i = 0, n[1] && (i.display = n[1]), n[2] && (i._rules = [], n[2].replace(s, function () { var n = arguments; n[4] = n[4] || n[5], i._rules.push({ and: "&" === n[1], not: "!" === n[2], or: "|" === n[6], method: n[3], params: n[4] ? e.map(n[4].split(", "), u) : t }) }))) }, _multivalidate: function (i, n) { var s = this, a = s.options; return s.haserror = !1, a.ignore && (i = i.not(a.ignore)), i.each(function () { if (s._validate(this), s.haserror && a.stoponerror) return !1 }), n && (s.validating = !0, e.when.apply(null, e.map(s.deferred, function (e) { return e })).done(function () { n.call(s, !s.haserror), s.validating = !1 })), e.isemptyobject(s.deferred) ? !s.haserror : t }, _submit: function (i) { var n = this, s = n.options, a = i.target, r = "submit" === i.type && !i.isdefaultprevented(); i.preventdefault(), h && ~(h = !1) || n.submiting || "validate" === i.type && n.$el[0] !== a || w(s.beforesubmit) && s.beforesubmit.call(n, a) === !1 || (n.isajaxsubmit === t && n._guessajax(a), n._debug("log", "\n<<< event: " + i.type), n._reset(), n.submiting = !0, n._multivalidate(n.$el.find(n), function (t) { var i, l = t || 2 === s.debug ? "valid" : "invalid"; t || (s.focusinvalid && n.$el.find("[" + v + "]:first").focus(), i = e.map(n.errors, function (e) { return e })), n.submiting = !1, n.isvalid = t, w(s[l]) && s[l].call(n, a, i), n.$el.trigger(l + b, [a, i]), n._debug("log", ">>> " + l), t && (n.vetoed ? e(a).ajaxsubmit(n.ajaxformoptions) : r && !n.isajaxsubmit && document.createelement("form").submit.call(a)) })) }, _reset: function (e) { var t = this; t.errors = {}, e && (t.reseting = !0, t.$el.find(n).each(function () { t._resetelement(this) }), delete t.reseting) }, _resetelement: function (e, t) { this._setclass(e, null), this.hidemsg(e), t && z(e, x, null) }, _focusin: function (e) { var t, i, n = this, s = n.options, a = e.target; n.validating || "click" === e.type && document.activeelement === a || (s.focuscleanup && "true" === z(a, v) && (n._setclass(a, null), n.hidemsg(a)), i = z(a, $), i ? n.showmsg(a, { type: "tip", msg: i }) : (z(a, m) && n._parse(a), (t = z(a, e)) && (8 !== t && 9 !== t || n._focusout(e)))) }, _focusout: function (t) { var i, n, s, a, r, l, o, u, d, f = this, g = f.options, m = t.target, h = t.type, p = "focusin" === h, v = "validate" === h, _ = 0; if ("compositionstart" === h && (f.pausevalidate = !0), "compositionend" === h && (f.pausevalidate = !1), !f.pausevalidate && (n = m.name && c(m) ? f.$el.find('input[name="' + m.name + '"]').get(0) : m, s = f.getfield(n))) { if (i = s._e, s._e = h, d = s.timely, !v) { if (!d || c(m) && "click" !== h) return; if (r = s.getvalue(), s.ignoreblank && !r && !p) return void f.hidemsg(m); if ("focusout" === h) { if ("change" === i) return; if (2 === d || 8 === d) { if (!r) return; a = s.old, s.isvalid && !a.showok ? f.hidemsg(m) : f._makemsg(m, s, a) } } else { if (d < 2 && !t.data) return; if (l = +new date, l - (m._ts || 0) < 100) return; if (m._ts = l, "keyup" === h) { if ("input" === i) return; if (o = t.keycode, u = { 8: 1, 9: 1, 16: 1, 32: 1, 46: 1 }, 9 === o && !r) return; if (o < 48 && !u[o]) return } p || (_ = d < 100 ? "click" === h || "select" === m.tagname ? 0 : 400 : d) } } g.ignore && e(m).is(g.ignore) || (cleartimeout(s._t), _ ? s._t = settimeout(function () { f._validate(m, s) }, _) : (v && (s.old = {}), f._validate(m, s))) } }, _setclass: function (t, i) { var n = e(t), s = this.options; s.bindclassto && (n = n.closest(s.bindclassto)), n.removeclass(s.invalidclass + " " + s.validclass), null !== i && n.addclass(i ? s.validclass : s.invalidclass) }, _showmsg: function (e, t, i) { var n = this, s = e.target; n.$el.is(s) ? q(t) ? n.showmsg(t) : "tip" === t && n.$el.find(n + "[" + $ + "]", s).each(function () { n.showmsg(this, { type: t, msg: i }) }) : n.showmsg(s, { type: t, msg: i }) }, _hidemsg: function (t) { var i = e(t.target); i.is(n) && this.hidemsg(i) }, _validatedfield: function (t, i, n) { var s = this, a = s.options, r = i.isvalid = n.isvalid = !!n.isvalid, l = r ? "valid" : "invalid"; n.key = i.key, n.rulename = i._r, n.id = t.id, n.value = i.value, s.elements[i.key] = n.element = t, s.isvalid = s.$el[0].isvalid = r ? s.isformvalid() : r, r ? n.type = "ok" : (s.submiting && (s.errors[i.key] = n.msg), s.haserror = !0), i.old = n, w(i[l]) && i[l].call(s, t, n), w(a.validation) && a.validation.call(s, t, n), e(t).attr(v, !r || null).trigger(l + y, [n, s]), s.$el.triggerhandler("validation", [n, s]), s.checkonly || (s._setclass(t, n.skip || "tip" === n.type ? null : r), s._makemsg.apply(s, arguments)) }, _makemsg: function (t, i, n) { i.msgmaker && (n = e.extend({}, n), "focusin" === i._e && (n.type = "tip"), this[n.showok || n.msg || "tip" === n.type ? "showmsg" : "hidemsg"](t, n, i)) }, _validatedrule: function (i, n, s, a) { n = n || c.getfield(i), a = a || {}; var r, l, o, d, c = this, f = n._r, g = n.timely, m = 9 === g || 8 === g, h = !1; if (null === s) return c._validatedfield(i, n, { isvalid: !0, skip: !0 }), void (n._i = 0); if (s === t ? o = !0 : s === !0 || "" === s ? h = !0 : j(s) ? r = s : q(s) && (s.error ? r = s.error : (r = s.ok, h = !0)), l = n._rules[n._i], l.not && (r = t, h = "required" === f || !h), l.or) if (h) for (; n._i < n._rules.length && n._rules[n._i].or;) n._i++; else o = !0; else l.and && (n.isvalid || (o = !0)); o ? h = !0 : (h && n.showok !== !1 && (d = z(i, f), r = null === d ? j(n.ok) ? n.ok : r : d, !j(r) && j(n.showok) && (r = n.showok), j(r) && (a.showok = h)), h && !m || (r = (u(i, n, r || l.msg || c.messages[f]) || c.messages.fallback).replace(/\{0\|?([^\}]*)\}/, function (e, t) { return c._getdisplay(i, n.display) || t || c.messages[0] })), h || (n.isvalid = h), a.msg = r, e(i).trigger((h ? "valid" : "invalid") + _, [f, r])), !m || o && !l.and || (h || n._m || (n._m = r), n._v = n._v || [], n._v.push({ type: h ? o ? "tip" : "ok" : "error", msg: r || l.msg })), c._debug("log", " " + n._i + ": " + f + " => " + (h || r)), (h || m) && n._i < n._rules.length - 1 ? (n._i++, c._checkrule(i, n)) : (n._i = 0, m ? (a.isvalid = n.isvalid, a.result = n._v, a.msg = n._m || "", n.value || "focusin" !== n._e || (a.type = "tip")) : a.isvalid = h, c._validatedfield(i, n, a), delete n._m, delete n._v) }, _checkrule: function (i, n) { var s, a, r, l = this, u = n.key, d = n._rules[n._i], c = d.method, f = d.params; l.submiting && l.deferred[u] || (r = n.old, n._r = c, r && !n.must && !d.must && d.result !== t && r.rulename === c && r.id === i.id && n.value && r.value === n.value ? s = d.result : (a = o(i, c) || l.rules[c] || b, s = a.call(n, i, f, n), a.msg && (d.msg = a.msg)), q(s) && w(s.then) ? (l.deferred[u] = s, n.isvalid = t, !l.checkonly && l.showmsg(i, { type: "loading", msg: l.messages.loading }, n), s.then(function (s, a, r) { var o, u = u(r.responsetext), c = n.datafilter; /jsonp?/.test(this.datatype) ? u = s : "{" === u.charat(0) && (u = e.parsejson(u)), o = c.call(this, u, n), o === t && (o = c.call(this, u.data, n)), d.data = this.data, d.result = n.old ? o : t, l._validatedrule(i, n, o) }, function (e, t) { l._validatedrule(i, n, l.messages[t] || t) }).always(function () { delete l.deferred[u] })) : l._validatedrule(i, n, s)) }, _validate: function (e, t) { var i = this; if (!e.disabled && null === z(e, t) && (t = t || i.getfield(e), t && (t._rules || i._parse(e), t._rules))) return i._debug("info", t.key), t.isvalid = !0, t.element = e, t.value = t.getvalue(), t.required || t.must || t.value || c(e) ? (i._checkrule(e, t), t.isvalid) : (i._validatedfield(e, t, { isvalid: !0 }), !0) }, _debug: function (e, t) { window.console && this.options.debug && console[e](t) }, test: function (e, i) { var n, s, a, r, l = this, o = q.exec(i); return o && (a = o[1], a in l.rules && (r = o[2] || o[3], r = r ? r.split(", ") : t, s = l.getfield(e, !0), s._r = a, s.value = s.getvalue(), n = l.rules[a].call(s, e, r))), n === !0 || n === t || null === n }, _getdisplay: function (e, t) { return j(t) ? t : w(t) ? t.call(this, e) : "" }, _getmsgopt: function (t, i) { var n = i ? i : this.options; return e.extend({ type: "error", pos: d(n.msgclass), target: n.target, wrapper: n.msgwrapper, style: n.msgstyle, cls: n.msgclass, arrow: n.msgarrow, icon: n.msgicon }, j(t) ? { msg: t } : t) }, _getmsgdom: function (i, n) { var s, a, r, l, o = e(i); if (o.is(n) ? (r = n.target || z(i, c), r && (r = w(r) ? r.call(this, i) : this.$el.find(r), r.length && (r.is(n) ? i = r.get(0) : r.hasclass(w) ? s = r : l = r)), s || (a = c(i) && i.name || !i.id ? i.name : i.id, s = this.$el.find(n.wrapper + "." + w + '[for="' + a + '"]'))) : s = o, !n.hide && !s.length) if (o = this.$el.find(r || i), s = e("<" + n.wrapper + ">").attr({ "class": w + (n.cls ? " " + n.cls : ""), style: n.style || t, "for": a }), c(i)) { var u = o.parent(); s.appendto(u.is("label") ? u.parent() : u) } else l ? s.appendto(l) : s[n.pos && "right" !== n.pos ? "insertbefore" : "insertafter"](o); return s }, showmsg: function (t, i, n) { if (t) { var s, a, r, l, o = this, u = o.options; if (q(t) && !t.jquery && !i) return void e.each(t, function (e, t) { var i = o.elements[e] || o.$el.find(m(e))[0]; o.showmsg(i, t) }); e(t).is(n) && (n = n || o.getfield(t)), (a = (n || u).msgmaker) && (i = o._getmsgopt(i, n), t = e(t).get(0), i.msg || "error" === i.type || (r = z(t, "data-" + i.type), null !== r && (i.msg = r)), j(i.msg) && (l = o._getmsgdom(t, i), !i.test(l[0].classname) && l.addclass(i.cls), 6 === x && "bottom" === i.pos && (l[0].style.margintop = e(t).outerheight() + "px"), l.html(a.call(o, i))[0].style.display = "", w(s = n && n.msgshow || u.msgshow) && s.call(o, l, i.type))) } }, hidemsg: function (t, i, n) { var s, a, r = this, l = r.options; t = e(t).get(0), e(t).is(n) && (n = n || r.getfield(t), n && (n.isvalid || r.reseting) && z(t, v, null)), i = r._getmsgopt(i, n), i.hide = !0, a = r._getmsgdom(t, i), a.length && (w(s = n && n.msghide || l.msghide) ? s.call(r, a, i.type) : (a[0].style.display = "none", a[0].innerhtml = null)) }, getfield: function (e, i) { var n, s, a = this; if (j(e)) n = e, e = t; else { if (z(e, m)) return a._parse(e); n = e.id && "#" + e.id in a.fields || !e.name ? "#" + e.id : e.name } return ((s = a.fields[n]) || i && (s = new a.field(n))) && (s.element = e), s }, setfield: function (e, t) { var i = {}; e && (j(e) ? i[e] = t : i = e, this._initfields(i)) }, isformvalid: function () { var e, t, i = this.fields; for (e in i) if (t = i[e], t._rules && (t.required || t.must || t.value) && !t.isvalid) return !1; return !0 }, holdsubmit: function (e) { this.submiting = e === t || e }, cleanup: function () { this._reset(1) }, destroy: function () { this._reset(1), this.$el.off(v).removedata(p), z(this.$el[0], t, this._novalidate) } }, e(window).on("beforeunload", function () { this.focus() }), e(document).on("click", ":submit", function () { var e, t = this; t.form && (e = t.getattributenode("formnovalidate"), (e && null !== e.nodevalue || null !== z(t, t)) && (h = !0)) }).on("focusin submit validate", "form,." + k, function (t) { if (null === z(this, t)) { var i, n = e(this); !n.data(p) && (i = l(this)) && (e.isemptyobject(i.fields) ? (z(this, t, t), n.off(v).removedata(p)) : "focusin" === t.type ? i._focusin(t) : i._submit(t)) } }), new a({ fallback: "this field is not valid.", loading: "validating..." }), new s({ required: function (t, i) { var n = this, s = u(n.value), a = !0; if (i) if (1 === i.length) { if (g(i[0])) { if (n.rules[i[0]]) { if (!s && !n.test(t, i[0])) return z(t, x, null), null; z(t, x, !0) } } else if (!s && !e(i[0], n.$el).length) return null } else if ("not" === i[0]) e.each(i.slice(1), function () { return a = s !== u(this) }); else if ("from" === i[0]) { var r, l = n.$el.find(i[1]), o = "_validated_"; return a = l.filter(function () { var e = n.getfield(this); return e && !!u(e.getvalue()) }).length >= (i[2] || 1), a ? s || (r = null) : r = u(l[0], n) || !1, e(t).data(o) || l.data(o, 1).each(function () { t !== this && n._validate(this) }).removedata(o), r } return a && !!s }, integer: function (e, t) { var i, n = "0|", s = "[1-9]\\d*", a = t ? t[0] : "*"; switch (a) { case "+": i = s; break; case "-": i = "-" + s; break; case "+0": i = n + s; break; case "-0": i = n + "-" + s; break; default: i = n + "-?" + s } return i = "^(?:" + i + ")$", new regexp(i).test(this.value) || this.messages.integer[a] }, match: function (t, i) { if (i) { var n, s, a, r, l, o, u, d, c = this, g = "eq"; if (1 === i.length ? a = i[0] : (g = i[0], a = i[1]), o = m(a), u = c.$el.find(o)[0]) { if (d = c.getfield(u), n = c.value, s = d.getvalue(), c._match || (c.$el.on("valid" + y + v, o, function () { e(t).trigger("validate") }), c._match = d._match = 1), !c.required && "" === n && "" === s) return null; if (l = i[2], l && (/^date(time)?$/i.test(l) ? (n = f(n), s = f(s)) : "time" === l && (n = +n.replace(/:/g, ""), s = +s.replace(/:/g, ""))), "eq" !== g && !isnan(+n) && isnan(+s)) return !0; switch (r = c.messages.match[g].replace("{1}", c._getdisplay(t, d.display || a)), g) { case "lt": return +n < +s || r; case "lte": return +n <= +s || r; case "gte": return +n >= +s || r; case "gt": return +n > +s || r; case "neq": return n !== s || r; default: return n === s || r } } } }, range: function (e, t) { return this.getrangemsg(this.value, t) }, checked: function (e, t) { if (c(e)) { var i, n, s = this; return e.name ? n = s.$el.find('input[name="' + e.name + '"]').filter(function () { var e = this; return !i && c(e) && (i = e), !e.disabled && e.checked }).length : (i = e, n = i.checked), t ? s.getrangemsg(n, t) : !!n || u(i, s, "") || s.messages.required } }, length: function (e, t) { var i = this.value, n = ("true" === t[1] ? i.replace(d, "xx") : i).length; return this.getrangemsg(n, t, t[1] ? "_2" : "") }, remote: function (t, i) { if (i) { var n, s = this, a = h.exec(i[0]), r = s._rules[s._i], l = {}, o = "", u = a[3], d = a[2] || "post", c = (a[1] || "").tolowercase(); return r.must = !0, l[t.name] = s.value, i[1] && e.map(i.slice(1), function (e) { var t, i; ~e.indexof("=") ? o += "&" + e : (t = e.split(":"), e = u(t[0]), i = u(t[1]) || e, l[e] = s.$el.find(m(i)).val()) }), l = e.param(l) + o, !s.must && r.data && r.data === l ? r.result : ("cors" !== c && /^https?:/.test(u) && !~u.indexof(location.host) && (n = "jsonp"), e.ajax({ url: u, type: d, data: l, datatype: n })) } }, filter: function (e, t) { var i = this.value, n = i.replace(t ? new regexp("[" + t[0] + "]", "gm") : l, ""); n !== i && this.setvalue(n) } }), i.config = function (t, i) { function n(e, t) { "rules" === e ? new s(t) : "messages" === e ? new a(t) : e in y ? y[e] = t : k[e] = t } q(t) ? e.each(t, n) : j(t) && n(t, i) }, i.settheme = function (t, i) { q(t) ? e.extend(!0, z, t) : j(t) && q(i) && (z[t] = e.extend(z[t], i)) }, i.load = function (t) { if (t) { var n, s, a, r = document, l = {}, o = r.scripts[0]; t.replace(/([^?=&]+)=([^&#]*)/g, function (e, t, i) { l[t] = i }), n = l.dir || i.dir, i.css || "" === l.css || (s = r.createelement("link"), s.rel = "stylesheet", s.href = i.css = n + "jquery.validator.css", o.parentnode.insertbefore(s, o)), !i.local && ~t.indexof("local") && "" !== l.local && (i.local = (l.local || r.documentelement.lang || "en").replace("_", "-"), i.pending = 1, s = r.createelement("script"), s.src = n + "local/" + i.local + ".js", a = "onload" in s ? "onload" : "onreadystatechange", s[a] = function () { s.readystate && !/loaded|complete/.test(s.readystate) || (s = s[a] = null, delete i.pending, e(window).triggerhandler("validatorready")) }, o.parentnode.insertbefore(s, o)) } }, function () { for (var e, t, n = document.scripts, s = n.length, a = /(.*validator(?:\.min)?.js)(\?.*(?:local|css|dir)(?:=[\w\-]*)?)?/; s-- && !t;) e = n[s], t = (e.hasattribute ? e.src : e.getattribute("src", 4) || "").match(a); t && (i.dir = t[1].split("/").slice(0, -1).join("/") + "/", i.load(t[2])) }(), e[p] = i });