!function(){"use strict";angular.module("SOGo.MainUI",["SOGo.Common","SOGo.Authentication"]);function e(e,s,o,r,a,i,n,t,d,c){var w=this;this.$onInit=function(){this.creds={username:s.cookieUsername,password:null,domain:null,rememberLogin:angular.isDefined(s.cookieUsername)&&0{e.parentElement.classList.add("md-input-has-value")})},100)},this.login=function(){return w.loginState="authenticating",i.login(w.creds).then(function(e){e.totpmissingkey?(w.loginState="totpcode",n("totpcode")):e.totpdisabled?(w.loginState="totpdisabled",w.cn=e.cn,w.url=e.url):(w.loginState="logged",w.cn=e.cn,w.url=e.url,o(function(){w.continueLogin()},1e3))},function(e){var s,o;w.loginState="error",e.error?w.errorMessage=e.error:0{w.retrievePasswordRecoveryEnabled(),this.passwordRecovery.passwordRecoveryLinkTimer=null},2e3)},this.retrievePasswordRecoveryEnabled=function(){(this.creds.username||this.creds.domain)&&i.passwordRecoveryEnabled(this.creds.username,this.creds.domain).then(function(e){w.passwordRecovery.passwordRecoveryMailDomain=e,w.passwordRecovery.passwordRecoveryEnabled=!0},function(){w.passwordRecovery.passwordRecoveryEnabled=!1})},this.changePasswordVisibility=function(){this.passwords.visible=!this.passwords.visible;var e=document.getElementById("passwordField");this.passwords.visible?(e.type="text",document.getElementById("password-visibility-icon").innerHTML="visibility_off"):(e.type="password",document.getElementById("password-visibility-icon").innerHTML="visibility")}}e.$inject=["$scope","$window","$timeout","Dialog","$mdDialog","Authentication","sgFocus","sgRippleClick","sgConstant","$mdToast"],angular.module("SOGo.MainUI").controller("LoginController",e)}(); //# sourceMappingURL=Main.js.map