| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805 |
- import {
- require_jquery
- } from "./chunk-DH55I632.js";
- import {
- __commonJS
- } from "./chunk-WFTEJBJX.js";
- // node_modules/jquery-validation/dist/additional-methods.js
- var require_additional_methods = __commonJS({
- "node_modules/jquery-validation/dist/additional-methods.js"(exports, module) {
- (function(factory) {
- if (typeof define === "function" && define.amd) {
- define(["jquery", "./jquery.validate"], factory);
- } else if (typeof module === "object" && module.exports) {
- module.exports = factory(require_jquery());
- } else {
- factory(jQuery);
- }
- })(function($) {
- (function() {
- function stripHtml(value) {
- return value.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "");
- }
- $.validator.addMethod("maxWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params;
- }, $.validator.format("Please enter {0} words or less."));
- $.validator.addMethod("minWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
- }, $.validator.format("Please enter at least {0} words."));
- $.validator.addMethod("rangeWords", function(value, element, params) {
- var valueStripped = stripHtml(value), regex = /\b\w+\b/g;
- return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1];
- }, $.validator.format("Please enter between {0} and {1} words."));
- })();
- $.validator.addMethod("abaRoutingNumber", function(value) {
- var checksum = 0;
- var tokens = value.split("");
- var length = tokens.length;
- if (length !== 9) {
- return false;
- }
- for (var i = 0; i < length; i += 3) {
- checksum += parseInt(tokens[i], 10) * 3 + parseInt(tokens[i + 1], 10) * 7 + parseInt(tokens[i + 2], 10);
- }
- if (checksum !== 0 && checksum % 10 === 0) {
- return true;
- }
- return false;
- }, "Please enter a valid routing number.");
- $.validator.addMethod("accept", function(value, element, param) {
- var typeParam = typeof param === "string" ? param.replace(/\s/g, "") : "image/*", optionalValue = this.optional(element), i, file, regex;
- if (optionalValue) {
- return optionalValue;
- }
- if ($(element).attr("type") === "file") {
- typeParam = typeParam.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g, "\\$&").replace(/,/g, "|").replace(/\/\*/g, "/.*");
- if (element.files && element.files.length) {
- regex = new RegExp(".?(" + typeParam + ")$", "i");
- for (i = 0; i < element.files.length; i++) {
- file = element.files[i];
- if (!file.type.match(regex)) {
- return false;
- }
- }
- }
- }
- return true;
- }, $.validator.format("Please enter a value with a valid mimetype."));
- $.validator.addMethod("alphanumeric", function(value, element) {
- return this.optional(element) || /^\w+$/i.test(value);
- }, "Letters, numbers, and underscores only please.");
- $.validator.addMethod("bankaccountNL", function(value, element) {
- if (this.optional(element)) {
- return true;
- }
- if (!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value)) {
- return false;
- }
- var account = value.replace(/ /g, ""), sum = 0, len = account.length, pos, factor, digit;
- for (pos = 0; pos < len; pos++) {
- factor = len - pos;
- digit = account.substring(pos, pos + 1);
- sum = sum + factor * digit;
- }
- return sum % 11 === 0;
- }, "Please specify a valid bank account number.");
- $.validator.addMethod("bankorgiroaccountNL", function(value, element) {
- return this.optional(element) || $.validator.methods.bankaccountNL.call(this, value, element) || $.validator.methods.giroaccountNL.call(this, value, element);
- }, "Please specify a valid bank or giro account number.");
- $.validator.addMethod("bic", function(value, element) {
- return this.optional(element) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(value.toUpperCase());
- }, "Please specify a valid BIC code.");
- $.validator.addMethod("cifES", function(value, element) {
- "use strict";
- if (this.optional(element)) {
- return true;
- }
- var cifRegEx = new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi);
- var letter = value.substring(0, 1), number = value.substring(1, 8), control = value.substring(8, 9), all_sum = 0, even_sum = 0, odd_sum = 0, i, n, control_digit, control_letter;
- function isOdd(n2) {
- return n2 % 2 === 0;
- }
- if (value.length !== 9 || !cifRegEx.test(value)) {
- return false;
- }
- for (i = 0; i < number.length; i++) {
- n = parseInt(number[i], 10);
- if (isOdd(i)) {
- n *= 2;
- odd_sum += n < 10 ? n : n - 9;
- } else {
- even_sum += n;
- }
- }
- all_sum = even_sum + odd_sum;
- control_digit = (10 - all_sum.toString().substr(-1)).toString();
- control_digit = parseInt(control_digit, 10) > 9 ? "0" : control_digit;
- control_letter = "JABCDEFGHI".substr(control_digit, 1).toString();
- if (letter.match(/[ABEH]/)) {
- return control === control_digit;
- } else if (letter.match(/[KPQS]/)) {
- return control === control_letter;
- }
- return control === control_digit || control === control_letter;
- }, "Please specify a valid CIF number.");
- $.validator.addMethod("cnhBR", function(value) {
- value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "");
- if (value.length !== 11) {
- return false;
- }
- var sum = 0, dsc = 0, firstChar, firstCN, secondCN, i, j, v;
- firstChar = value.charAt(0);
- if (new Array(12).join(firstChar) === value) {
- return false;
- }
- for (i = 0, j = 9, v = 0; i < 9; ++i, --j) {
- sum += +(value.charAt(i) * j);
- }
- firstCN = sum % 11;
- if (firstCN >= 10) {
- firstCN = 0;
- dsc = 2;
- }
- sum = 0;
- for (i = 0, j = 1, v = 0; i < 9; ++i, ++j) {
- sum += +(value.charAt(i) * j);
- }
- secondCN = sum % 11;
- if (secondCN >= 10) {
- secondCN = 0;
- } else {
- secondCN = secondCN - dsc;
- }
- return String(firstCN).concat(secondCN) === value.substr(-2);
- }, "Please specify a valid CNH number.");
- $.validator.addMethod("cnpjBR", function(value, element) {
- "use strict";
- if (this.optional(element)) {
- return true;
- }
- value = value.replace(/[^\d]+/g, "");
- if (value.length !== 14) {
- return false;
- }
- if (value === "00000000000000" || value === "11111111111111" || value === "22222222222222" || value === "33333333333333" || value === "44444444444444" || value === "55555555555555" || value === "66666666666666" || value === "77777777777777" || value === "88888888888888" || value === "99999999999999") {
- return false;
- }
- var tamanho = value.length - 2;
- var numeros = value.substring(0, tamanho);
- var digitos = value.substring(tamanho);
- var soma = 0;
- var pos = tamanho - 7;
- for (var i = tamanho; i >= 1; i--) {
- soma += numeros.charAt(tamanho - i) * pos--;
- if (pos < 2) {
- pos = 9;
- }
- }
- var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
- if (resultado !== parseInt(digitos.charAt(0), 10)) {
- return false;
- }
- tamanho = tamanho + 1;
- numeros = value.substring(0, tamanho);
- soma = 0;
- pos = tamanho - 7;
- for (var il = tamanho; il >= 1; il--) {
- soma += numeros.charAt(tamanho - il) * pos--;
- if (pos < 2) {
- pos = 9;
- }
- }
- resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
- if (resultado !== parseInt(digitos.charAt(1), 10)) {
- return false;
- }
- return true;
- }, "Please specify a CNPJ value number.");
- $.validator.addMethod("cpfBR", function(value, element) {
- "use strict";
- if (this.optional(element)) {
- return true;
- }
- value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "");
- if (value.length !== 11) {
- return false;
- }
- var sum = 0, firstCN, secondCN, checkResult, i;
- firstCN = parseInt(value.substring(9, 10), 10);
- secondCN = parseInt(value.substring(10, 11), 10);
- checkResult = function(sum2, cn) {
- var result = sum2 * 10 % 11;
- if (result === 10 || result === 11) {
- result = 0;
- }
- return result === cn;
- };
- if (value === "" || value === "00000000000" || value === "11111111111" || value === "22222222222" || value === "33333333333" || value === "44444444444" || value === "55555555555" || value === "66666666666" || value === "77777777777" || value === "88888888888" || value === "99999999999") {
- return false;
- }
- for (i = 1; i <= 9; i++) {
- sum = sum + parseInt(value.substring(i - 1, i), 10) * (11 - i);
- }
- if (checkResult(sum, firstCN)) {
- sum = 0;
- for (i = 1; i <= 10; i++) {
- sum = sum + parseInt(value.substring(i - 1, i), 10) * (12 - i);
- }
- return checkResult(sum, secondCN);
- }
- return false;
- }, "Please specify a valid CPF number.");
- $.validator.addMethod("creditcard", function(value, element) {
- if (this.optional(element)) {
- return "dependency-mismatch";
- }
- if (/[^0-9 \-]+/.test(value)) {
- return false;
- }
- var nCheck = 0, nDigit = 0, bEven = false, n, cDigit;
- value = value.replace(/\D/g, "");
- if (value.length < 13 || value.length > 19) {
- return false;
- }
- for (n = value.length - 1; n >= 0; n--) {
- cDigit = value.charAt(n);
- nDigit = parseInt(cDigit, 10);
- if (bEven) {
- if ((nDigit *= 2) > 9) {
- nDigit -= 9;
- }
- }
- nCheck += nDigit;
- bEven = !bEven;
- }
- return nCheck % 10 === 0;
- }, "Please enter a valid credit card number.");
- $.validator.addMethod("creditcardtypes", function(value, element, param) {
- if (/[^0-9\-]+/.test(value)) {
- return false;
- }
- value = value.replace(/\D/g, "");
- var validTypes = 0;
- if (param.mastercard) {
- validTypes |= 1;
- }
- if (param.visa) {
- validTypes |= 2;
- }
- if (param.amex) {
- validTypes |= 4;
- }
- if (param.dinersclub) {
- validTypes |= 8;
- }
- if (param.enroute) {
- validTypes |= 16;
- }
- if (param.discover) {
- validTypes |= 32;
- }
- if (param.jcb) {
- validTypes |= 64;
- }
- if (param.unknown) {
- validTypes |= 128;
- }
- if (param.all) {
- validTypes = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128;
- }
- if (validTypes & 1 && (/^(5[12345])/.test(value) || /^(2[234567])/.test(value))) {
- return value.length === 16;
- }
- if (validTypes & 2 && /^(4)/.test(value)) {
- return value.length === 16;
- }
- if (validTypes & 4 && /^(3[47])/.test(value)) {
- return value.length === 15;
- }
- if (validTypes & 8 && /^(3(0[012345]|[68]))/.test(value)) {
- return value.length === 14;
- }
- if (validTypes & 16 && /^(2(014|149))/.test(value)) {
- return value.length === 15;
- }
- if (validTypes & 32 && /^(6011)/.test(value)) {
- return value.length === 16;
- }
- if (validTypes & 64 && /^(3)/.test(value)) {
- return value.length === 16;
- }
- if (validTypes & 64 && /^(2131|1800)/.test(value)) {
- return value.length === 15;
- }
- if (validTypes & 128) {
- return true;
- }
- return false;
- }, "Please enter a valid credit card number.");
- $.validator.addMethod("currency", function(value, element, param) {
- var isParamString = typeof param === "string", symbol = isParamString ? param : param[0], soft = isParamString ? true : param[1], regex;
- symbol = symbol.replace(/,/g, "");
- symbol = soft ? symbol + "]" : symbol + "]?";
- regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$";
- regex = new RegExp(regex);
- return this.optional(element) || regex.test(value);
- }, "Please specify a valid currency.");
- $.validator.addMethod("dateFA", function(value, element) {
- return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value);
- }, $.validator.messages.date);
- $.validator.addMethod("dateITA", function(value, element) {
- var check = false, re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, adata, gg, mm, aaaa, xdata;
- if (re.test(value)) {
- adata = value.split("/");
- gg = parseInt(adata[0], 10);
- mm = parseInt(adata[1], 10);
- aaaa = parseInt(adata[2], 10);
- xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0));
- if (xdata.getUTCFullYear() === aaaa && xdata.getUTCMonth() === mm - 1 && xdata.getUTCDate() === gg) {
- check = true;
- } else {
- check = false;
- }
- } else {
- check = false;
- }
- return this.optional(element) || check;
- }, $.validator.messages.date);
- $.validator.addMethod("dateNL", function(value, element) {
- return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
- }, $.validator.messages.date);
- $.validator.addMethod("extension", function(value, element, param) {
- param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif";
- return this.optional(element) || value.match(new RegExp("\\.(" + param + ")$", "i"));
- }, $.validator.format("Please enter a value with a valid extension."));
- $.validator.addMethod("giroaccountNL", function(value, element) {
- return this.optional(element) || /^[0-9]{1,7}$/.test(value);
- }, "Please specify a valid giro account number.");
- $.validator.addMethod("greaterThan", function(value, element, param) {
- var target = $(param);
- if (this.settings.onfocusout && target.not(".validate-greaterThan-blur").length) {
- target.addClass("validate-greaterThan-blur").on("blur.validate-greaterThan", function() {
- $(element).valid();
- });
- }
- return value > target.val();
- }, "Please enter a greater value.");
- $.validator.addMethod("greaterThanEqual", function(value, element, param) {
- var target = $(param);
- if (this.settings.onfocusout && target.not(".validate-greaterThanEqual-blur").length) {
- target.addClass("validate-greaterThanEqual-blur").on("blur.validate-greaterThanEqual", function() {
- $(element).valid();
- });
- }
- return value >= target.val();
- }, "Please enter a greater value.");
- $.validator.addMethod("iban", function(value, element) {
- if (this.optional(element)) {
- return true;
- }
- var iban = value.replace(/ /g, "").toUpperCase(), ibancheckdigits = "", leadingZeroes = true, cRest = "", cOperator = "", countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p;
- var minimalIBANlength = 5;
- if (iban.length < minimalIBANlength) {
- return false;
- }
- countrycode = iban.substring(0, 2);
- bbancountrypatterns = {
- "AL": "\\d{8}[\\dA-Z]{16}",
- "AD": "\\d{8}[\\dA-Z]{12}",
- "AT": "\\d{16}",
- "AZ": "[\\dA-Z]{4}\\d{20}",
- "BE": "\\d{12}",
- "BH": "[A-Z]{4}[\\dA-Z]{14}",
- "BA": "\\d{16}",
- "BR": "\\d{23}[A-Z][\\dA-Z]",
- "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
- "CR": "\\d{17}",
- "HR": "\\d{17}",
- "CY": "\\d{8}[\\dA-Z]{16}",
- "CZ": "\\d{20}",
- "DK": "\\d{14}",
- "DO": "[A-Z]{4}\\d{20}",
- "EE": "\\d{16}",
- "FO": "\\d{14}",
- "FI": "\\d{14}",
- "FR": "\\d{10}[\\dA-Z]{11}\\d{2}",
- "GE": "[\\dA-Z]{2}\\d{16}",
- "DE": "\\d{18}",
- "GI": "[A-Z]{4}[\\dA-Z]{15}",
- "GR": "\\d{7}[\\dA-Z]{16}",
- "GL": "\\d{14}",
- "GT": "[\\dA-Z]{4}[\\dA-Z]{20}",
- "HU": "\\d{24}",
- "IS": "\\d{22}",
- "IE": "[\\dA-Z]{4}\\d{14}",
- "IL": "\\d{19}",
- "IT": "[A-Z]\\d{10}[\\dA-Z]{12}",
- "KZ": "\\d{3}[\\dA-Z]{13}",
- "KW": "[A-Z]{4}[\\dA-Z]{22}",
- "LV": "[A-Z]{4}[\\dA-Z]{13}",
- "LB": "\\d{4}[\\dA-Z]{20}",
- "LI": "\\d{5}[\\dA-Z]{12}",
- "LT": "\\d{16}",
- "LU": "\\d{3}[\\dA-Z]{13}",
- "MK": "\\d{3}[\\dA-Z]{10}\\d{2}",
- "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
- "MR": "\\d{23}",
- "MU": "[A-Z]{4}\\d{19}[A-Z]{3}",
- "MC": "\\d{10}[\\dA-Z]{11}\\d{2}",
- "MD": "[\\dA-Z]{2}\\d{18}",
- "ME": "\\d{18}",
- "NL": "[A-Z]{4}\\d{10}",
- "NO": "\\d{11}",
- "PK": "[\\dA-Z]{4}\\d{16}",
- "PS": "[\\dA-Z]{4}\\d{21}",
- "PL": "\\d{24}",
- "PT": "\\d{21}",
- "RO": "[A-Z]{4}[\\dA-Z]{16}",
- "SM": "[A-Z]\\d{10}[\\dA-Z]{12}",
- "SA": "\\d{2}[\\dA-Z]{18}",
- "RS": "\\d{18}",
- "SK": "\\d{20}",
- "SI": "\\d{15}",
- "ES": "\\d{20}",
- "SE": "\\d{20}",
- "CH": "\\d{5}[\\dA-Z]{12}",
- "TN": "\\d{20}",
- "TR": "\\d{5}[\\dA-Z]{17}",
- "AE": "\\d{3}\\d{16}",
- "GB": "[A-Z]{4}\\d{14}",
- "VG": "[\\dA-Z]{4}\\d{16}"
- };
- bbanpattern = bbancountrypatterns[countrycode];
- if (typeof bbanpattern !== "undefined") {
- ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
- if (!ibanregexp.test(iban)) {
- return false;
- }
- }
- ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4);
- for (i = 0; i < ibancheck.length; i++) {
- charAt = ibancheck.charAt(i);
- if (charAt !== "0") {
- leadingZeroes = false;
- }
- if (!leadingZeroes) {
- ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
- }
- }
- for (p = 0; p < ibancheckdigits.length; p++) {
- cChar = ibancheckdigits.charAt(p);
- cOperator = "" + cRest + cChar;
- cRest = cOperator % 97;
- }
- return cRest === 1;
- }, "Please specify a valid IBAN.");
- $.validator.addMethod("integer", function(value, element) {
- return this.optional(element) || /^-?\d+$/.test(value);
- }, "A positive or negative non-decimal number please.");
- $.validator.addMethod("ipv4", function(value, element) {
- return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value);
- }, "Please enter a valid IP v4 address.");
- $.validator.addMethod("ipv6", function(value, element) {
- return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
- }, "Please enter a valid IP v6 address.");
- $.validator.addMethod("lessThan", function(value, element, param) {
- var target = $(param);
- if (this.settings.onfocusout && target.not(".validate-lessThan-blur").length) {
- target.addClass("validate-lessThan-blur").on("blur.validate-lessThan", function() {
- $(element).valid();
- });
- }
- return value < target.val();
- }, "Please enter a lesser value.");
- $.validator.addMethod("lessThanEqual", function(value, element, param) {
- var target = $(param);
- if (this.settings.onfocusout && target.not(".validate-lessThanEqual-blur").length) {
- target.addClass("validate-lessThanEqual-blur").on("blur.validate-lessThanEqual", function() {
- $(element).valid();
- });
- }
- return value <= target.val();
- }, "Please enter a lesser value.");
- $.validator.addMethod("lettersonly", function(value, element) {
- return this.optional(element) || /^[a-z]+$/i.test(value);
- }, "Letters only please.");
- $.validator.addMethod("letterswithbasicpunc", function(value, element) {
- return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value);
- }, "Letters or punctuation only please.");
- $.validator.addMethod("maxfiles", function(value, element, param) {
- if (this.optional(element)) {
- return true;
- }
- if ($(element).attr("type") === "file") {
- if (element.files && element.files.length > param) {
- return false;
- }
- }
- return true;
- }, $.validator.format("Please select no more than {0} files."));
- $.validator.addMethod("maxsize", function(value, element, param) {
- if (this.optional(element)) {
- return true;
- }
- if ($(element).attr("type") === "file") {
- if (element.files && element.files.length) {
- for (var i = 0; i < element.files.length; i++) {
- if (element.files[i].size > param) {
- return false;
- }
- }
- }
- }
- return true;
- }, $.validator.format("File size must not exceed {0} bytes each."));
- $.validator.addMethod("maxsizetotal", function(value, element, param) {
- if (this.optional(element)) {
- return true;
- }
- if ($(element).attr("type") === "file") {
- if (element.files && element.files.length) {
- var totalSize = 0;
- for (var i = 0; i < element.files.length; i++) {
- totalSize += element.files[i].size;
- if (totalSize > param) {
- return false;
- }
- }
- }
- }
- return true;
- }, $.validator.format("Total size of all files must not exceed {0} bytes."));
- $.validator.addMethod("mobileNL", function(value, element) {
- return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
- }, "Please specify a valid mobile number.");
- $.validator.addMethod("mobileRU", function(phone_number, element) {
- var ruPhone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test(ruPhone_number);
- }, "Please specify a valid mobile number.");
- $.validator.addMethod("mobileUK", function(phone_number, element) {
- phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
- }, "Please specify a valid mobile number.");
- $.validator.addMethod("netmask", function(value, element) {
- return this.optional(element) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(value);
- }, "Please enter a valid netmask.");
- $.validator.addMethod("nieES", function(value, element) {
- "use strict";
- if (this.optional(element)) {
- return true;
- }
- var nieRegEx = new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi);
- var validChars = "TRWAGMYFPDXBNJZSQVHLCKET", letter = value.substr(value.length - 1).toUpperCase(), number;
- value = value.toString().toUpperCase();
- if (value.length > 10 || value.length < 9 || !nieRegEx.test(value)) {
- return false;
- }
- value = value.replace(/^[X]/, "0").replace(/^[Y]/, "1").replace(/^[Z]/, "2");
- number = value.length === 9 ? value.substr(0, 8) : value.substr(0, 9);
- return validChars.charAt(parseInt(number, 10) % 23) === letter;
- }, "Please specify a valid NIE number.");
- $.validator.addMethod("nifES", function(value, element) {
- "use strict";
- if (this.optional(element)) {
- return true;
- }
- value = value.toUpperCase();
- if (!value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")) {
- return false;
- }
- if (/^[0-9]{8}[A-Z]{1}$/.test(value)) {
- return "TRWAGMYFPDXBNJZSQVHLCKE".charAt(value.substring(8, 0) % 23) === value.charAt(8);
- }
- if (/^[KLM]{1}/.test(value)) {
- return value[8] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(value.substring(8, 1) % 23);
- }
- return false;
- }, "Please specify a valid NIF number.");
- $.validator.addMethod("nipPL", function(value) {
- "use strict";
- value = value.replace(/[^0-9]/g, "");
- if (value.length !== 10) {
- return false;
- }
- var arrSteps = [6, 5, 7, 2, 3, 4, 5, 6, 7];
- var intSum = 0;
- for (var i = 0; i < 9; i++) {
- intSum += arrSteps[i] * value[i];
- }
- var int2 = intSum % 11;
- var intControlNr = int2 === 10 ? 0 : int2;
- return intControlNr === parseInt(value[9], 10);
- }, "Please specify a valid NIP number.");
- $.validator.addMethod("nisBR", function(value) {
- var number;
- var cn;
- var sum = 0;
- var dv;
- var count;
- var multiplier;
- value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "");
- if (value.length !== 11) {
- return false;
- }
- cn = parseInt(value.substring(10, 11), 10);
- number = parseInt(value.substring(0, 10), 10);
- for (count = 2; count < 12; count++) {
- multiplier = count;
- if (count === 10) {
- multiplier = 2;
- }
- if (count === 11) {
- multiplier = 3;
- }
- sum += number % 10 * multiplier;
- number = parseInt(number / 10, 10);
- }
- dv = sum % 11;
- if (dv > 1) {
- dv = 11 - dv;
- } else {
- dv = 0;
- }
- if (cn === dv) {
- return true;
- } else {
- return false;
- }
- }, "Please specify a valid NIS/PIS number.");
- $.validator.addMethod("notEqualTo", function(value, element, param) {
- return this.optional(element) || !$.validator.methods.equalTo.call(this, value, element, param);
- }, "Please enter a different value, values must not be the same.");
- $.validator.addMethod("nowhitespace", function(value, element) {
- return this.optional(element) || /^\S+$/i.test(value);
- }, "No white space please.");
- $.validator.addMethod("pattern", function(value, element, param) {
- if (this.optional(element)) {
- return true;
- }
- if (typeof param === "string") {
- param = new RegExp("^(?:" + param + ")$");
- }
- return param.test(value);
- }, "Invalid format.");
- $.validator.addMethod("phoneNL", function(value, element) {
- return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
- }, "Please specify a valid phone number.");
- $.validator.addMethod("phonePL", function(phone_number, element) {
- phone_number = phone_number.replace(/\s+/g, "");
- var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;
- return this.optional(element) || regexp.test(phone_number);
- }, "Please specify a valid phone number.");
- $.validator.addMethod("phonesUK", function(phone_number, element) {
- phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/);
- }, "Please specify a valid uk phone number.");
- $.validator.addMethod("phoneUK", function(phone_number, element) {
- phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
- }, "Please specify a valid phone number.");
- $.validator.addMethod("phoneUS", function(phone_number, element) {
- phone_number = phone_number.replace(/\s+/g, "");
- return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/);
- }, "Please specify a valid phone number.");
- $.validator.addMethod("postalcodeBR", function(cep_value, element) {
- return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(cep_value);
- }, "Informe um CEP válido.");
- $.validator.addMethod("postalCodeCA", function(value, element) {
- return this.optional(element) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(value);
- }, "Please specify a valid postal code.");
- $.validator.addMethod("postalcodeIT", function(value, element) {
- return this.optional(element) || /^\d{5}$/.test(value);
- }, "Please specify a valid postal code.");
- $.validator.addMethod("postalcodeNL", function(value, element) {
- return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value);
- }, "Please specify a valid postal code.");
- $.validator.addMethod("postcodeUK", function(value, element) {
- return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value);
- }, "Please specify a valid UK postcode.");
- $.validator.addMethod("require_from_group", function(value, element, options) {
- var $fields = $(options[1], element.form), $fieldsFirst = $fields.eq(0), validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this), isValid = $fields.filter(function() {
- return validator.elementValue(this);
- }).length >= options[0];
- $fieldsFirst.data("valid_req_grp", validator);
- if (!$(element).data("being_validated")) {
- $fields.data("being_validated", true);
- $fields.each(function() {
- validator.element(this);
- });
- $fields.data("being_validated", false);
- }
- return isValid;
- }, $.validator.format("Please fill at least {0} of these fields."));
- $.validator.addMethod("skip_or_fill_minimum", function(value, element, options) {
- var $fields = $(options[1], element.form), $fieldsFirst = $fields.eq(0), validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this), numberFilled = $fields.filter(function() {
- return validator.elementValue(this);
- }).length, isValid = numberFilled === 0 || numberFilled >= options[0];
- $fieldsFirst.data("valid_skip", validator);
- if (!$(element).data("being_validated")) {
- $fields.data("being_validated", true);
- $fields.each(function() {
- validator.element(this);
- });
- $fields.data("being_validated", false);
- }
- return isValid;
- }, $.validator.format("Please either skip these fields or fill at least {0} of them."));
- $.validator.addMethod("stateUS", function(value, element, options) {
- var isDefault = typeof options === "undefined", caseSensitive = isDefault || typeof options.caseSensitive === "undefined" ? false : options.caseSensitive, includeTerritories = isDefault || typeof options.includeTerritories === "undefined" ? false : options.includeTerritories, includeMilitary = isDefault || typeof options.includeMilitary === "undefined" ? false : options.includeMilitary, regex;
- if (!includeTerritories && !includeMilitary) {
- regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
- } else if (includeTerritories && includeMilitary) {
- regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
- } else if (includeTerritories) {
- regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
- } else {
- regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
- }
- regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i");
- return this.optional(element) || regex.test(value);
- }, "Please specify a valid state.");
- $.validator.addMethod("strippedminlength", function(value, element, param) {
- return $(value).text().length >= param;
- }, $.validator.format("Please enter at least {0} characters."));
- $.validator.addMethod("time", function(value, element) {
- return this.optional(element) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(value);
- }, "Please enter a valid time, between 00:00 and 23:59.");
- $.validator.addMethod("time12h", function(value, element) {
- return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value);
- }, "Please enter a valid time in 12-hour am/pm format.");
- $.validator.addMethod("url2", function(value, element) {
- return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?)|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff])|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62}\.)))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
- }, $.validator.messages.url);
- $.validator.addMethod("vinUS", function(v) {
- if (v.length !== 17) {
- return false;
- }
- var LL = ["A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], VL = [1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9], FL = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2], rs = 0, i, n, d, f, cd, cdv;
- for (i = 0; i < 17; i++) {
- f = FL[i];
- d = v.slice(i, i + 1);
- if (isNaN(d)) {
- d = d.toUpperCase();
- n = VL[LL.indexOf(d)];
- } else {
- n = parseInt(d, 10);
- }
- if (i === 8) {
- cdv = n;
- if (d === "X") {
- cdv = 10;
- }
- }
- rs += n * f;
- }
- cd = rs % 11;
- if (cd === cdv) {
- return true;
- }
- return false;
- }, "The specified vehicle identification number (VIN) is invalid.");
- $.validator.addMethod("zipcodeUS", function(value, element) {
- return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value);
- }, "The specified US ZIP Code is invalid.");
- $.validator.addMethod("ziprange", function(value, element) {
- return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value);
- }, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx.");
- return $;
- });
- }
- });
- export default require_additional_methods();
- /*! Bundled license information:
- jquery-validation/dist/additional-methods.js:
- (*!
- * jQuery Validation Plugin v1.21.0
- *
- * https://jqueryvalidation.org/
- *
- * Copyright (c) 2024 Jörn Zaefferer
- * Released under the MIT license
- *)
- */
- //# sourceMappingURL=jquery-validation_dist_additional-methods.js.map
|