1/*! jQuery Validation Plugin - v1.19.1 - 6/15/2019 2 * https://jqueryvalidation.org/ 3 * Copyright (c) 2019 Jörn Zaefferer; Licensed MIT */ 4!(function(a) { 5 'function' == typeof define && define.amd 6 ? define(['jquery'], a) 7 : 'object' == typeof module && module.exports 8 ? (module.exports = a(require('jquery'))) 9 : a(jQuery); 10})(function(a) { 11 a.extend(a.fn, { 12 validate: function(b) { 13 if (!this.length) 14 return void ( 15 b && 16 b.debug && 17 window.console && 18 console.warn("Nothing selected, can't validate, returning nothing.") 19 ); 20 var c = a.data(this[0], 'validator'); 21 return c 22 ? c 23 : (this.attr('novalidate', 'novalidate'), 24 (c = new a.validator(b, this[0])), 25 a.data(this[0], 'validator', c), 26 c.settings.onsubmit && 27 (this.on('click.validate', ':submit', function(b) { 28 (c.submitButton = b.currentTarget), 29 a(this).hasClass('cancel') && (c.cancelSubmit = !0), 30 void 0 !== a(this).attr('formnovalidate') && (c.cancelSubmit = !0); 31 }), 32 this.on('submit.validate', function(b) { 33 function d() { 34 var d, e; 35 return ( 36 c.submitButton && 37 (c.settings.submitHandler || c.formSubmitted) && 38 (d = a("<input type='hidden'/>") 39 .attr('name', c.submitButton.name) 40 .val(a(c.submitButton).val()) 41 .appendTo(c.currentForm)), 42 !(c.settings.submitHandler && !c.settings.debug) || 43 ((e = c.settings.submitHandler.call(c, c.currentForm, b)), 44 d && d.remove(), 45 void 0 !== e && e) 46 ); 47 } 48 return ( 49 c.settings.debug && b.preventDefault(), 50 c.cancelSubmit 51 ? ((c.cancelSubmit = !1), d()) 52 : c.form() 53 ? c.pendingRequest 54 ? ((c.formSubmitted = !0), !1) 55 : d() 56 : (c.focusInvalid(), !1) 57 ); 58 })), 59 c); 60 }, 61 valid: function() { 62 var b, c, d; 63 return ( 64 a(this[0]).is('form') 65 ? (b = this.validate().form()) 66 : ((d = []), 67 (b = !0), 68 (c = a(this[0].form).validate()), 69 this.each(function() { 70 (b = c.element(this) && b), b || (d = d.concat(c.errorList)); 71 }), 72 (c.errorList = d)), 73 b 74 ); 75 }, 76 rules: function(b, c) { 77 var d, 78 e, 79 f, 80 g, 81 h, 82 i, 83 j = this[0], 84 k = 'undefined' != typeof this.attr('contenteditable') && 'false' !== this.attr('contenteditable'); 85 if ( 86 null != j && 87 (!j.form && k && ((j.form = this.closest('form')[0]), (j.name = this.attr('name'))), null != j.form) 88 ) { 89 if (b) 90 switch ( 91 ((d = a.data(j.form, 'validator').settings), (e = d.rules), (f = a.validator.staticRules(j)), b) 92 ) { 93 case 'add': 94 a.extend(f, a.validator.normalizeRule(c)), 95 delete f.messages, 96 (e[j.name] = f), 97 c.messages && (d.messages[j.name] = a.extend(d.messages[j.name], c.messages)); 98 break; 99 case 'remove': 100 return c 101 ? ((i = {}), 102 a.each(c.split(/\s/), function(a, b) { 103 (i[b] = f[b]), delete f[b]; 104 }), 105 i) 106 : (delete e[j.name], f); 107 } 108 return ( 109 (g = a.validator.normalizeRules( 110 a.extend( 111 {}, 112 a.validator.classRules(j), 113 a.validator.attributeRules(j), 114 a.validator.dataRules(j), 115 a.validator.staticRules(j) 116 ), 117 j 118 )), 119 g.required && ((h = g.required), delete g.required, (g = a.extend({ required: h }, g))), 120 g.remote && ((h = g.remote), delete g.remote, (g = a.extend(g, { remote: h }))), 121 g 122 ); 123 } 124 } 125 }), 126 a.extend(a.expr.pseudos || a.expr[':'], { 127 blank: function(b) { 128 return !a.trim('' + a(b).val()); 129 }, 130 filled: function(b) { 131 var c = a(b).val(); 132 return null !== c && !!a.trim('' + c); 133 }, 134 unchecked: function(b) { 135 return !a(b).prop('checked'); 136 } 137 }), 138 (a.validator = function(b, c) { 139 (this.settings = a.extend(!0, {}, a.validator.defaults, b)), (this.currentForm = c), this.init(); 140 }), 141 (a.validator.format = function(b, c) { 142 return 1 === arguments.length 143 ? function() { 144 var c = a.makeArray(arguments); 145 return c.unshift(b), a.validator.format.apply(this, c); 146 } 147 : void 0 === c 148 ? b 149 : (arguments.length > 2 && c.constructor !== Array && (c = a.makeArray(arguments).slice(1)), 150 c.constructor !== Array && (c = [c]), 151 a.each(c, function(a, c) { 152 b = b.replace(new RegExp('\\{' + a + '\\}', 'g'), function() { 153 return c; 154 }); 155 }), 156 b); 157 }),
158 a.extend(a.validator, { 159 defaults: { 160 messages: {}, 161 groups: {}, 162 rules: {}, 163 errorClass: 'error', 164 pendingClass: 'pending', 165 validClass: 'valid', 166 errorElement: 'label', 167 focusCleanup: !1, 168 focusInvalid: !0, 169 errorContainer: a([]), 170 errorLabelContainer: a([]), 171 onsubmit: !0, 172 ignore: ':hidden', 173 ignoreTitle: !1, 174 onfocusin: function(a) { 175 (this.lastActive = a), 176 this.settings.focusCleanup && 177 (this.settings.unhighlight && 178 this.settings.unhighlight.call( 179 this, 180 a, 181 this.settings.errorClass, 182 this.settings.validClass 183 ), 184 this.hideThese(this.errorsFor(a))); 185 }, 186 onfocusout: function(a) { 187 this.checkable(a) || (!(a.name in this.submitted) && this.optional(a)) || this.element(a); 188 }, 189 onkeyup: function(b, c) { 190 var d = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225]; 191 (9 === c.which && '' === this.elementValue(b)) || 192 a.inArray(c.keyCode, d) !== -1 || 193 ((b.name in this.submitted || b.name in this.invalid) && this.element(b)); 194 }, 195 onclick: function(a) { 196 a.name in this.submitted 197 ? this.element(a) 198 : a.parentNode.name in this.submitted && this.element(a.parentNode); 199 }, 200 highlight: function(b, c, d) { 201 'radio' === b.type 202 ? this.findByName(b.name) 203 .addClass(c) 204 .removeClass(d) 205 : a(b) 206 .addClass(c) 207 .removeClass(d); 208 }, 209 unhighlight: function(b, c, d) { 210 'radio' === b.type 211 ? this.findByName(b.name) 212 .removeClass(c) 213 .addClass(d) 214 : a(b) 215 .removeClass(c) 216 .addClass(d); 217 } 218 }, 219 setDefaults: function(b) { 220 a.extend(a.validator.defaults, b); 221 }, 222 messages: { 223 required: 'This field is required.', 224 remote: 'Please fix this field.', 225 email: 'Please enter a valid email address.', 226 url: 'Please enter a valid URL.', 227 date: 'Please enter a valid date.', 228 dateISO: 'Please enter a valid date (ISO).', 229 number: 'Please enter a valid number.', 230 digits: 'Please enter only digits.', 231 equalTo: 'Please enter the same value again.', 232 maxlength: a.validator.format('Please enter no more than {0} characters.'), 233 minlength: a.validator.format('Please enter at least {0} characters.'), 234 rangelength: a.validator.format('Please enter a value between {0} and {1} characters long.'), 235 range: a.validator.format('Please enter a value between {0} and {1}.'), 236 max: a.validator.format('Please enter a value less than or equal to {0}.'), 237 min: a.validator.format('Please enter a value greater than or equal to {0}.'), 238 step: a.validator.format('Please enter a multiple of {0}.') 239 }, 240 autoCreateRanges: !1, 241 prototype: { 242 init: function() { 243 function b(b) { 244 var c = 245 'undefined' != typeof a(this).attr('contenteditable') && 246 'false' !== a(this).attr('contenteditable'); 247 if ( 248 (!this.form && 249 c && 250 ((this.form = a(this).closest('form')[0]), (this.name = a(this).attr('name'))), 251 d === this.form) 252 ) { 253 var e = a.data(this.form, 'validator'), 254 f = 'on' + b.type.replace(/^validate/, ''), 255 g = e.settings; 256 g[f] && !a(this).is(g.ignore) && g[f].call(e, this, b); 257 } 258 } 259 (this.labelContainer = a(this.settings.errorLabelContainer)), 260 (this.errorContext = 261 (this.labelContainer.length && this.labelContainer) || a(this.currentForm)), 262 (this.containers = a(this.settings.errorContainer).add(this.settings.errorLabelContainer)), 263 (this.submitted = {}), 264 (this.valueCache = {}), 265 (this.pendingRequest = 0), 266 (this.pending = {}), 267 (this.invalid = {}), 268 this.reset(); 269 var c, 270 d = this.currentForm, 271 e = (this.groups = {}); 272 a.each(this.settings.groups, function(b, c) { 273 'string' == typeof c && (c = c.split(/\s/)), 274 a.each(c, function(a, c) { 275 e[c] = b; 276 }); 277 }), 278 (c = this.settings.rules), 279 a.each(c, function(b, d) { 280 c[b] = a.validator.normalizeRule(d); 281 }), 282 a(this.currentForm) 283 .on(
284 'focusin.validate focusout.validate keyup.validate', 285 ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']", 286 b 287 ) 288 .on('click.validate', "select, option, [type='radio'], [type='checkbox']", b), 289 this.settings.invalidHandler && 290 a(this.currentForm).on('invalid-form.validate', this.settings.invalidHandler); 291 }, 292 form: function() { 293 return ( 294 this.checkForm(), 295 a.extend(this.submitted, this.errorMap), 296 (this.invalid = a.extend({}, this.errorMap)), 297 this.valid() || a(this.currentForm).triggerHandler('invalid-form', [this]), 298 this.showErrors(), 299 this.valid() 300 ); 301 }, 302 checkForm: function() { 303 this.prepareForm(); 304 for (var a = 0, b = (this.currentElements = this.elements()); b[a]; a++) this.check(b[a]); 305 return this.valid(); 306 }, 307 element: function(b) { 308 var c, 309 d, 310 e = this.clean(b), 311 f = this.validationTargetFor(e), 312 g = this, 313 h = !0; 314 return ( 315 void 0 === f 316 ? delete this.invalid[e.name] 317 : (this.prepareElement(f), 318 (this.currentElements = a(f)), 319 (d = this.groups[f.name]), 320 d && 321 a.each(this.groups, function(a, b) { 322 b === d && 323 a !== f.name && 324 ((e = g.validationTargetFor(g.clean(g.findByName(a)))), 325 e && 326 e.name in g.invalid && 327 (g.currentElements.push(e), (h = g.check(e) && h))); 328 }), 329 (c = this.check(f) !== !1), 330 (h = h && c), 331 c ? (this.invalid[f.name] = !1) : (this.invalid[f.name] = !0), 332 this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), 333 this.showErrors(), 334 a(b).attr('aria-invalid', !c)), 335 h 336 ); 337 }, 338 showErrors: function(b) { 339 if (b) { 340 var c = this; 341 a.extend(this.errorMap, b), 342 (this.errorList = a.map(this.errorMap, function(a, b) { 343 return { message: a, element: c.findByName(b)[0] }; 344 })), 345 (this.successList = a.grep(this.successList, function(a) { 346 return !(a.name in b); 347 })); 348 } 349 this.settings.showErrors 350 ? this.settings.showErrors.call(this, this.errorMap, this.errorList) 351 : this.defaultShowErrors(); 352 }, 353 resetForm: function() { 354 a.fn.resetForm && a(this.currentForm).resetForm(), 355 (this.invalid = {}), 356 (this.submitted = {}), 357 this.prepareForm(), 358 this.hideErrors(); 359 var b = this.elements() 360 .removeData('previousValue') 361 .removeAttr('aria-invalid'); 362 this.resetElements(b); 363 }, 364 resetElements: function(a) { 365 var b; 366 if (this.settings.unhighlight) 367 for (b = 0; a[b]; b++) 368 this.settings.unhighlight.call(this, a[b], this.settings.errorClass, ''), 369 this.findByName(a[b].name).removeClass(this.settings.validClass); 370 else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass); 371 }, 372 numberOfInvalids: function() { 373 return this.objectLength(this.invalid); 374 }, 375 objectLength: function(a) { 376 var b, 377 c = 0; 378 for (b in a) void 0 !== a[b] && null !== a[b] && a[b] !== !1 && c++; 379 return c; 380 }, 381 hideErrors: function() { 382 this.hideThese(this.toHide); 383 }, 384 hideThese: function(a) { 385 a.not(this.containers).text(''), this.addWrapper(a).hide(); 386 }, 387 valid: function() { 388 return 0 === this.size(); 389 }, 390 size: function() { 391 return this.errorList.length; 392 }, 393 focusInvalid: function() { 394 if (this.settings.focusInvalid) 395 try { 396 a(this.findLastActive() || (this.errorList.length && this.errorList[0].element) || []) 397 .filter(':visible') 398 .trigger('focus') 399 .trigger('focusin'); 400 } catch (b) {} 401 }, 402 findLastActive: function() { 403 var b = this.lastActive; 404 return ( 405 b && 406 1 === 407 a.grep(this.errorList, function(a) { 408 return a.element.name === b.name; 409 }).length && 410 b 411 ); 412 }, 413 elements: function() { 414 var b = this, 415 c = {}; 416 return a(this.currentForm) 417 .find('input, select, textarea, [contenteditable]') 418 .not(':submit, :reset, :image, :disabled') 419 .not(this.settings.ignore) 420 .filter(function() { 421 var d = this.name || a(this).attr('name'), 422 e = 423 'undefined' != typeof a(this).attr('contenteditable') && 424 'false' !== a(this).attr('contenteditable'); 425 return ( 426 !d && 427 b.settings.debug && 428 window.console && 429 console.error('%o has no name assigned', this), 430 e && ((this.form = a(this).closest('form')[0]), (this.name = d)), 431 this.form === b.currentForm && 432 (!(d in c || !b.objectLength(a(this).rules())) && ((c[d] = !0), !0)) 433 ); 434 }); 435 }, 436 clean: function(b) { 437 return a(b)[0]; 438 }, 439 errors: function() { 440 var b = this.settings.errorClass.split(' ').join('.'); 441 return a(this.settings.errorElement + '.' + b, this.errorContext); 442 }, 443 resetInternals: function() { 444 (this.successList = []), 445 (this.errorList = []), 446 (this.errorMap = {}), 447 (this.toShow = a([])), 448 (this.toHide = a([])); 449 }, 450 reset: function() { 451 this.resetInternals(), (this.currentElements = a([])); 452 }, 453 prepareForm: function() { 454 this.reset(), (this.toHide = this.errors().add(this.containers
454)); 455 }, 456 prepareElement: function(a) { 457 this.reset(), (this.toHide = this.errorsFor(a)); 458 }, 459 elementValue: function(b) { 460 var c, 461 d, 462 e = a(b), 463 f = b.type, 464 g = 'undefined' != typeof e.attr('contenteditable') && 'false' !== e.attr('contenteditable'); 465 return 'radio' === f || 'checkbox' === f 466 ? this.findByName(b.name) 467 .filter(':checked') 468 .val() 469 : 'number' === f && 'undefined' != typeof b.validity 470 ? b.validity.badInput 471 ? 'NaN' 472 : e.val() 473 : ((c = g ? e.text() : e.val()), 474 'file' === f 475 ? 'C:\\fakepath\\' === c.substr(0, 12) 476 ? c.substr(12) 477 : ((d = c.lastIndexOf('/')), 478 d >= 0 479 ? c.substr(d + 1) 480 : ((d = c.lastIndexOf('\\')), d >= 0 ? c.substr(d + 1) : c)) 481 : 'string' == typeof c 482 ? c.replace(/\r/g, '') 483 : c); 484 }, 485 check: function(b) { 486 b = this.validationTargetFor(this.clean(b)); 487 var c, 488 d, 489 e, 490 f, 491 g = a(b).rules(), 492 h = a.map(g, function(a, b) { 493 return b; 494 }).length, 495 i = !1, 496 j = this.elementValue(b); 497 'function' == typeof g.normalizer 498 ? (f = g.normalizer) 499 : 'function' == typeof this.settings.normalizer && (f = this.settings.normalizer), 500 f && ((j = f.call(b, j)), delete g.normalizer); 501 for (d in g) { 502 e = { method: d, parameters: g[d] }; 503 try { 504 if ( 505 ((c = a.validator.methods[d].call(this, j, b, e.parameters)), 506 'dependency-mismatch' === c && 1 === h) 507 ) { 508 i = !0; 509 continue; 510 } 511 if (((i = !1), 'pending' === c)) 512 return void (this.toHide = this.toHide.not(this.errorsFor(b))); 513 if (!c) return this.formatAndAdd(b, e), !1; 514 } catch (k) { 515 throw (this.settings.debug && 516 window.console && 517 console.log( 518 'Exception occurred when checking element ' + 519 b.id + 520 ", check the '" + 521 e.method + 522 "' method.", 523 k 524 ), 525 k instanceof TypeError && 526 (k.message += 527 '. Exception occurred when checking element ' + 528 b.id + 529 ", check the '" + 530 e.method + 531 "' method."), 532 k); 533 } 534 } 535 if (!i) return this.objectLength(g) && this.successList.push(b), !0; 536 }, 537 customDataMessage: function(b, c) { 538 return ( 539 a(b).data('msg' + c.charAt(0).toUpperCase() + c.substring(1).toLowerCase()) || a(b).data('msg') 540 ); 541 }, 542 customMessage: function(a, b) { 543 var c = this.settings.messages[a]; 544 return c && (c.constructor === String ? c : c[b]); 545 }, 546 findDefined: function() { 547 for (var a = 0; a < arguments.length; a++) if (void 0 !== arguments[a]) return arguments[a]; 548 }, 549 defaultMessage: function(b, c) { 550 'string' == typeof c && (c = { method: c }); 551 var d = this.findDefined( 552 this.customMessage(b.name, c.method), 553 this.customDataMessage(b, c.method), 554 (!this.settings.ignoreTitle && b.title) || void 0, 555 a.validator.messages[c.method], 556 '<strong>Warning: No message defined for ' + b.name + '</strong>' 557 ), 558 e = /\$?\{(\d+)\}/g; 559 return ( 560 'function' == typeof d 561 ? (d = d.call(this, c.parameters, b)) 562 : e.test(d) && (d = a.validator.format(d.replace(e, '{$1}'), c.parameters)), 563 d 564 ); 565 }, 566 formatAndAdd: function(a, b) { 567 var c = this.defaultMessage(a, b); 568 this.errorList.push({ message: c, element: a, method: b.method }), 569 (this.errorMap[a.name] = c), 570 (this.submitted[a.name] = c); 571 }, 572 addWrapper: function(a) { 573 return this.settings.wrapper && (a = a.add(a.parent(this.settings.wrapper))), a; 574 }, 575 defaultShowErrors: function() { 576 var a, b, c; 577 for (a = 0; this.errorList[a]; a++) 578 (c = this.errorList[a]), 579 this.settings.highlight && 580 this.settings.highlight.call( 581 this, 582 c.element, 583 this.settings.errorClass, 584 this.settings.validClass 585 ), 586 this.showLabel(c.element, c.message); 587 if ( 588 (this.errorList.length && (this.toShow = this.toShow.add(this.containers
588)), 589 this.settings.success) 590 ) 591 for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]); 592 if (this.settings.unhighlight) 593 for (a = 0, b = this.validElements(); b[a]; a++) 594 this.settings.unhighlight.call( 595 this, 596 b[a], 597 this.settings.errorClass, 598 this.settings.validClass 599 ); 600 (this.toHide = this.toHide.not(this.toShow)), 601 this.hideErrors(), 602 this.addWrapper(this.toShow).show(); 603 }, 604 validElements: function() { 605 return this.currentElements.not(this.invalidElements()); 606 }, 607 invalidElements: function() { 608 return a(this.errorList).map(function() { 609 return this.element; 610 }); 611 }, 612 showLabel: function(b, c) { 613 var d, 614 e, 615 f, 616 g, 617 h = this.errorsFor(b), 618 i = this.idOrName(b), 619 j = a(b).attr('aria-describedby'); 620 h.length 621 ? (h.removeClass(this.settings.validClass).addClass(this.settings.errorClass), h.html(c)) 622 : ((h = a('<' + this.settings.errorElement + '>') 623 .attr('id', i + '-error') 624 .addClass(this.settings.errorClass) 625 .html(c || '')), 626 (d = h), 627 this.settings.wrapper && 628 (d = h 629 .hide() 630 .show() 631 .wrap('<' + this.settings.wrapper + '/>') 632 .parent()), 633 this.labelContainer.length 634 ? this.labelContainer.append(d) 635 : this.settings.errorPlacement 636 ? this.settings.errorPlacement.call(this, d, a(b)) 637 : d.insertAfter(b), 638 h.is('label') 639 ? h.attr('for', i) 640 : 0 === h.parents("label[for='" + this.escapeCssMeta(i) + "']").length && 641 ((f = h.attr('id')), 642 j 643 ? j.match(new RegExp('\\b' + this.escapeCssMeta(f) + '\\b')) || (j += ' ' + f) 644 : (j = f), 645 a(b).attr('aria-describedby', j),
646 (e = this.groups[b.name]), 647 e && 648 ((g = this), 649 a.each(g.groups, function(b, c) { 650 c === e && 651 a("[name='" + g.escapeCssMeta(b) + "']", g.currentForm).attr( 652 'aria-describedby', 653 h.attr('id') 654 ); 655 })))), 656 !c && 657 this.settings.success && 658 (h.text(''), 659 'string' == typeof this.settings.success 660 ? h.addClass(this.settings.success) 661 : this.settings.success(h, b)), 662 (this.toShow = this.toShow.add(h)); 663 }, 664 errorsFor: function(b) { 665 var c = this.escapeCssMeta(this.idOrName(b)), 666 d = a(b).attr('aria-describedby'), 667 e = "label[for='" + c + "'], label[for='" + c + "'] *"; 668 return d && (e = e + ', #' + this.escapeCssMeta(d).replace(/\s+/g, ', #')), this.errors().filter(e); 669 }, 670 escapeCssMeta: function(a) { 671 return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g, '\\$1'); 672 }, 673 idOrName: function(a) { 674 return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name); 675 }, 676 validationTargetFor: function(b) { 677 return this.checkable(b) && (b = this.findByName(b.name)), a(b).not(this.settings.ignore)[0]; 678 }, 679 checkable: function(a) { 680 return /radio|checkbox/i.test(a.type); 681 }, 682 findByName: function(b) { 683 return a(this.currentForm).find("[name='" + this.escapeCssMeta(b) + "']"); 684 }, 685 getLength: function(b, c) { 686 switch (c.nodeName.toLowerCase()) { 687 case 'select': 688 return a('option:selected', c).length; 689 case 'input': 690 if (this.checkable(c)) return this.findByName(c.name).filter(':checked').length; 691 } 692 return b.length; 693 }, 694 depend: function(a, b) { 695 return !this.dependTypes[typeof a] || this.dependTypes[typeof a](a, b); 696 }, 697 dependTypes: { 698 boolean: function(a) { 699 return a; 700 }, 701 string: function(b, c) { 702 return !!a(b, c.form).length; 703 }, 704 function: function(a, b) { 705 return a(b); 706 } 707 }, 708 optional: function(b) { 709 var c = this.elementValue(b); 710 return !a.validator.methods.required.call(this, c, b) && 'dependency-mismatch'; 711 }, 712 startRequest: function(b) { 713 this.pending[b.name] || 714 (this.pendingRequest++, a(b).addClass(this.settings.pendingClass), (this.pending[b.name] = !0)); 715 }, 716 stopRequest: function(b, c) { 717 this.pendingRequest--, 718 this.pendingRequest < 0 && (this.pendingRequest = 0), 719 delete this.pending[b.name], 720 a(b).removeClass(this.settings.pendingClass), 721 c && 0 === this.pendingRequest && this.formSubmitted && this.form() 722 ? (a(this.currentForm).submit(), 723 this.submitButton && 724 a("input:hidden[name='" + this.submitButton.name + "']", this.currentForm).remove(), 725 (this.formSubmitted = !1)) 726 : !c && 727 0 === this.pendingRequest && 728 this.formSubmitted && 729 (a(this.currentForm).triggerHandler('invalid-form', [this]), (this.formSubmitted = !1)); 730 }, 731 previousValue: function(b, c) { 732 return ( 733 (c = ('string' == typeof c && c) || 'remote'), 734 a.data(b, 'previousValue') || 735 a.data(b, 'previousValue', { 736 old: null, 737 valid: !0, 738 message: this.defaultMessage(b, { method: c }) 739 }) 740 ); 741 }, 742 destroy: function() { 743 this.resetForm(), 744 a(this.currentForm) 745 .off('.validate') 746 .removeData('validator') 747 .find('.validate-equalTo-blur') 748 .off('.validate-equalTo') 749 .removeClass('validate-equalTo-blur') 750 .find('.validate-lessThan-blur') 751 .off('.validate-lessThan') 752 .removeClass('validate-lessThan-blur') 753 .find('.validate-lessThanEqual-blur') 754 .off('.validate-lessThanEqual') 755 .removeClass('validate-lessThanEqual-blur') 756 .find('.validate-greaterThanEqual-blur') 757 .off('.validate-greaterThanEqual') 758 .removeClass('validate-greaterThanEqual-blur') 759 .find('.validate-greaterThan-blur') 760 .off('.validate-greaterThan') 761 .removeClass('validate-greaterThan-blur'); 762 } 763 }, 764 classRuleSettings: { 765 required: { required: !0 }, 766 email: { email: !0 }, 767 url: { url: !0 },
768 date: { date: !0 }, 769 dateISO: { dateISO: !0 }, 770 number: { number: !0 }, 771 digits: { digits: !0 }, 772 creditcard: { creditcard: !0 } 773 }, 774 addClassRules: function(b, c) { 775 b.constructor === String ? (this.classRuleSettings[b] = c) : a.extend(this.classRuleSettings, b); 776 }, 777 classRules: function(b) { 778 var c = {}, 779 d = a(b).attr('class'); 780 return ( 781 d && 782 a.each(d.split(' '), function() { 783 this in a.validator.classRuleSettings && a.extend(c, a.validator.classRuleSettings[this]); 784 }), 785 c 786 ); 787 }, 788 normalizeAttributeRule: function(a, b, c, d) { 789 /min|max|step/.test(c) && 790 (null === b || /number|range|text/.test(b)) && 791 ((d = Number(d)), isNaN(d) && (d = void 0)), 792 d || 0 === d ? (a[c] = d) : b === c && 'range' !== b && (a[c] = !0); 793 }, 794 attributeRules: function(b) { 795 var c, 796 d, 797 e = {}, 798 f = a(b), 799 g = b.getAttribute('type'); 800 for (c in a.validator.methods) 801 'required' === c ? ((d = b.getAttribute(c)), '' === d && (d = !0), (d = !!d)) : (d = f.attr(c)), 802 this.normalizeAttributeRule(e, g, c, d); 803 return e.maxlength && /-1|2147483647|524288/.test(e.maxlength) && delete e.maxlength, e; 804 }, 805 dataRules: function(b) { 806 var c, 807 d, 808 e = {}, 809 f = a(b), 810 g = b.getAttribute('type'); 811 for (c in a.validator.methods) 812 (d = f.data('rule' + c.charAt(0).toUpperCase() + c.substring(1).toLowerCase())), 813 '' === d && (d = !0), 814 this.normalizeAttributeRule(e, g, c, d); 815 return e; 816 }, 817 staticRules: function(b) { 818 var c = {}, 819 d = a.data(b.form, 'validator'); 820 return d.settings.rules && (c = a.validator.normalizeRule(d.settings.rules[b.name]) || {}), c; 821 }, 822 normalizeRules: function(b, c) { 823 return ( 824 a.each(b, function(d, e) { 825 if (e === !1) return void delete b[d]; 826 if (e.param || e.depends) { 827 var f = !0; 828 switch (typeof e.depends) { 829 case 'string': 830 f = !!a(e.depends, c.form).length; 831 break; 832 case 'function': 833 f = e.depends.call(c, c); 834 } 835 f 836 ? (b[d] = void 0 === e.param || e.param) 837 : (a.data(c.form, 'validator').resetElements(a(c)), delete b[d]); 838 } 839 }), 840 a.each(b, function(d, e) { 841 b[d] = a.isFunction(e) && 'normalizer' !== d ? e(c) : e; 842 }), 843 a.each(['minlength', 'maxlength'], function() { 844 b[this] && (b[this] = Number(b[this])); 845 }), 846 a.each(['rangelength', 'range'], function() { 847 var c; 848 b[this] && 849 (a.isArray(b[this]) 850 ? (b[this] = [Number(b[this][0]), Number(b[this][1])]) 851 : 'string' == typeof b[this] && 852 ((c = b[this].replace(/[\[\]]/g, '').split(/[\s,]+/)), 853 (b[this] = [Number(c[0]), Number(c[1])]))); 854 }), 855 a.validator.autoCreateRanges && 856 (null != b.min && null != b.max && ((b.range = [b.min, b.max]), delete b.min, delete b.max), 857 null != b.minlength && 858 null != b.maxlength && 859 ((b.rangelength = [b.minlength, b.maxlength]), delete b.minlength, delete b.maxlength)), 860 b 861 ); 862 }, 863 normalizeRule: function(b) { 864 if ('string' == typeof b) { 865 var c = {}; 866 a.each(b.split(/\s/), function() { 867 c[this] = !0; 868 }), 869 (b = c); 870 } 871 return b; 872 }, 873 addMethod: function(b, c, d) { 874 (a.validator.methods[b] = c), 875 (a.validator.messages[b] = void 0 !== d ? d : a.validator.messages[b]), 876 c.length < 3 && a.validator.addClassRules(b, a.validator.normalizeRule(b)); 877 }, 878 methods: { 879 required: function(b, c, d) { 880 if (!this.depend(d, c)) return 'dependency-mismatch'; 881 if ('select' === c.nodeName.toLowerCase()) { 882 var e = a(c).val(); 883 return e && e.length > 0; 884 } 885 return this.checkable(c) ? this.getLength(b, c) > 0 : void 0 !== b && null !== b && b.length > 0; 886 }, 887 email: function(a, b) { 888 return ( 889 this.optional(b) || 890 /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( 891 a 892 ) 893 ); 894 }, 895 url: function(a, b) { 896 return ( 897 this.optional(b) ||
898 /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?: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-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test( 899 a 900 ) 901 ); 902 }, 903 date: (function() { 904 var a = !1; 905 return function(b, c) { 906 return ( 907 a || 908 ((a = !0), 909 this.settings.debug && 910 window.console && 911 console.warn( 912 "The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`." 913 )), 914 this.optional(c) || !/Invalid|NaN/.test(new Date(b).toString()) 915 ); 916 }; 917 })(), 918 dateISO: function(a, b) { 919 return this.optional(b) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a); 920 }, 921 number: function(a, b) { 922 return this.optional(b) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a); 923 }, 924 digits: function(a, b) { 925 return this.optional(b) || /^\d+$/.test(a); 926 }, 927 minlength: function(b, c, d) { 928 var e = a.isArray(b) ? b.length : this.getLength(b, c); 929 return this.optional(c) || e >= d; 930 }, 931 maxlength: function(b, c, d) { 932 var e = a.isArray(b) ? b.length : this.getLength(b, c); 933 return this.optional(c) || e <= d; 934 }, 935 rangelength: function(b, c, d) { 936 var e = a.isArray(b) ? b.length : this.getLength(b, c); 937 return this.optional(c) || (e >= d[0] && e <= d[1]); 938 }, 939 min: function(a, b, c) { 940 return this.optional(b) || a >= c; 941 }, 942 max: function(a, b, c) { 943 return this.optional(b) || a <= c; 944 }, 945 range: function(a, b, c) { 946 return this.optional(b) || (a >= c[0] && a <= c[1]); 947 }, 948 step: function(b, c, d) { 949 var e, 950 f = a(c).attr('type'), 951 g = 'Step attribute on input type ' + f + ' is not supported.', 952 h = ['text', 'number', 'range'], 953 i = new RegExp('\\b' + f + '\\b'), 954 j = f && !i.test(h.join()), 955 k = function(a) { 956 var b = ('' + a).match(/(?:\.(\d+))?$/); 957 return b && b[1] ? b[1].length : 0; 958 }, 959 l = function(a) { 960 return Math.round(a * Math.pow(10, e)); 961 }, 962 m = !0; 963 if (j) throw new Error(g); 964 return (e = k(d)), (k(b) > e || l(b) % l(d) !== 0) && (m = !1), this.optional(c) || m; 965 }, 966 equalTo: function(b, c, d) { 967 var e = a(d); 968 return ( 969 this.settings.onfocusout && 970 e.not('.validate-equalTo-blur').length && 971 e.addClass('validate-equalTo-blur').on('blur.validate-equalTo', function() { 972 a(c).valid(); 973 }), 974 b === e.val() 975 ); 976 }, 977 remote: function(b, c, d, e) { 978 if (this.optional(c)) return 'dependency-mismatch'; 979 e = ('string' == typeof e && e) || 'remote'; 980 var f, 981 g, 982 h, 983 i = this.previousValue(c, e); 984 return ( 985 this.settings.messages[c.name] || (this.settings.messages[c.name] = {}), 986 (i.originalMessage = i.originalMessage || this.settings.messages[c.name][e]), 987 (this.settings.messages[c.name][e] = i.message), 988 (d = ('string' == typeof d && { url: d }) || d), 989 (h = a.param(a.extend({ data: b }, d.data))), 990 i.old === h 991 ? i.valid 992 : ((i.old = h), 993 (f = this), 994 this.startRequest(c), 995 (g = {}), 996 (g[c.name] = b),
997 a.ajax( 998 a.extend( 999 !0, 1000 { 1001 mode: 'abort', 1002 port: 'validate' + c.name, 1003 dataType: 'json', 1004 data: g, 1005 context: f.currentForm, 1006 success: function(a) { 1007 var d, 1008 g, 1009 h, 1010 j = a === !0 || 'true' === a; 1011 (f.settings.messages[c.name][e] = i.originalMessage), 1012 j 1013 ? ((h = f.formSubmitted), 1014 f.resetInternals(), 1015 (f.toHide = f.errorsFor(c)), 1016 (f.formSubmitted = h), 1017 f.successList.push(c), 1018 (f.invalid[c.name] = !1), 1019 f.showErrors()) 1020 : ((d = {}), 1021 (g = a || f.defaultMessage(c, { method: e, parameters: b })), 1022 (d[c.name] = i.message = g), 1023 (f.invalid[c.name] = !0), 1024 f.showErrors(d)), 1025 (i.valid = j), 1026 f.stopRequest(c, j); 1027 } 1028 }, 1029 d 1030 ) 1031 ), 1032 'pending') 1033 ); 1034 } 1035 } 1036 }); 1037 var b, 1038 c = {}; 1039 return ( 1040 a.ajaxPrefilter 1041 ? a.ajaxPrefilter(function(a, b, d) { 1042 var e = a.port; 1043 'abort' === a.mode && (c[e] && c[e].abort(), (c[e] = d)); 1044 }) 1045 : ((b = a.ajax), 1046 (a.ajax = function(d) { 1047 var e = ('mode' in d ? d : a.ajaxSettings).mode, 1048 f = ('port' in d ? d : a.ajaxSettings).port; 1049 return 'abort' === e 1050 ? (c[f] && c[f].abort(), (c[f] = b.apply(this, arguments)), c[f]) 1051 : b.apply(this, arguments); 1052 })), 1053 a 1054 ); 1055});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.