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AAM8B,UAAUqE,iBAAuB,MA0EvG8W,CAAsBvc,KAAKV,OAC3BU,KAAKV,MAAMoG,2BACX1F,KAAKV,MAAMqG,sBACgB,QAA3BlD,EAAAzC,KAAKV,MAAMsD,KAAKD,KAAKE,cAAM,IAAAJ,GAA3BA,EAA6BmB,QAAU,KAAO5D,KAAKV,MAAMsG,eAC1DxG,IAAAA,cAACmC,EAAAA,KAAI,CAAC1B,UAAU,6BACgB,QAA3B6C,EAAA1C,KAAKV,MAAMsD,KAAKD,KAAKE,cAAM,IAAAH,GAA3BA,EAA6BkB,QAC1BxE,IAAAA,cAACwB,EAAAA,OAAM,CACHf,UAAU,mCACVgG,MAAMC,EAAAA,EAAAA,IAAW,OAAQ9F,KAAKV,MAAM0D,QAAQ+C,gBAE3C/F,KAAKV,MAAM8B,UAAU4E,6BAE1B,SAtIRC,IAACjC,EAAuD1E,GAoNhF,iBC/OAkd,EAAOC,QAAUrd,cCAjBod,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/themes/cirrus/views/cart-icon.view.tsx?bcea","webpack://Msdyn365.Commerce.Online/./lib/cart-icon/module-registration.js?4d28","webpack://Msdyn365.Commerce.Online/./src/validate-cart.ts?cd50","webpack://Msdyn365.Commerce.Online/./src/Common/get-product.ts?0a21","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/components/flyout-cart-line-items.tsx?f2c4","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/utils/get-products-in-mini-cart.ts?3c15","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.tsx?4ae8","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.view.tsx?f9dd","webpack://Msdyn365.Commerce.Online/../../src/search-org-unit-locations.ts?d18d","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/cart-icon.view.tsx?7ec9","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ICartViewProps } from '@msdyn365-commerce-modules/cart';\r\nimport { ICartIconViewProps } from '@msdyn365-commerce-modules/cart/src/modules/cart-icon/./cart-icon';\r\nimport { IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart/src/modules/cart-icon/./components/flyout-cart-line-items';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\n\r\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\r\n\r\n/**\r\n * ICartIconViewState: Interface for Cart Icon View State.\r\n */\r\ninterface ICartIconViewState {\r\n isModalOpen: boolean;\r\n}\r\n\r\n/**\r\n * Render Cart lines.\r\n * @param cartLines - Flyout cart line view props.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n return (\r\n \r\n \r\n {cartLine.cartline}\r\n \r\n {cartLine.remove}\r\n {cartLine.storeLocation}\r\n \r\n );\r\n });\r\n};\r\n\r\n/**\r\n * Initiate total price.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\r\n const totalPrice = price ? props.context.cultureFormatter.formatCurrency(price) : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n return (\r\n
\r\n \r\n {props.resources.totalPriceFormatString.replace('{price}','')}\r\n \r\n {totalPrice}\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\n/**\r\n *\r\n * CartIconView component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class CartIconView extends React.PureComponent, ICartIconViewState> {\r\n\r\n private isAutoDisplayTriggered: boolean;\r\n\r\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\r\n super(props);\r\n this.isAutoDisplayTriggered = false;\r\n this.state = {\r\n isModalOpen: false\r\n };\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.removeEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @returns JSX Element.\r\n */\r\n public render(): JSX.Element | null {\r\n const cart = this.props.data.cart.result ?? undefined;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart = cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n if (shouldShowMiniCart) {\r\n if (!this.isAutoDisplayTriggered) {\r\n // First time trigger auto mini cart.\r\n this.setState({ isModalOpen: true });\r\n this.isAutoDisplayTriggered = true;\r\n } else if (!this.state.isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n this.isAutoDisplayTriggered = false;\r\n }\r\n }\r\n return (\r\n \r\n \r\n {this.props.cartIcon}\r\n \r\n \r\n \r\n {this.props.flyoutTitle}\r\n {this._renderCartItemCount(this.props)}\r\n {this._renderCartCloseIcon()}\r\n \r\n \r\n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\r\n \r\n {renderCartlines(this.props.cartlines, this.props)}\r\n \r\n \r\n \r\n {this.props.slots.promoContentItem}\r\n {renderTotalPrice(this.props)}\r\n

\r\n {this.props.resources.subTotalMessage}\r\n

\r\n {this.props.checkoutAsSignInUserButton}\r\n {this.props.checkoutAsGuestButton}\r\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\r\n \r\n {\r\n this.props.data.cart.result?.isEmpty ? \r\n {this.props.resources.continueShoppingButtonTitle}\r\n : null\r\n }\r\n \r\n
\r\n \r\n \r\n );\r\n }\r\n\r\n /**\r\n * Initiate modal container.\r\n * @returns Inode props.\r\n */\r\n private readonly _modalContainer = (): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: this.state.isModalOpen,\r\n toggle: this.closeModal\r\n };\r\n };\r\n\r\n /**\r\n * Initiate open modal.\r\n */\r\n private readonly _openModal = (): void => {\r\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\r\n this.setState({\r\n isModalOpen: true\r\n });\r\n };\r\n\r\n /**\r\n * Initiate close modal.\r\n */\r\n private readonly closeModal = (): void => {\r\n this.setState({\r\n isModalOpen: false\r\n });\r\n\r\n };\r\n\r\n /**\r\n * Initiate cart close Icon.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\r\n return (\r\n \r\n );\r\n };\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartItemCount = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n let cartItemCount;\r\n const defaultCartItemCount: number = 0;\r\n const defaultCartItemCountOne: number = 1;\r\n\r\n if (ArrayExtensions.hasElements(props.cartlines)) {\r\n if (props.cartlines.length === defaultCartItemCountOne) {\r\n cartItemCount = `${defaultCartItemCountOne} ${props.resources.item}`;\r\n } else {\r\n cartItemCount = `${props.cartlines.length} ${props.resources.items}`;\r\n }\r\n } else {\r\n cartItemCount = `${defaultCartItemCount} ${props.resources.items}`;\r\n }\r\n return (\r\n \r\n {cartItemCount}\r\n \r\n );\r\n };\r\n\r\n /**\r\n * Handle escape click to close modal.\r\n * @param event - On press of any key.\r\n */\r\n private readonly _escFunction = (event: KeyboardEvent) => {\r\n if (event.keyCode === KeyCodes.Escape && this.state.isModalOpen) {\r\n this.closeModal();\r\n }\r\n };\r\n\r\n}\r\n\r\nexport default CartIconView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['cart-icon'] = {\n c: () => require('@msdyn365-commerce-modules/cart/dist/lib/modules/cart-icon/cart-icon'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action', runOn: 1},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerBalances', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'cart-icon',\n p: 'cart',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/cart/dist/lib/modules/cart-icon'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|themes|cirrus|views|cart-icon'] = {\n c: () => require('partner/themes/cirrus/views/cart-icon.view.tsx'),\n cn: '__local__-__local__-cart-icon'\n };\nviewDictionary['@msdyn365-commerce-modules|cart|modules|cart-icon|cart-icon'] = {\n c: () => require('@msdyn365-commerce-modules/cart/dist/lib/modules/cart-icon/cart-icon.view.js'),\n cn: '@msdyn365-commerce-modules-cart-cart-icon'\n };\nviewDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|cart-icon'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/cart-icon.view.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CartLine,\n CartLineValidationResults,\n CartLineValidationResultsByLineId,\n CartsDataActions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\n\nimport { ITelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Validate the cart.\n * @param isQuantityLimitsFeatureEnabled -- Is the quantity limits feature enabled.\n * @param cart -- The cart state to validate.\n * @param telemetry -- The telemetry.\n * @param propsContext -- The props context.\n * @param shouldRetry -- Should retry.\n * @returns A list of line data validation failures.\n */\nexport async function validateCartAsync(\n cart: AsyncResult,\n telemetry: ITelemetry,\n propsContext: ICoreContext,\n shouldRetry: boolean = true\n): Promise {\n let cartResult: ICartState;\n let cartVersion: number | undefined;\n try {\n cartResult = await cart;\n cartVersion = cartResult.cart.Version;\n } catch (error) {\n telemetry.warning(error);\n telemetry.debug('Unable to get cart or cart version.');\n return AsyncResult.resolve();\n }\n\n if (cartVersion) {\n try {\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\n { callerContext: propsContext.actionContext, bypassCache: 'none' },\n cartResult.cart.Id,\n cartVersion\n );\n\n return await AsyncResult.resolve(validationResult.ValidationResultsByLineId ?? undefined);\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- error type is not defined.\n if (shouldRetry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n try {\n await cartResult.refreshCart({});\n } catch (refreshError) {\n telemetry.warning(refreshError);\n telemetry.debug('Unable to refresh Cart');\n return AsyncResult.resolve();\n }\n try {\n await validateCartAsync(cart, telemetry, propsContext, false);\n return AsyncResult.resolve();\n } catch (validateError) {\n telemetry.warning(validateError);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n }\n\n telemetry.warning(error);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n } else {\n telemetry.warning('Cart version not found for Cart validation request.');\n return AsyncResult.resolve();\n }\n}\n\n/**\n * Check if cart line quantity update is success.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function isCartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number\n): Promise {\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find(\n (product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId\n );\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult.status === 'SUCCESS');\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve(false);\n}\n\n/**\n * Update cart line with cart action result.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function cartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number\n): Promise {\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find(\n (product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId\n );\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult);\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve();\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Find the product in array of products considering product id.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @returns - The found product.\n */\nexport function getProductByProductId(productId: number | undefined, products?: SimpleProduct[]): SimpleProduct | undefined {\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId;\n });\n }\n\n return undefined;\n}\n\n/**\n * Find the product in array of products considering product id and product behavior's warehouse.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @param warehouseId - Warehouse id of cartLine.\n * @param cartState - The cart start in case cart line has no warehouse.\n * @returns - The found product.\n */\nexport function getProductByProductIdAndWarehouse(\n productId: number | undefined,\n products?: SimpleProduct[],\n warehouseId?: string,\n cartState?: ICartState\n): SimpleProduct | undefined {\n const targetWarehouseValue = warehouseId ?? cartState?.cart.WarehouseId;\n\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId && product.Behavior?.InventoryLocationId === targetWarehouseValue;\n });\n }\n\n return undefined;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n OrgUnitLocation,\n ProductAvailableQuantity,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ProductCatalog, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\n\nexport interface IFlyoutCartLineItemsProps {\n cartlines: CartLine[];\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n catalogs?: ProductCatalog[];\n\n /**\n * GridSettings for the product image in cartline\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartline\n */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n removeButtonText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n maxCartlineQuantity: number;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isQuantityLimitsFeatureEnabled: boolean;\n\n outOfStockThreshold: number;\n isStockCheckEnabled: boolean;\n telemetryContent?: ITelemetryContent;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\nexport interface IFlyoutCartLineItemViewProps {\n cartline: React.ReactNode;\n remove: React.ReactNode;\n storeLocation: React.ReactNode;\n hasError: boolean;\n\n data: {\n product: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (\n isStockCheckEnabled: boolean,\n outOfStockThreshold: number,\n productAvailability?: ProductAvailableQuantity\n): number => {\n if (isStockCheckEnabled) {\n if (\n !productAvailability ||\n !productAvailability.AvailableQuantity ||\n productAvailability.AvailableQuantity <= 0 ||\n productAvailability.AvailableQuantity <= outOfStockThreshold\n ) {\n return 0;\n }\n return productAvailability.AvailableQuantity - outOfStockThreshold;\n }\n\n return 0;\n};\n\nconst _getCartItemMaxQuantity = (\n maxQuantityByConfig: number,\n isStockCheckEnabled: boolean,\n availableQuantityInStock: number,\n isQuantityLimitsFeatureEnabled: boolean,\n maxByQuantityLimitsFeature: number\n) => {\n if (isQuantityLimitsFeatureEnabled) {\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\n\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\n // and consider available qty if stock check enabled and max from config in site settings.\n if (!maxByQuantityLimitsFeature) {\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\n }\n\n return isStockCheckEnabled\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\n ? maxByQuantityLimitsFeatureResult\n : availableQuantityInStock\n : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\n};\n\n/**\n * On Remove Click functionality.\n * @param removeItemClickHandler -Remove item click function.\n * @param cartline -CartLine.\n * @returns Remove change value.\n */\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\n removeItemClickHandler(cartline);\n};\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct,\n props: IFlyoutCartLineItemsProps,\n index: number,\n foundProductAvailability?: ProductAvailableQuantity,\n foundProductDeliveryOptions?: ProductDeliveryOptions\n): IFlyoutCartLineItemViewProps => {\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\n\n const availableQuantityInStock = _getCartItemAvailableQuantity(\n props.isStockCheckEnabled,\n props.outOfStockThreshold,\n foundProductAvailability\n );\n const maxQuantity =\n product &&\n _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0\n );\n\n // Check if the product is service or not by product type\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n\n return {\n data: {\n product,\n cartline\n },\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\n cartline: (\n \n ),\n remove: (\n \n {removeButtonText}\n \n ),\n storeLocation: _renderStoreLocation(cartline, props)\n };\n};\n\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\n let deliverylocation;\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\n });\n }\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\n const location = delivery?.Description;\n\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n if (location) {\n deliverylocation = `${location}, ${orgUnitName}`;\n } else {\n deliverylocation = `${orgUnitName}`;\n }\n } else {\n deliverylocation = props.resources.shippingText;\n }\n return deliverylocation;\n};\n\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n if (orgUnitName) {\n return (\n
\n {orgUnitName}\n
\n );\n }\n }\n\n return null;\n};\n\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if (foundLocation) {\n return foundLocation.OrgUnitName;\n }\n return fulfillmentStoreId;\n};\n\nconst _assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: IFlyoutCartLineItemsProps\n): IFlyoutCartLineItemViewProps[] | null => {\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\n\n if (!products || products.length === 0) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n cartlines.map((cartline, index) => {\n let product;\n if (props.isQuantityLimitsFeatureEnabled) {\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\n // to check productId and WarehouseId for identification.\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\n } else {\n product = getProductByProductId(cartline.ProductId, products);\n }\n let foundProductAvailability;\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n }\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n if (product) {\n reactNodes.push(\n _assembleNode(\n cartline,\n product,\n props,\n index,\n foundProductAvailability?.ProductAvailableQuantity,\n foundProductDeliveryOption\n )\n );\n }\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n */\n\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\n const { products, cartlines } = props;\n return _assembleCartlines(cartlines, products, props);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ActiveCartProductsInput,\n getActiveCartProductsAction,\n getAvailabilitiesForCartLineItems,\n getDeliveryOptionsForCartLineItems,\n IProductInventoryInformation,\n ProductAvailabilitiesForCartLineItems,\n ProductDeliveryOptionsForCartLineItems\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IMiniCartData entity interface.\n */\nexport interface IMiniCartData {\n products?: SimpleProduct[];\n productAvailabilites?: IProductInventoryInformation[];\n deliveryOptions?: ProductDeliveryOptions[];\n}\n\nexport const createInput = () => {\n return new ActiveCartProductsInput();\n};\n\n/**\n * Calls the Retail API and returns a mini cart data.\n * @param ctx\n * @param cartState\n */\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\n const miniCartData: IMiniCartData = {};\n\n const cart = cartState.cart;\n\n // If there are cart lines, make call to get products\n // If there are invocie linese, then there is no products, so don't make call to get products\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\n await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)\n .then(products => {\n if (products) {\n miniCartData.products = products;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(availableQuantity => {\n if (availableQuantity) {\n miniCartData.productAvailabilites = availableQuantity;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(deliveryOptions => {\n if (deliveryOptions) {\n miniCartData.deliveryOptions = deliveryOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n }\n\n return miniCartData;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n CartLineValidationResultsByLineId,\n OrgUnitLocation\n} from '@msdyn365-commerce/retail-proxy';\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant,\n UncontrolledTooltip,\n updateMaxQuantityForCartLineItem,\n urlCheck\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\n\nimport { ICartIconData } from './cart-icon.data';\nimport { cartLinesSortOrder, ICartIconProps } from './cart-icon.props.autogenerated';\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\n\nexport interface IMiniCartState {\n miniCartData: IMiniCartData;\n orgUnitLocations?: OrgUnitLocation[];\n isQuantityLimitsFeatureEnabled: boolean;\n isCartValid: boolean;\n}\n\nexport interface ICartIconViewProps extends ICartIconProps {\n className: string;\n cartIcon: React.ReactNode;\n FlyoutContainer?: INodeProps;\n CartlinesWrapper: INodeProps;\n miniCartWrapper: INodeProps;\n miniCartItemWrapper: INodeProps;\n cartlines?: IFlyoutCartLineItemViewProps[];\n flyoutTitle: React.ReactNode;\n totalPrice: React.ReactNode;\n checkoutAsGuestButton?: React.ReactNode;\n checkoutAsSignInUserButton?: React.ReactNode;\n goToCartButton?: React.ReactNode;\n waitingComponent?: React.ReactNode;\n isCartLoading: boolean;\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\n/**\n *\n * Cart component.\n * @extends {React.PureComponent>}\n */\n@observer\nclass CartIcon extends React.Component, IMiniCartState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\n\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\n\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n private lastValidatedCartVersion: number | undefined;\n\n constructor(props: ICartIconProps) {\n super(props);\n this.state = {\n miniCartData: {},\n isCartValid: true,\n isQuantityLimitsFeatureEnabled: false\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n }\n\n public async componentDidMount(): Promise {\n const context = this.props.context.actionContext;\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n this.setState({\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\n });\n }\n );\n await this._setQuantityLimitsFeatureFlag();\n\n this.setState({\n orgUnitLocations: this.props.data.orgUnitLocations?.result\n });\n\n this._validateCart();\n }\n\n public componentDidUpdate(prevProps: ICartIconProps): void {\n this._validateCart();\n }\n\n public shouldComponentUpdate(nextProps: ICartIconProps, nextState: IMiniCartState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\n public render(): JSX.Element | null {\n const {\n id,\n typeName,\n config: { enableHoverCart, isAnonymousCheckout },\n context: {\n request: {\n user: { isAuthenticated, signInUrl }\n }\n },\n context,\n resources\n } = this.props;\n\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart =\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n const hasInvoiceLine = cart?.hasInvoiceLine;\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const cartLines = this._getCartLines();\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.state.miniCartData.productAvailabilites ?? [],\n this.props.context.actionContext,\n this.state.miniCartData.products ?? [],\n emailDeliveryModeCode\n );\n const hasError =\n !validInventoryAcrossCartLines?.isValid ||\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\n const flyoutTitle = resources.flyoutTitle;\n const flyoutTooltip = {\n tag: UncontrolledTooltip,\n shouldShowMiniCart,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__flyout-container',\n trigger: 'hover',\n displayMode: 'FLYOUT',\n target: id,\n shouldShowCloseButton: true,\n cartPageUrl: cartUrl,\n hideAriaHidden: true\n };\n\n // If there are invoice lines, don't update mini cart price\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\n const priceString = price\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\n : '';\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\n feature => feature.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n cartIcon: (\n \n ),\n cartlines: cartLines,\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\n CartlinesWrapper: {\n className: 'ms-cart-icon__cart-lines'\n },\n miniCartWrapper: {\n className: classnames('ms-cart-icon'),\n id: this.props.id\n },\n miniCartItemWrapper: {\n className: classnames('msc-cart-lines-item')\n },\n\n // If there are invoice lines, don't update mini cart checkout button\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\n checkoutAsSignInUserButton:\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton:\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n goToCartButton: (\n \n {goToCartButtonText}\n \n ),\n checkoutBlockedDueToUnavailableFunds: null,\n flyoutTitle: {flyoutTitle},\n totalPrice:
{priceString}
\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _validateCart(): void {\n const {\n data: { cart }\n } = this.props;\n const cartVersion = cart.result?.cart?.Version ?? undefined;\n if (this.lastValidatedCartVersion === cartVersion) {\n return;\n }\n\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\n\n if (this.state.isQuantityLimitsFeatureEnabled) {\n validateCartAsync(cart, this.props.telemetry, this.props.context)\n .then((result: CartLineValidationResultsByLineId | undefined) => {\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\n })\n .catch(() => {\n this.setState({ isCartValid: false });\n });\n } else {\n this.setState({ isCartValid: true });\n }\n }\n\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Sort cartline items.\n * @param cartlines - Cartlines to be sorted.\n * @param sortOrder - Ascending or descending.\n * @returns - Sorted cartlines.\n */\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\n const lines: CartLine[] = [...cartlines];\n const zero: number = 0;\n\n if (sortOrder === cartLinesSortOrder.descending) {\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\n }\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\n };\n\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\n const {\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources\n } = this.props;\n\n const imageSettings = this._getImageSettings(config.imageSettings);\n const cart = this.props.data.cart && this.props.data.cart.result;\n\n // Cart-icon could be placed in each page\n // so we check cart content to reduce number of RS calls\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\n ? FlyoutCartLineItems({\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\n products: this.state.miniCartData.products,\n productAvailabilites: this.state.miniCartData.productAvailabilites,\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\n imageSettings,\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n quantityDisplayString: resources.quantityDisplayText,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n inputQuantityAriaLabel: '', // Not used\n discountStringText: '', // Not used\n originalPriceText: '',\n currentPriceText: '',\n shippingChargesText: '',\n shippingText: resources.shippingText\n },\n telemetry,\n removeButtonText: resources.removeCartButtonText,\n outOfStockText: '', // Not used\n outOfRangeOneText: '', // Not used\n outOfRangeFormatText: '', // Not used\n cartState: cart,\n orgUnitLocations: this.state.orgUnitLocations,\n removeItemClickHandler: this._removeItemFromCartHandler,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n telemetryContent: this.telemetryContent,\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\n catalogs: this.props.data.catalogs?.result\n })\n : null;\n }\n\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return (\n imageSettings || {\n viewports: {\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\n },\n lazyload: true\n }\n );\n };\n\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result.removeCartLines(input).catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n private async _setQuantityLimitsFeatureFlag(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\n )?.IsEnabled || false;\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n return;\n }\n\n const useSiteBuilderSettings = featureStatuses?.find(\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\n )?.IsEnabled;\n\n if (useSiteBuilderSettings) {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n\n try {\n const featureStatuses = await this.props.data.featureState;\n const isQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\n )?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n } else {\n this.props.data.customerInformation\n .then(customerInfo => {\n const result =\n !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\n this.setState({ isQuantityLimitsFeatureEnabled: result });\n })\n .catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n });\n }\n } else {\n const cartConfiguration = await this.props.data.cartConfiguration;\n this.setState({ isQuantityLimitsFeatureEnabled: !(cartConfiguration?.IgnoreOrderSettings ?? false) });\n return;\n }\n }\n}\n\nexport default CartIcon;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICartIconViewProps } from './cart-icon';\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\n\nconst _renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n return cartLines.map((cartLine, index) => {\n return (\n \n {cartLine.cartline}\n {cartLine.storeLocation}\n {cartLine.remove}\n \n );\n });\n};\n\nconst CartIconView: React.FC = (props: ICartIconViewProps) => (\n \n {props.cartIcon}\n {props.FlyoutContainer ? (\n \n {props.flyoutTitle}\n {props.checkoutBlockedDueToUnavailableFunds}\n {_renderCartlines(props.cartlines, props)}\n {props.totalPrice}\n {props.checkoutAsSignInUserButton}\n {props.checkoutAsGuestButton}\n {props.goToCartButton}\n \n ) : (\n false\n )}\n \n);\n\nexport default CartIconView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IAny,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { searchOrgUnitLocationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\n\n/**\n * Input for search-org-unit-locations data action.\n */\nexport class SearchOrgUnitLocationsInput implements IActionInput {\n public getCacheKey = () => 'SearchOrgUnitLocations';\n\n public getCacheObjectType = () => 'SearchOrgUnitLocations';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- Input data.\n * @returns -- IActionInput.\n */\nexport const createSearchOrgUnitLocationsInputFunc = (inputData: ICreateActionContext>): IActionInput => {\n return new SearchOrgUnitLocationsInput();\n};\n\n/**\n * Calls the Retail API and returns all the orgUnitLocations as array.\n * @param input - Input.\n * @param ctx - Context.\n * @returns - orgUnitLocations.\n */\nexport async function getSearchOrgUnitLocationsAction(\n input: SearchOrgUnitLocationsInput,\n context: IActionContext\n): Promise {\n const OrgUnitLocations = await searchOrgUnitLocationsAsync(\n {\n callerContext: context\n },\n {}\n );\n\n return OrgUnitLocations;\n}\n\nexport const retailActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/search-org-unit-locations',\n action: >getSearchOrgUnitLocationsAction,\n input: createSearchOrgUnitLocationsInputFunc\n});\n\nexport default retailActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\n\n/**\n * ICartIconViewState: Interface for Cart Icon View State.\n */\ninterface ICartIconViewState {\n isModalOpen: boolean;\n}\n\n/**\n * Render Cart lines.\n * @param cartLines - Flyout cart line view props.\n * @param props - Cart icon view props.-\n * @returns JSX Element.\n */\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n return cartLines.map((cartLine, index) => {\n const cartLineIndex = index;\n return (\n \n {cartLine.cartline}\n {cartLine.storeLocation}\n {cartLine.remove}\n \n );\n });\n};\n\n/**\n * Initiate total price.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\n const totalPrice = price\n ? props.context.cultureFormatter.formatCurrency(price)\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\n return cart && !cart.hasInvoiceLine ? (\n
\n \n {props.resources.totalPriceFormatString}\n {totalPrice}\n \n
\n ) : (\n <>\n );\n};\n\n/**\n * Initiate subtotal message.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderSubtotalMessage = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n return cart && !cart.hasInvoiceLine ?

{props.resources.subTotalMessage}

: null;\n};\n\n/**\n *\n * CartIconView component.\n * @extends {React.PureComponent}\n */\nexport class CartIconView extends React.PureComponent<\n ICartViewProps & ICartIconViewProps & ICartIconExtensionProps<{}>,\n ICartIconViewState\n> {\n private isAutoDisplayTriggered: boolean;\n\n private readonly cartIconRef: React.RefObject = React.createRef();\n\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\n super(props);\n this.isAutoDisplayTriggered = false;\n this.state = {\n isModalOpen: false\n };\n }\n\n public componentDidMount(): void {\n if (MsDyn365.isBrowser) {\n window.addEventListener('keydown', this._escFunction, false);\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser) {\n window.removeEventListener('keydown', this._escFunction, false);\n }\n }\n\n /**\n * Render Cart Item count.\n * @returns JSX Element.\n */\n public render(): JSX.Element | null {\n const cart = this.props.data.cart.result ?? undefined;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart =\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n if (shouldShowMiniCart) {\n if (!this.isAutoDisplayTriggered) {\n // First time trigger auto mini cart.\n this.setState({ isModalOpen: true });\n this.isAutoDisplayTriggered = true;\n } else if (!this.state.isModalOpen) {\n // If modal is closed, reset the flag.\n this.isAutoDisplayTriggered = false;\n }\n }\n return (\n \n \n \n \n {this.props.flyoutTitle}\n {this._renderCartItemCount(this.props)}\n {this._renderCartCloseIcon()}\n \n \n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\n {this.props.checkoutBlockedDueToUnavailableFunds}\n {renderCartlines(this.props.cartlines, this.props)}\n \n \n {this.props.slots.promoContentItem}\n {renderTotalPrice(this.props)}\n {renderSubtotalMessage(this.props)}\n {this.props.checkoutAsSignInUserButton}\n {this.props.checkoutAsGuestButton}\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\n \n {this.props.data.cart.result?.isEmpty ? (\n \n {this.props.resources.continueShoppingButtonTitle}\n \n ) : null}\n \n \n \n \n );\n }\n\n /**\n * Initiate modal container.\n * @returns Inode props.\n */\n private readonly _modalContainer = (): INodeProps => {\n return {\n tag: Modal,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__minicartmodal-container',\n wrapClassName: 'ms-cart-icon__minicartmodal',\n isOpen: this.state.isModalOpen,\n toggle: this.closeModal\n };\n };\n\n /**\n * Initiate open modal.\n */\n private readonly _openModal = (): void => {\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\n this.setState({\n isModalOpen: true\n });\n };\n\n /**\n * Initiate close modal.\n */\n private readonly closeModal = (): void => {\n this.cartIconRef.current?.focus();\n this.setState({\n isModalOpen: false\n });\n };\n\n /**\n * Initiate cart close Icon.\n * @returns JSX Element.\n */\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\n return