text: /*! jQuery ADA Validation Plugin - v0.3.1 - 2/2/2016
   * Copyright (c) 2016 MCD Partners; Licensed MIT */
  !function(a,b,c,d){"use strict";function e(a){a.attr("aria-hidden","true")}function f(a){a.attr("aria-hidden","false")}function g(a){a.attr("aria-invalid","false")}function h(a){a.attr("aria-invalid","true")}var i="data-validation",j="data-validation-label",k="has-warning",l="has-error",m={REQ:"requirement",RES:"restriction"},n=function(b){if(a.extend(this,b),this.rules=[],b&&b.rules)for(var c=0;c<b.rules.length;c++)this.rules[c]=new o(b.rules[c])};n.create=function(a){return b.validations[a]?new n(b.validations[a]):"object"==typeof a?new n(a):new n},n.prototype.renderNotes=function(a){for(var b='<div id="'+a+'Validations" class="validations" aria-hidden="true"><ul>',c=0;c<this.rules.length;c++)b+='<li class="'+this.rules[c].type+'" aria-hidden="true">'+this.rules[c].note+"</li>";return b+="</ul></div>"},n.prototype.test=function(a){for(var b=0,c=0;c<this.rules.length;c++)this.rules[c].test(a)&&b++;return b===this.rules.length};var o=function(b){a.extend(this,{type:m.REQ,note:"",regx:/.+/,all:!1,minTestLen:-1,help:!0,showOnFirstFocus:!0},b),b&&b.type===m.RES&&(this.help=b.help||!1)};o.prototype.test=function(a){var b,c=0;if("function"==typeof this.func)return this.func(a);if(this.regx.length>1){for(var d=0;d<this.regx.length;d++)this.regx[d].test(a)&&c++;b=this.all?c===this.regx.length:c>0}else b=this.regx.test(a);return this.type===m.REQ?b:!b},function(){function b(a){setTimeout(function(){a.data.handled||(a.data.validate(),a.data.handled=!1)},0)}function d(a){a.data.handled=!0,a.data.validate()}function j(a){a.data.handled=!0,a.data.validate()}function m(b){var c=b.data,d=c.$element,f=a("#"+d.attr("id")+"Validations"),g=c.validate().warnings.length>0,h=""===d.val(),i=d.attr("required"),j=d.closest(".form-group");(g||h&&i)&&j.addClass(k),e(f),d.data("validation-first-focus","false"),b.data.handled=!1}function o(b){return this.each(function(){var c=a(this),d=c.data("validatedInput"),e=a.extend({},p.DEFAULTS,c.data(),"object"==typeof b&&b);d||c.data("validatedInput",d=new p(this,e)),"string"==typeof b&&d[b]()})}var p=function(b,c){var d;this.$element=a(b),this.options=a.extend({},p.DEFAULTS,c),this.isRequired=this.$element.attr("required"),this.validator=n.create(c.validator),this.hasError=!1,this.tagName=this.$element.prop("tagName").toLowerCase(),this.isRequired&&(d=new n(validations.required),this.options.requiredNote&&(d.rules[0].note=this.options.requiredNote),this.validator.rules=this.validator.rules.concat(d.rules)),this.addListeners(),this.configureInput()};p.VERSION="0.3.1",p.DEFAULTS={},p.prototype.addListeners=function(){this.$element.on("focus.validatedInput",this,b),this.$element.on("change.validatedInput",this,j),this.$element.on("blur.validatedInput",this,m),"input"===this.tagName&&this.$element.on("keyup.validatedInput",this,d)},p.prototype.removeListeners=function(){this.$element.off("focus.validatedInput, keyup.validatedInput, blur.validatedInput")},p.prototype.configureInput=function(){var b,c=this.$element.attr("id"),d=this.$element.attr("type"),e={"aria-describedby":c+"Validations"};if(-1===["input","select"].indexOf(this.tagName))throw new Error("ValidatedInput cannot be applied to a "+tagName);if(this.$element.attr(i)||(e[i]="true"),this.isRequired&&(e["aria-required"]="true"),"true"===this.$element.attr("aria-invalid")&&(this.hasError=!0),"input"===this.tagName)switch(d){case"text":case"email":case"tel":case"password":a.extend(e,{maxlength:this.validator.maxlength,autocapitalize:this.validator.autocapitalize||"off",autocorrect:this.validator.autocorrect||"off",placeholder:this.validator.placeholder});break;case"radio":case"checkbox":}e["data-validation-first-focus"]="true",this.$element.attr(e),b=this.validator.renderNotes(c),this.$element.closest(".form-group").append(b)},p.prototype.validate=function(b){var c,d,i,j=this.$element.val(),m=this.$element.closest(".form-group"),n=this.validator.rules,o=a("#"+this.$element.attr("id")+"Validations"),p=o.find("ul").children(),q={errors:[],warnings:[]},r=this.$element.data("validation-first-focus")===!0,s=this.$element.prop("disabled"),t="required"===this.$element.attr("required"),u=!t,v=j.length>0;if(o.css("width",this.$element.outerWidth()+"px"),s)return q;for(var w=0;w<n.length;w++)d=n[w],c=d.test(j),b?c||!v&&u?e(p.eq(w)):(this.hasError=!0,m.addClass(l),h(this.$element),q.errors.push(d.note)):(!r||d.showOnFirstFocus)&&(i=j.length<d.minTestLen,i?e(p.eq(w)):c?(this.hasError=!1,e(p.eq(w))):(f(o),f(p.eq(w)),h(this.$element),q.warnings.push(d.note),r||this.hasError||m.addClass(k)));return 0===q.warnings.length&&0===q.errors.length&&(e(o),g(this.$element),m.removeClass(l),m.removeClass(k)),q};var q=a.fn.validatedInput;a.fn.validatedInput=o,a.fn.validatedInput.Constructor=p,a.fn.validatedInput.noConflict=function(){return a.fn.validatedInput=q,this},a(c).ready(function(){a("[data-validation]").each(function(){var b=a(this),c=b.data("validatedInput"),d={validator:b.data("validation")};c||o.call(b,d)})})}(),function(){function c(b){var c=b.data,d=a(c.options.container);d.find("."+k).removeClass(k),d.find("."+l).removeClass(l),c.removeSummary()}function d(c){var d=a(b),e=a(a(c.currentTarget).attr("href"));return d.scrollTop(e.offset().top-d.outerHeight(!0)/2),e.focus(),!1}function e(a){var b=a.data;b.validate()?b.options.submits||a.preventDefault():a.preventDefault()}function f(b){return this.each(function(){var c=a(this),d=c.data("validatedForm"),e=a.extend({},g.DEFAULTS,c.data(),"object"==typeof b&&b);d||c.data("validatedForm",d=new g(this,e)),"string"==typeof b&&d[b]()})}var g=function(b,c){this.$element=a(b),this.options=a.extend({},g.DEFAULTS,c),this.addListeners()};g.VERSION="0.3.1",g.DEFAULTS={},g.prototype.addListeners=function(){this.$element.on("click.validatedForm",this,e),a(this.options.summary).on("click.validatedForm","a",d),a(this.options.resetbtn).on("click.validatedForm",this,c)},g.prototype.validate=function(){var b,c,d,e,f,g=this.options.container,h=[];return d=g?a(g):this.$element.closest("form")||a("body"),d.find("["+i+"]").each(function(){b=a(this),b.data("validation-first-focus","false"),e=b.data("validatedInput").validate(!0).errors.length>0,e&&(c=a("label[for="+this.id+"]"),f=c.attr(j)||c.html(),h.push({element:this,label:f,errors:b.data("validatedInput").validate(!0).errors.slice()}))}),h.length>0?(this.displaySummary(h),this.options.onError&&this.options.onError.call(this,h)):this.options.onSuccess&&this.options.onSuccess.call(this),0===h.length},g.prototype.removeSummary=function(b){var c=a(this.options.summary);c.removeClass("open").attr("aria-hidden","true")},g.prototype.displaySummary=function(b){var c=a(this.options.summary);if(!b||0===b.length)return void this.removeSummary();if(c.length>0){for(var d="",e=0;e<b.length;e++)d+='<li><a href="#'+b[e].element.id+'">'+b[e].label+" is invalid.</a></li>";c.addClass("open").attr("aria-hidden","false").focus(),c.find("ul").empty().append(d)}};var h=a.fn.validatedForm;a.fn.validatedForm=f,a.fn.validatedForm.Constructor=g,a.fn.validatedForm.noConflict=function(){return a.fn.validatedForm=h,this}}(),b.validations={password:{maxlength:32,rules:[{note:"Enter 8 to 32 characters",regx:/^.{8,32}$/},{note:"Enter at least 1 letter and at least 1 number",regx:/^(?=.*\d)(?=.*[a-zA-Z]).+$/},{type:"restriction",note:'Input must not contain the word "Password"',regx:/[Pp]assword/}]},email:{maxlength:48,rules:[{note:"Enter a proper email format (e.g., email@domain.com)"},{help:!1,note:"Enter a proper email format (e.g., email@domain.com)",regx:/^[\'_a-zA-Z0-9-]+(\.[\'_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,})$/,minTestLen:1},{help:!1,note:'Input must contain "@" and "."',regx:/^(?=.*@)(?=.*\.).+$/,minTestLen:5},{type:"restriction",note:"Input must not have more than 48 characters",regx:/^.{49,}$/},{type:"restriction",note:'Input must not start or end with "@" and "."',regx:[/^@/,/@$/,/^\./,/\.$/]},{type:"restriction",note:'Input must not contain more than one "@"',regx:/^[^@]*@[^@]*(?=@)/},{type:"restriction",note:'Input must not have "." immediately following "@"',regx:/@\./}]},phone:{maxlength:14,placeholder:"(XXX) XXX-XXXX",rules:[{note:"Enter 10 digits, no hyphens",regx:/^\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/},{type:"restriction",note:"Invalid Phone Number",func:function(a){var b=String(a.replace(/[^\d]/g,""));if("0"!==b[0]&&"1"!==b[0]&&!(b.length>=3&&b[1]===b[2]||b.length>=4&&"0"===b[3]||"1"===b[3]||b.length>=6&&"1"===b[4]&&"1"===b[5]||10===b.length&&-1!=="01234567890123456789".indexOf(b)||10===b.length&&-1!=="98765432109876543210".indexOf(b))){switch(b){case"0000000000":case"1111111111":case"2222222222":case"3333333333":case"4444444444":case"5555555555":case"6666666666":case"7777777777":case"8888888888":case"9999999999":return}return!0}}}]},ssn:{maxlength:11,placeholder:"XXX-XX-XXXX",rules:[{note:"Enter 9 digits",regx:[/^\d{9}$/,/^\d{3}-\d{2}-\d{4}$/]}]},ssn4:{maxlength:4,placeholder:"XXXX",rules:[{note:"Enter 4 digits",regx:/^\d{4}$/}]},zip:{maxlength:5,placeholder:"XXXXX",rules:[{note:"Enter 5 digits",regx:/^\d{5}$/}]},zip4:{maxlength:9,placeholder:"XXXXX-XXXX",rules:[{note:"Enter 5 plus 4 digits",regx:[/^\d{5}$/,/^\d{5}-\d{4}$/]}]},date:{maxlength:10,placeholder:"mm/dd/yyyy",rules:[{note:"Enter a proper date format (e.g., mm/dd/yyyy)",func:function(a){var b,c,d,e=/^\d{2}\/\d{2}\/\d{4}$/,f=/^\d{2}-\d{2}-\d{4}$/;return e.test(a)||f.test(a)?(b=new Date(a),b?(c=("0"+(b.getMonth()+1)).slice(-2).toString()+("0"+b.getDate()).slice(-2).toString()+b.getFullYear().toString(),d=a.replace(/[^\d]/g,"").toString(),c===d):!1):!1}}]},ccnum:{maxlength:19,placeholder:"XXXX-XXXX-XXXX-XXXX",rules:[{note:"Enter 16 digits",regx:[/^\d{16}$/,/^\d{4}\s\d{4}\s\d{4}\s\d{4}$/,/^\d{4}-\d{4}-\d{4}-\d{4}$/]},{note:"Input is not a valid credit card number",func:function(a){var b,c=a.replace(/[^\d]/g,""),d=c.length,e=0,f=d%2;if(16!==d)return!1;for(var g=0;d>g;g++)b=parseInt(c.charAt(g),10),g%2===f&&(b*=2),b>9&&(b-=9),e+=b;return e%10===0}}]},ccexp:{maxlength:7,placeholder:"mm/yyyy",rules:[{note:"Enter a proper format (e.g., mm/yyyy)",regx:/^\d{2}\/\d{4}$/}]},ccv:{maxlength:3,rules:[{note:"Enter the last 3 digits of the ID number on the back of your Credit Card",regx:/^\d{3}$/}]},abartn:{maxlength:9,rules:[{note:"Enter a valid bank account routing number",func:function(a){for(var b=0,c=0;c<a.length;c+=3)b+=3*parseInt(a.charAt(c),10)+7*parseInt(a.charAt(c+1),10)+parseInt(a.charAt(c+2),10);return 0!==b&&b%10===0}},{note:"Enter 9 digits",regx:/^\d{9}$/}]},required:{rules:[{help:!1,note:"Input is required",regx:/.+/,showOnFirstFocus:!1}]}}}(jQuery,window,document);