"},this.showSuccessMessage=!0,this.showErrorMessage=!0,this.checkValid=function(a){return!(!a||!a.$valid)},this.validate=function(a){var c=d.defer(),g=0;if(void 0===a)return console.error("This is not a regular Form name scope"),c.reject("This is not a regular Form name scope"),c.promise;if(a.validationId)b.$broadcast(a.$name+"submit-"+a.validationId,g++);else if(a.constructor===Array)for(var h in a)b.$broadcast(a[h].$name+"submit-"+a[h].validationId,g++);else for(var i in a)"$"!==i[0]&&a[i].hasOwnProperty("$dirty")&&b.$broadcast(i+"submit-"+a[i].validationId,g++);return c.promise.success=function(a){return c.promise.then(function(b){a(b)}),c.promise},c.promise.error=function(a){return c.promise.then(null,function(b){a(b)}),c.promise},e(function(){f.checkValid(a)?c.resolve("success"):c.reject("error")}),c.promise},this.validCallback=null,this.invalidCallback=null,this.resetCallback=null,this.reset=function(a){if(void 0===a)return void console.error("This is not a regular Form name scope");if(a.validationId)b.$broadcast(a.$name+"reset-"+a.validationId);else if(a.constructor===Array)for(var c in a)b.$broadcast(a[c].$name+"reset-"+a[c].validationId);else for(var d in a)"$"!==d[0]&&a[d].hasOwnProperty("$dirty")&&b.$broadcast(d+"reset-"+a[d].validationId)},this.addMsgElement=function(a){return a.after("")},this.getMsgElement=function(a){return a.next()},this.$get=["$injector",function(a){return g(a),{setValidMethod:this.setValidMethod,getValidMethod:this.getValidMethod,setErrorHTML:this.setErrorHTML,getErrorHTML:this.getErrorHTML,setSuccessHTML:this.setSuccessHTML,getSuccessHTML:this.getSuccessHTML,setExpression:this.setExpression,getExpression:this.getExpression,setDefaultMsg:this.setDefaultMsg,getDefaultMsg:this.getDefaultMsg,showSuccessMessage:this.showSuccessMessage,showErrorMessage:this.showErrorMessage,checkValid:this.checkValid,validate:this.validate,validCallback:this.validCallback,invalidCallback:this.invalidCallback,resetCallback:this.resetCallback,reset:this.reset,addMsgElement:this.addMsgElement,getMsgElement:this.getMsgElement}}]}angular.module("validation.provider").provider("$validation",a)}.call(this),function(){function a(a){var b=a.get("$validation"),c=a.get("$timeout"),d=a.get("$parse");return{link:function(a,e,f){var g=d(f.validationReset)(a);c(function(){e.on("click",function(a){a.preventDefault(),b.reset(g)})})}}}angular.module("validation.directive").directive("validationReset",a),a.$inject=["$injector"]}.call(this),function(){function a(a){var b=a.get("$validation"),c=a.get("$timeout"),d=a.get("$parse");return{priority:1,require:"?ngClick",link:function(a,e,f){var g=d(f.validationSubmit)(a);c(function(){e.off("click"),e.on("click",function(c){c.preventDefault(),b.validate(g).success(function(){d(f.ngClick)(a)})})})}}}angular.module("validation.directive").directive("validationSubmit",a),a.$inject=["$injector"]}.call(this),function(){function a(a){function b(a,b,c){for(var d=document.querySelectorAll("*[validation-group="+b+"]"),e=0,f=d.length;e0&&c[0]?(x&&(h[x][g.$name]=!0,b(a,x,!0)),y.success()):x?(h[x][g.$name]=!1,k(x)?void b(a,x,!0):(b(a,x,!1),y.error())):y.error()},function(){return y.error()});if(w.constructor!==RegExp)return y.error();if(void 0!==n&&null!==n){if(c.getExpression(r).test(n))return x&&(h[x][g.$name]=!0,b(a,x,!0)),y.success();if(!x)return y.error();if(h[x][g.$name]=!1,!k(x))return b(a,x,!1),y.error();b(a,x,!0)}},n=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},o=function(){return n()+n()+n()+n()};return{restrict:"A",require:"ngModel",link:function(a,b,d,f){var g,i=d.validator,j=d.messageId,k=d.validationGroup,n=d.validMethod,p=d.ngModel,q=function(){},r=i.split(","),s=f.validationId=o(),t=null;return"boolean"==typeof a.initialValidity&&(g=a.initialValidity),k&&(h[k]||(h[k]={}),h[k][f.$name]=!1),j||k||c.addMsgElement(b),f.$setValidity(f.$name,g),a.$on(f.$name+"reset-"+s,function(){q(),e(function(){f.$setViewValue(t),f.$setPristine(),f.$setValidity(f.$name,void 0),f.$render(),j||k?angular.element(document.querySelector("#"+(j||k))).html(""):c.getMsgElement(b).html(""),c.resetCallback&&c.resetCallback(b)})}),n=angular.isUndefined(n)?c.getValidMethod():n,a.$on(f.$name+"submit-"+s,function(c,g){var h=f.$viewValue,i=!1;i=m(a,b,d,f,r,h),"submit"===n&&(q(),q=a.$watch(function(){return a.$eval(p)},function(c,e){c!==e&&(void 0!==c&&null!==c||(c=""),i=m(a,b,d,f,r,c))}));var j=function(a){a?delete l[g]:(l[g]=b[0],e(function(){l[Math.min.apply(null,Object.keys(l))].focus()},0))};i.constructor===Object?i.then(j):j(i)}),"blur"===n?void b.bind("blur",function(){var c=a.$eval(p);a.$apply(function(){m(a,b,d,f,r,c)})}):void("submit"!==n&&"submit-only"!==n&&(a.$watch(function(){return a.$eval(p)},function(e){if(f.$pristine&&f.$viewValue)t=f.$viewValue||"",f.$setViewValue(f.$viewValue);else if(f.$pristine)return void(j||k?angular.element(document.querySelector("#"+(j||k))).html(""):c.getMsgElement(b).html(""));m(a,b,d,f,r,e)}),e(function(){d.$observe("noValidationMessage",function(a){var d;d=j||k?angular.element(document.querySelector("#"+(j||k))):c.getMsgElement(b),"true"===a||a===!0?d.css("display","none"):"false"!==a&&a!==!1||d.css("display","block")})})))}}}angular.module("validation.directive").directive("validator",a),a.$inject=["$injector"]}.call(this);
\ No newline at end of file
+angular.module("validation",["validation.provider","validation.directive"]),angular.module("validation.provider",[]),angular.module("validation.directive",["validation.provider"]),function(){function a(){var a,b,c,d,e,f=this,g=function(f){a=f,b=a.get("$rootScope"),c=a.get("$http"),d=a.get("$q"),e=a.get("$timeout")},h={},i=null,j={};this.setExpression=function(a){return angular.extend(h,a),f},this.getExpression=function(a){return h[a]},this.setDefaultMsg=function(a){return angular.extend(j,a),f},this.getDefaultMsg=function(a){return j[a]},this.setValidMethod=function(a){i=a},this.getValidMethod=function(){return i},this.setErrorHTML=function(a){if(a.constructor===Function)return f.getErrorHTML=a,f},this.getErrorHTML=function(a){return'