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3S,UAE/BsC,EAAAA,EAAAA,KAACuP,GAAsB,U,gBChCxB,MCcDrM,GDdoB,IAAI2L,EAAAA,OAAOjJ,GAAAA,GAAc,CAAEkJ,SAAUmC,GAAAA,KCchC5B,YAAY,aAEpCxO,eAAeqQ,GAAOC,GAEN,IAAIC,gBAAgBlW,OAAOC,SAASkW,KAAKC,MAAM,KAAK,IAAzE,MAEM,OAAEC,EAAS,IAAOJ,EAAYK,SAC9B,WAAE9W,KAAe+W,IAAcC,EAAAA,EAAAA,sBACnCH,EACA,KAEI,YAAEvO,EAAW,OAAEpI,GAAW6W,EAI9BE,EAAAA,oBAAoBC,YAAWC,EAAAA,EAAAA,uCA2BjC,MAAM,WAAEC,SAAqB,oCAC7BA,EAAWX,GAAaD,QACtBlR,EAAAA,EAAAA,KAAC+P,EAAAA,cAAa,CAACD,OAAQ5M,GAAYxF,UACjCsC,EAAAA,EAAAA,KAAC+R,EAAAA,uBAAsB,CACrBrX,WAAYA,EACZsX,aAAa,GAAEtU,UAEfsC,EAAAA,EAAAA,KAACiS,EAAAA,EAAa,CACZC,qBAAmB,EACnBC,SAAUC,GAAAA,GAAkB1U,UAE5BsC,EAAAA,EAAAA,KAACyQ,GAAG,IAAKgB,UAKnB,C","sources":["webpack://oriwebmessengerapp/../../../src/utils/removeLanguageFromUrl.ts","webpack://oriwebmessengerapp/../../../src/hooks/useGetWebMessengerConfiguration.ts","webpack://oriwebmessengerapp/../../../src/utils/waitAndExecute.ts","webpack://oriwebmessengerapp/../../../src/utils/purgeLocalStorage.ts","webpack://oriwebmessengerapp/../../../src/contexts/webMessengerContext.tsx","webpack://oriwebmessengerapp/../../../src/utils/prepareGenesysScript.ts","webpack://oriwebmessengerapp/../../../src/hooks/useIsButtonVisible.ts","webpack://oriwebmessengerapp/../../../src/hooks/useSetWindowOriGenesysPlugin.ts","webpack://oriwebmessengerapp/../../../src/constants/app.ts","webpack://oriwebmessengerapp/../../../src/utils/authUtils.ts","webpack://oriwebmessengerapp/../../../src/contexts/externalAuthContext.tsx","webpack://oriwebmessengerapp/../../../src/utils/generateAuthUrl.ts","webpack://oriwebmessengerapp/../../../src/hooks/useCreateAuthenticatedSession.ts","webpack://oriwebmessengerapp/../../src/constants-generated.ts","webpack://oriwebmessengerapp/../../../src/queries-net/customerQuery.ts","webpack://oriwebmessengerapp/../../../src/utils/shouldSkipGraphqlQuery.ts","webpack://oriwebmessengerapp/../../../src/utils/getCustomerData.ts","webpack://oriwebmessengerapp/../../../src/hooks/useSendCustomerAttributes.ts","webpack://oriwebmessengerapp/../../../src/utils/sendCustomerData.ts","webpack://oriwebmessengerapp/../../../../src/components/Icon/styles.ts","webpack://oriwebmessengerapp/../../../../src/components/Icon/Icon.tsx","webpack://oriwebmessengerapp/../../../../src/components/Button/styles.ts","webpack://oriwebmessengerapp/../../../../src/components/Button/Button.tsx","webpack://oriwebmessengerapp/../../../src/hooks/useTranslations.ts","webpack://oriwebmessengerapp/../../../src/hooks/useOpenChatQueryParamOnMount.ts","webpack://oriwebmessengerapp/../../../../src/components/Button/constants.ts","webpack://oriwebmessengerapp/../../../../src/components/WebMessenger/WebMessenger.tsx","webpack://oriwebmessengerapp/../../../src/constants/defaultTranslations.ts","webpack://oriwebmessengerapp/../../src/logger.ts","webpack://oriwebmessengerapp/../../../src/containers/ApiProvider.tsx","webpack://oriwebmessengerapp/../../../src/containers/WebMessengerController.tsx","webpack://oriwebmessengerapp/./src/App.tsx","webpack://oriwebmessengerapp/./src/logger.ts","webpack://oriwebmessengerapp/./src/appRender.tsx"],"sourcesContent":["const REGEX_FOR_LANGUAGE_CODE = /^\\/[a-z]{2}(\\/|$)/i;\n\n/**\n * Remove language code from url\n * /kz/products => /products\n * /kz => /\n *\n * @param url\n */\nexport const removeLanguageFromRelativeUrl = (url?: string) =>\n url && REGEX_FOR_LANGUAGE_CODE.test(url) ? url.replace(REGEX_FOR_LANGUAGE_CODE, '/') : (url ?? '/');\n","import { isAuthenticatedCustomer, useToken } from '@ori/auth';\nimport { useEnvironment } from '@ori/environment';\nimport { validateStatus } from '@ori/fetching';\nimport { useGetCustomerInfo } from '@ori/presentation-http';\nimport { isSSR } from '@ori/presentation-utils';\nimport { useGetTenantApplicationsWebMessengerConfiguration } from '@ori/static-api-client-react';\n\nimport { removeLanguageFromRelativeUrl } from '../utils';\n\ninterface IsUseGetTenantApplicationsWebMessengerConfigurationEnabled\n extends Pick, 'customerTypeId' | 'visitorSegment'> {\n isAuthenticated: boolean;\n relativeUrl?: string;\n}\n\nexport const isUseGetTenantApplicationsWebMessengerConfigurationEnabled = ({\n customerTypeId,\n isAuthenticated,\n relativeUrl,\n visitorSegment,\n}: IsUseGetTenantApplicationsWebMessengerConfigurationEnabled) =>\n !!relativeUrl && (!isAuthenticated || (customerTypeId !== undefined && visitorSegment !== undefined));\n\nexport const useGetWebMessengerConfiguration = () => {\n const { customerId } = useToken();\n // istanbul ignore next -- No need to test undefined tenant case.\n const { tenant } = useEnvironment();\n const { customerTypeId, visitorSegment } = useGetCustomerInfo({ customerId });\n const isAuthenticated = isAuthenticatedCustomer(customerId);\n // istanbul ignore next -- No need to test isSSR.\n const relativeUrl = isSSR() ? undefined : removeLanguageFromRelativeUrl(window.location.pathname);\n\n return useGetTenantApplicationsWebMessengerConfiguration(\n tenant,\n {\n customerTypeId,\n relativeUrl,\n visitorSegment,\n },\n {\n swr: {\n enabled: isUseGetTenantApplicationsWebMessengerConfigurationEnabled({\n customerTypeId,\n isAuthenticated,\n relativeUrl,\n visitorSegment,\n }),\n revalidateIfStale: false,\n revalidateOnFocus: false,\n revalidateOnReconnect: false,\n },\n request: {\n validateStatus,\n },\n },\n );\n};\n","export const waitAndExecute = (callback: () => void, delay: number) => {\n setTimeout(callback, delay);\n};\n","/**\n * Genesys cloud stores some data in local storage.\n * This function removes it to be able to auto login again.\n */\nexport const purgeLocalStorage = () => {\n Object.keys(localStorage)\n .filter((key) => key.startsWith('_act') || key.includes(':gcm') || key.startsWith('_gca'))\n .forEach((key) => localStorage.removeItem(key));\n};\n","/* istanbul ignore file -- Does not make sense to test loading of script */\n\n/* eslint-disable new-cap -- Genesys preset naming */\nimport type { GlobalEvent } from '@ori/presentation-hooks';\nimport { useGlobalEvents } from '@ori/presentation-hooks';\nimport {\n createContext,\n type FC,\n type PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { useGetWebMessengerConfiguration } from '../hooks/useGetWebMessengerConfiguration';\nimport { prepareGenesysScript, waitAndExecute } from '../utils';\nimport { purgeLocalStorage } from '../utils/purgeLocalStorage';\n\nexport interface WebMessengerContext {\n isScriptLoaded: boolean;\n isChatOpened: boolean;\n isMessengerReady: boolean;\n loading: boolean;\n openChatWindow: () => void;\n closeChatWindow: () => void;\n deploymentId?: string;\n}\n\nexport const webMessengerContextDefaultValue: WebMessengerContext = {\n isChatOpened: false,\n isScriptLoaded: false,\n isMessengerReady: false,\n loading: false,\n openChatWindow: () => {},\n closeChatWindow: () => {},\n deploymentId: '',\n};\n\nexport const webMessengerContext = createContext(webMessengerContextDefaultValue);\n\nconst { Provider } = webMessengerContext;\n\nconst MESSENGER_DELAY = 3000;\n\nexport interface WebMessengerProviderProps extends PropsWithChildren {\n /** If true genesys script is loaded on first render. */\n preloadGenesysScript?: boolean;\n}\n\nexport const WebMessengerProvider: FC = ({ preloadGenesysScript, children }) => {\n const [isScriptLoaded, setIsScriptLoaded] = useState(false);\n const [isMessengerReady, setIsMessengerReady] = useState(false);\n const [loading, setLoading] = useState(false);\n const [isChatOpened, setIsChatOpened] = useState(false);\n const { data } = useGetWebMessengerConfiguration();\n const { deploymentId, environment, scriptUrl } = data ?? {};\n\n const events = useMemo(() => [{ name: 'beforeunload', listener: purgeLocalStorage }], []);\n useGlobalEvents(events);\n\n const loadScript = useCallback(() => {\n const onLoad = () => {\n setIsScriptLoaded(true);\n window.Genesys?.('subscribe', 'Messenger.Ready', () => setIsMessengerReady(true));\n };\n\n const script = prepareGenesysScript({\n deploymentId,\n environment,\n scriptUrl,\n });\n\n if (script) {\n script.addEventListener('load', onLoad);\n document.head.append(script);\n\n return () => script.remove();\n }\n\n return undefined;\n }, [deploymentId, environment, scriptUrl]);\n\n useEffect(() => {\n if (preloadGenesysScript && deploymentId && !isScriptLoaded) {\n loadScript();\n }\n }, [deploymentId, isScriptLoaded, loadScript, preloadGenesysScript]);\n\n const openChatWindow = useCallback(() => {\n setIsChatOpened(true);\n if (!isScriptLoaded) {\n setLoading(true);\n loadScript();\n }\n\n waitAndExecute(\n () => {\n window.Genesys?.('command', 'Messenger.open');\n setLoading(false);\n },\n isScriptLoaded && isMessengerReady ? 0 : MESSENGER_DELAY,\n );\n }, [isMessengerReady, loadScript, isScriptLoaded]);\n\n const closeChatWindow = useCallback(() => {\n setIsChatOpened(false);\n if (isScriptLoaded && isMessengerReady) {\n window.Genesys?.('command', 'Messenger.close');\n }\n }, [isMessengerReady, isScriptLoaded]);\n\n useEffect(() => {\n if (isScriptLoaded && isMessengerReady) {\n window.Genesys?.('subscribe', 'Messenger.closed', closeChatWindow);\n }\n }, [isMessengerReady, closeChatWindow, isScriptLoaded]);\n\n const value = useMemo(\n () => ({\n isScriptLoaded,\n isChatOpened,\n openChatWindow,\n closeChatWindow,\n loading,\n deploymentId,\n isMessengerReady,\n }),\n [isMessengerReady, isScriptLoaded, isChatOpened, openChatWindow, closeChatWindow, loading, deploymentId],\n );\n\n return {children};\n};\n\nexport const useWebMessenger = () => useContext(webMessengerContext);\n","import type { StaticApplicationsWebMessengerWebMessengerConfigurationDto } from '@ori/static-api-client-react';\n\nexport const prepareGenesysScript = ({\n deploymentId,\n environment,\n scriptUrl,\n}: StaticApplicationsWebMessengerWebMessengerConfigurationDto | undefined = {}) => {\n if (!window.Genesys) {\n Object.defineProperty(window, 'Genesys', { writable: true, value: {} });\n }\n if (deploymentId && environment && scriptUrl) {\n window._genesysJs = 'Genesys';\n Object.defineProperty(window, 'Genesys', {\n writable: true,\n value: {\n t: Date.now(),\n c: {\n environment,\n deploymentId,\n debug: process.env.NODE_ENV !== 'production',\n },\n },\n });\n const script = document.createElement('script');\n script.src = scriptUrl;\n\n return script;\n }\n\n return null;\n};\n","import { useEnvironment } from '@ori/environment';\nimport { getRetryErrorSwrOptions } from '@ori/presentation-utils';\nimport { useGetTenantFeatureToggle } from '@ori/static-api-client-react';\nimport { useEffect, useState } from 'react';\n\nimport { useWebMessenger } from '../contexts/webMessengerContext';\n\n/** Turns on chatbot ANNA */\nconst UseNewBotChat = '986DF7FE-88E1-4742-B77F-43DC8B3D2F76';\n\n/**\n * Checks if chat-bot is used and if chat is opened.\n * If chat-bot is used WebMessenger button is visible right after chat-bot opens WebMessenger.\n * If chat-bot is not used WebMessenger button is always visible.\n */\nexport const useIsButtonVisible = () => {\n const { tenant } = useEnvironment();\n const { isChatOpened } = useWebMessenger();\n const [isButtonVisible, setIsButtonVisible] = useState(false);\n const { data: { isEnabled } = { isEnabled: true } } = useGetTenantFeatureToggle(tenant, UseNewBotChat, {\n swr: getRetryErrorSwrOptions(),\n });\n useEffect(() => {\n if (isChatOpened || !isEnabled) {\n setIsButtonVisible(true);\n }\n }, [isChatOpened, isEnabled]);\n\n return { isButtonVisible };\n};\n","import { useEffect } from 'react';\n\nimport { useWebMessenger } from '../contexts/webMessengerContext';\nimport type { OriGenesysPlugin } from '../models';\n\n// istanbul ignore next -- No need to test this function.\nconst emptyFunction = () => {};\n// istanbul ignore next -- No need to test this function.\nconst nullFunction = () => null;\n\n/**\n * Sets the OriGenesysPlugin object on the window object.\n * Object is used by chat-bot to communicate with WebMessenger and to open WebMessenger.\n */\nexport const useSetWindowOriGenesysPlugin = () => {\n const { deploymentId, closeChatWindow, openChatWindow } = useWebMessenger();\n\n useEffect(() => {\n if (deploymentId && !window.oriGenesysPlugin) {\n const value: OriGenesysPlugin = {\n ininChat: {\n clearUserData: emptyFunction,\n events: {\n CHAT_DISCONNECT: '',\n CLOSE: '',\n COMPLETE: '',\n INIT: '',\n OPEN_ERROR: '',\n READY: '',\n RECONNECT_FAILURE: '',\n subscribe: emptyFunction,\n unsubscribe: emptyFunction,\n },\n getChatId: nullFunction,\n handleClose: closeChatWindow,\n iFrame: { load: openChatWindow },\n openChatWindow,\n popup: { close: emptyFunction, login: emptyFunction, minimize: emptyFunction, open: emptyFunction },\n server: { sendMessage: emptyFunction },\n toggle: emptyFunction,\n toggleVisibility: emptyFunction,\n },\n };\n Object.defineProperty(window, 'oriGenesysPlugin', { writable: true, value });\n }\n }, [closeChatWindow, deploymentId, openChatWindow]);\n};\n","// istanbul ignore file -- No need to test constants.\n\n/**\n * Iframe id for authentication.\n */\nexport const AUTH_IFRAME_ID = 'GenesysAuthFrame';\n\n/**\n * Auth Code storage parameter.\n */\nexport const AUTH_CODE_STORAGE_PARAMETER_FOR_GENESYS = 'genesysAuthCode';\n\n/**\n * Issuer storage parameter.\n */\nexport const ISSUER_STORAGE_PARAMETER_FOR_GENESYS = 'genesysIssuer';\n\n/**\n * Base URI for authentication.\n */\nexport const REDIRECT_URI_BASE = `https://clientapp-${\n process.env.NODE_ENV === 'production' ? '' : 'test-'\n}cdn.oriflame.com`;\n\n/**\n * Redirect URI for authentication.\n */\nexport const REDIRECT_URI = `${REDIRECT_URI_BASE}/static/web-messenger/auth-callback/index.html`;\n\nexport const MESSENGER_DELAY = 2000;\n","/**\n * Converts a decimal number to a hexadecimal string.\n *\n * @param {number} dec - The decimal number to be converted to hexadecimal.\n * @returns {string} The hexadecimal representation of the input decimal number.\n */\nexport const dec2hex = (dec: number): string => `0${dec.toString(16)}`.slice(-2);\n\n/**\n * Generates a random code verifier for PKCE (Proof Key for Code Exchange) authentication.\n *\n * @returns {string} A random code verifier represented as a hexadecimal string.\n */\nconst generateCodeVerifier = () => {\n const array = new Uint32Array(56 / 2);\n window.crypto.getRandomValues(array);\n\n return Array.from(array, dec2hex).join('');\n};\n\n/**\n * Generates an SHA-256 hash of a string.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest\n *\n * @param {string} plain - The string to be hashed.\n */\nconst sha256 = async (plain: string): Promise => {\n const encoder = new TextEncoder();\n const data = encoder.encode(plain);\n\n return window.crypto.subtle.digest('SHA-256', data);\n};\n\n/**\n * Base64url encoding is similar to base64 encoding except it uses non-reserved URL characters\n * (e.g., '-', '_', '~') instead of reserved URL characters (e.g., '+', '/', '=').\n *\n * @param {ArrayBuffer} a - The array buffer to be encoded.\n * @returns {string} The base64url encoded string.\n */\nconst base64urlEncode = (a: ArrayBuffer): string => {\n const bytes = new Uint8Array(a);\n const len = bytes.byteLength;\n let str = '';\n for (let i = 0; i < len; i++) {\n const point = bytes[i];\n if (point !== undefined) {\n str += String.fromCodePoint(point);\n }\n }\n\n // eslint-disable-next-line unicorn/better-regex -- We need not to change the regex\n return btoa(str).replaceAll('+', '-').replaceAll('/', '_').replace(/[=]+$/, '');\n};\n\n/**\n * Generates a code challenge from a code verifier for PKCE (Proof Key for Code Exchange) authentication.\n * The code challenge is a base64url encoded SHA-256 hash of the code verifier.\n *\n * See https://tools.ietf.org/html/rfc7636#section-4.2 for more details.\n *\n * @param {string} v - The code verifier to generate a code challenge from.\n * @returns {string} The code challenge.\n *\n */\nasync function generateCodeChallengeFromVerifier(v: string): Promise {\n const hashed = await sha256(v);\n\n return base64urlEncode(hashed);\n}\n\ninterface VerifierAndChallenge {\n codeChallenge: string;\n codeVerifier: string;\n}\n\n/**\n * Generates a code verifier and a code challenge for PKCE (Proof Key for Code Exchange) authentication.\n * The code verifier is a random string and the code challenge is a base64url encoded SHA-256 hash of the code verifier.\n * See https://tools.ietf.org/html/rfc7636#section-4.2 for more details.\n *\n * @returns {VerifierAndChallenge} The code verifier and the code challenge.\n *\n */\nexport const generateVerifierAndChallenge = async (): Promise => {\n const codeVerifier = generateCodeVerifier();\n const codeChallenge = await generateCodeChallengeFromVerifier(codeVerifier);\n\n return { codeChallenge, codeVerifier };\n};\n","import { NOT_LOGGED_IN_USER_ID, useToken } from '@ori/auth';\nimport { useServiceUrls } from '@ori/configuration-manager';\nimport { useEnvironment } from '@ori/environment';\nimport { useLogger } from '@ori/logger';\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useEffect, useMemo, useState } from 'react';\n\nimport {\n AUTH_CODE_STORAGE_PARAMETER_FOR_GENESYS,\n AUTH_IFRAME_ID,\n ISSUER_STORAGE_PARAMETER_FOR_GENESYS,\n} from '../constants';\nimport { generateAuthUrl } from '../utils';\nimport { generateVerifierAndChallenge } from '../utils/authUtils';\n\nexport interface ExternalAuthContext {\n codeVerifier: string;\n}\n\ninterface MessageEvent {\n data: {\n source: string;\n code: string;\n iss: string;\n };\n}\n\nexport const externalAuthContext = createContext({\n codeVerifier: '',\n});\n\nconst { Provider } = externalAuthContext;\n\nexport const ExternalAuthProvider: FC = ({ children }) => {\n // istanbul ignore next -- No need to test undefined tenant case.\n const { tenant } = useEnvironment();\n const { identityUrl } = useServiceUrls(['identity']);\n const { customerId } = useToken();\n const localLogger = useLogger('ExternalAuthProvider');\n\n const [codeVerifier, setCodeVerifier] = useState('');\n\n useEffect(() => {\n const handleMessage = (event: MessageEvent) => {\n if (event.data.source === 'genesysAuth' && event.data.code && event.data.iss) {\n localStorage.setItem(AUTH_CODE_STORAGE_PARAMETER_FOR_GENESYS, event.data.code);\n localStorage.setItem(ISSUER_STORAGE_PARAMETER_FOR_GENESYS, event.data.iss);\n\n document.getElementById(AUTH_IFRAME_ID)?.remove();\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => window.removeEventListener('message', handleMessage);\n }, []);\n\n useEffect(() => {\n if (customerId !== NOT_LOGGED_IN_USER_ID) {\n // istanbul ignore next -- No need to test setup of iframe.\n generateVerifierAndChallenge()\n .then(({ codeChallenge, codeVerifier: newCodeVerifier }) => {\n const authUrl = generateAuthUrl({ codeChallenge, identityUrl, tenant });\n\n setCodeVerifier(newCodeVerifier);\n\n const iframe = document.createElement('iframe');\n iframe.id = AUTH_IFRAME_ID;\n iframe.src = authUrl;\n iframe.sandbox.add('allow-forms');\n iframe.sandbox.add('allow-scripts');\n iframe.sandbox.add('allow-same-origin');\n iframe.hidden = true;\n iframe.style.visibility = 'hidden';\n iframe.style.display = 'none';\n\n document.body.append(iframe);\n\n return () => iframe.remove();\n })\n .catch((error) => {\n localLogger.error(\n new Error('Generating of a code verifier and a code challenge for PKCE failed', { cause: error }),\n );\n });\n }\n }, [customerId, identityUrl, localLogger, tenant]);\n\n const value = useMemo(\n () => ({\n codeVerifier,\n }),\n [codeVerifier],\n );\n\n return {children};\n};\n\nexport const useExternalAuth = () => useContext(externalAuthContext);\n","import type { ClientServiceUrls } from '@ori/configuration-manager';\nimport type { EnvironmentContext } from '@ori/environment';\n\nimport { REDIRECT_URI } from '../constants';\n\nexport interface GenerateAuthUrlParams\n extends Required>,\n Required> {\n codeChallenge: string;\n}\n\nexport const generateAuthUrl = ({ codeChallenge, identityUrl, tenant }: GenerateAuthUrlParams) => {\n // Quick hack for identityUrl until it's fixed on FP, sometimes it contains url {tenant}.online.ori which is wrong.\n const fixedIdentityUrl = identityUrl.includes('online.ori') ? 'https://identity-we.oriflame.com' : identityUrl;\n\n const url = new URL(fixedIdentityUrl);\n url.pathname = '/connect/authorize';\n url.searchParams.append('scope', 'all');\n url.searchParams.append('prompt', 'none');\n url.searchParams.append('client_id', 'GenesysWebMessenger');\n url.searchParams.append('response_type', 'code');\n url.searchParams.append('code_challenge_method', `S256`);\n url.searchParams.append('acr_values', `tenant:${tenant}`);\n url.searchParams.append('code_challenge', codeChallenge);\n url.searchParams.append('redirect_uri', REDIRECT_URI);\n\n return url.toString();\n};\n","import { NOT_LOGGED_IN_USER_ID, useToken } from '@ori/auth';\nimport { useEffect } from 'react';\n\nimport {\n AUTH_CODE_STORAGE_PARAMETER_FOR_GENESYS,\n ISSUER_STORAGE_PARAMETER_FOR_GENESYS,\n MESSENGER_DELAY,\n REDIRECT_URI,\n} from '../constants';\nimport { useExternalAuth } from '../contexts';\nimport { useWebMessenger } from '../contexts/webMessengerContext';\nimport { waitAndExecute } from '../utils';\n\n/**\n * Due to iframe and its redirect I have to wait few seconds before I can register plugin.\n */\nexport const useCreateAuthenticatedSession = () => {\n const { customerId } = useToken();\n const { codeVerifier } = useExternalAuth();\n const { isScriptLoaded } = useWebMessenger();\n\n useEffect(() => {\n if (customerId !== NOT_LOGGED_IN_USER_ID && isScriptLoaded) {\n waitAndExecute(\n // istanbul ignore next -- Genesys API\n () =>\n // eslint-disable-next-line new-cap, @typescript-eslint/no-unsafe-return -- Genesys preset naming,\n window.Genesys?.('registerPlugin', 'AuthProvider', (AuthProvider) => {\n AuthProvider.registerCommand('getAuthCode', (e) => {\n e.resolve({\n authCode: localStorage.getItem(AUTH_CODE_STORAGE_PARAMETER_FOR_GENESYS),\n codeVerifier,\n iss: localStorage.getItem(ISSUER_STORAGE_PARAMETER_FOR_GENESYS),\n redirectUri: REDIRECT_URI,\n });\n localStorage.removeItem(AUTH_CODE_STORAGE_PARAMETER_FOR_GENESYS);\n });\n\n AuthProvider.registerCommand('reAuthenticate', (e) => {\n /*\n In case there is no valid auth-code or refresh token it should again open login form but in this case we are using hidden iframe.\n */\n e.resolve(undefined);\n });\n\n AuthProvider.ready();\n }),\n MESSENGER_DELAY,\n );\n }\n }, [codeVerifier, customerId, isScriptLoaded]);\n};\n","/* istanbul ignore file */\n//\n// DO NOT EDIT!\n// This file was autogenerated by Eddie.\n// Changes may cause incorrect behavior and will be lost when the file is regenerated.\n//\n// Run `npx eddie update workspace` to regenerate.\n//\n\nexport const APP_NAME = 'web-messenger';\nexport const PACKAGE_NAME = '@ori/web-messenger';\nexport const TEAM_NAME = 'Presentation';\n\nexport const EMOTION_CACHE_KEY = `${APP_NAME}-emotion-cache-key`;\n\nexport const APP_ROOT_ELEMENT_ID = `${APP_NAME}-root`;\n","import { gql } from '@ori/fetching';\n\nexport const customerQuery = gql`\n query GetCustomer {\n customer {\n firstName\n lastName\n emails {\n emailAddress\n }\n consultantNumber\n customerId\n phones {\n telephoneNumber\n }\n customerType {\n description\n }\n }\n }\n`;\n","interface SkipUseGraphqlQueryParams {\n isAuthenticated: boolean;\n isScriptLoaded: boolean;\n}\n\nexport const shouldSkipGraphqlQuery = ({ isAuthenticated, isScriptLoaded }: SkipUseGraphqlQueryParams) =>\n !isAuthenticated || !isScriptLoaded;\n","/* eslint-disable @typescript-eslint/naming-convention -- Genesys preset naming */\nimport type { EnvironmentContext } from '@ori/environment';\nimport type { TranslationsContext } from '@ori/i18n';\n\nimport type { GetCustomerQuery } from '../models';\n\nexport interface GetCustomerDataParams\n extends Required>,\n Required> {\n data: GetCustomerQuery | undefined;\n}\n\nexport interface CustomerData {\n 'context.customField1Label': string;\n 'context.customField1': string;\n 'context.customField2Label': string;\n 'context.customField2': number | string;\n 'context.customField3Label': string;\n 'context.customField3': string;\n 'context.customField4Label': string;\n 'context.customField4': string;\n 'context.customerId': string;\n 'context.email': string;\n 'context.firstName': string;\n 'context.lastName': string;\n 'context.phoneNumber': string;\n 'context.source': string;\n}\n\nexport const getCustomerData = ({ data, language, tenant }: GetCustomerDataParams): CustomerData => {\n const {\n customerId: customerCustomerId,\n consultantNumber,\n customerType,\n emails,\n firstName,\n lastName,\n phones,\n } = data?.customer ?? {};\n\n const response = {\n 'context.customField1Label': 'Customer Title',\n 'context.customField1': customerType?.description ?? 'Anonymous',\n 'context.customField2Label': 'Consultant Number',\n 'context.customField2': consultantNumber ?? '',\n 'context.customField3Label': 'Language Code',\n 'context.customField3': language.slice(0, 2).toUpperCase(),\n 'context.customField4Label': 'Market Code',\n 'context.customField4': tenant.toUpperCase(),\n 'context.customerId': customerCustomerId ?? '',\n 'context.email': emails?.[0]?.emailAddress ?? '',\n 'context.firstName': firstName ?? '',\n 'context.lastName': lastName ?? '',\n 'context.phoneNumber': phones?.[0]?.telephoneNumber ?? '',\n 'context.source': 'web',\n };\n\n // eslint-disable-next-line no-console -- debug info required to investigate issues\n console.log(response);\n\n return response;\n};\n","import { isAuthenticatedCustomer, useToken } from '@ori/auth';\nimport { useServiceUrls } from '@ori/configuration-manager';\nimport { useEnvironment } from '@ori/environment';\nimport { getHeaders, useGraphqlQuery } from '@ori/fetching';\nimport { useTranslationsWithNamespaces } from '@ori/i18n';\nimport { useLogger } from '@ori/logger';\nimport { useEffect, useState } from 'react';\n\nimport { PACKAGE_NAME } from '../constants-generated';\nimport { useWebMessenger } from '../contexts/webMessengerContext';\nimport type { GetCustomerQuery, GetCustomerQueryVariables } from '../models';\nimport { customerQuery } from '../queries-net';\nimport { sendCustomerData, shouldSkipGraphqlQuery } from '../utils';\n\nexport const useSendCustomerAttributes = () => {\n const { tenant } = useEnvironment();\n const { language } = useTranslationsWithNamespaces();\n const { graphQlNetUrl } = useServiceUrls(['graphQlNet']);\n const { customerId, token } = useToken();\n const { isScriptLoaded } = useWebMessenger();\n const localLogger = useLogger('useSendCustomerAttributes');\n const isAuthenticated = isAuthenticatedCustomer(customerId);\n const [attributesSent, setAttributesSent] = useState(false);\n const { data, error } = useGraphqlQuery({\n query: customerQuery,\n url: graphQlNetUrl,\n headers: getHeaders({\n customerId,\n language,\n sourceAppName: PACKAGE_NAME,\n tenant,\n token,\n }),\n skip: shouldSkipGraphqlQuery({ isAuthenticated, isScriptLoaded }),\n swrConfig: {\n revalidateIfStale: false,\n revalidateOnFocus: false,\n revalidateOnReconnect: false,\n },\n });\n\n if (error) {\n localLogger.error(new Error('useGraphqlQuery customerQuery', { cause: error }));\n }\n\n useEffect(() => {\n if (isScriptLoaded && (data != null || error != null || !isAuthenticated)) {\n sendCustomerData({ language, data, tenant });\n setAttributesSent(true);\n }\n }, [isScriptLoaded, data, error, isAuthenticated, language, tenant]);\n\n return {\n attributesSent,\n };\n};\n","// istanbul ignore file -- Calling Genesys API\nimport type { GetCustomerDataParams } from './getCustomerData';\nimport { getCustomerData } from './getCustomerData';\n\nexport const sendCustomerData = (customerDataParams: GetCustomerDataParams) => {\n // eslint-disable-next-line new-cap -- Genesys preset naming\n window.Genesys?.('command', 'Database.set', {\n messaging: {\n customAttributes: getCustomerData(customerDataParams),\n },\n });\n};\n","import { BubbleHelpFilled, Clear } from '@ori-ui/icons';\nimport { styled, CircularProgress } from '@ori-ui/mui';\nimport type { Theme } from '@ori-ui/mui';\n\ninterface GetIconStylesProps {\n theme: Theme;\n}\n\nconst getIconStyles = ({ theme }: GetIconStylesProps) => ({\n display: 'flex',\n height: '32px',\n padding: theme.spacing(0, 2.8, 0, 2),\n width: '32px',\n});\n\nexport const OpenIcon = styled(BubbleHelpFilled)(getIconStyles);\n\nexport const CloseIcon = styled(Clear)(getIconStyles);\n\nexport const Progress = styled(CircularProgress)(({ theme }) => ({\n margin: theme.spacing(3),\n}));\n","import type { FC } from 'react';\n\nimport { CloseIcon, OpenIcon, Progress } from './styles';\nimport type { IconProps } from './types';\n\nexport const Icon: FC = ({ isChatOpened, loading }) => {\n if (loading) {\n return ;\n }\n\n return isChatOpened ? : ;\n};\n","import { SHADOW_LEVEL1, styled } from '@ori-ui/mui';\n\ninterface ButtonComponentProps {\n isChatOpened?: boolean;\n}\n\nexport const ButtonComponent = styled('div')(({ isChatOpened, theme }) => {\n const buttonExpanded = {\n maxWidth: '100%',\n transitionDelay: '0s',\n div: {\n opacity: 1,\n transitionDelay: '0.2s',\n },\n };\n\n return {\n alignItems: 'center',\n background: theme.palette.default.main,\n borderRadius: '30px',\n bottom: '15px',\n boxShadow: SHADOW_LEVEL1,\n boxSizing: 'unset',\n color: theme.palette.common.white,\n cursor: 'pointer',\n direction: 'rtl',\n display: 'flex',\n flexDirection: 'row',\n height: '60px',\n maxWidth: '60px',\n overflow: 'hidden',\n position: 'fixed',\n right: '15px',\n textAlign: 'center',\n textOverflow: 'ellipsis',\n textTransform: 'uppercase',\n transition: 'max-width 0.5s ease-in-out 0.2s',\n userSelect: 'none',\n verticalAlign: 'middle',\n whiteSpace: 'nowrap',\n width: 'auto',\n zIndex: 100,\n\n [theme.breakpoints.up('md')]: {\n bottom: '30px',\n right: '30px',\n },\n '&:focus, &:hover': buttonExpanded,\n ...(isChatOpened ? buttonExpanded : undefined),\n };\n});\n\nexport const Label = styled('div')(({ theme }) => ({\n display: 'block',\n fontSize: '1.4rem',\n fontWeight: theme.typography.fontWeightBold,\n opacity: 0,\n paddingLeft: theme.spacing(4),\n transition: 'opacity 0.3s ease-in-out',\n}));\n","import type { FC } from 'react';\n\nimport { useWebMessenger } from '../../contexts/webMessengerContext';\nimport {\n useIsButtonVisible,\n useOpenChatQueryParamOnMount,\n useSetWindowOriGenesysPlugin,\n useTranslations,\n} from '../../hooks';\nimport { useCreateAuthenticatedSession } from '../../hooks/useCreateAuthenticatedSession';\nimport { useSendCustomerAttributes } from '../../hooks/useSendCustomerAttributes';\nimport { Icon } from '../Icon';\nimport { WEB_MESSENGER_BUTTON } from './constants';\nimport { ButtonComponent, Label } from './styles';\n\nexport const Button: FC = () => {\n const { translations } = useTranslations();\n\n const { loading, isChatOpened, openChatWindow } = useWebMessenger();\n\n useSendCustomerAttributes();\n useCreateAuthenticatedSession();\n useOpenChatQueryParamOnMount();\n const { isButtonVisible } = useIsButtonVisible();\n useSetWindowOriGenesysPlugin();\n\n if (!isButtonVisible) {\n return null;\n }\n\n return (\n \n \n \n \n );\n};\n","/* istanbul ignore file */\n\n/**\n * DO NOT EDIT!\n * This file was autogenerated by npm script `localizations-codegen`.\n * Changes may cause incorrect behavior and will be lost when the file is regenerated.\n *\n * Run `npx localizations-codegen` to regenerate.\n */\nimport { useTranslationsFromNamespace, type UseTranslationsFromNamespaceResult } from '@ori/i18n';\n\nimport type { DefaultTranslations } from '../constants/defaultTranslations';\n\n/**\n * A hook for accessing translations within a specific namespace along with a formatting function.\n *\n * @returns The translations within the specified namespace and a formatting function.\n */\nexport const useTranslations: () => UseTranslationsFromNamespaceResult = () =>\n useTranslationsFromNamespace();\n","import { getClientQueryParam } from '@ori/presentation-utils';\nimport { useEffect, useRef } from 'react';\n\nimport { useWebMessenger } from '../contexts/webMessengerContext';\n\nconst DELAY = 500;\n\n/** Runs openChatWindow with a delay when `openChat` query param is `true` and script is loaded. */\nexport const useOpenChatQueryParamOnMount = () => {\n const { openChatWindow } = useWebMessenger();\n const actionExecuted = useRef(false);\n\n useEffect(() => {\n const openChatAsString = getClientQueryParam('openChat');\n const openChat = openChatAsString === 'true';\n\n if (!actionExecuted.current && openChat) {\n const timeoutId = setTimeout(() => {\n openChatWindow();\n actionExecuted.current = true;\n }, DELAY);\n\n return () => clearTimeout(timeoutId);\n }\n\n return () => {};\n }, [openChatWindow]);\n};\n","export const WEB_MESSENGER_BUTTON = 'web-messenger-button';\n","import type { FC } from 'react';\n\nimport { useWebMessenger } from '../../contexts/webMessengerContext';\nimport { Button } from '../Button';\n\nexport const WebMessenger: FC = () => {\n const { deploymentId } = useWebMessenger();\n\n return deploymentId ?