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le-callback-err: warn, no-invalid-this: warn */\n\nwindow.userManager = (function() {\n\t\"use strict\";\n\n\tvar onLogonPage = false;\n\tvar mgr;\n\n\tvar retryTimeOutID = undefined;\n\tvar retryInterval = 100;\n\n\tOidc.Log.logger = console;\n\tOidc.Log.level = Oidc.Log.NONE;\n\n\t/**\n\t * Helper function genreate the markup for message box.\n\t *\n\t * @param {Object} options Then options which used to generate markup.\n\t * @return {string} html markup.\n\t */\n\tfunction generateMarkup(options) {\n\t\tconst {message = \"Unknown error\", title, buttons = []} = options;\n\t\tconst btns = buttons.map((button) => `
\n\t\t\t\t\t\t${button.text}\n\t\t\t\t\t
`);\n\t\treturn `\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t${title}\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t${message}\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t${btns.join(\"\")}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t\t`;\n\t}\n\n\t/**\n\t * Function is used to compose custom message box.\n\t * @param {Object} options Then options which used to generate markup.\n\t */\n\tfunction showMessageBox(options) {\n\t\tdocument.body.innerHTML = DOMPurify.sanitize(generateMarkup(options));\n\t\tconst {buttons = []} = options;\n\t\tfor (const button of buttons) {\n\t\t\tif (button.id) {\n\t\t\t\tconst btnEl = document.getElementById(button.id);\n\t\t\t\tbtnEl.addEventListener(\"click\", button.handler);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction remove_hash_from_url() {\n\t\tvar uri = window.location.toString();\n\t\tif (uri.indexOf(\"#\") > 0) {\n\t\t\tvar clean_uri = uri.substring(0, uri.indexOf(\"#\"));\n\t\t\twindow.history.replaceState({}, document.title, clean_uri);\n\t\t}\n\t}\n\n\t/**\n\t * Function which is used to handle an error which received as a response of 'postToken' .\n\t * @param {Object} data Then error object\n\t */\n\tfunction handleError(data) {\n\t\t// Configuration Object for the custom message box.\n\t\tconst cfg = {\n\t\t\ttitle: 'Authorization failed',\n\t\t\tmessage: data.error.message,\n\t\t\t// handler used by the Ext.messageBox.\n\t\t\thandler: function(btnId) {\n\t\t\t\tif (btnId === \"retry\") {\n\t\t\t\t\tretryPostToken(data, false);\n\t\t\t\t} else if (btnId === \"signout\") {\n\t\t\t\t\tsignOut();\n\t\t\t\t}\n\t\t\t},\n\t\t\tbuttons: [{\n\t\t\t\ttext: \"Retry\",\n\t\t\t\tid: \"btnRetry\",\n\t\t\t\thandler: function() {\n\t\t\t\t\tretryPostToken(data, false);\n\t\t\t\t},\n\t\t\t}, {\n\t\t\t\ttext: \"Signout\",\n\t\t\t\tid: \"btnSignout\",\n\t\t\t\thandler: signOut,\n\t\t\t}],\n\t\t};\n\n\t\twrapperHandler(data.error.hcode, cfg);\n\t}\n\n\t/**\n\t * Function which is used to handle MAPI error which received as a response of 'postToken' .\n\t *\n\t * @param {Object} data Then error object\n\t */\n\tfunction handleMapiError (data) {\n\t\t// Configuration Object for the custom message box.\n\t\tconst cfg = {\n\t\t\ttitle: 'Authorization failed',\n\t\t\tmessage: \"Failed to authorization due to server error\",\n\t\t\t// handler used by the Ext.messageBox.\n\t\t\thandler: function(btnId) {\n\t\t\t\tif (btnId === \"retry\") {\n\t\t\t\t\treauthenticateWithRedirect();\n\t\t\t\t} else if (btnId === \"signout\") {\n\t\t\t\t\tsignOut();\n\t\t\t\t}\n\t\t\t},\n\t\t\tbuttons: [{\n\t\t\t\ttext: \"Retry\",\n\t\t\t\tid: \"btnRetry\",\n\t\t\t\thandler: reauthenticateWithRedirect,\n\t\t\t}, {\n\t\t\t\ttext: \"Signout\",\n\t\t\t\tid: \"btnSignout\",\n\t\t\t\thandler: signOut,\n\t\t\t}],\n\t\t};\n\n\t\twrapperHandler(data.error.hcode, cfg);\n\t}\n\n\t/**\n\t * Helper function which do 'postToken' again.\n\t * @param {Object} data The response data of last 'postToken'.\n\t * @param {boolean} timeout true to wait for the 3 sec. to do 'postToken' false it wont wait for 3 sec.\n\t */\n\tfunction retryPostToken(data, timeout) {\n\t\tmgr.getUser().then(function(user) {\n\t\t\tif (isUserNotExpired(user)) {\n\t\t\t\tif (timeout === false) {\n\t\t\t\t\tpostToken(user);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tretryTimeOutID = window.setTimeout(function() {\n\t\t\t\t\tpostToken(user);\n\t\t\t\t}, retryInterval);\n\n\t\t\t\t// Upper limit for the incremental retry interval is 5 second.\n\t\t\t\tretryInterval = retryInterval < 5000 ? retryInterval * 2 : 5000;\n\t\t\t\tOidc.Log.debug(\"Retry OIDC post token in: \"+ retryInterval);\n\t\t\t} else {\n\t\t\t\thandleError(data);\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction onLoad() {\n\t\ttry {\n\t\t\tvar data = JSON.parse(this.responseText);\n\t\t} catch (e) {\n\t\t\tOidc.Log.error('oidc unable to parse post token response');\n\t\t}\n\n\t\tif (data && data.error) {\n\t\t\tOidc.Log.error('oidc post token failed: ' + data.error.hcode);\n\n\t\t\tswitch (data.error.hcode) {\n\t\t\tcase 'MAPI_E_UNCONFIGURED':\n\t\t\tcase 'MAPI_E_NETWORK_ERROR':\n\t\t\t\tretryPostToken(data, true);\n\t\t\t\treturn;\n\t\t\tcase 'MAPI_E_LOGON_FAILED':\n\t\t\tcase 'MAPI_E_NO_ACCESS':\n\t\t\tcase 'OIDC_SCOPE_NOT_FOUND':\n\t\t\t\t// MAPI_E_LOGON_FAILED it means token is expired\n\t\t\t\t// so need to redirect to interactive login page\n\t\t\t\t// Or OIDC_SCOPE_NOT_FOUND it means some required scope\n\t\t\t\t// is missing.\n\t\t\t\thandleError(data);\n\t\t\t\tbreak;\n\t\t\tcase 'MAPI_E_CALL_FAILED':\n\t\t\tdefault:\n\t\t\t\thandleMapiError(data);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (onLogonPage) {\n\t\t\twindow.location.href = window.location.origin + window.location.pathname;\n\t\t} else if (data && data.authenticated === false) {\n\t\t\twrapperHandler('AUTHENTICATION_FAILURE', {\n\t\t\t\thandler: function() {\n\t\t\t\t\treauthenticateWithRedirect();\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tclearTimeout(retryTimeOutID);\n\t\t\tretryInterval = 100;\n\t\t}\n\t}\n\n\t/**\n\t * Helper function used to initialize the http request object.\n\t *\n\t * @param {String} method The request method.\n\t * @param {String} url The url to request.\n\t * @return {XMLHttpRequest} return xml http request instance.\n\t */\n\tfunction request(method, url) {\n\t\tvar http = new XMLHttpRequest();\n\t\thttp.open(method, url, true);\n\t\thttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n\t\treturn http;\n\t}\n\n\t/**\n\t * Function triggered request to token service which authenticate the user\n\t *\n\t * @param {Object} user The current login user.\n\t */\n\tfunction postToken(user) {\n\t\t// Post to webapp service with token.\n\t\tvar http = request(\"POST\", \"service.php?service=token\");\n\n\t\tvar data = \"token=\" + user.access_token;\n\t\tif (onLogonPage) {\n\t\t\tdata += \"&new=true\";\n\t\t}\n\t\thttp.addEventListener(\"load\", onLoad);\n\t\thttp.send(data);\n\t}\n\n\t/**\n\t * Function used to clear the webapp/php session. It will triggered an request to\n\t * 'service.logout.php' which is responsible to destroy/clear the session.\n\t * @param {function} onLoadEventHandler The event handler which triggered on load.\n\t */\n\tfunction clearSession(onLoadEventHandler) {\n\t\tvar http = request(\"GET\", \"service.php?service=logout\");\n\t\thttp.addEventListener(\"load\", onLoadEventHandler);\n\t\thttp.send();\n\t}\n\n\t/**\n\t * Middleware function used to show the proper message box based on the action type.\n\t *\n\t * @param {String} actionType The constant action type which used to show the message box.\n\t * @param {Object} cfg The configuration object used by 'showMessageBox' to compose custom message box.\n\t */\n\tfunction wrapperHandler(actionType, cfg) {\n\t\tif (window.Zarafa) {\n\t\t\tswitch (actionType) {\n\t\t\tcase \"ACCESS_TOKEN_EXPIRED\":\n\t\t\tcase \"AUTHENTICATION_FAILURE\":\n\t\t\t\tvar title = actionType === \"ACCESS_TOKEN_EXPIRED\" ? _('Access token expired') : _('Authorization failed');\n\t\t\t\twindow.Zarafa.core.Util.showMessageBox({\n\t\t\t\t\ttitle: title,\n\t\t\t\t\tmsg: _('Failed to renew session, re-authentication is required.'),\n\t\t\t\t\tcls: Ext.MessageBox.ERROR_CLS,\n\t\t\t\t\tminWidth: 250,\n\t\t\t\t\tfn: cfg.handler,\n\t\t\t\t\tbuttons: Ext.MessageBox.OK,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'MAPI_E_LOGON_FAILED':\n\t\t\tcase 'MAPI_E_UNCONFIGURED':\n\t\t\tcase 'MAPI_E_NETWORK_ERROR':\n\t\t\tcase 'OIDC_SCOPE_NOT_FOUND':\n\t\t\tcase 'MAPI_E_CALL_FAILED':\n\t\t\t\twindow.Zarafa.core.Util.showMessageBox({\n\t\t\t\t\ttitle: cfg.title,\n\t\t\t\t\tmsg: cfg.message,\n\t\t\t\t\tcls: Ext.MessageBox.ERROR_CLS,\n\t\t\t\t\twidth: 200,\n\t\t\t\t\tfn: cfg.handler,\n\t\t\t\t\tcustomButton: [{\n\t\t\t\t\t\ttext: _('Retry'),\n\t\t\t\t\t\tname: 'retry',\n\t\t\t\t\t}, {\n\t\t\t\t\t\ttext: _('Signout'),\n\t\t\t\t\t\tname: 'signout',\n\t\t\t\t\t}],\n\t\t\t\t\tscope: this,\n\t\t\t\t}, true);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tOidc.Log.error(\"UnKnown action type:\", actionType);\n\t\t\t}\n\t\t} else if (cfg) {\n\t\t\t// This will show the custom message box\n\t\t\t// when Extjs is unavailable.\n\t\t\tshowMessageBox(cfg);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function which redirect to signin page.\n\t *\n\t * @param {Object} args The config options used by sign-in redirect.\n\t */\n\tfunction signinRedirect(args) {\n\t\tif (window.Zarafa) {\n\t\t\tZarafa.core.Util.disableLeaveRequester();\n\t\t}\n\n\t\treturn mgr.signinRedirect(args);\n\t}\n\n\t/**\n\t * Helper function which help to identify that give user is expired or not.\n\t *\n\t * @param {Object} user The current login user.\n\t * @return {boolean} true if user session is not expired yet else false.\n\t */\n\tfunction isUserNotExpired(user) {\n\t\treturn user && user.access_token && !user.expired;\n\t}\n\n\t/**\n\t * Function show the error message box when scopes are invalid/mismatch.\n\t * User can either retry and switch the user or sign out.\n\t */\n\tfunction handleScopesMismatch () {\n\t\tshowMessageBox({\n\t\t\ttitle: \"Access denied\",\n\t\t\tmessage: \"Please switch to another user or sign out first to access this app\",\n\t\t\tbuttons: [{\n\t\t\t\ttext: \"Retry\",\n\t\t\t\tid: \"btnRetry\",\n\t\t\t\thandler: reauthenticateWithRedirect,\n\t\t\t}, {\n\t\t\t\ttext: \"Sign out\",\n\t\t\t\tid: \"btnSignOut\",\n\t\t\t\thandler: signOut,\n\t\t\t}],\n\t\t});\n\t}\n\n\t/**\n\t * Helper function which used to silently renew the access token.\n\t *\n\t * @param {Object} mgr The instance of user manager.\n\t * @return {Promise} return the promise.\n\t */\n\tfunction silentRenewAccessToken(mgr) {\n\t\treturn mgr.signinSilent().then(function(user) {\n\t\t\tif (isUserNotExpired(user)) {\n\t\t\t\tOidc.Log.info('oidc sign-in silent successfully.');\n\t\t\t\tpostToken(user);\n\t\t\t}\n\t\t\treturn user;\n\t\t}).catch(function(err) {\n\t\t\tOidc.Log.error('oidc silent sign-in failed');\n\t\t\treturn null;\n\t\t});\n\t}\n\n\tfunction init(oidcSettings, loginPage) {\n\t\tonLogonPage = loginPage;\n\t\tvar url = window.location.protocol +\"//\"+ window.location.hostname + window.location.pathname;\n\t\tif (!url.endsWith('/')) {\n\t\t\turl += '/';\n\t\t}\n\t\toidcSettings.redirect_uri = url + '#oidc-callback';\n\t\toidcSettings.post_logout_redirect_uri = url + '?logout';\n\t\toidcSettings.silent_redirect_uri = url + \"?oidc-silent-refresh\";\n\t\toidcSettings.accessTokenExpiringNotificationTime = 120;\n\n\t\t/**\n\t\t * Helper function used to check all required\n\t\t * scopes are avaiable in user/token settings.\n\t\t *\n\t\t * @param {Object} user The current login user.\n\t\t * @return {Boolean} true if scopes are as expected else false.\n\t\t */\n\t\tfunction validateScopes (user) {\n\t\t\tvar isScopesValid = true;\n\t\t\tvar scopes = oidcSettings.requiredScope.split(\" \");\n\n\t\t\tvar userScopes = user.scopes;\n\t\t\tfor (var i = 0; i < scopes.length; i++) {\n\t\t\t\tif (!userScopes.includes(scopes[i])) {\n\t\t\t\t\tisScopesValid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn isScopesValid;\n\t\t}\n\n\t\tmgr = new Oidc.UserManager(oidcSettings);\n\t\tmgr.clearStaleState();\n\n\t\tmgr.events.addUserSignedOut(function() {\n\t\t\tOidc.Log.info('oidc user signed out at OP');\n\t\t\tmgr.removeUser();\n\n\t\t\t// clear php session and redirect to interactive sign in page.\n\t\t\tclearSession(function() {\n\t\t\t\tOidc.Log.info('php session cleared.');\n\n\t\t\t\tif (window.Zarafa) {\n\t\t\t\t\tZarafa.core.Util.disableLeaveRequester();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tmgr.events.addAccessTokenExpiring(function() {\n\t\t\tOidc.Log.info('oidc token expiring');\n\t\t});\n\n\t\t// Try to silently renew the access token, in case if it fails\n\t\t// then show access token expired dialog. After click on ok button\n\t\t// it will redirect to interactive logon page.\n\t\tvar accessTokenExpiredHandler = function() {\n\t\t\tOidc.Log.warn('oidc access token expired');\n\t\t\tmgr.getUser().then(function(user) {\n\t\t\t\tif (user) {\n\t\t\t\t\t// If the access token is not expired, then post the token to the PHP server.\n\t\t\t\t\tif (isUserNotExpired(user)) {\n\t\t\t\t\t\tOidc.Log.info('oidc sign-in silent successfully.');\n\t\t\t\t\t\tpostToken(user);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar refreshToken = user.refresh_token;\n\t\t\t\t\t\t// Remove user from storage if refresh_token is\n\t\t\t\t\t\t// not configured in user object.\n\t\t\t\t\t\tif (!refreshToken) {\n\t\t\t\t\t\t\tmgr.removeUser();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsilentRenewAccessToken(mgr).then(function(user) {\n\t\t\t\t\t\t\tif (!user) {\n\t\t\t\t\t\t\t\tOidc.Log.info('oidc sign-in silent did not return a user');\n\t\t\t\t\t\t\t\tif (refreshToken) {\n\t\t\t\t\t\t\t\t\tsetTimeout(function(mgr) {\n\t\t\t\t\t\t\t\t\t\tgetUser(mgr);\n\t\t\t\t\t\t\t\t\t}, 5000, mgr);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Silent sign-in failed, show message box which further redirects\n\t\t\t\t\t\t\t\t\t// to the interactive login page.\n\t\t\t\t\t\t\t\t\twrapperHandler(\"ACCESS_TOKEN_EXPIRED\", {\n\t\t\t\t\t\t\t\t\t\thandler: function() {\n\t\t\t\t\t\t\t\t\t\t\treauthenticateWithRedirect();\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// Event handler triggered when access token get expired.\n\t\tmgr.events.addAccessTokenExpired(accessTokenExpiredHandler);\n\n\t\t// Event handler triggered when getting error\n\t\t// while silently renewing access token.\n\t\tmgr.events.addSilentRenewError(function(err) {\n\t\t\tOidc.Log.error(\"oidc silent renew error\");\n\t\t\tif (err) {\n\t\t\t\tswitch (err.error) {\n\t\t\t\tcase 'interaction_required':\n\t\t\t\tcase 'login_required':\n\t\t\t\t\taccessTokenExpiredHandler();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if there is not error\n\t\t\tsetTimeout(function() {\n\t\t\t\tOidc.Log.info('oidc retrying silent renew');\n\t\t\t\tmgr.getUser().then(function(user) {\n\t\t\t\t\tOidc.Log.info('oidc retrying silent renew of user');\n\t\t\t\t\tif (isUserNotExpired(user)) {\n\t\t\t\t\t\tOidc.Log.info('oidc start silent renew');\n\t\t\t\t\t\tmgr.startSilentRenew();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar refreshToken = user ? user.refresh_token : null;\n\t\t\t\t\t\tOidc.Log.info('oidc failed to renew in time so try once to silently renew user.');\n\t\t\t\t\t\tmgr.signinSilent().catch(function(err) {\n\t\t\t\t\t\t\tOidc.Log.info('oidc silent sign-in failed');\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}).then(function(user) {\n\t\t\t\t\t\t\tif (user === null) {\n\t\t\t\t\t\t\t\tOidc.Log.info('oidc sign-in silent did not return a user');\n\t\t\t\t\t\t\t\tif (refreshToken) {\n\t\t\t\t\t\t\t\t\tsetTimeout(function(mgr) {\n\t\t\t\t\t\t\t\t\t\tgetUser(mgr);\n\t\t\t\t\t\t\t\t\t}, 5000, mgr);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Silent sign-in failed, show message box which further\n\t\t\t\t\t\t\t\t\t// redirect to interactive login page.\n\t\t\t\t\t\t\t\t\twrapperHandler(\"ACCESS_TOKEN_EXPIRED\", {\n\t\t\t\t\t\t\t\t\t\thandler: function() {\n\t\t\t\t\t\t\t\t\t\t\treauthenticateWithRedirect();\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, 5000);\n\t\t});\n\n\t\tmgr.events.addUserLoaded(function(user) {\n\t\t\tOidc.Log.info('oidc user loaded');\n\t\t\tmgr.getUser().then(function (user) {\n\t\t\t\t// Check scopes are matched with token\n\t\t\t\tif (!validateScopes(user)) {\n\t\t\t\t\thandleScopesMismatch();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpostToken(user);\n\t\t\t});\n\t\t});\n\n\t\tmgr.getUser().then(function(user) {\n\t\t\tif (isUserNotExpired(user)) {\n\t\t\t\t// Check scopes are matched with token\n\t\t\t\tif (!validateScopes(user)) {\n\t\t\t\t\thandleScopesMismatch();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpostToken(user);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Callback redirect handling.\n\t\t\tif (onLogonPage && window.location.hash.startsWith('#oidc-callback')) {\n\t\t\t\tvar error = undefined;\n\t\t\t\tmgr.signinRedirectCallback().catch(function(err) {\n\t\t\t\t\tOidc.Log.error('oidc failed to complete authentication');\n\t\t\t\t\terror = err;\n\t\t\t\t\treturn null;\n\t\t\t\t}).then(function(user) {\n\t\t\t\t\tremove_hash_from_url();\n\t\t\t\t\tif (!user) {\n\t\t\t\t\t\tvar msg = `Unable to complete the login. Please try again.\n\t\t\t\t\t\t

\n\t\t\t\t\t\tIf this problem persists, contact your system administrator with the following details:
\n\t\t\t\t\t\tError: ${(error && error.message) || \"Unable to complete login.\"}`;\n\n\t\t\t\t\t\tshowMessageBox({\n\t\t\t\t\t\t\ttitle: 'Incomplete login',\n\t\t\t\t\t\t\tmessage: msg,\n\t\t\t\t\t\t\tbuttons: [{\n\t\t\t\t\t\t\t\ttext: \"Retry\",\n\t\t\t\t\t\t\t\tid: \"btnRetry\",\n\t\t\t\t\t\t\t\thandler: function() {\n\t\t\t\t\t\t\t\t\tremove_hash_from_url();\n\t\t\t\t\t\t\t\t\tmgr.removeUser();\n\t\t\t\t\t\t\t\t\tsigninRedirect({\"prompt\": \"select_account\"});\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmgr.signinSilent().catch(function(err) {\n\t\t\t\tOidc.Log.error('oidc sign-in silent failed');\n\t\t\t\tif (onLogonPage) {\n\t\t\t\t\tOidc.Log.info('oidc sign-in silent did not return a user');\n\t\t\t\t\t// Silent sign-in failed, login normal\n\t\t\t\t\tsigninRedirect().catch(function(err) {\n\t\t\t\t\t\tOidc.Log.error(\"Unreachable service.\");\n\t\t\t\t\t\tshowMessageBox({\n\t\t\t\t\t\t\ttitle: 'Connection error',\n\t\t\t\t\t\t\tmessage: 'Problem occurred while connecting to an authorization service.',\n\t\t\t\t\t\t\tbuttons: [{\n\t\t\t\t\t\t\t\ttext: \"OK\",\n\t\t\t\t\t\t\t\tid: \"btnOk\",\n\t\t\t\t\t\t\t\thandler: function() {\n\t\t\t\t\t\t\t\t\tsigninRedirect();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Function called when user click on 'signout' button.\n\t * It will signout the user and clear the php session.\n\t */\n\tfunction signOut() {\n\t\t// clear php session and do signout.\n\t\tclearSession(function() {\n\t\t\t// We assume php session was clear successfully\n\t\t\tmgr.signoutRedirect();\n\t\t});\n\t}\n\n\t/**\n\t * Re-Authenticates the current user with redirecting to interactive login page.\n\t * It will first triggered request to clear the php session and then redirect to\n\t * interactive login page.\n\t */\n\tfunction reauthenticateWithRedirect() {\n\t\t// clear php session and do signout.\n\t\tclearSession(function() {\n\t\t\t// We assume php session was clear successfully\n\t\t\tsigninRedirect({\"prompt\": \"select_account\"});\n\t\t});\n\t}\n\n\t/**\n\t * Function used get the User object for the currently authenticated user. It will redirect to\n\t * interactive signin page in case of it fails to retrieve user from store.\n\t *\n\t * @param {Object} mgr The instance of user manager.\n\t * @returns {Object} return user object if user info exists in store else null.\n\t */\n\tfunction getUser(mgr) {\n\t\t// mgr.getUser() function internally called the event.load which further\n\t\t// more called the addSilentRenewError and addAccessTokenExpired\n\t\t// as an callback. This block only execute when offline access scope\n\t\t// was configured.\n\t\treturn mgr.getUser().then(function(user) {\n\t\t\tif (!user) {\n\t\t\t\tclearSession(function() {\n\t\t\t\t\tOidc.Log.info('php session cleared.');\n\n\t\t\t\t\tif (window.Zarafa) {\n\t\t\t\t\t\tZarafa.core.Util.disableLeaveRequester();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn user;\n\t\t});\n\t}\n\n\treturn {\n\t\tinit,\n\t\tsignOut,\n\t\treauthenticateWithRedirect,\n\t};\n})();\n\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\t// Condition succeed when interactive signin page was show.\n\tconst metaEl = document.querySelector(\"meta[name='kopano:webapp-view']\");\n\tif (metaEl && metaEl.content === 'interactive-signin') {\n\t\tvar uri = [location.protocol, '//', location.host, location.pathname].join('');\n\t\twindow.history.replaceState({}, document.title, uri);\n\n\t\tdocument.getElementById(\"signin-btn\").addEventListener(\"click\", function() {\n\t\t\twindow.location.reload();\n\t\t});\n\t\treturn;\n\t}\n\n\tconst elem = document.getElementById('oidc-settings');\n\tif (!elem) {\n\t\treturn;\n\t}\n\n\tconst oidcSettings = JSON.parse(elem.getAttribute('content'));\n\tconst firstLogon = elem.getAttribute('logon') === \"\";\n\tif (oidcSettings && !oidcSettings.client_id) {\n\t\toidcSettings.client_id = 'e4a-webapp-' + location.protocol + '//' + location.host + location.pathname;\n\t}\n\tuserManager.init(oidcSettings, firstLogon);\n});\n"], "names":["window","userManager","generateMarkup","options","message","title","buttons","btns","map","button","id","text","join","showMessageBox","document","body","innerHTML","DOMPurify","sanitize","getElementById","btnEl","addEventListener","handler","remove_hash_from_url","uri","location","toString","indexOf","clean_uri","substring","history","replaceState","handleError","data","wrapperHandler","error","hcode","cfg","btnId","retryPostToken","signOut","handleMapiError","reauthenticateWithRedirect","timeout","mgr","getUser","then","user","isUserNotExpired","postToken","retryTimeOutID","setTimeout","retryInterval","Oidc","Log","debug","onLoad","JSON","parse","responseText","e","onLogonPage","href","origin","pathname","authenticated","clearTimeout","request","method","url","http","XMLHttpRequest","open","setRequestHeader","access_token","send","clearSession","onLoadEventHandler","actionType","Zarafa","_","core","Util","msg","cls","Ext","MessageBox","ERROR_CLS","minWidth","fn","OK","width","customButton","name","scope","signinRedirect","args","disableLeaveRequester","expired","handleScopesMismatch","silentRenewAccessToken","signinSilent","info","catch","err","signoutRedirect","undefined","logger","console","level","NONE","init","oidcSettings","loginPage","validateScopes","isScopesValid","scopes","requiredScope","split","userScopes","i","length","includes","protocol","hostname","endsWith","redirect_uri","post_logout_redirect_uri","silent_redirect_uri","accessTokenExpiringNotificationTime","UserManager","clearStaleState","events","addUserSignedOut","removeUser","addAccessTokenExpiring","accessTokenExpiredHandler","warn","refreshToken","refresh_token","addAccessTokenExpired","addSilentRenewError","startSilentRenew","addUserLoaded","hash","startsWith","signinRedirectCallback","metaEl","querySelector","content","host","reload","elem","getAttribute","firstLogon","client_id"] }