From be582f9eaf2f90b1b8d4bd9a729041ae966a2abf Mon Sep 17 00:00:00 2001 From: Abraham Przewodnik Date: Thu, 10 Dec 2020 16:31:57 +0100 Subject: [PATCH] Remove the debugging-statement and revert dist/doc --- dist/parsley.js | 33 ++-- dist/parsley.js.map | 2 +- dist/parsley.min.js | 2 +- dist/parsley.min.js.map | 2 +- doc/annotated-source/base.html | 22 +-- doc/annotated-source/field.html | 15 +- doc/annotated-source/form.html | 19 +- doc/annotated-source/remote.html | 2 +- doc/assets/spec-build.js | 38 ++-- src/parsley/field.js | 291 ++++++++++++++++++------------- 10 files changed, 230 insertions(+), 196 deletions(-) diff --git a/dist/parsley.js b/dist/parsley.js index 612a095e0..0b85864a2 100644 --- a/dist/parsley.js +++ b/dist/parsley.js @@ -1,6 +1,6 @@ /*! * Parsley.js -* Version 2.9.2 - built Thu, Dec 10th 2020, 1:44 pm +* Version 2.9.2 - built Tue, Dec 10th 2019, 6:18 pm * http://parsleyjs.org * Guillaume Potier - * Marc-Andre Lafortune - @@ -345,18 +345,16 @@ Base.prototype = { asyncSupport: true, // Deprecated - _pipeAccordingToValidationResult: function _pipeAccordingToValidationResult(deferred) { + _pipeAccordingToValidationResult: function _pipeAccordingToValidationResult() { var _this = this; - return $.Deferred(function (newDefer) { - var handle = function handle() { - var r = true === _this.validationResult ? $.Deferred().resolve() : $.Deferred().reject(); - r.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject); - }; + var pipe = function pipe() { + var r = $.Deferred(); + if (true !== _this.validationResult) r.reject(); + return r.resolve().promise(); + }; - deferred.done(handle); - deferred.fail(handle); - }); + return [pipe, pipe]; }, actualizeOptions: function actualizeOptions() { Utils.attr(this.element, this.options.namespace, this.domOptions); @@ -1320,7 +1318,8 @@ return statusMapping[this.whenValidate(options).state()]; }, whenValidate: function whenValidate() { - var _this2 = this; + var _this2 = this, + _Utils$all$done$fail$; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, group = _ref.group, @@ -1354,7 +1353,7 @@ }); }); - return this._pipeAccordingToValidationResult(Utils.all(promises).done(function () { + return (_Utils$all$done$fail$ = Utils.all(promises).done(function () { _this2._trigger('success'); }).fail(function () { _this2.validationResult = false; @@ -1364,7 +1363,7 @@ _this2._trigger('error'); }).always(function () { _this2._trigger('validated'); - })); + })).pipe.apply(_Utils$all$done$fail$, _toConsumableArray(this._pipeAccordingToValidationResult())); }, // Iterate over refreshed fields, and stop on first failure. // Returns `true` if all fields are valid, `false` if a failure is detected @@ -1588,7 +1587,8 @@ // @returns a promise that succeeds only when all validations do // or `undefined` if field is not in the given `group`. whenValidate: function whenValidate() { - var _this = this; + var _this$whenValid$alway, + _this = this; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, force = _ref.force, @@ -1601,7 +1601,7 @@ this._trigger('validate'); - return this._pipeAccordingToValidationResult(this.whenValid({ + return (_this$whenValid$alway = this.whenValid({ force: force, value: this.value, _refreshed: true @@ -1613,7 +1613,7 @@ _this._trigger('error'); }).always(function () { _this._trigger('validated'); - })); + })).pipe.apply(_this$whenValid$alway, _toConsumableArray(this._pipeAccordingToValidationResult())); }, hasConstraints: function hasConstraints() { return 0 !== this.constraints.length; @@ -1677,7 +1677,6 @@ if (!this.hasConstraints()) return $.when(); // Value could be passed as argument, needed to add more power to 'field:validate' if ('undefined' === typeof value || null === value) value = this.getValue(); - console.log('validate' + value); if (!this.needsValidation(value) && true !== force) return $.when(); var groupedConstraints = this._getGroupedConstraints(); diff --git a/dist/parsley.js.map b/dist/parsley.js.map index f6d4120da..e6b1578d1 100644 --- a/dist/parsley.js.map +++ b/dist/parsley.js.map @@ -1 +1 @@ -{"version":3,"file":"parsley.js","sources":["../src/parsley/utils.js","../src/parsley/defaults.js","../src/parsley/base.js","../src/parsley/validator.js","../src/parsley/validator_registry.js","../src/parsley/ui.js","../src/parsley/form.js","../src/parsley/constraint.js","../src/parsley/field.js","../src/parsley/multiple.js","../src/parsley/factory.js","../src/parsley/main.js","../src/parsley/pubsub.js","../src/parsley/remote.js","../src/i18n/en.js","../src/vendor/inputevent.js","../src/parsley.js"],"sourcesContent":["import $ from 'jquery';\n\nvar globalID = 1;\nvar pastWarnings = {};\n\nvar Utils = {\n // Parsley DOM-API\n // returns object from dom attributes and values\n attr: function (element, namespace, obj) {\n var i;\n var attribute;\n var attributes;\n var regex = new RegExp('^' + namespace, 'i');\n\n if ('undefined' === typeof obj)\n obj = {};\n else {\n // Clear all own properties. This won't affect prototype's values\n for (i in obj) {\n if (obj.hasOwnProperty(i))\n delete obj[i];\n }\n }\n\n if (!element)\n return obj;\n\n attributes = element.attributes;\n for (i = attributes.length; i--; ) {\n attribute = attributes[i];\n\n if (attribute && attribute.specified && regex.test(attribute.name)) {\n obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);\n }\n }\n\n return obj;\n },\n\n checkAttr: function (element, namespace, checkAttr) {\n return element.hasAttribute(namespace + checkAttr);\n },\n\n setAttr: function (element, namespace, attr, value) {\n element.setAttribute(this.dasherize(namespace + attr), String(value));\n },\n\n getType: function(element) {\n return element.getAttribute('type') || 'text';\n },\n\n generateID: function () {\n return '' + globalID++;\n },\n\n /** Third party functions **/\n deserializeValue: function (value) {\n var num;\n\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\n value)\n : value;\n } catch (e) { return value; }\n },\n\n // Zepto camelize function\n camelize: function (str) {\n return str.replace(/-+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n },\n\n // Zepto dasherize function\n dasherize: function (str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase();\n },\n\n warn: function () {\n if (window.console && 'function' === typeof window.console.warn)\n window.console.warn(...arguments);\n },\n\n warnOnce: function(msg) {\n if (!pastWarnings[msg]) {\n pastWarnings[msg] = true;\n this.warn(...arguments);\n }\n },\n\n _resetWarnings: function () {\n pastWarnings = {};\n },\n\n trimString: function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n },\n\n parse: {\n date: function(string) {\n let parsed = string.match(/^(\\d{4,})-(\\d\\d)-(\\d\\d)$/);\n if (!parsed)\n return null;\n let [_, year, month, day] = parsed.map(x => parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
    ',\n\n // li elem that would receive error message\n errorTemplate: '
  • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function (deferred) {\n return $.Deferred((newDefer) => {\n const handle = () => {\n var r = true === this.validationResult ?\n $.Deferred().resolve():\n $.Deferred().reject();\n r.promise()\n .progress(newDefer.notify)\n .done(newDefer.resolve)\n .fail(newDefer.reject)\n }\n deferred.done(handle)\n deferred.fail(handle)\n })\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-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-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId);\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n this._ui.$errorClassHandler.removeAttr('aria-describedby');\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return this._pipeAccordingToValidationResult(\n Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n );\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this._pipeAccordingToValidationResult(\n this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n );\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n console.log('validate' + value)\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `
    ` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise query cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","_","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","_boolean","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","TypeError","_SubmitSelector","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","Field","errorsContainer","errorsWrapper","errorTemplate","Base","__id__","asyncSupport","_pipeAccordingToValidationResult","deferred","Deferred","newDefer","handle","r","validationResult","resolve","reject","promise","progress","notify","done","fail","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","queue","subscribe","listenTo","off","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","convertArrayRequirement","m","values","convertExtraOptionRequirement","requirementSpec","extraOptionReader","main","extra","key","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","type","isPlainObject","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","parseArguments","args","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","typeMessages","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","re","UI","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","_reflowUI","_buildUI","_ui","diff","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","$errorClassHandler","errorsWrapperId","html","removeAttr","removeClass","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","capitalize","cap","requirementList","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","log","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","o","deprecated","adapt","context","parsleyAdaptedCallback","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","ajax","handleXhr","then","InputEvent","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall","inputevent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA,IAAIA,QAAQ,GAAG,CAAf;EACA,IAAIC,YAAY,GAAG,EAAnB;EAEA,IAAIC,KAAK,GAAG;EACV;EACA;EACAC,EAAAA,IAAI,EAAE,cAAUC,OAAV,EAAmBC,SAAnB,EAA8BC,GAA9B,EAAmC;EACvC,QAAIC,CAAJ;EACA,QAAIC,SAAJ;EACA,QAAIC,UAAJ;EACA,QAAIC,KAAK,GAAG,IAAIC,MAAJ,CAAW,MAAMN,SAAjB,EAA4B,GAA5B,CAAZ;EAEA,QAAI,gBAAgB,OAAOC,GAA3B,EACEA,GAAG,GAAG,EAAN,CADF,KAEK;EACH;EACA,WAAKC,CAAL,IAAUD,GAAV,EAAe;EACb,YAAIA,GAAG,CAACM,cAAJ,CAAmBL,CAAnB,CAAJ,EACE,OAAOD,GAAG,CAACC,CAAD,CAAV;EACH;EACF;EAED,QAAI,CAACH,OAAL,EACE,OAAOE,GAAP;EAEFG,IAAAA,UAAU,GAAGL,OAAO,CAACK,UAArB;;EACA,SAAKF,CAAC,GAAGE,UAAU,CAACI,MAApB,EAA4BN,CAAC,EAA7B,GAAmC;EACjCC,MAAAA,SAAS,GAAGC,UAAU,CAACF,CAAD,CAAtB;;EAEA,UAAIC,SAAS,IAAIA,SAAS,CAACM,SAAvB,IAAoCJ,KAAK,CAACK,IAAN,CAAWP,SAAS,CAACQ,IAArB,CAAxC,EAAoE;EAClEV,QAAAA,GAAG,CAAC,KAAKW,QAAL,CAAcT,SAAS,CAACQ,IAAV,CAAeE,KAAf,CAAqBb,SAAS,CAACQ,MA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W,QAAD,CAAD;EAAA,SACG5R,GADH,CACO,kBADP,EAC2BnE,GAAG,CAAC4U,IAAJ,CAASqE,QADpC,EAC8C,KAAI,CAACD,SADnD,EAEG7U,GAFH,CAEO,mBAFP,EAE4BnE,GAAG,CAAC4U,IAAJ,CAASqE,QAFrC,EAE+C,KAAI,CAACF,UAFpD;EAGD;EACF,KA5BiB;EA8BlB;EACAG,IAAAA,OAAO,EAAE,mBAAM;EACb,UAAIT,OAAO,CAACU,iBAAZ,EAA+B;EAC7B;EACD;;EACDV,MAAAA,OAAO,CAACU,iBAAR,GAA4B,OAA5B;;EACA,8BAAqB,CAAC,QAAD,EAAW,wBAAX,EAAqC,qBAArC,EAA4D,oBAA5D,CAArB,0BAAwG;EAAnG,YAAIF,QAAQ,WAAZ;EACHlZ,QAAAA,CAAC,CAACgW,QAAD,CAAD,CACGjS,EADH,CACM,kBADN,EAC0BmV,QAD1B,EACoC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SADpC,EACgD,KAAI,CAACD,SADrD,EAEGlV,EAFH,CAEM,mBAFN,EAE2BmV,QAF3B,EAEqC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SAFrC,EAEiD,KAAI,CAACF,UAFtD;EAGD;EACF,KAzCiB;EA2ClBK,IAAAA,SAAS,EAAE,qBAAM;EACf,aAAOX,OAAO,CAACU,iBAAf;EACApZ,MAAAA,CAAC,CAACgW,QAAD,CAAD,CAAY5R,GAAZ,CAAgB,aAAhB;EACD;EA9CiB,GAApB;EAiDD;AAED,mBAAe,IAAIqU,UAAJ,EAAf;;EC3DAa,UAAU,CAACH,OAAX;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"parsley.js","sources":["../src/parsley/utils.js","../src/parsley/defaults.js","../src/parsley/base.js","../src/parsley/validator.js","../src/parsley/validator_registry.js","../src/parsley/ui.js","../src/parsley/form.js","../src/parsley/constraint.js","../src/parsley/field.js","../src/parsley/multiple.js","../src/parsley/factory.js","../src/parsley/main.js","../src/parsley/pubsub.js","../src/parsley/remote.js","../src/i18n/en.js","../src/vendor/inputevent.js","../src/parsley.js"],"sourcesContent":["import $ from 'jquery';\n\nvar globalID = 1;\nvar pastWarnings = {};\n\nvar Utils = {\n // Parsley DOM-API\n // returns object from dom attributes and values\n attr: function (element, namespace, obj) {\n var i;\n var attribute;\n var attributes;\n var regex = new RegExp('^' + namespace, 'i');\n\n if ('undefined' === typeof obj)\n obj = {};\n else {\n // Clear all own properties. This won't affect prototype's values\n for (i in obj) {\n if (obj.hasOwnProperty(i))\n delete obj[i];\n }\n }\n\n if (!element)\n return obj;\n\n attributes = element.attributes;\n for (i = attributes.length; i--; ) {\n attribute = attributes[i];\n\n if (attribute && attribute.specified && regex.test(attribute.name)) {\n obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);\n }\n }\n\n return obj;\n },\n\n checkAttr: function (element, namespace, checkAttr) {\n return element.hasAttribute(namespace + checkAttr);\n },\n\n setAttr: function (element, namespace, attr, value) {\n element.setAttribute(this.dasherize(namespace + attr), String(value));\n },\n\n getType: function(element) {\n return element.getAttribute('type') || 'text';\n },\n\n generateID: function () {\n return '' + globalID++;\n },\n\n /** Third party functions **/\n deserializeValue: function (value) {\n var num;\n\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\n value)\n : value;\n } catch (e) { return value; }\n },\n\n // Zepto camelize function\n camelize: function (str) {\n return str.replace(/-+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n },\n\n // Zepto dasherize function\n dasherize: function (str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase();\n },\n\n warn: function () {\n if (window.console && 'function' === typeof window.console.warn)\n window.console.warn(...arguments);\n },\n\n warnOnce: function(msg) {\n if (!pastWarnings[msg]) {\n pastWarnings[msg] = true;\n this.warn(...arguments);\n }\n },\n\n _resetWarnings: function () {\n pastWarnings = {};\n },\n\n trimString: function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n },\n\n parse: {\n date: function(string) {\n let parsed = string.match(/^(\\d{4,})-(\\d\\d)-(\\d\\d)$/);\n if (!parsed)\n return null;\n let [_, year, month, day] = parsed.map(x => parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
      ',\n\n // li elem that would receive error message\n errorTemplate: '
    • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function () {\n var pipe = () => {\n var r = $.Deferred();\n if (true !== this.validationResult)\n r.reject();\n return r.resolve().promise();\n };\n return [pipe, pipe];\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-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-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId);\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n this._ui.$errorClassHandler.removeAttr('aria-describedby');\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise querry cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","_","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","_boolean","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","TypeError","_SubmitSelector","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","Field","errorsContainer","errorsWrapper","errorTemplate","Base","__id__","asyncSupport","_pipeAccordingToValidationResult","pipe","r","Deferred","validationResult","reject","resolve","promise","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","queue","subscribe","listenTo","off","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","convertArrayRequirement","m","values","convertExtraOptionRequirement","requirementSpec","extraOptionReader","main","extra","key","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","type","isPlainObject","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","parseArguments","args","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","typeMessages","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","re","UI","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","_reflowUI","_buildUI","_ui","diff","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","$errorClassHandler","errorsWrapperId","html","removeAttr","removeClass","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","done","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","fail","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","capitalize","cap","requirementList","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","o","deprecated","adapt","context","parsleyAdaptedCallback","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","ajax","handleXhr","then","InputEvent","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall","inputevent"],"m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,EAAW,wBAAX,EAAqC,qBAArC,EAA4D,oBAA5D,CAArB,0BAAwG;EAAnG,YAAIF,QAAQ,WAAZ;EACH7Y,QAAAA,CAAC,CAAC2V,QAAD,CAAD,CACGlS,EADH,CACM,kBADN,EAC0BoV,QAD1B,EACoC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SADpC,EACgD,KAAI,CAACD,SADrD,EAEGnV,EAFH,CAEM,mBAFN,EAE2BoV,QAF3B,EAEqC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SAFrC,EAEiD,KAAI,CAACF,UAFtD;EAGD;EACF,KAzCiB;EA2ClBK,IAAAA,SAAS,EAAE,qBAAM;EACf,aAAOX,OAAO,CAACU,iBAAf;EACA/Y,MAAAA,CAAC,CAAC2V,QAAD,CAAD,CAAY7R,GAAZ,CAAgB,aAAhB;EACD;EA9CiB,GAApB;EAiDD;AAED,mBAAe,IAAIsU,UAAJ,EAAf;;EC3DAa,UAAU,CAACH,OAAX;;;;;;;;"} \ No newline at end of file diff --git a/dist/parsley.min.js b/dist/parsley.min.js index 572fdbb0f..09a24b301 100644 --- a/dist/parsley.min.js +++ b/dist/parsley.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):(t=t||self).parsley=e(t.jQuery)}(this,function(h){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){return(o=Object.assign||function(t){for(var e=1;e',errorTemplate:"
    • "};r.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(i){var r=this;return h.Deferred(function(t){function e(){(!0===r.validationResult?h.Deferred().resolve():h.Deferred().reject()).promise().progress(t.notify).done(t.resolve).fail(t.reject)}i.done(e),i.fail(e)})},actualizeOptions:function(){return d.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(t){for(var e in this.domOptions=d.objectCreate(this.parent.options),this.options=d.objectCreate(this.domOptions),t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);this.actualizeOptions()},_listeners:null,on:function(t,e){return this._listeners=this._listeners||{},(this._listeners[t]=this._listeners[t]||[]).push(e),this},subscribe:function(t,e){h.listenTo(this,t.toLowerCase(),e)},off:function(t,e){var i=this._listeners&&this._listeners[t];if(i)if(e)for(var r=i.length;r--;)i[r]===e&&i.splice(r,1);else delete this._listeners[t];return this},unsubscribe:function(t){h.unsubscribeTo(this,t.toLowerCase())},trigger:function(t,e,i){e=e||this;var r,n=this._listeners&&this._listeners[t];if(n)for(var s=n.length;s--;)if(!1===(r=n[s].call(e,e,i)))return r;return!this.parent||this.parent.trigger(t,e,i)},asyncIsValid:function(t,e){return d.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:t,force:e})},_findRelated:function(){return this.options.multiple?h(this.parent.element.querySelectorAll("[".concat(this.options.namespace,'multiple="').concat(this.options.multiple,'"]'))):this.$element}};function c(t){h.extend(!0,this,t)}c.prototype={validate:function(t,e){if(this.fn)return 3d)return!1;var h=function(t){return Math.round(t*Math.pow(10,d))};if((h(u)-h(o))%h(s)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(t,e){return!t||e.test(t)},requirementType:"regexp",priority:64},minlength:{validateString:function(t,e){return!t||t.length>=e},requirementType:"integer",priority:30},maxlength:{validateString:function(t,e){return t.length<=e},requirementType:"integer",priority:30},length:{validateString:function(t,e,i){return!t||t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(t,e){return t.length>=e},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(t,e){return t.length<=e},requirementType:"integer",priority:30},check:{validateMultiple:function(t,e,i){return t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},min:g(function(t,e){return e<=t}),max:g(function(t,e){return t<=e}),range:g(function(t,e,i){return e<=t&&t<=i}),equalto:{validateString:function(t,e){if(!t)return!0;var i=h(e);return i.length?t===i.val():t===e},priority:256},euvatin:{validateString:function(t){if(!t)return!0;return/^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/.test(t)},priority:30}}};var v={};v.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",d._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(!(this._focusedField=null)===this.validationResult||"none"===this.options.focus)return null;for(var t=0;t').appendTo(this.$element)),e.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(o(h.Event("submit"),{parsley:!0}))}},validate:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={group:e[0],force:e[1],event:e[2]}}return _[this.whenValidate(t).state()]},whenValidate:function(t){var e=this,i=0',errorTemplate:"
    • "};r.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){function t(){var t=h.Deferred();return!0!==e.validationResult&&t.reject(),t.resolve().promise()}var e=this;return[t,t]},actualizeOptions:function(){return d.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(t){for(var e in this.domOptions=d.objectCreate(this.parent.options),this.options=d.objectCreate(this.domOptions),t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);this.actualizeOptions()},_listeners:null,on:function(t,e){return this._listeners=this._listeners||{},(this._listeners[t]=this._listeners[t]||[]).push(e),this},subscribe:function(t,e){h.listenTo(this,t.toLowerCase(),e)},off:function(t,e){var i=this._listeners&&this._listeners[t];if(i)if(e)for(var r=i.length;r--;)i[r]===e&&i.splice(r,1);else delete this._listeners[t];return this},unsubscribe:function(t){h.unsubscribeTo(this,t.toLowerCase())},trigger:function(t,e,i){e=e||this;var r,n=this._listeners&&this._listeners[t];if(n)for(var s=n.length;s--;)if(!1===(r=n[s].call(e,e,i)))return r;return!this.parent||this.parent.trigger(t,e,i)},asyncIsValid:function(t,e){return d.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:t,force:e})},_findRelated:function(){return this.options.multiple?h(this.parent.element.querySelectorAll("[".concat(this.options.namespace,'multiple="').concat(this.options.multiple,'"]'))):this.$element}};function c(t){h.extend(!0,this,t)}c.prototype={validate:function(t,e){if(this.fn)return 3d)return!1;var h=function(t){return Math.round(t*Math.pow(10,d))};if((h(u)-h(o))%h(s)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(t,e){return!t||e.test(t)},requirementType:"regexp",priority:64},minlength:{validateString:function(t,e){return!t||t.length>=e},requirementType:"integer",priority:30},maxlength:{validateString:function(t,e){return t.length<=e},requirementType:"integer",priority:30},length:{validateString:function(t,e,i){return!t||t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(t,e){return t.length>=e},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(t,e){return t.length<=e},requirementType:"integer",priority:30},check:{validateMultiple:function(t,e,i){return t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},min:g(function(t,e){return e<=t}),max:g(function(t,e){return t<=e}),range:g(function(t,e,i){return e<=t&&t<=i}),equalto:{validateString:function(t,e){if(!t)return!0;var i=h(e);return i.length?t===i.val():t===e},priority:256},euvatin:{validateString:function(t){if(!t)return!0;return/^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/.test(t)},priority:30}}};var v={};v.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",d._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(!(this._focusedField=null)===this.validationResult||"none"===this.options.focus)return null;for(var t=0;t').appendTo(this.$element)),e.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(l(h.Event("submit"),{parsley:!0}))}},validate:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={group:e[0],force:e[1],event:e[2]}}return _[this.whenValidate(t).state()]},whenValidate:function(t){var e,i=this,r=0 parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function (deferred) {\n return $.Deferred((newDefer) => {\n const handle = () => {\n var r = true === this.validationResult ?\n $.Deferred().resolve():\n $.Deferred().reject();\n r.promise()\n .progress(newDefer.notify)\n .done(newDefer.resolve)\n .fail(newDefer.reject)\n }\n deferred.done(handle)\n deferred.fail(handle)\n })\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
        ',\n\n // li elem that would receive error message\n errorTemplate: '
      • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-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-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId);\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n this._ui.$errorClassHandler.removeAttr('aria-describedby');\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return this._pipeAccordingToValidationResult(\n Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n );\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this._pipeAccordingToValidationResult(\n this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n );\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n console.log('validate' + value)\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise query cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","this","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","_","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","_typeof","TypeError","_SubmitSelector","Base","__id__","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","errorsContainer","errorsWrapper","errorTemplate","asyncSupport","_pipeAccordingToValidationResult","deferred","Deferred","newDefer","handle","_this","validationResult","resolve","reject","promise","progress","notify","done","fail","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","subscribe","listenTo","off","queue","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","extraOptionReader","type","values","m","convertArrayRequirement","isPlainObject","requirementSpec","main","extra","key","convertExtraOptionRequirement","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","_extends","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","UI","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","Field","_reflowUI","_buildUI","_ui","diff","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","$errorClassHandler","errorsWrapperId","html","removeAttr","removeClass","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_this2","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_this3","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","_this4","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","requirementList","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","log","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","deprecated","o","adapt","context","parsleyAdaptedCallback","args","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","handleXhr","ajax","then","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall"],"mappings":"i+CAEA,IAAIA,EAAW,EACXC,EAAe,GAEfC,EAAQ,CAGVC,KAAM,SAAUC,EAASC,EAAWC,OAC9BC,EACAC,EACAC,EACAC,EAAQ,IAAIC,OAAO,IAAMN,EAAW,aAEpC,IAAuBC,EACzBA,EAAM,YAGDC,KAAKD,EACJA,EAAIM,eAAeL,WACdD,EAAIC,OAIZH,EACH,OAAOE,MAGJC,GADLE,EAAaL,EAAQK,YACDI,OAAQN,MAC1BC,EAAYC,EAAWF,KAENC,EAAUM,WAAaJ,EAAMK,KAAKP,EAAUQ,QAC3DV,EAAIW,KAAKC,SAASV,EAAUQ,KAAKG,MAAMd,EAAUQ,UAAYI,KAAKG,iBAAiBZ,EAAUa,eAI1Ff,GAGTgB,UAAW,SAAUlB,EAASC,EAAWiB,UAChClB,EAAQmB,aAAalB,EAAYiB,IAG1CE,QAAS,SAAUpB,EAASC,EAAWF,EAAMkB,GAC3CjB,EAAQqB,aAAaR,KAAKS,UAAUrB,EAAYF,GAAOwB,OAAON,KAGhEO,QAAS,SAASxB,UACTA,EAAQyB,aAAa,SAAW,QAGzCC,WAAY,iBACH,GAAK9B,KAIdoB,iBAAkB,SAAUC,OACtBU,aAGKV,EACI,QAATA,GACU,SAATA,IACQ,QAATA,EAAkB,KACjBW,MAAMD,EAAME,OAAOZ,IACpB,UAAUN,KAAKM,GAASa,KAAKC,MAAMd,GACnCA,EAF8BU,GAG5BV,EACJ,MAAOe,UAAYf,IAIvBH,SAAU,SAAUmB,UACXA,EAAIC,QAAQ,UAAW,SAAUC,EAAOC,UACtCA,EAAMA,EAAIC,cAAgB,MAKrCf,UAAW,SAAUW,UACZA,EAAIC,QAAQ,MAAO,KACvBA,QAAQ,wBAAyB,SACjCA,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AAgB,oDAChB7C,IAAgB,kDAChBH,MAAgB,0CAChB6C,UAAgB,iEAChBE,UAAgB,iEAChBvO,OAAgB,gFAChByO,SAAgB,uCAChBC,SAAgB,uCAChBC,MAAgB,6CAChBC,QAAgB,iCAChBI,QAAgB,gDAGlB7C,EAAQC,UAAU,OCoCH,0BAvDTsQ,EAAU3a,QAAU4a,SAIVvc,KAAM,CAGlBwc,cAAe,SAAA3Y,UACNA,EAAI4Y,gBAAiD,IAAhC5Y,EAAI4Y,cAAcC,WAGhDC,eAAgB,SAAA9Y,GACV+C,EAAK4V,cAAc3Y,IACrBD,EAAEC,EAAIwE,QAAQvC,QAAQ,UAI1B8W,WAAY,SAAA/Y,GACN+C,EAAK4V,cAAc3Y,KACrB+C,EAAKiW,UAAUhZ,GACfD,EAAEgW,UACChS,GAAG,oBAAqB/D,EAAI4U,KAAKqE,SAAUlW,EAAK+V,gBACnD/V,EAAK+V,eAAe9Y,KAIxBgZ,UAAW,SAAAhZ,GACL+C,EAAK4V,cAAc3Y,IACrBD,EAAEgW,UACC5R,IAAI,mBAAoBnE,EAAI4U,KAAKqE,SAAUlW,EAAKiW,WAChD7U,IAAI,oBAAqBnE,EAAI4U,KAAKqE,SAAUlW,EAAKgW,aAKxDG,QAAS,eACHT,EAAQU,mBAGZV,EAAQU,kBAAoB,sBACP,CAAC,SAAU,yBAA0B,sBAAuB,qCAAuB,KAA/FF,OACPlZ,EAAEgW,UACChS,GAAG,mBAAoBkV,EAAU,CAACA,SAAAA,GAAWlW,EAAKiW,WAClDjV,GAAG,oBAAqBkV,EAAU,CAACA,SAAAA,GAAWlW,EAAKgW,eAI1DK,UAAW,kBACFX,EAAQU,kBACfpZ,EAAEgW,UAAU5R,IAAI,oBCrDX+U"} \ No newline at end of file +{"version":3,"file":"parsley.min.js","sources":["../src/parsley/utils.js","../src/parsley/base.js","../src/parsley/defaults.js","../src/parsley/validator.js","../src/parsley/validator_registry.js","../src/parsley/ui.js","../src/parsley/form.js","../src/parsley/constraint.js","../src/parsley/field.js","../src/parsley/multiple.js","../src/parsley/factory.js","../src/parsley/main.js","../src/parsley/pubsub.js","../src/parsley/remote.js","../src/i18n/en.js","../src/vendor/inputevent.js","../src/parsley.js"],"sourcesContent":["import $ from 'jquery';\n\nvar globalID = 1;\nvar pastWarnings = {};\n\nvar Utils = {\n // Parsley DOM-API\n // returns object from dom attributes and values\n attr: function (element, namespace, obj) {\n var i;\n var attribute;\n var attributes;\n var regex = new RegExp('^' + namespace, 'i');\n\n if ('undefined' === typeof obj)\n obj = {};\n else {\n // Clear all own properties. This won't affect prototype's values\n for (i in obj) {\n if (obj.hasOwnProperty(i))\n delete obj[i];\n }\n }\n\n if (!element)\n return obj;\n\n attributes = element.attributes;\n for (i = attributes.length; i--; ) {\n attribute = attributes[i];\n\n if (attribute && attribute.specified && regex.test(attribute.name)) {\n obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);\n }\n }\n\n return obj;\n },\n\n checkAttr: function (element, namespace, checkAttr) {\n return element.hasAttribute(namespace + checkAttr);\n },\n\n setAttr: function (element, namespace, attr, value) {\n element.setAttribute(this.dasherize(namespace + attr), String(value));\n },\n\n getType: function(element) {\n return element.getAttribute('type') || 'text';\n },\n\n generateID: function () {\n return '' + globalID++;\n },\n\n /** Third party functions **/\n deserializeValue: function (value) {\n var num;\n\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\n value)\n : value;\n } catch (e) { return value; }\n },\n\n // Zepto camelize function\n camelize: function (str) {\n return str.replace(/-+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n },\n\n // Zepto dasherize function\n dasherize: function (str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase();\n },\n\n warn: function () {\n if (window.console && 'function' === typeof window.console.warn)\n window.console.warn(...arguments);\n },\n\n warnOnce: function(msg) {\n if (!pastWarnings[msg]) {\n pastWarnings[msg] = true;\n this.warn(...arguments);\n }\n },\n\n _resetWarnings: function () {\n pastWarnings = {};\n },\n\n trimString: function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n },\n\n parse: {\n date: function(string) {\n let parsed = string.match(/^(\\d{4,})-(\\d\\d)-(\\d\\d)$/);\n if (!parsed)\n return null;\n let [_, year, month, day] = parsed.map(x => parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function () {\n var pipe = () => {\n var r = $.Deferred();\n if (true !== this.validationResult)\n r.reject();\n return r.resolve().promise();\n };\n return [pipe, pipe];\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
          ',\n\n // li elem that would receive error message\n errorTemplate: '
        • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-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-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId);\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n this._ui.$errorClassHandler.removeAttr('aria-describedby');\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise querry cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","this","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","_","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","_typeof","TypeError","_SubmitSelector","Base","__id__","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","errorsContainer","errorsWrapper","errorTemplate","asyncSupport","_pipeAccordingToValidationResult","pipe","r","Deferred","_this","validationResult","reject","resolve","promise","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","subscribe","listenTo","off","queue","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","extraOptionReader","type","values","m","convertArrayRequirement","isPlainObject","requirementSpec","main","extra","key","convertExtraOptionRequirement","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","_extends","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","UI","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","Field","_reflowUI","_buildUI","_ui","diff","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","$errorClassHandler","errorsWrapperId","html","removeAttr","removeClass","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_this2","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_this3","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","done","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","fail","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","_this4","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","requirementList","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","deprecated","o","adapt","context","parsleyAdaptedCallback","args","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","handleXhr","ajax","then","globals","global","isNativeEvent","originalEv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lBoc,cAAe,SAAAvY,UACNA,EAAIwY,gBAAiD,IAAhCxY,EAAIwY,cAAcC,WAGhDC,eAAgB,SAAA1Y,GACV8C,EAAKyV,cAAcvY,IACrBD,EAAEC,EAAImE,QAAQlC,QAAQ,UAI1B0W,WAAY,SAAA3Y,GACN8C,EAAKyV,cAAcvY,KACrB8C,EAAK8V,UAAU5Y,GACfD,EAAE4V,UACCjS,GAAG,oBAAqB1D,EAAIwU,KAAKqE,SAAU/V,EAAK4V,gBACnD5V,EAAK4V,eAAe1Y,KAIxB4Y,UAAW,SAAA5Y,GACL8C,EAAKyV,cAAcvY,IACrBD,EAAE4V,UACC7R,IAAI,mBAAoB9D,EAAIwU,KAAKqE,SAAU/V,EAAK8V,WAChD9U,IAAI,oBAAqB9D,EAAIwU,KAAKqE,SAAU/V,EAAK6V,aAKxDG,QAAS,eACHT,EAAQU,mBAGZV,EAAQU,kBAAoB,sBACP,CAAC,SAAU,yBAA0B,sBAAuB,qCAAuB,KAA/FF,OACP9Y,EAAE4V,UACCjS,GAAG,mBAAoBmV,EAAU,CAACA,SAAAA,GAAW/V,EAAK8V,WAClDlV,GAAG,oBAAqBmV,EAAU,CAACA,SAAAA,GAAW/V,EAAK6V,eAI1DK,UAAW,kBACFX,EAAQU,kBACfhZ,EAAE4V,UAAU7R,IAAI,oBCrDXgV"} \ No newline at end of file diff --git a/doc/annotated-source/base.html b/doc/annotated-source/base.html index b0fdb4020..915f50adb 100644 --- a/doc/annotated-source/base.html +++ b/doc/annotated-source/base.html @@ -121,20 +121,14 @@

          base.js

          Base.prototype = { asyncSupport: true, // Deprecated - _pipeAccordingToValidationResult: function (deferred) { - return $.Deferred((newDefer) => { - const handle = () => { - var r = true === this.validationResult ? - $.Deferred().resolve(): - $.Deferred().reject(); - r.promise() - .progress(newDefer.notify) - .done(newDefer.resolve) - .fail(newDefer.reject) - } - deferred.done(handle) - deferred.fail(handle) - }) + _pipeAccordingToValidationResult: function () { + var pipe = () => { + var r = $.Deferred(); + if (true !== this.validationResult) + r.reject(); + return r.resolve().promise(); + }; + return [pipe, pipe]; }, actualizeOptions: function () { diff --git a/doc/annotated-source/field.html b/doc/annotated-source/field.html index 8c42714ce..805380e0d 100644 --- a/doc/annotated-source/field.html +++ b/doc/annotated-source/field.html @@ -261,13 +261,12 @@

          Public API

              this._trigger('validate');
           
          -    return this._pipeAccordingToValidationResult(
          -      this.whenValid({force, value: this.value, _refreshed: true})
          -        .always(() => { this._reflowUI(); })
          -        .done(() =>   { this._trigger('success'); })
          -        .fail(() =>   { this._trigger('error'); })
          -        .always(() => { this._trigger('validated'); })
          -    );
          +    return this.whenValid({force, value: this.value, _refreshed: true})
          +      .always(() => { this._reflowUI(); })
          +      .done(() =>   { this._trigger('success'); })
          +      .fail(() =>   { this._trigger('error'); })
          +      .always(() => { this._trigger('validated'); })
          +      .pipe(...this._pipeAccordingToValidationResult());
             },
           
             hasConstraints: function () {
          @@ -430,8 +429,6 @@ 

          Public API

              if ('undefined' === typeof value || null === value)
                 value = this.getValue();
           
          -    console.log('validate' + value)
          -
               if (!this.needsValidation(value) && true !== force)
                 return $.when();
           
          diff --git a/doc/annotated-source/form.html b/doc/annotated-source/form.html
          index ee19d5c92..9e5cb2306 100644
          --- a/doc/annotated-source/form.html
          +++ b/doc/annotated-source/form.html
          @@ -329,16 +329,15 @@ 

          form.js

          return $.map(this.fields, field => field.whenValidate({force, group})); }); - return this._pipeAccordingToValidationResult( - Utils.all(promises) - .done( () => { this._trigger('success'); }) - .fail( () => { - this.validationResult = false; - this.focus(); - this._trigger('error'); - }) - .always(() => { this._trigger('validated'); }) - ); + return Utils.all(promises) + .done( () => { this._trigger('success'); }) + .fail( () => { + this.validationResult = false; + this.focus(); + this._trigger('error'); + }) + .always(() => { this._trigger('validated'); }) + .pipe(...this._pipeAccordingToValidationResult()); },
          diff --git a/doc/annotated-source/remote.html b/doc/annotated-source/remote.html index 2f22b58f1..73dca7fad 100644 --- a/doc/annotated-source/remote.html +++ b/doc/annotated-source/remote.html @@ -274,7 +274,7 @@

          remote.js

          -

          Initialise query cache

          +

          Initialise querry cache

          diff --git a/doc/assets/spec-build.js b/doc/assets/spec-build.js index 3583185c2..a091e6f7c 100644 --- a/doc/assets/spec-build.js +++ b/doc/assets/spec-build.js @@ -1,6 +1,6 @@ /*! * Parsley.js -* Version 2.9.2 - built Thu, Dec 10th 2020, 1:44 pm +* Version 2.9.2 - built Tue, Dec 10th 2019, 6:18 pm * http://parsleyjs.org * Guillaume Potier - * Marc-Andre Lafortune - @@ -402,18 +402,16 @@ Base.prototype = { asyncSupport: true, // Deprecated - _pipeAccordingToValidationResult: function _pipeAccordingToValidationResult(deferred) { + _pipeAccordingToValidationResult: function _pipeAccordingToValidationResult() { var _this = this; - return $.Deferred(function (newDefer) { - var handle = function handle() { - var r = true === _this.validationResult ? $.Deferred().resolve() : $.Deferred().reject(); - r.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject); - }; + var pipe = function pipe() { + var r = $.Deferred(); + if (true !== _this.validationResult) r.reject(); + return r.resolve().promise(); + }; - deferred.done(handle); - deferred.fail(handle); - }); + return [pipe, pipe]; }, actualizeOptions: function actualizeOptions() { Utils.attr(this.element, this.options.namespace, this.domOptions); @@ -1377,7 +1375,8 @@ return statusMapping[this.whenValidate(options).state()]; }, whenValidate: function whenValidate() { - var _this2 = this; + var _this2 = this, + _Utils$all$done$fail$; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, group = _ref.group, @@ -1411,7 +1410,7 @@ }); }); - return this._pipeAccordingToValidationResult(Utils.all(promises).done(function () { + return (_Utils$all$done$fail$ = Utils.all(promises).done(function () { _this2._trigger('success'); }).fail(function () { _this2.validationResult = false; @@ -1421,7 +1420,7 @@ _this2._trigger('error'); }).always(function () { _this2._trigger('validated'); - })); + })).pipe.apply(_Utils$all$done$fail$, _toConsumableArray(this._pipeAccordingToValidationResult())); }, // Iterate over refreshed fields, and stop on first failure. // Returns `true` if all fields are valid, `false` if a failure is detected @@ -1645,7 +1644,8 @@ // @returns a promise that succeeds only when all validations do // or `undefined` if field is not in the given `group`. whenValidate: function whenValidate() { - var _this = this; + var _this$whenValid$alway, + _this = this; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, force = _ref.force, @@ -1658,7 +1658,7 @@ this._trigger('validate'); - return this._pipeAccordingToValidationResult(this.whenValid({ + return (_this$whenValid$alway = this.whenValid({ force: force, value: this.value, _refreshed: true @@ -1670,7 +1670,7 @@ _this._trigger('error'); }).always(function () { _this._trigger('validated'); - })); + })).pipe.apply(_this$whenValid$alway, _toConsumableArray(this._pipeAccordingToValidationResult())); }, hasConstraints: function hasConstraints() { return 0 !== this.constraints.length; @@ -1734,7 +1734,6 @@ if (!this.hasConstraints()) return $.when(); // Value could be passed as argument, needed to add more power to 'field:validate' if ('undefined' === typeof value || null === value) value = this.getValue(); - console.log('validate' + value); if (!this.needsValidation(value) && true !== force) return $.when(); var groupedConstraints = this._getGroupedConstraints(); @@ -2707,10 +2706,7 @@ $('#element').val('2001-03-03'); expect(parsleyField.isValid()).to.be(false); $('#element').val('2001/01/01').removeAttr('max'); - console.log(['2001/01/01', $('#element').val()]); - expect(parsleyField.isValid({ - value: '2001/01/01' - })).to.be(false); // Still invalid because of format + expect(parsleyField.isValid()).to.be(false); // Still invalid because of format expect(parsleyField.constraints.length).to.be(1); // Type=Date }); diff --git a/src/parsley/field.js b/src/parsley/field.js index bbb2de720..415af7a1e 100644 --- a/src/parsley/field.js +++ b/src/parsley/field.js @@ -1,16 +1,16 @@ -import $ from 'jquery'; -import Constraint from './constraint'; -import UI from './ui'; -import Utils from './utils'; +import $ from "jquery"; +import Constraint from "./constraint"; +import UI from "./ui"; +import Utils from "./utils"; var Field = function (field, domOptions, options, parsleyFormInstance) { - this.__class__ = 'Field'; + this.__class__ = "Field"; this.element = field; this.$element = $(field); // Set parent if we have one - if ('undefined' !== typeof parsleyFormInstance) { + if ("undefined" !== typeof parsleyFormInstance) { this.parent = parsleyFormInstance; } @@ -26,7 +26,7 @@ var Field = function (field, domOptions, options, parsleyFormInstance) { this._bindConstraints(); }; -var statusMapping = {pending: null, resolved: true, rejected: false}; +var statusMapping = { pending: null, resolved: true, rejected: false }; Field.prototype = { // # Public API @@ -35,39 +35,52 @@ Field.prototype = { // `null` if validation is not finished. Prefer using whenValidate validate: function (options) { if (arguments.length >= 1 && !$.isPlainObject(options)) { - Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.'); - options = {options}; + Utils.warnOnce( + "Calling validate on a parsley field without passing arguments as an object is deprecated." + ); + options = { options }; } var promise = this.whenValidate(options); - if (!promise) // If excluded with `group` option + if (!promise) + // If excluded with `group` option return true; switch (promise.state()) { - case 'pending': return null; - case 'resolved': return true; - case 'rejected': return this.validationResult; + case "pending": + return null; + case "resolved": + return true; + case "rejected": + return this.validationResult; } }, // Validate field and trigger some events for mainly `UI` // @returns a promise that succeeds only when all validations do // or `undefined` if field is not in the given `group`. - whenValidate: function ({force, group} = {}) { + whenValidate: function ({ force, group } = {}) { // do not validate a field if not the same as given validation group this.refresh(); - if (group && !this._isInGroup(group)) - return; + if (group && !this._isInGroup(group)) return; this.value = this.getValue(); // Field Validate event. `this.value` could be altered for custom needs - this._trigger('validate'); + this._trigger("validate"); return this._pipeAccordingToValidationResult( - this.whenValid({force, value: this.value, _refreshed: true}) - .always(() => { this._reflowUI(); }) - .done(() => { this._trigger('success'); }) - .fail(() => { this._trigger('error'); }) - .always(() => { this._trigger('validated'); }) + this.whenValid({ force, value: this.value, _refreshed: true }) + .always(() => { + this._reflowUI(); + }) + .done(() => { + this._trigger("success"); + }) + .fail(() => { + this._trigger("error"); + }) + .always(() => { + this._trigger("validated"); + }) ); }, @@ -77,12 +90,15 @@ Field.prototype = { // An empty optional field does not need validation needsValidation: function (value) { - if ('undefined' === typeof value) - value = this.getValue(); + if ("undefined" === typeof value) value = this.getValue(); // If a field is empty and not required, it is valid // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators - if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty) + if ( + !value.length && + !this._isRequired() && + "undefined" === typeof this.options.validateIfEmpty + ) return false; return true; @@ -100,12 +116,15 @@ Field.prototype = { // See also `whenValid`. isValid: function (options) { if (arguments.length >= 1 && !$.isPlainObject(options)) { - Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.'); + Utils.warnOnce( + "Calling isValid on a parsley field without passing arguments as an object is deprecated." + ); var [force, value] = arguments; - options = {force, value}; + options = { force, value }; } var promise = this.whenValid(options); - if (!promise) // Excluded via `group` + if (!promise) + // Excluded via `group` return true; return statusMapping[promise.state()]; }, @@ -115,28 +134,21 @@ Field.prototype = { // or `undefined` if the field is not in the given `group`. // The argument `force` will force validation of empty fields. // If a `value` is given, it will be validated instead of the value of the input. - whenValid: function ({force = false, value, group, _refreshed} = {}) { + whenValid: function ({ force = false, value, group, _refreshed } = {}) { // Recompute options and rebind constraints to have latest changes - if (!_refreshed) - this.refresh(); + if (!_refreshed) this.refresh(); // do not validate a field if not the same as given validation group - if (group && !this._isInGroup(group)) - return; + if (group && !this._isInGroup(group)) return; this.validationResult = true; // A field without constraint is valid - if (!this.hasConstraints()) - return $.when(); + if (!this.hasConstraints()) return $.when(); // Value could be passed as argument, needed to add more power to 'field:validate' - if ('undefined' === typeof value || null === value) - value = this.getValue(); - - console.log('validate' + value) + if ("undefined" === typeof value || null === value) value = this.getValue(); - if (!this.needsValidation(value) && true !== force) - return $.when(); + if (!this.needsValidation(value) && true !== force) return $.when(); var groupedConstraints = this._getGroupedConstraints(); var promises = []; @@ -144,28 +156,27 @@ Field.prototype = { // Process one group of constraints at a time, we validate the constraints // and combine the promises together. var promise = Utils.all( - $.map(constraints, constraint => this._validateConstraint(value, constraint)) + $.map(constraints, (constraint) => + this._validateConstraint(value, constraint) + ) ); promises.push(promise); - if (promise.state() === 'rejected') - return false; // Interrupt processing if a group has already failed + if (promise.state() === "rejected") return false; // Interrupt processing if a group has already failed }); return Utils.all(promises); }, // @returns a promise - _validateConstraint: function(value, constraint) { + _validateConstraint: function (value, constraint) { var result = constraint.validate(value, this); // Map false to a failed promise - if (false === result) - result = $.Deferred().reject(); + if (false === result) result = $.Deferred().reject(); // Make sure we return a promise and that we record failures - return Utils.all([result]).fail(errorMessage => { - if (!(this.validationResult instanceof Array)) - this.validationResult = []; + return Utils.all([result]).fail((errorMessage) => { + if (!(this.validationResult instanceof Array)) this.validationResult = []; this.validationResult.push({ assert: constraint, - errorMessage: 'string' === typeof errorMessage && errorMessage + errorMessage: "string" === typeof errorMessage && errorMessage, }); }); }, @@ -175,16 +186,14 @@ Field.prototype = { var value; // Value could be overriden in DOM or with explicit options - if ('function' === typeof this.options.value) + if ("function" === typeof this.options.value) value = this.options.value(this); - else if ('undefined' !== typeof this.options.value) + else if ("undefined" !== typeof this.options.value) value = this.options.value; - else - value = this.$element.val(); + else value = this.$element.val(); // Handle wrong DOM or configurations - if ('undefined' === typeof value || null === value) - return ''; + if ("undefined" === typeof value || null === value) return ""; return this._handleWhitespace(value); }, @@ -192,16 +201,16 @@ Field.prototype = { // Reset UI reset: function () { this._resetUI(); - return this._trigger('reset'); + return this._trigger("reset"); }, // Destroy Parsley instance (+ UI) destroy: function () { // Field case: emit destroy event to clean UI and then destroy stored instance this._destroyUI(); - this.$element.removeData('Parsley'); - this.$element.removeData('FieldMultiple'); - this._trigger('destroy'); + this.$element.removeData("Parsley"); + this.$element.removeData("FieldMultiple"); + this._trigger("destroy"); }, // Actualize options and rebind constraints @@ -214,26 +223,33 @@ Field.prototype = { return this.actualizeOptions()._bindConstraints(); }, - refreshConstraints: function() { - Utils.warnOnce("Parsley's refreshConstraints is deprecated. Please use refresh"); + refreshConstraints: function () { + Utils.warnOnce( + "Parsley's refreshConstraints is deprecated. Please use refresh" + ); return this.refresh(); }, /** - * Add a new constraint to a field - * - * @param {String} name - * @param {Mixed} requirements optional - * @param {Number} priority optional - * @param {Boolean} isDomConstraint optional - */ + * Add a new constraint to a field + * + * @param {String} name + * @param {Mixed} requirements optional + * @param {Number} priority optional + * @param {Boolean} isDomConstraint optional + */ addConstraint: function (name, requirements, priority, isDomConstraint) { - if (window.Parsley._validatorRegistry.validators[name]) { - var constraint = new Constraint(this, name, requirements, priority, isDomConstraint); + var constraint = new Constraint( + this, + name, + requirements, + priority, + isDomConstraint + ); // if constraint already exist, delete it and push new version - if ('undefined' !== this.constraintsByName[constraint.name]) + if ("undefined" !== this.constraintsByName[constraint.name]) this.removeConstraint(constraint.name); this.constraints.push(constraint); @@ -256,8 +272,11 @@ Field.prototype = { // Update a constraint (Remove + re-add) updateConstraint: function (name, parameters, priority) { - return this.removeConstraint(name) - .addConstraint(name, parameters, priority); + return this.removeConstraint(name).addConstraint( + name, + parameters, + priority + ); }, // # Internals @@ -290,53 +309,79 @@ Field.prototype = { // Bind specific HTML5 constraints to be HTML5 compliant _bindHtml5Constraints: function () { // html5 required - if (null !== this.element.getAttribute('required')) - this.addConstraint('required', true, undefined, true); + if (null !== this.element.getAttribute("required")) + this.addConstraint("required", true, undefined, true); // html5 pattern - if (null !== this.element.getAttribute('pattern')) - this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true); + if (null !== this.element.getAttribute("pattern")) + this.addConstraint( + "pattern", + this.element.getAttribute("pattern"), + undefined, + true + ); // range - let min = this.element.getAttribute('min'); - let max = this.element.getAttribute('max'); + let min = this.element.getAttribute("min"); + let max = this.element.getAttribute("max"); if (null !== min && null !== max) - this.addConstraint('range', [min, max], undefined, true); - + this.addConstraint("range", [min, max], undefined, true); // HTML5 min - else if (null !== min) - this.addConstraint('min', min, undefined, true); - + else if (null !== min) this.addConstraint("min", min, undefined, true); // HTML5 max - else if (null !== max) - this.addConstraint('max', max, undefined, true); - + else if (null !== max) this.addConstraint("max", max, undefined, true); // length - if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength')) - this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true); - + if ( + null !== this.element.getAttribute("minlength") && + null !== this.element.getAttribute("maxlength") + ) + this.addConstraint( + "length", + [ + this.element.getAttribute("minlength"), + this.element.getAttribute("maxlength"), + ], + undefined, + true + ); // HTML5 minlength - else if (null !== this.element.getAttribute('minlength')) - this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true); - + else if (null !== this.element.getAttribute("minlength")) + this.addConstraint( + "minlength", + this.element.getAttribute("minlength"), + undefined, + true + ); // HTML5 maxlength - else if (null !== this.element.getAttribute('maxlength')) - this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true); - + else if (null !== this.element.getAttribute("maxlength")) + this.addConstraint( + "maxlength", + this.element.getAttribute("maxlength"), + undefined, + true + ); // html5 types var type = Utils.getType(this.element); // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise - if ('number' === type) { - return this.addConstraint('type', ['number', { - step: this.element.getAttribute('step') || '1', - base: min || this.element.getAttribute('value') - }], undefined, true); - // Regular other HTML5 supported types + if ("number" === type) { + return this.addConstraint( + "type", + [ + "number", + { + step: this.element.getAttribute("step") || "1", + base: min || this.element.getAttribute("value"), + }, + ], + undefined, + true + ); + // Regular other HTML5 supported types } else if (/^(email|url|range|date)$/i.test(type)) { - return this.addConstraint('type', type, undefined, true); + return this.addConstraint("type", type, undefined, true); } return this; }, @@ -344,8 +389,7 @@ Field.prototype = { // Internal only. // Field is required if have required constraint without `false` value _isRequired: function () { - if ('undefined' === typeof this.constraintsByName.required) - return false; + if ("undefined" === typeof this.constraintsByName.required) return false; return false !== this.constraintsByName.required.requirements; }, @@ -353,7 +397,7 @@ Field.prototype = { // Internal only. // Shortcut to trigger an event _trigger: function (eventName) { - return this.trigger('field:' + eventName); + return this.trigger("field:" + eventName); }, // Internal only @@ -362,28 +406,33 @@ Field.prototype = { // Use `data-parsley-whitespace="trim"` to auto trim input value _handleWhitespace: function (value) { if (true === this.options.trimValue) - Utils.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'); + Utils.warnOnce( + 'data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"' + ); - if ('squish' === this.options.whitespace) - value = value.replace(/\s{2,}/g, ' '); + if ("squish" === this.options.whitespace) + value = value.replace(/\s{2,}/g, " "); - if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue)) + if ( + "trim" === this.options.whitespace || + "squish" === this.options.whitespace || + true === this.options.trimValue + ) value = Utils.trimString(value); return value; }, - _isDateInput: function() { + _isDateInput: function () { var c = this.constraintsByName.type; - return c && c.requirements === 'date'; + return c && c.requirements === "date"; }, // Internal only. // Returns the constraints, grouped by descending priority. // The result is thus an array of arrays of constraints. _getGroupedConstraints: function () { - if (false === this.options.priorityEnabled) - return [this.constraints]; + if (false === this.options.priorityEnabled) return [this.constraints]; var groupedConstraints = []; var index = {}; @@ -391,16 +440,16 @@ Field.prototype = { // Create array unique of priorities for (var i = 0; i < this.constraints.length; i++) { var p = this.constraints[i].priority; - if (!index[p]) - groupedConstraints.push(index[p] = []); + if (!index[p]) groupedConstraints.push((index[p] = [])); index[p].push(this.constraints[i]); } // Sort them by priority DESC - groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; }); + groupedConstraints.sort(function (a, b) { + return b[0].priority - a[0].priority; + }); return groupedConstraints; - } - + }, }; export default Field;