1/*! 2 * Parsleyjs 3 * Guillaume Potier - <[email protected]> 4 * Version 2.0.5 - built Thu Aug 28 2014 11:33:36 5 * MIT Licensed 6 * 7 */ 8!function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : t(jQuery) }(function (t) { 9 void 0 === t && void 0 !== window.jQuery && (t = window.jQuery); var e = { attr: function (t, e, i) { var s, n = {}, r = this.msieversion(), a = RegExp("^" + e, "i"); if (void 0 === t || void 0 === t[0]) return {}; for (var o in t[0].attributes) if (s = t[0].attributes[o], void 0 !== s && null !== s && (!r || r >= 8 || s.specified) && a.test(s.name)) { if (void 0 !== i && RegExp(i + "$", "i").test(s.name)) return !0; n[this.camelize(s.name.replace(e, ""))] = this.deserializeValue(s.value) } return void 0 === i ? n : !1 }, setAttr: function (t, e, i, s) { t[0].setAttribute(this.dasherize(e + i), s + "") }, get: function (t, e) { for (var i = 0, s = (e || "").split(".") ; this.isObject(t) || this.isArray(t) ;) if (t = t[s[i++]], i === s.length) return t; return void 0 }, hash: function (t) { return (Math.random() + "").substring(2, t ? t + 2 : 9) }, isArray: function (t) { return "[object Array]" === Object.prototype.toString.call(t) }, isObject: function (t) { return t === Object(t) }, deserializeValue: function (e) { var i; try { return e ? "true" == e || ("false" == e ? !1 : "null" == e ? null : isNaN(i = +e) ? /^[\[\{]/.test(e) ? t.parseJSON(e) : e : i) : e } catch (s) { return e } }, camelize: function (t) { return t.replace(/-+(.)?/g, function (t, e) { return e ? e.toUpperCase() : "" }) }, dasherize: function (t) { return t.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase() }, msieversion: function () { var t = window.navigator.userAgent, e = t.indexOf("MSIE "); return e > 0 || navigator.userAgent.match(/Trident.*rv\:11\./) ? parseInt(t.substring(e + 5, t.indexOf(".", e)), 10) : 0 } }, i = { namespace: "data-parsley-", inputs: "input, textarea, select", excluded: "input[type=button], input[type=submit], input[type=reset], input[type=hidden]", priorityEnabled: !0, uiEnabled: !0, validationThreshold: 3, focus: "first", trigger: !1, errorClass: "parsley-error", successClass: "parsley-success", classHandler: function () { }, errorsContainer: function () { }, errorsWrapper: '<ul class="parsley-errors-list"></ul>', errorTemplate: "<li></li>" }, s = function () { }; s.prototype = { asyncSupport: !1, actualizeOptions: function () { return this.options = this.OptionsFactory.get(this), this }, validateThroughValidator: function (t, e, i) { return window.ParsleyValidator.validate.apply(window.ParsleyValidator, [t, e, i]) }, subscribe: function (e, i) { return t.listenTo(this, e.toLowerCase(), i), this }, unsubscribe: function (e) { return t.unsubscribeTo(this, e.toLowerCase()), this }, reset: function () { if ("ParsleyForm" !== this.__class__) return t.emit("parsley:field:reset", this); for (var e = 0; e < this.fields.length; e++) t.emit("parsley:field:reset", this.fields[e]); t.emit("parsley:form:reset", this) }, destroy: function () { if ("ParsleyForm" !== this.__class__) return this.$element.removeData("Parsley"), this.$element.removeData("ParsleyFieldMultiple"), void t.emit("parsley:field:destroy", this); for (var e = 0; e < this.fields.length; e++) this.fields[e].destroy(); this.$element.removeData("Parsley"), t.emit("parsley:form:destroy", this) } }; var n = function () { var t = {}, e = function (t) { this.__class__ = "Validator", this.__version__ = "1.0.0", this.options = t || {}, this.bindingKey = this.options.bindingKey || "_validatorjsConstraint" }; e.prototype = { constructor: e, validate: function (t, e, i) { if ("string" != typeof t && "object" != typeof t) throw Error("You must validate an object or a string"); return "string" == typeof t || a(t) ? this._validateString(t, e, i) : this.isBinded(t) ? this._validateBindedObject(t, e) : this._validateObject(t, e, i) }, bind: function (t, e) { if ("object" != typeof t) throw Error("Must bind a Constraint to an object"); return t[this.bindingKey] = new i(e), this }, unbind: function (t) { return void 0 === t._validatorjsConstraint ? this : (delete t[this.bindingKey], this) }, isBinded: function (t) { return void 0 !== t[this.bindingKey] }, getBinded: function (t) { return this.isBinded(t) ? t[this.bindingKey] : null }, _validateString: function (t, e, i) { var r, o = []; a(e) || (e = [e]); for (var l = 0; l < e.length; l++) { if (!(e[l] instanceof n)) throw Error("You must give an Assert or an Asserts array to validate a string"); r = e[l].check(t, i), r instanceof s && o.push(r) } return o.length ? o : !0 }, _validateObject: function (t, e, s) { if ("object" != typeof e) throw Error("You must give a constraint to validate an object"); return e instanceof i ? e.check(t, s) : new i(e).check(t, s) }, _validateBindedObject: function (t, e) { return t[this.bindingKey].check(t, e) } }, e.errorCode = { must_be_a_string: "must_be_a_string", must_be_an_array: "must_be_an_array", must_be_a_number: "must_be_a_number", must_be_a_string_or_array: "must_be_a_string_or_array" }; var i = function (t, e) { if (this.__class__ = "Constraint", this.options = e || {}, this.nodes = {}, t) try { this._bootstrap(t) } catch (i) { throw Error("Should give a valid mapping object to Constraint", i, t) } }; i.prototype = { constructor: i, check: function (t, e) { var i, s = {}; for (var o in this.nodes) { for (var l = !1, u = this.get(o), h = a(u) ? u : [u], d = h.length - 1; d >= 0; d--) "Required" !== h[d].__class__ || (l = h[d].requiresValidation(e)); if (this.has(o, t) || this.options.strict || l) try { this.has(o, this.options.strict || l ? t : void 0) || (new n).HaveProperty(o).validate(t), i = this._check(o, t[o], e), (a(i) && i.length > 0 || !a(i) && !r(i)) && (s[o] = i) } catch (c) { s[o] = c } } return r(s) ? !0 : s }, add: function (t, e) { if (e instanceof n || a(e) && e[0] instanceof n) return this.nodes[t] = e, this; if ("object" == typeof e && !a(e)) return this.nodes[t] = e instanceof i ? e : new i(e), this; throw Error("Should give an Assert, an Asserts array, a Constraint", e) }, has: function (t, e) { return e = void 0 !== e ? e : this.nodes, void 0 !== e[t] }, get: function (t, e) { return this.has(t) ? this.nodes[t] : e || null }, remove: function (t) { var e = []; for (var i in this.nodes) i !== t && (e[i] = this.nodes[i]); return this.nodes = e, this }, _bootstrap: function (t) { if (t instanceof i) return this.nodes = t.n
9odes; for (var e in t) this.add(e, t[e]) }, _check: function (t, e, s) { if (this.nodes[t] instanceof n) return this._checkAsserts(e, [this.nodes[t]], s); if (a(this.nodes[t])) return this._checkAsserts(e, this.nodes[t], s); if (this.nodes[t] instanceof i) return this.nodes[t].check(e, s); throw Error("Invalid node", this.nodes[t]) }, _checkAsserts: function (t, e, i) { for (var s, n = [], r = 0; r < e.length; r++) s = e[r].check(t, i), void 0 !== s && !0 !== s && n.push(s); return n } }; var s = function (t, e, i) { if (this.__class__ = "Violation", !(t instanceof n)) throw Error("Should give an assertion implementing the Assert interface"); this.assert = t, this.value = e, void 0 !== i && (this.violation = i) }; s.prototype = { show: function () { var t = { assert: this.assert.__class__, value: this.value }; return this.violation && (t.violation = this.violation), t }, __toString: function () { return void 0 !== this.violation && (this.violation = '", ' + this.getViolation().constraint + " expected was " + this.getViolation().expected), this.assert.__class__ + ' assert failed for "' + this.value + this.violation || "" }, getViolation: function () { var t, e; for (t in this.violation) e = this.violation[t]; return { constraint: t, expected: e } } }; var n = function (t) { this.__class__ = "Assert", this.__parentClass__ = this.__class__, this.groups = [], void 0 !== t && this.addGroup(t) }; n.prototype = { construct: n, requiresValidation: function (t) { return t && !this.hasGroup(t) ? !1 : !t && this.hasGroups() ? !1 : !0 }, check: function (t, e) { if (this.requiresValidation(e)) try { return this.validate(t, e) } catch (i) { return i } }, hasGroup: function (t) { return a(t) ? this.hasOneOf(t) : "Any" === t ? !0 : this.hasGroups() ? -1 !== this.groups.indexOf(t) : "Default" === t }, hasOneOf: function (t) { for (var e = 0; e < t.length; e++) if (this.hasGroup(t[e])) return !0; return !1 }, hasGroups: function () { return this.groups.length > 0 }, addGroup: function (t) { return a(t) ? this.addGroups(t) : (this.hasGroup(t) || this.groups.push(t), this) }, removeGroup: function (t) { for (var e = [], i = 0; i < this.groups.length; i++) t !== this.groups[i] && e.push(this.groups[i]); return this.groups = e, this }, addGroups: function (t) { for (var e = 0; e < t.length; e++) this.addGroup(t[e]); return this }, HaveProperty: function (t) { return this.__class__ = "HaveProperty", this.node = t, this.validate = function (t) { if (void 0 === t[this.node]) throw new s(this, t, { value: this.node }); return !0 }, this }, Blank: function () { return this.__class__ = "Blank", this.validate = function (t) { if ("string" != typeof t) throw new s(this, t, { value: e.errorCode.must_be_a_string }); if ("" !== t.replace(/^\s+/g, "").replace(/\s+$/g, "")) throw new s(this, t); return !0 }, this }, Callback: function (t) { if (this.__class__ = "Callback", this.arguments = Array.prototype.slice.call(arguments), 1 === this.arguments.length ? this.arguments = [] : this.arguments.splice(0, 1), "function" != typeof t) throw Error("Callback must be instanciated with a function"); return this.fn = t, this.validate = function (t) { var e = this.fn.apply(this, [t].concat(this.arguments)); if (!0 !== e) throw new s(this, t, { result: e }); return !0 }, this }, Choice: function (t) { if (this.__class__ = "Choice", !a(t) && "function" != typeof t) throw Error("Choice must be instanciated with an array or a function"); return this.list = t, this.validate = function (t) { for (var e = "function" == typeof this.list ? this.list() : this.list, i = 0; i < e.length; i++) if (t === e[i]) return !0; throw new s(this, t, { choices: e }) }, this }, Collection: function (t) { return this.__class__ = "Collection", this.constraint = void 0 !== t ? t instanceof n ? t : new i(t) : !1, this.validate = function (t, i) { var n, o = new e, l = 0, u = {}, h = this.groups.length ? this.groups : i; if (!a(t)) throw new s(this, array, { value: e.errorCode.must_be_an_array }); for (var d = 0; d < t.length; d++) n = this.constraint ? o.validate(t[d], this.constraint, h) : o.validate(t[d], h), r(n) || (u[l] = n), l++; return r(u) ? !0 : u }, this }, Count: function (t) { return this.__class__ = "Count", this.count = t, this.validate = function (t) { if (!a(t)) throw new s(this, t, { value: e.errorCode.must_be_an_array }); var i = "function" == typeof this.count ? this.count(t) : this.count; if (isNaN(+i)) throw Error("Count must be a valid interger", i); if (i !== t.length) throw new s(this, t, { count: i }); return !0 }, this }, Email: function () { return this.__class__ = "Email", this.validate = function (t) { var i = /^((([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; if ("string" != typeof t) throw new s(this, t, { value: e.errorCode.must_be_a_string }); if (!i.test(t)) throw new s(this, t); return !0 }, this }, EqualTo: function (t) { if (this.__class__ = "EqualTo", void 0 === t) throw Error("EqualTo must be instanciated with a value or a function"); return this.reference = t, this.validate = function (t) { var e = "function" == typeof this.reference ? this.reference(t) : this.reference; if (e !== t) throw new s(this, t, { value: e }); return !0 }, this }, GreaterThan: function (t) { if (this.__class__ = "GreaterThan", void 0 === t) throw Error("Should give a threshold value"); return this.threshold = t, this.validate = function (t) { if ("" === t || isNaN(+t)) throw new s(this, t, { value: e.errorCode.must_be_a_number }); if (this.threshold >= t) throw new s(this, t, { threshold: this.threshold }); return !0 }, this }, GreaterThanOrEqual: function (t) { if (this.__class__ = "GreaterThanOrEqual", void 0 === t) throw Error("Should give a threshold value"); return this.threshold = t, this.validate = function (t) { if ("" === t || isNaN(+t)) throw new s(this, t, { value: e.errorCode.must_be_a_number }); if (this.threshold > t) throw new s(this, t, { threshold: this.threshold }); return !0 }, this }, InstanceOf: function (t) { if (this.__class__ = "InstanceOf", void 0 === t) throw Error("InstanceOf must be instanciated with a value"); return this.classRef = t, this.validate = function (t) { if (1 != t instanceof this.classRef) throw new s(this, t, { classRef: this.classRef }); return !0 }, this }, Length: function (t) { if (this.__class__ = "Length", !t.min && !t.max) throw Error("Lenth assert must be instanciated with a { min: x, max: y } object"); return this.min = t.min, this.max = t.max, this.validate = function (t) { if ("string" != typeof t && !a(t)) throw new s(this, t, { value: e.errorCode.must_be_a_string_or_array }); if (void 0 !== this.min && this.min === this.max && t.length !== this.min) throw new s(this, t, { min: this.min, max: this.max }); if (void 0 !== this.max && t.length > this.max) throw new s(this, t, { max: this.max }); if (void 0 !== this.min && t.length < this.min) throw new s(this, t, { min: this.min }); return !0 }, this }, LessThan: function (t) { if (this.__class__ = "LessThan", void 0 === t) throw Error("Should give a threshold value"); return this.threshold = t, this.validate = function (t) { if ("" === t || isNaN(+t)) throw new s(this, t, { value: e.errorCode.must_be_a_number }); if (this.threshold <= t) throw new s(this, t, { threshold: this.threshold }); return !0 }, this }, LessThanOrEqual: function (t) { if (this.__class__ = "LessThanOrEqual", void 0 === t) throw Error("Should give a threshold value"); return this.threshold = t, this.validate = function (t) { if ("" === t || isNaN(+t)) throw new s(this, t, { value: e.errorCode.must_be_a_number }); if (this.threshold < t) throw new s(this, t, { threshold: this.threshold }); return !0 }, this }, NotNull: function () { return this.__class__ = "NotNull", this.validate = function (t) { if (null === t || void 0 === t) throw new s(this, t); return !0 }, this }, NotBlank: function () { return this.__class__ = "NotBlank", this.validate = function (t) { if ("string" != typeof t) throw new s(this, t, { value: e.errorCode.must_be_a_string }); if ("" === t.replace(/^\s+/g, "").replace(/\s+$/g, "")) throw new s(this, t); return !0 }, this }, Null: function () { return this.__class__ = "Null", this.validate = function (t) { if (null !== t) throw new s(this, t); return !0 }, this }, Range: function (t, e) { if (this.__class__ = "Range", void 0 === t || void 0 === e) throw Error("Range assert expects min and max values"); return this.min = t, this.max = e, this.validate = function (t) { try { return "string" == typeof t && isNaN(+t) || a(t) ? (new n).Length({ min: this.min, max: this.max }).validate(t) : (new n).GreaterThanOrEqual(this.min).validate(t) && (new n).LessThanOrEqual(this.max).validate(t), !0 } catch (e) { throw new s(this, t, e.violation) } return !0 }, this }, Regexp: function (t, i) { if (this.__class__ = "Regexp", void 0 === t) throw Error("You must give a regexp"); return this.regexp = t, this.flag = i || "", this.validate = function (t) { if ("string" != typeof t) throw new s(this, t, { value: e.errorCode.must_be_a_string }); if (!RegExp(this.regexp, this.flag).test(t)) throw new s(this, t, { regexp: this.regexp, flag: this.flag }); return !0 }, this }, Required: function () { return this.__class__ = "Required", this.validate = function (t) { if (void 0 === t) throw new s(this, t); try { "string" == typeof t ? (new n).NotNull().validate(t) && (new n).NotBlank().validate(t) : !0 === a(t) && (new n).Length({ min: 1 }).validate(t) } catch (e) { throw new s(this, t) } return !0 }, this }, Unique: function (t) { return this.__class__ = "Unique", "object" == typeof t && (this.key = t.key), this.validate = function (t) { var i, n = []; if (!a(t)) throw new s(this, t, { value: e.errorCode.must_be_an_array }); for (var r = 0; r < t.length; r++) if (i = "object" == typeof t[r] ? t[r][this.key] : t[r], void 0 !== i) { if (-1 !== n.indexOf(i)) throw new s(this, t, { value: i }); n.push(i) } return !0 }, this } }, t.Assert = n, t.Validator = e, t.Violation = s, t.Constraint = i, Array.prototype.indexOf || (Array.prototype.indexOf = function (t) { if (null === this) throw new TypeError; var e = Object(this), i = e.length >>> 0; if (0 === i) return -1; var s = 0; if (arguments.length > 1 && (s = +arguments[1], s != s ? s = 0 : 0 !== s && 1 / 0 != s && s != -1 / 0 && (s = (s > 0 || -1) * Math.floor(Math.abs(s)))), s >= i) return -1; for (var n = 0 > s ? Math.max(i - Math.abs(s), 0) : s; i > n; n++) if (n in e && e[n] === t) return n; return -1 }); var r = function (t) { for (var e in t) return !1; return !0 }, a = function (t) { return "[object Array]" === Object.prototype.toString.call(t) }; return "function" == typeof define && define.amd ? define("vendors/validator.js/dist/validator", [], function () { return t }) : "undefined" != typeof module && module.exports ? module.exports = t : window["undefined" != typeof validatorjs_ns ? validatorjs_ns : "Validator"] = t, t }(); n = void 0 !== n ? n : "undefined" != typeof module ? module.exports : null; var r = function (t, e) { this.__class__ = "ParsleyValidator", this.Validator = n, this.locale = "en", this.init(t || {}, e || {}) }; r.prototype = { init: function (e, i) { this.catalog = i; for (var s in e) this.addValidator(s, e[s].fn, e[s].priority, e[s].requirementsTransformer); t.emit("parsley:validator:init") }, setLocale: function (t) { if (void 0 === this.catalog[t]) throw Error(t + " is not available in the catalog"); return this.locale = t, this }, addCatalog: function (t, e, i) { return "object" == typeof e && (this.catalog[t] = e), !0 === i ? this.setLocale(t) : this }, addMessage: function (t, e, i) { return void 0 === this.catalog[t] && (this.catalog[t] = {}), this.catalog[t][e.toLowerCase()] = i, this }
9, validate: function () { return (new this.Validator.Validator).validate.apply(new n.Validator, arguments) }, addValidator: function (e, i, s, r) { return this.validators[e.toLowerCase()] = function (e) { return t.extend((new n.Assert).Callback(i, e), { priority: s, requirementsTransformer: r }) }, this }, updateValidator: function (t, e, i, s) { return this.addValidator(t, e, i, s) }, removeValidator: function (t) { return delete this.validators[t], this }, getErrorMessage: function (t) { var e; return e = "type" === t.name ? this.catalog[this.locale][t.name][t.requirements] : this.formatMessage(this.catalog[this.locale][t.name], t.requirements), "" !== e ? e : this.catalog[this.locale].defaultMessage }, formatMessage: function (t, e) { if ("object" == typeof e) { for (var i in e) t = this.formatMessage(t, e[i]); return t } return "string" == typeof t ? t.replace(RegExp("%s", "i"), e) : "" }, validators: { notblank: function () { return t.extend((new n.Assert).NotBlank(), { priority: 2 }) }, required: function () { return t.extend((new n.Assert).Required(), { priority: 512 }) }, type: function (e) { var i; switch (e) { case "email": i = (new n.Assert).Email(); break; case "range": case "number": i = (new n.Assert).Regexp("^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$"); break; case "integer": i = (new n.Assert).Regexp("^-?\\d+$"); break; case "digits": i = (new n.Assert).Regexp("^\\d+$"); break; case "alphanum": i = (new n.Assert).Regexp("^\\w+$", "i"); break; case "url": i = (new n.Assert).Regexp("(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)", "i"); break; default: throw Error("validator type `" + e + "` is not supported") } return t.extend(i, { priority: 256 }) }, pattern: function (e) { var i = ""; return /^\/.*\/(?:[gimy]*)$/.test(e) && (i = e.replace(/.*\/([gimy]*)$/, "$1"), e = e.replace(RegExp("^/(.*?)/" + i + "$"), "$1")), t.extend((new n.Assert).Regexp(e, i), { priority: 64 }) }, minlength: function (e) { return t.extend((new n.Assert).Length({ min: e }), { priority: 30, requirementsTransformer: function () { return "string" != typeof e || isNaN(e) ? e : parseInt(e, 10) } }) }, maxlength: function (e) { return t.extend((new n.Assert).Length({ max: e }), { priority: 30, requirementsTransformer: function () { return "string" != typeof e || isNaN(e) ? e : parseInt(e, 10) } }) }, length: function (e) { return t.extend((new n.Assert).Length({ min: e[0], max: e[1] }), { priority: 32 }) }, mincheck: function (t) { return this.minlength(t) }, maxcheck: function (t) { return this.maxlength(t) }, check: function (t) { return this.length(t) }, min: function (e) { return t.extend((new n.Assert).GreaterThanOrEqual(e), { priority: 30, requirementsTransformer: function () { return "string" != typeof e || isNaN(e) ? e : parseInt(e, 10) } }) }, max: function (e) { return t.extend((new n.Assert).LessThanOrEqual(e), { priority: 30, requirementsTransformer: function () { return "string" != typeof e || isNaN(e) ? e : parseInt(e, 10) } }) }, range: function (e) { return t.extend((new n.Assert).Range(e[0], e[1]), { priority: 32, requirementsTransformer: function () { for (var t = 0; t < e.length; t++) e[t] = "string" != typeof e[t] || isNaN(e[t]) ? e[t] : parseInt(e[t], 10); return e } }) }, equalto: function (e) { return t.extend((new n.Assert).EqualTo(e), { priority: 256, requirementsTransformer: function () { return t(e).length ? t(e).val() : e } }) } } }; var a = function () { this.__class__ = "ParsleyUI" }; a.prototype = { listen: function () { return t.listen("parsley:form:init", this, this.setupForm), t.listen("parsley:field:init", this, this.setupField), t.listen("parsley:field:validated", this, this.reflow), t.listen("parsley:form:validated", this, this.focus), t.listen("parsley:field:reset", this, this.reset), t.listen("parsley:form:destroy", this, this.destroy), t.listen("parsley:field:destroy", this, this.destroy), this }, reflow: function (t) { if (void 0 !== t._ui && !1 !== t._ui.active) { var e = this._diff(t.validationResult, t._ui.lastValidationResult);
9 t._ui.lastValidationResult = t.validationResult, t._ui.validatedOnce = !0, this.manageStatusClass(t), this.manageErrorsMessages(t, e), this.actualizeTriggers(t), (e.kept.length || e.added.length) && void 0 === t._ui.failedOnce && this.manageFailingFieldTrigger(t) } }, getErrorsMessages: function (t) { if (!0 === t.validationResult) return []; for (var e = [], i = 0; i < t.validationResult.length; i++) e.push(this._getErrorMessage(t, t.validationResult[i].assert)); return e }, manageStatusClass: function (t) { !0 === t.validationResult ? this._successClass(t) : t.validationResult.length > 0 ? this._errorClass(t) : this._resetClass(t) }, manageErrorsMessages: function (e, i) { if (void 0 === e.options.errorsMessagesDisabled) { if (void 0 !== e.options.errorMessage) return i.added.length || i.kept.length ? (0 === e._ui.$errorsWrapper.find(".parsley-custom-error-message").length && e._ui.$errorsWrapper.append(t(e.options.errorTemplate).addClass("parsley-custom-error-message")), e._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(e.options.errorMessage)) : e._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove(); for (var s = 0; s < i.removed.length; s++) this.removeError(e, i.removed[s].assert.name, !0); for (s = 0; s < i.added.length; s++) this.addError(e, i.added[s].assert.name, void 0, i.added[s].assert, !0); for (s = 0; s < i.kept.length; s++) this.updateError(e, i.kept[s].assert.name, void 0, i.kept[s].assert, !0) } }, addError: function (e, i, s, n, r) { e._ui.$errorsWrapper.addClass("filled").append(t(e.options.errorTemplate).addClass("parsley-" + i).html(s || this._getErrorMessage(e, n))), !0 !== r && this._errorClass(e) }, updateError: function (t, e, i, s, n) { t._ui.$errorsWrapper.addClass("filled").find(".parsley-" + e).html(i || this._getErrorMessage(t, s)), !0 !== n && this._errorClass(t) }, removeError: function (t, e, i) { t._ui.$errorsWrapper.removeClass("filled").find(".parsley-" + e).remove(), !0 !== i && this.manageStatusClass(t) }, focus: function (t) { if (!0 === t.validationResult || "none" === t.options.focus) return t._focusedField = null; t._focusedField = null; for (var e = 0; e < t.fields.length; e++) if (!0 !== t.fields[e].validationResult && t.fields[e].validationResult.length > 0 && void 0 === t.fields[e].options.noFocus) { if ("first" === t.options.focus) return t._focusedField = t.fields[e].$element, t._focusedField.focus(); t._focusedField = t.fields[e].$element } return null === t._focusedField ? null : t._focusedField.focus() }, _getErrorMessage: function (t, e) { var i = e.name + "Message"; return void 0 !== t.options[i] ? window.ParsleyValidator.formatMessage(t.options[i], e.requirements) : window.ParsleyValidator.getErrorMessage(e) }, _diff: function (t, e, i) { for (var s = [], n = [], r = 0; r < t.length; r++) { for (var a = !1, o = 0; o < e.length; o++) if (t[r].assert.name === e[o].assert.name) { a = !0; break } a ? n.push(t[r]) : s.push(t[r]) } return { kept: n, added: s, removed: i ? [] : this._diff(e, t, !0).added } }, setupForm: function (e) { e.$element.on("submit.Parsley", !1, t.proxy(e.onSubmitValidate, e)), !1 !== e.options.uiEnabled && e.$element.attr("novalidate", "") }, setupField: function (e) { var i = { active: !1 }; !1 !== e.options.uiEnabled && (i.active = !0, e.$element.attr(e.options.namespace + "id", e.__id__), i.$errorClassHandler = this._manageClassHandler(e), i.errorsWrapperId = "parsley-id-" + (void 0 !== e.options.multiple ? "multiple-" + e.options.multiple : e.__id__), i.$errorsWrapper = t(e.options.errorsWrapper).attr("id", i.errorsWrapperId), i.lastValidationResult = [], i.validatedOnce = !1, i.validationInformationVisible = !1, e._ui = i, e.$element.is(e.options.excluded) || this._insertErrorWrapper(e), this.actualizeTriggers(e)) }, _manageClassHandler: function (e) { if ("string" == typeof e.options.classHandler && t(e.options.classHandler).length) return t(e.options.classHandler); var i = e.options.classHandler(e); return void 0 !== i && i.length ? i : void 0 === e.options.multiple || e.$element.is("select") ? e.$element : e.$element.parent() }, _insertErrorWrapper: function (e) { var i;
9 if ("string" == typeof e.options.errorsContainer) { if (t(e.options.errorsContainer).length) return t(e.options.errorsContainer).append(e._ui.$errorsWrapper); window.console && window.console.warn && window.console.warn("The errors container `" + e.options.errorsContainer + "` does not exist in DOM") } else "function" == typeof e.options.errorsContainer && (i = e.options.errorsContainer(e)); return void 0 !== i && i.length ? i.append(e._ui.$errorsWrapper) : void 0 === e.options.multiple ? e.$element.after(e._ui.$errorsWrapper) : e.$element.parent().after(e._ui.$errorsWrapper) }, actualizeTriggers: function (e) { var i = this; if (e.options.multiple ? t("[" + e.options.namespace + 'multiple="' + e.options.multiple + '"]').each(function () { t(this).off(".Parsley") }) : e.$element.off(".Parsley"), !1 !== e.options.trigger) { var s = e.options.trigger.replace(/^\s+/g, "").replace(/\s+$/g, ""); "" !== s && (e.options.multiple ? t("[" + e.options.namespace + 'multiple="' + e.options.multiple + '"]').each(function () { t(this).on(s.split(" ").join(".Parsley ") + ".Parsley", !1, t.proxy("function" == typeof e.eventValidate ? e.eventValidate : i.eventValidate, e)) }) : e.$element.on(s.split(" ").join(".Parsley ") + ".Parsley", !1, t.proxy("function" == typeof e.eventValidate ? e.eventValidate : this.eventValidate, e))) } }, eventValidate: function (t) { RegExp("key").test(t.type) && !this._ui.validationInformationVisible && this.getValue().length <= this.options.validationThreshold || (this._ui.validatedOnce = !0, this.validate()) }, manageFailingFieldTrigger: function (e) { return e._ui.failedOnce = !0, e.options.multiple && t("[" + e.options.namespace + 'multiple="' + e.options.multiple + '"]').each(function () { return RegExp("change", "i").test(t(this).parsley().options.trigger || "") ? void 0 : t(this).on("change.ParsleyFailedOnce", !1, t.proxy(e.validate, e)) }), e.$element.is("select") && !RegExp("change", "i").test(e.options.trigger || "") ? e.$element.on("change.ParsleyFailedOnce", !1, t.proxy(e.validate, e)) : RegExp("keyup", "i").test(e.options.trigger || "") ? void 0 : e.$element.on("keyup.ParsleyFailedOnce", !1, t.proxy(e.validate, e)) }, reset: function (e) { e.$element.off(".Parsley"), e.$element.off(".ParsleyFailedOnce"), void 0 !== e._ui && "ParsleyForm" !== e.__class__ && (e._ui.$errorsWrapper.children().each(function () { t(this).remove() }), this._resetClass(e), e._ui.validatedOnce = !1, e._ui.lastValidationResult = [], e._ui.validationInformationVisible = !1) }, destroy: function (t) { this.reset(t), "ParsleyForm" !== t.__class__ && (void 0 !== t._ui && t._ui.$errorsWrapper.remove(), delete t._ui) }, _successClass: function (t) { t._ui.validationInformationVisible = !0, t._ui.$errorClassHandler.removeClass(t.options.errorClass).addClass(t.options.successClass) }, _errorClass: function (t) { t._ui.validationInformationVisible = !0, t._ui.$errorClassHandler.removeClass(t.options.successClass).addClass(t.options.errorClass) }, _resetClass: function (t) { t._ui.$errorClassHandler.removeClass(t.options.successClass).removeClass(t.options.errorClass) } }; var o = function (i, s, n, r) { this.__class__ = "OptionsFactory", this.__id__ = e.hash(4), this.formOptions = null, this.fieldOptions = null, this.staticOptions = t.extend(!0, {}, i, s, n, { namespace: r }) }; o.prototype = { get: function (t) { if (void 0 === t.__class__) throw Error("Parsley Instance expected"); switch (t.__class__) { case "Parsley": return this.staticOptions; case "ParsleyForm": return this.getFormOptions(t); case "ParsleyField": case "ParsleyFieldMultiple": return this.getFieldOptions(t); default: throw Error("Instance " + t.__class__ + " is not supported") } }, getFormOptions: function (i) { return this.formOptions = e.attr(i.$element, this.staticOptions.namespace), t.extend({}, this.staticOptions, this.formOptions) }, getFieldOptions: function (i) { return this.fieldOptions = e.attr(i.$element, this.staticOptions.namespace), null === this.formOptions && void 0 !== i.parent && (this.formOptions = this.getFormOptions(i.parent)), t.extend({}, this.staticOptions, this.formOptions, this.fieldOptions) } }; var l = function (i, s) { if (this.__class__ = "ParsleyForm", this.__id__ = e.hash(4), "OptionsFactory" !== e.get(s, "__class__")) throw Error("You must give an OptionsFactory instance"); this.OptionsFactory = s, this.$element = t(i), this.validationResult = null, this.options = this.OptionsFactory.get(this) }; l.prototype = { onSubmitValidate: function (e) { return this.validate(void 0, void 0, e), !1 === this.validationResult && e instanceof t.Event && (e.stopImmediatePropagation(), e.preventDefault()), this }
9, validate: function (e, i, s) { this.submitEvent = s, this.validationResult = !0; var n = []; this._refreshFields(), t.emit("parsley:form:validate", this); for (var r = 0; r < this.fields.length; r++) (!e || this._isFieldInGroup(this.fields[r], e)) && (n = this.fields[r].validate(i), !0 !== n && n.length > 0 && this.validationResult && (this.validationResult = !1)); return t.emit("parsley:form:validated", this), this.validationResult }, isValid: function (t, e) { this._refreshFields(); for (var i = 0; i < this.fields.length; i++) if ((!t || this._isFieldInGroup(this.fields[i], t)) && !1 === this.fields[i].isValid(e)) return !1; return !0 }, _isFieldInGroup: function (i, s) { return e.isArray(i.options.group) ? -1 !== t.inArray(i.options.group, s) : i.options.group === s }, _refreshFields: function () { return this.actualizeOptions()._bindFields() }, _bindFields: function () { var t = this; return this.fields = [], this.fieldsMappedById = {}, this.$element.find(this.options.inputs).each(function () { var e = new window.Parsley(this, {}, t); "ParsleyField" !== e.__class__ && "ParsleyFieldMultiple" !== e.__class__ || e.$element.is(e.options.excluded) || void 0 === t.fieldsMappedById[e.__class__ + "-" + e.__id__] && (t.fieldsMappedById[e.__class__ + "-" + e.__id__] = e, t.fields.push(e)) }), this } }; var u = function (i, s, n, r, a) { if (!RegExp("ParsleyField").test(e.get(i, "__class__"))) throw Error("ParsleyField or ParsleyFieldMultiple instance expected"); if ("function" != typeof window.ParsleyValidator.validators[s] && "Assert" !== window.ParsleyValidator.validators[s](n).__parentClass__) throw Error("Valid validator expected"); var o = function (t, i) { return void 0 !== t.options[i + "Priority"] ? t.options[i + "Priority"] : e.get(window.ParsleyValidator.validators[i](n), "priority") || 2 }; return r = r || o(i, s), "function" == typeof window.ParsleyValidator.validators[s](n).requirementsTransformer && (n = window.ParsleyValidator.validators[s](n).requirementsTransformer()), t.extend(window.ParsleyValidator.validators[s](n), { name: s, requirements: n, priority: r, groups: [r], isDomConstraint: a || e.attr(i.$element, i.options.namespace, s) }) }, h = function (i, s, n) { this.__class__ = "ParsleyField", this.__id__ = e.hash(4), this.$element = t(i), void 0 !== n ? (this.parent = n, this.OptionsFactory = this.parent.OptionsFactory, this.options = this.OptionsFactory.get(this)) : (this.OptionsFactory = s, this.options = this.OptionsFactory.get(this)), this.constraints = [], this.constraintsByName = {}, this.validationResult = [], this._bindConstraints() }; h.prototype = { 10 validate: function (e) { return this.value = this.getValue(), t.emit("parsley:field:validate", this), t.emit("parsley:field:" + (this.isValid(e, this.value) ? "success" : "error"), this), t.emit("parsley:field:validated", this), this.validationResult }, isValid: function (t, e) { this.refreshConstraints(); var i = this._getConstraintsSortedPriorities(); if (e = e || this.getValue(), 0 === e.length && !this._isRequired() && void 0 === this.options.validateIfEmpty && !0 !== t) return this.validationResult = []; if (!1 === this.options.priorityEnabled) return !0 === (this.validationResult = this.validateThroughValidator(e, this.constraints, "Any")); for (var s = 0; s < i.length; s++) if (!0 !== (this.validationResult = this.validateThroughValidator(e, this.constraints, i[s]))) return !1; return !0 }, getValue: function () { var t; return t = void 0 !== this.options.value ? this.options.value : this.$element.val(), void 0 === t || null === t ? "" : !0 === this.options.trimValue ? t.replace(/^\s+|\s+$/g, "") : t }, refreshConstraints: function () { return this.actualizeOptions()._bindConstraints() }, addConstraint: function (t, e, i, s) { if (t = t.toLowerCase(), "function" == typeof window.ParsleyValidator.validators[t]) { var n = new u(this, t, e, i, s); "undefined" !== this.constraintsByName[n.name] && this.removeConstraint(n.name), this.constraints.push(n), this.constraintsByName[n.name] = n } return this }, removeConstraint: function (t) { for (var e = 0; e < this.constraints.length; e++) if (t === this.constraints[e].name) { this.constraints.splice(e, 1); break } return this }, updateConstraint: function (t, e, i) { return this.removeConstraint(t).addConstraint(t, e, i) }, _bindConstraints: function () { 11 for (var t = [], e = 0; e < this.constraints.length; e++) !1 === this.constraints[e].isDomConstraint && t.push(this.constraints[e]); 12 this.constraints = t; for (var i in this.options) this.addConstraint(i, this.options[i]); return this._bindHtml5Constraints() 13 }, _bindHtml5Constraints: function () { (this.$element.hasClass("required") || this.$element.attr("required")) && this.addConstraint("required", !0, void 0, !0), "string" == typeof this.$element.attr("pattern") && this.addConstraint("pattern", this.$element.attr("pattern"), void 0, !0), void 0 !== this.$element.attr("min") && void 0 !== this.$element.attr("max") ? this.addConstraint("range", [this.$element.attr("min"), this.$element.attr("max")], void 0, !0) : void 0 !== this.$element.attr("min") ? this.addConstraint("min", this.$element.attr("min"), void 0, !0) : void 0 !== this.$element.attr("max") && this.addConstraint("max", this.$element.attr("max"), void 0, !0); var t = this.$element.attr("type"); return void 0 === t ? this : "number" === t ? this.addConstraint("type", "integer", void 0, !0) : RegExp(t, "i").test("email url range") ? this.addConstraint("type", t, void 0, !0) : this }, _isRequired: function () { return void 0 === this.constraintsByName.required ? !1 : !1 !== this.constraintsByName.required.requirements }, _getConstraintsSortedPriorities: function () { for (var t = [], e = 0; e < this.constraints.length; e++) -1 === t.indexOf(this.constraints[e].priority) && t.push(this.constraints[e].priority); return t.sort(function (t, e) { return e - t }), t } 14 }; var d = function () { this.__class__ = "ParsleyFieldMultiple" }; d.prototype = { addElement: function (t) { return this.$elements.push(t), this }, refreshConstraints: function () { var e; if (this.constraints = [], this.$element.is("select")) return this.actualizeOptions()._bindConstraints(), this; for (var i = 0; i < this.$elements.length; i++) if (t("html").has(this.$elements[i]).length) { e = this.$elements[i].data("ParsleyFieldMultiple").refreshConstraints().constraints; for (var s = 0; s < e.length; s++) this.addConstraint(e[s].name, e[s].requirements, e[s].priority, e[s].isDomConstraint) } else this.$elements.splice(i, 1); return this }, getValue: function () { if (void 0 === this.options.value) { if (this.options.value, this.$element.is("input[type=radio]")) return t("[" + this.options.namespace + 'multiple="' + this.options.multiple + '"]:checked').val() || ""; if (this.$element.is("input[type=checkbox]")) { var e = []; return t("[" + this.options.namespace + 'multiple="' + this.options.multiple + '"]:checked').each(function () { e.push(t(this).val()) }), e.length ? e : [] } return this.$element.is("select") && null === this.$element.val() ? [] : this.$element.val() } }, _init: function (t) { return this.$elements = [this.$element], this.options.multiple = t, this } }; var c = t({}), f = {}; t.listen = function (t) { if (void 0 === f[t] && (f[t] = []), "function" == typeof arguments[1]) return f[t].push({ fn: arguments[1] }); if ("object" == typeof arguments[1] && "function" == typeof arguments[2]) return f[t].push({ fn: arguments[2], ctxt: arguments[1] }); throw Error("Wrong parameters") }, t.listenTo = function (t, e, i) { if (void 0 === f[e] && (f[e] = []), !(t instanceof h || t instanceof l)) throw Error("Mu
14st give Parsley instance"); if ("string" != typeof e || "function" != typeof i) throw Error("Wrong parameters"); f[e].push({ instance: t, fn: i }) }, t.unsubscribe = function (t, e) { if (void 0 !== f[t]) { if ("string" != typeof t || "function" != typeof e) throw Error("Wrong arguments"); for (var i = 0; i < f[t].length; i++) if (f[t][i].fn === e) return f[t].splice(i, 1) } }, t.unsubscribeTo = function (t, e) { if (void 0 !== f[e]) { if (!(t instanceof h || t instanceof l)) throw Error("Must give Parsley instance"); for (var i = 0; i < f[e].length; i++) if (void 0 !== f[e][i].instance && f[e][i].instance.__id__ === t.__id__) return f[e].splice(i, 1) } }, t.unsubscribeAll = function (t) { void 0 !== f[t] && delete f[t] }, t.emit = function (t, e) { if (void 0 !== f[t]) for (var i = 0; i < f[t].length; i++) if (void 0 !== f[t][i].instance) { if (e instanceof h || e instanceof l) if (f[t][i].instance.__id__ !== e.__id__) { if (f[t][i].instance instanceof l && e instanceof h) for (var s = 0; s < f[t][i].instance.fields.length; s++) if (f[t][i].instance.fields[s].__id__ === e.__id__) { f[t][i].fn.apply(c, Array.prototype.slice.call(arguments, 1)); continue } } else f[t][i].fn.apply(c, Array.prototype.slice.call(arguments, 1)) } else f[t][i].fn.apply(void 0 !== f[t][i].ctxt ? f[t][i].ctxt : c, Array.prototype.slice.call(arguments, 1)) }, t.subscribed = function () { return f }, window.ParsleyConfig = window.ParsleyConfig || {}, window.ParsleyConfig.i18n = window.ParsleyConfig.i18n || {}, window.ParsleyConfig.i18n.en = t.extend(window.ParsleyConfig.i18n.en || {}, { defaultMessage: "This value seems to be invalid.", type: { email: ("" + window.location).indexOf("/cn/") < 0 ? "This value should be a valid email." : "该æ°å¼åºå¡«åææé®ä»¶å°å", url: "This value should be a valid url.", number: "This value should be a valid number.", integer: "This value should be a valid integer.", digits: "This value should be digits.", alphanum: "This value should be alphanumeric." }, notblank: "This value should not be blank.", required: "This value is required.", pattern: "This value seems to be invalid.", min: "This value should be greater than or equal to %s.", max: "This value should be lower than or equal to %s.", range: "This value should be between %s and %s.", minlength: "This value is too short. It should have %s characters or more.", maxlength: "This value is too long. It should have %s characters or fewer.", length: ("" + window.location).indexOf("/cn/") < 0 ? "This value length is invalid. It should be between %s and %s characters long." : "该æ°å¼é¿åº¦æ æãé¿åº¦åºä¸º %s è³ %s 个å符", mincheck: "You must select at least %s choices.", maxcheck: "You must select %s choices or fewer.", check: "You must select between %s and %s choices.", equalto: "This value should be the same." }), void 0 !== window.ParsleyValidator && window.ParsleyValidator.addCatalog("en", window.ParsleyConfig.i18n.en, !0); var p = function (i, s, n) { if (this.__class__ = "Parsley", this.__version__ = "2.0.5", this.__id__ = e.hash(4), void 0 === i) throw Error("You must give an element"); if (void 0 !== n && "ParsleyForm" !== n.__class__) throw Error("Parent instance must be a ParsleyForm instance"); return this.init(t(i), s, n) }; p.prototype = { init: function (t, s, n) { if (!t.length) throw Error("You must bind Parsley on an existing element."); if (this.$element = t, this.$element.data("Parsley")) { var r = this.$element.data("Parsley"); return void 0 !== n && (r.parent = n), r } return this.OptionsFactory = new o(i, e.get(window, "ParsleyConfig") || {}, s, this.getNamespace(s)), this.options = this.OptionsFactory.get(this), this.$element.is("form") || e.attr(this.$element, this.options.namespace, "validate") && !this.$element.is(this.options.inputs) ? this.bind("parsleyForm") : this.$element.is(this.options.inputs) && !this.$element.is(this.options.excluded) ? this.isMultiple() ? this.handleMultiple(n) : this.bind("parsleyField", n) : this }, isMultiple: function () { return this.$element.is("input[type=radio], input[type=checkbox]") && void 0 === this.options.multiple || this.$element.is("select") && void 0 !== this.$element.attr("multiple") }, handleMultiple: function (i) { var s, n, r, a = this; if (this.options = t.extend(this.options, i ? i.OptionsFactory.get(i) : {}, e.attr(this.$element, this.options.namespace)), this.options.multiple ? n = this.options.multiple : void 0 !== this.$element.attr("name") && this.$element.attr("name").length ? n = s = this.$element.attr("name") : void 0 !== this.$element.attr("id") && this.$element.attr("id").length && (n = this.$element.attr("id")), this.$element.is("select") && void 0 !== this.$element.attr("multiple")) return this.bind("parsleyFieldMultiple", i, n || this.__id__); if (void 0 === n) return window.console && window.console.warn && window.console.warn("To be binded by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.", this.$element), this; if (n = n.replace(/(:|\.|\[|\]|\$)/g, ""), void 0 !== s && t('input[name="' + s + '"]').each(function () { t(this).is("input[type=radio], input[type=checkbox]") && t(this).attr(a.options.namespace + "multiple", n) }), t("[" + this.options.namespace + "multiple=" + n + "]").length) for (var o = 0; o < t("[" + this.options.namespace + "multiple=" + n + "]").length; o++) if (void 0 !== t(t("[" + this.options.namespace + "multiple=" + n + "]").get(o)).data("Parsley")) { r = t(t("[" + this.options.namespace + "multiple=" + n + "]").get(o)).data("Parsley"), this.$element.data("ParsleyFieldMultiple") || (r.addElement(this.$element), this.$element.attr(this.options.namespace + "id", r.__id__)); break } return this.bind("parsleyField", i, n, !0), r || this.bind("parsleyFieldMultiple", i, n) }, getNamespace: function (t) { return void 0 !== this.$element.data("parsleyNamespace") ? this.$element.data("parsleyNamespace") : void 0 !== e.get(t, "namespace") ? t.namespace : void 0 !== e.get(window, "ParsleyConfig.namespace") ? window.ParsleyConfig.namespace : i.namespace }, bind: function (i, n, r, a) { var o; switch (i) { case "parsleyForm": o = t.extend(new l(this.$element, this.OptionsFactory), new s, window.ParsleyExtend)._bindFields(); break; case "parsleyField": o = t.extend(new h(this.$element, this.OptionsFactory, n), new s, window.ParsleyExtend); break; case "parsleyFieldMultiple": o = t.extend(new h(this.$element, this.OptionsFactory, n), new s, new d, window.ParsleyExtend)._init(r); break; default: throw Error(i + "is not a supported Parsley type") } return void 0 !== r && e.setAttr(this.$element, this.options.namespace, "multiple", r), void 0 !== a ? (this.$element.data("ParsleyFieldMultiple", o), o) : (RegExp("ParsleyF", "i").test(o.__class__) && (this.$element.data("Parsley", o), t.emit("parsley:" + ("parsleyForm" === i ? "form" : "field") + ":init", o)), o) } }, t.fn.parsley = t.fn.psly = function (e) { if (this.length > 1) { var i = []; return this.each(function () { i.push(t(this).parsley(e)) }), i } return t(this).length ? new p(this, e) : void (window.console && window.console.warn && window.console.warn("You must bind Parsley on an existing element.")) }, window.ParsleyUI = "function" == typeof e.get(window, "ParsleyConfig.ParsleyUI") ? (new window.ParsleyConfig.ParsleyUI).listen() : (new a).listen(), void 0 === window.ParsleyExtend && (window.ParsleyExtend = {}), void 0 === window.ParsleyConfig && (window.ParsleyConfig = {}), window.Parsley = window.psly = p, window.ParsleyUtils = e, window.ParsleyValidator = new r(window.ParsleyConfig.validators, window.ParsleyConfig.i18n), !1 !== e.get(window, "ParsleyConfig.autoBind") && t(document).ready(function () { t("[data-parsley-validate]").length && t("[data-parsley-validate]").parsley() }) 15});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.