bValidator.Bs3FormPresenter=function(e){"use strict";var s=function(t,n){function i(){}i.prototype=s.fn,this.fn=new i,this.fn.$input=t,this.fn.validatorInstance=n,this.fn.$msgContainer=null,this.fn.themeOptions=null,this.fn.chkboxOrRadio=null,this.fn.$formGroupElement=null,this.fn.$msgParent=null};return s.prototype={showInvalid:function(t){this.fn.showInvalid(t)},showValid:function(){this.fn.showValid()},removeAll:function(){this.fn.removeAll()},setOptions:function(t){this.fn.setOptions(t)},isInvalidOn:function(){return this.fn.isInvalidOn()}},s.fn={createMsg:function(t){for(var n="",i=0;i<t.length;i++)n+="<div>"+t[i]+"</div>";return e(this.themeOptions.template.replace("{message}",n))},showInvalid:function(t){this.removeInvalid(!0),this.validatorInstance&&this.validatorInstance.setScrollTo(this.$input.offset().top),this.getFormGroupElement().addClass(this.themeOptions.formGroupInvalidClass),!0===this.themeOptions.showMessages&&(this.$msgContainer=this.createMsg(t),this.getMsgContainer().append(this.$msgContainer))},getFormGroupElement:function(){if(null!==this.$formGroupElement&&this.$formGroupElement.length)return this.$formGroupElement;var t=null,n=this.themeOptions.formGroup;return 0===(t="#"==n[0]?e(n):this.validatorInstance?this.$input.closest(n,this.validatorInstance.fn.$mainElement):this.$input.closest(n)).length&&window.console.warn("[bValidator 'bs3form' theme] missing form-group element"),this.$formGroupElement=t},getMsgContainer:function(){if(!this.themeOptions.msgParent)return this.getFormGroupElement();if(null!==this.$msgParent&&this.$msgParent.length)return this.$msgParent;var t=null,n=this.themeOptions.msgParent;return 0===(t="#"==n[0]?e(n):this.validatorInstance?this.$input.closest(n,this.validatorInstance.fn.$mainElement):this.$input.closest(n)).length&&(t=this.getFormGroupElement()),this.$msgParent=t},showValid:function(){this.removeInvalid(),this.themeOptions.formGroupValidClass&&this.getFormGroupElement().addClass(this.themeOptions.formGroupValidClass)},removeInvalid:function(){null!==this.$msgContainer&&(this.$msgContainer.remove(),this.$msgContainer=null),this.getFormGroupElement().removeClass(this.themeOptions.formGroupInvalidClass)},removeValid:function(){this.getFormGroupElement().removeClass(this.themeOptions.formGroupValidClass)},removeAll:function(){this.removeValid(),this.removeInvalid()},setOptions:function(t){this.themeOptions=t,"checkbox"==this.$input[0].type||"radio"==this.$input[0].type?this.chkboxOrRadio=!0:this.chkboxOrRadio=!1},isInvalidOn:function(){return null!==this.$msgContainer}},s}(jQuery);