{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/images/valid.svg","webpack:///./app/javascript/images/invalid.svg","webpack:///./app/javascript/packs/password_validator.js","webpack:///./node_modules/password-validator/src/index.js","webpack:///./node_modules/password-validator/src/constants.js","webpack:///./node_modules/password-validator/src/lib.js","webpack:///./node_modules/password-validator/src/validationMessages.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","PasswordValidator","is","min","has","uppercase","lowercase","digits","symbols","validationRules","message","validate","password","validatePassword","feedbackElement","innerHTML","allValid","_i2","_Object$entries","entries","length","_ref2","_slicedToArray","rule","isValid","feedback","document","createElement","concat","checkIcon","crossIcon","style","color","appendChild","validateGeoJson","input","cityFeedback","isPolygon","JSON","parse","type","textContent","e","validateEmail","email","submitted","arguments","undefined","domain","split","includes","toLowerCase","addEventListener","emailInput","getElementById","emailFeedback","passwordInput","passwordFeedback","togglePasswordBtn","cityGeojson","parentNode","isEmailValid","isPasswordValid","isGeoJsonValid","toggleButton","isPasswordVisible","togglePasswordVisibility","MutationObserver","observe","attributes","attributeFilter","getElementsByClassName","preventDefault","querySelector","submit","_typeof","obj","iterator","constructor","_defineProperties","target","props","descriptor","configurable","writable","arg","hint","prim","toPrimitive","res","TypeError","String","Number","_toPrimitive","lib","error","getValidationMessage","_validateLength","num","len","isNaN","isInteger","Error","_isPasswordValidFor","method","apply","this","_register","args","description","properties","push","instance","Constructor","_classCallCheck","protoProps","staticProps","pwd","options","_this","list","Boolean","details","positive","reduce","errorList","detail","validation","inverted","validationMessage","every","count","pattern","fn","invalidPlugin","regex","letters","spaces","_process","regexp","repeat","parsedRepeat","parseInt","RegExp","test","not","symbol","max","characterIndex","upperCaseLetters","currentLetter","charAt","lowerCaseLetters","toUpperCase","oneOf","indexOf","usingPlugin","result","err","msgList","negativeMessages","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,qBAAqBtE,OAAOsI,EAAUhE,GACtI,EACA5F,UAAW,WACT,IAAI4F,EAAMpD,UAAU1B,OAAS,QAAsB2B,IAAjBD,UAAU,GAAmBA,UAAU,GAAK,EAC9E,MAAO,qBAAqBlB,OAAe,IAARsE,EAAY,WAAa,qBAAqBtE,OAAOsE,GAAM,qBAAqBtE,OAAOsI,EAAUhE,GACtI,EACA1F,QAAS,WACP,IAAI0F,EAAMpD,UAAU1B,OAAS,QAAsB2B,IAAjBD,UAAU,GAAmBA,UAAU,GAAK,EAC9E,MAAO,qBAAqBlB,OAAe,IAARsE,EAAY,WAAa,qBAAqBtE,OAAOsE,GAAM,WAAWtE,OAAOsI,EAAUhE,GAC5H,EACAuC,OAAQ,WACN,IAAIvC,EAAMpD,UAAU1B,OAAS,QAAsB2B,IAAjBD,UAAU,GAAmBA,UAAU,GAAK,EAC9E,MAAO,qBAAqBlB,OAAe,IAARsE,EAAY,WAAa,qBAAqBtE,OAAOsE,GAAM,UAAUtE,OAAOsI,EAAUhE,GAC3H,EACAwD,MAAO,SAAelC,GACpB,MAAO,4BAA4B5F,OAAO4F,EAAKpG,OAAS,EAAI,UAAUQ,OAAO4F,EAAK2C,MAAM,GAAI,GAAGC,KAAK,MAAO,SAAW,IAAIxI,OAAO4F,EAAKA,EAAKpG,OAAS,GACtJ,EACAhB,IAAK,SAAagI,GAChB,MAAO,uCAAuCxG,OAAOwG,EAAS,IAChE,EACAa,IAAK,SAAab,GAChB,MAAO,mCAAmCxG,OAAOwG,EAAS,IAC5D,EACAwB,YAAa,SAAqBvB,GAChC,MAAO,6BAA6BzG,OAAOyG,EAAG7J,MAAQ,SACxD,GAEF,SAAS0L,EAAUhE,GACjB,OAAe,IAARA,EAAY,GAAK,GAC1B,C","file":"js/password_validator-00c29950801c3351201a.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2052);\n","module.exports = __webpack_public_path__ + \"media/app/javascript/images/valid-331645038a1c799a30cf66ef8bccc069.svg\";","module.exports = __webpack_public_path__ + \"media/app/javascript/images/invalid-85ce74a06fa0a6299384a56d96684d1c.svg\";","import PasswordValidator from 'password-validator';\nimport checkIcon from '../images/valid.svg';\nimport crossIcon from '../images/invalid.svg';\nconst schema = new PasswordValidator()\n .is().min(8)\n .has().uppercase()\n .has().lowercase()\n .has().digits()\n .has().symbols()\n\n\nconst validationRules = {\n lowercase: {\n message: \"A lowercase character\",\n validate: (password) => new PasswordValidator().has().lowercase().validate(password)\n },\n uppercase: {\n message: \"An uppercase character\",\n validate: (password) => new PasswordValidator().has().uppercase().validate(password)\n },\n digits: {\n message: \"A number\",\n validate: (password) => new PasswordValidator().has().digits().validate(password)\n },\n min: {\n message: \"Minimum 8 characters\",\n validate: (password) => new PasswordValidator().is().min(8).validate(password)\n },\n symbols: {\n message: \"A special character\",\n validate: (password) => new PasswordValidator().has().symbols().validate(password)\n }\n};\n\nfunction validatePassword(password, feedbackElement) {\n feedbackElement.innerHTML = ''; // Clear previous feedback\n let allValid = true;\n\n for (const [key, rule] of Object.entries(validationRules)) {\n const isValid = rule.validate(password);\n\n const feedback = document.createElement('div');\n feedback.innerHTML = isValid\n ? `
${rule.message}`\n : `
${rule.message}`;\n\n feedback.style.color = isValid ? 'green' : 'rgba(0,0,0,.5)';\n feedbackElement.appendChild(feedback);\n\n if (!isValid) allValid = false;\n }\n\n return allValid;\n}\n\nfunction validateGeoJson(input, cityFeedback) {\n let isPolygon\n try {\n const parsed = JSON.parse(input);\n isPolygon = parsed.type !== \"Point\";\n\n if (isPolygon) {\n cityFeedback.textContent = '';\n } else {\n cityFeedback.textContent = 'Please select a valid city';\n cityFeedback.style.color = 'red';\n }\n } catch (e) {\n isPolygon = false;\n cityFeedback.textContent = 'Please select a valid city';\n cityFeedback.style.color = 'red';\n }\n\n return isPolygon\n}\n\nfunction validateEmail(email, feedbackElement, submitted = false) {\n const restrictedDomains = ['gmail.com', 'yahoo.com', 'outlook.com', 'hotmail.com'];\n const domain = email.split('@')[1];\n\n feedbackElement.textContent = '';\n\n if ((domain && restrictedDomains.includes(domain.toLowerCase())) || (domain === undefined) && submitted) {\n feedbackElement.textContent = 'Please use a work email (no Gmail, Yahoo, etc.)';\n feedbackElement.style.color = 'red';\n return false;\n } else {\n feedbackElement.textContent = '';\n feedbackElement.style.color = 'green';\n return true;\n }\n}\n\nfunction updateSubmitButtonState(emailValid, passwordValid, isGeoJsonValid) {\n const submit = document.getElementsByClassName('submit-btn')[0];\n submit.disabled = !(emailValid && passwordValid && isGeoJsonValid);\n}\n\nfunction togglePasswordVisibility(passwordInput, toggleButton) {\n const isPasswordVisible = passwordInput.type === 'text';\n\n passwordInput.type = isPasswordVisible ? 'password' : 'text';\n}\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const emailInput = document.getElementById('user_email');\n const emailFeedback = document.getElementById('email-feedback');\n const passwordInput = document.getElementById('password');\n const passwordFeedback = document.getElementById('password-feedback');\n const cityFeedback = document.getElementById('city-feedback');\n const togglePasswordBtn = document.getElementById('toggle-password-visibility');\n const cityGeojson = document.getElementById('city-geojson');\n\n emailInput.parentNode.appendChild(emailFeedback);\n\n let isEmailValid = false;\n let isPasswordValid = false;\n let isGeoJsonValid = false;\n\n if (emailInput && emailFeedback) {\n validateEmail(emailInput.value, emailFeedback);\n emailInput.addEventListener('input', () => {\n isEmailValid = validateEmail(emailInput.value, emailFeedback);\n // updateSubmitButtonState(isEmailValid, isPasswordValid, isGeoJsonValid);\n });\n }\n\n if (passwordInput && passwordFeedback) {\n validatePassword(passwordInput.value, passwordFeedback);\n passwordInput.addEventListener('input', () => {\n isPasswordValid = validatePassword(passwordInput.value, passwordFeedback);\n // updateSubmitButtonState(isEmailValid, isPasswordValid, isGeoJsonValid);\n });\n }\n\n if (togglePasswordBtn && passwordInput) {\n togglePasswordBtn.addEventListener('click', () => {\n togglePasswordVisibility(passwordInput, togglePasswordBtn);\n });\n }\n\n if (cityGeojson) {\n const observer = new MutationObserver(() => {\n isGeoJsonValid = validateGeoJson(cityGeojson.value, cityFeedback);\n // updateSubmitButtonState(isEmailValid, isPasswordValid, isGeoJsonValid);\n });\n\n observer.observe(cityGeojson, {\n attributes: true,\n attributeFilter: ['value']\n });\n }\n\n const submit = document.getElementsByClassName('submit-btn')[0];\n submit.addEventListener('click', (e) => {\n e.preventDefault();\n\n isEmailValid = validateEmail(emailInput.value, emailFeedback, true);\n isPasswordValid = validatePassword(passwordInput.value, passwordFeedback);\n isGeoJsonValid = validateGeoJson(cityGeojson.value, cityFeedback);\n\n if (!isEmailValid) {\n emailFeedback.textContent = 'Please use a work email (no Gmail, Yahoo, etc.)';\n emailFeedback.style.color = 'red';\n } else {\n emailFeedback.textContent = '';\n }\n\n if (!isGeoJsonValid) {\n cityFeedback.textContent = 'Please select a valid city';\n cityFeedback.style.color = 'red';\n } else {\n cityFeedback.textContent = '';\n }\n\n if (isEmailValid && isPasswordValid && isGeoJsonValid) {\n document.querySelector('form').submit();\n }\n });\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/* eslint-disable no-unused-vars */\nvar lib = require('./lib');\nvar error = require('./constants').error;\nvar getValidationMessage = require('./validationMessages');\n\n/**\n * Validates that a number is a valid length (positive number)\n *\n * @private\n * @param {number} num - Number to validate\n */\nfunction _validateLength(num) {\n var len = Number(num);\n if (isNaN(len) || !Number.isInteger(len) || len < 1) {\n throw new Error(error.length);\n }\n}\n\n/**\n * Tests a validation and return the result\n *\n * @private\n * @param {string} property - Property to validate\n * @returns {boolean} Boolean value indicting the validity\n * of the password against the property\n */\nfunction _isPasswordValidFor(property) {\n return lib[property.method].apply(this, property.arguments);\n}\n\n/**\n * Registers the properties of a password-validation schema object\n *\n * @private\n * @param {string} method - Property name\n * @param {array} arguments - arguments for the func property\n * @returns {PasswordValidator}\n */\nfunction _register(method, args, description) {\n // Add property to the schema\n this.properties.push({\n method: method,\n arguments: args,\n description: description\n });\n return this;\n}\nvar PasswordValidator = /*#__PURE__*/function () {\n /**\n * Creates a password-validator schema\n *\n * @constructor\n */\n function PasswordValidator() {\n _classCallCheck(this, PasswordValidator);\n this.properties = [];\n }\n\n /**\n * Method to validate the password against schema\n *\n * @param {string} pwd - password to validate\n * @param {object} [options] - optional options to configure validation\n * @param {boolean} [options.list] - asks for a list of validation\n * failures instead of just true/false\n * @param {boolean} [options.details] - asks for more details about\n * failed validations including arguments, and error messages\n * @returns {boolean|array} Boolean value indicting the validity\n * of the password as per schema, if 'options.list' or\n * 'options.details' is not set. Otherwise, it returns an\n * array of property names which failed validations\n */\n _createClass(PasswordValidator, [{\n key: \"validate\",\n value: function validate(pwd, options) {\n var _this = this;\n this.list = Boolean(options && options.list);\n this.details = Boolean(options && options.details);\n this.password = String(pwd);\n this.positive = true;\n if (this.list || this.details) {\n return this.properties.reduce(function (errorList, property) {\n // Applies all validations defined in lib one by one\n if (!_isPasswordValidFor.call(_this, property)) {\n // If the validation for a property fails,\n // add it to the error list\n var detail = property.method;\n // If the details option was provided,\n // return a rich object including validation message\n if (_this.details) {\n detail = {\n validation: property.method\n };\n if (property.arguments && property.arguments[0]) {\n detail.arguments = property.arguments[0];\n }\n if (!_this.positive && property.method !== 'not') {\n detail.inverted = true;\n }\n var description = property.arguments && property.arguments[1];\n var validationMessage = description || getValidationMessage(property.method, detail.arguments, detail.inverted);\n detail.message = validationMessage;\n }\n return errorList.concat(detail);\n }\n return errorList;\n }, []);\n }\n return this.properties.every(_isPasswordValidFor.bind(this));\n }\n\n /**\n * Rule to mandate the presence of letters in the password\n *\n * @param {number} [count] - minimum number of letters required\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"letters\",\n value: function letters(count, description) {\n count && _validateLength(count);\n return _register.call(this, 'letters', arguments);\n }\n\n /**\n * Rule to mandate the presence of digits in the password\n *\n * @param {number} [count] - minimum number of digits required\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"digits\",\n value: function digits(count, description) {\n count && _validateLength(count);\n return _register.call(this, 'digits', arguments);\n }\n\n /**\n * Rule to mandate the presence of symbols in the password\n *\n * @param {number} [count] - minimum number of symbols required\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"symbols\",\n value: function symbols(count, description) {\n count && _validateLength(count);\n return _register.call(this, 'symbols', arguments);\n }\n\n /**\n * Rule to specify a minimum length of the password\n *\n * @param {number} num - minimum length\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"min\",\n value: function min(num, description) {\n _validateLength(num);\n return _register.call(this, 'min', arguments);\n }\n\n /**\n * Rule to specify a maximum length of the password\n *\n * @param {number} num - maximum length\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"max\",\n value: function max(num, description) {\n _validateLength(num);\n return _register.call(this, 'max', arguments);\n }\n\n /**\n * Rule to mandate the presence of lowercase letters in the password\n *\n * @param {number} [count] - minimum number of lowercase letters required\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"lowercase\",\n value: function lowercase(count, description) {\n count && _validateLength(count);\n return _register.call(this, 'lowercase', arguments);\n }\n\n /**\n * Rule to mandate the presence of uppercase letters in the password\n *\n * @param {number} [count] - minimum number of uppercase letters required\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"uppercase\",\n value: function uppercase(count, description) {\n count && _validateLength(count);\n return _register.call(this, 'uppercase', arguments);\n }\n\n /**\n * Rule to mandate the presence of space in the password\n * It can be used along with 'not' to not allow spaces\n * in the password\n *\n * @param {number} [count] - minimum number of spaces required\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"spaces\",\n value: function spaces(count, description) {\n count && _validateLength(count);\n return _register.call(this, 'spaces', arguments);\n }\n\n /**\n * Rule to invert the effects of 'not'\n * Apart from that, 'has' is also used\n * to make the api readable and chainable\n *\n * @param {string|RegExp} [pattern] - pattern to match\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"has\",\n value: function has(pattern, description) {\n return _register.call(this, 'has', arguments);\n }\n\n /**\n * Rule to invert the next applied rules.\n * All the rules applied after 'not' will have opposite effect,\n * until 'has' rule is applied\n *\n * @param {string|RegExp} [pattern] - pattern to not match\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"not\",\n value: function not(pattern, description) {\n return _register.call(this, 'not', arguments);\n }\n\n /**\n * Rule to invert the effects of 'not'\n * Apart from that, 'is' is also used\n * to make the api readable and chainable\n *\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"is\",\n value: function is() {\n return _register.call(this, 'is', arguments);\n }\n\n /**\n * Rule to whitelist words to be used as password\n *\n * @param {array} list - list of values allowed\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"oneOf\",\n value: function oneOf(list, description) {\n return _register.call(this, 'oneOf', arguments);\n }\n\n /**\n * Insert a plugin function into the validation chain\n *\n * @param {Plugin} fn - A plugin function\n * @param {string} [description] - description of the validation\n * @returns {PasswordValidator} instance of PasswordValidator schema\n */\n }, {\n key: \"usingPlugin\",\n value: function usingPlugin(fn, description) {\n if (typeof fn !== 'function') {\n throw new Error(error.invalidPlugin);\n }\n return _register.call(this, 'usingPlugin', arguments);\n }\n }]);\n return PasswordValidator;\n}();\nmodule.exports = PasswordValidator;\n\n/**\n * @callback Plugin\n * @param password Password injected by the library\n */","module.exports = {\n error: {\n length: 'Length should be a valid positive number',\n password: 'Password should be a valid string',\n invalidPlugin: 'Plugin should be a valid function'\n },\n regex: {\n digits: '(\\\\d.*)',\n letters: '([a-zA-Z].*)',\n symbols: '([`~\\\\!@#\\\\$%\\\\^\\\\&\\\\*\\\\(\\\\)\\\\-_\\\\=\\\\+\\\\[\\\\\\{\\\\}\\\\]\\\\\\\\\\|;:\\\\\\'\",<.>\\\\/\\\\?€£¥₹§±].*)',\n spaces: '([\\\\s].*)'\n }\n};","/**\n * Generic method to test regex\n *\n * @private\n * @param {string} regex - regex to test\n * with password\n */\nvar regex = require('./constants').regex;\nfunction _process(regexp, repeat) {\n if (repeat && repeat > 1) {\n var parsedRepeat = parseInt(repeat, 10);\n return new RegExp(regexp + '{' + parsedRepeat + ',}').test(this.password) === this.positive;\n }\n return new RegExp(regexp).test(this.password) === this.positive;\n}\nmodule.exports = {\n /**\n * Method to invert the next validations\n *\n * @param {RegExp} [symbol] - custom Regex which should not be present\n */\n not: function not(symbol) {\n this.positive = false;\n if (symbol) {\n return _process.call(this, symbol);\n }\n return true;\n },\n /**\n * Method to invert the effects of not()\n *\n * @param {RegExp} [symbol] - custom Regex which should be present\n */\n has: function has(symbol) {\n this.positive = true;\n if (symbol) {\n return _process.call(this, symbol);\n }\n return true;\n },\n /**\n * Method to invert the effects of not() and\n * to make the api readable and chainable\n *\n */\n is: function is() {\n this.positive = true;\n return true;\n },\n /**\n * Method to specify a minimum length\n *\n * @param {number} num - minimum length\n */\n min: function min(num) {\n return this.password.length >= num;\n },\n /**\n * Method to specify a maximum length\n *\n * @param {number} num - maximum length\n */\n max: function max(num) {\n return this.password.length <= num;\n },\n /**\n * Method to validate the presence of digits\n *\n * @param {number} repeat - count of required digits\n */\n digits: function digits(repeat) {\n return _process.call(this, regex.digits, repeat);\n },\n /**\n * Method to validate the presence of letters\n *\n * @param {number} repeat - count of required letters\n */\n letters: function letters(repeat) {\n return _process.call(this, regex.letters, repeat);\n },\n /**\n * Method to validate the presence of uppercase letters\n *\n * @param {number} repeat - count of required uppercase letters\n */\n uppercase: function uppercase(repeat) {\n if (repeat && repeat > 1) {\n var characterIndex = 0;\n var upperCaseLetters = 0;\n while (upperCaseLetters < repeat && characterIndex < this.password.length) {\n var currentLetter = this.password.charAt(characterIndex);\n if (currentLetter !== currentLetter.toLowerCase()) {\n upperCaseLetters++;\n }\n characterIndex++;\n }\n return upperCaseLetters === repeat === this.positive;\n }\n return this.password !== this.password.toLowerCase() === this.positive;\n },\n /**\n * Method to validate the presence of lowercase letters\n *\n * @param {number} repeat - count of required lowercase letters\n */\n lowercase: function lowercase(repeat) {\n if (repeat && repeat > 1) {\n var characterIndex = 0;\n var lowerCaseLetters = 0;\n while (lowerCaseLetters < repeat && characterIndex < this.password.length) {\n var currentLetter = this.password.charAt(characterIndex);\n if (currentLetter !== currentLetter.toUpperCase()) {\n lowerCaseLetters++;\n }\n characterIndex++;\n }\n return lowerCaseLetters === repeat === this.positive;\n }\n return this.password !== this.password.toUpperCase() === this.positive;\n },\n /**\n * Method to validate the presence of symbols\n *\n * @param {number} repeat - count of required symbols\n */\n symbols: function symbols(repeat) {\n return _process.call(this, regex.symbols, repeat);\n },\n /**\n * Method to validate the presence of space\n *\n * @param {number} repeat - count of required spaces\n */\n spaces: function spaces(repeat) {\n return _process.call(this, regex.spaces, repeat);\n },\n /**\n * Method to provide pre-defined values for password\n *\n * @param {array} list - list of values allowed\n */\n oneOf: function oneOf(list) {\n return list.indexOf(this.password) >= 0 === this.positive;\n },\n /**\n * Method to run a plugin function for password\n *\n * @param {function} plugin - A plugin function\n */\n usingPlugin: function usingPlugin(fn) {\n try {\n var result = fn.call({}, this.password);\n return Boolean(result) === this.positive;\n } catch (err) {\n return false;\n }\n }\n};","module.exports = function (method, arg, inverted) {\n var msgList = inverted ? negativeMessages : positiveMessages;\n return msgList[method] && msgList[method](arg);\n};\nvar positiveMessages = {\n min: function min(num) {\n return \"The string should have a minimum length of \".concat(num, \" character\").concat(pluralify(num));\n },\n max: function max(num) {\n return \"The string should have a maximum length of \".concat(num, \" character\").concat(pluralify(num));\n },\n letters: function letters() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return \"The string should have a minimum of \".concat(num, \" letter\").concat(pluralify(num));\n },\n digits: function digits() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return \"The string should have a minimum of \".concat(num, \" digit\").concat(pluralify(num));\n },\n uppercase: function uppercase() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return \"The string should have a minimum of \".concat(num, \" uppercase letter\").concat(pluralify(num));\n },\n lowercase: function lowercase() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return \"The string should have a minimum of \".concat(num, \" lowercase letter\").concat(pluralify(num));\n },\n symbols: function symbols() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return \"The string should have a minimum of \".concat(num, \" symbol\").concat(pluralify(num));\n },\n spaces: function spaces() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n return \"The string should have a minimum of \".concat(num, \" space\").concat(pluralify(num));\n },\n oneOf: function oneOf(list) {\n return \"The string should be \".concat(list.length > 1 ? \"one of \".concat(list.slice(0, -1).join(', '), \" and \") : '').concat(list[list.length - 1]);\n },\n has: function has(pattern) {\n return \"The string should have pattern '\".concat(pattern, \"'\");\n },\n not: function not(pattern) {\n return \"The string should not have pattern '\".concat(pattern, \"'\");\n },\n usingPlugin: function usingPlugin(fn) {\n return \"The string should not violate \".concat(fn.name || 'plugin');\n }\n};\nvar negativeMessages = {\n min: function min(num) {\n return \"The string should have a maximum length of \".concat(num, \" character\").concat(pluralify(num));\n },\n max: function max(num) {\n return \"The string should have a minimum length of \".concat(num, \" character\").concat(pluralify(num));\n },\n letters: function letters() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return \"The string should \".concat(num === 0 ? 'not have' : \"have a maximum of \".concat(num), \" letter\").concat(pluralify(num));\n },\n digits: function digits() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return \"The string should \".concat(num === 0 ? 'not have' : \"have a maximum of \".concat(num), \" digit\").concat(pluralify(num));\n },\n uppercase: function uppercase() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return \"The string should \".concat(num === 0 ? 'not have' : \"have a maximum of \".concat(num), \" uppercase letter\").concat(pluralify(num));\n },\n lowercase: function lowercase() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return \"The string should \".concat(num === 0 ? 'not have' : \"have a maximum of \".concat(num), \" lowercase letter\").concat(pluralify(num));\n },\n symbols: function symbols() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return \"The string should \".concat(num === 0 ? 'not have' : \"have a maximum of \".concat(num), \" symbol\").concat(pluralify(num));\n },\n spaces: function spaces() {\n var num = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n return \"The string should \".concat(num === 0 ? 'not have' : \"have a maximum of \".concat(num), \" space\").concat(pluralify(num));\n },\n oneOf: function oneOf(list) {\n return \"The string should not be \".concat(list.length > 1 ? \"one of \".concat(list.slice(0, -1).join(', '), \" and \") : '').concat(list[list.length - 1]);\n },\n has: function has(pattern) {\n return \"The string should not have pattern '\".concat(pattern, \"'\");\n },\n not: function not(pattern) {\n return \"The string should have pattern '\".concat(pattern, \"'\");\n },\n usingPlugin: function usingPlugin(fn) {\n return \"The string should violate \".concat(fn.name || 'plugin');\n }\n};\nfunction pluralify(num) {\n return num === 1 ? '' : 's';\n}"],"sourceRoot":""}