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qB,EAAAA,W,8lBCTnC,IAAMC,IAAWC,EAAAA,EAAAA,IAAejD,GAAAA,IAC1BkD,IAAUC,EAAAA,EAAAA,IAAcnD,GAAAA,IAGxBoD,GAAuD,CAC3D,kBACA,aACA,cACA,eACA,UAwBWC,GAAmB,SAACC,GAC/B,IAAMC,GAAeC,EAAAA,GAAAA,GAA4CF,EAAQF,IACzEJ,GAAS,uBAAwBO,GACjC,IAAME,EAnB2B,SAA+CF,GAOhF,OAN8BzO,GAAAA,GAAA,GACzByO,GAAY,IACfG,aAAaC,EAAAA,GAAAA,GAAoBJ,EAAaG,aAAa,GAAO,GAClEtD,cAAcuD,EAAAA,GAAAA,GAAoBJ,EAAanD,cAAc,GAAO,IAIxE,CAWiBwD,CAAoBL,GAGnC,OAFAL,GAAQ,2BAA4BO,GAE7BA,CACT,E,0kBCpCiBR,EAAAA,EAAAA,IAAejD,GAAAA,IAKzB6D,eAAeC,GAAOC,GAC3B,IAAAC,EAAwBD,EAAYE,QAA5BX,OACFY,EAAYb,QADJ,IAAAW,EAAG,GAAEA,GAEXG,EAAoCD,EAApCC,WAAYT,EAAwBQ,EAAxBR,YAAwBQ,EAAX7D,OAEjC,IAAKqD,EACH,MAAM,IAAIU,MAAM,0BAalBC,EAAAA,EAAAA,GAAWN,GAAaD,QACtB9H,EAAAA,EAAAA,KAAC0F,GAAa,CAAA3F,UACZC,EAAAA,EAAAA,KAACsI,EAAAA,EAAuB,CAACH,WAAYA,EAAWpI,UAC9CC,EAAAA,EAAAA,KAACuI,EAAAA,EAAa,CACZC,qBAAmB,EACnBC,SAAUC,GAAAA,GAAkB3I,UAE5BC,EAAAA,EAAAA,KAACiE,GAAGnL,GAAA,GAAKoP,UAKnB,C","sources":["webpack://oribasketbubble/../../../src/constants/index.ts","webpack://oribasketbubble/../../../../src/components/BubbleGroup/styles.ts","webpack://oribasketbubble/../../../src/constants/defaultTranslations.ts","webpack://oribasketbubble/../../../src/utils/isMinibagVisibile.ts","webpack://oribasketbubble/../../../../src/components/Bubble/styles.ts","webpack://oribasketbubble/../../../src/types/TestId.ts","webpack://oribasketbubble/../../../../src/components/Bubble/Bubble.tsx","webpack://oribasketbubble/../../../src/hooks/useTranslations.ts","webpack://oribasketbubble/../../../../src/components/BubbleGroup/BubbleGroup.tsx","webpack://oribasketbubble/./src/utils/getTranslationsProps.ts","webpack://oribasketbubble/./src/App.tsx","webpack://oribasketbubble/../../../src/utils/isECatalogue.ts","webpack://oribasketbubble/./src/containers/ErrorBoundary.ts","webpack://oribasketbubble/./src/utils/getConfiguration.ts","webpack://oribasketbubble/./src/appRender.tsx"],"sourcesContent":["export * from './defaultTranslations';\n\nexport const APP_NAME = 'basket-bubble';\n\nexport const EMOTION_CACHE_KEY = `${APP_NAME}-emotion-cache-key`;\n\nexport const IDENTITY_CLIENT_ID = 'SPADev';\n\n// Bubble settings\nexport const bubbleDuration = 2000;\nexport const bubbleHeight = 94;\n","import { styled } from '@ori-ui/mui';\n\nimport { bubbleHeight } from '../../constants';\n\nconst topNavHeightStyle = 'var(--top-nav-height, 0)';\nconst toolbarPositionStyle = 'var(--ecatalogue-toolbar-position, 0)';\n\nexport const BasketBubbleWrapper = styled('div')<{\n ownerState: { isECatalogue: boolean };\n}>(({ theme, ownerState }) => ({\n boxSizing: 'border-box',\n width: theme.spacing(64),\n marginTop: 10,\n pointerEvents: 'none',\n position: 'fixed',\n top: 0,\n right: 15,\n transform: `translate(0, ${topNavHeightStyle})`,\n transition: `transform var(--top-nav-height-animation), 0.3s ease-in-out`,\n ...(ownerState.isECatalogue && {\n transform: `translate(0, ${toolbarPositionStyle})`,\n transition: `transform var(--ecatalogue-toolbar-position-animation), 0.3s ease-in-out`,\n }),\n zIndex: 10000,\n\n [theme.breakpoints.up('sm')]: {\n right: 30,\n },\n\n '& *': {\n boxSizing: 'border-box',\n },\n}));\n\nexport const AnimationWrapper = styled('div')<{\n ownerState: { state: string };\n}>(({ ownerState }) => ({\n transition: 'opacity 750ms',\n opacity: 0,\n\n ...(ownerState.state === 'entered' && {\n opacity: 1,\n }),\n\n ...(ownerState.state === 'exiting' && {\n opacity: 0,\n transition: 'margin-top 300ms 950ms, opacity 1250ms',\n marginTop: -(bubbleHeight + 10),\n }),\n}));\n","/* istanbul ignore file */\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 */\n\nimport type { TranslationKey } from '../models/TranslationKey';\n\nexport type DefaultTranslations = Record;\n\nexport const defaultTranslations: DefaultTranslations = {\n quantity: 'Quantity',\n};\n\nexport const translationsNamespace = 'basket-bubble';\n","// This might be outdated after recent changes - TODO\nexport const isMinibagVisible = () => {\n const element = document.querySelector('[data-testid=Checkout-shopping-mini-bag-fading-wrapper]');\n if (!element) {\n return false;\n }\n\n return window.getComputedStyle(element).visibility === 'visible';\n};\n","import { Products } from '@ori-ui/icons';\nimport { SHADOW_LEVEL3, styled } from '@ori-ui/mui';\n\nimport { bubbleHeight } from '../../constants';\n\nexport const BubbleWrapper = styled('div')(({ theme }) => ({\n background: theme.palette.common.white,\n border: `2px solid ${theme.palette.grey[100]}`,\n borderRadius: theme.spacing(2),\n boxShadow: SHADOW_LEVEL3,\n display: 'flex',\n height: bubbleHeight,\n marginBottom: theme.spacing(2),\n padding: theme.spacing(1),\n pointerEvents: 'auto',\n position: 'relative',\n width: theme.spacing(64),\n userSelect: 'none',\n}));\n\nexport const ImageWrapper = styled('div')(({ theme }) => ({\n background: theme.palette.grey[100],\n borderRadius: theme.spacing(1, 0, 0, 1),\n flex: theme.spacing(0, 0, 16),\n height: theme.spacing(16),\n marginRight: theme.spacing(2),\n overflow: 'hidden',\n position: 'relative',\n width: theme.spacing(16),\n}));\n\nexport const Image = styled('img')({\n height: '100%',\n maxHeight: '100%',\n maxWidth: '100%',\n objectFit: 'contain',\n width: '100%',\n});\n\nexport const ImagePlaceholder = styled(Products)(({ theme }) => ({\n color: theme.palette.grey[200],\n left: '50%',\n height: 'auto',\n position: 'absolute',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n width: '50%',\n}));\n\nexport const Details = styled('div')({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n width: 216,\n});\n\nexport const Name = styled('div')(({ theme }) => ({\n color: theme.palette.text.primary,\n fontSize: theme.typography.pxToRem(14),\n fontWeight: 700,\n overflow: 'hidden',\n paddingTop: theme.spacing(2),\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n width: '100%',\n}));\n\nexport const Shade = styled('div')(({ theme }) => ({\n color: theme.palette.grey.A400,\n fontSize: theme.typography.pxToRem(12),\n}));\n\nexport const Shopping = styled('div')({\n alignItems: 'center',\n display: 'flex',\n marginTop: 'auto',\n});\n\nexport const Quantity = styled('div')(({ theme }) => ({\n color: theme.palette.text.secondary,\n flexGrow: 1,\n fontSize: theme.typography.pxToRem(12),\n}));\n\nexport const Price = styled('div')(({ theme }) => ({\n color: theme.palette.text.primary,\n fontSize: theme.typography.pxToRem(14),\n fontWeight: 700,\n marginLeft: 'auto',\n}));\n\nexport const Points = styled('div')(({ theme }) => ({\n background: theme.palette.offer.dark,\n borderRadius: '50%',\n bottom: theme.spacing(2),\n color: theme.palette.common.white,\n fontSize: theme.typography.pxToRem(14),\n fontWeight: 'bold',\n height: theme.spacing(7),\n lineHeight: theme.spacing(7),\n position: 'absolute',\n right: theme.spacing(2),\n textAlign: 'center',\n width: theme.spacing(7),\n}));\n","export enum TestId {\n // One particular add-to-basket notification bubble popup (multiple can be displayed at a time)\n Popup = 'popup',\n}\n","import useTestId from '@ori/testid-generator';\nimport { LastAddedItemMethod } from '@ori-events/basket-updated';\nimport type { MouseEvent, FC } from 'react';\n\nimport {\n BubbleWrapper,\n Details,\n Image,\n ImagePlaceholder,\n ImageWrapper,\n Name,\n Points,\n Price,\n Quantity,\n Shade,\n Shopping,\n} from './styles';\nimport { type BubbleProps } from './types';\nimport { useTranslations } from '../../hooks/useTranslations';\nimport { TestId } from '../../types';\n\nfunction ignoreClickEvent(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n}\n\nexport const Bubble: FC = ({ code, image, methodType, name, points, price, quantity }) => {\n const { getTestId } = useTestId();\n const { formatMessage } = useTranslations();\n const { BUY_FOR_MONEY, BUY_FOR_POINTS } = LastAddedItemMethod;\n\n return (\n \n \n {image ? (\n \n ) : (\n \n )}\n \n
\n {name}\n {code}\n \n \n {formatMessage('quantity')}: {quantity}\n \n {methodType === BUY_FOR_MONEY && {price}}\n {methodType === BUY_FOR_POINTS && {points}}\n \n
\n \n );\n};\n","/* istanbul ignore file */\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 { TranslationsNamespaceProvider } from '@ori/i18n';\nimport type { LastAddedItemMethod } from '@ori-events/basket-updated';\nimport * as BasketUpdatedEvent from '@ori-events/basket-updated';\nimport * as ToggleMenuFlyoutEvent from '@ori-events/toggle-menu-flyout';\nimport { type FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { Transition, TransitionGroup } from 'react-transition-group';\nimport { v4 } from 'uuid';\n\nimport { AnimationWrapper, BasketBubbleWrapper } from './styles';\nimport type { BubbleGroupProps } from './types';\nimport { bubbleDuration, translationsNamespace } from '../../constants';\nimport { isMinibagVisible } from '../../utils';\nimport { Bubble, type BubbleInstanceProps } from '../Bubble';\n\nexport const BubbleGroup: FC = ({ isECatalogue }) => {\n const [bubbles, setBubbles] = useState([]);\n\n const removeBasketBubble = (bubbleId: string) => {\n setBubbles((currentBubbles) => currentBubbles.filter((currentBubble) => currentBubble.id !== bubbleId));\n };\n\n const onToggleMenuFlyout = ((event: ToggleMenuFlyoutEvent.Event) => {\n const { menuType } = event.detail;\n if (menuType === ToggleMenuFlyoutEvent.MenuTypes.Minibag && isMinibagVisible()) {\n // hide all bubbles when minibag is being opened\n setBubbles([]);\n }\n }) as EventListener;\n\n const onBasketUpdate = ((event: BasketUpdatedEvent.Event) => {\n // don't show bubble if not add-to-basket update or if minibag is visible\n if (!event.detail.lastAddedItem || isMinibagVisible()) {\n return;\n }\n\n const { itemCode, method } = event.detail.lastAddedItem;\n const { shoppingBagItems, offers } = event.detail.shoppingBag;\n const offersItems = offers.reduce(\n (acc: BasketUpdatedEvent.ShoppingBagItem[], offer: BasketUpdatedEvent.ShoppingBagOffer) => [\n ...acc,\n ...offer.items,\n ],\n [],\n );\n\n // proper typing for method -- TODO\n const methodType = method as unknown as LastAddedItemMethod;\n\n const item =\n methodType === BasketUpdatedEvent.LastAddedItemMethod.BUY_FOR_MONEY\n ? shoppingBagItems.find((product) => product.itemCode === itemCode)\n : offersItems.find((product) => product.itemCode === itemCode);\n\n if (!item) {\n return;\n }\n\n const bubble: BubbleInstanceProps = {\n id: v4(),\n code: item.itemCode,\n name: item.itemDescription,\n price: item.totalPrice,\n quantity: item.requestedQuantity,\n image: item.itemImageSrc,\n points: item.totalRedeemedPoints,\n methodType,\n };\n setBubbles((currentBubbles) => [...currentBubbles, bubble]);\n setTimeout(() => removeBasketBubble(bubble.id), bubbleDuration);\n }) as EventListener;\n\n useEffect(() => {\n window.addEventListener(BasketUpdatedEvent.Name, onBasketUpdate);\n window.addEventListener(ToggleMenuFlyoutEvent.Name, onToggleMenuFlyout);\n\n return () => {\n window.removeEventListener(BasketUpdatedEvent.Name, onBasketUpdate);\n window.removeEventListener(ToggleMenuFlyoutEvent.Name, onToggleMenuFlyout);\n };\n });\n\n const ownerState = { isECatalogue };\n const timeoutSettings = {\n appear: 0,\n enter: 0,\n exit: 1250,\n };\n\n return (\n \n \n \n {bubbles.map(({ id, ...bubble }) => (\n \n {(state) => {\n const bubbleOwnerState = { state };\n\n return (\n \n \n \n );\n }}\n \n ))}\n \n \n \n );\n};\n","import { defaultTranslations, translationsNamespace } from '@ori/basket-bubble-lib';\nimport { getErrorLogger } from '@ori/checkout-utils';\nimport { type TranslationsContext } from '@ori/i18n';\n\nimport { APP_NAME } from '../constants';\n\ninterface GetTranslationsOptions {\n currentLanguage: string;\n staticApiUrl: string;\n tenant: string;\n token: string;\n}\n\nconst logError = getErrorLogger(APP_NAME);\n\nexport const getTranslationsProps = ({ currentLanguage, staticApiUrl, tenant, token }: GetTranslationsOptions) => {\n const result: TranslationsContext = {\n clientFetchConfiguration: {\n baseUrl: staticApiUrl,\n onError: (error) => {\n logError('Error occured while loading translations.', String(error));\n },\n tenant,\n token,\n },\n currentLanguage,\n defaultTranslationsWithNamespaces: {\n [translationsNamespace]: defaultTranslations,\n },\n };\n\n return result;\n};\n","import { isTokenValid, useToken } from '@ori/auth';\nimport { BubbleGroup, isECatalogue } from '@ori/basket-bubble-lib';\nimport { TranslationsProvider } from '@ori/i18n';\nimport { Team, TestIdProvider } from '@ori/testid-generator';\nimport { type parseSpaConfig } from '@ori-appshell/config';\nimport { type FC } from 'react';\n\nimport { APP_NAME } from './constants';\nimport type { AppConfiguration } from './types';\nimport { getTranslationsProps } from './utils';\n\nexport type AppProps = ReturnType;\n\nexport const App: FC = (configuration) => {\n const { currentLanguage, staticApiUrl, tenant } = configuration;\n const { token } = useToken();\n const translationProps = getTranslationsProps({ currentLanguage, staticApiUrl, tenant, token });\n const isCatalogue = isECatalogue();\n\n if (!isTokenValid(token)) {\n return null;\n }\n\n return (\n \n \n \n \n \n );\n};\n","export const E_CATALOGUE_ROOT_ELEMENT_ID = 'catalogue-ipaper-root';\n\n// This might be outdated after recent changes - TODO\nexport const isECatalogue = () => Boolean(document.getElementById(E_CATALOGUE_ROOT_ELEMENT_ID));\n","import { getErrorLogger } from '@ori/checkout-utils';\nimport { Component, type ReactNode } from 'react';\n\nimport { APP_NAME } from '../constants';\n\ninterface ErrorBoundaryProps {\n children: JSX.Element;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nconst logError = getErrorLogger(APP_NAME);\n\nexport class ErrorBoundary extends Component {\n override readonly state: ErrorBoundaryState = {};\n\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { error };\n }\n\n override render(): ReactNode {\n const { error }: ErrorBoundaryState = this.state;\n\n if (error) {\n logError(error);\n\n return null;\n }\n\n const { children }: ErrorBoundaryProps = this.props;\n\n return children;\n }\n}\n","import { getDebugLogger, getInfoLogger, normalizeSlashChars } from '@ori/checkout-utils';\nimport { parseSpaConfig } from '@ori-appshell/config';\n\nimport { APP_NAME } from '../constants';\nimport type { AppConfiguration, ParsedConfigData, RequiredConfigProps, ToIndexed } from '../types';\n\nconst logDebug = getDebugLogger(APP_NAME);\nconst logInfo = getInfoLogger(APP_NAME);\n\n// Required props for parseSpaConfig method.\nconst requiredProps: RequiredConfigProps = [\n 'currentLanguage',\n 'customerId',\n 'identityUrl',\n 'staticApiUrl',\n 'tenant',\n];\n\n/**\n * Normalizes some values in the raw parsed config.\n * @param parsedConfig Original config data returned by the parseSpaConfig method.\n * @returns Final normalized configuration.\n */\nexport const normalizeConfigData = >(parsedConfig: T) => {\n const result: AppConfiguration = {\n ...parsedConfig,\n identityUrl: normalizeSlashChars(parsedConfig.identityUrl, false, false),\n staticApiUrl: normalizeSlashChars(parsedConfig.staticApiUrl, false, false),\n };\n\n return result;\n};\n\n/**\n * Parses the configuration.\n * @param config Config data serialized in a string in JSON format.\n * Usually taken from data-config HTML attribute of the component's root element.\n * @returns Normalized component configuration.\n */\nexport const getConfiguration = (config: string) => {\n const parsedConfig = parseSpaConfig>(config, requiredProps);\n logDebug('parsed configuration', parsedConfig);\n const result = normalizeConfigData(parsedConfig);\n logInfo('normalized configuration', result);\n\n return result;\n};\n","import { StandaloneTokenProvider, doDevelopmentLogin } from '@ori/auth';\nimport { getDebugLogger } from '@ori/checkout-utils';\nimport { ThemeProvider } from '@ori-ui/mui';\nimport { createRoot } from 'react-dom/client';\n\nimport { App } from './App';\nimport { APP_NAME, EMOTION_CACHE_KEY } from './constants';\nimport { ErrorBoundary } from './containers/ErrorBoundary';\nimport { getConfiguration } from './utils';\n\nconst logDebug = getDebugLogger(APP_NAME);\n\n/**\n * React app renderer that is used when app is used as a standalone app\n */\nexport async function render(rootElement: HTMLElement) {\n const { config = '' } = rootElement.dataset;\n const appConfig = getConfiguration(config);\n const { customerId, identityUrl, tenant } = appConfig;\n\n if (!identityUrl) {\n throw new Error('Missing Identity URL!');\n }\n\n // Get token for local development\n if (process.env.NODE_ENV !== 'production') {\n // when using Requestly we do not want to load token\n if (process.env.REACT_APP_USE_REQUESTLY === '1') {\n logDebug('USING REQUESTLY');\n } else {\n await doDevelopmentLogin({ identityUrl, tenant });\n }\n }\n\n createRoot(rootElement).render(\n \n \n \n \n \n \n ,\n );\n}\n"],"names":["concat","BasketBubbleWrapper","styled","_ref","theme","ownerState","_objectSpread","boxSizing","width","spacing","marginTop","pointerEvents","position","top","right","transform","transition","isECatalogue","_defineProperty","zIndex","breakpoints","up","AnimationWrapper","_ref2","opacity","state","defaultTranslations","quantity","translationsNamespace","isMinibagVisible","element","document","querySelector","window","getComputedStyle","visibility","BubbleWrapper","background","palette","common","white","border","grey","borderRadius","boxShadow","SHADOW_LEVEL3","display","height","marginBottom","padding","userSelect","ImageWrapper","flex","marginRight","overflow","Image","maxHeight","maxWidth","objectFit","ImagePlaceholder","Products","_ref3","color","left","Details","flexDirection","justifyContent","Name","_ref4","text","primary","fontSize","typography","pxToRem","fontWeight","paddingTop","textOverflow","whiteSpace","Shade","_ref5","A400","Shopping","alignItems","Quantity","_ref6","secondary","flexGrow","Price","_ref7","marginLeft","Points","_ref8","offer","dark","bottom","lineHeight","textAlign","TestId","ignoreClickEvent","event","preventDefault","stopPropagation","Bubble","code","image","methodType","name","points","price","getTestId","useTestId","formatMessage","useTranslationsFromNamespace","BUY_FOR_MONEY","LastAddedItemMethod","BUY_FOR_POINTS","_jsxs","Popup","onClick","children","_jsx","src","alt","BubbleGroup","_useState","useState","_useState2","_slicedToArray","bubbles","setBubbles","onToggleMenuFlyout","detail","menuType","ToggleMenuFlyoutEvent","Minibag","onBasketUpdate","lastAddedItem","_event$detail$lastAdd","itemCode","method","_event$detail$shoppin","shoppingBag","shoppingBagItems","offersItems","offers","reduce","acc","_toConsumableArray","items","item","BasketUpdatedEvent","find","product","bubble","id","v4","itemDescription","totalPrice","requestedQuantity","itemImageSrc","totalRedeemedPoints","currentBubbles","setTimeout","bubbleId","filter","currentBubble","useEffect","addEventListener","removeEventListener","timeoutSettings","appear","enter","exit","TranslationsNamespaceProvider","namespace","TransitionGroup","map","_objectWithoutProperties","_excluded","Transition","timeout","bubbleOwnerState","logError","getErrorLogger","APP_NAME","App","configuration","currentLanguage","staticApiUrl","tenant","token","useToken","translationProps","clientFetchConfiguration","baseUrl","onError","error","String","defaultTranslationsWithNamespaces","getTranslationsProps","isCatalogue","Boolean","getElementById","isTokenValid","TestIdProvider","project","team","Team","Checkout","TranslationsProvider","ErrorBoundary","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","_assertThisInitialized","_createClass","key","value","this","props","Component","logDebug","getDebugLogger","logInfo","getInfoLogger","requiredProps","getConfiguration","config","parsedConfig","parseSpaConfig","result","identityUrl","normalizeSlashChars","normalizeConfigData","async","render","rootElement","_rootElement$dataset$","dataset","appConfig","customerId","Error","createRoot","StandaloneTokenProvider","ThemeProvider","enableCacheProvider","cacheKey","EMOTION_CACHE_KEY"],"sourceRoot":""}