{"version":3,"sources":["webpack://carbonio-login-ui/./assets/carbonio_loginpage.jpg","webpack://carbonio-login-ui/./assets/carbonio_loginpage-retina.jpg","webpack://carbonio-login-ui/./assets/logo-carbonio.png","webpack://carbonio-login-ui/./src/components-v1/modals.jsx","webpack://carbonio-login-ui/./src/components-v1/spinner.jsx","webpack://carbonio-login-ui/./src/components-v1/credentials-form.jsx","webpack://carbonio-login-ui/./src/components-v1/v1-login-manager.jsx","webpack://carbonio-login-ui/./src/services/v1-service.js","webpack://carbonio-login-ui/./src/components-v1/change-password-form.jsx","webpack://carbonio-login-ui/./src/components-v1/forget-password.jsx","webpack://carbonio-login-ui/./src/services/forget-password-service.js","webpack://carbonio-login-ui/./src/components-v1/v2-login-manager.jsx","webpack://carbonio-login-ui/./src/services/v2-service.js","webpack://carbonio-login-ui/./src/components-index/server-not-responding.jsx","webpack://carbonio-login-ui/./src/components-v1/form-selector.jsx","webpack://carbonio-login-ui/./src/services/auth-configuration-service.js","webpack://carbonio-login-ui/./src/components-index/zimbra-form.jsx","webpack://carbonio-login-ui/./assets/play-store.svg","webpack://carbonio-login-ui/./assets/app-store.svg","webpack://carbonio-login-ui/./src/components-v1/page-layout.jsx","webpack://carbonio-login-ui/./src/components-index/use-screen-mode.jsx","webpack://carbonio-login-ui/./src/components-index/use-touch-device.jsx"],"names":["OfflineModal","_ref","open","onClose","_useTranslation","useTranslation","t","_slicedToArray","React","Modal","title","Paragraph","StyledSpinner","styled","displayName","componentId","Spinner","viewBox","className","cx","cy","r","fill","strokeWidth","urlParams","URLSearchParams","window","location","search","CredentialsForm","authError","submitCredentials","configuration","disableInputs","onClickForgetPassword","_ref$loading","loading","_useState","useState","get","_useState2","username","setUsername","_useState3","_useState4","password","setPassword","_useLoginConfigStore","useLoginConfigStore","carbonioDomainName","carbonioFeatureResetPasswordEnabled","submitUserPassword","useCallback","e","preventDefault","usernameModified","has","concat","replace","includes","trim","samlButtonCbk","assign","destinationUrl","samlButton","useMemo","authMethods","Button","type","label","color","disabled","onClick","style","minHeight","clickForgetPassword","domainElement","Tooltip","placement","size","Text","weight","marginTop","maxWidth","onSubmit","width","Row","padding","bottom","Input","defaultValue","onChange","target","value","hasError","autocomplete","backgroundColor","CustomIcon","PasswordInput","overflow","orientation","crossAlignment","top","mainAlignment","textDecorationLine","cursor","V1LoginManager","setLoading","progress","_useState5","_useState6","setAuthError","_useState7","_useState8","snackbarNetworkError","setSnackbarNetworkError","_useState9","_useState10","detailNetworkModal","setDetailNetworkModal","authMethod","user","service","fetch","method","headers","getDeviceModel","deviceId","body","JSON","stringify","auth_method","postV1Login","then","_ref2","_asyncToGenerator","_regeneratorRuntime","_callee","res","_context","prev","next","t0","status","saveCredentials","abrupt","stop","_x","apply","arguments","onCloseCbk","onSnackbarActionCbk","onCloseSnackbarCbk","vertical","Snackbar","actionLabel","onActionClick","autoHideTimeout","isLoading","setIsLoading","oldPassword","setOldPassword","newPassword","setNewPassword","confirmNewPassword","setConfirmNewPassword","showOldPasswordError","setShowOldPasswordError","errorLabelNewPassword","setErrorLabelNewPassword","_useState11","_useState12","errorLabelConfirmNewPassword","setErrorLabelConfirmNewPassword","onChangeOldPassword","ev","onChangeNewPassword","onChangeConfirmNewPassword","useEffect","submitChangePasswordCb","credentials","Body","ChangePasswordRequest","_jsns","csrfTokenSecured","persistAuthTokenCookie","account","by","_content","prefs","pref","name","submitChangePassword","_payload2","_payload2$Body","_payload2$Body$Fault","_payload2$Body$Fault$","_payload2$Body$Fault$2","_payload3","_payload3$Body","_payload3$Body$Fault","_payload3$Body$Fault$","_payload3$Body$Fault$2","_payload4","_payload4$Body","_payload4$Body$Fault","_payload4$Body$Fault$","_payload4$Body$Fault$2","payload","_payload","_payload$Body","_payload$Body$ChangeP","authTokenArr","authToken","a","currNum","json","sent","ChangePasswordResponse","length","undefined","setCookie","ZM_AUTH_TOKEN","t1","Fault","Detail","Error","Code","INVALID_PASSWORD_ERR_CODE","find","rec","n","BLOCK_COMMON_WORDS_IN_PASSWORD_POLICY","str","BLOCK_PERSONAL_DATA_IN_PASSWORD_POLICY","ZIMBRA_PASSWORD_MAX_LENGTH_ATTR_NAME","num","ZIMBRA_PASSWORD_MIN_LENGTH_ATTR_NAME","ZIMBRA_PASSWORD_MIN_LOWERCASE_CHARS_ATTR_NAME","ZIMBRA_PASSWORD_MIN_NUMERIC_CHARS_ATTR_NAME","ZIMBRA_PASSWORD_MIN_PUNCTUATION_CHARS_ATTR_NAME","ZIMBRA_PASSWORD_MIN_UPPERCASE_CHARS_ATTR_NAME","ZIMBRA_PASSWORD_MIN_DIGITS_OR_PUNCS","PASSWORD_LOCKED","PASSWORD_RECENTLY_USED_ERR_CODE","err","message","startsWith","height","maxHeight","display","state","setProgress","code","setCode","recoveryEmail","setRecoveryEmail","showRecoveryEmailError","setShowRecoveryEmailError","showSendCodeError","setShowSendCodeError","_useState13","_useState14","showValidationCodeError","setShowValidationCodeError","_useState15","_useState16","recoveryAttemptsLeft","setRecoveryAttemptsLeft","createSnackbar","useContext","SnackbarManagerContext","onRetrieveRecoveryEmail","RecoverAccountRequest","op","email","channel","getRecoveryAccount","_payload$Body$Recover","RecoverAccountResponse","recoveryAccount","onSendRecoveryCode","getSendRecoveryCode","_ref3","_callee2","_payload2$Body$Recove","rAttemptLeft","_context2","key","hideButton","_x2","onValidateCode","recoveryCode","AuthRequest","validateRecoveryCode","_ref4","_callee3","_payload3$Body$AuthRe","_context3","AuthResponse","_x3","onProceedWithSession","Trans","i18nKey","defaults","components","bold","values","recovery_email","Container","formState","V2LoginManager","loadingCredentials","setLoadingCredentials","loadingOtp","setLoadingOtp","showOtpError","setShowOtpError","otpList","setOtpList","otpId","setOtpId","otp","setOtp","onChangeOtp","_useState17","_useState18","trustDevice","setTrustDevice","toggleTrustDevice","v","_useState19","_useState20","setEmail","_useState21","_useState22","loadingChangePassword","setLoadingChangePassword","_useState23","_useState24","_useState25","_useState26","postV2Login","redirected","response","_response$otp","_response$otp2","map","obj","id","submitOtpCb","version","unsecure_device","submitOtp","Select","items","background","defaultSelection","Checkbox","ChangePasswordForm","ForgetPassword","ServerNotResponding","isOpen","setOpen","FormSelector","domain","setConfiguration","error","setError","setDisableInputs","componentIsMounted","append","getAuthSupported","conf","_objectSpread","maxApiVersion","doAuthLogout","console","log","minApiVersion","NotSupportedVersion","waiting","twoFactor","changePassword","ZimbraForm","generateDeviceId","zimbraLogin","_payload$Body$Fault","_payload$Body$Fault$D","_payload$Body$Fault$D2","_payload$Body$Fault2","_payload$Body$Fault2$","_payload$Body$Fault2$2","Reason","origin","forgetPassword","LoginContainer","withConfig","props","backgroundImage","screenMode","DESKTOP","css","isDefaultBg","backgroundImageRetina","FormContainer","FormWrapper","theme","palette","gray6","regular","DarkReaderListener","setDarkReaderState","ThemeCallbacksContext","darkReaderResultValue","useDarkReaderResultValue","PageLayout","_ref5","_urlParams$get","hasBackendApi","logo","setLogo","serverError","setServerError","prepareUrlForForward","setDestinationUrl","setDomain","bg","setBg","setIsDefaultBg","setEditedTheme","copyrightBanner","setCopyrightBanner","setDomainName","showModal","setShowModal","showMobileAppModal","setShowMobileAppModal","doNotShowAgain","setDoNotShowAgain","check","MOBILE","TABLET","setScreenMode","handleResize","innerWidth","addEventListener","removeEventListener","useScreenMode","isTouchDevice","setIsTouchDevice","mediaQuery","matchMedia","handleMediaChange","matches","useIsTouchDevice","localStorage","getItem","primaryColor","useGetPrimaryColor","isAdvanced","SetIsAdvanced","isSupportedBrowser","browserName","CHROME","FIREFOX","useLayoutEffect","getLoginConfig","publicUrl","zimbraDomainName","_logo","loginPageBackgroundImage","loginPageLogo","image","logoCarbonio","loginPageSkinLogoUrl","url","loginPageTitle","document","loginPageFavicon","link","querySelector","createElement","rel","href","getElementsByTagName","appendChild","loginPageColorSet","colorSet","primary","et","generateColorSet","secondary","carbonioWebUiTitle","carbonioWebUiFavicon","carbonioWebUiDarkMode","carbonioWebUiDarkLoginBackground","carbonioWebUiDarkLoginLogo","carbonioWebUiLoginBackground","carbonioWebUiLoginLogo","carbonioWebUiDescription","carbonioLogoURL","CARBONIO_LOGO_URL","LinkText","_ref6","to","children","logoHtml","alt","src","marginLeft","marginRight","Padding","wrap","right","Icon","icon","CARBONIO_SUPPORTED_BROWSER_LINK","CARBONIO_CE_SUPPORTED_BROWSER_LINK","Date","getFullYear","customFooter","gap","showCloseIcon","setItem","lineHeight","PLAY_STORE_URL","playStore","APP_STORE_URL","appStore","iconColor"],"mappings":"uOAAA,QAAe,IAA0B,8CCAzC,EAAe,IAA0B,8CCAzC,EAAe,IAA0B,8C,2CCW1B,SAASA,EAAYC,GAAoB,IAAjBC,EAAID,EAAJC,KAAMC,EAAOF,EAAPE,QAC5CC,GAAYC,SAALC,GAAqBC,OAAAH,EAAA,GAApB,GACR,OACCI,gBAACC,KAAK,CAACC,MAAM,UAAUR,KAAMA,EAAMC,QAASA,GAC3CK,gBAACG,KAAS,CAAC,cAAY,cACrBL,EAAE,UAAW,qEAIlB,CCXA,IAAMM,EAAgBC,yBAAU,CAAAC,YAAA,yBAAAC,YAAA,eAAVF,CAAU,mXAgCjB,SAASG,IACvB,OACCR,gBAACI,EAAa,CAACK,QAAQ,aACtBT,gBAAA,UAAQU,UAAU,OAAOC,GAAG,KAAKC,GAAG,KAAKC,EAAE,KAAKC,KAAK,OAAOC,YAAY,MAG3E,C,cCpCMC,EAAY,IAAIC,gBAAgBC,OAAOC,SAASC,QAEvC,SAASC,EAAe5B,GAOpC,IANF6B,EAAS7B,EAAT6B,UACAC,EAAiB9B,EAAjB8B,kBACAC,EAAa/B,EAAb+B,cACAC,EAAahC,EAAbgC,cACAC,EAAqBjC,EAArBiC,sBAAqBC,EAAAlC,EACrBmC,eAAO,IAAAD,GAAQA,EAEf/B,GAAYC,SAALC,GAAqBC,OAAAH,EAAA,GAApB,GAERiC,GAAgCC,cAASd,EAAUe,IAAI,aAAe,IAAGC,GAAAjC,OAAA8B,EAAA,GAAlEI,EAAQD,EAAA,GAAEE,EAAWF,EAAA,GAC5BG,GAAgCL,cAAS,IAAGM,GAA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"137.js","sourcesContent":["export default __webpack_public_path__ + \"assets/8b90fe7b942c6f389f1ddd01103d3b0e.jpg\";","export default __webpack_public_path__ + \"assets/a2ca34c391de073172d480fe7977954a.jpg\";","export default __webpack_public_path__ + \"assets/c469e23959fd19cc40fbb5e56c083c86.png\";","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport { useTranslation } from 'react-i18next';\nimport React from 'react';\n\nimport { Modal, Paragraph } from '@zextras/carbonio-design-system';\n\nexport default function OfflineModal({ open, onClose }) {\n\tconst [t] = useTranslation();\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t{t('offline', 'You are currently offline, please check your internet connection')}\n\t\t\t\n\t\t\n\t);\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport React from 'react';\nimport styled from 'styled-components';\n\nconst StyledSpinner = styled.svg`\n\tanimation: rotate 2s linear infinite;\n\tmargin: -25px 0 0 -25px;\n\twidth: 50px;\n\theight: 50px;\n\n\t& .path {\n\t\tstroke: #0000ff;\n\t\tanimation: dash 1.5s ease-in-out infinite;\n\t}\n\n\t@keyframes rotate {\n\t\t100% {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n\t@keyframes dash {\n\t\t0% {\n\t\t\tstroke-dasharray: 1, 150;\n\t\t\tstroke-dashoffset: 0;\n\t\t}\n\t\t50% {\n\t\t\tstroke-dasharray: 90, 150;\n\t\t\tstroke-dashoffset: -35;\n\t\t}\n\t\t100% {\n\t\t\tstroke-dasharray: 90, 150;\n\t\t\tstroke-dashoffset: -124;\n\t\t}\n\t}\n`;\n\nexport default function Spinner() {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport React, { useCallback, useState, useMemo } from 'react';\nimport { Button, Input, PasswordInput, Row, Text, Tooltip } from '@zextras/carbonio-design-system';\nimport { useTranslation } from 'react-i18next';\nimport { useLoginConfigStore } from '../store/login/store';\n\nconst urlParams = new URLSearchParams(window.location.search);\n\nexport default function CredentialsForm({\n\tauthError,\n\tsubmitCredentials,\n\tconfiguration,\n\tdisableInputs,\n\tonClickForgetPassword,\n\tloading = false\n}) {\n\tconst [t] = useTranslation();\n\n\tconst [username, setUsername] = useState(urlParams.get('username') || '');\n\tconst [password, setPassword] = useState('');\n\tconst { carbonioDomainName, carbonioFeatureResetPasswordEnabled } = useLoginConfigStore();\n\n\tconst submitUserPassword = useCallback(\n\t\t(e) => {\n\t\t\te.preventDefault();\n\t\t\tif (username && password) {\n\t\t\t\tlet usernameModified = username;\n\t\t\t\tif (urlParams.has('virtualacctdomain')) {\n\t\t\t\t\tusernameModified = `${usernameModified.replace('@', '.')}@${urlParams.get(\n\t\t\t\t\t\t'virtualacctdomain'\n\t\t\t\t\t)}`;\n\t\t\t\t} else if (urlParams.has('customerDomain') && !username.includes('@')) {\n\t\t\t\t\tusernameModified = `${usernameModified.trim()}@${urlParams.get('customerDomain')}`;\n\t\t\t\t}\n\t\t\t\tif (!username.includes('@') && carbonioDomainName) {\n\t\t\t\t\tusernameModified = `${username}@${carbonioDomainName}`;\n\t\t\t\t}\n\t\t\t\tsubmitCredentials(usernameModified, password);\n\t\t\t}\n\t\t},\n\t\t[username, password, carbonioDomainName, submitCredentials]\n\t);\n\n\tconst samlButtonCbk = useCallback(() => {\n\t\twindow.location.assign(\n\t\t\t`/zx/auth/startSamlWorkflow?redirectUrl=${configuration.destinationUrl}`\n\t\t);\n\t}, [configuration]);\n\tconst samlButton = useMemo(() => {\n\t\tif (configuration.authMethods.includes('saml')) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t// used to keep the correct space where or not SAML is shown\n\t\t\t
\n\t\t);\n\t}, [configuration, disableInputs, samlButtonCbk, t]);\n\n\tconst clickForgetPassword = useCallback(\n\t\t(e) => {\n\t\t\te.preventDefault();\n\t\t\tonClickForgetPassword();\n\t\t},\n\t\t[onClickForgetPassword]\n\t);\n\n\tconst domainElement = useMemo(() => {\n\t\treturn !username?.includes('@') && carbonioDomainName ? (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t@{carbonioDomainName}\n\t\t\t\t\n\t\t\t\n\t\t) : null;\n\t}, [username, carbonioDomainName]);\n\n\treturn (\n\t\t e.preventDefault()}\n\t\t\tstyle={{ width: '100%' }}\n\t\t\tdata-testid=\"credentials-form\"\n\t\t>\n\t\t\t\n\t\t\t\t setUsername(e.target.value)}\n\t\t\t\t\thasError={!!authError}\n\t\t\t\t\tautocomplete=\"username\"\n\t\t\t\t\tlabel={t('username', 'Username')}\n\t\t\t\t\tbackgroundColor=\"gray5\"\n\t\t\t\t\tCustomIcon={() => domainElement}\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t setPassword(e.target.value)}\n\t\t\t\t\thasError={!!authError}\n\t\t\t\t\tautocomplete=\"password\"\n\t\t\t\t\tlabel={t('password', 'Password')}\n\t\t\t\t\tbackgroundColor=\"gray5\"\n\t\t\t\t/>\n\t\t\t\n\t\t\t\n\t\t\t\t{authError ||
}\n\t\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{samlButton}\n\t\t\t\n\t\t\t{carbonioFeatureResetPasswordEnabled !== false && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{t('forget_password', 'Forget Password?')}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport React, { useCallback, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Row, Snackbar } from '@zextras/carbonio-design-system';\nimport OfflineModal from './modals';\nimport Spinner from './spinner';\nimport CredentialsForm from './credentials-form';\nimport { postV1Login } from '../services/v1-service';\nimport { saveCredentials } from '../utils';\n\nconst formState = {\n\tcredentials: 'credentials',\n\twaiting: 'waiting',\n\ttwoFactor: 'two-factor',\n\tchangePassword: 'change-password',\n\tforgetPassword: 'forget-password'\n};\n\nexport default function V1LoginManager({ configuration, disableInputs }) {\n\tconst [t] = useTranslation();\n\n\tconst [loading, setLoading] = useState(false);\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tconst [progress, setProgress] = useState('credentials');\n\n\tconst [authError, setAuthError] = useState();\n\n\tconst [snackbarNetworkError, setSnackbarNetworkError] = useState(false);\n\tconst [detailNetworkModal, setDetailNetworkModal] = useState(false);\n\n\tconst submitCredentials = useCallback(\n\t\t(username, password) => {\n\t\t\tsetLoading(true);\n\t\t\treturn postV1Login('password', username, password)\n\t\t\t\t.then(async (res) => {\n\t\t\t\t\tswitch (res.status) {\n\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\tawait saveCredentials(username, password);\n\t\t\t\t\t\t\twindow.location.assign(configuration.destinationUrl);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'credentials_not_valid',\n\t\t\t\t\t\t\t\t\t'Credentials are not valid, please check data and try again'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 403:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'auth_not_valid',\n\t\t\t\t\t\t\t\t\t'The authentication policy needs more steps: please contact your administrator for more information'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 502:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt('server_unreachable', 'Error 502: Service Unreachable - Retry later.')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tsetSnackbarNetworkError(true);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => setLoading(false));\n\t\t},\n\t\t[configuration.destinationUrl, t]\n\t);\n\n\tconst onCloseCbk = useCallback(() => setDetailNetworkModal(false), [setDetailNetworkModal]);\n\tconst onSnackbarActionCbk = useCallback(\n\t\t() => setDetailNetworkModal(true),\n\t\t[setDetailNetworkModal]\n\t);\n\tconst onCloseSnackbarCbk = useCallback(\n\t\t() => setSnackbarNetworkError(false),\n\t\t[setSnackbarNetworkError]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{progress === 'credentials' && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === 'waiting' && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/*\n * SPDX-FileCopyrightText: 2021 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport { getDeviceModel, deviceId } from '../utils';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function postV1Login(authMethod, user, password, service) {\n\treturn fetch('/zx/auth/v1/login', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'X-Device-Model': getDeviceModel(),\n\t\t\t'X-Device-Id': deviceId(),\n\t\t\t'X-Service': 'webUI',\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tauth_method: authMethod,\n\t\t\tuser,\n\t\t\tpassword\n\t\t})\n\t});\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport { Row, Text, Input, Button, PasswordInput } from '@zextras/carbonio-design-system';\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n\tZM_AUTH_TOKEN,\n\tZIMBRA_PASSWORD_MAX_LENGTH_ATTR_NAME,\n\tZIMBRA_PASSWORD_MIN_LENGTH_ATTR_NAME,\n\tZIMBRA_PASSWORD_MIN_LOWERCASE_CHARS_ATTR_NAME,\n\tZIMBRA_PASSWORD_MIN_NUMERIC_CHARS_ATTR_NAME,\n\tZIMBRA_PASSWORD_MIN_PUNCTUATION_CHARS_ATTR_NAME,\n\tZIMBRA_PASSWORD_MIN_UPPERCASE_CHARS_ATTR_NAME,\n\tINVALID_PASSWORD_ERR_CODE,\n\tPASSWORD_RECENTLY_USED_ERR_CODE,\n\tBLOCK_PERSONAL_DATA_IN_PASSWORD_POLICY,\n\tBLOCK_COMMON_WORDS_IN_PASSWORD_POLICY,\n\tPASSWORD_LOCKED,\n\tZIMBRA_PASSWORD_MIN_DIGITS_OR_PUNCS\n} from '../constants';\nimport { saveCredentials, setCookie } from '../utils';\n\nexport const submitChangePassword = (username, oldPassword, newPassword) => {\n\treturn fetch('/service/soap/ChangePasswordRequest', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tcredentials: 'omit',\n\t\tbody: JSON.stringify({\n\t\t\tBody: {\n\t\t\t\tChangePasswordRequest: {\n\t\t\t\t\t_jsns: 'urn:zimbraAccount',\n\t\t\t\t\tcsrfTokenSecured: '1',\n\t\t\t\t\tpersistAuthTokenCookie: '1',\n\t\t\t\t\taccount: {\n\t\t\t\t\t\tby: 'name',\n\t\t\t\t\t\t_content: username\n\t\t\t\t\t},\n\t\t\t\t\toldPassword: {\n\t\t\t\t\t\t_content: oldPassword\n\t\t\t\t\t},\n\t\t\t\t\tpassword: {\n\t\t\t\t\t\t_content: newPassword\n\t\t\t\t\t},\n\t\t\t\t\tprefs: [{ pref: { name: 'zimbraPrefMailPollingInterval' } }]\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t});\n};\n\nconst ChangePasswordForm = ({ isLoading, setIsLoading, username, configuration }) => {\n\tconst [t] = useTranslation();\n\n\tconst [oldPassword, setOldPassword] = useState('');\n\tconst [newPassword, setNewPassword] = useState('');\n\tconst [confirmNewPassword, setConfirmNewPassword] = useState('');\n\tconst [showOldPasswordError, setShowOldPasswordError] = useState(false);\n\tconst [errorLabelNewPassword, setErrorLabelNewPassword] = useState(false);\n\tconst [errorLabelConfirmNewPassword, setErrorLabelConfirmNewPassword] = useState('');\n\n\tconst onChangeOldPassword = useCallback(\n\t\t(ev) => setOldPassword(ev.target.value),\n\t\t[setOldPassword]\n\t);\n\tconst onChangeNewPassword = useCallback(\n\t\t(ev) => setNewPassword(ev.target.value),\n\t\t[setNewPassword]\n\t);\n\tconst onChangeConfirmNewPassword = useCallback(\n\t\t(ev) => setConfirmNewPassword(ev.target.value),\n\t\t[setConfirmNewPassword]\n\t);\n\n\tuseEffect(() => {\n\t\tsetErrorLabelNewPassword('');\n\t\tsetErrorLabelConfirmNewPassword('');\n\t}, [newPassword, t]);\n\n\tuseEffect(() => {\n\t\tif (newPassword && confirmNewPassword !== newPassword) {\n\t\t\tsetErrorLabelConfirmNewPassword(\n\t\t\t\tt('changePassword_error_confirmPassword', 'Confirm password not valid')\n\t\t\t);\n\t\t} else {\n\t\t\tsetErrorLabelConfirmNewPassword('');\n\t\t}\n\t}, [confirmNewPassword, newPassword, t]);\n\n\tconst submitChangePasswordCb = useCallback(\n\t\t(e) => {\n\t\t\te.preventDefault();\n\t\t\tsetIsLoading(true);\n\t\t\tif (newPassword && confirmNewPassword === newPassword && !errorLabelNewPassword) {\n\t\t\t\tsubmitChangePassword(username, oldPassword, newPassword)\n\t\t\t\t\t.then(async (res) => {\n\t\t\t\t\t\tlet payload;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tpayload = await res.json();\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tpayload = await res;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (res.status === 200) {\n\t\t\t\t\t\t\tconst authTokenArr = payload?.Body?.ChangePasswordResponse?.authToken;\n\t\t\t\t\t\t\tconst authToken =\n\t\t\t\t\t\t\t\tauthTokenArr && authTokenArr.length > 0 ? authTokenArr[0]._content : undefined;\n\t\t\t\t\t\t\tif (authToken) {\n\t\t\t\t\t\t\t\tsetCookie(ZM_AUTH_TOKEN, authToken);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch (res.status) {\n\t\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\t\tawait saveCredentials(username, newPassword);\n\t\t\t\t\t\t\t\twindow.location.assign(configuration.destinationUrl);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\t\tcase 500:\n\t\t\t\t\t\t\t\tif (payload?.Body?.Fault?.Detail?.Error?.Code === INVALID_PASSWORD_ERR_CODE) {\n\t\t\t\t\t\t\t\t\tsetShowOldPasswordError(false);\n\t\t\t\t\t\t\t\t\tconst { a } = payload.Body.Fault.Detail.Error;\n\t\t\t\t\t\t\t\t\tlet currNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === BLOCK_COMMON_WORDS_IN_PASSWORD_POLICY)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_block_common_words', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue:\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Invalid password: password is known to be too common: {{str}}',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { str: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === BLOCK_PERSONAL_DATA_IN_PASSWORD_POLICY)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_block_personal_data', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue:\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Invalid password: password contains username or other personal data: {{str}}',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { str: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MAX_LENGTH_ATTR_NAME)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_maxLength', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Maximum length is {{num}} characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MIN_LENGTH_ATTR_NAME)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_minLength', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Minimum length is {{num}} characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MIN_LOWERCASE_CHARS_ATTR_NAME)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_minLowerCaseChars', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Expecting at least {{num}} lowercase characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MIN_NUMERIC_CHARS_ATTR_NAME)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_minNumericChars', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Expecting at least {{num}} numeric characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MIN_PUNCTUATION_CHARS_ATTR_NAME)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_minPunctuationChars', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Expecting at least {{num}} punctuation characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MIN_UPPERCASE_CHARS_ATTR_NAME)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_minUppercaseChars', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Expecting at least {{num}} uppercase characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\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\tcurrNum = a\n\t\t\t\t\t\t\t\t\t\t? a.find((rec) => rec.n === ZIMBRA_PASSWORD_MIN_DIGITS_OR_PUNCS)\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (currNum) {\n\t\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\t\tt('changePassword_error_minDigitsOrPuncs', {\n\t\t\t\t\t\t\t\t\t\t\t\tdefaultValue:\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Expecting at least {{num}} numeric or punctuation characters',\n\t\t\t\t\t\t\t\t\t\t\t\treplace: { num: currNum._content }\n\t\t\t\t\t\t\t\t\t\t\t})\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} else if (payload?.Body?.Fault?.Detail?.Error?.Code === PASSWORD_LOCKED) {\n\t\t\t\t\t\t\t\t\tsetShowOldPasswordError(false);\n\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\tt('changePassword_error_passwordLocked', {\n\t\t\t\t\t\t\t\t\t\t\tdefaultValue: \"Password is locked and can't be changed\"\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} else if (\n\t\t\t\t\t\t\t\t\tpayload?.Body?.Fault?.Detail?.Error?.Code === PASSWORD_RECENTLY_USED_ERR_CODE\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tsetShowOldPasswordError(false);\n\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\t\tt('changePassword_error_passwordRecentlyUsed', {\n\t\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Password recently used'\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} else {\n\t\t\t\t\t\t\t\t\tsetShowOldPasswordError(true);\n\t\t\t\t\t\t\t\t\tsetErrorLabelNewPassword('');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 502:\n\t\t\t\t\t\t\t\tsetShowOldPasswordError(false);\n\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\tt('server_unreachable', 'Error 502: Service Unreachable - Retry later.')\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tsetShowOldPasswordError(false);\n\t\t\t\t\t\t\t\tsetErrorLabelNewPassword(\n\t\t\t\t\t\t\t\t\tt('changePassword_error_minLowerCaseChars', {\n\t\t\t\t\t\t\t\t\t\tdefaultValue: 'Expecting at least {{num}} lowercase characters',\n\t\t\t\t\t\t\t\t\t\treplace: { num: 6 }\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\tsetIsLoading(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch((err) => {\n\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t\tif (err.message.startsWith('authentication failed')) {\n\t\t\t\t\t\t\tsetShowOldPasswordError(true);\n\t\t\t\t\t\t\tsetErrorLabelNewPassword('');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\t\t\tsetIsLoading(false);\n\t\t},\n\t\t[\n\t\t\tt,\n\t\t\tsetIsLoading,\n\t\t\tnewPassword,\n\t\t\tconfirmNewPassword,\n\t\t\terrorLabelNewPassword,\n\t\t\tusername,\n\t\t\toldPassword,\n\t\t\tconfiguration.destinationUrl\n\t\t]\n\t);\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{t('changePassword_title', 'Create a new password')}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{showOldPasswordError && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{t('wrong_password', 'Wrong password, please check data and try again')}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{errorLabelNewPassword && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{errorLabelNewPassword}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{errorLabelConfirmNewPassword && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{errorLabelConfirmNewPassword}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\nexport default ChangePasswordForm;\n","/*\n * SPDX-FileCopyrightText: 2023 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\nimport React, { useCallback, useContext, useState } from 'react';\nimport {\n\tRow,\n\tText,\n\tInput,\n\tButton,\n\tContainer,\n\tSnackbarManagerContext\n} from '@zextras/carbonio-design-system';\nimport { Trans, useTranslation } from 'react-i18next';\nimport {\n\tgetRecoveryAccount,\n\tgetSendRecoveryCode,\n\tvalidateRecoveryCode\n} from '../services/forget-password-service';\nimport { ZM_AUTH_TOKEN } from '../constants';\nimport { setCookie } from '../utils';\n\nconst urlParams = new URLSearchParams(window.location.search);\n\nconst state = {\n\tretrieveRecoveryEmail: 'retrieve-recovery-email',\n\tsendRecoveryCode: 'send-recovery-code',\n\tvalidateRecoveryCode: 'validate-recovery-code',\n\tproceedToLoginScreen: 'proceed-to-login-screen'\n};\n\nconst ForgetPassword = ({ configuration, disableInputs }) => {\n\tconst [t] = useTranslation();\n\tconst [username, setUsername] = useState(urlParams.get('username') || '');\n\tconst [progress, setProgress] = useState(state.retrieveRecoveryEmail);\n\tconst [code, setCode] = useState('');\n\tconst [recoveryEmail, setRecoveryEmail] = useState('');\n\tconst [showRecoveryEmailError, setShowRecoveryEmailError] = useState(false);\n\tconst [showSendCodeError, setShowSendCodeError] = useState(false);\n\tconst [showValidationCodeError, setShowValidationCodeError] = useState(false);\n\tconst [recoveryAttemptsLeft, setRecoveryAttemptsLeft] = useState();\n\tconst createSnackbar = useContext(SnackbarManagerContext);\n\n\tconst onRetrieveRecoveryEmail = useCallback(() => {\n\t\tgetRecoveryAccount(username)\n\t\t\t.then(async (res) => {\n\t\t\t\tlet payload;\n\t\t\t\ttry {\n\t\t\t\t\tpayload = await res.json();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tpayload = await res;\n\t\t\t\t}\n\t\t\t\tif (res.status === 200) {\n\t\t\t\t\tconst email = payload?.Body?.RecoverAccountResponse?.recoveryAccount;\n\t\t\t\t\tsetRecoveryEmail(email);\n\t\t\t\t\tsetProgress(state.sendRecoveryCode);\n\t\t\t\t} else {\n\t\t\t\t\tsetShowRecoveryEmailError(true);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tsetShowRecoveryEmailError(true);\n\t\t\t});\n\t}, [username]);\n\n\tconst onSendRecoveryCode = useCallback(() => {\n\t\tgetSendRecoveryCode(username)\n\t\t\t.then(async (res) => {\n\t\t\t\tlet payload;\n\t\t\t\ttry {\n\t\t\t\t\tpayload = await res.json();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tpayload = await res;\n\t\t\t\t}\n\t\t\t\tif (res.status === 200) {\n\t\t\t\t\tconst rAttemptLeft = payload?.Body?.RecoverAccountResponse?.recoveryAttemptsLeft;\n\t\t\t\t\tsetRecoveryAttemptsLeft(rAttemptLeft);\n\t\t\t\t\tcreateSnackbar({\n\t\t\t\t\t\tkey: 'success',\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\tlabel: t('recovery_code_send_success', 'The Recovery code has been send successfully'),\n\t\t\t\t\t\tautoHideTimeout: 3000,\n\t\t\t\t\t\thideButton: true,\n\t\t\t\t\t\treplace: true\n\t\t\t\t\t});\n\t\t\t\t\tsetProgress(state.validateRecoveryCode);\n\t\t\t\t} else {\n\t\t\t\t\tsetShowSendCodeError(true);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tsetShowSendCodeError(true);\n\t\t\t});\n\t}, [createSnackbar, t, username]);\n\n\tconst onValidateCode = useCallback(() => {\n\t\tvalidateRecoveryCode(username, code)\n\t\t\t.then(async (res) => {\n\t\t\t\tlet payload;\n\t\t\t\ttry {\n\t\t\t\t\tpayload = await res.json();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tpayload = await res;\n\t\t\t\t}\n\t\t\t\tif (res.status === 200) {\n\t\t\t\t\tconst authTokenArr = payload?.Body?.AuthResponse?.authToken;\n\t\t\t\t\tconst authToken =\n\t\t\t\t\t\tauthTokenArr && authTokenArr.length > 0 ? authTokenArr[0]._content : undefined;\n\t\t\t\t\tif (authToken) {\n\t\t\t\t\t\tsetCookie(ZM_AUTH_TOKEN, authToken);\n\t\t\t\t\t}\n\t\t\t\t\tsetProgress(state.proceedToLoginScreen);\n\t\t\t\t} else {\n\t\t\t\t\tsetShowValidationCodeError(true);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tsetShowValidationCodeError(true);\n\t\t\t});\n\t}, [code, username]);\n\n\tconst onProceedWithSession = useCallback(() => {\n\t\twindow.location.assign('/carbonio');\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t{progress !== state.proceedToLoginScreen && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === state.retrieveRecoveryEmail && (\n\t\t\t\t<>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{t(\n\t\t\t\t\t\t\t\t'enter_your_username_to_retrieve_recovery_email',\n\t\t\t\t\t\t\t\t'Please enter your username so we may retrieve the recovery email.'\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\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetUsername(e.target.value);\n\t\t\t\t\t\t\t\tsetShowRecoveryEmailError(false);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tautocomplete=\"username\"\n\t\t\t\t\t\t\thasError={showRecoveryEmailError}\n\t\t\t\t\t\t\tlabel={t('username', 'Username')}\n\t\t\t\t\t\t\tbackgroundColor=\"gray5\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t{showRecoveryEmailError && (\n\t\t\t\t\t\t\n\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\t'something_went_wrong',\n\t\t\t\t\t\t\t\t\t'Something went wrong. Please contact your administrator.'\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{t(\n\t\t\t\t\t\t\t\t'not_have_recovery_email_setup_note',\n\t\t\t\t\t\t\t\t'Don’t have a recovery email setup? Please contact your system administrator for support.'\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\t{progress === state.sendRecoveryCode && (\n\t\t\t\t<>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{ recovery_email }}?\"\n\t\t\t\t\t\t\t\tcomponents={{ bold: }}\n\t\t\t\t\t\t\t\tvalues={{ recovery_email: recoveryEmail }}\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{t(\n\t\t\t\t\t\t\t\t'send_a_recovery_code_notes',\n\t\t\t\t\t\t\t\t'Click on the button below to send a recovery code to that address, use it validate the next request.'\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\t{showSendCodeError && (\n\t\t\t\t\t\t\n\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\t'something_went_wrong',\n\t\t\t\t\t\t\t\t\t'Something went wrong. Please contact your administrator.'\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\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\t{progress === state.validateRecoveryCode && (\n\t\t\t\t<>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{ recovery_email }} and will be valid for 10 minutes. You have {{ recoveryAttemptsLeft }} more attempts. Enter the code in the form below.\"\n\t\t\t\t\t\t\t\tcomponents={{ bold: }}\n\t\t\t\t\t\t\t\tvalues={{\n\t\t\t\t\t\t\t\t\trecovery_email: recoveryEmail,\n\t\t\t\t\t\t\t\t\trecoveryAttemptsLeft\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\t\n\t\t\t\t\t\t setCode(e.target.value)}\n\t\t\t\t\t\t\tautocomplete=\"code\"\n\t\t\t\t\t\t\tlabel={t('code', 'Code')}\n\t\t\t\t\t\t\tbackgroundColor=\"gray5\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t{showValidationCodeError && (\n\t\t\t\t\t\t\n\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\t'something_went_wrong',\n\t\t\t\t\t\t\t\t\t'Something went wrong. Please contact your administrator.'\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\t\n\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\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{t(\n\t\t\t\t\t\t\t\t'resend_code_notes',\n\t\t\t\t\t\t\t\t'Don’t see the code in your inbox? Wait a couple of minutes or check your spam folder. If you still don’t see it please click on \"Resend Code\".'\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\t{progress === state.proceedToLoginScreen && (\n\t\t\t\t<>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{ username }}!\"\n\t\t\t\t\t\t\t\tcomponents={{ bold: }}\n\t\t\t\t\t\t\t\tvalues={{ username }}\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{t(\n\t\t\t\t\t\t\t\t'proceed_with_the_login_and_change_your_password',\n\t\t\t\t\t\t\t\t'You can proceed with the login, but remember to also change your password'\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\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};\nexport default ForgetPassword;\n","/*\n * SPDX-FileCopyrightText: 2021 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\nexport function getRecoveryAccount(username) {\n\treturn fetch('/service/soap/RecoverAccountRequest', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tcredentials: 'omit',\n\t\tbody: JSON.stringify({\n\t\t\tBody: {\n\t\t\t\tRecoverAccountRequest: {\n\t\t\t\t\t_jsns: 'urn:zimbraMail',\n\t\t\t\t\top: 'getRecoveryAccount',\n\t\t\t\t\temail: username,\n\t\t\t\t\tchannel: 'email'\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t});\n}\n\nexport function getSendRecoveryCode(username) {\n\treturn fetch('/service/soap/RecoverAccountRequest', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tcredentials: 'omit',\n\t\tbody: JSON.stringify({\n\t\t\tBody: {\n\t\t\t\tRecoverAccountRequest: {\n\t\t\t\t\t_jsns: 'urn:zimbraMail',\n\t\t\t\t\top: 'sendRecoveryCode',\n\t\t\t\t\temail: username,\n\t\t\t\t\tchannel: 'email'\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t});\n}\n\nexport function validateRecoveryCode(username, recoveryCode) {\n\treturn fetch('/service/soap/AuthRequest', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tcredentials: 'omit',\n\t\tbody: JSON.stringify({\n\t\t\tBody: {\n\t\t\t\tAuthRequest: {\n\t\t\t\t\t_jsns: 'urn:zimbraAccount',\n\t\t\t\t\tcsrfTokenSecured: '1',\n\t\t\t\t\taccount: {\n\t\t\t\t\t\tby: 'name',\n\t\t\t\t\t\t_content: username\n\t\t\t\t\t},\n\t\t\t\t\trecoveryCode: {\n\t\t\t\t\t\t_content: recoveryCode\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t});\n}\n","/* eslint-disable import/no-extraneous-dependencies */\n/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport {\n\tButton,\n\tCheckbox,\n\tInput,\n\tRow,\n\tSelect,\n\tSnackbar,\n\tText\n} from '@zextras/carbonio-design-system';\nimport { map } from 'lodash';\nimport React, { useCallback, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { postV2Login, submitOtp } from '../services/v2-service';\nimport { saveCredentials } from '../utils';\nimport ChangePasswordForm from './change-password-form';\nimport CredentialsForm from './credentials-form';\n\nimport OfflineModal from './modals';\nimport Spinner from './spinner';\nimport ForgetPassword from './forget-password';\n\nconst formState = {\n\tcredentials: 'credentials',\n\twaiting: 'waiting',\n\ttwoFactor: 'two-factor',\n\tchangePassword: 'change-password',\n\tforgetPassword: 'forget-password'\n};\n\nexport default function V2LoginManager({ configuration, disableInputs }) {\n\tconst [t] = useTranslation();\n\n\tconst [loadingCredentials, setLoadingCredentials] = useState(false);\n\tconst [loadingOtp, setLoadingOtp] = useState(false);\n\tconst [progress, setProgress] = useState(formState.credentials);\n\n\tconst [authError, setAuthError] = useState(false);\n\tconst [showOtpError, setShowOtpError] = useState(false);\n\n\tconst [otpList, setOtpList] = useState([]);\n\tconst [otpId, setOtpId] = useState('');\n\tconst [otp, setOtp] = useState('');\n\tconst onChangeOtp = useCallback(\n\t\t(ev) => {\n\t\t\tsetOtp(ev.target.value);\n\t\t},\n\t\t[setOtp]\n\t);\n\tconst [trustDevice, setTrustDevice] = useState(false);\n\tconst toggleTrustDevice = useCallback(() => setTrustDevice((v) => !v), [setTrustDevice]);\n\n\tconst [email, setEmail] = useState('');\n\tconst [loadingChangePassword, setLoadingChangePassword] = useState(false);\n\n\tconst [snackbarNetworkError, setSnackbarNetworkError] = useState(false);\n\tconst [detailNetworkModal, setDetailNetworkModal] = useState(false);\n\n\tconst submitCredentials = useCallback(\n\t\t(username, password) => {\n\t\t\tsetLoadingCredentials(true);\n\t\t\treturn postV2Login('password', username, password)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tswitch (res.status) {\n\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\tsetEmail(username);\n\t\t\t\t\t\t\tif (res.redirected) {\n\t\t\t\t\t\t\t\tsetProgress(formState.changePassword);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres.json().then(async (response) => {\n\t\t\t\t\t\t\t\t\tawait saveCredentials(username, password);\n\t\t\t\t\t\t\t\t\tif (response?.['2FA'] === true) {\n\t\t\t\t\t\t\t\t\t\tsetOtpList(\n\t\t\t\t\t\t\t\t\t\t\tmap(response?.otp ?? [], (obj) => ({\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: obj.label,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: obj.id\n\t\t\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tsetOtpId(response?.otp?.[0].id);\n\t\t\t\t\t\t\t\t\t\tsetProgress(formState.twoFactor);\n\t\t\t\t\t\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\twindow.location.assign(configuration.destinationUrl);\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\tbreak;\n\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'credentials_not_valid',\n\t\t\t\t\t\t\t\t\t'Credentials are not valid, please check data and try again'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 403:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'auth_not_valid',\n\t\t\t\t\t\t\t\t\t'The authentication policy needs more steps: please contact your administrator for more information'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 502:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt('server_unreachable', 'Error 502: Service Unreachable - Retry later.')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tsetSnackbarNetworkError(true);\n\t\t\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => setLoadingCredentials(false));\n\t\t},\n\t\t[configuration.destinationUrl, t]\n\t);\n\n\tconst submitOtpCb = useCallback(\n\t\t(e) => {\n\t\t\te.preventDefault();\n\t\t\tsetLoadingOtp(true);\n\t\t\tsubmitOtp(otpId, otp, trustDevice)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (res.status === 200) {\n\t\t\t\t\t\tif (res.redirected) {\n\t\t\t\t\t\t\tsetProgress(formState.changePassword);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.location.assign(configuration.destinationUrl);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetLoadingOtp(false);\n\t\t\t\t\t\tsetShowOtpError(true);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => setLoadingOtp(false));\n\t\t},\n\t\t[otpId, otp, trustDevice, configuration.destinationUrl]\n\t);\n\n\tconst onCloseCbk = useCallback(() => setDetailNetworkModal(false), [setDetailNetworkModal]);\n\tconst onSnackbarActionCbk = useCallback(\n\t\t() => setDetailNetworkModal(true),\n\t\t[setDetailNetworkModal]\n\t);\n\tconst onCloseSnackbarCbk = useCallback(\n\t\t() => setSnackbarNetworkError(false),\n\t\t[setSnackbarNetworkError]\n\t);\n\n\tconst onClickForgetPassword = useCallback(() => {\n\t\tsetProgress(formState.forgetPassword);\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t{progress === formState.credentials && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === formState.waiting && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === formState.twoFactor && (\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{t('two_step_authentication', 'Two-Step-Authentication')}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{showOtpError &&\n\t\t\t\t\t\t\t\tt('wrong_password', 'Wrong password, please check data and try again')}\n\t\t\t\t\t\t\t{!showOtpError &&
}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\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\t{progress === formState.changePassword && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === formState.forgetPassword && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","/*\n * SPDX-FileCopyrightText: 2021 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport { getDeviceModel, deviceId } from '../utils';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function postV2Login(authMethod, user, password, service) {\n\treturn fetch('/zx/auth/v2/login', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'X-Device-Model': getDeviceModel(),\n\t\t\t'X-Device-Id': deviceId(),\n\t\t\t'X-Service': 'WebUI',\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tauth_method: authMethod,\n\t\t\tuser,\n\t\t\tpassword\n\t\t})\n\t});\n}\n\nexport function submitOtp(id, code, trustDevice) {\n\treturn fetch('/zx/auth/v2/otp/validate', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'X-Device-Model': getDeviceModel(),\n\t\t\t'X-Device-Id': deviceId(),\n\t\t\t'X-Service': 'WebUI',\n\t\t\t'Content-Type': 'application/json',\n\t\t\tversion: '2'\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tid,\n\t\t\tcode,\n\t\t\tunsecure_device: !trustDevice\n\t\t})\n\t});\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport React, { useCallback, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Snackbar } from '@zextras/carbonio-design-system';\n\nexport default function ServerNotResponding() {\n\tconst [t] = useTranslation();\n\tconst [isOpen, setOpen] = useState(true);\n\tconst onCloseCbk = useCallback(() => setOpen(false), []);\n\n\treturn (\n\t\t\n\t);\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport React, { useEffect, useState } from 'react';\nimport V1LoginManager from './v1-login-manager';\nimport V2LoginManager from './v2-login-manager';\nimport { getAuthSupported, doAuthLogout } from '../services/auth-configuration-service';\nimport ServerNotResponding from '../components-index/server-not-responding';\nimport NotSupportedVersion from '../components-index/not-supported-version';\n\nexport default function FormSelector({ destinationUrl, domain }) {\n\tconst [configuration, setConfiguration] = useState(null);\n\tconst [error, setError] = useState(false);\n\tconst [disableInputs, setDisableInputs] = useState(true);\n\n\tuseEffect(() => {\n\t\tlet componentIsMounted = true;\n\n\t\tgetAuthSupported(domain)\n\t\t\t.then((res) => {\n\t\t\t\tif (componentIsMounted) {\n\t\t\t\t\tsetConfiguration((conf) => ({\n\t\t\t\t\t\t...conf,\n\t\t\t\t\t\t...res,\n\t\t\t\t\t\tdestinationUrl\n\t\t\t\t\t}));\n\t\t\t\t\tsetDisableInputs(false);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\t// It should never happen, If the server doesn't respond this page will not be loaded\n\t\t\t\tif (componentIsMounted) setError(true);\n\t\t\t});\n\t\treturn () => {\n\t\t\tcomponentIsMounted = false;\n\t\t};\n\t}, [destinationUrl, domain]);\n\n\tuseEffect(() => {\n\t\tconst urlParams = new URLSearchParams(window.location.search);\n\t\tif (configuration && urlParams.has('loginOp') && urlParams.get('loginOp') === 'logout') {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tdoAuthLogout(configuration).catch(() => console.log('Logout failed'));\n\t\t}\n\t}, [configuration]);\n\n\tif (error) return ;\n\n\tif (configuration === null || !configuration.destinationUrl) return
;\n\n\tif (configuration.maxApiVersion >= 2 && configuration.minApiVersion <= 2)\n\t\treturn ;\n\tif (configuration.maxApiVersion >= 1 && configuration.minApiVersion <= 1)\n\t\treturn ;\n\n\treturn ;\n}\n","/*\n * SPDX-FileCopyrightText: 2021 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nexport function getAuthSupported(domain) {\n\tconst urlParams = new URLSearchParams();\n\tif (domain) urlParams.append('domain', domain);\n\treturn fetch(`/zx/auth/supported?${urlParams}`, {\n\t\tmethod: 'GET'\n\t}).then((res) => {\n\t\tif (res.status === 200) return res.json();\n\t\tthrow Error('Notwork Error');\n\t});\n}\n\nexport function doAuthLogout(configuration) {\n\treturn fetch(`/zx/auth/v${configuration.maxApiVersion}/logout`, {\n\t\tmethod: 'GET'\n\t}).then((res) => {\n\t\tif (res.status !== 200) throw Error('Notwork Error');\n\t});\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport { useTranslation } from 'react-i18next';\nimport React, { useCallback, useState } from 'react';\n\nimport CredentialsForm from '../components-v1/credentials-form';\nimport ChangePasswordForm from '../components-v1/change-password-form';\nimport ForgetPassword from '../components-v1/forget-password';\n\nconst formState = {\n\tcredentials: 'credentials',\n\twaiting: 'waiting',\n\ttwoFactor: 'two-factor',\n\tchangePassword: 'change-password'\n};\n\nconst zimbraLogin = (username, password) => {\n\treturn fetch('/service/soap/AuthRequest', {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tBody: {\n\t\t\t\tAuthRequest: {\n\t\t\t\t\t_jsns: 'urn:zimbraAccount',\n\t\t\t\t\tcsrfTokenSecured: '1',\n\t\t\t\t\tpersistAuthTokenCookie: '1',\n\t\t\t\t\tgenerateDeviceId: '1',\n\t\t\t\t\taccount: {\n\t\t\t\t\t\tby: 'name',\n\t\t\t\t\t\t_content: username\n\t\t\t\t\t},\n\t\t\t\t\tpassword: {\n\t\t\t\t\t\t_content: password\n\t\t\t\t\t},\n\t\t\t\t\tprefs: [{ pref: { name: 'zimbraPrefMailPollingInterval' } }]\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t});\n};\n\nexport function ZimbraForm({ destinationUrl }) {\n\tconst { t } = useTranslation();\n\tconst [authError, setAuthError] = useState();\n\tconst [loading, setLoading] = useState(false);\n\tconst [progress, setProgress] = useState(formState.credentials);\n\tconst [loadingChangePassword, setLoadingChangePassword] = useState(false);\n\tconst [loadingCredentials, setLoadingCredentials] = useState(false);\n\tconst [email, setEmail] = useState('');\n\n\tconst submitCredentials = useCallback(\n\t\t(username, password) => {\n\t\t\tsetLoading(true);\n\t\t\tsetLoadingCredentials(true);\n\t\t\treturn zimbraLogin(username, password)\n\t\t\t\t.then(async (res) => {\n\t\t\t\t\tlet payload;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpayload = await res.json();\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tpayload = await res;\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\tsetEmail(username);\n\t\t\t\t\tif (payload?.Body?.Fault) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tpayload.Body.Fault?.Detail?.Error?.Code &&\n\t\t\t\t\t\t\tpayload.Body.Fault?.Detail?.Error?.Code === 'account.CHANGE_PASSWORD'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tsetProgress(formState.changePassword);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Error(payload.Body.Fault.Reason.Text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tswitch (res.status) {\n\t\t\t\t\t\tcase 200:\n\t\t\t\t\t\t\twindow.location.assign(destinationUrl || window.location.origin);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 401:\n\t\t\t\t\t\tcase 500:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'credentials_not_valid',\n\t\t\t\t\t\t\t\t\t'Credentials are not valid, please check data and try again'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 403:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t\t'auth_not_valid',\n\t\t\t\t\t\t\t\t\t'The authentication policy needs more steps: please contact your administrator for more information'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 502:\n\t\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\t\tt('server_unreachable', 'Error 502: Service Unreachable - Retry later.')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tsetLoading(false);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\tsetLoadingCredentials(false);\n\t\t\t\t\tif (err.message.startsWith('authentication failed'))\n\t\t\t\t\t\tsetAuthError(\n\t\t\t\t\t\t\tt(\n\t\t\t\t\t\t\t\t'credentials_not_valid',\n\t\t\t\t\t\t\t\t'Credentials are not valid, please check data and try again'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\telse setAuthError(err.message);\n\t\t\t\t});\n\t\t},\n\t\t[destinationUrl, t]\n\t);\n\n\tconst onClickForgetPassword = useCallback(() => {\n\t\tsetProgress(formState.forgetPassword);\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t{progress === formState.credentials && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === formState.changePassword && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t{progress === formState.forgetPassword && (\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t);\n}\n","export default __webpack_public_path__ + \"assets/67e4952b6e580669e1ed0c4b5b7c5fe3.svg\";","export default __webpack_public_path__ + \"assets/9a9d55fd81e4fd941cdda13d49a4d5eb.svg\";","/* eslint-disable import/no-extraneous-dependencies */\n/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport React, { useLayoutEffect, useState, useContext, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\nimport {\n\tCheckbox,\n\tContainer,\n\tModal,\n\tPadding,\n\tRow,\n\tText,\n\tIcon\n} from '@zextras/carbonio-design-system';\nimport { useTranslation, Trans } from 'react-i18next';\nimport { browserName } from 'react-device-detect';\nimport backgroundImage from '../../assets/carbonio_loginpage.jpg';\nimport backgroundImageRetina from '../../assets/carbonio_loginpage-retina.jpg';\nimport logoCarbonio from '../../assets/logo-carbonio.png';\nimport { getLoginConfig } from '../services/login-page-services';\nimport FormSelector from './form-selector';\nimport ServerNotResponding from '../components-index/server-not-responding';\nimport { ZimbraForm } from '../components-index/zimbra-form';\nimport playStore from '../../assets/play-store.svg';\nimport appStore from '../../assets/app-store.svg';\nimport { generateColorSet, prepareUrlForForward } from '../utils';\nimport { ThemeCallbacksContext } from '../theme-provider/theme-provider';\nimport {\n\tAPP_STORE_URL,\n\tCARBONIO_LOGO_URL,\n\tDESKTOP,\n\tMOBILE,\n\tPLAY_STORE_URL,\n\tCARBONIO_CE_SUPPORTED_BROWSER_LINK,\n\tCARBONIO_SUPPORTED_BROWSER_LINK,\n\tCHROME,\n\tFIREFOX\n} from '../constants';\nimport { useLoginConfigStore } from '../store/login/store';\nimport { useDarkReaderResultValue } from '../dark-mode/use-dark-reader-result-value';\nimport useScreenMode from '../components-index/use-screen-mode';\nimport { useGetPrimaryColor } from '../primary-color/use-get-primary-color';\nimport useIsTouchDevice from '../components-index/use-touch-device';\n\nconst LoginContainer = styled(Container)`\n\tpadding: 0 100px;\n\tbackground: url(${(props) => props.backgroundImage}) no-repeat 75% center/cover;\n\tjustify-content: center;\n\talign-items: flex-start;\n\t${({ screenMode }) =>\n\t\tscreenMode !== DESKTOP &&\n\t\tcss`\n\t\t\tpadding: 0 12px;\n\t\t\talign-items: center;\n\t\t`}\n\t${({ isDefaultBg }) =>\n\t\tisDefaultBg &&\n\t\tcss`\n\t\t\t@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {\n\t\t\t\tbackground: url(${backgroundImageRetina}) no-repeat 75% center/cover;\n\t\t\t}\n\t\t`}\n`;\n\nconst FormContainer = styled.div`\n\tmax-width: 100%;\n\tmax-height: 100vh;\n\tbox-shadow: 0px 0px 20px -7px rgba(0, 0, 0, 0.3);\n`;\n\nconst FormWrapper = styled(Container)`\n\twidth: auto;\n\theight: auto;\n\tbackground-color: ${({ theme }) => theme.palette.gray6.regular};\n\tpadding: 48px 48px 0;\n\twidth: 436px;\n\tmax-width: 100%;\n\tmin-height: 620px;\n\t// height: 100vh;\n\toverflow-y: auto;\n\t${({ screenMode }) =>\n\t\tscreenMode !== DESKTOP &&\n\t\tcss`\n\t\t\tpadding: 20px 20px 0;\n\t\t\twidth: 360px;\n\t\t\tmax-height: 100%;\n\t\t\theight: auto;\n\t\t`}\n`;\n\nfunction DarkReaderListener() {\n\tconst { setDarkReaderState } = useContext(ThemeCallbacksContext);\n\tconst darkReaderResultValue = useDarkReaderResultValue();\n\tuseEffect(() => {\n\t\tif (darkReaderResultValue) {\n\t\t\tsetDarkReaderState(darkReaderResultValue);\n\t\t}\n\t}, [darkReaderResultValue, setDarkReaderState]);\n\treturn null;\n}\n\nexport default function PageLayout({ version, hasBackendApi }) {\n\tconst [t] = useTranslation();\n\tconst [logo, setLogo] = useState(null);\n\tconst [serverError, setServerError] = useState(false);\n\n\tconst urlParams = new URLSearchParams(window.location.search);\n\tconst [destinationUrl, setDestinationUrl] = useState(\n\t\tprepareUrlForForward(urlParams.get('destinationUrl'))\n\t);\n\tconst [domain, setDomain] = useState(urlParams.get('domain') ?? destinationUrl);\n\n\tconst [bg, setBg] = useState(backgroundImage);\n\tconst [isDefaultBg, setIsDefaultBg] = useState(true);\n\tconst [editedTheme, setEditedTheme] = useState({});\n\tconst [copyrightBanner, setCopyrightBanner] = useState('');\n\tconst { setDarkReaderState } = useContext(ThemeCallbacksContext);\n\tconst { setDomainName } = useLoginConfigStore();\n\tconst [showModal, setShowModal] = useState(true);\n\tconst [showMobileAppModal, setShowMobileAppModal] = useState(true);\n\tconst [doNotShowAgain, setDoNotShowAgain] = useState(false);\n\tconst screenMode = useScreenMode();\n\tconst isTouchDevice = useIsTouchDevice();\n\n\tuseEffect(() => {\n\t\tconst storedState = localStorage.getItem('doNotShowMobileAppModal');\n\t\tif (storedState) {\n\t\t\tsetShowMobileAppModal(false);\n\t\t}\n\t}, []);\n\tconst primaryColor = useGetPrimaryColor();\n\tconst [isAdvanced, SetIsAdvanced] = useState(true);\n\tconst isSupportedBrowser = browserName === CHROME || browserName === FIREFOX;\n\n\tuseLayoutEffect(() => {\n\t\tlet componentIsMounted = true;\n\n\t\tif (hasBackendApi) {\n\t\t\tgetLoginConfig(version, domain, domain)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!destinationUrl) setDestinationUrl(prepareUrlForForward(res.publicUrl));\n\t\t\t\t\tif (!domain) setDomain(res.zimbraDomainName);\n\t\t\t\t\tsetDomainName(res.zimbraDomainName);\n\n\t\t\t\t\tconst _logo = {};\n\n\t\t\t\t\tif (componentIsMounted) {\n\t\t\t\t\t\tif (res.loginPageBackgroundImage) {\n\t\t\t\t\t\t\tsetBg(res.loginPageBackgroundImage);\n\t\t\t\t\t\t\tsetIsDefaultBg(false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (res.loginPageLogo) {\n\t\t\t\t\t\t\t_logo.image = res.loginPageLogo;\n\t\t\t\t\t\t\t_logo.width = '100%';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_logo.image = logoCarbonio;\n\t\t\t\t\t\t\t_logo.width = '221px';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (res.loginPageSkinLogoUrl) {\n\t\t\t\t\t\t\t_logo.url = res.loginPageSkinLogoUrl;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_logo.url = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (res.loginPageTitle) {\n\t\t\t\t\t\t\tdocument.title = res.loginPageTitle;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.title = t('carbonio_authentication', 'Carbonio Authentication');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (res.loginPageFavicon) {\n\t\t\t\t\t\t\tconst link =\n\t\t\t\t\t\t\t\tdocument.querySelector(\"link[rel*='icon']\") || document.createElement('link');\n\t\t\t\t\t\t\tlink.type = 'image/x-icon';\n\t\t\t\t\t\t\tlink.rel = 'shortcut icon';\n\t\t\t\t\t\t\tlink.href = res.loginPageFavicon;\n\t\t\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(link);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (res.loginPageColorSet) {\n\t\t\t\t\t\t\tconst colorSet = res.loginPageColorSet;\n\t\t\t\t\t\t\tif (colorSet.primary) {\n\t\t\t\t\t\t\t\tsetEditedTheme((et) => ({\n\t\t\t\t\t\t\t\t\t...et,\n\t\t\t\t\t\t\t\t\t'palette.primary': generateColorSet({\n\t\t\t\t\t\t\t\t\t\tregular: `#${colorSet.primary}`\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\tif (colorSet.secondary) {\n\t\t\t\t\t\t\t\tsetEditedTheme((et) => ({\n\t\t\t\t\t\t\t\t\t...et,\n\t\t\t\t\t\t\t\t\t'palette.secondary': generateColorSet({\n\t\t\t\t\t\t\t\t\t\tregular: `#${colorSet.secondary}`\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\n\t\t\t\t\t\tif (version === 3) {\n\t\t\t\t\t\t\tuseLoginConfigStore.setState(res);\n\t\t\t\t\t\t\t// In case of v3 API response\n\t\t\t\t\t\t\tif (res?.carbonioWebUiTitle) {\n\t\t\t\t\t\t\t\tdocument.title = res.carbonioWebUiTitle;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res?.carbonioWebUiFavicon) {\n\t\t\t\t\t\t\t\tconst link =\n\t\t\t\t\t\t\t\t\tdocument.querySelector(\"link[rel*='icon']\") || document.createElement('link');\n\t\t\t\t\t\t\t\tlink.type = 'image/x-icon';\n\t\t\t\t\t\t\t\tlink.rel = 'shortcut icon';\n\t\t\t\t\t\t\t\tlink.href = res.carbonioWebUiFavicon;\n\t\t\t\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(link);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res?.carbonioWebUiDarkMode) {\n\t\t\t\t\t\t\t\tif (res?.carbonioWebUiDarkLoginBackground) {\n\t\t\t\t\t\t\t\t\tsetBg(res.carbonioWebUiDarkLoginBackground);\n\t\t\t\t\t\t\t\t\tsetIsDefaultBg(false);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (res?.carbonioWebUiDarkLoginLogo) {\n\t\t\t\t\t\t\t\t\t_logo.image = res.carbonioWebUiDarkLoginLogo;\n\t\t\t\t\t\t\t\t\t_logo.width = '100%';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (res?.carbonioWebUiLoginBackground) {\n\t\t\t\t\t\t\t\t\tsetBg(res.carbonioWebUiLoginBackground);\n\t\t\t\t\t\t\t\t\tsetIsDefaultBg(false);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (res?.carbonioWebUiLoginLogo) {\n\t\t\t\t\t\t\t\t\t_logo.image = res.carbonioWebUiLoginLogo;\n\t\t\t\t\t\t\t\t\t_logo.width = '100%';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res?.carbonioWebUiDescription) {\n\t\t\t\t\t\t\t\tsetCopyrightBanner(res.carbonioWebUiDescription);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_logo.url = res?.carbonioLogoURL ? res.carbonioLogoURL : CARBONIO_LOGO_URL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetLogo(_logo);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t// It should never happen, If the server doesn't respond this page will not be loaded\n\t\t\t\t\tif (componentIsMounted) setServerError(true);\n\t\t\t\t});\n\t\t} else {\n\t\t\tsetLogo({ image: logoCarbonio, width: '221px', url: CARBONIO_LOGO_URL });\n\t\t\tdocument.title = t('carbonio_authentication', 'Carbonio Authentication');\n\t\t\tSetIsAdvanced(false);\n\t\t}\n\n\t\treturn () => {\n\t\t\tcomponentIsMounted = false;\n\t\t};\n\t}, [t, version, domain, destinationUrl, hasBackendApi, setDarkReaderState, setDomainName]);\n\n\tconst LinkText = (props) => {\n\t\tconst { to, children } = props || {};\n\t\treturn (\n\t\t\t\n\t\t\t\t{children}\n\t\t\t\n\t\t);\n\t};\n\n\tif (serverError) return ;\n\n\tif (logo) {\n\t\tconst logoHtml = (\n\t\t\t\n\t\t);\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{logo.url ? (\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t{logoHtml}\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\t\tlogoHtml\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\t{hasBackendApi ? (\n\t\t\t\t\t\t\t\n\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\t\n\t\t\t\t\t\t\t\n\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\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tsupported'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'Having troubles? Try a fully supported browser'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tcomponents={{\n\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t)\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\n\t\t\t\t\t\t\t{copyrightBanner ? (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{copyrightBanner}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tCopyright ©\n\t\t\t\t\t\t\t\t\t{` ${new Date().getFullYear()} Zextras, `}\n\t\t\t\t\t\t\t\t\t{t('all_rights_reserved', 'All rights reserved')}\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\t{showMobileAppModal && screenMode !== DESKTOP && isTouchDevice && (\n\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\tshowCloseIcon\n\t\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\t\tif (doNotShowAgain) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('doNotShowMobileAppModal', JSON.stringify(true));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetShowModal(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t Android and Iphone, download your version using the buttons below!\"\n\t\t\t\t\t\t\t\t\t\tcomponents={{ bold: }}\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\t\n\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\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\t\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tsetDoNotShowAgain(!doNotShowAgain);\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\t}\n\n\treturn null;\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\n\nimport { useCallback, useEffect, useState } from 'react';\nimport { DESKTOP, MOBILE, TABLET } from '../constants';\n\nexport default function useScreenMode() {\n\tconst check = useCallback((width) => {\n\t\tif (width < 1280) {\n\t\t\tif (width < 640) {\n\t\t\t\treturn MOBILE;\n\t\t\t}\n\t\t\treturn TABLET;\n\t\t}\n\t\treturn DESKTOP;\n\t}, []);\n\n\tconst [screenMode, setScreenMode] = useState(DESKTOP);\n\n\tuseEffect(() => {\n\t\tconst handleResize = () => {\n\t\t\tsetScreenMode(check(window.innerWidth));\n\t\t};\n\t\thandleResize();\n\t\twindow.addEventListener('resize', handleResize);\n\t\treturn () => {\n\t\t\twindow.removeEventListener('resize', handleResize);\n\t\t};\n\t}, [check]);\n\n\treturn screenMode;\n}\n","/*\n * SPDX-FileCopyrightText: 2022 Zextras \n *\n * SPDX-License-Identifier: AGPL-3.0-only\n */\nimport { useState, useEffect } from 'react';\n\nfunction useIsTouchDevice() {\n\tconst [isTouchDevice, setIsTouchDevice] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst mediaQuery = window.matchMedia('(pointer:coarse)');\n\n\t\tconst handleMediaChange = () => {\n\t\t\tsetIsTouchDevice(mediaQuery.matches);\n\t\t};\n\n\t\t// Initial check\n\t\thandleMediaChange();\n\n\t\t// Listen for changes\n\t\tmediaQuery.addEventListener('change', handleMediaChange);\n\n\t\t// Cleanup\n\t\treturn () => {\n\t\t\tmediaQuery.removeEventListener('change', handleMediaChange);\n\t\t};\n\t}, []);\n\n\treturn isTouchDevice;\n}\n\nexport default useIsTouchDevice;\n"],"sourceRoot":""}