{"version":3,"sources":["components/UI/Buttons/Button.module.css","../node_modules/typescript/lib sync","components/API/APIRequest.js","i18n.js","components/Utilities/Loading.js","components/Configuration/ConfigurationManager.js","Client.js","components/Layout/AbacusFooter/FooterBranding.js","components/Layout/AbacusFooter/AbacusFooter.js","components/Layout/AbacusHeader/HeaderBranding.js","components/Layout/AbacusHeader/AbacusHeader.js","components/Utilities/ErrorBox.js","components/Utilities/TokenManager.js","components/Utilities/ADFECookie.js","components/Authentication/Auth0/Auth0ADInterface.js","components/Authentication/Auth0/Auth0EmbeddedAuthenticationProvider.js","components/Authentication/Auth0/Auth0UniversalAuthenticationProvider.js","components/Authentication/Account/ADNativeAuthenticationProvider.js","components/Authentication/AuthenticationProvider.js","components/UI/MessageBox/MessageBox.js","components/UI/ErrorBox/GenericErrorBox.js","components/Layout.js","components/Webactivity/LogWebActivity.js","components/UI/Buttons/ButtonSvg.js","components/UI/Buttons/ButtonSvgDark.js","components/UI/Buttons/UpdatedButton.js","components/UI/Buttons/UpdatingButton.js","components/UI/Buttons/Button.js","components/UI/ErrorBox/ErrorBox.js","components/UI/Transition/Transition.js","components/Authentication/Auth0/SocialConnections/SocialConnections.js","components/Utilities/SafeUrl.js","Hooks/useBodyClass.js","Hooks/usePageTitle.js","components/UI/Inputs/InputWrapperRefacture.js","Hooks/useCreateUrl.js","Hooks/useBrandingData.js","components/Utilities/EmailRegex.js","components/Authentication/Login/LoginAuth.js","components/Authentication/Login.js","components/Authentication/Logout.js","components/Authentication/Auth0/Auth0Callback.js","components/UI/Inputs/InputNew.js","components/UI/Inputs/InputWrapper.js","components/UI/Checkbox/Checkbox.js","components/Utilities/SetStateAsync.js","components/Authentication/PasswordValidations/PasswordValidations.js","components/Utilities/RecaptchaError.js","components/UI/SurveyForms/SurveyForm.js","components/Authentication/Register/Register.js","components/Authentication/UpdateEmail/UpdateEmail.js","components/Authentication/UpdatePassword/UpdatePassword.js","components/Authentication/ForgottenPassword/ForgottenPassword.js","components/Authentication/WarningComponent/WarningComponent.js","components/UI/DesignReview/DesignReview.js","components/Authentication/ResetPassword/ResetPassword.js","components/Caching/ClearCache.js","components/Redirection/Redirection.js","components/Test/Test.js","DynamicScriptComponent.js","App.js","serviceWorkerRegistration.js","reportWebVitals.js","index.js"],"names":["module","exports","webpackEmptyContext","req","e","Error","code","keys","resolve","id","APIGet","props","Promise","reject","apiUrl","APIUrl","data","URLSearchParams","toString","axios","method","url","headers","apiConfig","secret","then","response","catch","error","APIPost","contentTypeHeader","content_type","APIRedirect","window","location","href","protocol","host","port","hostname","developmentapiport","controller","String","action","environment","identifier","getEnvironment","path","pathname","length","nextSegmentIndex","substring","indexOf","environmentCandidate","getPage","page","lastIndexOf","language","sessionStorage","getItem","result","console","log","success","localStorage","setItem","langVer","errors","lver","lpathremote","i18n","use","ChainedBackend","initReactI18next","init","lng","backend","backends","LocalStorageBackend","Backend","backendOptions","prefix","expirationTime","defaultVersion","store","loadPath","fallbackLng","debug","ns","defaultNS","keySeparator","interpolation","escapeValue","formatSeparator","react","wait","Loading","loading","_jsx","className","class","children","GetConfiguration","configurationName","sessionKey","setting","configuration","JSON","parse","stringify","Client","client","setClient","useState","GetClient","content","_jsxs","FooterBranding","footerData","brandingFooter","Fragment","ReactHtmlParser","AbacusFooter","brandFooter","HeaderBranding","headerHtml","brandingHeader","AbacusHeader","brandHeader","ProcessErrors","errorList","ProcessError","push","startsWith","constructor","Array","i","GetADToken","tokenString","SaveADToken","userToken","RemoveADToken","clear","GetAuth0TokenLocal","auth0Token","SaveAuth0Token","RemoveAuth0Token","removeItem","SaveCookie","cookiename","cookievalue","domain","expiresDays","frontendloginpersistencedays","currentDate","Date","expiresDate","setDate","getDate","cookie","toISOString","endsWith","document","GetCookieName","cookieName","frontendcookiename","DeleteCookie","name","AutologinAPI","bodyFormData","FormData","append","reftoken","user","frontendCookieName","frontendCookieValue","frontendCookieDomain","userfullname","partyid","username","GetAuth0UserByEmail","email","encodeURIComponent","auth0response","unexpected","useProvideEmbeddedAuth","isLoading","setIsLoading","userData","setUserData","setErrors","webAuth","setWebAuth","setEnvironment","currentAction","setCurrentAction","returnUrl","setReturnUrl","params","Proxy","search","get","searchParams","getUserToken","refToken","refParam","token","authenticationprovidertype","pop","aerrors","cerrors","wa","auth0","WebAuth","customDomain","clientID","clientId","responseMode","responseType","scope","webauthErrors","sessionToken","authProviderType","ReturnUrl","URL","retUrl","referrer","_response$data","_response$data$brand","brand","returnurl","PassThruUrl","ForwardPage","CheckEmail","status","Login","password","login","realm","async","access_token","accessToken","refresh_token","refreshToken","id_token","idToken","expires_in","expiresIn","token_type","axresponse","axresult","ad_ref_token","axerror","Logout","formData","ClearAuth0Tokens","origin","callBack","logout","returnTo","GetADRefToken","GetLoginData","loginData","GetSocialConnections","connections","ClearUserData","SendForgottenPasswordLink","axiosErrors","ValidatePasswordResetToken","forEach","ResetPassword","newPassword","Auth0EmbeddedAuthenticationProvider","AuthContext","auth","Provider","value","useProvideUniversalAuth","GotoUniversalLogin","CheckRegisteredAccount","Auth0UniversalAuthenticationProvider","useProvideADNativeAuth","fallbackUrl","brandhostname","inuse","Username","Password","ADNativeAuthenticationProvider","React","createContext","AuthenticationProvider","setConfiguration","useAuth","useContext","MessageBox","messageState","GenericErrorBox","useEffect","t","useTranslation","map","universal","Layout","_props$brandingData","_props$brandingData2","brandingData","headerData","role","LogWebActivity","logged","setLogged","useParams","logWebActivity","ButtonSvg","xmlns","width","height","viewBox","transform","d","fill","ButtonSvgDark","UpdatedButton","UpdatingButton","style","marginBottom","opacity","stroke","Button","isDisabled","disabled","buttonType","btnType","hasIcon","hasOnlyIcon","btnSize","buttonSize","txtName","classes","buttonIcon","ErrorBox","Transition","_ref","timer","mountAnimation","containerClass","mountState","setMountState","setTimeout","undefined","SocialConnections","onclick","displayData","connection","onClick","strategy","_Fragment","IsSafeUrl","urlString","currentHost","IsSameSite","IsBrandDomain","cookiedomain","trusted","IsTrustedHost","RedirectWarning","isNotTrusted","format","addBodyClass","body","classList","add","removeBodyClass","remove","useBodyClass","usePageTitle","title","documentDefined","originalTitle","useRef","current","InputWrapperRefacture","forwardRef","ref","description","edit","inputSize","text","label","btnText","optionalField","setButtonEvent","helpField","inputFieldType","route","onClickFunction","showHelp","setShowHelp","showDetails","setShowDetails","showPassword","setShowPassword","editable","setEditable","inputType","setInputType","inputWidth","helpLinkHandler","preventDefault","inputText","labelField","htmlFor","specs","invalidClass","type","onMouseDown","Link","to","useCreateUrl","env","destination","useBrandingData","brandData","setBranding","getBrandedHtml","brandKey","tempText","_tempText","replace","dangerouslySetInnerHTML","__html","emailRegexUtils","nameRegexUtils","LoginAuth","_props$brandingElemen","_props$brandingElemen2","_props$brandingElemen3","_props$brandingElemen4","_props$brandingElemen5","_props$brandingElemen6","_props$brandingElemen7","_props$brandingElemen8","_props$brandingElemen9","_props$brandingElemen10","setIsNotTrusted","setIsDisabled","isInactive","setIsInactive","enteredEmailTouched","setEnteredEmailTouched","IsEmailInvalid","setIsEmailInvalid","IsEmailBlank","setIsEmailBlank","buttonEvent","IsBlank","setIsBlank","socialConnections","setSocialConnections","nextAction","setNextAction","buttonState","setButtonState","userPassword","setUserPassword","emailValid","setEmailValid","inputRef","headerRef","formRef","combNotMatches","setCombNotMatches","createUrl","navigate","useNavigate","useLocation","step","userEmail","setUserEmail","resetLinkEmail","isEditTrue","setIsEditTrue","brandingElement","emailRegex","_headerRef$current","focus","Validated","validated","passwordValue","emailValue","temp","split","localPart","match","focusOnFirstError","_formRef$current","firstElement","querySelectorAll","emailInputIsValid","isValid","passwordRow","bodyClass","pageTitle","showBtnText","hideBtnText","onBlur","getElementById","handleOnBlur","onChange","target","ErrorBoxCS","_inputRef$current","termsText","titleEdit","chooseError","tabIndex","onSubmit","event","loginResult","toLowerCase","placeholder","val","onKeyPress","key","readOnly","mailValidError","passThruUrl","dataset","_props$brandingLogin","providerType","setProviderType","NotFound","setNotFound","brandingLogin","currentOperation","setCurrentOperation","canRedirect","redirectToLoginUrl","Auth0Callback","state","ProcessUniversalAuthentication","returnUri","InputNew","altText","typeInThree","filled","setFilled","get_Radio_Input","get_Text_Input","valid","basicInputUI","InputWrapper","details","btnHandler","helpText","subscriptionAmount","subscriptionPeriod","radio_and_checkbox_input","toggle_switch","radio_input_with_altText","radio_input_with_description","radio_input_with_border","text_input_with_button","password_input_with_button","text_input_with_help","maxWidth","getHelpTextUI","text_input_for_details","text_input","checkbox_input_for_amount","getInputUIForSpecs","getInputUIForType","Checkbox","setStateAsync","callback","sent","setSent","passwordRules","setPasswordRules","passwordCounts","setPasswordCounts","upper","lower","digit","special","pswStatus","setPswStatus","pswError","setPswError","focused","setFocused","getPswRuleUI","ruleText","iconClass","isPasswordValid","pc","minlength","setPswValid","passwordrules","newpassword","onFocus","psw","updatedCounts","borderLeft","RecaptchaError","Serializer","addProperty","SurveyForm","surveyCode","surveyData","setSurveyData","isHandling","handleValueChanged","sender","options","originalField","question","getQuestionByName","setValue","adOtherValue","isArray","includes","filter","handleLoadChoicesFromServer","survey","dataEndpoint","choices","item","setItems","total","loaded","waitForResult","surveyModel","Model","onValueChanged","onChoicesLazyLoad","InlineForms","useImperativeHandle","validateSurvey","validate","getSurveyData","prefixAnswers","getAllQuestions","q","getType","answerCode","Survey","model","Register","checking","setChecking","fieldChanged","setFieldChanged","firstName","setFirstName","lastName","setLastName","dpa","setDpa","cleanDpaQuestionHtml","setCleanDpaQuestionHtml","registered","setRegistered","pswValid","isChecked","setIsChecked","IsInvalid","setIsInvalid","isDpaQuestionTextBlank","setIsDpaQuestionTextBlank","dpaValidationConfig","setDpaValidationConfig","reCaptchaError","setReCaptchaError","nameRegex","surveyRef","executeRecaptcha","useGoogleReCaptcha","surveycode","setSurveyCode","useSearchParams","surveycodeURLParam","handleReCaptchaVerify","useCallback","err","checkForDpaQuestionText","div","createElement","innerHTML","textContent","trim","cleanDpaText","cleanDpaHtml","DOMPurify","sanitize","ALLOWED_ATTR","dpaquestion","questiontext","defaultticked","loadDPA","getFrontendConfiguration","getCurrentBrandDefaultDemograpicsForm","useLayoutEffect","onTextFieldKeyed","fieldType","test","config","dpaValidationConfiguration","brandObj","GetCurrentBrand","brandRegistrationDemographicsDefaultForm","isHuman","hasRecaptcha","recaptchaToken","res","score","recaptchaVerified","userName","registerResult","checked","UpdateEmail","setLoginData","updateState","setUpdateState","changeEmailText","setChangeEmailText","GotoReturnUrl","updateUser","updateAccountResult","onPasswordChanged","changeEmailText1","changeEmailText2","getContent","user_id","from","UpdatePassword","oldpassword","setOldPassword","setNewPassword","changePasswordText","ForgottenPassword","errorState","setErrorState","WarningComponent","htmlString","disabledUserErrorText","DesignReview","Input","errorMessage","tokenValidated","setTokenValidated","passwordReset","setPasswordReset","ClearCache","cacheCleared","setCacheCleared","Redirection","Test","DynamicScriptComponent","metaData","branding","metaScriptsAdded","setMetaScriptsAdded","brandingScriptsAdded","setBrandingScriptsAdded","extractingScript","scripts","tempDiv","scriptTags","getElementsByTagName","scriptContent","innerText","srcAttributeValue","getAttribute","scriptId","scriptType","executingScripts","element","pos","script","newScript","src","insertAdjacentElement","head","removingScripts","addedScripts","existingScript","querySelector","headHtmlScript","headHtml","afterBodyOpenScript","afterBodyOpenData","beforeBodyCloseScript","beforeBodyCloseData","partyMetaDataScript","partymetadata","basketMetaDataScript","basketmetadata","App","reCaptchaKey","setReCaptchaKey","setMetaData","tagManager","tagManagerArgs","gtmId","TagManager","initialize","htmlHeadScript","br","htmlHead","modifiedHtml","insertAdjacentHTML","cssHeadScript","inlinecssHead","cssData","faviconCustom","favicon","link","_response$data$brandi","_response$data$brandi2","reCAPTCHAkey","loadheaderBranding","Suspense","fallback","Routes","Route","exact","GoogleReCaptchaProvider","scriptProps","Boolean","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","baseUrl","rootElement","ReactDOM","render","BrowserRouter","basename","navigator","serviceWorker","ready","registration","unregister","message"],"mappings":"+QACAA,EAAOC,QAAU,CAAC,oBAAoB,kCAAkC,eAAe,6BAA6B,mBAAmB,iCAAiC,iBAAiB,+B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OJ,GACPK,EAAOL,GACPM,EAAQN,EAAY,GAExB,ECCF,MAAMO,GAAUpqB,SAAS+lB,qBAAqB,QAAQ,GAAGI,aAAa,QAChEkE,GAAcrqB,SAASwV,eAAe,QAG5C8U,IAASC,OACLvuB,cAACwuB,IAAa,CAACC,SAAUL,GAAQjuB,SAC7BH,cAACY,EAAM,CAAAT,SACHH,cAACgM,GAAsB,CAAA7L,SACnBH,cAAC4rB,GAAG,UAIlByC,IFyGI,kBAAmBK,WACrBA,UAAUC,cAAcC,MACrBrzB,MAAMszB,IACLA,EAAaC,YAAY,IAE1BrzB,OAAOC,IACNiC,QAAQjC,MAAMA,EAAMqzB,QAAQ,IErGpCnB,I","file":"static/js/main.5b8ec1ac.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"tierchiary-button\":\"Button_tierchiary-button__5ItpE\",\"ghost-button\":\"Button_ghost-button__2oLTX\",\"secondary-button\":\"Button_secondary-button__1xLFA\",\"primary-button\":\"Button_primary-button__1wnMe\",\"large\":\"Button_large__3YLr7\",\"medium\":\"Button_medium__1uEOX\",\"small\":\"Button_small__1ZjLb\",\"hasOnlyIcon\":\"Button_hasOnlyIcon__5-RG9\",\"hasIcon\":\"Button_hasIcon__2R2_N\",\"buttonIcon\":\"Button_buttonIcon__1HoTZ\",\"disabled\":\"Button_disabled__nSd2V\"};","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 52;","import axios from 'axios';\r\nimport apiConfig from './apiconfig.json';\r\nexport { APIGet, APIPost, APIRedirect, getEnvironment, getPage, APIUrl };\r\nfunction APIGet(props) {\r\n return new Promise((resolve, reject) => {\r\n var apiUrl = APIUrl(props);\r\n if (props.data) {\r\n var params = new URLSearchParams(props.data).toString();\r\n apiUrl += \"?\" + params;\r\n }\r\n \r\n axios({\r\n method: \"get\",\r\n url: apiUrl,\r\n headers: {\r\n \"Authorization\": \"Bearer \" + apiConfig.secret\r\n },\r\n }).then((response) => {\r\n resolve(response);\r\n }).catch((error) => {\r\n reject(error);\r\n })\r\n });\r\n}\r\n\r\nfunction APIPost(props) {\r\n \r\n return new Promise((resolve, reject) => {\r\n var apiUrl = APIUrl(props);\r\n var contentTypeHeader = \"multipart/form-data\";\r\n if (props.content_type && props.content_type == \"json\") {\r\n contentTypeHeader = \"application/json\";\r\n }\r\n axios({\r\n method: \"post\",\r\n data: props.data,\r\n url: apiUrl,\r\n headers: {\r\n \"Content-Type\": contentTypeHeader,\r\n \"Authorization\": \"Bearer \" + apiConfig.secret\r\n },\r\n }).then((response) => {\r\n resolve(response);\r\n }).catch((error) => {\r\n reject(error);\r\n })\r\n });\r\n}\r\n\r\nfunction APIRedirect(props) {\r\n var apiUrl = APIUrl(props);\r\n if (props.data) {\r\n var params = new URLSearchParams(props.data).toString();\r\n apiUrl += \"?\" + params;\r\n }\r\n window.location.href = apiUrl;\r\n}\r\n\r\nfunction APIUrl(props) {\r\n\r\n var apiUrl = window.location.protocol + \"//\" + window.location.host;\r\n\r\n var port = window.location.port;\r\n // this stuff below is for local development environments\r\n if (port !== \"80\" && port !== \"443\" && port !== \"\") {\r\n apiUrl = window.location.protocol + \"//\" + window.location.hostname + \":\" + apiConfig.developmentapiport\r\n }\r\n\r\n // back to the regular things\r\n var controller = new String(props.controller);\r\n var action = new String(props.action);\r\n apiUrl += \"/api/\" + controller;\r\n if (props.environment) {\r\n apiUrl += \"/\" + props.environment;\r\n }\r\n apiUrl += \"/\" + action;\r\n if (props.identifier) {\r\n apiUrl += \"/\" + props.identifier;\r\n }\r\n return apiUrl;\r\n}\r\n\r\nfunction getEnvironment() {\r\n var path = window.location.pathname;\r\n var environment = null;\r\n if (path.length > 1) {\r\n path = path.substring(1);\r\n var nextSegmentIndex = path.indexOf(\"/\");\r\n if (nextSegmentIndex > 0) {\r\n var environmentCandidate = path.substring(0, nextSegmentIndex);\r\n if (environmentCandidate.indexOf(\".\") > 0) {\r\n environment = environmentCandidate;\r\n }\r\n }\r\n }\r\n return environment;\r\n}\r\n\r\nfunction getPage() {\r\n let path = window.location.pathname;\r\n let page = path;\r\n if (path.length > 1) {\r\n path = path.substring(1);\r\n page = path;\r\n var nextSegmentIndex = path.lastIndexOf(\"/\");\r\n if (nextSegmentIndex > 0) {\r\n page = path.substring(nextSegmentIndex+1); \r\n }\r\n }\r\n return page;\r\n}\r\n","import i18n from 'i18next'\r\nimport Backend from 'i18next-http-backend';\r\nimport ChainedBackend from 'i18next-chained-backend'\r\nimport LocalStorageBackend from 'i18next-localstorage-backend'; // load from local storage\r\nimport { initReactI18next } from 'react-i18next';\r\n\r\nimport { APIGet, getEnvironment, APIUrl } from './components/API/APIRequest';\r\n\r\nvar language = sessionStorage.getItem('language');\r\nconst environment = getEnvironment();\r\n\r\nvar acn = 'getlanguagefilever/translations/en';\r\n\r\nAPIGet({\r\n \"controller\": \"brand\",\r\n \"action\": acn,\r\n \"environment\": environment\r\n}).then((response) => {\r\n var result = response.data;\r\n console.log(result);\r\n if (result.success) {\r\n localStorage.setItem(\"i18next_ver_adfev2\", result.langVer);\r\n console.log('local storage lver set');\r\n }\r\n else {\r\n console.log(result.errors);\r\n }\r\n}).catch((error) => {\r\n console.log(error);\r\n});\r\n\r\nvar lver = localStorage.getItem('i18next_ver_adfev2');\r\nif (lver === null)\r\n lver = '20240101000000';\r\n\r\nvar lpathremote = APIUrl({\r\n \"controller\": \"brand\",\r\n \"action\": \"getlanguagefile\",\r\n \"environment\": environment,\r\n});\r\nlpathremote = lpathremote + '/{{ns}}/{{lng}}';\r\n\r\ni18n\r\n .use(ChainedBackend)\r\n .use(initReactI18next)\r\n .init({\r\n lng: language,\r\n backend: {\r\n backends: [\r\n LocalStorageBackend, // primary\r\n Backend // fallback\r\n ],\r\n backendOptions: [{\r\n prefix: 'i18next_adfev2_',\r\n //expiration in ms (ie 7 days is 7*24*60*60*1000)\r\n expirationTime: 7*24*60*60*1000,\r\n defaultVersion: lver,\r\n // can be either window.localStorage or window.sessionStorage. Default: window.localStorage\r\n store: typeof window !== 'undefined' ? window.localStorage : null\r\n }, {\r\n loadPath: lpathremote // http api load path for my own fallback\r\n }]\r\n },\r\n fallbackLng: 'en',\r\n debug: true,\r\n ns: ['translations'],\r\n defaultNS: 'translations',\r\n keySeparator: false,\r\n interpolation: {\r\n escapeValue: false,\r\n formatSeparator: ','\r\n },\r\n react: {\r\n wait: true\r\n }\r\n });\r\n\r\nexport default i18n\r\n","import { useTranslation } from 'react-i18next';\r\nimport '../../i18n'\r\nexport function Loading(props) {\r\n //const { t, i18n } = useTranslation();\r\n if (!props.loading) {\r\n return ('')\r\n }\r\n //return ({t('global.loading')});\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n}","import { APIGet } from '../API/APIRequest';\r\n\r\nexport function GetConfiguration (configurationName, environment) {\r\n return new Promise((resolve, reject) => {\r\n let sessionKey = environment ?? \"host\";\r\n sessionKey += \"_\" + configurationName;\r\n var setting = sessionStorage.getItem(sessionKey);\r\n var configuration = null;\r\n if (!setting) { \r\n APIGet({\r\n \"controller\": \"configuration\",\r\n \"action\": configurationName,\r\n \"environment\": environment\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n configuration = result.configuration;\r\n sessionStorage.setItem(sessionKey, JSON.stringify(configuration));\r\n resolve(configuration);\r\n }\r\n else\r\n {\r\n reject(result.errors);\r\n }\r\n //return result.authprovidertype;\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }\r\n else {\r\n resolve(JSON.parse(setting));\r\n }\r\n });\r\n}\r\n\r\nexport function GetCurrentBrand(environment) {\r\n return new Promise((resolve, reject) => {\r\n let brand = null;\r\n let brandObj = sessionStorage.getItem(\"Brand_\" + environment);\r\n if (brandObj) {\r\n brand = JSON.parse(brandObj);\r\n }\r\n\r\n if (!brand) {\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getcurrentbrand\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n brand = result.brand;\r\n sessionStorage.setItem(\"Brand_\" + environment, JSON.stringify(brand));\r\n resolve(brand);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n //return result.authprovidertype;\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }\r\n else {\r\n resolve(brand);\r\n }\r\n });\r\n}\r\n\r\nexport function GetClient(environment) {\r\n return new Promise((resolve, reject) => {\r\n var client = sessionStorage.getItem(\"Client_\" + environment);\r\n \r\n if (!client) {\r\n APIGet({\r\n \"controller\": \"configuration\",\r\n \"action\": \"getclient\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n client = result.client;\r\n sessionStorage.setItem(\"Client_\" + environment, client);\r\n resolve(client);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n //return result.authprovidertype;\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }\r\n else {\r\n resolve(client);\r\n }\r\n });\r\n}\r\n\r\n//export { useConfiguration };\r\n ","import React, { useState, Suspense } from 'react';\r\nimport { Loading } from './components/Utilities/Loading'\r\nimport { getEnvironment } from './components/API/APIRequest'\r\nimport {GetClient} from './components/Configuration/ConfigurationManager'\r\nconst Client = props => {\r\n const [client, setClient] = useState(null);\r\n var environment = getEnvironment();\r\n GetClient(environment).then((response) => {\r\n setClient(response);\r\n }).catch((error) => {\r\n setClient(\"none\");\r\n });\r\n\r\n var content = '';\r\n if (client) {\r\n if (client !== \"none\") {\r\n content = props.children;\r\n }\r\n else {\r\n content =

No Configuration

No configuration can be found for {(environment ? environment : window.location.host)}
\r\n }\r\n }\r\n \r\n return (
\r\n \r\n {content}\r\n
)\r\n}\r\n\r\nexport default Client;","import React, { useState, Fragment } from \"react\";\r\nimport ReactHtmlParser from 'html-react-parser';\r\n\r\nconst FooterBranding = props => {\r\n const footerData = props?.brandingFooter || '';\r\n return (\r\n \r\n {ReactHtmlParser(footerData)} \r\n \r\n )\r\n }\r\nexport default FooterBranding;\r\n\r\n","import { useParams, Link } from 'react-router-dom'\r\nimport React, { useState, useEffect } from \"react\";\r\nimport { APIUrl, APIWithEnvironmentUrl, getEnvironment } from '../../Utilities/APIUrl';\r\nimport FooterBranding from \"./FooterBranding\";\r\n\r\nconst AbacusFooter = props => {\r\n \r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\n\r\nexport default AbacusFooter;","import React, { useState, Fragment } from \"react\";\r\nimport ReactHtmlParser from 'html-react-parser';\r\n\r\nconst HeaderBranding = props => {\r\n const headerHtml = props?.brandingHeader || '';\r\n return (\r\n \r\n {ReactHtmlParser(headerHtml)}\r\n \r\n )\r\n }\r\nexport default HeaderBranding;\r\n\r\n","import { useParams, Link } from 'react-router-dom'\r\nimport React, { useState, useEffect } from \"react\";\r\nimport { Fragment } from \"react\";\r\nimport cssHeader from './Header.css';\r\nimport HeaderBranding from \"./HeaderBranding\";\r\n\r\n\r\nconst AbacusHeader = props => { \r\n \r\n return (\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\n\r\nexport default AbacusHeader;","import { useTranslation } from 'react-i18next';\r\nimport '../../i18n'\r\nexport function ErrorBox(props) {\r\n const { t, i18n } = useTranslation();\r\n if (!props.errors || props.errors.length == 0) {\r\n return ('');\r\n }\r\n\r\n const errorList = [];\r\n props.errors.map((error) => { errorList.push(
  • {t(error)}
  • ) });\r\n return (
    \r\n

    {t('errorbox.title')}

    \r\n \r\n
    \r\n // {t('login.combinationdoesnotmatch')}\r\n );\r\n}\r\n\r\nexport function ProcessErrors(errors) {\r\n\r\n\r\n const errorList = [];\r\n\r\n const ProcessError = (error) => {\r\n switch (error) {\r\n case 'too_many_attempts':\r\n errorList.push('error.toomanyattempts');\r\n break;\r\n case 'invalid_grant':\r\n errorList.push('error.authenticationfailed');\r\n break;\r\n default:\r\n if (error.startsWith(\"error.\")) {\r\n errorList.push(error);\r\n }\r\n else {\r\n errorList.push(\"error.\" + error);\r\n }\r\n break;\r\n }\r\n }\r\n \r\n if (errors.constructor === Array) {\r\n for (let i = 0; i < errors.length; i++) {\r\n ProcessError(errors[i]);\r\n }\r\n }\r\n //if (typeof errors === 'string') {\r\n // errorList.push(errors);\r\n //}\r\n else if (errors?.code)\r\n {\r\n ProcessError(errors.code);\r\n }\r\n else if (errors) {\r\n ProcessError(errors);\r\n }\r\n return errorList;\r\n}","import { Component } from \"react\";\r\nimport { APIPost,getEnvironment } from '../API/APIRequest'\r\n\r\n\r\n //constructor(props) {\r\n // super(props);\r\n // this.getToken = this.getToken.bind(this);\r\n // this.saveToken = this.saveToken.bind(this);\r\n // this.refreshToken = this.refreshToken.bind(this);\r\n //}\r\n\r\nexport function GetADToken() {\r\n var tokenString = sessionStorage.getItem('adtoken');\r\n if (tokenString) {\r\n var userToken = JSON.parse(tokenString);\r\n return userToken;\r\n }\r\n return null;\r\n}\r\n\r\nexport function RefreshADToken() {\r\n return new Promise((resolve, reject) => {\r\n var userToken = GetADToken();\r\n if (userToken) {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('adtoken', userToken.token);\r\n\r\n var environment = getEnvironment();\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"validateandrefreshadtoken\",\r\n \"environment\" : environment,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n userToken.token = result.token;\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n else {\r\n RemoveADToken();\r\n resolve(null);\r\n }\r\n });\r\n resolve(userToken);\r\n }\r\n resolve(null);\r\n });\r\n \r\n}\r\n\r\nexport function SaveADToken(userToken) {\r\n sessionStorage.setItem('adtoken', JSON.stringify(userToken));\r\n}\r\n\r\nexport function RemoveADToken() {\r\n sessionStorage.clear();\r\n}\r\n\r\nexport function GetAuth0TokenLocal() {\r\n var tokenString = localStorage.getItem('auth0token');\r\n var auth0Token = null;\r\n if (tokenString) {\r\n auth0Token = JSON.parse(tokenString);\r\n }\r\n return auth0Token;\r\n}\r\n\r\nexport function SaveAuth0Token(auth0Token) {\r\n localStorage.setItem('auth0token', JSON.stringify(auth0Token));\r\n}\r\n\r\nexport function RemoveAuth0Token() {\r\n localStorage.removeItem('auth0token');\r\n}","import { GetConfiguration } from '../Configuration/ConfigurationManager'\r\nimport { APIGet, APIPost, getEnvironment } from '../API/APIRequest';\r\nexport function SaveCookie(cookiename, cookievalue, domain) {\r\n GetConfiguration('userconfiguration').then((configuration) => {\r\n var expiresDays = configuration.frontendloginpersistencedays;\r\n var currentDate = new Date();\r\n var expiresDate = new Date(currentDate.setDate(currentDate.getDate() + expiresDays));\r\n\r\n var cookie = cookiename + \"=\" + cookievalue + \";Path=/;secure;expires=\" + expiresDate.toISOString();\r\n if (window.location.hostname.endsWith(domain)) {\r\n cookie += \";domain=\" + domain\r\n }\r\n document.cookie = cookie;\r\n }).catch((error) => {\r\n throw (error);\r\n });\r\n};\r\n\r\nexport function GetCookieName() {\r\n return new Promise((resolve, reject) => {\r\n var cookieName = sessionStorage.getItem('ADFECookieName');\r\n if (cookieName) {\r\n resolve(cookieName);\r\n }\r\n var environment = getEnvironment();\r\n APIGet({\r\n \"controller\": \"account\",\r\n \"action\": \"frontendcookiename\",\r\n \"environment\" : environment\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n cookieName = result.frontendcookiename;\r\n sessionStorage.setItem('ADFECookieName', cookieName);\r\n resolve(cookieName);\r\n }\r\n reject(null);\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n \r\n }); \r\n}\r\n\r\nexport function GetCookieValue(cookiename) {\r\n let name = cookiename + \"=\";\r\n let decodedCookie = decodeURIComponent(document.cookie);\r\n let ca = decodedCookie.split(';');\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) == ' ') {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) == 0) {\r\n return c.substring(name.length, c.length);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport function ValidateCookieValue(cookievalue) {\r\n return new Promise((resolve, reject) => {\r\n var data = new FormData()\r\n data.append('cookieValue', cookievalue);\r\n var environment = getEnvironment();\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"validateadfrontendcookie\",\r\n \"environment\": environment\r\n })\r\n .then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n resolve(result.user);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).\r\n catch((error) => {\r\n reject(error);\r\n });\r\n \r\n });\r\n}\r\nexport function DeleteCookie(name) {\r\n document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;Path=/;';\r\n};\r\n\r\n","import React, { useState, useEffect } from 'react';\r\nimport { SaveAuth0Token, RemoveAuth0Token, RemoveADToken, SaveADToken } from '../../Utilities/TokenManager';\r\nimport { APIGet, APIPost } from '../../API/APIRequest';\r\nimport { SaveCookie, DeleteCookie } from '../../Utilities/ADFECookie';\r\n\r\n//function GetAuth0TokenFromServer(auth0Id) {\r\n// return new Promise((resolve, reject) => {\r\n// if (auth0Id) {\r\n// var bodyFormData = new FormData();\r\n// bodyFormData.append('auth0Id', auth0Id);\r\n\r\n// var accessTokenUrl = APIUrl({ \"path\": \"/auth0/getaccesstoken\" });\r\n// var auth0token = null;\r\n// axios({\r\n// method: \"post\",\r\n// url: accessTokenUrl,\r\n// data: bodyFormData,\r\n// headers: { \"Content-Type\": \"multipart/form-data\" },\r\n// }).then((response) => {\r\n// var result = response.data;\r\n// if (result.success) {\r\n// if (result.token) {\r\n// auth0token = {\r\n// auth0id: auth0Id,\r\n// token: result.token.value\r\n// };\r\n// SaveAuth0Token(auth0token);\r\n// }\r\n// else {\r\n// RemoveAuth0Token();\r\n// }\r\n// resolve(auth0token);\r\n// }\r\n// else {\r\n// RemoveAuth0Token();\r\n// DeleteCookie();\r\n// RemoveADToken();\r\n// auth0token = null;\r\n// reject(result.errors);\r\n// }\r\n// }).catch((error) => {\r\n// reject(error);\r\n// });\r\n// }\r\n// })\r\n//};\r\n\r\nfunction AutologinAPI(environment, auth0Token) {\r\n return new Promise((resolve, reject) => {\r\n if (auth0Token) {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('refToken', auth0Token);\r\n\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"autologin\",\r\n \"environment\": environment,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n if (result.reftoken) {\r\n SaveAuth0Token(result.reftoken);\r\n var user = result.user;\r\n SaveCookie(user.frontendCookieName, user.frontendCookieValue, user.frontendCookieDomain);\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n else {\r\n RemoveAuth0Token();\r\n }\r\n resolve(result.user);\r\n }\r\n else {\r\n RemoveAuth0Token();\r\n DeleteCookie();\r\n RemoveADToken();\r\n reject(result.errors);\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }\r\n })\r\n};\r\n\r\nfunction GetAuth0UserByEmail(email, environment) {\r\n return new Promise((resolve, reject) => {\r\n \r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getuserbyemail\",\r\n \"environment\": environment,\r\n data: {\r\n \"email\": encodeURIComponent(email)\r\n }\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n resolve(result.auth0response);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).\r\n catch((error) => {\r\n var unexpected = [];\r\n unexpected.push(\"error.unexpected\");\r\n reject(unexpected);\r\n });\r\n });\r\n}\r\n\r\nfunction CreateADAuthenticationAssets(auth0Id) {\r\n return new Promise((resolve, reject) => {\r\n if (auth0Id) {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('additionalCodeType', 'Auth0_id');\r\n bodyFormData.append('additionalCodeValue', auth0Id);\r\n\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"getlogindetailsbyadditionalcode\",\r\n \"environment\": null,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n var user = result.user;\r\n SaveCookie(user.frontendCookieName, user.frontendCookieValue, user.frontendCookieDomain);\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n }); \r\n } \r\n });\r\n};\r\n\r\nexport {CreateADAuthenticationAssets,GetAuth0UserByEmail, AutologinAPI }\r\n\r\n","import React, { useState,useEffect } from 'react';\r\nimport auth0 from 'auth0-js';\r\nimport { ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { Loading } from '../../Utilities/Loading';\r\nimport { APIGet, APIPost, APIRedirect, getEnvironment} from '../../API/APIRequest';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager';\r\nimport { GetADToken, SaveADToken, RefreshADToken, GetAuth0TokenLocal, RemoveADToken, RemoveAuth0Token, SaveAuth0Token } from '../../Utilities/TokenManager'\r\nimport { GetCookieName, GetCookieValue, ValidateCookieValue, DeleteCookie, SaveCookie} from '../../Utilities/ADFECookie'\r\nimport { GetAuth0UserByEmail, AutologinAPI } from './Auth0ADInterface'\r\n\r\nfunction useProvideEmbeddedAuth() {\r\n \r\n const [isLoading, setIsLoading] = useState(true);\r\n const [userData, setUserData] = useState(null);\r\n const [errors, setErrors] = useState([]);\r\n const [webAuth, setWebAuth] = useState(null)\r\n const [environment, setEnvironment] = useState(getEnvironment());\r\n const [currentAction, setCurrentAction] = useState([]);\r\n const [returnUrl, setReturnUrl] = useState(null);\r\n const authProviderType = \"auth0\"; \r\n\r\n const params = new Proxy(new URLSearchParams(window.location.search),\r\n {\r\n get: (searchParams, props) => searchParams.get(props),\r\n });\r\n\r\n const getWebAuth = () => {\r\n if (!webAuth) {\r\n GetConfiguration(\"auth0authenticationapiconfiguration\", environment).then((configuration) => {\r\n var wa = new auth0.WebAuth(\r\n {\r\n domain: configuration.customDomain,\r\n clientID: configuration.clientId,\r\n responseMode: 'query',\r\n responseType: 'code',\r\n scope: 'openid profile email offline_access'\r\n });\r\n setWebAuth(wa);\r\n }).catch((webauthErrors) => {\r\n errors.push(webauthErrors);\r\n });\r\n }\r\n }\r\n\r\n const PassThruUrl = () => {\r\n let params = (new URL(document.location)).searchParams;\r\n return params.get(\"PassThruUrl\");\r\n }\r\n \r\n const ReturnUrl = () => {\r\n \r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\");\r\n if (retUrl){\r\n\r\n setReturnUrl(retUrl);\r\n return retUrl;\r\n\r\n } \r\n\r\n if (!returnUrl ) {\r\n //return new Promise((resolve, reject) => {\r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\");\r\n \r\n if (!retUrl) {\r\n retUrl = document.referrer;\r\n }\r\n if (!retUrl) {\r\n retUrl = sessionStorage.getItem(\"ReturnUrl\");\r\n }\r\n if (retUrl) {\r\n setReturnUrl(retUrl);\r\n //resolve(returnUrl);\r\n }\r\n if (!retUrl) {\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getcurrentbrand\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n\r\n if (response?.data?.brand?.returnurl) { \r\n sessionStorage.setItem(\"ReturnUrl\", response.data.brand.returnurl);\r\n setReturnUrl(response.data.brand.returnurl);\r\n }\r\n //resolve(returnUrl);\r\n }).\r\n catch((error) => {\r\n //reject(error);\r\n })\r\n }\r\n }\r\n return returnUrl;\r\n //})\r\n }\r\n\r\n const ClearUserData = () => {\r\n RemoveADToken();\r\n setUserData(null);\r\n }\r\n\r\n const AuthenticateWithCookie = () => {\r\n return new Promise((resolve, reject) => {\r\n GetCookieName().then((cookieName) => {\r\n var cookieValue = GetCookieValue(cookieName);\r\n if (cookieValue) {\r\n ValidateCookieValue(cookieValue).then((user) => {\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n resolve(null);\r\n });\r\n }\r\n resolve(null);\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n const Login = (username, password) => {\r\n return new Promise((resolve, reject) => { \r\n webAuth.client.login({\r\n username: username,\r\n password: password,\r\n realm: 'Username-Password-Authentication'\r\n }, async (error, result) => {\r\n if (error) {\r\n reject(error);\r\n }\r\n else { \r\n \r\n var data = {\r\n access_token: result.accessToken,\r\n refresh_token: result.refreshToken,\r\n id_token: result.idToken,\r\n scope: '',\r\n expires_in: result.expiresIn,\r\n token_type: 'access_token'\r\n };\r\n \r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"processtokensfromembeddedlogin\",\r\n \"environment\": environment,\r\n \"content_type\": \"json\",\r\n data: data \r\n }).then((axresponse) => {\r\n var axresult = axresponse.data;\r\n if (!axresult.success) {\r\n reject(axresult.errors);\r\n }\r\n var user = axresult.user;\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveAuth0Token(axresult.ad_ref_token);\r\n SaveADToken(userToken);\r\n setUserData(userToken);\r\n resolve(axresult);\r\n } \r\n }).catch((axerror) => {\r\n reject(axerror);\r\n });\r\n }\r\n })\r\n });\r\n }\r\n\r\n const ClearAuth0Tokens = (refToken) => {\r\n return new Promise((resolve, reject) => {\r\n var formData = new FormData();\r\n formData.append(\"refToken\", refToken);\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"cleartokens\",\r\n \"environment\": environment,\r\n data: formData\r\n }).then((axresult) => {\r\n resolve(axresult.data.success);\r\n }).catch((axerror) => {\r\n reject(axerror);\r\n });\r\n });\r\n }\r\n\r\n const AutoLogin = (refParam) => {\r\n return new Promise((resolve, reject) => {\r\n if (currentAction.length == 0) {\r\n currentAction.push(\"authenticating\");\r\n var auth0Token = refParam;\r\n if (!auth0Token) {\r\n auth0Token = GetAuth0TokenLocal();\r\n }\r\n if (auth0Token) {\r\n AutologinAPI(environment, auth0Token).then((userToken) => {\r\n sessionStorage.setItem('authenticatedWithAuth0', 'true');\r\n currentAction.pop();\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n currentAction.pop();\r\n reject(aerrors);\r\n });\r\n\r\n }\r\n else {\r\n currentAction.pop();\r\n resolve(null);\r\n }\r\n }\r\n });\r\n }\r\n \r\n const getUserToken = () => {\r\n return new Promise((resolve, reject) => {\r\n var refToken = params.refToken;\r\n var userToken = GetADToken(); \r\n if (isLoading) {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n //var checkADFECookie = true;\r\n //if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n // var authenticatedWithAuth0 = sessionStorage.getItem('authenticatedWithAuth0');\r\n // checkADFECookie = (authenticatedWithAuth0 && Boolean(authenticatedWithAuth0));\r\n //}\r\n //if (userToken?.token) {\r\n // RefreshADToken().then((result) => {\r\n // userToken = result;\r\n // resolve(userToken);\r\n // });\r\n //}\r\n //if (!userToken?.token && checkADFECookie) {\r\n // AuthenticateWithCookie().then((userToken) => {\r\n // if (userToken?.token) {\r\n // resolve(userToken);\r\n // }\r\n // }).catch((aerrors) => {\r\n // reject(aerrors);\r\n // });\r\n //}\r\n if (!userToken?.token || refToken) {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n AutoLogin(refToken).then((userToken) => {\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n reject(aerrors);\r\n });\r\n }\r\n else {\r\n resolve(null);\r\n }\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n }).catch((cerrors) => {\r\n reject(cerrors);\r\n })\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n });\r\n\r\n }\r\n\r\n const GetLoginData = (environment, refToken) => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getuserlogindata\",\r\n \"environment\": environment,\r\n \"identifier\": refToken\r\n }).then((response) => {\r\n resolve(response.data.loginData);\r\n }).catch((errors) => {\r\n reject(errors);\r\n });\r\n })\r\n }\r\n\r\n const GetADRefToken = () => {\r\n var refToken = params.refToken;\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n return refToken;\r\n }\r\n \r\n const GetSocialConnections = () => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getsocialconnections\",\r\n \"environment\": environment\r\n }).\r\n then((response) => {\r\n var result = response.data;\r\n\r\n if (result.success) {\r\n resolve(result.connections);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).\r\n catch((error) => {\r\n var unexpected = []\r\n unexpected.push(error)\r\n reject(error);\r\n });\r\n });\r\n\r\n }\r\n\r\n const CheckEmail = (email) => {\r\n return new Promise((resolve, reject) => {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n GetAuth0UserByEmail(email, environment).then((auth0response) => {\r\n if (auth0response.status == 0) {\r\n resolve({ status: \"email_found\" }); \r\n }\r\n else {\r\n resolve({ status: \"email_not_found\" });\r\n }\r\n }).catch((errors) => {\r\n //setErrors(errors);\r\n reject(errors)\r\n });\r\n }\r\n });\r\n }); \r\n }\r\n\r\n const ForwardPage = () => {\r\n \r\n }\r\n\r\n function Logout(returnUrl, refToken) {\r\n GetCookieName().then((cookieName) => {\r\n DeleteCookie(cookieName);\r\n });\r\n\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n if (refToken) {\r\n RemoveADToken();\r\n ClearAuth0Tokens(refToken).then((result) => {\r\n RemoveAuth0Token();\r\n }).catch((error) => {\r\n setErrors(ProcessErrors(error));\r\n });\r\n }\r\n \r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n \r\n var callBack = window.location.href;\r\n if (returnUrl) {\r\n callBack += \"?ReturnUrl=\" + returnUrl;\r\n }\r\n if (callBack.indexOf(\"?\") > 0) {\r\n callBack += \"&IsCallback=true\";\r\n }\r\n else {\r\n callBack += \"?IsCallback=true\";\r\n }\r\n webAuth.logout({ returnTo: callBack }); \r\n }\r\n\r\n const SendForgottenPasswordLink = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"sendforgottenpasswordlink\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result.errors);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n const ValidatePasswordResetToken = (token) => {\r\n return new Promise((resolve, reject) => {\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"validateresetpasswordtoken\",\r\n \"environment\": environment,\r\n \"identifier\": token\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n if (errors.length == 0) {\r\n result.errors.forEach((error) => {\r\n errors.push(error);\r\n });\r\n }\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n errors.push(\"error.unexpected\");\r\n });\r\n });\r\n }\r\n\r\n const ResetPassword = (token, newPassword) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('newPassword', newPassword);\r\n \r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"resetpassword\",\r\n \"environment\": environment,\r\n \"identifier\": token,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((errors) => {\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n\r\n //if (!webAuth) {\r\n getWebAuth();\r\n //}\r\n\r\n if (isLoading) {\r\n getUserToken().then((userToken) => {\r\n setIsLoading(false);\r\n setUserData(userToken);\r\n\r\n }).catch((error) => {\r\n errors.push(ProcessErrors(\"error.unexpected\"));\r\n setIsLoading(false);\r\n });\r\n }\r\n else {\r\n var sessionToken = GetADToken()\r\n if (!userData && sessionToken) {\r\n setUserData(sessionToken);\r\n }\r\n }\r\n \r\n return {\r\n authProviderType,\r\n environment,\r\n userData,\r\n isLoading,\r\n setErrors,\r\n errors,\r\n ReturnUrl,\r\n PassThruUrl,\r\n ForwardPage,\r\n CheckEmail,\r\n Login,\r\n Logout,\r\n GetADRefToken,\r\n GetLoginData,\r\n GetSocialConnections,\r\n ClearUserData,\r\n SendForgottenPasswordLink,\r\n ValidatePasswordResetToken,\r\n ResetPassword\r\n }\r\n}\r\n\r\nfunction Auth0EmbeddedAuthenticationProvider(props) {\r\n const AuthContext = props.AuthContext;\r\n var auth = useProvideEmbeddedAuth();\r\n if (!auth || auth.isLoading) {\r\n return ();\r\n }\r\n else {\r\n return ()\r\n }\r\n}\r\n\r\nexport {Auth0EmbeddedAuthenticationProvider}","import React, { useState,useEffect } from 'react';\r\nimport auth0 from 'auth0-js';\r\nimport { ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { Loading } from '../../Utilities/Loading';\r\nimport { APIGet, APIPost, APIRedirect, getEnvironment, getPage } from '../../API/APIRequest';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager';\r\nimport { GetADToken, SaveADToken, RefreshADToken, GetAuth0TokenLocal, RemoveADToken, RemoveAuth0Token, SaveAuth0Token } from '../../Utilities/TokenManager'\r\nimport { GetCookieName, GetCookieValue, ValidateCookieValue, DeleteCookie, SaveCookie} from '../../Utilities/ADFECookie'\r\nimport { GetAuth0UserByEmail, AutologinAPI } from './Auth0ADInterface'\r\n\r\nfunction useProvideUniversalAuth() {\r\n \r\n const [isLoading, setIsLoading] = useState(true);\r\n const [userData, setUserData] = useState(null);\r\n const [errors, setErrors] = useState([]);\r\n const [webAuth, setWebAuth] = useState(null)\r\n const [environment, setEnvironment] = useState(getEnvironment());\r\n const [currentAction, setCurrentAction] = useState([]);\r\n const [returnUrl, setReturnUrl] = useState(null);\r\n const authProviderType = \"auth0\"; \r\n\r\n const params = new Proxy(new URLSearchParams(window.location.search),\r\n {\r\n get: (searchParams, props) => searchParams.get(props),\r\n });\r\n\r\n const getWebAuth = () => {\r\n if (!webAuth) {\r\n GetConfiguration(\"auth0authenticationapiconfiguration\", environment).then((configuration) => {\r\n var wa = new auth0.WebAuth(\r\n {\r\n domain: configuration.customDomain,\r\n clientID: configuration.clientId,\r\n responseMode: 'query',\r\n responseType: 'code',\r\n scope: 'openid profile email offline_access'\r\n });\r\n setWebAuth(wa);\r\n }).catch((webauthErrors) => {\r\n errors.push(webauthErrors);\r\n });\r\n }\r\n }\r\n\r\n const PassThruUrl = () => {\r\n let params = (new URL(document.location)).searchParams;\r\n return params.get(\"PassThruUrl\");\r\n }\r\n \r\n const EmailId = () => {\r\n let params = (new URL(document.location)).searchParams;\r\n return params.get(\"email\") || \"\";\r\n }\r\n const ReturnUrl = () => {\r\n \r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\");\r\n if (retUrl){\r\n\r\n setReturnUrl(retUrl);\r\n return retUrl;\r\n\r\n } \r\n\r\n if (!returnUrl ) {\r\n //return new Promise((resolve, reject) => {\r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\");;\r\n \r\n if (!retUrl) {\r\n retUrl = document.referrer;\r\n }\r\n if (!retUrl) {\r\n retUrl = sessionStorage.getItem(\"ReturnUrl\");\r\n }\r\n if (retUrl) {\r\n setReturnUrl(retUrl);\r\n //resolve(returnUrl);\r\n }\r\n if (!retUrl) {\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getcurrentbrand\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n\r\n if (response?.data?.brand?.returnurl) { \r\n sessionStorage.setItem(\"ReturnUrl\", response.data.brand.returnurl);\r\n setReturnUrl(response.data.brand.returnurl);\r\n }\r\n //resolve(returnUrl);\r\n }).\r\n catch((error) => {\r\n //reject(error);\r\n })\r\n }\r\n }\r\n return returnUrl;\r\n //})\r\n }\r\n\r\n const ClearUserData = () => {\r\n RemoveADToken();\r\n setUserData(null);\r\n }\r\n\r\n const AuthenticateWithCookie = () => {\r\n return new Promise((resolve, reject) => {\r\n GetCookieName().then((cookieName) => {\r\n var cookieValue = GetCookieValue(cookieName);\r\n if (cookieValue) {\r\n ValidateCookieValue(cookieValue).then((user) => {\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n resolve(null);\r\n });\r\n }\r\n resolve(null);\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n const Login = (username,password) => {\r\n \r\n }\r\n\r\n const GotoUniversalLogin = (email) => {\r\n console.log(email);\r\n if(!email)\r\n email = EmailId()\r\n let returnUrl = ReturnUrl();\r\n var data = {\r\n \"ReturnUrl\": returnUrl,\r\n \"email\": email\r\n };\r\n \r\n APIRedirect({\r\n \"controller\": \"auth0\",\r\n \"action\": \"authenticate\",\r\n \"environment\": environment,\r\n data : data\r\n });\r\n }\r\n\r\n const ClearAuth0Tokens = (refToken) => {\r\n return new Promise((resolve, reject) => {\r\n var formData = new FormData();\r\n formData.append(\"refToken\", refToken);\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"cleartokens\",\r\n \"environment\": environment,\r\n data: formData\r\n }).then((axresult) => {\r\n resolve(axresult.data.success);\r\n }).catch((axerror) => {\r\n reject(axerror);\r\n });\r\n });\r\n }\r\n\r\n const AutoLogin = (refParam) => {\r\n return new Promise((resolve, reject) => {\r\n if (currentAction.length == 0) {\r\n currentAction.push(\"authenticating\");\r\n var auth0Token = refParam;\r\n if (!auth0Token) {\r\n auth0Token = GetAuth0TokenLocal();\r\n }\r\n if (auth0Token) {\r\n AutologinAPI(environment, auth0Token).then((userToken) => {\r\n sessionStorage.setItem('authenticatedWithAuth0', 'true');\r\n currentAction.pop();\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n currentAction.pop();\r\n reject(aerrors);\r\n });\r\n\r\n }\r\n else {\r\n currentAction.pop();\r\n resolve(null);\r\n }\r\n }\r\n });\r\n }\r\n \r\n const getUserToken = () => {\r\n return new Promise((resolve, reject) => {\r\n var refToken = params.refToken;\r\n var userToken = GetADToken(); \r\n if (isLoading) {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n //var checkADFECookie = true;\r\n //if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n // var authenticatedWithAuth0 = sessionStorage.getItem('authenticatedWithAuth0');\r\n // checkADFECookie = (authenticatedWithAuth0 && Boolean(authenticatedWithAuth0));\r\n //}\r\n //if (userToken?.token) {\r\n // RefreshADToken().then((result) => {\r\n // userToken = result;\r\n // resolve(userToken);\r\n // });\r\n //}\r\n //if (!userToken?.token && checkADFECookie) {\r\n // AuthenticateWithCookie().then((userToken) => {\r\n // if (userToken?.token) {\r\n // resolve(userToken);\r\n // }\r\n // }).catch((aerrors) => {\r\n // reject(aerrors);\r\n // });\r\n //}\r\n if (!userToken?.token || refToken) {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n AutoLogin(refToken).then((userToken) => {\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n reject(aerrors);\r\n });\r\n }\r\n else {\r\n resolve(null);\r\n }\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n }).catch((cerrors) => {\r\n reject(cerrors);\r\n })\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n });\r\n\r\n }\r\n\r\n const GetLoginData = (environment, refToken) => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getuserlogindata\",\r\n \"environment\": environment,\r\n \"identifier\": refToken\r\n }).then((response) => {\r\n resolve(response.data.loginData);\r\n }).catch((errors) => {\r\n reject(errors);\r\n });\r\n })\r\n }\r\n\r\n const GetADRefToken = () => {\r\n var refToken = params.refToken;\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n return refToken;\r\n }\r\n \r\n const GetSocialConnections = () => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getsocialconnections\",\r\n \"environment\": environment\r\n }).\r\n then((response) => {\r\n var result = response.data;\r\n\r\n if (result.success) {\r\n resolve(result.connections);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).\r\n catch((error) => {\r\n var unexpected = []\r\n unexpected.push(error)\r\n reject(error);\r\n });\r\n });\r\n\r\n }\r\n\r\n const CheckEmail = (email) => {\r\n return new Promise((resolve, reject) => { \r\n let page = getPage();\r\n /*\r\n * for universal bypass all the waffleflows & go straight to auth0\r\n */\r\n if (page === \"login\")\r\n {\r\n GotoUniversalLogin(email);\r\n } \r\n GetAuth0UserByEmail(email, environment).then((auth0response) => {\r\n if (auth0response.status == 0) {\r\n console.log(auth0response);\r\n resolve({ status: \"email_found\" }); \r\n }\r\n else {\r\n resolve({ status: \"email_not_found\" });\r\n }\r\n }).catch((errors) => {\r\n //setErrors(errors);\r\n reject(errors)\r\n }); \r\n }); \r\n }\r\n\r\n const CheckRegisteredAccount = (email) => {\r\n return new Promise((resolve, reject) => {\r\n let page = getPage();\r\n /*\r\n * for universal bypass all the waffleflows & go straight to auth0\r\n */\r\n if (page === \"login\") {\r\n GotoUniversalLogin(email);\r\n }\r\n GetAuth0UserByEmail(email, environment).then((auth0response) => {\r\n if (auth0response.status == 0) {\r\n console.log(auth0response);\r\n resolve({ status: \"email_found\" });\r\n }\r\n else {\r\n resolve({ status: \"email_not_found\" });\r\n }\r\n }).catch((errors) => {\r\n //setErrors(errors);\r\n reject(errors)\r\n });\r\n });\r\n }\r\n\r\n const ForwardPage = () => {\r\n \r\n }\r\n\r\n function Logout(returnUrl, refToken) {\r\n GetCookieName().then((cookieName) => {\r\n DeleteCookie(cookieName);\r\n });\r\n\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n if (refToken) {\r\n RemoveADToken();\r\n ClearAuth0Tokens(refToken).then((result) => {\r\n RemoveAuth0Token();\r\n }).catch((error) => {\r\n setErrors(ProcessErrors(error));\r\n });\r\n }\r\n \r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n \r\n APIRedirect({\r\n \"controller\": \"auth0\",\r\n \"action\": \"logout\",\r\n \"environment\": environment,\r\n data : {\r\n ReturnUrl : returnUrl\r\n }\r\n }); \r\n }\r\n\r\n const SendForgottenPasswordLink = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"sendforgottenpasswordlink\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result.errors);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n const ValidatePasswordResetToken = (token) => {\r\n return new Promise((resolve, reject) => {\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"validateresetpasswordtoken\",\r\n \"environment\": environment,\r\n \"identifier\": token\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n if (errors.length == 0) {\r\n result.errors.forEach((error) => {\r\n errors.push(error);\r\n });\r\n }\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n errors.push(\"error.unexpected\");\r\n });\r\n });\r\n }\r\n\r\n const ResetPassword = (token, newPassword) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('newPassword', newPassword);\r\n \r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"resetpassword\",\r\n \"environment\": environment,\r\n \"identifier\": token,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((errors) => {\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n if (isLoading) {\r\n getUserToken().then((userToken) => {\r\n setIsLoading(false);\r\n setUserData(userToken);\r\n\r\n }).catch((error) => {\r\n errors.push(ProcessErrors(\"error.unexpected\"));\r\n setIsLoading(false);\r\n });\r\n }\r\n else {\r\n var sessionToken = GetADToken()\r\n if (!userData && sessionToken) {\r\n setUserData(sessionToken);\r\n }\r\n }\r\n \r\n return {\r\n authProviderType,\r\n environment,\r\n userData,\r\n isLoading,\r\n setErrors,\r\n errors,\r\n ReturnUrl,\r\n PassThruUrl,\r\n ForwardPage,\r\n CheckEmail,\r\n CheckRegisteredAccount,\r\n Login,\r\n Logout,\r\n GetADRefToken,\r\n GetLoginData,\r\n GetSocialConnections,\r\n ClearUserData,\r\n SendForgottenPasswordLink,\r\n ValidatePasswordResetToken,\r\n ResetPassword,\r\n GotoUniversalLogin\r\n }\r\n}\r\n\r\nfunction Auth0UniversalAuthenticationProvider(props) {\r\n const AuthContext = props.AuthContext;\r\n var auth = useProvideUniversalAuth();\r\n if (!auth || auth.isLoading) {\r\n return ();\r\n }\r\n else {\r\n return ()\r\n }\r\n}\r\n\r\nexport {Auth0UniversalAuthenticationProvider}","import React, { useState,useEffect } from 'react';\r\nimport auth0 from 'auth0-js';\r\nimport { ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { Loading } from '../../Utilities/Loading';\r\nimport { APIGet, APIPost, APIRedirect, getEnvironment} from '../../API/APIRequest';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager';\r\nimport { GetADToken, SaveADToken, RefreshADToken, GetAuth0TokenLocal, RemoveADToken, RemoveAuth0Token, SaveAuth0Token } from '../../Utilities/TokenManager'\r\nimport { GetCookieName, GetCookieValue, ValidateCookieValue, DeleteCookie, SaveCookie} from '../../Utilities/ADFECookie'\r\n\r\nfunction useProvideADNativeAuth() {\r\n \r\n const [isLoading, setIsLoading] = useState(true);\r\n const [userData, setUserData] = useState(null);\r\n const [errors, setErrors] = useState([]);\r\n const [webAuth, setWebAuth] = useState(null)\r\n const [environment, setEnvironment] = useState(getEnvironment());\r\n const [currentAction, setCurrentAction] = useState([]);\r\n const [returnUrl, setReturnUrl] = useState(null);\r\n const authProviderType = \"adnative\"; \r\n \r\n\r\n\r\n const params = new Proxy(new URLSearchParams(window.location.search),\r\n {\r\n get: (searchParams, props) => searchParams.get(props),\r\n });\r\n\r\n const getWebAuth = () => {\r\n if (!webAuth) {\r\n GetConfiguration(\"auth0authenticationapiconfiguration\", environment).then((configuration) => {\r\n var wa = new auth0.WebAuth(\r\n {\r\n domain: configuration.customDomain,\r\n clientID: configuration.clientId,\r\n responseMode: 'query',\r\n responseType: 'code',\r\n scope: 'openid profile email offline_access'\r\n });\r\n setWebAuth(wa);\r\n }).catch((webauthErrors) => {\r\n errors.push(webauthErrors);\r\n });\r\n }\r\n }\r\n\r\n const PassThruUrl = () => {\r\n let params = (new URL(document.location)).searchParams;\r\n return params.get(\"PassThruUrl\")\r\n \r\n }\r\n\r\n const ForwardPage = () => {\r\n \r\n }\r\n \r\n const ReturnUrl = () => {\r\n \r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\") ;\r\n if (retUrl){\r\n \r\n setReturnUrl(retUrl);\r\n return retUrl;\r\n\r\n } \r\n\r\n if (!returnUrl ) {\r\n //return new Promise((resolve, reject) => {\r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\") ;\r\n \r\n if (!retUrl) {\r\n retUrl = document.referrer;\r\n }\r\n if (!retUrl) {\r\n retUrl = sessionStorage.getItem(\"ReturnUrl\");\r\n }\r\n if (retUrl) {\r\n setReturnUrl(retUrl);\r\n //resolve(returnUrl);\r\n }\r\n if (!retUrl) {\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getcurrentbrand\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n\r\n if (response?.data?.brand?.returnurl) {\r\n sessionStorage.setItem(\"ReturnUrl\", response.data.brand.returnurl);\r\n setReturnUrl(response.data.brand.returnurl);\r\n }\r\n else {\r\n let fallbackUrl = \"https://\" + response.data.brand.brandhostname + \"/thankyou\";\r\n sessionStorage.setItem(\"ReturnUrl\",fallbackUrl);\r\n setReturnUrl(fallbackUrl);\r\n }\r\n //resolve(returnUrl);\r\n }).\r\n catch((error) => {\r\n //reject(error);\r\n })\r\n }\r\n }\r\n return returnUrl;\r\n //})\r\n }\r\n\r\n const ClearUserData = () => {\r\n RemoveADToken();\r\n setUserData(null);\r\n }\r\n\r\n const AuthenticateWithCookie = () => {\r\n return new Promise((resolve, reject) => {\r\n GetCookieName().then((cookieName) => {\r\n var cookieValue = GetCookieValue(cookieName);\r\n if (cookieValue) {\r\n ValidateCookieValue(cookieValue).then((user) => {\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n resolve(null);\r\n });\r\n }\r\n resolve(null);\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n const Login = (username, password) => {\r\n return new Promise((resolve, reject) => { \r\n var data = {\r\n Username: username,\r\n Password: password\r\n }; \r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"login\",\r\n \"environment\": environment,\r\n data: data \r\n }).then((axresponse) => {\r\n var axresult = axresponse.data;\r\n if (!axresult.success) {\r\n reject(axresult.errors);\r\n }\r\n var user = axresult.user;\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveAuth0Token(axresult.ad_ref_token);\r\n SaveADToken(userToken);\r\n setUserData(userToken);\r\n resolve(axresult);\r\n } \r\n }).catch((axerror) => {\r\n reject(axerror);\r\n }); \r\n });\r\n }\r\n\r\n const ClearAuth0Tokens = (refToken) => {\r\n return new Promise((resolve, reject) => {\r\n var formData = new FormData();\r\n formData.append(\"refToken\", refToken);\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"cleartokens\",\r\n \"environment\": environment,\r\n data: formData\r\n }).then((axresult) => {\r\n resolve(axresult.data.success);\r\n }).catch((axerror) => {\r\n reject(axerror);\r\n });\r\n });\r\n }\r\n\r\n const AutoLogin = (refParam) => {\r\n return new Promise((resolve, reject) => {\r\n if (currentAction.length == 0) {\r\n currentAction.push(\"authenticating\");\r\n \r\n currentAction.pop();\r\n resolve(null); \r\n }\r\n });\r\n }\r\n \r\n const getUserToken = () => {\r\n return new Promise((resolve, reject) => {\r\n var refToken = params.refToken;\r\n var userToken = GetADToken(); \r\n if (isLoading) {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n if (!userToken?.token) { \r\n AutoLogin(refToken).then((userToken) => {\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n reject(aerrors);\r\n }); \r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n }).catch((cerrors) => {\r\n reject(cerrors);\r\n })\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n });\r\n\r\n }\r\n\r\n const GetLoginData = (environment, refToken) => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"account\",\r\n \"action\": \"getuserlogindata\",\r\n \"environment\": environment,\r\n \"identifier\": refToken\r\n }).then((response) => {\r\n resolve(response.data.loginData);\r\n }).catch((errors) => {\r\n reject(errors);\r\n });\r\n })\r\n\r\n }\r\n\r\n const GetADRefToken = () => {\r\n var refToken = params.refToken;\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n return refToken;\r\n }\r\n \r\n const GetSocialConnections = () => {\r\n return new Promise((resolve, reject) => {\r\n resolve([]);\r\n });\r\n }\r\n\r\n const CheckEmail = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"checkemail\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n if (response.data.inuse) {\r\n resolve({ status: \"email_found\" });\r\n }\r\n else {\r\n resolve({ status: \"email_not_found\" });\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }); \r\n }\r\n\r\n const CheckRegisteredAccount = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"checkregisteredaccount\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n if (response.data.inuse) {\r\n resolve({ status: \"email_found\" });\r\n }\r\n else {\r\n resolve({ status: \"email_not_found\" });\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n });\r\n }\r\n\r\n function Logout(returnUrl, refToken) {\r\n GetCookieName().then((cookieName) => {\r\n DeleteCookie(cookieName);\r\n });\r\n\r\n if (refToken) {\r\n RemoveADToken();\r\n }\r\n \r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n \r\n var callBack = window.location.href;\r\n if (returnUrl) {\r\n callBack += \"?ReturnUrl=\" + returnUrl;\r\n }\r\n if (callBack.indexOf(\"?\") > 0) {\r\n callBack += \"&IsCallback=true\";\r\n }\r\n else {\r\n callBack += \"?IsCallback=true\";\r\n }\r\n window.location.href=callBack; \r\n }\r\n\r\n const SendForgottenPasswordLink = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"sendforgottenpasswordlink\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result.errors);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n const ValidatePasswordResetToken = (token) => {\r\n return new Promise((resolve, reject) => {\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"validateresetpasswordtoken\",\r\n \"environment\": environment,\r\n \"identifier\": token\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n if (errors.length == 0) {\r\n result.errors.forEach((error) => {\r\n errors.push(error);\r\n });\r\n }\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n errors.push(\"error.unexpected\");\r\n });\r\n });\r\n }\r\n\r\n const ResetPassword = (token, newPassword) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('newPassword', newPassword);\r\n \r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"resetpassword\",\r\n \"environment\": environment,\r\n \"identifier\": token,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((errors) => {\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n\r\n //if (!webAuth) {\r\n getWebAuth();\r\n //}\r\n\r\n if (isLoading) {\r\n getUserToken().then((userToken) => {\r\n setIsLoading(false);\r\n setUserData(userToken);\r\n\r\n }).catch((error) => {\r\n errors.push(ProcessErrors(\"error.unexpected\"));\r\n setIsLoading(false);\r\n });\r\n }\r\n else {\r\n var sessionToken = GetADToken()\r\n if (!userData && sessionToken) {\r\n setUserData(sessionToken);\r\n }\r\n }\r\n \r\n return {\r\n authProviderType,\r\n environment,\r\n userData,\r\n isLoading,\r\n setErrors,\r\n errors,\r\n ReturnUrl,\r\n PassThruUrl,\r\n ForwardPage,\r\n CheckEmail,\r\n CheckRegisteredAccount,\r\n Login,\r\n Logout,\r\n GetADRefToken,\r\n GetSocialConnections,\r\n GetLoginData,\r\n ClearUserData,\r\n SendForgottenPasswordLink,\r\n ValidatePasswordResetToken,\r\n ResetPassword\r\n }\r\n}\r\n\r\nfunction ADNativeAuthenticationProvider(props) {\r\n const AuthContext = props.AuthContext;\r\n var auth = useProvideADNativeAuth();\r\n if (!auth || auth.isLoading) {\r\n return ();\r\n }\r\n else {\r\n return ()\r\n }\r\n}\r\n\r\nexport {ADNativeAuthenticationProvider}","import React, { useState,useEffect } from 'react';\r\nimport auth0 from 'auth0-js';\r\nimport { ProcessErrors } from '../Utilities/ErrorBox';\r\nimport { Loading } from '../Utilities/Loading';\r\nimport { APIGet, APIPost, APIRedirect, getEnvironment} from '../API/APIRequest';\r\nimport { GetConfiguration } from '../Configuration/ConfigurationManager';\r\nimport { GetADToken, SaveADToken, RefreshADToken, GetAuth0TokenLocal, RemoveADToken, RemoveAuth0Token, SaveAuth0Token } from '../Utilities/TokenManager'\r\nimport { GetCookieName, GetCookieValue, ValidateCookieValue, DeleteCookie, SaveCookie} from '../Utilities/ADFECookie'\r\nimport { GetAuth0UserByEmail, AutologinAPI } from './Auth0/Auth0ADInterface'\r\nimport { Auth0EmbeddedAuthenticationProvider } from './Auth0/Auth0EmbeddedAuthenticationProvider'\r\nimport { Auth0UniversalAuthenticationProvider } from './Auth0/Auth0UniversalAuthenticationProvider'\r\nimport { ADNativeAuthenticationProvider } from './Account/ADNativeAuthenticationProvider'\r\n\r\nconst AuthContext = React.createContext()\r\n\r\nexport function useProvideADAuth() {\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [userData, setUserData] = useState(null);\r\n const [errors, setErrors] = useState([]);\r\n const [environment, setEnvironment] = useState(getEnvironment());\r\n\r\n const ReturnUrl = () => {\r\n var params = (new URL(document.location)).searchParams;\r\n return params.get(\"ReturnUrl\");\r\n }\r\n\r\n const CheckEmail = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"checkemail\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n if (response.data.inuse) {\r\n resolve(\"email_found\");\r\n }\r\n else {\r\n resolve(\"email_not_found\");\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }); \r\n }\r\n\r\n const SendForgottenPasswordLink = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n\r\n APIPost({\r\n \"controller\": \"account\",\r\n \"action\": \"forgottenpassword\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n var result = response.data;\r\n });\r\n });\r\n }\r\n}\r\n\r\nfunction useProvideUniversalAuth() {\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [userData, setUserData] = useState(null);\r\n const [errors, setErrors] = useState([]);\r\n const [environment, setEnvironment] = useState(getEnvironment());\r\n\r\n const ReturnUrl = () => {\r\n var params = (new URL(document.location)).searchParams;\r\n return params.get(\"ReturnUrl\");\r\n }\r\n\r\n const AuthenticateWithCookie = () => {\r\n return new Promise((resolve, reject) => {\r\n GetCookieName().then((cookieName) => {\r\n var cookieValue = GetCookieValue(cookieName);\r\n if (cookieValue) {\r\n ValidateCookieValue(cookieValue).then((user) => {\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n resolve(null);\r\n });\r\n }\r\n resolve(null);\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n const AuthenticateWithAuth0 = () => {\r\n return new Promise((resolve, reject) => {\r\n var auth0Token = GetAuth0TokenLocal();\r\n if (auth0Token) {\r\n //var auth0Id = auth0Token.auth0id;\r\n //GetAuth0TokenFromServer(auth0Id).then(() => {\r\n // CreateADAuthenticationAssets(auth0Id).then((userToken) => {\r\n // sessionStorage.setItem('authenticatedWithAuth0', 'true');\r\n // resolve(userToken);\r\n // }).catch((errors) => {\r\n // reject(errors);\r\n // });\r\n //}).catch((errors) => {\r\n // reject(errors);\r\n //});\r\n\r\n }\r\n else {\r\n resolve(null);\r\n }\r\n });\r\n }\r\n\r\n const getUserToken = () => {\r\n return new Promise((resolve, reject) => {\r\n var userToken = GetADToken();\r\n if (isLoading) {\r\n GetConfiguration(\"userconfiguration\").then((configuration) => {\r\n var checkADFECookie = true;\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n var authenticatedWithAuth0 = sessionStorage.getItem('authenticatedWithAuth0');\r\n checkADFECookie = (authenticatedWithAuth0 && Boolean(authenticatedWithAuth0));\r\n }\r\n if (userToken?.token) { \r\n resolve(userToken); \r\n }\r\n if (!userToken?.token && checkADFECookie) {\r\n AuthenticateWithCookie().then((userToken) => {\r\n if (userToken?.token) {\r\n resolve(userToken);\r\n }\r\n }).catch((errors) =>\r\n {\r\n reject(errors);\r\n });\r\n }\r\n if (!userToken?.token) {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n AuthenticateWithAuth0().then((userToken) => {\r\n resolve(userToken);\r\n }).catch((errors) => {\r\n reject(errors);\r\n });\r\n }\r\n else {\r\n resolve(null);\r\n }\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n });\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n });\r\n\r\n }\r\n\r\n const GetSocialConnections = () => {\r\n return new Promise((resolve, reject) => { \r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getsocialconnections\",\r\n \"environment\": environment\r\n }).\r\n then((response) => {\r\n var result = response.data;\r\n\r\n if (result.success) {\r\n resolve(result.connections);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).\r\n catch((error) => {\r\n var unexpected = []\r\n unexpected.push(error)\r\n reject(error);\r\n }); \r\n });\r\n \r\n }\r\n\r\n const CheckEmail = (email) => {\r\n GetConfiguration(\"userconfiguration\").then((configuration) => {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n GetAuth0UserByEmail(email).then((auth0response) => {\r\n if (auth0response.status == 0) {\r\n var returnUrl = ReturnUrl(); \r\n var data = {\r\n \"ReturnUrl\": returnUrl,\r\n \"email\" : email\r\n } \r\n APIRedirect({\r\n \"controller\": \"auth0\",\r\n \"action\": \"authenticate\",\r\n \"environment\": environment,\r\n data: data\r\n });\r\n }\r\n else {\r\n var returnUrl = ReturnUrl();\r\n window.location.href = \"/register?ReturnUrl=\" + returnUrl;\r\n }\r\n }).catch((errors) => {\r\n setErrors(errors);\r\n });\r\n }\r\n });\r\n }\r\n\r\n function Logout(returnUrl) {\r\n GetCookieName().then((cookieName) => {\r\n DeleteCookie(cookieName);\r\n });\r\n\r\n var userToken = GetADToken();\r\n if (userToken) {\r\n RemoveADToken();\r\n }\r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n GetConfiguration(\"userconfiguration\").then((configuration) => {\r\n var providerType = configuration.authenticationprovidertype;\r\n if (providerType == \"auth0\") {\r\n RemoveAuth0Token();\r\n var data = {\r\n \"ReturnUrl\": returnUrl\r\n }\r\n APIRedirect({\r\n \"controller\": \"auth0\",\r\n \"action\": \"logout\",\r\n \"environment\": environment,\r\n data: data\r\n });\r\n }\r\n });\r\n }\r\n\r\n if (isLoading) {\r\n getUserToken().then((userToken) => {\r\n setIsLoading(false);\r\n setUserData(userToken);\r\n\r\n }).catch((error) => {\r\n errors.push(error);\r\n setIsLoading(false);\r\n });\r\n }\r\n else {\r\n var sessionToken = GetADToken()\r\n if (!userData && sessionToken) {\r\n setUserData(sessionToken);\r\n }\r\n }\r\n return {\r\n userData,\r\n isLoading,\r\n errors,\r\n ReturnUrl,\r\n CheckEmail,\r\n Logout,\r\n GetSocialConnections,\r\n }\r\n}\r\n\r\n\r\n\r\n\r\nexport function useProvideEmbeddedAuth() {\r\n \r\n const [isLoading, setIsLoading] = useState(true);\r\n const [userData, setUserData] = useState(null);\r\n const [errors, setErrors] = useState([]);\r\n const [webAuth, setWebAuth] = useState(null)\r\n const [environment, setEnvironment] = useState(getEnvironment());\r\n const [currentAction, setCurrentAction] = useState([]);\r\n const [returnUrl, setReturnUrl] = useState(null);\r\n \r\n\r\n\r\n const params = new Proxy(new URLSearchParams(window.location.search),\r\n {\r\n get: (searchParams, props) => searchParams.get(props),\r\n });\r\n\r\n const getWebAuth = () => {\r\n if (!webAuth) {\r\n GetConfiguration(\"auth0authenticationapiconfiguration\", environment).then((configuration) => {\r\n var wa = new auth0.WebAuth(\r\n {\r\n domain: configuration.customDomain,\r\n clientID: configuration.clientId,\r\n responseMode: 'query',\r\n responseType: 'code',\r\n scope: 'openid profile email offline_access'\r\n });\r\n setWebAuth(wa);\r\n }).catch((webauthErrors) => {\r\n errors.push(webauthErrors);\r\n });\r\n }\r\n }\r\n\r\n \r\n const ReturnUrl = () => {\r\n \r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\");\r\n if (retUrl) {\r\n \r\n setReturnUrl(retUrl);\r\n return retUrl;\r\n\r\n } \r\n\r\n if (!returnUrl ) {\r\n //return new Promise((resolve, reject) => {\r\n let params = (new URL(document.location)).searchParams;\r\n let retUrl = params.get(\"ReturnUrl\") || params.get(\"returl\");\r\n \r\n if (!retUrl) {\r\n retUrl = document.referrer;\r\n }\r\n if (!retUrl) {\r\n retUrl = sessionStorage.getItem(\"ReturnUrl\");\r\n }\r\n if (retUrl) {\r\n setReturnUrl(retUrl);\r\n //resolve(returnUrl);\r\n }\r\n if (!retUrl) {\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getcurrentbrand\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n\r\n if (response?.data?.brand?.returnurl) { \r\n sessionStorage.setItem(\"ReturnUrl\", response.data.brand.returnurl);\r\n setReturnUrl(response.data.brand.returnurl);\r\n }\r\n //resolve(returnUrl);\r\n }).\r\n catch((error) => {\r\n //reject(error);\r\n })\r\n }\r\n }\r\n return returnUrl;\r\n //})\r\n }\r\n\r\n const ClearUserData = () => {\r\n RemoveADToken();\r\n setUserData(null);\r\n }\r\n\r\n const AuthenticateWithCookie = () => {\r\n return new Promise((resolve, reject) => {\r\n GetCookieName().then((cookieName) => {\r\n var cookieValue = GetCookieValue(cookieName);\r\n if (cookieValue) {\r\n ValidateCookieValue(cookieValue).then((user) => {\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveADToken(userToken);\r\n resolve(userToken);\r\n }\r\n resolve(null);\r\n });\r\n }\r\n resolve(null);\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n const Login = (username, password) => {\r\n return new Promise((resolve, reject) => { \r\n webAuth.client.login({\r\n username: username,\r\n password: password,\r\n realm: 'Username-Password-Authentication'\r\n }, async (error, result) => {\r\n if (error) {\r\n reject(error);\r\n }\r\n else { \r\n \r\n var data = {\r\n access_token: result.accessToken,\r\n refresh_token: result.refreshToken,\r\n id_token: result.idToken,\r\n scope: '',\r\n expires_in: result.expiresIn,\r\n token_type: 'access_token'\r\n };\r\n \r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"processtokensfromembeddedlogin\",\r\n \"environment\": environment,\r\n \"content_type\": \"json\",\r\n data: data \r\n }).then((axresponse) => {\r\n var axresult = axresponse.data;\r\n if (!axresult.success) {\r\n reject(axresult.errors);\r\n }\r\n var user = axresult.user;\r\n if (user) {\r\n var userToken = {\r\n \"name\": user.userfullname,\r\n \"token\": user.userToken,\r\n \"partyid\": user.partyid,\r\n \"username\": user.username\r\n };\r\n SaveAuth0Token(axresult.ad_ref_token);\r\n SaveADToken(userToken);\r\n setUserData(userToken);\r\n resolve(axresult);\r\n } \r\n }).catch((axerror) => {\r\n reject(axerror);\r\n });\r\n }\r\n })\r\n });\r\n }\r\n\r\n const ClearAuth0Tokens = (refToken) => {\r\n return new Promise((resolve, reject) => {\r\n var formData = new FormData();\r\n formData.append(\"refToken\", refToken);\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"cleartokens\",\r\n \"environment\": environment,\r\n data: formData\r\n }).then((axresult) => {\r\n resolve(axresult.data.success);\r\n }).catch((axerror) => {\r\n reject(axerror);\r\n });\r\n });\r\n }\r\n\r\n const AutoLogin = (refParam) => {\r\n return new Promise((resolve, reject) => {\r\n if (currentAction.length == 0) {\r\n currentAction.push(\"authenticating\");\r\n var auth0Token = refParam;\r\n if (!auth0Token) {\r\n auth0Token = GetAuth0TokenLocal();\r\n }\r\n if (auth0Token) {\r\n AutologinAPI(environment, auth0Token).then((userToken) => {\r\n sessionStorage.setItem('authenticatedWithAuth0', 'true');\r\n currentAction.pop();\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n currentAction.pop();\r\n reject(aerrors);\r\n });\r\n\r\n }\r\n else {\r\n currentAction.pop();\r\n resolve(null);\r\n }\r\n }\r\n });\r\n }\r\n \r\n const getUserToken = () => {\r\n return new Promise((resolve, reject) => {\r\n var refToken = params.refToken;\r\n var userToken = GetADToken(); \r\n if (isLoading) {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n //var checkADFECookie = true;\r\n //if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n // var authenticatedWithAuth0 = sessionStorage.getItem('authenticatedWithAuth0');\r\n // checkADFECookie = (authenticatedWithAuth0 && Boolean(authenticatedWithAuth0));\r\n //}\r\n //if (userToken?.token) {\r\n // RefreshADToken().then((result) => {\r\n // userToken = result;\r\n // resolve(userToken);\r\n // });\r\n //}\r\n //if (!userToken?.token && checkADFECookie) {\r\n // AuthenticateWithCookie().then((userToken) => {\r\n // if (userToken?.token) {\r\n // resolve(userToken);\r\n // }\r\n // }).catch((aerrors) => {\r\n // reject(aerrors);\r\n // });\r\n //}\r\n if (!userToken?.token || refToken) {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n AutoLogin(refToken).then((userToken) => {\r\n resolve(userToken);\r\n }).catch((aerrors) => {\r\n reject(aerrors);\r\n });\r\n }\r\n else {\r\n resolve(null);\r\n }\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n }).catch((cerrors) => {\r\n reject(cerrors);\r\n })\r\n }\r\n else {\r\n resolve(userToken);\r\n }\r\n });\r\n\r\n }\r\n\r\n const GetADRefToken = () => {\r\n var refToken = params.refToken;\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n return refToken;\r\n }\r\n \r\n const GetSocialConnections = () => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getsocialconnections\",\r\n \"environment\": environment\r\n }).\r\n then((response) => {\r\n var result = response.data;\r\n\r\n if (result.success) {\r\n resolve(result.connections);\r\n }\r\n else {\r\n reject(result.errors);\r\n }\r\n }).\r\n catch((error) => {\r\n var unexpected = []\r\n unexpected.push(error)\r\n reject(error);\r\n });\r\n });\r\n\r\n }\r\n\r\n const CheckEmail = (email) => {\r\n return new Promise((resolve, reject) => {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n if (configuration && configuration.authenticationprovidertype == \"auth0\") {\r\n GetAuth0UserByEmail(email, environment).then((auth0response) => {\r\n if (auth0response.status == 0) {\r\n resolve({ status: \"email_found\" }); \r\n }\r\n else {\r\n resolve({ status: \"email_not_found\" });\r\n }\r\n }).catch((errors) => {\r\n //setErrors(errors);\r\n reject(errors)\r\n });\r\n }\r\n });\r\n }); \r\n }\r\n\r\n function Logout(returnUrl, refToken) {\r\n GetCookieName().then((cookieName) => {\r\n DeleteCookie(cookieName);\r\n });\r\n\r\n if (!refToken) {\r\n refToken = GetAuth0TokenLocal();\r\n }\r\n if (refToken) {\r\n RemoveADToken();\r\n ClearAuth0Tokens(refToken).then((result) => {\r\n RemoveAuth0Token();\r\n }).catch((error) => {\r\n setErrors(ProcessErrors(error));\r\n });\r\n }\r\n \r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n \r\n var callBack = window.location.href;\r\n if (returnUrl) {\r\n callBack += \"?ReturnUrl=\" + returnUrl;\r\n }\r\n if (callBack.indexOf(\"?\") > 0) {\r\n callBack += \"&IsCallback=true\";\r\n }\r\n else {\r\n callBack += \"?IsCallback=true\";\r\n }\r\n webAuth.logout({ returnTo: callBack }); \r\n }\r\n\r\n const SendForgottenPasswordLink = (email) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('email', email);\r\n\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"sendforgottenpasswordlink\",\r\n \"environment\": environment,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result.errors);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n const ValidatePasswordResetToken = (token) => {\r\n return new Promise((resolve, reject) => {\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"validateresetpasswordtoken\",\r\n \"environment\": environment,\r\n \"identifier\": token\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n if (errors.length == 0) {\r\n result.errors.forEach((error) => {\r\n errors.push(error);\r\n });\r\n }\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((axiosErrors) => {\r\n errors.push(\"error.unexpected\");\r\n });\r\n });\r\n }\r\n\r\n const ResetPassword = (token, newPassword) => {\r\n return new Promise((resolve, reject) => {\r\n var bodyFormData = new FormData();\r\n bodyFormData.append('newPassword', newPassword);\r\n \r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"resetpassword\",\r\n \"environment\": environment,\r\n \"identifier\": token,\r\n data: bodyFormData\r\n }).then((response) => {\r\n var result = response.data;\r\n if (!result.success) {\r\n errors.push(ProcessErrors(result.errors));\r\n reject(result);\r\n }\r\n else {\r\n resolve(result);\r\n }\r\n }).catch((errors) => {\r\n errors.push((ProcessErrors(\"error.unexpected\")));\r\n });\r\n });\r\n }\r\n\r\n\r\n //if (!webAuth) {\r\n getWebAuth();\r\n //}\r\n\r\n if (isLoading) {\r\n getUserToken().then((userToken) => {\r\n setIsLoading(false);\r\n setUserData(userToken);\r\n\r\n }).catch((error) => {\r\n errors.push(ProcessErrors(\"error.unexpected\"));\r\n setIsLoading(false);\r\n });\r\n }\r\n else {\r\n var sessionToken = GetADToken()\r\n if (!userData && sessionToken) {\r\n setUserData(sessionToken);\r\n }\r\n }\r\n \r\n return {\r\n environment,\r\n userData,\r\n isLoading,\r\n setErrors,\r\n errors,\r\n ReturnUrl,\r\n CheckEmail,\r\n Login,\r\n Logout,\r\n GetADRefToken,\r\n GetSocialConnections,\r\n ClearUserData,\r\n SendForgottenPasswordLink,\r\n ValidatePasswordResetToken,\r\n ResetPassword\r\n }\r\n}\r\n\r\nfunction AuthenticationProvider(props) {\r\n\r\n const [configuration, setConfiguration] = useState(null);\r\n const GetAuthConfiguration = () => {\r\n let environment = getEnvironment();\r\n GetConfiguration(\"userconfiguration\", environment).then((response) => {\r\n console.log(response);\r\n setConfiguration(response);\r\n });\r\n }\r\n\r\n if (!configuration) {\r\n GetAuthConfiguration();\r\n }\r\n let authProviderType = configuration?.authenticationprovidertype;\r\n \r\nconsole.log(authProviderType);\r\n if (authProviderType == \"adnative\")\r\n return ();\r\n if (authProviderType == \"auth0embedded\")\r\n return ();\r\n if (authProviderType == \"auth0universal\")\r\n return ();\r\n else\r\n return ();\r\n \r\n}\r\n\r\n\r\nconst useAuth = () => {\r\n return React.useContext(AuthContext);\r\n}\r\nexport {AuthenticationProvider, useAuth}","import React from 'react';\r\nimport './MessageBox.css';\r\n\r\n//\r\nconst MessageBox = (props) => {\r\n return
    \r\n \r\n {props.children}\r\n
    \r\n}\r\n\r\nexport default MessageBox;","import React, { useEffect } from 'react';\r\nimport './ErrorBox.css';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../../i18n'\r\nimport { useAuth } from '../../Authentication/AuthenticationProvider';\r\nimport MessageBox from '../MessageBox/MessageBox';\r\n\r\n\r\n\r\n// const GenericErrorBox = (props) => {\r\n// return
    \r\n// \r\n// {props.children}\r\n//
    \r\n// }\r\n\r\nexport function GenericErrorBox(props) {\r\n\r\n const auth = useAuth();\r\n\r\n\r\n useEffect(() => {\r\n // console.log(auth)\r\n\r\n if (auth.setErrors) {\r\n auth.setErrors([]);\r\n }\r\n }, [window.location.href])\r\n\r\n const { t, i18n } = useTranslation();\r\n if (!props.errors || props.errors.length == 0) {\r\n return ('');\r\n }\r\n\r\n const errorList = [];\r\n\r\n props.errors.map((error) => { errorList.push({t(error)}) });\r\n return (props.universal ?
    \r\n \r\n \r\n {errorList}\r\n \r\n
    :
    \r\n \r\n {errorList}\r\n \r\n
    \r\n // {t('login.combinationdoesnotmatch')}\r\n );\r\n}\r\n\r\nexport function ProcessErrors(errors) {\r\n const errorList = [];\r\n\r\n const ProcessError = (error) => {\r\n switch (error) {\r\n case 'too_many_attempts':\r\n errorList.push('error.toomanyattempts');\r\n break;\r\n case 'invalid_grant':\r\n errorList.push('error.authenticationfailed');\r\n break;\r\n case 'error.resetpasswordtokenexpired':\r\n errorList.push('error.resetpasswordtokenexpired');\r\n break;\r\n case 'error.emailinuse':\r\n errorList.push('error.emailinuse');\r\n break;\r\n case 'error.incorrectemailpassword':\r\n errorList.push('error.incorrectemailpassword');\r\n break;\r\n case 'error.incorrectpassword':\r\n errorList.push('error.incorrectpassword');\r\n break;\r\n case 'error.concurrentusers':\r\n errorList.push('error.concurrentusers');\r\n break;\r\n default:\r\n if (error.startsWith(\"error.\")) {\r\n errorList.push(error);\r\n }\r\n else {\r\n errorList.push(\"error.\" + error);\r\n }\r\n break;\r\n }\r\n }\r\n\r\n if (errors.constructor === Array) {\r\n for (let i = 0; i < errors.length; i++) {\r\n ProcessError(errors[i]);\r\n }\r\n }\r\n //if (typeof errors === 'string') {\r\n // errorList.push(errors);\r\n //}\r\n else if (errors?.code) {\r\n ProcessError(errors.code);\r\n }\r\n else if (errors) {\r\n ProcessError(errors);\r\n }\r\n return errorList;\r\n}\r\n","import React, { Component, Fragment, useEffect } from 'react';\r\nimport { Container } from 'reactstrap';\r\nimport AbacusFooter from './Layout/AbacusFooter/AbacusFooter';\r\nimport AbacusHeader from './Layout/AbacusHeader/AbacusHeader';\r\nimport { GenericErrorBox } from './UI/ErrorBox/GenericErrorBox';\r\n\r\nconst Layout = props => { \r\n console.log(props);\r\n return (\r\n
    \r\n \r\n \r\n
    \r\n {props.children} \r\n
    \r\n \r\n
    \r\n );\r\n }\r\n\r\nexport default Layout;\r\n","import React, { useState, useEffect } from 'react';\r\nimport {useParams} from 'react-router-dom'\r\nimport { GetADToken } from '../Utilities/TokenManager';\r\nimport { APIPost } from '../API/APIRequest'\r\nimport { ErrorBox } from '../Utilities/ErrorBox'\r\nimport { GenericErrorBox } from '../UI/ErrorBox/GenericErrorBox';\r\n\r\nexport function LogWebActivity(props) {\r\n \r\n const [logged, setLogged] = useState(false);\r\n const [errors, setErrors] = useState([]);\r\n const { environment } = useParams();\r\n\r\n useEffect (() => {\r\n logWebActivity();\r\n }, [])\r\n\r\n const logWebActivity = () => {\r\n if (!logged) {\r\n const data = new FormData();\r\n var token = GetADToken();\r\n\r\n data.append('item', window.location.href);\r\n data.append('userToken', JSON.stringify(token));\r\n\r\n APIPost({\r\n \"controller\": \"WebActivity\",\r\n \"action\": \"SaveWebActivity\",\r\n \"environment\": environment,\r\n data: data\r\n }).then((response) => {\r\n setLogged(true);\r\n }).\r\n catch((error) => {\r\n var unexpected = [];\r\n unexpected.push(\"error.unexpected\");\r\n setErrors(unexpected);\r\n });\r\n \r\n }\r\n }\r\n return ();\r\n}\r\n","const ButtonSvg = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\nexport default ButtonSvg;","const ButtonSvgDark = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\nexport default ButtonSvgDark;","const UpdatedButton = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\nexport default UpdatedButton;","const UpdatingButton = () => {\r\n return (\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\nexport default UpdatingButton;","\r\nimport ButtonSvg from \"./ButtonSvg\";\r\nimport classes from './Button.module.css';\r\nimport './Button.css';\r\nimport ButtonSvgDark from \"./ButtonSvgDark\";\r\nimport ButtonSvgDisabled from \"./ButtonSvgDisabled\";\r\nimport UpdatedButton from \"./UpdatedButton\";\r\nimport UpdatingButton from \"./UpdatingButton\";\r\n\r\nconst Button = props => {\r\n \r\n let buttonType = () => {\r\n switch (props.btnType) {\r\n case 'primary':\r\n return \"primary-button\"\r\n case 'secondary':\r\n return \"secondary-button\"\r\n case 'ghost':\r\n return \"ghost-button\"\r\n case 'tierchiary':\r\n return 'tierchiary-button'\r\n default:\r\n return \"primary-button\"\r\n }\r\n }\r\n\r\n let btnSize = () => {\r\n switch (props.buttonSize) {\r\n case 'full-width':\r\n return \"full-width\"\r\n case 'large':\r\n return \"large\"\r\n case 'medium':\r\n return \"medium\"\r\n case 'small':\r\n return \"small\"\r\n default:\r\n return \"large\"\r\n }\r\n }\r\n if (props.isDisabled) {\r\n \r\n } \r\n\r\n\r\n return \r\n}\r\nexport default Button;","import React from 'react';\r\nimport './ErrorBox.css';\r\nconst ErrorBox = (props) => {\r\n return
    \r\n \r\n {props.children}\r\n
    \r\n}\r\n\r\nexport default ErrorBox;","import React, { useState, useEffect, useRef, Fragment } from 'react';\r\nimport './Transition.css';\r\n\r\nconst Transition = ({ timer, children, mountAnimation, containerClass }) => {\r\n\r\n const [mountState, setMountState] = useState(\"mount-start\")\r\n\r\n useEffect(() => {\r\n setTimeout(() => {\r\n setMountState(mountAnimation)\r\n }, timer || 200)\r\n\r\n }, [])\r\n\r\n useEffect(() => {\r\n return () => {\r\n setMountState(\"unmount\")\r\n //not working currently\r\n };\r\n }, []);\r\n\r\n\r\n return
    \r\n {children}\r\n
    \r\n}\r\n\r\nexport default Transition;","import React, { useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Button } from 'reactstrap';\r\nimport '../../../../i18n';\r\nimport Transition from '../../../UI/Transition/Transition';\r\nimport './SocialConnections.css';\r\n\r\nexport function SocialConnections(props) {\r\n const { t, i18n } = useTranslation();\r\n\r\n console.log(props.connections);\r\n console.log(props.onclick)\r\n \r\n const getDisplayData = () => {\r\n return (\r\n props.connections.map((connection) => (\r\n \r\n \r\n {t('social.' + connection.strategy)}\r\n {connection.strategy == 'facebook' ? \r\n \r\n : ''}\r\n {connection.strategy == 'google-oauth2' ? \r\n \r\n \r\n : ''}\r\n \r\n \r\n \r\n ))\r\n ) \r\n };\r\n \r\n var displayData = getDisplayData();\r\n console.log(displayData);\r\n return (\r\n <>\r\n {displayData} \r\n \r\n );\r\n}\r\n\r\n","import React, { useState, useEffect } from 'react';\r\nimport { format } from 'react-string-format';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../i18n'\r\nimport {APIGet,APIPost} from '../API/APIRequest'\r\nfunction IsSafeUrl(urlString, environment) {\r\n const IsSameSite = (urlString) => {\r\n var url = new URL(urlString);\r\n var currentHost = window.location.hostname;\r\n if (url.hostname == currentHost) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n const IsBrandDomain = (urlString, environment) => {\r\n return new Promise((resolve, reject) => {\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getcurrentbrand\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n var cookiedomain = result.brand.cookiedomain;\r\n if (cookiedomain) {\r\n var url = new URL(urlString);\r\n if (url.hostname.endsWith(cookiedomain)) {\r\n resolve(true);\r\n }\r\n }\r\n resolve(false);\r\n }\r\n else {\r\n resolve(false);\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n });\r\n }\r\n\r\n const IsTrustedHost = (urlString) => {\r\n return new Promise((resolve, reject) => { \r\n var url = new URL(urlString);\r\n APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"checktrustedhost\",\r\n \"environment\": environment,\r\n \"data\": {\r\n \"host\" : url.hostname\r\n }\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n resolve(result.trusted);\r\n }\r\n else {\r\n resolve(false);\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n });\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n if (IsSameSite(urlString)) {\r\n resolve(true);\r\n }\r\n IsBrandDomain(urlString, environment).then((result) => {\r\n if (result) {\r\n resolve(result);\r\n }\r\n else {\r\n IsTrustedHost(urlString, environment).then((result) => {\r\n resolve(result);\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n }\r\n }).catch((error) => {\r\n reject(error);\r\n });\r\n //resolve(false);\r\n });\r\n}\r\n\r\nfunction RedirectWarning(props) {\r\n\r\n const { t, i18n } = useTranslation();\r\n\r\n if (!props.isNotTrusted) {\r\n return ('');\r\n }\r\n return (
    \r\n
    \r\n
    \r\n
    \r\n {format(t('auth0callback.unsafeurlwarning'), props.returnUrl)}\r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    );\r\n}\r\n\r\nexport {IsSafeUrl, RedirectWarning}","import { useEffect } from 'react';\r\n\r\nconst addBodyClass = className => className && document.body.classList.add(className);\r\nconst removeBodyClass = className => className && document.body.classList.remove(className);\r\n\r\nexport default function useBodyClass(className) {\r\n useEffect(\r\n () => {\r\n // Set up\r\n \r\n className instanceof Array ? className.map(addBodyClass) : addBodyClass(className);\r\n\r\n // Clean up\r\n return () => {\r\n className instanceof Array\r\n ? className.map(removeBodyClass)\r\n : removeBodyClass(className);\r\n };\r\n },\r\n [className]\r\n );\r\n}","import React, { useEffect } from 'react';\r\n\r\nconst usePageTitle = title => {\r\n const documentDefined = typeof document !== 'undefined';\r\n const originalTitle = React.useRef(documentDefined ? document.title : null);\r\n\r\n useEffect(() => {\r\n if (!documentDefined) return;\r\n\r\n if (document.title !== title) document.title = title;\r\n\r\n return () => {\r\n document.title = originalTitle?.current;\r\n };\r\n }, [title]);\r\n};\r\n\r\nexport default usePageTitle;","import { Fragment, useState, forwardRef } from \"react\";\r\nimport InputNew from \"./Input.js\";\r\nimport ErrorBox from '../ErrorBox/ErrorBox';\r\nimport './InputRe.css';\r\nimport { Link } from \"react-router-dom\";\r\n//import { shouldProcessLinkClick } from \"react-router-dom/dist/dom\";\r\nconst InputWrapperRefacture = forwardRef((props, ref) => {\r\n\r\n const { description, edit, inputSize, text, label, btnText, optionalField, setButtonEvent, helpField, inputFieldType, route, value, onClickFunction } = props;\r\n\r\n\r\n const [showHelp, setShowHelp] = useState(false);\r\n const [showDetails, setShowDetails] = useState(false);\r\n const [showPassword, setShowPassword] = useState(false);\r\n const [editable, setEditable] = useState(false);\r\n const [inputType, setInputType] = useState();\r\n\r\n\r\n //basic text input with a label along with a standard subtext with an exception of email input box\r\n\r\n let inputWidth = () => {\r\n switch (inputSize) {\r\n case 'full-width':\r\n return \"full-width\"\r\n case 'large':\r\n return \"large\"\r\n case 'medium':\r\n return \"medium\"\r\n case 'small':\r\n return \"small\"\r\n default:\r\n return \"large\"\r\n }\r\n }\r\n\r\n const helpLinkHandler = (e) => {\r\n e.preventDefault();\r\n return setShowHelp(!showHelp);\r\n }\r\n\r\n const inputField = () => {\r\n return
    \r\n
    0) ? \"filled\" : \"\"}`}>\r\n \r\n {route ? {btnText} : (edit || onClickFunction) ? : \"\"}\r\n
    \r\n
    \r\n }\r\n\r\n const inputText = () => {\r\n return
    \r\n {text}\r\n
    \r\n }\r\n\r\n const checkboxField = () => {\r\n return
    \r\n
    \r\n \r\n
    \r\n {text && inputText()}\r\n
    \r\n }\r\n\r\n const radioField = () => {\r\n return
    \r\n \r\n {text && inputText()}\r\n
    \r\n }\r\n\r\n //div-wrapper is the class enclosing the input field and the button\r\n\r\n const passwordField = () => {\r\n return
    \r\n\r\n
    0) ? \"filled\" : \"\"}`}>\r\n \r\n \r\n
    \r\n\r\n
    \r\n }\r\n\r\n\r\n const labelField = () => {\r\n return
    \r\n
    \r\n \r\n

    {description}

    \r\n {/*not present in code this particular spec */} {(props.specs === \"search_input\") &&

    Type first letters to find..

    }\r\n
    \r\n
    \r\n {optionalField ?
    Optional |
    : \"\"}\r\n {helpField ? : \"\"}\r\n\r\n
    \r\n
    \r\n }\r\n\r\n\r\n\r\n return <>\r\n {(!label && !description && !optionalField && !helpField) ? !labelField() : labelField()}\r\n {inputFieldType === 'password' && passwordField()}\r\n {inputFieldType === 'checkbox' && checkboxField()}\r\n {inputFieldType === 'radio' && radioField()}\r\n\r\n {inputFieldType === 'text' && inputField()}\r\n\r\n \r\n\r\n\r\n})\r\nexport default InputWrapperRefacture;","import { useEffect } from 'react';\r\nimport { useAuth } from '../components/Authentication/AuthenticationProvider';\r\n\r\n\r\nexport default function useCreateUrl() {\r\n\r\n const auth= useAuth();\r\n const env= auth.environment;\r\n const returnUrl = auth.ReturnUrl() || sessionStorage.getItem(\"ReturnUrl\");\r\n const createUrl = (destination) => {\r\n \r\n let url = \"/\"\r\n if (env) {\r\n url += env + \"/\";\r\n }\r\n if(destination){\r\n url += destination+\"?ReturnUrl=\" + encodeURIComponent(returnUrl);\r\n return url\r\n }\r\n \r\n }\r\n return createUrl\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { useAuth } from '../components/Authentication/AuthenticationProvider';\r\n\r\n\r\n//we set the brand data in front-end through this.\r\n\r\nexport default function useBrandingData(brandData) {\r\n \r\n const [brandingData, setBranding] = useState(brandData); //brand data coming from backend\r\n\r\n\r\n useEffect(() => {\r\n setBranding(brandData);\r\n }, [brandData])\r\n\r\n //brandKey is the name of the brandElement here.\r\n const getBrandedHtml = (brandKey, value) => {\r\n if (brandData) {\r\n let tempText = brandingData[brandKey];\r\n if (brandKey == 'changeEmailText') {\r\n tempText = tempText?.replace(/##user_email##/g, value); //replacing the user_email string with the user entered value on front-end dynamically\r\n }\r\n return //returning the html\r\n }\r\n else {\r\n <>\r\n }\r\n }\r\n \r\n return { brandingData, getBrandedHtml };\r\n}\r\n","export const emailRegexUtils = /^[a-zA-Z0-9]+([.!#$%&'*+\\/=?^_`{|}~-]?[a-zA-Z0-9]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/\r\nexport const nameRegexUtils = /^[^<>%]*$/;","import React, { useState, useEffect, useRef, Fragment } from 'react';\r\nimport { useParams, Link, useNavigate, useRouter, useLocation } from 'react-router-dom'\r\nimport { useTranslation } from 'react-i18next';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport '../../../i18n';\r\nimport './LoginAuth.css'\r\nimport { format } from 'react-string-format';\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { SocialConnections } from '../Auth0/SocialConnections/SocialConnections'\r\nimport { APIRedirect } from '../../API/APIRequest'\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox'\r\nimport { IsSafeUrl, RedirectWarning } from '../../Utilities/SafeUrl'\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport useBodyClass from '../../../Hooks/useBodyClass';\r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\nimport ReactHtmlParser from 'html-react-parser';\r\nimport InputWrapperRefacture from '../../UI/Inputs/InputWrapperRefacture';\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport { isNewExpression } from 'typescript';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport useBrandingData from '../../../Hooks/useBrandingData';\r\nimport { emailRegexUtils } from '../../Utilities/EmailRegex';\r\nimport MessageBox from '../../UI/MessageBox/MessageBox';\r\nimport Transition from '../../UI/Transition/Transition';\r\n\r\n\r\n\r\n\r\nexport function LoginAuth(props) {\r\n // usePageTitle(`${!passwordRow ? t('register.title') : t('login.title')} - ${props.brandingLogin?.id}`); \r\n\r\n const { t, i18n } = useTranslation();\r\n const [errors, setErrors] = useState([]);\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [isNotTrusted, setIsNotTrusted] = useState(false);\r\n const [isDisabled, setIsDisabled] = useState(false);\r\n const [isInactive, setIsInactive] = useState(false);\r\n const [enteredEmailTouched, setEnteredEmailTouched] = useState(false);\r\n const [IsEmailInvalid, setIsEmailInvalid] = useState(false);\r\n const [IsEmailBlank, setIsEmailBlank] = useState(false);\r\n const [buttonEvent, setButtonEvent] = useState(false);\r\n const [IsBlank, setIsBlank] = useState({ email: false, password: false });\r\n const [socialConnections, setSocialConnections] = useState([]);\r\n const [nextAction, setNextAction] = useState(null);\r\n const [buttonState, setButtonState] = useState(\"initial\"); //the normal state of a button is initial, the other is loading state\r\n const [userPassword, setUserPassword] = useState(\"\")\r\n const [emailValid, setEmailValid] = useState(\"\");\r\n const inputRef = useRef(null);\r\n const headerRef = useRef(null);\r\n const formRef = useRef(null);\r\n const [combNotMatches, setCombNotMatches] = useState(false)\r\n const createUrl = useCreateUrl()\r\n const auth = useAuth();\r\n const navigate = useNavigate();\r\n const { environment } = useParams();\r\n const search = useLocation().search;\r\n const step = new URLSearchParams(search).get('step');\r\n const [userEmail, setUserEmail] = useState((step && localStorage.getItem('email')) ? (localStorage.getItem('email')) : \"\");\r\n const resetLinkEmail = new URLSearchParams(search).get('email') //query params\r\n const [mountState, setMountState]= useState(\"mount-start\")\r\n const [isEditTrue, setIsEditTrue] = useState(false);\r\n const { getBrandedHtml } = useBrandingData(props.brandingElement ? props.brandingElement : \"\");\r\n\r\n const emailRegex = emailRegexUtils;\r\n\r\n\r\n const CheckEmail = (event) => {\r\n\r\n event.preventDefault();\r\n\r\n setErrors(null);\r\n let email = userEmail.toLowerCase(); //as it was giving an error of case sensitivity in the API\r\n \r\n //after assessing the validity of the email address it'll go further\r\n if (emailInputIsValid()) {\r\n setButtonState(\"loading\")\r\n localStorage.setItem(\"email\", email)\r\n auth.CheckRegisteredAccount(email).then((result) => {\r\n\r\n if (result.status === \"email_found\") {\r\n setNextAction(\"password_required\");\r\n navigate(createUrl(\"login\") + \"&step=password\");\r\n setButtonState(\"initial\")\r\n }\r\n\r\n else {\r\n setNextAction(\"registration_required\");\r\n }\r\n // console.log(nextAction);\r\n }).catch((errors) => {\r\n\r\n setErrors(ProcessErrors(errors));\r\n setButtonState(\"initial\")\r\n });\r\n }\r\n }\r\n\r\n //componentDidMount\r\n useEffect(() => {\r\n sessionStorage.setItem(\"ad_ref_token\", null);\r\n headerRef.current?.focus();\r\n setErrors(null);\r\n \r\n }, [])\r\n\r\n\r\n //for login-screen 1st(email-required) and 2nd(password-required)\r\n useEffect(() => {\r\n if(step) {\r\n setNextAction(\"password_required\")\r\n setErrors(null);\r\n //if we find the query param email in the redirection link\r\n if (resetLinkEmail) {\r\n setUserEmail(resetLinkEmail)\r\n }\r\n }\r\n else {\r\n //when we land on the login-screen 1\r\n localStorage.clear();\r\n setErrors(null);\r\n setNextAction(null)\r\n }\r\n }, [step])\r\n\r\n //email address validation\r\n\r\n const Validated = () => {\r\n\r\n let validated = true;\r\n let passwordValue = userPassword\r\n let emailValue = userEmail || \"\";\r\n let temp = emailValue?.split(\"@\"); //for extracting the local part\r\n let localPart = temp ? temp[0] : \"\";\r\n setIsBlank(IsBlank => ({ ...IsBlank, password: false }))\r\n if ((emailValue?.match(emailRegex) || []).length <= 0 || localPart.length > 64) {\r\n validated = false;\r\n }\r\n\r\n //add email blank condtion as well as it is in isEmailInvalid() todo\r\n\r\n else if (nextAction === \"password_required\") {\r\n if (passwordValue < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, password: true }))\r\n validated &= false;\r\n\r\n }\r\n else { validated &= true }\r\n }\r\n\r\n if (!validated) {\r\n focusOnFirstError();\r\n }\r\n\r\n return validated;\r\n\r\n }\r\n\r\n //onSubmit focusing on first error causing input\r\n const focusOnFirstError = () => {\r\n setTimeout(() => {\r\n let firstElement = formRef.current?.querySelectorAll(\"input[invalidclass='Invalid-input']\")[0]\r\n firstElement?.focus();\r\n }, 200)\r\n\r\n }\r\n\r\n //email input validation - not blank and valid email address \r\n\r\n const emailInputIsValid = () => {\r\n setIsEmailBlank(false);\r\n setIsEmailInvalid(false);\r\n let emailValue = userEmail;\r\n let isValid = Validated();\r\n if (emailValue == \"\") {\r\n setIsEmailBlank(true)\r\n return false;\r\n }\r\n else if (!isValid) {\r\n setIsEmailInvalid(true);\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n\r\n }\r\n\r\n const PassThru = (event) => {\r\n event.preventDefault();\r\n let passThruUrl = auth.PassThruUrl();\r\n IsSafeUrl(passThruUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n window.location.replace(passThruUrl);\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(passThruUrl);\r\n }\r\n\r\n\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n\r\n setButtonState(\"initial\")\r\n });\r\n }\r\n\r\n const Login = (event) => {\r\n\r\n event.preventDefault();\r\n setErrors(null)\r\n let returnUrl = auth.ReturnUrl();\r\n if (Validated()) {\r\n setButtonState(\"loading\")\r\n auth.Login(userEmail, userPassword).then((response) => {\r\n let loginResult = response;\r\n let returnUri = new URL(returnUrl);\r\n if (returnUri.hostname != window.location.hostname) {\r\n let ad_ref_token = loginResult.ad_ref_token;\r\n if (returnUrl.indexOf('?') >= 0) {\r\n returnUrl += \"&\";\r\n }\r\n else {\r\n returnUrl += \"?\";\r\n }\r\n returnUrl += \"ref=\" + ad_ref_token;\r\n }\r\n\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n window.location.replace(returnUrl);\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(returnUrl);\r\n }\r\n\r\n\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n \r\n setButtonState(\"initial\")\r\n });\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n setButtonState(\"initial\")\r\n // added the checnk for concurrency error, which is not coming from the controller but pushing to the error list to get it from the languages.\r\n // if we add the error to the controller and the value is not error.concurrentusers the error won't appear\r\n if (errors[0] === \"Maximum number of cookies exceeded\") {\r\n setErrors(ProcessErrors('error.concurrentusers'))\r\n } \r\n if (errors[0] === \"error.deceased\") {\r\n setIsDisabled(true);\r\n navigate(createUrl(\"warning\"));\r\n }\r\n if (errors[0] === \"error.inactive\") {\r\n setIsInactive(true)\r\n navigate(createUrl(\"warning\"));\r\n }\r\n if (errors[0] === \"error.accountlocked\") {\r\n setIsInactive(true)\r\n navigate(createUrl(\"warning\"));\r\n }\r\n\r\n });\r\n }\r\n }\r\n\r\n const SocialSignIn = (event) => {\r\n event.preventDefault();\r\n\r\n let connection = event.target.dataset.connection;\r\n\r\n let returnUrl = auth.ReturnUrl();\r\n var data = {\r\n \"ReturnUrl\": returnUrl,\r\n \"connection\": connection\r\n };\r\n \r\n APIRedirect({\r\n \"controller\": \"auth0\",\r\n \"action\": \"socialsignin\",\r\n \"environment\": environment,\r\n data : data\r\n });\r\n }\r\n\r\n let passwordRow = '';\r\n\r\n useBodyClass(['login', 'anotherlogin', props.brandingElement?.bodyClass]);\r\n const pageTitle = !passwordRow ? `${t('register.title')} - ${props.brandingElement?.id}` : `${t('login.title')} - ${props.brandingElement?.id}`;\r\n\r\n\r\n usePageTitle(pageTitle)\r\n\r\n useEffect(() => {\r\n\r\n // console.log(nextAction);\r\n if (isLoading) {\r\n auth.GetSocialConnections().then((connections) => {\r\n setSocialConnections(connections);\r\n setIsLoading(false);\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n setIsLoading(false);\r\n })\r\n }\r\n }, [isLoading]);\r\n\r\n //componentWillUnmount\r\n useEffect(() => {\r\n setButtonState(\"initial\")\r\n return () => {\r\n setButtonState(\"initial\") //when we leave the page it sets button state to initial on change of url\r\n };\r\n }, [window.location.href])\r\n\r\n\r\n const handleOnBlur = (e) => {\r\n if (buttonEvent) {\r\n document.getElementById(\"password\").focus();\r\n setButtonEvent(false)\r\n e.preventDefault();\r\n }\r\n }\r\n\r\n const onTextFieldKeyed = (event) => {\r\n if ((event.key.match(emailRegex) || []).length > 0) {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n let returnUrl = auth.ReturnUrl();\r\n if (nextAction===\"password_required\"){\r\n passwordRow = <>\r\n
    \r\n
    \r\n { handleOnBlur(e) }}\r\n setButtonEvent={setButtonEvent}\r\n aria-invalid={IsBlank.password}\r\n aria-describedby=\"password-blank-error\"\r\n invalidClass={(IsBlank.password) ? \"Invalid-input\" : \"\"}\r\n onChange={(e) => setUserPassword(e.target.value)} />\r\n\r\n {IsBlank.password && {t('login.blankpasswordinput')}}\r\n\r\n { navigate(createUrl(\"forgottenpassword\"), { replace: true }) }}>

    {t('forgottenpassword.linktext')}

    \r\n
    \r\n
    \r\n }\r\n \r\n\r\n useEffect(() => {\r\n if (nextAction == \"registration_required\") {\r\n\r\n navigate(createUrl(\"register\"));\r\n }\r\n if (nextAction == \"forgot_password\") {\r\n\r\n navigate(createUrl(\"forgottenpassword\"));\r\n }\r\n if (nextAction === \"password_required\") {\r\n\r\n setTimeout(() => { inputRef.current?.focus() }, 100);\r\n\r\n\r\n }\r\n\r\n // console.log(nextAction, \"inside-useEffect\")\r\n\r\n }, [nextAction])\r\n\r\n const termsText = props.brandingElement?.termsText || '';\r\n\r\n useBodyClass(['login', 'anotherlogin', props.brandingElement?.bodyClass]);\r\n const title = !passwordRow ? `${t('register.title')} - ${props.brandingElement?.id}` : `${t('login.title')} - ${ props.brandingElement?.id }`;\r\n const titleEdit = !passwordRow ? `${t('register.titleEdit')} - ${props.brandingElement?.id}` : `${t('login.title')} - ${ props.brandingElement?.id }`;\r\n\r\n //usePageTitle(title + props.brandingElement.id); \r\n usePageTitle(!isEditTrue ? title : titleEdit);\r\n \r\n\r\n //edit button on email field\r\n const handleOnEdit = (val) => {\r\n setNextAction(val);\r\n setErrors(null);\r\n navigate(createUrl(\"login\"));\r\n setIsEditTrue(true)\r\n \r\n }\r\n\r\n let chooseError = \r\n\r\n if (isDisabled) {\r\n chooseError = '';\r\n } else {\r\n if (isInactive) {\r\n chooseError = '';\r\n\r\n }\r\n }\r\n\r\n console.log(auth);\r\n\r\n if (auth.authProviderType === \"auth0\") {\r\n auth.GotoUniversalLogin(\"\");\r\n return (<>);\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n\r\n \r\n \r\n
    \r\n \r\n \r\n
    \r\n {/*to make the screen reader read out the module heading we explicitly make it focus on it as the mounting happens*/}\r\n

    {!passwordRow ? t('login.createorlogin') : t('login.title') }

    \r\n
    \r\n \r\n {chooseError} \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n\r\n { setUserEmail(e.target.value) }}\r\n readOnly={nextAction == \"password_required\" ? \"readOnly\" : \"\"} />\r\n\r\n \r\n {IsEmailBlank && {t('login.blankemailinput')}}\r\n {IsEmailInvalid ? props.brandingElement?.mailValidError ? {getBrandedHtml('mailValidError')} : {t('login.incorrectemailinput')} : \"\"}\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n \r\n \r\n
    \r\n {passwordRow}\r\n
    \r\n\r\n \r\n \r\n
    \r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" ?\r\n \r\n : \"\"}\r\n
    \r\n {auth.PassThruUrl() ?\r\n
    \r\n
    {t('login.guestcontinuetext')}
    \r\n {t('login.guestcontinuebutton')}\r\n
    \r\n : \"\"\r\n }\r\n \r\n
    \r\n {auth.authProviderType === \"auth0\" ?\r\n <>\r\n \r\n {!passwordRow ?
    \r\n
    {t('login.textbetweennativeorsociallogin')}
    : ''}\r\n
    \r\n \r\n \r\n \r\n\r\n {socialConnections.length !== 0 ?\r\n \r\n {nextAction === \"password_required\" ? \"\" :
    {ReactHtmlParser(termsText)}
    }\r\n
    \r\n : \"\"}\r\n \r\n : \"\"\r\n }\r\n \r\n\r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n\r\n \r\n );\r\n\r\n}\r\n\r\n","import React, { useState, useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../i18n'\r\nimport { GetConfiguration } from '../Configuration/ConfigurationManager'\r\nimport { ErrorBox, ProcessErrors } from '../Utilities/ErrorBox'\r\nimport { useAuth } from './AuthenticationProvider'\r\nimport { LoginAuth } from './Login/LoginAuth'\r\nimport { GenericErrorBox } from '../UI/ErrorBox/GenericErrorBox';\r\nimport usePageTitle from '../../Hooks/usePageTitle'\r\nexport function Login(props) {\r\n const { t, i18n } = useTranslation();\r\n const [providerType, setProviderType] = useState('none');\r\n const [NotFound, setNotFound] = useState(false);\r\n const [errors, setErrors] = useState([]);\r\n //const [returnUrl, setReturnUrl] = useState(null);\r\n const auth = useAuth();\r\n usePageTitle(`Sign in or create an account - ${props?.brandingLogin?.id}`);\r\n var returnUrl = auth.ReturnUrl();\r\n if (!returnUrl) {\r\n if (errors.length == 0) {\r\n errors.push('error.noreturnurl');\r\n }\r\n return ()\r\n }\r\n \r\n return ();\r\n}\r\n\r\n","import React, { useState, useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../i18n'\r\nimport { useAuth } from './AuthenticationProvider'\r\nimport { useParams, Link } from 'react-router-dom'\r\nimport { GetConfiguration } from '../Configuration/ConfigurationManager'\r\nimport { GetADToken } from '../Utilities/TokenManager'\r\nimport { IsSafeUrl, RedirectWarning } from '../Utilities/SafeUrl'\r\nimport { ErrorBox } from '../Utilities/ErrorBox'\r\nimport { GenericErrorBox } from '../UI/ErrorBox/GenericErrorBox'; \r\nimport usePageTitle from '../../Hooks/usePageTitle';\r\nexport function Logout(props) {\r\n const auth = useAuth();\r\n const [errors, setErrors] = useState([]);\r\n const [isNotTrusted, setIsNotTrusted] = useState('');\r\n const { environment } = useParams();\r\n const [currentOperation, setCurrentOperation] = useState([]);\r\n\r\n var params = (new URL(document.location)).searchParams;\r\n var returnUrl = params.get(\"ReturnUrl\");\r\n var refToken = params.get(\"refToken\");\r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n var isCallback = params.get(\"IsCallback\");\r\n \r\n if (!isCallback && currentOperation.length == 0) {\r\n currentOperation.push(\"logout\");\r\n auth.Logout(returnUrl, refToken);\r\n }\r\n else {\r\n if (auth.userData) {\r\n auth.ClearUserData();\r\n }\r\n }\r\n \r\n var canRedirect = !auth.userData;\r\n const redirectToLoginUrl = window.location.href.replace(\"logout\", \"login\");\r\n\r\n usePageTitle(`Logout processing - ${props.brandingElement?.id}`);\r\n if (canRedirect) {\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n window.location.href = redirectToLoginUrl;\r\n }\r\n else {\r\n window.location.href= redirectToLoginUrl\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(redirectToLoginUrl);\r\n }\r\n }\r\n\r\n }).catch((error) => {\r\n errors.push(error);\r\n });\r\n }\r\n return (
    \r\n \r\n \r\n
    );\r\n}","import React, { useState, useEffect } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../../i18n'\r\nimport { useParams, Link } from 'react-router-dom'\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { Loading } from '../../Utilities/Loading';\r\nimport { IsSafeUrl, RedirectWarning } from '../../Utilities/SafeUrl';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport { APIPost } from '../../API/APIRequest';\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\n\r\nexport function Auth0Callback(props) {\r\n const [errors, setErrors] = useState([]);\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [isNotTrusted, setIsNotTrusted] = useState(false);\r\n \r\n const { environment } = useParams();\r\n const params = (new URL(document.location)).searchParams; \r\n const state = params.get(\"state\");\r\n const code = params.get(\"code\")\r\n var returnUrl = params.get(\"ReturnUrl\");\r\n const createUrl = useCreateUrl();\r\n\r\n useEffect(() => {\r\n if (isLoading) {\r\n ProcessUniversalAuthentication();\r\n setIsLoading(false);\r\n }\r\n });\r\n\r\n const ProcessUniversalAuthentication = () => { \r\n var data = {\r\n ReturnUrl: returnUrl,\r\n state: state,\r\n code: code\r\n };\r\n\r\n APIPost({\r\n \"controller\": \"auth0\",\r\n \"action\": \"AuthorizeCallback\",\r\n \"environment\": environment,\r\n data: data\r\n }).then((response) => {\r\n var result = response.data;\r\n if (result.success) {\r\n if (!returnUrl) {\r\n returnUrl = window.location.origin;\r\n }\r\n\r\n var returnUri = new URL(returnUrl);\r\n returnUri.searchParams.append(\"ref\", result.refToken);\r\n\r\n returnUrl = returnUri.href;\r\n\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n window.location.href = returnUrl;\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(true);\r\n }\r\n } \r\n\r\n }).catch((error) => {\r\n setErrors(ProcessErrors(error));\r\n });\r\n }\r\n else {\r\n setErrors(ProcessErrors(result.errors));\r\n window.location.href = createUrl(\"warning\");\r\n \r\n }\r\n });\r\n };\r\n\r\n \r\n return (\r\n
    \r\n \r\n \r\n \r\n
    \r\n );\r\n}\r\n\r\n","import { forwardRef, Fragment, useState } from \"react\";\r\nimport './Input.css';\r\nimport './ToggleInput.css';\r\nconst InputNew =(props) => {\r\n\r\n const { description, altText, showHelp, typeInThree, specs, value } = props;\r\n const [filled, setFilled]= useState(false) \r\n let inputType = () => {\r\n switch (props.inputType) {\r\n case 'text':\r\n return \"text\"\r\n case 'email':\r\n return \"email\" //added by megha\r\n case 'checkbox':\r\n return \"checkbox\"\r\n case 'radio':\r\n return \"radio\"\r\n case 'submit':\r\n return 'submit'\r\n default:\r\n return \"text\"\r\n }\r\n }\r\n\r\n let inputSize = () => {\r\n switch (props.inputSize) {\r\n case 'full-width':\r\n return \"full-width\"\r\n case 'medium':\r\n return \"medium\"\r\n case 'small':\r\n return \"small\"\r\n default:\r\n return \"full-width\"\r\n }\r\n }\r\n\r\n \r\n //switch case for returning UI on the basis of inputType\r\n const basicInputUI=()=>{\r\n switch (props.inputType) {\r\n case 'text':\r\n return get_Text_Input()\r\n case 'password':\r\n return get_Text_Input() \r\n case 'radio':\r\n return get_Radio_Input()\r\n case 'checkbox':\r\n return get_Radio_Input()\r\n default:\r\n return get_Text_Input()\r\n }\r\n }\r\n\r\n //for checkboxes and radios\r\n const get_Radio_Input = () => {\r\n return <>\r\n {specs == \"toggle_switch\" ?\r\n \r\n :\r\n \r\n }\r\n \r\n }\r\n\r\n //for text inputs, emails.\r\n const get_Text_Input = () => {\r\n return <>\r\n \r\n \r\n 0) ? \"filled\" : \"\"} `} type={props.inputType||props.type} {...props} />\r\n \r\n }\r\n\r\n return \r\n {basicInputUI()}\r\n \r\n}\r\n\r\n\r\n\r\nexport default InputNew","import { forwardRef, Fragment, useState } from \"react\";\r\nimport {Link} from \"react-router-dom\";\r\nimport InputNew from \"./InputNew.js\";\r\n//import './Input.css';\r\n//import { shouldProcessLinkClick } from \"react-router-dom/dist/dom\";\r\nconst InputWrapper = (props) => {\r\n\r\n const { description, altText,edit, type, inputType, inputSize, label, details,btnText, showBtnText, hideBtnText, btnHandler, helpText, specs, subscriptionAmount, subscriptionPeriod } = props;\r\n\r\n const [showHelp, setShowHelp] = useState(false);\r\n const [showDetails, setShowDetails] = useState(false);\r\n const [showPassword, setShowPassword] = useState(false);\r\n const [editable, setEditable]=useState(false)\r\n //switch case for different Input Components\r\n const getInputUIForSpecs = () => {\r\n switch (specs) {\r\n case 'radio_and_checkbox_input':\r\n return radio_and_checkbox_input()\r\n case 'toggle_switch':\r\n return toggle_switch()\r\n case 'radio_input_with_altText':\r\n return radio_input_with_altText()\r\n case 'radio_input_with_description':\r\n return radio_input_with_description()\r\n case 'text_input_with_button':\r\n return text_input_with_button()\r\n case 'text_input_with_help':\r\n return text_input_with_help()\r\n case 'radio_input_with_border':\r\n return radio_input_with_border()\r\n case 'text_input':\r\n return text_input()\r\n case 'checkbox_input_for_amount':\r\n return checkbox_input_for_amount()\r\n case 'text_input_for_details':\r\n return text_input_for_details()\r\n case 'password_input_with_button':\r\n return password_input_with_button()\r\n default:\r\n return text_input() \r\n\r\n\r\n\r\n }\r\n }\r\n\r\n const getInputUIForType=()=>{\r\n switch (type){\r\n case 'text':\r\n return text_input()\r\n case 'password':\r\n return password_input_with_button()\r\n case 'radio':\r\n return radio_and_checkbox_input()\r\n case 'checkbox':\r\n return radio_and_checkbox_input()\r\n case 'email':\r\n return text_input()\r\n default :\r\n return text_input()\r\n \r\n\r\n \r\n\r\n \r\n\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n //radio and checkbox inputs in the application\r\n const radio_and_checkbox_input = () => {\r\n return
    \r\n \r\n \r\n
    \r\n }\r\n\r\n //switch inputs in the application\r\n const toggle_switch = () => {\r\n return
    \r\n

    {label}

    \r\n
    \r\n }\r\n\r\n //radio and checkbox inputs with altText \r\n const radio_input_with_altText = () => {\r\n return
    \r\n {radio_and_checkbox_input()}\r\n

    {altText}

    \r\n
    \r\n\r\n }\r\n\r\n //radio and checkbox inputs with description\r\n const radio_input_with_description = () => {\r\n return
    \r\n {radio_and_checkbox_input()}\r\n {specs === \"radio_input_with_description\" && description &&

    {description}

    }\r\n
    \r\n\r\n }\r\n\r\n //radio and checkbox inputs with border\r\n const radio_input_with_border = () => {\r\n return
    \r\n {radio_and_checkbox_input()}\r\n
    \r\n\r\n }\r\n\r\n //text and psw input with a button\r\n const text_input_with_button = () => {\r\n return
    \r\n \r\n {(props.specs === \"search_input\") &&

    Type first letters to find..

    }\r\n
    \r\n \r\n {edit? {btnText}:\"\"}\r\n
    \r\n
    \r\n \r\n }\r\n //text and psw input with a button------to be edited later\r\n const text_input_with_button1 = () => {\r\n return
    \r\n \r\n {(props.specs === \"search_input\") &&

    Type first letters to find..

    }\r\n
    \r\n \r\n {edit? :\"\"}\r\n
    \r\n
    \r\n }\r\n\r\n //psw input\r\n const password_input_with_button = () => {\r\n return
    \r\n \r\n {(props.specs === \"search_input\") &&

    Type first letters to find..

    }\r\n
    \r\n \r\n \r\n \r\n
    \r\n
    \r\n }\r\n\r\n //text inputs with a help text which toggles with a button\r\n const text_input_with_help = () => {\r\n return
    \r\n
    \r\n \r\n {getHelpTextUI()}\r\n
    \r\n

    Type first three letters to find..

    \r\n {showHelp && helpText &&
    \r\n

    About this question

    \r\n

    {helpText}

    \r\n
    }\r\n \r\n \r\n \r\n
    \r\n\r\n }\r\n\r\n\r\n //text inputs for details which toggles with a button\r\n const text_input_for_details = () => {\r\n return
    \r\n
    \r\n

    Tell me more about this

    \r\n \r\n
    \r\n\r\n {showDetails && details &&

    {details}

    }\r\n\r\n
    \r\n\r\n }\r\n\r\n //basic text input with a label along with a standard subtext with an exception of email input box\r\n const text_input = () => {\r\n return
    \r\n \r\n {(props.specs === \"search_input\") &&

    Type first letters to find..

    }\r\n \r\n \r\n \r\n
    \r\n\r\n }\r\n\r\n \r\n\r\n\r\n //returns the ui of help text section in text_input_with_help\r\n const getHelpTextUI = () => {\r\n return
    \r\n Optional |\r\n \r\n\r\n
    \r\n\r\n\r\n }\r\n\r\n\r\n //checkbox input for selection of subscription amount and cycle\r\n const checkbox_input_for_amount = () => {\r\n return
    \r\n
    \r\n \r\n

    {subscriptionPeriod}

    \r\n
    \r\n \r\n\r\n
    \r\n }\r\n\r\n\r\n\r\n return \r\n\r\n {!specs ? getInputUIForType : getInputUIForSpecs() }\r\n \r\n}\r\nexport default InputWrapper;","import { Fragment, useState, forwardRef } from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\n//import { shouldProcessLinkClick } from \"react-router-dom/dist/dom\";\r\nconst Checkbox = forwardRef((props, ref) => {\r\n\r\n const { inputSize, label, id} = props;\r\n\r\n\r\n const [showHelp, setShowHelp] = useState(false);\r\n\r\n\r\n //basic text input with a label along with a standard subtext with an exception of email input box\r\n\r\n let inputWidth = () => {\r\n switch (inputSize) {\r\n case 'full-width':\r\n return \"full-width\"\r\n case 'large':\r\n return \"large\"\r\n case 'medium':\r\n return \"medium\"\r\n case 'small':\r\n return \"small\"\r\n default:\r\n return \"large\"\r\n }\r\n }\r\n\r\n const helpLinkHandler = (e) => {\r\n e.preventDefault();\r\n return setShowHelp(!showHelp);\r\n }\r\n\r\n\r\n\r\n\r\n return <>\r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n\r\n \r\n\r\n\r\n})\r\nexport default Checkbox;","\r\nconst setStateAsync = (callback)=>{\r\n setTimeout(callback,200)\r\n }\r\n\r\nexport default setStateAsync; ","import React, { Component, useState } from 'react';\r\nimport { useParams } from 'react-router-dom';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../../i18n';\r\nimport './PasswordValidations.css';\r\nimport { format } from 'react-string-format';\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport InputWrapper from '../../UI/Inputs/InputWrapper';\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport InputWrapperRefacture from '../../UI/Inputs/InputWrapperRefacture';\r\nimport setStateAsync from '../../Utilities/SetStateAsync';\r\n\r\nexport function Password(props) {\r\n const { t, i18n } = useTranslation();\r\n const [sent, setSent] = useState(false);\r\n const [errors, setErrors] = useState([]);\r\n const { environment } = useParams();\r\n const auth = useAuth();\r\n const [passwordRules, setPasswordRules] = useState(null);\r\n const [passwordCounts, setPasswordCounts] = useState({ length: 0, upper: 0, lower: 0, digit: 0, special: 0 });\r\n const [password, setUserPassword] = useState(\"\");\r\n const [pswStatus, setPswStatus] = useState(\"initial\");\r\n const [pswError, setPswError] = useState(false);\r\n const [focused, setFocused] = useState(false);\r\n const [buttonEvent, setButtonEvent] = useState(false);\r\n const [IsBlank, setIsBlank] = useState({password:false});\r\n \r\n\r\n\r\n\r\n // const { token } = useParams();\r\n\r\n function getPasswordRules() {\r\n \r\n if (!passwordRules) {\r\n GetConfiguration(\"userconfiguration\", environment).then((configuration) => {\r\n setPasswordRules(JSON.parse(configuration.passwordrules));\r\n });\r\n \r\n }\r\n }\r\n\r\n \r\n\r\n //password change handler\r\n\r\n const onPasswordChanged = (event) => {\r\n \r\n let psw=event.target.value;\r\n let updatedCounts = {};\r\n if(psw.length<1){setPswError(false)}\r\n updatedCounts.length = psw.length;\r\n updatedCounts.upper = (psw.match(/[A-Z]/g) || []).length;\r\n updatedCounts.lower = (psw.match(/[a-z]/g) || []).length;\r\n updatedCounts.digit = (psw.match(/[0-9]/g) || []).length;\r\n updatedCounts.special = (psw.match(/[^A-Za-z0-9]/g) || []).length;\r\n setPasswordCounts(updatedCounts);\r\n isPasswordValid(updatedCounts)\r\n props.setUserPassword(event.target.value)\r\n setUserPassword(event.target.value)\r\n }\r\n\r\n\r\n //for getting the UI of a password rule\r\n\r\n const getPswRuleUI = (ruleText, iconClass) => {\r\n return
    \r\n \r\n {ruleText}
    \r\n }\r\n\r\n // function returning the psw rules as per the validations\r\n\r\n \r\n\r\n const getPswRulesUI = () => {\r\n\r\n return
    \r\n
    {t('register.passwordmusttext')}:
    \r\n
    \r\n \r\n \r\n \r\n {passwordRules?.minlength !== 0 ?\r\n getPswRuleUI(format(t('register.passwordruleslength'), passwordRules?.minlength),\r\n passwordCounts.length >= passwordRules?.minlength ? \"checked\" :\r\n (passwordCounts.length < passwordRules?.minlength) && pswError ? \"unchecked\" : \"bullet-circle\"):\"\"}\r\n \r\n {passwordRules?.upper !== 0 ?\r\n getPswRuleUI(format(t('register.passwordupper'), passwordRules?.upper),\r\n passwordCounts.upper >= passwordRules?.upper ? \"checked\" :\r\n (passwordCounts.upper < passwordRules?.upper) && pswError ? \"unchecked\" : \"bullet-circle\"):\"\"}\r\n \r\n {passwordRules?.digit !== 0 ?\r\n getPswRuleUI(format(t('register.passwordnumber'), passwordRules?.digit),\r\n passwordCounts.digit >= passwordRules?.digit ? \"checked\" :\r\n (passwordCounts.digit < passwordRules?.digit) && pswError ? \"unchecked\" : \"bullet-circle\"):\"\"}\r\n {passwordRules?.special !== 0 ?\r\n getPswRuleUI(format(t('register.passwordspecial'), passwordRules?.special),\r\n passwordCounts.special >= passwordRules?.special ? \"checked\" :\r\n (passwordCounts.special < passwordRules?.special) && pswError ? \"unchecked\" : \"bullet-circle\"):\"\"}\r\n {passwordRules?.lower !== 0 ?\r\n getPswRuleUI(format(t('register.passwordlower'), passwordRules?.lower),\r\n passwordCounts.lower >= passwordRules?.lower ? \"checked\" :\r\n (passwordCounts.lower < passwordRules?.lower) && pswError ? \"unchecked\" : \"bullet-circle\"):\"\"} \r\n \r\n
    \r\n
    \r\n }\r\n\r\n //checking the password validity\r\n\r\n const isPasswordValid = (pc) => {\r\n \r\n\r\n {\r\n if (((passwordRules?.minlength !==0 && pc.length >= passwordRules?.minlength) || passwordRules?.minlength === 0)\r\n && ((passwordRules?.upper !== 0 && pc.upper >= passwordRules?.upper) || passwordRules?.upper === 0 )\r\n && ((passwordRules?.lower !== 0 && pc.lower >= passwordRules?.lower) || passwordRules?.lower === 0 )\r\n && ((passwordRules?.digit !== 0 && pc.digit >= passwordRules?.digit) || passwordRules?.digit === 0)\r\n && ((passwordRules?.special !== 0 && pc.special >= passwordRules?.special) || passwordRules?.special === 0 )) {\r\n \r\n setPswStatus(\"valid\")\r\n props.setPswValid(\"true\");\r\n\r\n }\r\n else {\r\n setPswStatus(\"invalid\")\r\n props.setPswValid(\"false\");\r\n }\r\n }\r\n }\r\n\r\n\r\n //onFocus handler to handle the psw status message\r\n const handleOnFocus = () => {\r\n setStateAsync(()=>{\r\n setFocused(true);\r\n })\r\n \r\n }\r\n\r\n\r\n //onBlur handler checking the psw validity to handle the psw error message\r\n const handleOnBlur = (e) => {\r\n if(buttonEvent){\r\n document.getElementById(\"password\").focus()\r\n setButtonEvent(false)\r\n e.preventDefault();\r\n }\r\n \r\n else{\r\n\r\n //as handleOnBlur does not work synchronously when it is with setState\r\n setStateAsync(()=>{\r\n setFocused(false)\r\n if(password.length<1) \r\n { setPswError(false)\r\n props.setIsBlank(IsBlank=>({...IsBlank, newpassword:true, password:true}))\r\n setIsBlank(IsBlank=>({...IsBlank,password:true}))\r\n \r\n }\r\n else\r\n {props.setIsBlank(IsBlank=>({...IsBlank, newpassword:false, password:false}))\r\n setIsBlank(IsBlank=>({...IsBlank,password:false}))}\r\n setPswError((pswStatus===\"invalid\" && password.length>1) ? true : false)\r\n })\r\n \r\n }\r\n }\r\n\r\n //email validation\r\n \r\n const emailRegex= /^\\w+([\\.-/+?`$-_%&=~!'|#{*^}]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/\r\n \r\n //fetching password rules\r\n getPasswordRules();\r\n\r\n return (<>\r\n \r\n \r\n { handleOnBlur(e) }}\r\n onFocus={(e) => { handleOnFocus(e) }}\r\n showBtnText={t('input.showpasswordlabel')}\r\n hideBtnText={t('input.hidepasswordlabel')}\r\n name=\"password\"\r\n inputFieldType=\"password\"\r\n invalidClass={pswError || IsBlank.password ||props.IsBlank.newpassword ||props.IsBlank.password ? \"Invalid-input\" : \"\"}\r\n onChange={onPasswordChanged}\r\n aria-invalid={pswError || IsBlank.password ||props.IsBlank.newpassword ||props.IsBlank.password }\r\n aria-describedby=\"password-errors\"\r\n {...props} />\r\n \r\n \r\n {props.IsBlank.password ? {t('register.blankpassword')} : props.IsBlank.newpassword ? {t('updatepassword.blanknewpassword')}:\"\"} \r\n {pswError && {t('register.passworderror')}} {/*to show on blur error message*/}\r\n {focused && getPswRulesUI()} {/*to show on focus psw status*/}\r\n \r\n \r\n\r\n )\r\n}\r\n\r\n","import { useTranslation } from 'react-i18next';\r\nimport '../../i18n'\r\nimport '../../general.css'\r\nimport ErrorBoxCS from '../UI/ErrorBox/ErrorBox';\r\n\r\nexport function RecaptchaError(props) {\r\n const { t, i18n } = useTranslation();\r\n return (\r\n
    \r\n {t('recaptcha.nothumanerror')}\r\n
    \r\n );\r\n}","import React, { forwardRef, useRef, useMemo, useImperativeHandle, useEffect, useState } from \"react\";\r\nimport { Model, Serializer } from \"survey-core\";\r\nimport { Survey } from \"survey-react-ui\";\r\nimport { APIGet } from '../../API/APIRequest';\r\nimport { useParams } from 'react-router-dom'\r\nimport \"survey-core/defaultV2.min.css\";\r\nimport \"./resetSurvey.scss\"\r\n\r\nSerializer.addProperty(\"dropdown\", { name: \"adOtherValue:string\" });\r\nSerializer.addProperty(\"dropdown\", { name: \"dataEndpoint:string\" });\r\nSerializer.addProperty(\"radiogroup\", { name: \"adOtherValue:string\" });\r\nSerializer.addProperty(\"checkbox\", { name: \"adOtherValue:string\" });\r\n[\"text\", \"comment\", \"date\", \"datetime\", \"dropdown\"].forEach(type => {\r\n Serializer.addProperty(type, { name: \"answerCode:string\" });\r\n});\r\n\r\nconst SurveyForm = forwardRef(({ surveyCode } , ref) => {\r\n const [surveyData, setSurveyData] = useState(null);\r\n const { environment } = useParams();\r\n const surveyJson = \r\n\r\n {\r\n showNavigationButtons: false,\r\n name: \"demographics\",\r\n elements: [\r\n {\r\n type: \"radiogroup\",\r\n name: \"sf_radiobox_1\",\r\n title: \"Radiobox with other?\",\r\n choices: [\r\n { text: \"Male\", value: \"male\", category: \"By Birth\" },\r\n { text: \"Female\", value: \"female\", category: \"By Birth\" },\r\n { text: \"Non-Binary\", value: \"nonbinary\", category: \"Other Identities\" },\r\n { text: \"Prefer not to say\", value: \"prefer_not_say\", category: \"Other Identities\" }\r\n ],\r\n hasOther: true, // Enables \"Other\" option\r\n otherText: \"Other (please specify)\", // Custom label for \"Other\"\r\n isRequired: true\r\n\r\n },\r\n {\r\n type: \"dropdown\",\r\n name: \"sf_dropdown_1\",\r\n title: \"Dropdown with other\",\r\n choices: [\r\n { value: \"high-school\", text: \"High School\" },\r\n { value: \"associate-degree\", text: \"Associate Degree\" },\r\n { value: \"bachelor\", text: \"Bachelor’s Degree\" },\r\n { value: \"master\", text: \"Master’s Degree\" },\r\n { value: \"phd\", text: \"PhD\" },\r\n\r\n ],\r\n hasOther: true, // Enables \"Other\" option\r\n otherText: \"Other (please specify)\", // Custom label for \"Other\"\r\n isRequired: true\r\n },\r\n\r\n {\r\n type: \"dropdown\",\r\n name: \"sf_dropdown_2\",\r\n title: \"What is your current employment status?\",\r\n description: \"Simple dropdown\",\r\n titleTooltip: \"Get help here\",\r\n choices: [\r\n { value: \"full-time\", text: \"Employed full-time\" },\r\n { value: \"part-time\", text: \"Employed part-time\" },\r\n { value: \"self-employed\", text: \"Self-employed\" },\r\n { value: \"unemployed\", text: \"Unemployed\" },\r\n { value: \"student\", text: \"Student\" },\r\n { value: \"retired\", text: \"Retired\" }\r\n ],\r\n isRequired: false\r\n },\r\n {\r\n type: \"checkbox\",\r\n name: \"sf_checkbox_1\",\r\n title: \"Multiple checkbox:\",\r\n choices: [\r\n \"Apple\",\r\n \"Banana\",\r\n \"Orange\",\r\n \"Grapes\",\r\n \"Mango\"\r\n ],\r\n hasOther: true, // Enables \"Other\" option\r\n otherText: \"Other (please specify)\", // Custom label for \"Other\"\r\n isRequired: true\r\n },\r\n {\r\n type: \"text\",\r\n name: \"sf_textbox_1\",\r\n title: \"Text box number:\",\r\n inputType: \"number\", // Makes it a numeric input\r\n isRequired: true,\r\n min: 1, // Minimum value allowed\r\n max: 120, // Maximum value allowed\r\n placeHolder: \"Enter a number\"\r\n },\r\n {\r\n type: \"text\",\r\n name: \"sf_textbox_2\",\r\n title: \"Text box:\",\r\n isRequired: true,\r\n placeHolder: \"Enter a company\"\r\n },\r\n {\r\n \"type\": \"dropdown\",\r\n \"name\": \"sf_dropdown_3\",\r\n \"title\": \"Dropdown Y/N\",\r\n \"choices\": [\r\n { \"value\": \"yes\", \"text\": \"Yes\" },\r\n { \"value\": \"no\", \"text\": \"No\" }\r\n ],\r\n \"defaultValue\": \"yes\"\r\n },\r\n {\r\n \"type\": \"checkbox\",\r\n \"name\": \"sf_checkbox_2\",\r\n \"title\": \"Checkbox Y/N\",\r\n \"choices\": [\r\n { \"value\": \"yes\", \"text\": \"This is a dpa\" },\r\n\r\n ],\r\n \"defaultValue\": [\"yes\"],\r\n isRequired: true,\r\n },\r\n {\r\n \"type\": \"radiogroup\",\r\n \"name\": \"sf_radiobox_2\",\r\n \"title\": \"Radio button Y/N\",\r\n \"choices\": [\r\n { value: \"yes\", text: \"yes\" },\r\n { value: \"no\", text: \"no\" },\r\n\r\n ],\r\n \"defaultValue\": [\"yes\"],\r\n },\r\n {\r\n type: \"comment\",\r\n name: \"sf_textarea_1\",\r\n title: \"Text Area 5 rows\",\r\n isRequired: true,\r\n placeHolder: \"Write here...\",\r\n rows: 5 // Sets the initial height of the textarea\r\n },\r\n {\r\n type: \"comment\",\r\n name: \"sf_textarea_2\",\r\n title: \"Text Area 5 rows with Max length\",\r\n isRequired: true,\r\n placeHolder: \"Write here...\",\r\n maxLength: 500, // Limits input to 500 characters\r\n rows: 5 // Sets the initial height of the textarea\r\n },\r\n {\r\n \"type\": \"text\",\r\n \"name\": \"sf_phonenumber_1\",\r\n \"title\": \"Enter your phone number\",\r\n \"isRequired\": true,\r\n \"inputType\": \"tel\",\r\n \"validators\": [{\r\n \"type\": \"regex\",\r\n \"text\": \"Only numbers, '+', '(', and ')' are allowed.\",\r\n \"regex\": \"^[0-9+()\\\\- ]+$\"\r\n }]\r\n }\r\n\r\n ],\r\n showCompletedPage: false,\r\n showQuestionNumbers: \"off\",\r\n completedHtml: \"\",\r\n questionErrorLocation: \"bottom\",\r\n \r\n };\r\n\r\n let isHandling = false;\r\n const handleValueChanged = (sender, options) => {\r\n if (isHandling) return;\r\n isHandling = true;\r\n if (options.name.endsWith(\"-Comment\") \r\n // && (question.getType() === \"dropdown\" || question.getType() === \"radiogroup\" || question.getType() === \"checkbox\")\r\n )\r\n {\r\n const originalField = options.name.replace(\"-Comment\", \"\"); \r\n const question = sender.getQuestionByName(originalField);\r\n\r\n if (question.value === \"other\") {\r\n sender.setValue(originalField, question.adOtherValue || question.value);\r\n }\r\n else if (Array.isArray(question.value)) {\r\n if (question.value.includes(\"other\") && !question.value.includes(question.adOtherValue))\r\n question.value = [...question.value, question.adOtherValue];\r\n else if (!question.value.includes(\"other\") && question.value.includes(question.adOtherValue))\r\n question.value = question.value.filter(val => val !== question.adOtherValue);\r\n }\r\n }\r\n isHandling = false;\r\n };\r\n\r\n const handleLoadChoicesFromServer = (survey, options) => {\r\n\r\n // Handle \"country\" dropdown\r\n //if (options.question.choicesByUrl.url === \"getformcompanies\") {\r\n if (options.question.dataEndpoint) {\r\n APIGet({\r\n \"controller\": \"account\",\r\n \"action\": options.question.dataEndpoint,\r\n \"identifier\": surveyCode,\r\n \"environment\": environment\r\n })\r\n .then(function (response) {\r\n let data = response.data.choices;\r\n /*options.choices */let choices = data.map(item => ({\r\n value: item.name,\r\n text: item.name\r\n }));\r\n options.setItems(choices, response.data.total);\r\n options.loaded = true;\r\n\r\n });\r\n\r\n options.waitForResult = true;\r\n }\r\n //}\r\n };\r\n\r\n useEffect(() => {\r\n const InlineForms = async () => {\r\n await APIGet({\r\n \"controller\": \"account\",\r\n \"action\": \"getformbyid\",\r\n \"identifier\": surveyCode,\r\n \"environment\": environment\r\n })\r\n .then(function (response) {\r\n let survey = response.data.surveyData;\r\n const surveyModel = new Model(survey);\r\n //surveyModel.onValueChanging.add(handleValueChanging);\r\n surveyModel.onValueChanged.add(handleValueChanged);\r\n //surveyModel.onLoadChoicesFromServer.add(handleLoadChoicesFromServer);\r\n surveyModel.onChoicesLazyLoad.add(handleLoadChoicesFromServer);\r\n setSurveyData(surveyModel);\r\n });\r\n\r\n };\r\n\r\n InlineForms();\r\n }, []);\r\n\r\n //const surveyModel = useRef(new Model(surveyJson)); // SurveyJS model initialization\r\n //const surveyModel = useRef(new Model(surveyData)); // SurveyJS model initialization\r\n\r\n\r\n //console.log(\"surveyJs controller: \", surveyData)\r\n \r\n useImperativeHandle(ref, () => ({\r\n validateSurvey: () => surveyData.validate(),\r\n getSurveyData: () => surveyData.data,\r\n prefixAnswers: () => {\r\n const survey = surveyData;\r\n const questions = survey.getAllQuestions();\r\n\r\n questions.forEach((q) => {\r\n if (\r\n [\"text\", \"comment\", \"date\", \"datetime\", \"dropdown\"].includes(q.getType()) &&\r\n q.value &&\r\n q.answerCode\r\n ) {\r\n const prefix = q.answerCode;\r\n\r\n if (prefix && q.value && typeof q.value === \"string\") {\r\n q.value = `${prefix}_ad|_${q.value}`;\r\n }\r\n }\r\n });\r\n\r\n console.log(\"Prefixed values:\", survey.data);\r\n }\r\n }));\r\n \r\n return surveyData ? :

    Loading survey...

    ;\r\n});\r\n\r\nexport default SurveyForm;\r\n","import React, { useState, useRef, useCallback, useEffect, useLayoutEffect } from 'react';\r\nimport axios from 'axios';\r\nimport { useParams, useNavigate, useSearchParams } from 'react-router-dom'\r\nimport { format } from 'react-string-format';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport '../../../i18n';\r\nimport * as ReactDOM from 'react-dom';\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { GetConfiguration, GetCurrentBrand } from '../../Configuration/ConfigurationManager';\r\nimport { APIGet, APIPost, APIRedirect } from '../../API/APIRequest'\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { LogWebActivity } from '../../Webactivity/LogWebActivity';\r\nimport { Loading } from '../../Utilities/Loading';\r\nimport { IsSafeUrl, RedirectWarning } from '../../Utilities/SafeUrl';\r\nimport { useAuth } from '../AuthenticationProvider';\r\nimport Input from '../../UI/Inputs/Input';\r\nimport InputWrapper from '../../UI/Inputs/InputWrapper';\r\nimport Checkbox from '../../UI/Checkbox/Checkbox';\r\nimport useBodyClass from '../../../Hooks/useBodyClass';\r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\nimport ReactHtmlParser from 'html-react-parser';\r\nimport './Register.css';\r\nimport { Password } from '../PasswordValidations/PasswordValidations';\r\nimport InputWrapperRefacture from '../../UI/Inputs/InputWrapperRefacture';\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport setStateAsync from '../../Utilities/SetStateAsync';\r\nimport useBrandingData from '../../../Hooks/useBrandingData';\r\nimport { emailRegexUtils, nameRegexUtils } from '../../Utilities/EmailRegex';\r\nimport {\r\n GoogleReCaptchaProvider,\r\n useGoogleReCaptcha\r\n } from 'react-google-recaptcha-v3';\r\nimport { APIUrl } from '../../Utilities/APIUrl';\r\nimport { RecaptchaError } from '../../Utilities/RecaptchaError';\r\nimport Transition from '../../UI/Transition/Transition';\r\nimport DOMPurify from 'dompurify';\r\nimport SurveyForm from '../../UI/SurveyForms/SurveyForm';\r\n \r\n\r\nexport function Register(props) {\r\n\r\n useBodyClass(['register', props.brandingElement?.bodyClass]);\r\n usePageTitle(`Create your account - ${props.brandingElement?.id}`);\r\n\r\n const { t, i18n } = useTranslation();\r\n const [errors, setErrors] = useState([]);\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [checking, setChecking] = useState(false);\r\n const [isNotTrusted, setIsNotTrusted] = useState('');\r\n const { environment } = useParams();\r\n const auth = useAuth();\r\n const [fieldChanged, setFieldChanged] = useState(null);\r\n const [firstName, setFirstName] = useState(\"\");\r\n const [buttonEvent, setButtonEvent] = useState(false);\r\n const [lastName, setLastName] = useState(\"\");\r\n const [dpa, setDpa] = useState([]);\r\n const [cleanDpaQuestionHtml, setCleanDpaQuestionHtml] = useState([]);\r\n const [userPassword, setUserPassword] = useState(\"\");\r\n const [registered, setRegistered] = useState(\"false\");\r\n const [userEmail, setUserEmail] = useState(localStorage.getItem('email'));\r\n const [pswValid, setPswValid] = useState(\"false\");\r\n const [isChecked, setIsChecked] = useState(\"false\")\r\n const [buttonState, setButtonState] = useState(\"initial\");\r\n const [IsBlank, setIsBlank] = useState({ email: false, password: false, lastName: false, firstName: false, dpa: false })\r\n const [IsInvalid, setIsInvalid] = useState({ lastName: false, firstName: false})\r\n const createUrl = useCreateUrl();\r\n const navigate = useNavigate();\r\n const headerRef = useRef(null);\r\n const formRef=useRef(null);\r\n const [isDpaQuestionTextBlank, setIsDpaQuestionTextBlank] = useState(false);\r\n const [dpaValidationConfig , setDpaValidationConfig] = useState(false);\r\n // const { getBrandedHtml } = useBrandingData(props.brandingElement ? props.brandingElement : \"\");\r\n // const recaptchaKey=getBrandedHtml('reCAPTCHAkey')\r\n const [reCaptchaError, setReCaptchaError]= useState(false)\r\n const [surveyData, setSurveyData] = useState({});\r\n const emailRegex = emailRegexUtils;\r\n const nameRegex = nameRegexUtils;\r\n const surveyRef = useRef(null);\r\n const { executeRecaptcha } = useGoogleReCaptcha();\r\n\r\n const [surveycode, setSurveyCode] = useState(null);\r\n let [searchParams] = useSearchParams();\r\n let surveycodeURLParam = searchParams.get(\"surveycode\");\r\n //recaptcha verification\r\n const handleReCaptchaVerify = useCallback(async () => {\r\n if (!executeRecaptcha) {\r\n console.log('Execute recaptcha not yet available');\r\n return;\r\n }try{\r\n\r\n const recaptchaToken = await executeRecaptcha('register');\r\n return recaptchaToken;\r\n\r\n } catch(err){\r\n //in case of invalid recaptcha key\r\n return \"invalidKey\";\r\n }\r\n \r\n // we will use the token in recaptchaVerified()\r\n }, [executeRecaptcha]);\r\n\r\n \r\n const ReturnUrl = () => {\r\n let params = (new URL(document.location)).searchParams;\r\n return params.get(\"ReturnUrl\");\r\n }\r\n\r\n const loadDPA = async () => {\r\n await APIGet({\r\n \"controller\": \"auth0\",\r\n \"action\": \"getregistrationdpa\",\r\n \"environment\": environment\r\n })\r\n .then(function (response) {\r\n\r\n let dpa=response.data.dpaquestion;\r\n setDpa(dpa);\r\n cleanDpaText(dpa?.questiontext);\r\n checkForDpaQuestionText(dpa?.questiontext) //check for blank question text\r\n setIsChecked(dpa?.defaultticked); //this is also async..so may take time so directly pass in the function.\r\n setIsLoading(false)\r\n \r\n })\r\n .catch(function (error) {\r\n // handle error\r\n setIsLoading(false);\r\n console.log(error);\r\n })\r\n }\r\n\r\n const checkForDpaQuestionText=(dpa)=>{\r\n \r\n let div = document.createElement('div');\r\n \r\n div.innerHTML = dpa;\r\n \r\n let textContent = div.textContent; \r\n \r\n let trimmedText = textContent.trim(); //if html is present and has a blank\r\n \r\n if(trimmedText===\"\"){\r\n setIsDpaQuestionTextBlank(true);\r\n }\r\n\r\n }\r\n\r\n const cleanDpaText=(dpa)=>{\r\n const cleanDpaHtml = DOMPurify.sanitize(dpa, {\r\n ALLOWED_ATTR: ['target', 'href', 'class', 'id', 'style'], // Add any other allowed attributes here\r\n });\r\n\r\n setCleanDpaQuestionHtml(cleanDpaHtml); \r\n }\r\n\r\n\r\n useEffect(() => {\r\n\r\n setButtonState(\"initial\");\r\n return () => {\r\n setButtonState(\"initial\") //when we leave the page it sets button state to initial\r\n };\r\n }, [window.location.href])\r\n\r\n useEffect(() => {\r\n loadDPA();\r\n getFrontendConfiguration();\r\n getCurrentBrandDefaultDemograpicsForm();\r\n headerRef.current?.focus();\r\n }, [])\r\n\r\n useLayoutEffect(() => {\r\n\r\n setTimeout(() => {\r\n if (localStorage.getItem(\"email\")) {\r\n setUserEmail(localStorage.getItem(\"email\"))\r\n auth.CheckRegisteredAccount(localStorage.getItem(\"email\")).then((result) => {\r\n if (result.status === \"email_found\") {\r\n setRegistered(\"true\");\r\n }\r\n }).catch((errors) => {\r\n\r\n });\r\n }\r\n }, 1500)\r\n }, [])\r\n\r\n //recaptcha verification\r\n const recaptchaVerified = async() => {\r\n const recaptchaToken = await handleReCaptchaVerify();\r\n //if recaptcha is incorrect\r\n if(recaptchaToken === \"invalidKey\"){\r\n return true; //it should work without the recaptcha as well and will return true in case of invalid key\r\n }\r\n \r\n let bodyFormData = new FormData();\r\n bodyFormData.append('token', recaptchaToken);\r\n\r\n const res = await APIPost({\r\n \"controller\": \"security\",\r\n \"action\": \"verifyrecaptcha\",\r\n \"environment\" : environment,\r\n data: bodyFormData,\r\n }).catch((errors) => { ProcessErrors(errors)})\r\n\r\n if (res.data.success) {\r\n if (res.data.score > 0.5) {\r\n return true; //probable human activity\r\n }\r\n else{\r\n setReCaptchaError(true) //probabale bot activity\r\n return false;\r\n } \r\n }else{\r\n return false;\r\n }\r\n \r\n }\r\n\r\n const registerUser = async(event) => {\r\n event.preventDefault();\r\n //in case of invalid key or of no-recaptcha value of isHuman will be true, only when we get a valid recaptchaKey, the flow of recaptcha\r\n //and assessment of activity will begin.\r\n //recaptcha verification\r\n let surveyData = null;\r\n if (surveyRef?.current) {\r\n surveyRef.current.prefixAnswers();\r\n surveyData = surveyRef.current.getSurveyData();\r\n console.log('Survey Data:', surveyData);\r\n for (let key in surveyData) {\r\n console.log(key, surveyData[key]);\r\n }\r\n }\r\n setButtonState(\"loading\") \r\n setErrors(null);\r\n if (Validated()) {\r\n const isHuman= props.hasRecaptcha ? await recaptchaVerified() : true; \r\n\r\n if(isHuman){\r\n \r\n let controller = \"\"; \r\n switch (auth.authProviderType) {\r\n case \"adnative\":\r\n controller = \"account\";\r\n break;\r\n case \"auth0\":\r\n controller = \"auth0\";\r\n break;\r\n } \r\n \r\n let returnUrl = auth.ReturnUrl();\r\n\r\n let bodyFormData = new FormData();\r\n let userName = userEmail;\r\n let password = userPassword;\r\n bodyFormData.append('email', userName);\r\n bodyFormData.append('password', password);\r\n bodyFormData.append('firstname', firstName);\r\n bodyFormData.append('surname', lastName);\r\n if (surveyData)\r\n for (let key in surveyData) {\r\n bodyFormData.append(`_srvitem_${key}`, surveyData[key]);\r\n \r\n }\r\n if (dpa == null) {\r\n bodyFormData.append('dpaFlag', false);\r\n } else {\r\n bodyFormData.append('dpaFlag', isChecked);\r\n }\r\n bodyFormData.append('returnUrl', returnUrl);\r\n \r\n APIPost({\r\n \"controller\": controller,\r\n \"action\": \"register\",\r\n \"environment\" : environment,\r\n data: bodyFormData\r\n }).then((response) => {\r\n let registerResult = response.data;\r\n if (registerResult.success) {\r\n // let apiUrl = APIUrl({ \"path\": \"/auth0/authenticate\" });\r\n // apiUrl += \"?ReturnUrl=\" + returnUrl + \"&email=\" + result.auth0user.email;\r\n // window.location.href = apiUrl;\r\n\r\n let returnUrl = auth.ReturnUrl();\r\n auth.Login(userName, userPassword).then((response) => {\r\n let loginResult = response;\r\n let returnUri = new URL(returnUrl);\r\n if (returnUri.hostname != window.location.hostname) {\r\n let ad_ref_token = loginResult.ad_ref_token;\r\n sessionStorage.setItem(\"ad_ref_token\", ad_ref_token)\r\n if (returnUrl.indexOf('?') >= 0) {\r\n returnUrl += \"&\";\r\n }\r\n else {\r\n returnUrl += \"?\";\r\n }\r\n returnUrl += \"ref=\" + ad_ref_token;\r\n }\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n // add adref token to returnUrl if request is from outside this host\r\n\r\n\r\n navigate(\"/redirect\", {\r\n state:\r\n { returnUrl: returnUrl }\r\n })\r\n\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(returnUrl);\r\n }\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n setButtonState(\"initial\")\r\n });\r\n });\r\n }\r\n else {\r\n setErrors(ProcessErrors(registerResult.errors));\r\n setButtonState(\"initial\")\r\n }\r\n }).\r\n catch((error) => {\r\n setErrors(ProcessErrors('error.unexpected'));\r\n setButtonState(\"initial\")\r\n }); \r\n }else{\r\n setButtonState(\"initial\") \r\n }\r\n }else{\r\n setButtonState(\"initial\") \r\n }\r\n }\r\n\r\n\r\n //when we go back to register page on pressing continue button this will get called.\r\n const redirect = (event) => {\r\n event.preventDefault();\r\n setButtonState(\"loading\")\r\n let ad_ref_token = sessionStorage.getItem(\"ad_ref_token\")\r\n //if we have ad_ref_token in the session then only we'd go further\r\n if (ad_ref_token) {\r\n let returnUrl = auth.ReturnUrl();\r\n let returnUri = new URL(returnUrl);\r\n if (returnUri.hostname != window.location.hostname) {\r\n if (returnUrl.indexOf('?') >= 0) {\r\n returnUrl += \"&\";\r\n }\r\n else {\r\n returnUrl += \"?\";\r\n }\r\n returnUrl += \"ref=\" + ad_ref_token;\r\n\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n // add adref token to returnUrl if request is from outside this host\r\n navigate(\"/redirect\", {\r\n state:\r\n { returnUrl: returnUrl }\r\n }) //navigate??? cause button state is an issue here. (loading)\r\n setButtonState(\"initial\")\r\n\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(returnUrl);\r\n }\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n setButtonState(\"initial\")\r\n });\r\n }\r\n }\r\n }\r\n\r\n\r\n const onTextFieldKeyed = (event) => {\r\n if ((event.key.match(emailRegex) || []).length > 0) {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n\r\n const handleOnBlur = (e, fieldType) => {\r\n let value = e.target.value;\r\n setStateAsync(() => {\r\n if (value.length < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, [fieldType]: true }))\r\n setIsInvalid(IsInvalid => ({ ...IsInvalid, [fieldType]: false }))\r\n }\r\n else {\r\n setIsBlank(IsBlank => ({ ...IsBlank, [fieldType]: false }))\r\n\r\n //validating firstName and lastName through regex match\r\n if (!nameRegex.test(e.target.value)) {\r\n setIsInvalid(IsInvalid => ({ ...IsInvalid, [fieldType]: true }))\r\n }\r\n else {\r\n setIsInvalid(IsInvalid => ({ ...IsInvalid, [fieldType]: false }))\r\n }\r\n }\r\n })\r\n\r\n }\r\n\r\n\r\n //fetching frontend configurations\r\n const getFrontendConfiguration=()=>{\r\n APIGet({\r\n \"controller\": \"configuration\",\r\n \"action\": \"frontendconfiguration\",\r\n \"environment\": environment,\r\n }).then((response) => {\r\n let config= response.data.configuration\r\n setDpaValidationConfig(config?.dpaValidationConfiguration)\r\n\r\n }).catch((errors)=>{\r\n console.log(\"Error in loading frontend configuration\")\r\n })\r\n }\r\n const getCurrentBrandDefaultDemograpicsForm = () => {\r\n if (surveycodeURLParam)\r\n setSurveyCode(surveycodeURLParam);\r\n else\r\n GetCurrentBrand(environment).then((brand) => {\r\n if (brand?.brandRegistrationDemographicsDefaultForm) {\r\n setSurveyCode(brand?.brandRegistrationDemographicsDefaultForm);\r\n }\r\n }).\r\n catch((error) => {\r\n //reject(error);\r\n })\r\n }\r\n\r\n const Validated = () => {\r\n let validated = true;\r\n let emailValue = userEmail;\r\n setIsBlank(IsBlank => ({ email: false, firstName: false, lastName: false, password: false }))\r\n if ((emailValue?.match(emailRegex) || []).length <= 0) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, email: true }))\r\n validated &= false;\r\n }\r\n if (firstName < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, firstName: true }))\r\n validated &= false;\r\n }\r\n else if(!nameRegex.test(firstName)){\r\n setIsInvalid(IsInvalid => ({ ...IsInvalid, firstName: true }))\r\n validated &= false;\r\n }\r\n if (lastName < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, lastName: true }))\r\n validated &= false;\r\n }\r\n else if(!nameRegex.test(lastName)){\r\n setIsInvalid(IsInvalid => ({ ...IsInvalid, lastName: true }))\r\n validated &= false;\r\n }\r\n\r\n if (userPassword < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, password: true }))\r\n validated &= false\r\n }\r\n if (pswValid !== \"true\") {\r\n validated &= false\r\n }\r\n if (surveyRef?.current) {\r\n const isValid = surveyRef.current.validateSurvey();\r\n if (!isValid) {\r\n validated &= false;\r\n }\r\n }\r\n \r\n if(dpa?.questiontext && !isDpaQuestionTextBlank && dpaValidationConfig && !isChecked){\r\n setIsBlank(IsBlank => ({ ...IsBlank, dpa: true }))\r\n validated &= false\r\n }\r\n\r\n if(dpa?.questiontext && !isDpaQuestionTextBlank && dpaValidationConfig && !isChecked){\r\n setIsBlank(IsBlank => ({ ...IsBlank, dpa: true }))\r\n validated &= false\r\n }\r\n\r\n \r\n if(!validated){\r\n focusOnFirstError();\r\n }\r\n \r\n return validated;\r\n\r\n }\r\n\r\n //On submit, focusing on first error causing input field\r\n const focusOnFirstError=()=>{\r\n setTimeout(()=>{\r\n let firstElement = formRef.current?.querySelectorAll(\"input[invalidclass='Invalid-input'],.sd-question--error input, .sd-question--error textarea\")[0];\r\n firstElement?.focus();\r\n },200)\r\n \r\n }\r\n\r\n if (!auth.ReturnUrl() && !isLoading) {\r\n if (errors.length == 0) {\r\n errors.push('error.noreturnurl');\r\n }\r\n return ()\r\n }\r\n\r\n \r\n const termsText = props.brandingElement?.termsText || '';\r\n\r\n\r\n return (<>\r\n {reCaptchaError ? :\r\n (registered === \"true\") ?\r\n
    \r\n
    \r\n

    {t('register.title')}

    \r\n
    \r\n
    \r\n
    \r\n
    \r\n

    Your account has been created

    \r\n
    \r\n
    \r\n\r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" &&\r\n \r\n }\r\n
    \r\n
    \r\n\r\n : (sessionStorage.getItem(\"ad_ref_token\") === \"null\" && registered === \"false\") ?\r\n \r\n
    \r\n \r\n
    \r\n

    {t('register.title')}

    \r\n
    \r\n \r\n \r\n
    \r\n\r\n
    \r\n
    \r\n { handleOnBlur(e, \"email\") }}\r\n inputFieldType=\"text\"\r\n btnText={t('input.edittextlabel')}\r\n invalidClass={IsBlank.email && \"Invalid-input\"}\r\n aria-invalid={IsBlank.email}\r\n aria-describedby=\"email-blank-error\"\r\n inputSize=\"full-width\"\r\n value={userEmail}\r\n onKeyPress={onTextFieldKeyed}\r\n />\r\n {IsBlank.email && {t('register.blankemail')}}\r\n
    \r\n
    \r\n\r\n \r\n {/* password with validations ---component */}\r\n
    \r\n
    \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n\r\n { handleOnBlur(e, \"firstName\") }}\r\n specs=\"text_input\"\r\n name=\"firstname\"\r\n value={firstName}\r\n type=\"text\"\r\n invalidClass={(IsBlank.firstName || IsInvalid?.firstName) && \"Invalid-input\"}\r\n onKeyPress={onTextFieldKeyed}\r\n aria-invalid={(IsBlank.firstName || IsInvalid?.firstName)}\r\n aria-describedby=\"firstname-blank-error\" \r\n onChange={(e) => { setFirstName(e.target.value) }}\r\n />\r\n\r\n \r\n {IsBlank.firstName && {t('register.blankfirstname')}}\r\n {IsInvalid?.firstName && {t('register.invalidfirstname')}}\r\n \r\n
    \r\n
    \r\n\r\n
    \r\n \r\n\r\n
    \r\n
    \r\n\r\n { handleOnBlur(e, \"lastName\") }}\r\n name=\"lastname\"\r\n type=\"text\"\r\n value={lastName}\r\n invalidClass={(IsBlank.lastName|| IsInvalid?.lastName) && \"Invalid-input\"}\r\n specs=\"text-input\"\r\n onKeyPress={onTextFieldKeyed}\r\n aria-invalid={(IsBlank.lastName || IsInvalid?.lastName)}\r\n aria-describedby=\"lastname-blank-error\" \r\n onChange={(e) => { setLastName(e.target.value) }}\r\n />\r\n\r\n \r\n {IsBlank.lastName && {t('register.blanklastname')}}\r\n {IsInvalid?.lastName && {t('register.invalidlastname')}}\r\n \r\n
    \r\n
    \r\n
    \r\n {(surveycode) && <>\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n }\r\n \r\n {(dpa?.questiontext && !isDpaQuestionTextBlank) && <>\r\n
    \r\n
    \r\n } id=\"dpa-checkbox\" name=\"dpa\" checked={isChecked} onChange={() => {setIsChecked(!isChecked)}} />\r\n \r\n {(IsBlank?.dpa && !isChecked) && {t('register.blankdpa')}}\r\n \r\n
    \r\n\r\n
    \r\n \r\n }\r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    {ReactHtmlParser(termsText)}
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" &&\r\n \r\n }\r\n \r\n \r\n
    \r\n \r\n\r\n
    \r\n \r\n : sessionStorage.getItem(\"ad_ref_token\") !== \"null\" && registered === \"false\" ? : \"\"\r\n }\r\n \r\n \r\n );\r\n}\r\n\r\n","import React, { useState, useRef, useEffect } from 'react';\r\nimport { useParams, Link, useNavigate } from 'react-router-dom'\r\nimport { format } from 'react-string-format';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport '../../../i18n';\r\nimport './UpdateEmail.css';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager'\r\nimport { APIGet, APIPost } from '../../API/APIRequest'\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox'\r\nimport { LogWebActivity } from '../../Webactivity/LogWebActivity';\r\nimport { Loading } from '../../Utilities/Loading'\r\nimport { IsSafeUrl, RedirectWarning } from '../../Utilities/SafeUrl'\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport Input from '../../UI/Inputs/Input';\r\nimport InputWrapper from '../../UI/Inputs/InputWrapper';\r\nimport { GetAuth0UserByEmail } from '../Auth0/Auth0ADInterface';\r\nimport { Password } from '../PasswordValidations/PasswordValidations';\r\nimport InputWrapperRefacture from '../../UI/Inputs/InputWrapperRefacture';\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport setStateAsync from '../../Utilities/SetStateAsync';\r\nimport useBrandingData from '../../../Hooks/useBrandingData';\r\nimport { emailRegexUtils } from '../../Utilities/EmailRegex';\r\nimport Transition from '../../UI/Transition/Transition'; \r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\n\r\n\r\n\r\n\r\nexport function UpdateEmail(props) {\r\n\r\n const { t, i18n } = useTranslation();\r\n const [errors, setErrors] = useState([]);\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [isNotTrusted, setIsNotTrusted] = useState('');\r\n const [loginData, setLoginData] = useState(null);\r\n const [userEmail, setUserEmail] = useState(null);\r\n const [nextAction, setNextAction] = useState(null);\r\n const [IsEmailInvalid, setIsEmailInvalid] = useState(false);\r\n const [IsEmailBlank, setIsEmailBlank] = useState(false);\r\n const [buttonEvent, setButtonEvent] = useState(false);\r\n const [userPassword, setUserPassword] = useState(null);\r\n const [updateState, setUpdateState] = useState(\"not_started\");\r\n const createUrl = useCreateUrl();\r\n const [combNotMatches, setCombNotMatches] = useState(false)\r\n const [IsBlank, setIsBlank] = useState({ email: false, password: false });\r\n const { environment } = useParams();\r\n const headerRef = useRef(null);\r\n const [buttonState, setButtonState] = useState(\"initial\");\r\n const [changeEmailText, setChangeEmailText] = useState(\"\");\r\n const auth = useAuth();\r\n const formRef = useRef(null);\r\n const [fieldChanged, setFieldChanged] = useState(null);\r\n const { getBrandedHtml } = useBrandingData(props.brandingElement ? props.brandingElement : \"\");\r\n\r\n usePageTitle(`Update email - ${props.brandingElement?.id}`);\r\n\r\n const emailRegex = emailRegexUtils;\r\n\r\n const GotoReturnUrl = () => {\r\n\r\n let returnUrl = auth.ReturnUrl();\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n // add adref token to returnUrl if request is from outside this host\r\n\r\n window.location.href = returnUrl;\r\n return returnUrl;\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(returnUrl);\r\n }\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n });\r\n }\r\n\r\n\r\n const updateUser = (event) => {\r\n\r\n event.preventDefault();\r\n setErrors(null);\r\n if (Validated()) {\r\n setButtonState(\"loading\")\r\n \r\n let controller = \"\";\r\n switch (auth.authProviderType) {\r\n case \"adnative\":\r\n controller = \"account\";\r\n break;\r\n case \"auth0\":\r\n controller = \"auth0\";\r\n break;\r\n }\r\n let refToken = auth.GetADRefToken();\r\n \r\n let bodyFormData = new FormData();\r\n\r\n bodyFormData.append('newEmail', userEmail);\r\n bodyFormData.append('password', userPassword);\r\n APIPost({\r\n \"controller\": controller,\r\n \"action\": \"updateemail\",\r\n \"environment\": environment,\r\n \"identifier\" : refToken,\r\n data: bodyFormData\r\n }).then((response) => {\r\n let updateAccountResult = response.data;\r\n if (updateAccountResult.success) {\r\n setUpdateState(\"updated\")\r\n setTimeout(() => {\r\n GotoReturnUrl();\r\n }, 2000)\r\n\r\n }\r\n else {\r\n setErrors(ProcessErrors(updateAccountResult.errors));\r\n setButtonState(\"initial\")\r\n }\r\n }).\r\n catch((error) => {\r\n setErrors(ProcessErrors(\"error.unexpected\"));\r\n setButtonState(\"initial\")\r\n }); \r\n }\r\n }\r\n\r\n const onTextFieldKeyed = (event) => {\r\n if ((event.key.match(emailRegex) || []).length > 0) {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n const onTextFieldChanged = (event) => {\r\n setFieldChanged(event.target.name + event.target.value);\r\n }\r\n\r\n\r\n\r\n const onPasswordChanged = (event) => {\r\n let password = event.target.value;\r\n setUserPassword(password)\r\n let updatedCounts = {};\r\n updatedCounts.length = password.length;\r\n updatedCounts.upper = (password.match(/[A-Z]/g) || []).length;\r\n updatedCounts.lower = (password.match(/[a-z]/g) || []).length;\r\n updatedCounts.digit = (password.match(/[0-9]/g) || []).length;\r\n updatedCounts.special = (password.match(/[^A-Za-z0-9]/g) || []).length;\r\n\r\n }\r\n\r\n\r\n //email address validation\r\n const Validated = () => {\r\n\r\n let validated = true;\r\n let emailValue = userEmail || \"\";\r\n let temp = emailValue?.split(\"@\"); //for assessing the local part of domain\r\n let localPart = temp ? temp[0]: \"\";\r\n setIsBlank(IsBlank => ({ email: false, password: false }))\r\n\r\n if ((emailValue.length > 1) && (emailValue?.match(emailRegex) || []).length <= 0 || localPart.length > 64) {\r\n setIsEmailInvalid(true);\r\n validated &= false;\r\n\r\n }\r\n if (emailValue < 1) {\r\n setIsEmailInvalid(false);\r\n setIsBlank(IsBlank => ({ ...IsBlank, email: true }))\r\n\r\n validated &= false\r\n }\r\n\r\n if (userPassword < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, password: true }))\r\n validated &= false\r\n }\r\n \r\n if(!validated){\r\n focusOnFirstError();\r\n }\r\n \r\n return validated;\r\n\r\n }\r\n\r\n //onSubmit focusing on first error causing input\r\n const focusOnFirstError=()=>{\r\n setTimeout(()=>{\r\n let firstElement= formRef.current?.querySelectorAll(\"input[invalidclass='Invalid-input']\")[0]\r\n firstElement?.focus();\r\n },200)\r\n \r\n }\r\n\r\n //componentDidMount\r\n useEffect(() => {\r\n if (!loginData && isLoading) {\r\n auth.GetLoginData(environment, auth.GetADRefToken()).then((response) => {\r\n setLoginData(response);\r\n setIsLoading(false);\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n setIsLoading(false);\r\n })\r\n }\r\n\r\n headerRef.current?.focus();\r\n\r\n }, [])\r\n\r\n\r\n const handleOnBlur = (e, fieldType) => {\r\n\r\n let value = e.target.value;\r\n if (buttonEvent) {\r\n document.getElementById(\"password\").focus();\r\n setButtonEvent(false)\r\n e.preventDefault();\r\n }\r\n \r\n //due to OnBlur\r\n setStateAsync(() => {\r\n if (value.length < 1) {\r\n setIsEmailInvalid(false);\r\n setIsBlank(IsBlank => ({ ...IsBlank, [fieldType]: true }))\r\n }\r\n else {\r\n setIsBlank(IsBlank => ({ ...IsBlank, [fieldType]: false }))\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n\r\n let changeEmailText1 = format(t('updateemail.summarypart1'));\r\n let changeEmailText2 = format(t('updateemail.summarypart2'));\r\n\r\n // useEffect(()=>{\r\n // let tempText= props.brandingElement?.changeEmailText\r\n // tempText = tempText?.replace(/##user_email##/g, loginData?.email );\r\n // if(tempText){\r\n // setChangeEmailText(tempText)\r\n // }\r\n // }, [props.brandingElement?.changeEmailText]) \r\n\r\n\r\n\r\n const getContent = () => {\r\n let updateContent = '';\r\n\r\n if (loginData) {\r\n\r\n if (!`${loginData.user_id}`.startsWith(\"auth\") && auth.authProviderType == \"auth0\") {\r\n\r\n return
    \r\n

    It is not possible to change your email address as you logged in with your\r\n {`${loginData.user_id}`.startsWith(\"goo\") && Google }\r\n {`${loginData.user_id}`.startsWith(\"fac\") && Facebook }\r\n account.\r\n

    \r\n
    \r\n } else {\r\n return (
    \r\n
    \r\n
    \r\n {props.brandingElement?.changeEmailText ? getBrandedHtml('changeEmailText', loginData?.email) :

    {changeEmailText1} {loginData?.email} {changeEmailText2}

    }\r\n
    \r\n
    \r\n {(updateState === \"not_started\") ?\r\n <> \r\n
    \r\n
    \r\n { handleOnBlur(e, \"email\") }}\r\n btnText={t('input.edittextlabel')}\r\n inputSize=\"full-width\"\r\n value={userEmail}\r\n invalidClass={(IsBlank.email || IsEmailInvalid) ? \"Invalid-input\" : \"\"}\r\n onKeyPress={onTextFieldKeyed}\r\n onChange={(e) => { setUserEmail(e.target.value) }}\r\n aria-invalid={(IsBlank.email || IsEmailInvalid)}\r\n aria-describedby=\"email-errors\" />\r\n\r\n \r\n {IsBlank.email && {t('updateemail.blanknewemail')}}\r\n {IsEmailInvalid ? props.brandingElement?.mailValidError ? {getBrandedHtml('mailValidError')} : {t('login.incorrectemailinput')} : \"\"}\r\n \r\n\r\n
    \r\n
    \r\n \r\n \r\n
    \r\n
    \r\n {/* */}\r\n { handleOnBlur(e, \"password\") }}\r\n inputSize=\"full-width\"\r\n showBtnText={t('input.showpasswordlabel')}\r\n hideBtnText={t('input.hidepasswordlabel')}\r\n name=\"password\"\r\n invalidClass={(IsBlank.password) ? \"Invalid-input\" : \"\"}\r\n onChange={onPasswordChanged} \r\n aria-invalid={IsBlank.password}\r\n aria-describedby=\"password-blank-error\"/>\r\n\r\n \r\n {IsBlank.password && {t('updateemail.blankoldpassword')}}\r\n \r\n\r\n

    {t('forgottenpassword.linktext')}

    \r\n
    \r\n\r\n
    \r\n \r\n\r\n \r\n
    \r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" &&\r\n \r\n }\r\n
    \r\n \r\n : (updateState === \"updated\") && <>\r\n \r\n
    \r\n
    \r\n

    {t('updatepassword.redirecttext')} {t('updatepassword.backtoaccount')}

    {/*has to be changed to backToaccount*/}\r\n
    \r\n
    \r\n \r\n\r\n
    \r\n \r\n
    \r\n \r\n }\r\n
    \r\n )\r\n if (loginData?.identities[0].provider !== \"auth0\") {\r\n let actionMessage = format(t('updateemail.backlinktext'), auth.ReturnUrl);\r\n updateContent =

    {t('error.socialdetailsupdateattempt')}

    {actionMessage}

    \r\n }\r\n }\r\n\r\n\r\n }\r\n else if (!isLoading) {\r\n if (!errors || errors.length == 0) {\r\n let actionMessage = format(t('updateemail.backlinktext'), auth.ReturnUrl);\r\n setErrors(ProcessErrors(\"error.usernotloggedin\"));\r\n }\r\n }\r\n\r\n }\r\n var returnUrl = auth.ReturnUrl();\r\n if (!returnUrl && !isLoading) {\r\n if (errors.length == 0) {\r\n errors.push('error.noreturnurl');\r\n }\r\n }\r\n\r\n\r\n return (\r\n
    \r\n \r\n
    \r\n {/*to make the screen reader read out the module heading we explicitly make it focus on it as the mounting happens*/}\r\n

    {t('updateemail.title')}

    \r\n
    \r\n \r\n \r\n \r\n {getContent()}\r\n \r\n\r\n
    \r\n );\r\n}\r\n\r\n\r\n","import React, { useState, useRef, useEffect } from 'react';\r\nimport { useParams, Link, useNavigate } from 'react-router-dom'\r\nimport { format } from 'react-string-format';\r\nimport { useTranslation } from 'react-i18next';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport '../../../i18n';\r\nimport './UpdatePassword.css';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager'\r\nimport { APIGet, APIPost } from '../../API/APIRequest'\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox'\r\nimport { LogWebActivity } from '../../Webactivity/LogWebActivity';\r\nimport { Loading } from '../../Utilities/Loading'\r\nimport { IsSafeUrl, RedirectWarning } from '../../Utilities/SafeUrl'\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport Input from '../../UI/Inputs/Input';\r\nimport InputWrapper from '../../UI/Inputs/InputWrapper';\r\nimport { GetAuth0UserByEmail } from '../Auth0/Auth0ADInterface';\r\nimport { Password } from '../PasswordValidations/PasswordValidations';\r\nimport InputWrapperRefacture from '../../UI/Inputs/InputWrapperRefacture';\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport setStateAsync from '../../Utilities/SetStateAsync';\r\nimport useBrandingData from '../../../Hooks/useBrandingData';\r\nimport { emailRegexUtils } from '../../Utilities/EmailRegex';\r\nimport Transition from '../../UI/Transition/Transition'; \r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\n\r\n/*-------------------update password-------------------------------------------------*/\r\n\r\nexport function UpdatePassword(props) {\r\n\r\n const { t, i18n } = useTranslation();\r\n const [errors, setErrors] = useState([]);\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [isNotTrusted, setIsNotTrusted] = useState('');\r\n const [loginData, setLoginData] = useState(null);\r\n const { environment } = useParams();\r\n const auth = useAuth();\r\n const headerRef = useRef(null);\r\n const [buttonEvent, setButtonEvent] = useState(false);\r\n const [fieldChanged, setFieldChanged] = useState(null);\r\n const [oldpassword, setOldPassword] = useState(\"\");\r\n const [newpassword, setNewPassword] = useState(\"\");\r\n const [pswValid, setPswValid] = useState(\"false\");\r\n const [combNotMatches, setCombNotMatches] = useState(false);\r\n const [buttonState, setButtonState] = useState(\"initial\");\r\n const createUrl = useCreateUrl();\r\n const formRef = useRef(null);\r\n const [IsBlank, setIsBlank] = useState({ newpassword: false, oldpassword: false });\r\n const [updateState, setUpdateState] = useState(\"not_started\"); //state for handling password updation states\r\n const emailRegex = emailRegexUtils;\r\n usePageTitle(`Update password - ${props.brandingElement?.id}`);\r\n\r\n\r\n const GotoReturnUrl = () => {\r\n let returnUrl = auth.ReturnUrl();\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n // add adref token to returnUrl if request is from outside this host\r\n\r\n window.location.href = returnUrl;\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(returnUrl);\r\n }\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n });\r\n }\r\n\r\n\r\n //componentDidMount\r\n useEffect(() => {\r\n\r\n if (!loginData && isLoading) {\r\n auth.GetLoginData(environment, auth.GetADRefToken()).then((response) => {\r\n setLoginData(response);\r\n setIsLoading(false);\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n setIsLoading(false);\r\n })\r\n }\r\n headerRef.current?.focus(); //focusing on the module heading as we land on the page and the component mounts\r\n\r\n }, [])\r\n\r\n\r\n const updateUser = (event) => {\r\n\r\n event.preventDefault();\r\n setErrors(null);\r\n if (Validated()) {\r\n\r\n setButtonState(\"loading\");\r\n let controller = \"\";\r\n\r\n switch (auth.authProviderType) {\r\n case \"adnative\":\r\n controller = \"account\";\r\n break;\r\n case \"auth0\":\r\n controller = \"auth0\";\r\n break;\r\n }\r\n let refToken = auth.GetADRefToken();\r\n let returnUrl = auth.ReturnUrl();\r\n let bodyFormData = new FormData();\r\n\r\n bodyFormData.append('password', oldpassword);\r\n bodyFormData.append('newPassword', newpassword);\r\n bodyFormData.append('returnUrl', returnUrl);\r\n APIPost({\r\n \"controller\": controller,\r\n \"action\": \"updatepassword\",\r\n \"environment\": environment,\r\n \"identifier\": refToken,\r\n data: bodyFormData,\r\n }).then((response) => {\r\n\r\n let updateAccountResult = response.data;\r\n if (updateAccountResult.success) {\r\n //let apiUrl = APIUrl({ \"path\": \"/auth0/authenticate\" });\r\n //apiUrl += \"?ReturnUrl=\" + returnUrl + \"&email=\" + result.auth0user.email;\r\n //window.location.href = apiUrl;\r\n\r\n setUpdateState(\"updated\")\r\n setTimeout(() => {\r\n GotoReturnUrl();\r\n }, 2000)\r\n\r\n console.log(updateState)\r\n }\r\n else {\r\n setErrors(ProcessErrors(updateAccountResult.errors));\r\n setButtonState(\"initial\");\r\n }\r\n }).\r\n catch((error) => {\r\n\r\n setErrors(ProcessErrors(\"error.unexpected\"));\r\n setButtonState(\"initial\");\r\n });\r\n \r\n }\r\n }\r\n\r\n\r\n const onTextFieldKeyed = (event) => {\r\n if ((event.key.match(emailRegex) || []).length > 0) {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n //password input-handler\r\n const onPasswordChanged = (event, type) => {\r\n let oldpassword = event.target.value;\r\n if (type === \"old\") {\r\n setOldPassword(oldpassword)\r\n }\r\n\r\n }\r\n\r\n const handleOnBlur = (e, fieldType) => {\r\n if (buttonEvent && fieldType === \"oldpassword\") {\r\n document.getElementById(\"oldpassword\").focus();\r\n setButtonEvent(false);\r\n e.preventDefault();\r\n\r\n }\r\n\r\n if (buttonEvent && fieldType === \"newpassword\") {\r\n document.getElementById(\"newpassword\").focus();\r\n setButtonEvent(false);\r\n e.preventDefault();\r\n\r\n }\r\n //due to handleOnBlur and the order of event-handlers\r\n setStateAsync(() => {\r\n let value = e.target.value;\r\n if (value.length < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, [fieldType]: true }))\r\n }\r\n else {\r\n setIsBlank(IsBlank => ({ ...IsBlank, [fieldType]: false }))\r\n }\r\n })\r\n\r\n\r\n }\r\n\r\n const Validated = () => {\r\n\r\n let validated = true;\r\n setIsBlank(IsBlank => ({ ...IsBlank, newpassword: false, oldpassword: false }))\r\n if (oldpassword < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, oldpassword: true }))\r\n validated &= false;\r\n }\r\n\r\n if (newpassword < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, newpassword: true }))\r\n validated &= false\r\n }\r\n if (pswValid !== \"true\") {\r\n validated &= false\r\n }\r\n\r\n if (!validated) {\r\n focusOnFirstError();\r\n }\r\n return validated;\r\n }\r\n\r\n //onSubmit focusing on first error causing input\r\n const focusOnFirstError = () => {\r\n setTimeout(() => {\r\n let firstElement = formRef.current?.querySelectorAll(\"input[invalidclass='Invalid-input']\")[0]\r\n firstElement?.focus();\r\n }, 200)\r\n\r\n }\r\n\r\n let changePasswordText = format(t('updatepassword.summary'));\r\n\r\n const getContent = () => {\r\n\r\n if (loginData) {\r\n\r\n if (!`${loginData.user_id}`.startsWith(\"auth\") && auth.authProviderType==\"auth0\") {\r\n return
    \r\n

    It is not possible to change your password as you logged in with your\r\n {`${loginData.user_id}`.startsWith(\"goo\") && Google }\r\n {`${loginData.user_id}`.startsWith(\"fac\") && Facebook }\r\n account.\r\n

    \r\n
    \r\n } else {\r\n return (
    \r\n
    \r\n
    \r\n\r\n

    {changePasswordText} {loginData?.email}

    \r\n
    \r\n
    \r\n {updateState === \"not_started\" ? <>\r\n \r\n
    \r\n
    \r\n { handleOnBlur(e, \"oldpassword\") }}\r\n onChange={(e) => onPasswordChanged(e, \"old\")}\r\n aria-invalid={IsBlank.oldpassword}\r\n aria-describedby=\"oldpassword-blank-error\"\r\n />\r\n \r\n {/* {combNotMatches && {t('login.combinationdoesnotmatch')}} */}\r\n {IsBlank.oldpassword && {t('updatepassword.blankoldpassword')}}\r\n \r\n
    \r\n
    \r\n \r\n {/* password with validations --component */}\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" &&\r\n \r\n }\r\n
    \r\n \r\n : updateState === \"updated\" && <>\r\n \r\n
    \r\n
    \r\n

    {t('updatepassword.redirecttext')} {t('updatepassword.backtoaccount')}

    \r\n
    \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n\r\n }\r\n\r\n
    )\r\n\r\n if (loginData?.identities[0].provider !== \"auth0\") {\r\n let actionMessage = format(t('updatepassword.backlinktext'), auth.ReturnUrl);\r\n return

    {t('error.socialdetailsupdateattempt')}

    {actionMessage}

    \r\n }\r\n }\r\n }\r\n else if (!isLoading) {\r\n if (!errors || errors.length == 0) {\r\n let actionMessage = format(t('updatepassword.backlinktext'), auth.ReturnUrl);\r\n setErrors(ProcessErrors(\"error.usernotloggedin\"));\r\n }\r\n }\r\n }\r\n\r\n var returnUrl = auth.ReturnUrl();\r\n if (!returnUrl && !isLoading) {\r\n if (errors.length == 0) {\r\n errors.push('error.noreturnurl');\r\n }\r\n }\r\n\r\n return (\r\n
    \r\n\r\n \r\n
    \r\n {/*to make the screen reader read out the module heading we explicitly make it focus on it as the mounting happens*/}\r\n

    {t('updatepassword.title')}

    \r\n
    \r\n \r\n \r\n \r\n
    \r\n {getContent()}\r\n
    \r\n \r\n\r\n
    \r\n );\r\n}\r\n\r\n","import React, { Component, useEffect, useRef, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../../i18n';\r\nimport { Link } from 'react-router-dom'\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport './ForgottenPassword.css';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport { format } from 'react-string-format';\r\nimport InputWrapper from '../../UI/Inputs/InputWrapper';\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport InputWrapperRefacture from '../../UI/Inputs/InputWrapperRefacture';\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport useBodyClass from '../../../Hooks/useBodyClass';\r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport { useLocation, useParams } from 'react-router-dom';\r\nimport { IsSafeUrl, RedirectWarning } from '../../Utilities/SafeUrl';\r\nimport useBrandingData from '../../../Hooks/useBrandingData';\r\nimport { emailRegexUtils } from '../../Utilities/EmailRegex';\r\nimport Transition from '../../UI/Transition/Transition';\r\n\r\n\r\n\r\nexport function ForgottenPassword(props) {\r\n const { t, i18n } = useTranslation();\r\n const { environment } = useParams();\r\n const [sent, setSent] = useState(false);\r\n const [errors, setErrors] = useState([]);\r\n const [isNotTrusted, setIsNotTrusted] = useState('');\r\n const [errorState, setErrorState] = useState(false)\r\n const [userEmail, setUserEmail] = useState(\"\");\r\n const [IsEmailInvalid, setIsEmailInvalid] = useState(false);\r\n const [IsEmailBlank, setIsEmailBlank] = useState(false);\r\n const [buttonState, setButtonState] = useState(\"initial\");\r\n const location = useLocation();\r\n const formRef = useRef(null);\r\n const headerRef = useRef(null);\r\n const { from } = location.state ? location.state : \"\";\r\n const { getBrandedHtml } = useBrandingData(props.brandingElement ? props.brandingElement : \"\");\r\n const createUrl = useCreateUrl();\r\n\r\n console.log(from);\r\n const auth = useAuth();\r\n\r\n const checkEmail = (event) => {\r\n event.preventDefault();\r\n setErrors(null);\r\n let bodyFormData = new FormData();\r\n let email = userEmail.toLowerCase();\r\n\r\n if (emailInputIsValid()) {\r\n\r\n setButtonState(\"loading\");\r\n auth.CheckRegisteredAccount(email).then((response) => {\r\n if (response.status === \"email_found\") {\r\n auth.SendForgottenPasswordLink(email).then((response) => {\r\n setSent(true);\r\n }).catch((error) => {\r\n // setErrors(ProcessErrors(\"error.notsent\"));\r\n setSent(true);\r\n });\r\n } else {\r\n setSent(true);\r\n }\r\n }).catch((error) => {\r\n // setErrors(ProcessErrors(\"error.unexpected\"));\r\n setSent(true);\r\n });\r\n }\r\n }\r\n\r\n useBodyClass(['forgotten-password', props.brandingElement?.bodyClass]);\r\n usePageTitle(`Forgotten Password - ${props.brandingElement?.id}`);\r\n\r\n\r\n const emailRegex = emailRegexUtils;\r\n\r\n const Validated = () => {\r\n let validated = true;\r\n let emailValue = userEmail || \"\";\r\n let temp = emailValue?.split(\"@\");\r\n let localPart = temp ? temp[0] : \"\";\r\n if ((emailValue?.match(emailRegex) || []).length <= 0 || localPart.length > 64) {\r\n validated = false;\r\n }\r\n\r\n if (!validated) {\r\n focusOnFirstError();\r\n }\r\n\r\n return validated;\r\n }\r\n\r\n const GotoReturnUrl = () => {\r\n let returnUrl = auth.ReturnUrl();\r\n IsSafeUrl(returnUrl, environment).then((result) => {\r\n if (result) {\r\n\r\n // add adref token to returnUrl if request is from outside this host\r\n\r\n window.location.href = returnUrl;\r\n }\r\n else {\r\n if (!isNotTrusted) {\r\n setIsNotTrusted(returnUrl);\r\n }\r\n }\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n });\r\n }\r\n\r\n //for managing error-message-states\r\n const emailInputIsValid = () => {\r\n\r\n setIsEmailBlank(false)\r\n setIsEmailInvalid(false);\r\n let isValid = Validated();\r\n\r\n if (userEmail == \"\") {\r\n setIsEmailBlank(true)\r\n return false;\r\n }\r\n else if (!isValid) {\r\n setIsEmailInvalid(true);\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n\r\n }\r\n\r\n //onSubmit focusing on first error causing input\r\n const focusOnFirstError = () => {\r\n setTimeout(() => {\r\n let firstElement = formRef.current?.querySelectorAll(\"input[invalidclass='Invalid-input']\")[0]\r\n firstElement?.focus();\r\n }, 200)\r\n\r\n }\r\n\r\n //componentDidMount\r\n useEffect(() => {\r\n headerRef.current?.focus();\r\n }, [])\r\n\r\n return (\r\n\r\n
    \r\n\r\n
    \r\n {from === \"change-email\" ? \r\n \r\n

    {t('updateemail.backlinktext')}

    \r\n
    \r\n :\r\n \r\n \r\n {t('forgottenpassword.backlinktext')}\r\n }\r\n
    \r\n\r\n\r\n
    \r\n
    \r\n\r\n

    {t('login.forgottenpasswordtitle')}

    \r\n {!sent &&

    {t('forgottenpassword.instructionstext')}

    }\r\n
    \r\n
    \r\n\r\n \r\n {!sent ? <>\r\n\r\n
    \r\n \r\n
    \r\n
    \r\n { setUserEmail(e.target.value) }} />\r\n
    \r\n \r\n {IsEmailBlank && {t('login.blankemailinput')}}\r\n {IsEmailInvalid ? props.brandingElement?.mailValidError ? {getBrandedHtml('mailValidError')} : {t('login.incorrectemailinput')} : \"\"}\r\n \r\n
    \r\n \r\n \r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" &&\r\n \r\n }\r\n \r\n
    \r\n\r\n\r\n :\r\n \r\n
    \r\n
    \r\n

    {(t('forgottenpassword.emailsentresponse1'))}{userEmail}{(t('forgottenpassword.emailsentresponse2'))}

    \r\n
    \r\n \r\n
    \r\n \r\n }\r\n\r\n
    \r\n\r\n )\r\n}\r\n\r\n"," \r\nimport React, { Component, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../../i18n';\r\nimport './WarningComponent.css'\r\nimport { Link } from 'react-router-dom'\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport useBodyClass from '../../../Hooks/useBodyClass';\r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\n\r\n\r\nexport function WarningComponent(props) {\r\n const { t, i18n } = useTranslation();\r\n const createUrl = useCreateUrl();\r\n const auth = useAuth();\r\n\r\n useBodyClass(['disabled-account', props.brandingElement?.bodyClass]);\r\n usePageTitle(`This account is disabled - ${props.brandingElement?.id}`);\r\n const htmlString = props.brandingElement?.disabledUserErrorText;\r\n \r\n //The use of dangerouslySetInnerHTML is replacing the innerHTML\r\n //if you need further information please read this https://reactjs.org/docs/dom-elements.html\r\n return (\r\n
    \r\n
    \r\n \r\n \r\n {t('forgottenpassword.backlinktext')}\r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n {t('error.accountinactive')}\r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n )\r\n}\r\n\r\n ","import { Fragment } from \"react\";\r\nimport Button from \"../Buttons/Button\";\r\nimport Input from '../Inputs/InputWrapperRefacture';\r\nimport InputWrapper from '../Inputs/InputWrapper';\r\nimport MessageBox from \"../MessageBox/MessageBox\";\r\nimport { ProductOffer } from \"../../ProductOffer/ProductOffer\";\r\n\r\nconst DesignReview = () => {\r\n return <>\r\n
    \r\n
    \r\n \r\n This is a warning\r\n
    \r\n This is an error message\r\n
    \r\n This is an info message\r\n
    \r\n This is a positive message\r\n
    \r\n This is a neutral message\r\n
    \r\n
    \r\n
    \r\n

    This is an H1

    \r\n

    This is an H2

    \r\n

    This is an H3

    \r\n

    This is an H4

    \r\n
    This is an H5
    \r\n
    \r\n
    \r\n

    Module heading

    \r\n

    Module sub-heading

    \r\n

    Module description

    \r\n\r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n\r\n \r\n
    \r\n\r\n
    \r\n\r\n Input wrapper starts here\r\n\r\n
    \r\n
    \r\n\r\n \r\n\r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n\r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n\r\n
    \r\n \r\n \r\n \r\n \r\n}\r\nexport default DesignReview;","import React, { Component, useEffect, useRef, useState } from 'react';\r\nimport { useParams, useLocation, useNavigate } from 'react-router-dom';\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../../i18n';\r\nimport './ResetPassword.css';\r\nimport { format } from 'react-string-format';\r\nimport ErrorBoxCS from '../../UI/ErrorBox/ErrorBox';\r\nimport { GetConfiguration } from '../../Configuration/ConfigurationManager';\r\nimport Button from '../../UI/Buttons/Button';\r\nimport InputWrapper from '../../UI/Inputs/InputWrapper';\r\nimport { ErrorBox, ProcessErrors } from '../../Utilities/ErrorBox';\r\nimport { useAuth } from '../AuthenticationProvider'\r\nimport { Password } from '../PasswordValidations/PasswordValidations';\r\nimport { Link } from \"react-router-dom\";\r\nimport useCreateUrl from '../../../Hooks/useCreateUrl';\r\nimport { GenericErrorBox } from '../../UI/ErrorBox/GenericErrorBox';\r\nimport { create } from 'http-proxy-middleware/lib/path-rewriter';\r\nimport Transition from '../../UI/Transition/Transition';\r\nimport usePageTitle from '../../../Hooks/usePageTitle';\r\nexport function ResetPassword(props) {\r\n const { t, i18n } = useTranslation();\r\n const [sent, setSent] = useState(false);\r\n const [userPassword, setUserPassword] = useState(\"\");\r\n const [pswValid, setPswValid] = useState(\"false\");\r\n const [errors, setErrors] = useState([]);\r\n const [IsBlank, setIsBlank] = useState({ password: false });\r\n const [userEmail, setUserEmail] = useState(\"\");\r\n const [buttonState, setButtonState] = useState(\"initial\");\r\n const headerRef = useRef(null);\r\n const formRef = useRef(null);\r\n const auth = useAuth();\r\n const navigate = useNavigate();\r\n const { environment } = useParams();\r\n // const { token } = useParams();\r\n // const params = (new URL(document.location)).searchParams;\r\n // const token = params.get(\"token\");\r\n const [tokenValidated, setTokenValidated] = useState(false);\r\n const [updateState, setUpdateState] = useState(\"not_started\"); //state for handling password updation states\r\n const [passwordReset, setPasswordReset] = useState(false);\r\n\r\n const createUrl = useCreateUrl();\r\n const search = useLocation().search;\r\n const token = new URLSearchParams(search).get('token');\r\n\r\n usePageTitle(`Reset Password - ${props.brandingElement?.id}`);\r\n\r\n useEffect(() => {\r\n if (!tokenValidated && errors.length == 0) {\r\n auth.ValidatePasswordResetToken(token).then((result) => {\r\n setTokenValidated(true);\r\n setUserEmail(result.email);\r\n }).catch((result) => {\r\n if (errors.length == 0) {\r\n setErrors(ProcessErrors(auth.errors));\r\n }\r\n });\r\n }\r\n\r\n headerRef.current?.focus();\r\n }, [])\r\n\r\n\r\n const ResetPassword = (event) => {\r\n event.preventDefault();\r\n setErrors(null);\r\n if (Validated()) {\r\n setButtonState(\"loading\")\r\n let password = userPassword;\r\n auth.ResetPassword(token, password).then((result) => {\r\n setUpdateState(\"updated\");\r\n setTimeout(() => {\r\n //addedd the query param email and auth0callback\r\n const url = createUrl(\"login\") + \"&next=Lw==\" + \"&step=password\" + \"&email=\" + encodeURIComponent(userEmail)\r\n navigate(url);\r\n }, 2000)\r\n\r\n // auth.Login(userEmail, password).then((result) => {\r\n // setPasswordReset(true);\r\n\r\n // }).catch(() => {\r\n // errors.push(ProcessErrors(auth.errors));\r\n // })\r\n }).catch(() => {\r\n errors.push(ProcessErrors(auth.errors));\r\n setButtonState(\"initial\")\r\n });\r\n }\r\n }\r\n\r\n let changePasswordText = format(t('updatepassword.summary'), userEmail);\r\n\r\n //validation of all fields enabling the continue buttom\r\n const Validated = () => {\r\n let validated = true;\r\n if (pswValid !== \"true\") {\r\n validated &= false\r\n }\r\n if (userPassword < 1) {\r\n setIsBlank(IsBlank => ({ ...IsBlank, password: true }))\r\n validated &= false\r\n }\r\n\r\n if (!validated) {\r\n focusOnFirstError();\r\n }\r\n return validated;\r\n }\r\n\r\n //on submit focus on first error\r\n const focusOnFirstError = () => {\r\n setTimeout(() => {\r\n let firstElement = formRef.current?.querySelectorAll(\"input[invalidclass='Invalid-input']\")[0]\r\n firstElement?.focus();\r\n }, 200)\r\n\r\n }\r\n\r\n return (\r\n\r\n
    \r\n
    \r\n
    \r\n

    {t('login.resetpasswordtitle')}

    \r\n
    \r\n
    \r\n \r\n {tokenValidated && !passwordReset ? <>\r\n
    \r\n
    \r\n

    {t('resetpassword.instructionstext')} {userEmail}

    \r\n
    \r\n
    \r\n
    \r\n {updateState === \"not_started\" ? <>\r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n \r\n {buttonState === \"initial\" ?\r\n \r\n : buttonState === \"loading\" &&\r\n \r\n }\r\n \r\n \r\n : updateState === \"updated\" && <>\r\n \r\n
    \r\n

    {t('resetpassword.redirecttext')} {t('resetpassword.gotosignin')}

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n }\r\n
    \r\n \r\n : ''\r\n }\r\n {/* {passwordReset ? <>\r\n

    {t('resetpassword.resetcomplete')}

    \r\n \r\n : ''\r\n } */}\r\n
    \r\n )\r\n}\r\n\r\n","import React, { Component, useState } from 'react';\r\nimport { useParams, Link } from 'react-router-dom'\r\nimport { useTranslation } from 'react-i18next';\r\nimport '../../i18n';\r\nimport { ErrorBox, ProcessErrors } from '../Utilities/ErrorBox';\r\nimport { APIGet } from '../API/APIRequest';\r\nimport { GenericErrorBox } from '../UI/ErrorBox/GenericErrorBox';\r\n \r\nimport usePageTitle from '../../Hooks/usePageTitle';\r\n\r\nexport function ClearCache(props) {\r\n\r\n usePageTitle(`Clear cache - ${props.brandingElement?.id}`);\r\n const { t, i18n } = useTranslation(); \r\n const [sent, setSent] = useState(false);\r\n const [errors, setErrors] = useState([]);\r\n const [cacheCleared, setCacheCleared] = useState(false);\r\n\r\n const { environment } = useParams();\r\n const clearCache = () => {\r\n \r\n APIGet({\r\n \"controller\": \"cache\",\r\n \"action\": \"clearcache\",\r\n \"environment\": environment\r\n }).then((response) => {\r\n setCacheCleared(true);\r\n }).catch((errors) => {\r\n setErrors(ProcessErrors(errors));\r\n }); \r\n }\r\n\r\n if (!cacheCleared && errors.length == 0) {\r\n clearCache();\r\n }\r\n\r\n \r\n\r\n return (\r\n
    \r\n \r\n {cacheCleared ? <>\r\n

    Cache cleared

    \r\n \r\n :

    \r\n }\r\n
    )\r\n}\r\n\r\n","import React, { useEffect } from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { Loading } from '../Utilities/Loading';\r\n \r\nimport usePageTitle from '../../Hooks/usePageTitle';\r\n\r\n\r\nexport function Redirection(props) {\r\n usePageTitle(`Redirect processing - ${props.brandingElement?.id}`);\r\n\r\n const { state } = useLocation();\r\n \r\n useEffect(()=>{\r\n\r\n if(state){\r\n window.location.replace(state?.returnUrl);\r\n }\r\n \r\n\r\n },[state])\r\n \r\n\r\n return ( )\r\n}\r\n\r\n","import React, { Component, useState, useEffect } from 'react';\r\nimport { APIGet, APIPost } from '../API/APIRequest';\r\nexport function Test(props) {\r\n\r\n APIGet({\r\n \"controller\": \"security\",\r\n \"action\": \"test\",\r\n \"data\": {\r\n \"data1\": \"GET data1\",\r\n \"data2\": \"GET data2\"\r\n },\r\n \"environment\": null\r\n }).then((response) => { console.log(response) })\r\n .catch((error) => { console.log(error) });\r\n\r\n var data = new FormData();\r\n data.append(\"data1\", \"POST data1\");\r\n data.append(\"data2\", \"POST data2\");\r\n APIPost({\r\n \"controller\": \"security\",\r\n \"action\": \"test\",\r\n \"data\": data,\r\n \"environment\": null\r\n }).then((response) => { console.log(response) })\r\n .catch((error) => { console.log(error) });\r\n return (\r\n
    \r\n Hello World\r\n
    \r\n )\r\n \r\n}\r\n","import { useEffect, useState} from 'react';\r\n\r\n//go through for error handling\r\n\r\nexport function DynamicScriptComponent({ metaData, branding}) {\r\n\t\r\n const [metaScriptsAdded, setMetaScriptsAdded] = useState(false);\r\n const [brandingScriptsAdded, setBrandingScriptsAdded] = useState(false);\r\n\r\n const extractingScript = (data) => {\r\n const scripts = [];\r\n if (data) {\r\n\r\n let tempDiv = document.createElement('div');\r\n tempDiv.innerHTML = data;\r\n let scriptTags = tempDiv.getElementsByTagName('script');\r\n\r\n for (let i = 0; i < scriptTags.length; i++) {\r\n let scriptContent = scriptTags[i].textContent || scriptTags[i].innerText;\r\n let srcAttributeValue = scriptTags[i].getAttribute('src');\r\n let scriptId = scriptTags[i].id;\r\n let scriptType = scriptTags[i].type;\r\n scripts.push({ \"scriptContent\": scriptContent, \"src\": srcAttributeValue, \"id\":scriptId, 'type':scriptType });\r\n }\r\n }\r\n return scripts;\r\n }\r\n\r\n //element=where to append\r\n //pos= the position in the element\r\n const executingScripts = (scripts, element, pos) => {\r\n scripts.forEach(script => {\r\n const newScript = document.createElement('script');\r\n\r\n if(script.id){\r\n newScript.id = script.id;\r\n }\r\n if(script.type){\r\n newScript.type = script.type; \r\n }\r\n \r\n if (script.src) {\r\n newScript.src = script.src;\r\n } else {\r\n newScript.textContent = script.scriptContent;\r\n }\r\n\r\n if (element === \"body\") {\r\n document.body.insertAdjacentElement(pos, newScript);\r\n }\r\n else if (element === \"head\") {\r\n document.head.insertAdjacentElement(pos, newScript);\r\n }\r\n \r\n });\r\n }\r\n\r\n\r\n const removingScripts = (addedScripts) => {\r\n addedScripts.forEach(script => {\r\n if (script.src) {\r\n const existingScript = document.querySelector(`script[src=\"${script.src}\"]`);\r\n if (existingScript) {\r\n existingScript.remove();\r\n }\r\n } else if (script.scriptContent) {\r\n \r\n const existingScripts = document.querySelectorAll(`script`);\r\n existingScripts.forEach(existingScript => {\r\n if (existingScript.textContent === script.scriptContent) {\r\n existingScript.remove();\r\n }\r\n });\r\n }\r\n });\r\n };\r\n\r\n useEffect(() => {\r\n\r\n if (!brandingScriptsAdded && branding) {\r\n\r\n try {\r\n\r\n const headHtmlScript = extractingScript(branding?.headHtml);\r\n executingScripts(headHtmlScript, \"head\", \"beforeend\");\r\n\r\n const afterBodyOpenScript = extractingScript(branding?.afterBodyOpenData);\r\n executingScripts(afterBodyOpenScript, \"body\", \"afterbegin\");\r\n\r\n const beforeBodyCloseScript = extractingScript(branding?.beforeBodyCloseData);\r\n executingScripts(beforeBodyCloseScript, \"body\", \"beforeend\");\r\n\r\n setBrandingScriptsAdded(true)\r\n\r\n return () => {\r\n removingScripts(headHtmlScript);\r\n removingScripts(afterBodyOpenScript);\r\n removingScripts(beforeBodyCloseScript);\r\n\r\n };\r\n\r\n } catch (error) {\r\n console.error('Error in appending the script. Please check if the call is taking place correctly', error);\r\n }\r\n }\r\n\r\n }, [branding]);\r\n\r\n\r\n useEffect(() => {\r\n \r\n if (!metaScriptsAdded && metaData) {\r\n try {\r\n\r\n const partyMetaDataScript = extractingScript(metaData?.partymetadata);\r\n executingScripts(partyMetaDataScript, \"head\", \"afterbegin\");\r\n\r\n const basketMetaDataScript = extractingScript(metaData?.basketmetadata);\r\n executingScripts(basketMetaDataScript, \"head\", \"afterbegin\");\r\n\r\n setMetaScriptsAdded(true)\r\n\r\n return () => {\r\n removingScripts(basketMetaDataScript);\r\n removingScripts(partyMetaDataScript);\r\n \r\n };\r\n\r\n } catch (error) {\r\n console.error('Error in appending the script. Please check if the call is taking place correctly', error);\r\n }\r\n }\r\n\r\n }, [metaData]);\r\n\r\n return (\r\n\r\n <>\r\n\r\n );\r\n}","import React, { Component, Fragment, Suspense, useEffect, useLayoutEffect, useState } from 'react';\r\nimport ReactDom from 'react-dom';\r\nimport ReactHtmlParser from 'html-react-parser';\r\nimport { Routes, Route } from 'react-router-dom';\r\nimport './general.css'\r\nimport './normalize.css'\r\nimport './reset.css'\r\nimport Layout from './components/Layout';\r\nimport './i18n'\r\nimport PrivateRoute from './components/Utilities/PrivateRoute';\r\nimport { Payment } from './components/Order/Payment';\r\nimport { OrderComplete } from './components/Order/OrderComplete';\r\n//import { StripeResponseHandler } from './components/Order/Payment/StripeResponseHandler';\r\nimport { Login } from './components/Authentication/Login'\r\nimport TagManager from 'react-gtm-module'\r\nimport { Logout } from './components/Authentication/Logout'\r\nimport { Auth0Callback } from './components/Authentication/Auth0/Auth0Callback'\r\nimport { Register } from './components/Authentication/Register/Register'\r\nimport { UpdateEmail } from './components/Authentication/UpdateEmail/UpdateEmail'\r\nimport { UpdatePassword} from './components/Authentication/UpdatePassword/UpdatePassword'\r\nimport { ForgottenPassword } from './components/Authentication/ForgottenPassword/ForgottenPassword'\r\nimport { WarningComponent } from './components/Authentication/WarningComponent/WarningComponent';\r\nimport { RefreshADToken } from './components/Utilities/TokenManager'\r\nimport { Loading } from './components/Utilities/Loading'\r\nimport { ErrorBox, ProcessErrors } from './components/Utilities/ErrorBox'\r\n//import { ProductOffer } from './components/ProductOffer/ProductOffer';\r\nimport { useAuth } from './components/Authentication/AuthenticationProvider';\r\nimport DesignReview from './components/UI/DesignReview/DesignReview';\r\nimport HeadProperties from './components/Layout/Head/HeadProperties';\r\nimport { ResetPassword } from './components/Authentication/ResetPassword/ResetPassword';\r\nimport { ClearCache } from './components/Caching/ClearCache';\r\nimport { APIGet, APIPost , getEnvironment } from './components/API/APIRequest';\r\nimport { Redirection } from './components/Redirection/Redirection';\r\nimport { Test } from './components/Test/Test';\r\nimport {\r\n GoogleReCaptchaProvider,\r\n useGoogleReCaptcha\r\n } from 'react-google-recaptcha-v3';\r\nimport { DynamicScriptComponent } from './DynamicScriptComponent';\r\n \r\n\r\n\r\n\r\nexport default function App(props) {\r\n const [branding, setBranding] = useState(null);\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [reCaptchaKey, setReCaptchaKey] = useState(null);\r\n const [metaData, setMetaData] = useState(null);\r\n \r\n\r\n const environment = getEnvironment();\r\n const auth = useAuth();\r\n\r\n\r\n const loadheaderBranding = async () => {\r\n await APIGet({\r\n \"controller\": \"brand\",\r\n \"action\": \"getbranding\",\r\n \"environment\": environment\r\n })\r\n .then(function (response) {\r\n // handle success\r\n setBranding(response.data.branding);\r\n if(response.data.branding){\r\n if(response.data.branding?.reCAPTCHAkey )\r\n {\r\n setReCaptchaKey(response.data.branding?.reCAPTCHAkey)\r\n }\r\n else{\r\n setReCaptchaKey(\"no_recaptcha\")\r\n }\r\n } //this is also async..so may take time so directly pass in the function.\r\n htmlHeadScript(response.data.branding);\r\n cssHeadScript(response.data.branding);\r\n tagManager(response.data.branding);\r\n faviconCustom(response.data.branding)\r\n setIsLoading(false);\r\n console.log('app:');\r\n console.log(response.data);\r\n\r\n })\r\n .catch(function (error) {\r\n // handle error\r\n setReCaptchaKey(\"no_recaptcha\") //if recaptcha snippet throws an error.\r\n setIsLoading(false)\r\n console.log(error);\r\n })\r\n\r\n }\r\n\r\n const tagManager = (branding) => {\r\n if (branding && environment != \"ad-frontend.abasoft.co.uk\") {\r\n const tagManagerArgs = {\r\n gtmId: branding.gtmId\r\n\r\n }\r\n\r\n TagManager.initialize(tagManagerArgs)\r\n }\r\n }\r\n\r\n\r\n const htmlHeadScript = (br) => {\r\n const htmlHead = br.headHtml;\r\n const tempDiv = document.createElement('div');\r\n tempDiv.innerHTML=htmlHead;\r\n const scripts = tempDiv.querySelectorAll('script');\r\n\r\n scripts.forEach((script)=>{\r\n script.remove();\r\n })\r\n\r\n const modifiedHtml= tempDiv.innerHTML;\r\n return document.head.insertAdjacentHTML('beforeend', modifiedHtml);\r\n }\r\n\r\n const cssHeadScript = (data) => {\r\n const inlinecssHead = ``;\r\n return document.head.insertAdjacentHTML('beforeend', inlinecssHead);\r\n }\r\n \r\n\r\n const faviconCustom = (data) => {\r\n const favString = data.favicon || \"\";\r\n const favicons = favString.split(',');\r\n\r\n favicons.map((favicon, i) => {\r\n const link = ``;\r\n return document.head.insertAdjacentHTML('beforeend', link);\r\n });\r\n }\r\n\r\n \r\n useEffect(() => {\r\n RefreshADToken();\r\n loadheaderBranding(); \r\n }, [])\r\n \r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n } />\r\n } />\r\n {/*} /> */}\r\n {/*} />*/}\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n \r\n \r\n \r\n \r\n\r\n );\r\n\r\n}\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://cra.link/PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://cra.link/PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://cra.link/PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch((error) => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log('No internet connection found. App is running in offline mode.');\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then((registration) => {\r\n registration.unregister();\r\n })\r\n .catch((error) => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","const reportWebVitals = (onPerfEntry) => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import React, { Suspense } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { BrowserRouter, useHistory } from 'react-router-dom';\r\nimport Client from './Client';\r\nimport App from './App';\r\n\r\nimport * as serviceWorkerRegistration from './serviceWorkerRegistration';\r\nimport reportWebVitals from './reportWebVitals';\r\nimport { AuthenticationProvider } from './components/Authentication/AuthenticationProvider'\r\nimport { Loading } from './components/Utilities/Loading'\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nconst rootElement = document.getElementById('root');\r\n\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n rootElement);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://cra.link/PWA\r\nserviceWorkerRegistration.unregister();\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n"],"sourceRoot":""}