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LOyyB,CAA2B11B,EAAM0gB,wBAAyB1gB,EAAMggB,kBAAmBhgB,GA3KxE41B,EAC7BC,EACA7V,EACAhgB,IAEK61B,EAKDp2B,EAAAA,cAAC80B,EAAAA,KAAIxd,OAAAC,OAAA,GAAKgJ,GACLhgB,EAAMigB,UACN4V,EAAkB5tB,SAClB4tB,EAAkBjtB,SAClBitB,EAAkBxtB,YAClBwtB,EAAkB1tB,IAClB0tB,EAAkB5sB,eAAiB4sB,EAAkB5sB,eAAiB,KACtE4sB,EAAkBx0B,aAXvBrB,EAAMtB,QAAQuB,UAAUgD,MAAM,qDACvB,MAqKO2yB,CAAyB51B,EAAMwgB,sBAAuBxgB,EAAMggB,kBAAmBhgB,IAzN1Eo1B,EA0NQp1B,EAAM0iB,qBAzNlBne,EAAAA,gBAAgBC,YAAY4wB,EAAUzP,QAIrDlmB,EAAAA,cAAC80B,EAAAA,KAAIxd,OAAAC,OAAA,GAAKoe,EAAUhQ,SACfgQ,EAAU1P,OACV0P,EAAUzP,QALR,KAyNE3lB,EAAM4gB,2BACN5gB,EAAM+gB,sBACN/gB,EAAMkhB,uBAAyB3c,EAAAA,gBAAgBC,YAAYxE,EAAMkhB,uBAC9DzhB,EAAAA,cAAC80B,EAAAA,KAAIxd,OAAAC,OAAA,GAAKhX,EAAMqhB,+BAAgCrhB,EAAMkhB,uBACtD,KACHlhB,EAAMshB,qBACNthB,EAAMwhB,8BAGdxhB,EAAMmiB","sources":["webpack://Msdyn365.Commerce.Online/../../src/search-org-unit-locations.ts?d18d","webpack://Msdyn365.Commerce.Online/./src/invoice-summary-lineitem.tsx?5f61","webpack://Msdyn365.Commerce.Online/./src/validate-cart.ts?cd50","webpack://Msdyn365.Commerce.Online/./src/order-summary-lineitem.tsx?8a98","webpack://Msdyn365.Commerce.Online/./src/modules/cart/actions/get-pickup-options-for-cartlines.ts?acad","webpack://Msdyn365.Commerce.Online/./src/Common/get-product.ts?0a21","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-pick-up-in-store.tsx?dca8","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-line-items.tsx?f6b2","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-line-groups.tsx?f076","webpack://Msdyn365.Commerce.Online/./src/modules/cart/utils/get-promotion-in-cart.ts?4195","webpack://Msdyn365.Commerce.Online/./src/modules/cart/cart.tsx?d4e4","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-line-items-promotion.tsx?80d9","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/themes/adventureworks/views/components/cartMethodChangePopup.tsx?8f64","webpack://Msdyn365.Commerce.Online/./src/modules/cart/cart.view.tsx?d8c2"],"sourcesContent":["/*!\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 { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IInvoiceSummaryProps {\n orderTotalLabel: string;\n invoiceLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n id: string;\n typeName: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n}\n\nexport interface IInvoiceSummaryLines {\n orderTotal: React.ReactNode;\n invoices: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IInvoiceSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\nconst InvoiceSummaryLine: React.FC = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n

\n {label}\n {price || price === 0 ? (\n \n ) : (\n {toBeCalculatedText}\n )}\n

\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\n \n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nexport const InvoiceSummary = (props: IInvoiceSummaryProps) => {\n const { TotalAmount, CartLines } = props.cart;\n const invoiceLines = CartLines?.filter(cartLine => cartLine.IsInvoiceLine);\n const reactNodes: IInvoiceSummaryLines = {\n invoices: invoiceLines?.map((invoiceLine: CartLine) => {\n return _buildPaymentSummarySection(\n props,\n invoiceLine.InvoiceAmount,\n format(props.invoiceLabel, invoiceLine.InvoiceId),\n 'invoice'\n );\n }),\n orderTotal: _buildPaymentSummarySection(props, TotalAmount, props.orderTotalLabel, 'total')\n };\n\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildPaymentSummarySection(props, -loyaltyAmount, props.loyaltyLabel || 'Loyalty amount', 'loyalty');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildPaymentSummarySection(\n props,\n -giftCardAmount,\n props.giftcardLabel || 'Gift card amount',\n 'gift-card'\n );\n }\n\n reactNodes.orderTotal = _buildPaymentSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n props.orderTotalLabel,\n 'total'\n );\n }\n\n return reactNodes;\n};\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 { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\n\nexport interface IOrderSummaryProps {\n subTotalLabel: string;\n shippingLabel: string;\n taxLabel: string;\n orderTotalLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n totalDiscountsLabel: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n id: string;\n typeName: string;\n otherChargeLabel?: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n retailMultiplePickUpOptionEnabled?: boolean;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isTaxIncludedInPrice?: boolean;\n isShowTaxBreakup?: boolean;\n customerAccountLabel?: string;\n}\n\nexport interface IOrderSummaryLines {\n subtotal: React.ReactNode;\n shipping?: React.ReactNode;\n otherCharge?: React.ReactNode;\n tax: React.ReactNode;\n orderTotal: React.ReactNode;\n totalDiscounts?: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n customerAccount?: React.ReactNode;\n}\n\ninterface IOrderSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n priceCurrency?: string;\n}\n\ninterface IShippingOrderLine {\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n canShip?: boolean;\n hasDeliveryMethod?: boolean;\n hasShippingMethod?: boolean;\n freightFee?: number;\n}\n\nconst OrderSummaryLine: React.FC = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel,\n priceCurrency\n}) => {\n return (\n

\n {label}\n {price || price === 0 ? (\n \n ) : (\n {toBeCalculatedText}\n )}\n

\n );\n};\n\nconst _buildOrderSummarySection = (\n props: IOrderSummaryProps,\n price: number | undefined,\n cssLabel: string,\n label: string = ''\n): React.ReactNode => {\n return (\n \n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computedCustomerAccountAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.customerAccountAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nconst getDeliveryConfiguration = (\n cart: Cart,\n channelConfiguration: ChannelConfiguration,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\n retailMultiplePickUpOptionEnabled?: boolean,\n isTaxIncludedInPrice?: boolean,\n isShowTaxBreakup?: boolean\n): IShippingOrderLine => {\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\n const cartLines = cart.CartLines || [];\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\n const taxOnShippingCharge = cart.TaxOnShippingCharge !== undefined ? cart.TaxOnShippingCharge : 0;\n const shippingChargeAmount = cart.ShippingChargeAmount !== undefined ? cart.ShippingChargeAmount : 0;\n\n // isTaxIncludedInPrice isShowTaxBreakup useProperties\n // False False/True shippingChargeAmount\n // True True shippingChargeAmount\n // True false shippingChargeAmount + taxOnShippingCharge\n // if either of isTaxIncludedInPrice or isShowTaxBreakup is undefined then we will execute old logic\n let freightFee: number | undefined = 0;\n if (isTaxIncludedInPrice === undefined || isShowTaxBreakup === undefined) {\n freightFee = cart.ShippingChargeAmount;\n } else {\n freightFee = isTaxIncludedInPrice && !isShowTaxBreakup ? shippingChargeAmount + taxOnShippingCharge : cart.ShippingChargeAmount;\n }\n const canShip = deliveryModes.some(\n deliveryMode =>\n !(\n deliveryMode !== '' &&\n (deliveryMode ===\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) ||\n deliveryMode === emailDeliveryModeCode)\n )\n );\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\n const hasShippingMethod = deliveryModes.some(\n deliveryMode =>\n !!deliveryMode &&\n deliveryMode !==\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) &&\n deliveryMode !== emailDeliveryModeCode\n );\n return {\n canShip,\n hasDeliveryMethod,\n hasShippingMethod,\n freightFee\n } as IShippingOrderLine;\n};\n\nconst getDeliveryMode = (\n deliveryMode?: string,\n featureSate: boolean = false,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\n pickupDeliveryMode?: string\n) => {\n if (!featureSate) {\n return pickupDeliveryMode;\n }\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\n};\n\n// eslint-disable-next-line complexity\nexport const OrderSummary = (props: IOrderSummaryProps) => {\n const {\n SubtotalAmount,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\n SubtotalAmountWithoutTax,\n TaxAmount,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\n TaxOnNonShippingCharges,\n DiscountAmount = 0,\n TotalAmount,\n OtherChargeAmount\n } = props.cart;\n\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(\n props.cart,\n props.channelConfiguration,\n props.channelDeliveryOptionConfig,\n props.retailMultiplePickUpOptionEnabled,\n props.isTaxIncludedInPrice,\n props.isShowTaxBreakup\n );\n\n let reactNodes: IOrderSummaryLines;\n // if either of isTaxIncludedInPrice or isShowTaxBreakup is undefined then we will execute old logic\n if (props.isTaxIncludedInPrice === undefined || props.isShowTaxBreakup === undefined) {\n reactNodes = {\n subtotal: _buildOrderSummarySection(props, SubtotalAmount, 'sub-total', props.subTotalLabel),\n tax: _buildOrderSummarySection(props, hasDeliveryMethod ? TaxAmount : undefined, 'tax-amount', props.taxLabel),\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge:\n (OtherChargeAmount && _buildOrderSummarySection(props, OtherChargeAmount, 'other-charges', props.otherChargeLabel)) ||\n undefined\n };\n } else {\n const otherChargeAmount = OtherChargeAmount !== undefined ? OtherChargeAmount : 0;\n const taxOnNonShippingCharges = TaxOnNonShippingCharges !== undefined ? TaxOnNonShippingCharges : 0;\n const isTaxGreaterThanZero = TaxAmount !== undefined && TaxAmount > 0;\n // isTaxIncludedInPrice isShowTaxBreakup useProperties\n // False False/True otherChargeAmount\n // True True otherChargeAmount\n // True false otherChargeAmount+TaxOnNonShippingCharges\n\n const otherChargeAmountTotal =\n props.isTaxIncludedInPrice && !props.isShowTaxBreakup ? otherChargeAmount + taxOnNonShippingCharges : otherChargeAmount;\n\n const subtotalAmountActual = props.isTaxIncludedInPrice && props.isShowTaxBreakup ? SubtotalAmountWithoutTax : SubtotalAmount;\n\n reactNodes = {\n subtotal: _buildOrderSummarySection(props, subtotalAmountActual, 'sub-total', props.subTotalLabel),\n tax: props.isShowTaxBreakup\n ? _buildOrderSummarySection(\n props,\n hasDeliveryMethod || isTaxGreaterThanZero ? TaxAmount : undefined,\n 'tax-amount',\n props.taxLabel\n )\n : '',\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge:\n (OtherChargeAmount && _buildOrderSummarySection(props, otherChargeAmountTotal, 'other-charges', props.otherChargeLabel)) ||\n undefined\n };\n }\n if (canShip) {\n reactNodes.shipping = _buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\n }\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const customerAccountAmount = _computedCustomerAccountAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount - customerAccountAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\n }\n\n if (customerAccountAmount > 0) {\n reactNodes.customerAccount = _buildOrderSummarySection(\n props,\n -customerAccountAmount,\n 'customer-credit-amount',\n props.customerAccountLabel || 'Customer Credit amount'\n );\n }\n\n reactNodes.orderTotal = _buildOrderSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n 'total',\n props.orderTotalLabel\n );\n }\n\n if (DiscountAmount > 0) {\n reactNodes.totalDiscounts = _buildOrderSummarySection(props, -DiscountAmount, 'total-discounts', props.totalDiscountsLabel);\n }\n\n return reactNodes;\n};\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 IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { getCartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n ActiveCartProductsInput,\n QueryResultSettingsProxy,\n buildCacheKey,\n getActiveCartProductsAction\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for pickup delivery options for items in cart.\n */\nexport class ProductPickUpOptionsForCartLineItems implements IActionInput {\n public readonly apiSettings: ICommerceApiSettings;\n\n public constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n /**\n * Get Cache Key.\n * @returns - Cache key string.\n */\n public getCacheKey = (): string => buildCacheKey('ActiveCartLineItemsPickUpOptions', this.apiSettings);\n\n /**\n * Get Cachetype Name.\n * @returns - Cache name string.\n */\n public getCacheObjectType = (): string => 'ActiveCartLineItemsPickUpOptions';\n\n /**\n * Get Cachetype.\n * @returns - CacheType enum.\n */\n public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * CreateInput method for the GetPickUpOptionCartLineItems method.\n * @param inputData - The input data passed to the createInput method.\n * @returns - Input for data action.\n */\nconst createInput = (inputData: ICreateActionContext>) => {\n return new ProductPickUpOptionsForCartLineItems(inputData.requestContext.apiSettings);\n};\n\n/**\n * The action method for the GetPickUpOptionCartLineItems data action.\n * @param input - The action input.\n * @param context - The action context.\n * @returns - Order Template object.\n */\nexport async function getPickUpOptionsForCartLineItems(\n input: ProductPickUpOptionsForCartLineItems,\n context: IActionContext\n): Promise {\n // If no input is provided fail out\n if (!input.apiSettings.channelId) {\n throw new Error('[getPickUpOptionsForCartLineItems]No valid Input was provided, failing');\n }\n const cartState = await getCartState(context);\n const cart = cartState.cart;\n const products = await getActiveCartProductsAction(new ActiveCartProductsInput(), context);\n const filterOption = 4;\n const response: ProductDeliveryOptions[] = [];\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- existing code.\n if (cart === undefined || !ArrayExtensions.hasElements(products)) {\n return Promise.resolve(response);\n }\n\n const pickupoptions = await ProductsDataActions.getDeliveryOptionsAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n products.map(product => product.RecordId),\n {},\n filterOption\n );\n\n return pickupoptions;\n}\n\n/**\n * The GetPickupOptionCartLineItems Data Action\n * Returns pickup options.\n */\nexport const getPickUpOptionsForCartLineItemsDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/get-pickup-options-for-cartlines',\n action: getPickUpOptionsForCartLineItems as IAction,\n input: createInput\n});\n\nexport default getPickUpOptionsForCartLineItemsDataAction;\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 { ICartState } from '@msdyn365-commerce/global-state';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n DeliveryOption,\n OrgUnitLocation,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPickUpInStoreViewProps {\n callbacks: {\n toggleBopis(isBopisSelected: boolean): void;\n };\n defaultComponent?: React.ReactNode;\n orgUnitName?: string;\n isBopisSelected: boolean;\n ContainerProps: INodeProps;\n deliveryOption?: string;\n}\n\nexport interface IPickUpInStoreProps {\n cartline: CartLine;\n product: SimpleProduct;\n shipitText: string;\n pickUpInStoreText: string;\n changeStoreText: string;\n cartState: ICartState | undefined;\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\n orgUnitLocations?: OrgUnitLocation[] | undefined;\n deliveryOptions?: ProductDeliveryOptions;\n pickupDeliveryModeCode?: string;\n storeSelectorModuleId?: string;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n retailMulitplePickupFeatureState?: boolean;\n locationChangedHandler(): void;\n}\n\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\n const _onLocationChangedCallback = async (\n orgUnitLocation: OrgUnitLocation,\n cartState: ICartState | undefined,\n cartline: CartLine,\n deliveryMode?: string\n ) => {\n if (!cartState) {\n return Promise.resolve();\n }\n return cartState\n .updateCartLinePickupLocation({ cartLineId: cartline.LineId!, location: orgUnitLocation, deliveryMode })\n .then(result => {\n if (result.status === 'SUCCESS') {\n props.locationChangedHandler();\n }\n })\n .catch(error => {});\n };\n\n const _toggleBOPIS = (isBopisSelected: boolean) => {\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\n\n if (isBopisSelected) {\n if (!storeSelectorStateManager) {\n return;\n }\n storeSelectorStateManager\n .openDialog({\n id: storeSelectorModuleId,\n product,\n alreadySelectedLocation: {\n OrgUnitNumber: cartline.FulfillmentStoreId\n },\n deliveryOptions: props.deliveryOptions,\n onLocationSelected: async (orgUnitLocation, deliveryMode: string | undefined) => {\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\n }\n })\n .catch(error => {});\n } else {\n if (!cartState) {\n return;\n }\n cartline.DeliveryMode = '';\n cartline.FulfillmentStoreId = '';\n cartline.ShippingAddress = {};\n cartState\n .clearCartLinePickupLocation({ cartLineId: cartline.LineId! })\n .then(result => {\n if (result.status === 'SUCCESS') {\n props.locationChangedHandler();\n }\n })\n .catch(error => {});\n }\n };\n\n const _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\n const _renderShippingMethod = (\n cartLine: CartLine,\n shipItText: string,\n pickupInStoretext: string,\n changeStoreText: string,\n orgUnitLocations: OrgUnitLocation[] | undefined\n ): JSX.Element => {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\n const bopisSelected = !!cartLine.FulfillmentStoreId;\n\n const toggleBOPIS = (isBopisSelected: boolean) => {\n return () => {\n _toggleBOPIS(isBopisSelected);\n };\n };\n\n return (\n <>\n \n \n {cartLine.FulfillmentStoreId ? (\n
\n {orgUnitName}\n \n
\n ) : null}\n \n );\n };\n\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\n return delivery?.Description;\n };\n\n /**\n * Method to check if we have atleast one common delivery code between product and channel.\n * @param productdeliveryOptions - Product DeliveryOption List.\n * @param storePickUpOptionList - Channel DeliveryOption List.\n * @returns Boolean flag.\n */\n const matchDeliveryOptions = (\n productdeliveryOptions: DeliveryOption[] | undefined,\n storePickUpOptionList: string[] | undefined\n ): boolean => {\n const deliveryOption: string[] = [];\n productdeliveryOptions?.map(delivery => {\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\n if (pickup) {\n deliveryOption.push(pickup);\n }\n return deliveryOption;\n });\n\n return ArrayExtensions.hasElements(deliveryOption);\n };\n\n // If no delivery options present on the product, or none of the delivery options\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\n if (!props.deliveryOptions || !props.deliveryOptions.DeliveryOptions) {\n return undefined;\n }\n\n if (props.retailMulitplePickupFeatureState && props.channelDeliveryOptionConfig) {\n if (!matchDeliveryOptions(props.deliveryOptions.DeliveryOptions, props.channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\n return undefined;\n }\n } else if (\n !props.pickupDeliveryModeCode ||\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)\n ) {\n return undefined;\n }\n\n return {\n callbacks: {\n toggleBopis: _toggleBOPIS\n },\n defaultComponent: _renderShippingMethod(\n props.cartline,\n props.shipitText,\n props.pickUpInStoreText,\n props.changeStoreText,\n props.orgUnitLocations\n ),\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\n ContainerProps: {\n className: 'msc-cart-line__bopis-container'\n }\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n AddToOrderTemplateComponent,\n AddToWishlistComponent,\n CartLineItemComponent,\n IAddToOrderTemplateDialogResources,\n ICartlineResourceString,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources,\n IOrderTemplateNameDialogResources,\n IWishlistActionSuccessResult\n} from '@msdyn365-commerce/components';\nimport MsDyn365, {\n IAny,\n ICoreContext,\n IGeneric,\n IGridSettings,\n IImageSettings,\n ITelemetry,\n TelemetryEvent,\n isChannelTypeB2B\n} from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CartLine,\n CartLineValidationResultsByLineId,\n ChannelDeliveryOptionConfiguration,\n CommerceList,\n Customer,\n OrgUnitLocation,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ProductCatalog, ProductDimensionType, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport {\n ArrayExtensions,\n getInvoiceDetailsPageUrlSync,\n getProductUrlSync,\n IProductInventoryInformation,\n isCartLineItemPickUpType,\n ObjectExtensions,\n OrderTemplate,\n StringExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\nimport { IPickUpInStoreViewProps, PickUpInStore } from './cart-pick-up-in-store';\n\nexport interface ICartLineItemsProps {\n cartlines: CartLine[];\n cartlinesErrors: CartLineValidationResultsByLineId;\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 retailMulitplePickupFeatureState?: boolean;\n\n /* GridSettings for the product image in cartline */\n gridSettings: IGridSettings;\n\n /* ImageSettings for the product image in cartline */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext>;\n telemetry: ITelemetry;\n removeButtonText: string;\n addToWishlistButtonText: string;\n removeFromWishlistButtonText: string;\n shipItText: string;\n pickitUpText: string;\n changeStoreText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\n isStockCheckEnabled: boolean;\n wishlists: CommerceList[] | undefined;\n defaultWishlistName: string;\n maxCartlineQuantity: number;\n includeErrors?: boolean;\n showShippingChargesForLineItems?: boolean;\n telemetryContent?: ITelemetryContent;\n isQuantityLimitsFeatureEnabled: boolean;\n hasInvoiceLine?: boolean;\n storeSelectorModuleId?: string;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n\n addToOrderTemplateButtonText: string;\n addToOrderTemplateButtonTooltip: string;\n addToOrderTemplateMessage: string;\n addItemToOrderTemplateError: string;\n orderTemplates: OrderTemplate[] | undefined;\n customerInformation: Customer | undefined;\n shouldIgnoreWarehouse: boolean | undefined;\n productAvailability?: AsyncResult;\n productPickUpOptions?: ProductDeliveryOptions[] | undefined;\n isMultipleCatalogFeatureEnabledInHq: boolean;\n catalogId?: number;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number, lineIndex?: number): boolean;\n locationChangedHandler(): void;\n}\n\nexport interface ICartlinesViewProps {\n cartline: React.ReactNode;\n pickUpInStore?: IPickUpInStoreViewProps;\n remove: React.ReactNode;\n addToWishlist: React.ReactNode | undefined;\n addToOrderTemplate: React.ReactNode | undefined;\n\n error?: string;\n cartlineId?: string;\n hasError?: boolean;\n data?: {\n product?: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (\n isStockCheckEnabled: boolean,\n productAvailability: IProductInventoryInformation | undefined\n): number => {\n if (\n !isStockCheckEnabled ||\n !productAvailability ||\n !productAvailability.ProductAvailableQuantity ||\n !productAvailability.IsProductAvailable ||\n !productAvailability.ProductAvailableQuantity.AvailableQuantity\n ) {\n return 0;\n }\n\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\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 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\nconst _getErrorMessage = (\n availableQuantityInStock: number,\n currentQuantity: number,\n props: ICartLineItemsProps,\n shouldSkipStockCheck: boolean,\n cartLine: CartLine,\n lineId: string | undefined,\n foundProductAvailability?: IProductInventoryInformation\n): string | undefined => {\n const finalErrorMessages: string[] = [];\n\n const isLoadingDeliveryOptions = props.productAvailability?.status === 'LOADING';\n if (isLoadingDeliveryOptions) {\n return undefined;\n }\n // check availability passed as prop for each cartline\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\n if (foundProductAvailability === undefined) {\n finalErrorMessages.push(props.outOfStockText);\n return finalErrorMessages.toString();\n }\n }\n if (props.includeErrors && props.isStockCheckEnabled && !shouldSkipStockCheck) {\n if (availableQuantityInStock <= 0) {\n finalErrorMessages.push(props.outOfStockText);\n } else if (availableQuantityInStock < currentQuantity) {\n if (availableQuantityInStock === 1) {\n finalErrorMessages.push(props.outOfRangeOneText);\n } else {\n finalErrorMessages.push(props.outOfRangeFormatText.replace('{numLeft}', availableQuantityInStock.toString()));\n }\n }\n }\n\n // Server-side validation\n const checkForErrors = props.cartlinesErrors.ValidationResultsPairs;\n const errorsFoundByLineId = checkForErrors?.filter(index => index.LineId === lineId);\n if (errorsFoundByLineId !== undefined) {\n for (const i of errorsFoundByLineId) {\n if (ArrayExtensions.hasElements(i.ValidationFailures)) {\n i.ValidationFailures.forEach(validation => {\n if (validation.ErrorContext !== undefined) {\n finalErrorMessages.push(validation.ErrorContext);\n }\n });\n }\n }\n }\n\n if (ArrayExtensions.hasElements(finalErrorMessages)) {\n return finalErrorMessages.join(' ');\n }\n\n return undefined;\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};\n\n// eslint-disable-next-line complexity -- Auto-suppressed.\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct | undefined,\n props: ICartLineItemsProps,\n index: number,\n foundProductAvailability?: IProductInventoryInformation,\n productPickUpOptions?: ProductDeliveryOptions\n): ICartlinesViewProps => {\n const {\n imageSettings,\n gridSettings,\n id,\n typeName,\n context,\n resources,\n removeButtonText,\n removeItemClickHandler,\n moveToWishlistSuccessHandler,\n addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip,\n addToOrderTemplateDialogResources,\n createOrderTemplateDialogResources,\n itemAddedToOrderTemplateDialogResources,\n duplicateItemsWhenAddingToOrderTemplateDialogResources,\n addToWishlistButtonText,\n removeFromWishlistButtonText,\n orderTemplates,\n customerInformation,\n wishlists,\n defaultWishlistName,\n storeSelectorModuleId,\n isMultipleCatalogFeatureEnabledInHq\n } = props;\n\n const isAuthenticated = context.request.user.isAuthenticated;\n const nameOfWishlist = wishlists && wishlists.length > 0 && wishlists[0].Name ? wishlists[0].Name : defaultWishlistName;\n const availableQuantityInStock = _getCartItemAvailableQuantity(props.isStockCheckEnabled, 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 // Skip stock check if the cart line is a service item or an invoice line\n const shouldSkipStockCheck = product?.ItemTypeValue === ReleasedProductType.Service || !!cartline.IsInvoiceLine;\n\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity)\n ? undefined\n : _getErrorMessage(\n availableQuantityInStock,\n cartline.Quantity!,\n props,\n shouldSkipStockCheck,\n cartline,\n cartline.LineId,\n foundProductAvailability\n );\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n\n const payload = getPayloadObject(TelemetryEvent.RemoveFromCart, props.telemetryContent!, removeButtonText, '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\n\n const inventoryLbl = foundProductAvailability?.StockLevelLabel;\n const inventoryCode = foundProductAvailability\n ? `ms-cart-line__inventory-code-${foundProductAvailability.StockLevelCode?.toLowerCase()}`\n : undefined;\n const productDimension = 4;\n const customPriceDimensionType = productDimension as ProductDimensionType.Style;\n const isCustomPriceSelected =\n product?.Dimensions?.find(dimension => dimension.DimensionTypeValue === customPriceDimensionType)?.DimensionValue?.Value ===\n 'Custom';\n\n let productUrl: string | undefined;\n if (product) {\n productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n\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 } else {\n productUrl = getInvoiceDetailsPageUrlSync(cartline.Description || '', props.context.actionContext);\n }\n\n return {\n data: {\n product,\n cartline\n },\n cartlineId: cartline.LineId,\n error: errorMessage,\n hasError:\n (!shouldSkipStockCheck && props.isStockCheckEnabled ? cartline.Quantity! > (maxQuantity ?? 0) : false) ||\n (!ObjectExtensions.isNullOrUndefined(errorMessage) && !StringExtensions.isNullOrEmpty(errorMessage)),\n cartline: (\n \n ),\n pickUpInStore: product\n ? PickUpInStore({\n storeSelectorModuleId,\n cartState: props.cartState,\n cartline,\n product,\n shipitText: props.shipItText,\n pickUpInStoreText: props.pickitUpText,\n changeStoreText: props.changeStoreText,\n storeSelectorStateManager: props.storeSelectorStateManager,\n orgUnitLocations: props.orgUnitLocations,\n deliveryOptions: productPickUpOptions,\n pickupDeliveryModeCode:\n cartline.DeliveryMode !== (undefined || '') ? cartline.DeliveryMode : props.pickupDeliveryModeCode,\n retailMulitplePickupFeatureState: props.retailMulitplePickupFeatureState,\n channelDeliveryOptionConfig: props.channelDeliveryOptionConfig,\n locationChangedHandler: props.locationChangedHandler\n })\n : undefined,\n remove: (\n \n ),\n addToWishlist:\n isAuthenticated && product && !isCustomPriceSelected ? (\n \n ) : (\n undefined\n ),\n addToOrderTemplate:\n isAuthenticated && orderTemplates && product ? (\n \n ) : (\n undefined\n )\n };\n};\n\nexport const assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps\n): ICartlinesViewProps[] | null => {\n const reactNodes: ICartlinesViewProps[] = [];\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\n // check if cartlineitem is pickup item\n const isPickUpItem = isCartLineItemPickUpType(\n cartline,\n props.retailMulitplePickupFeatureState,\n props.channelDeliveryOptionConfig,\n props.pickupDeliveryModeCode\n );\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\n if (!props.shouldIgnoreWarehouse && isPickUpItem) {\n // check warehouse only if siteBuilder setting is not \"Based on aggregate for shipping and pickup warehouses\" and cartlineitem is pickupitem\n return (\n productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId &&\n productAvailability.InventLocationId?.toUpperCase() === cartline.WarehouseId?.toUpperCase()\n );\n }\n return productAvailability.ProductAvailableQuantity.ProductId === cartline.ProductId;\n });\n }\n\n let productPickUpOptions;\n if (props.productPickUpOptions !== undefined && ArrayExtensions.hasElements(props.productPickUpOptions)) {\n productPickUpOptions = props.productPickUpOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, productPickUpOptions));\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n * @param props\n */\nexport const CartLineItems = (props: ICartLineItemsProps) => {\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 { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport groupBy from 'lodash/groupBy';\n\nimport { assembleCartlines, ICartLineItemsProps, ICartlinesViewProps } from './cart-line-items';\n\nconst _assembleGroupCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps\n): ICartlinesViewProps[][] | null => {\n const reactNodes: ICartlinesViewProps[][] = [];\n if (!products || products.length === 0) {\n props.context.telemetry.error('Products content is empty, module wont render');\n return null;\n }\n\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => item.DeliveryMode);\n const groupDelivery = getGroupByDelivery(cartlines);\n const cartLinesGroup: CartLine[] = [];\n\n // 1) Group by store and pick up mode\n Object.entries(groupDelivery).forEach(([deliveryType, groupByDeliveryType]) => {\n // @ts-expect-error\n groupDelivery[deliveryType] = getGroupByStorePickup(groupByDeliveryType);\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\n });\n\n // 2) Create cartlines group\n Object.keys(cartLinesGroup).forEach(key => {\n const cartLines = cartLinesGroup[key];\n Object.keys(cartLines).forEach(index => {\n const cartLine = cartLines[index];\n const carLineViewProps = assembleCartlines(cartLine, products, props);\n if (carLineViewProps !== null) {\n reactNodes.push(carLineViewProps);\n }\n });\n });\n\n return reactNodes;\n};\n\nconst _assembleGroupInvoiceCartlines = (\n cartLines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps\n): ICartlinesViewProps[][] | null => {\n const reactNodes: ICartlinesViewProps[][] = [];\n if (cartLines && cartLines.length > 0) {\n // Create invoice cartLines group\n const carLineViewProps = assembleCartlines(cartLines, products, props);\n if (carLineViewProps !== null) {\n reactNodes.push(carLineViewProps);\n }\n }\n return reactNodes;\n};\n\n/**\n * CartLine Group component.\n * @param props\n */\nexport const CartLineGroupItems = (props: ICartLineItemsProps) => {\n const { products, cartlines, hasInvoiceLine } = props;\n return hasInvoiceLine\n ? _assembleGroupInvoiceCartlines(cartlines, products, props)\n : _assembleGroupCartlines(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 { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\nimport { getPromotionOptionsForCartLineItems, PromotionOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IPromotionData entity interface.\n */\nexport interface IPromotionData {\n promotionOptions?: CartPromotionLine[];\n}\n\n/**\n * Calls the Retail API and returns a promotion data.\n * @param ctx\n */\nexport async function getPromotionData(ctx: IActionContext): Promise {\n const promotionData: IPromotionData = {};\n\n await getPromotionOptionsForCartLineItems(new PromotionOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(promotionOptions => {\n if (promotionOptions) {\n promotionData.promotionOptions = promotionOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n return {};\n });\n\n return promotionData;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n IAddToOrderTemplateDialogResources,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources,\n ILinesAddedToOrderTemplateDialogResources,\n IOrderTemplateNameDialogResources,\n IWishlistActionSuccessResult,\n PromoCodeComponent,\n SaveCartToOrderTemplateComponent\n} from '@msdyn365-commerce/components';\nimport MsDyn365, { getCatalogId, getUrlSync, IImageSettings, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport { AsyncResult, CartLine, CartLineValidationResultsByLineId, LineValidationResult } from '@msdyn365-commerce/retail-proxy';\nimport { FeatureState, ProductDeliveryOptions, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { cartLineQuantityUpdatedAsync, validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport {\n ActiveCartProductsInput,\n ArrayExtensions,\n getActiveCartProductsAction,\n ICartLineInventoryValidationResult,\n ObjectExtensions,\n validateCartLinesInventory,\n ProductPickUpOptionsForCartLineItems,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Alert,\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant,\n Waiting,\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';\nimport { getPickUpOptionsForCartLineItems } from './actions/get-pickup-options-for-cartlines';\n\nimport { ICartData } from './cart.data';\nimport { ICartProps, ICartResources } from './cart.props.autogenerated';\nimport { CartLineGroupItems } from './components/cart-line-groups';\nimport { CartLineItems, ICartlinesViewProps } from './components/cart-line-items';\nimport { cartPromotions, ICartLineItemViewProps } from './components/cart-line-items-promotion';\nimport { getPromotionData, IPromotionData } from './utils/get-promotion-in-cart';\n\n/**\n * Cart view props interface.\n */\nexport interface ICartViewProps extends ICartProps {\n className: string;\n title?: React.ReactNode;\n CartlinesWrapper: INodeProps;\n cartlines?: ICartlinesViewProps[];\n cartLinesGroup?: ICartlinesViewProps[][];\n cart: ICartState | undefined;\n orderSummaryHeading: React.ReactNode;\n orderSummaryLineitems?: IOrderSummaryLines;\n invoiceSummaryLineitems?: IInvoiceSummaryLines;\n OrderSummaryWrapper: INodeProps;\n OrderSummaryItems: INodeProps;\n OrderSummaryErrors?: IOrderSummaryErrors;\n checkoutAsGuestButton: React.ReactNode;\n checkoutAsSignInUserButton: React.ReactNode;\n storeSelector?: React.ReactNode;\n expressCheckoutButton?: React.ReactNode[];\n ExpressCheckoutSectionWrapper: INodeProps;\n backToShoppingButton: React.ReactNode;\n waitingComponent: React.ReactNode;\n promotionOptions?: ICartLineItemViewProps;\n promoCode: React.ReactNode;\n cartLoadingStatus: string;\n cartDataResult: boolean;\n multiplePickUpEnabled?: boolean;\n createTemplateFromCartButton: React.ReactNode;\n telemetryContent?: ITelemetryContent;\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\n}\n\n/**\n * Order summary errors interface.\n */\nexport interface IOrderSummaryErrors {\n Wrapper: INodeProps;\n header: React.ReactNode;\n errors: React.ReactNode[];\n}\n\n/**\n * Cart component state interface.\n */\ninterface ICartComponentState {\n showPromotionDialog: boolean;\n cartlinesErrors: CartLineValidationResultsByLineId;\n promotionData: IPromotionData;\n isCartValid: boolean;\n productPickUpOptions?: ProductDeliveryOptions[];\n}\n\n/**\n * Cart component.\n * @extends {React.PureComponent>}\n */\n@observer\nclass Cart extends React.Component> {\n public state: ICartComponentState;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly payLoad: IPayLoad;\n\n private isQuantityLimitsFeatureEnabled: boolean = false;\n\n private _isMounted: boolean = false;\n\n private readonly promotionPopupId: string = 'cart-promotion-popup';\n\n public constructor(props: ICartProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\n this.promotionLinkClick = this.promotionLinkClick.bind(this);\n this.promotionCloseButtonclick = this.promotionCloseButtonclick.bind(this);\n\n this.state = {\n showPromotionDialog: false,\n promotionData: {},\n isCartValid: true,\n productPickUpOptions: undefined,\n cartlinesErrors: {}\n };\n }\n\n /**\n * Component did mount function.\n */\n public async componentDidMount(): Promise {\n this._isMounted = true;\n const {\n config,\n context: { actionContext }\n } = this.props;\n\n this.isQuantityLimitsFeatureEnabled =\n (await this.getOrderQuantityLimitsFeatureFlag()) || (await this._isChannelLimitsFeatureEnabled());\n if (this.isQuantityLimitsFeatureEnabled) {\n await this.validateCart();\n }\n\n if (config.showAvailablePromotions) {\n if (this._isMounted && this.props.data.cart.result?.cart.CartLines) {\n this.setState({ promotionData: await getPromotionData(actionContext) });\n }\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n if (this._isMounted) {\n this.setState({ promotionData: await getPromotionData(actionContext) });\n }\n }\n );\n }\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n if (this._isMounted) {\n const input = new ProductPickUpOptionsForCartLineItems(actionContext.requestContext.apiSettings);\n this.setState({ productPickUpOptions: await getPickUpOptionsForCartLineItems(input, actionContext) });\n }\n }\n );\n }\n\n /**\n * Component will unmount function.\n */\n public componentWillUnmount(): void {\n this._isMounted = false;\n }\n\n /**\n * Should component update function.\n * @param nextProps - Next props.\n * @param nextState - Next state.\n * @returns True if component should update, false otherwise.\n */\n public shouldComponentUpdate(nextProps: ICartProps, nextState: ICartComponentState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n /* eslint-disable complexity -- Disabling complexity for render method */\n public render(): JSX.Element | null {\n const {\n data: {\n cart: { result: cart },\n products: { result: products }\n },\n context: {\n request: {\n user: { isAuthenticated, signInUrl }\n }\n },\n resources\n } = this.props;\n\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const backToShoppingUrl = getUrlSync('home', 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 const cartLines = this._getCartLines();\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.props.data.productAvailabilites.result ?? [],\n this.props.context.actionContext,\n products ?? [],\n emailDeliveryModeCode\n );\n\n const hasError =\n !validInventoryAcrossCartLines?.isValid ||\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n const multiplePickUpEnabled = RetailMultiplePickupFeatureState?.IsEnabled;\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const { featureState } = this.props.data;\n const isMultipleCatalogsFeatureEnabled =\n featureState.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n const currentCatalogId = getCatalogId(this.props.context.request);\n validateCatalogId(currentCatalogId);\n const cartLinesGroup = cart?.hasInvoiceLine || multiplePickUpEnabled ? this.getCartLinesGroup() : null;\n this.payLoad.contentAction.etext = TelemetryConstant.Checkout;\n const checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.GuestCheckout;\n const checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.BackToShopping;\n const backtoShoppingAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n\n // If there's inventory issues across multiple cart lines then update the error and display as part of the order summary\n if (validInventoryAcrossCartLines && !validInventoryAcrossCartLines.isValid) {\n if (multiplePickUpEnabled && cartLinesGroup !== null) {\n for (const cartLineGroup of cartLinesGroup) {\n this._updateCartLineErrorForInvalidInventory(cartLineGroup, validInventoryAcrossCartLines);\n }\n }\n\n this._updateCartLineErrorForInvalidInventory(cartLines, validInventoryAcrossCartLines);\n }\n\n const viewProps = {\n ...this.props,\n className: classnames('ms-cart'),\n title:

{resources.cartTitle}

,\n cart: this.props.data.cart.result,\n CartlinesWrapper: { className: 'msc-cartline-wraper' },\n OrderSummaryWrapper: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary-wrapper' : 'msc-order-summary-wrapper' },\n OrderSummaryItems: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary__items' : 'msc-order-summary__items' },\n cartlines: cartLines,\n cartLinesGroup,\n promoCode: this._getPromoCode(),\n promotionOptions: this._getPromotions(),\n context: this.props.context,\n typeName: this.props.typeName,\n telemetry: this.props.telemetry,\n id: this.props.id,\n multiplePickUpEnabled,\n removePromoAriaLabelFormat: resources.removePromoAriaLabelFormat,\n orderSummaryHeading: ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\n cart?.hasInvoiceLine ? (\n

{resources.invoiceSummaryTitle}

\n ) : (\n

{resources.orderSummaryTitle}

\n )\n ) : null,\n orderSummaryLineitems: this._getOrderSummaryLineItems(),\n invoiceSummaryLineitems: this._getInvoiceSummaryLineItems(),\n checkoutAsSignInUserButton: !isCartEmpty ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton:\n !isCartEmpty && !isAuthenticated && this.props.config.showGuestCheckoutButton ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n expressCheckoutButton: !isCartEmpty ? this.props.slots.paymentExpress : null,\n ExpressCheckoutSectionWrapper: { className: 'msc-express-payment-container-in-cart-page' },\n backToShoppingButton: (\n \n {resources.backToShoppingButtonTitle}\n \n ),\n createTemplateFromCartButton:\n this._displayAddCartToTemplate() && products ? (\n \n ) : null,\n checkoutBlockedDueToUnavailableFunds: null,\n storeSelector:\n this.props.slots.storeSelector && this.props.slots.storeSelector.length > 0 ? this.props.slots.storeSelector[0] : null,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n waitingComponent: ,\n cartLoadingStatus: this.props.data.cart.status === 'FAILED' ? this.props.resources.cartLoadingErrorMessage : null,\n cartDataResult: this.props.data.cart.result && this.props.data.cart.result.isEmpty,\n OrderSummaryErrors: this._getOrderSummaryErrors(cartLines),\n telemetryContent: this.telemetryContent\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n /* eslint-enable complexity -- Disabling complexity for render method */\n\n /**\n * Promotion click event handler.\n * @param event - The mouse event.\n */\n private readonly promotionLinkClick = (event: React.MouseEvent) => {\n this.setState({\n showPromotionDialog: !this.state.showPromotionDialog\n });\n };\n\n /**\n * Promotion close button click.\n */\n private readonly promotionCloseButtonclick = () => {\n this._hidePromotionDialog();\n };\n\n /**\n * Hide promotion dialog.\n */\n private _hidePromotionDialog(): void {\n this.setState({\n showPromotionDialog: false\n });\n }\n\n /**\n * Display add to cart template.\n * @returns True if should display, false otherwise.\n */\n private _displayAddCartToTemplate(): boolean {\n const cart = this.props.data.cart?.result;\n if (ObjectExtensions.isNullOrUndefined(cart) || cart.hasInvoiceLine) {\n return false;\n }\n\n if (\n isChannelTypeB2B(this.props.context.actionContext.requestContext) &&\n this.props.data.orderTemplates.result &&\n ArrayExtensions.hasElements(cart.cart?.CartLines) &&\n this.props.data.customerInformation.result\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Get promotions.\n * @returns React node with the promotions.\n */\n private _getPromotions(): React.ReactNode {\n return (\n this.props.config.showAvailablePromotions &&\n cartPromotions({\n id: this.promotionPopupId,\n showPromotionPopup: this.state.showPromotionDialog,\n onSeeAllClick: this.promotionLinkClick,\n onCloseButtonClick: this.promotionCloseButtonclick,\n promotions: this.state.promotionData.promotionOptions,\n resources: {\n promotionStringHeading: this.props.resources.promotionStringHeading,\n promotionLinkText: this.props.resources.promotionLinkText,\n promotionPopupHeading: this.props.resources.promotionPopupHeading,\n promotionCloseButtonAriaLabel: this.props.resources.promotionCloseButtonAriaLabel\n }\n })\n );\n }\n\n /**\n * Add error message in cart line in case the quantity exceeds the current inventory.\n * @param cartLines - The cart lines.\n * @param cartLineInventoryValidationResult - The cart line inventory result.\n */\n private _updateCartLineErrorForInvalidInventory(\n cartLines: ICartlinesViewProps[] | null,\n cartLineInventoryValidationResult: ICartLineInventoryValidationResult\n ) {\n const { resources } = this.props;\n\n if (\n ArrayExtensions.hasElements(cartLines) &&\n !cartLineInventoryValidationResult.isValid &&\n ArrayExtensions.hasElements(cartLineInventoryValidationResult.productIdWithErrors)\n ) {\n for (const productIdWithError of cartLineInventoryValidationResult.productIdWithErrors) {\n const cartLine = cartLines?.find(element => element.data?.cartline.ProductId === productIdWithError);\n if (cartLine) {\n cartLine.error = resources.outOfStockErrorMessage;\n cartLine.hasError = true;\n }\n }\n }\n }\n\n /**\n * Get order summary errors.\n * @param cartLines - The cart lines.\n * @returns Order summary errors.\n */\n private _getOrderSummaryErrors(cartLines: ICartlinesViewProps[] | null): IOrderSummaryErrors | undefined {\n const allErrors =\n (cartLines &&\n cartLines\n .map(cartline => {\n // Check if the product is service or not by product type\n const isServiceItem = cartline.data?.product?.ItemTypeValue === ReleasedProductType.Service;\n\n if (!isServiceItem && cartline.error) {\n const fullError =\n cartline.data && cartline.data.product?.Name\n ? `${cartline.data.product.Name}: ${cartline.error}`\n : cartline.error;\n\n return (\n
\n {fullError}\n
\n );\n }\n\n return null;\n })\n .filter((line): line is JSX.Element => !!line)) ||\n [];\n\n return {\n Wrapper: {\n tag: Alert,\n className: 'msc-alert',\n isOpen: allErrors.length > 0,\n color: 'danger',\n assertive: true,\n 'aria-label': this.props.resources.outOfStockErrorMessageHeader\n },\n header: (\n \n ),\n errors: allErrors\n };\n }\n\n /**\n * Gets invoice summary line items.\n * @returns Invoice summary lines.\n */\n private _getInvoiceSummaryLineItems(): IInvoiceSummaryLines | undefined {\n const {\n data: {\n cart: { result: cart }\n },\n telemetry,\n resources\n } = this.props;\n\n return cart?.hasInvoiceLine\n ? InvoiceSummary({\n orderTotalLabel: resources.totalAmountLabel,\n invoiceLabel: resources.invoiceLabel,\n cart: cart.cart,\n context: this.props.context,\n typeName: this.props.typeName,\n telemetry,\n id: this.props.id\n })\n : undefined;\n }\n\n /**\n * Gets order summary line items.\n * @returns Order summary lines.\n */\n private _getOrderSummaryLineItems(): IOrderSummaryLines | undefined {\n const {\n data: {\n cart: { result: cart },\n channelDeliveryOptionConfig\n },\n telemetry,\n resources\n } = this.props;\n\n const channelConfiguration = this.props.context && this.props.context.request && this.props.context.request.channel;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const featureState = this.props?.data?.featureState;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(item => item.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n const isShowOrHideTaxEnabled = this.props.context.request.app.config?.isEnableShowOrHideSalesTaxECommerceEnabled === true;\n\n return channelConfiguration && ArrayExtensions.hasElements(cart?.cart.CartLines) && !cart?.hasInvoiceLine\n ? OrderSummary({\n cart: cart!.cart,\n subTotalLabel: resources.itemsWithCountLabel,\n shippingLabel: resources.estimatedShippingLabel,\n otherChargeLabel: resources.otherCharges,\n taxLabel: resources.estimatedTaxLabel,\n orderTotalLabel: resources.orderTotal,\n totalDiscountsLabel: resources.totalDiscountsLabel,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n toBeCalculatedText: resources.yetToBeCalculatedText,\n freeText: resources.priceFree,\n channelConfiguration,\n retailMultiplePickUpOptionEnabled,\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\n telemetry,\n isTaxIncludedInPrice: cart!.cart.IsTaxIncludedInPrice,\n isShowTaxBreakup: isShowOrHideTaxEnabled\n })\n : undefined;\n }\n\n /**\n * Gets promo code.\n * @returns React node with the promo code.\n */\n private _getPromoCode(): React.ReactNode {\n const {\n data: {\n cart: { result: cart }\n },\n resources\n } = this.props;\n\n return (\n cart && (\n \n )\n );\n }\n\n /**\n * Generate add to order template dialog resources.\n * @param resources - The resources.\n * @returns IAddToOrderTemplateDialogResources.\n */\n private _generateAddToOrderTemplateDialogResources(resources: ICartResources): IAddToOrderTemplateDialogResources {\n return {\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\n\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\n\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\n\n selectTemplatesText: resources.selectTemplatesText,\n addToTemplateButtonText: resources.addToTemplateButtonText,\n lineItemsText: resources.lineItemsText\n };\n }\n\n /**\n * Generate item added to order template dialog resources.\n * @param resources - The resources.\n * @returns IItemAddedToOrderTemplateDialogResources.\n */\n private _generateItemAddedToOrderTemplateDialogResources(resources: ICartResources): IItemAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\n freePriceText: resources.freePriceText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText\n };\n }\n\n /**\n * Generate lines added to order template dialog resources.\n * @param resources - The resources.\n * @returns ILinesAddedToOrderTemplateDialogResources.\n */\n private _generateLinesAddedToOrderTemplateDialogResources(resources: ICartResources): ILinesAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n linesAddedToOrderTemplateHeaderItemsOneText: resources.linesAddedToOrderTemplateHeaderItemsOneText,\n linesAddedToOrderTemplateHeaderItemsFormatText: resources.linesAddedToOrderTemplateHeaderItemsFormatText,\n linesAddedToOrderTemplateHeaderLinesOneText: resources.linesAddedToOrderTemplateHeaderLinesOneText,\n linesAddedToOrderTemplateHeaderLinesFormatText: resources.linesAddedToOrderTemplateHeaderLinesFormatText,\n linesAddedToOrderTemplateHeaderMessageText: resources.linesAddedToOrderTemplateHeaderMessageText,\n linesAddedToOrderTemplateCustomPriceAlertMessageText: resources.linesAddedToOrderTemplateCustomPriceAlertMessageText\n };\n }\n\n /**\n * Generate duplicate items when adding to order template dialog resources.\n * @param resources - The resources.\n * @returns IDuplicateItemsWhenAddingToOrderTemplateDialogResources.\n */\n private _generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources: ICartResources\n ): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\n return {\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\n updateQuantityButtonText: resources.updateQuantityButtonText,\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\n };\n }\n\n /**\n * Generate order template name dialog resources.\n * @param resources - The resources.\n * @returns IOrderTemplateNameDialogResources.\n */\n private _generateOrderTemplateNameDialogResources(resources: ICartResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\n orderTemplateDescription: resources.createOrderTemplateDescription,\n\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\n };\n }\n\n /**\n * Gets the cart lines view props.\n * @returns ICartlinesViewProps [].\n */\n private _getCartLines(): ICartlinesViewProps[] | null {\n const {\n data: {\n cart: { result: cart },\n wishlists: { result: wishlists },\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources,\n modules\n } = this.props;\n\n const imageSettings = this.getImageSettings(config.imageSettings);\n\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n const multiplePickUpEnabled = RetailMultiplePickupFeatureState?.IsEnabled;\n\n const cartlinesErrors: CartLineValidationResultsByLineId = this.state.cartlinesErrors;\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const isMultipleCatalogsFeatureEnabled =\n this.props.data.featureState.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled ||\n false;\n return ArrayExtensions.hasElements(cart?.cart.CartLines)\n ? CartLineItems({\n cartlines: cart!.cart.CartLines,\n storeSelectorModuleId: storeSelectorId,\n cartlinesErrors,\n products: this.props.data.products.result,\n productAvailabilites: this.props.data.productAvailabilites.result,\n productDeliveryOptions: this.props.data.deliveryOptions.result,\n catalogs: this.props.data.catalogs?.result,\n imageSettings,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n retailMulitplePickupFeatureState: multiplePickUpEnabled,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n amountString: resources.productDimensionTypeAmount,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\n discountStringText: resources.discountStringText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n shippingChargesText: resources.shippingCharges,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n priceEditorResources: {\n ...resources\n }\n },\n telemetry,\n addToWishlistButtonText: resources.addToWishlistButtonText,\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\n removeButtonText: resources.removeCartButtonText,\n shipItText: resources.shipInsteadDisplayText,\n pickitUpText: resources.pickItUpDisplayText,\n changeStoreText: resources.changeStoreDisplayText,\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\n outOfStockText: resources.outOfStockErrorMessage,\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\n cartState: this.props.data.cart.result,\n orgUnitLocations: this.props.data.orgUnitLocations.result,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\n wishlists,\n defaultWishlistName: resources.defaultWishlistName,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n includeErrors: config.showOutOfStockErrors,\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\n telemetryContent: this.telemetryContent,\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\n\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources\n ),\n\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\n orderTemplates,\n customerInformation,\n productAvailability: this.props.data.productAvailabilites,\n isMultipleCatalogFeatureEnabledInHq: isMultipleCatalogsFeatureEnabled || false\n })\n : null;\n }\n\n /**\n * Gets the checkout URL.\n * @param isAuthenticated - Is authenticated flag.\n * @param guestCheckoutUrl - Guest checkout URL.\n * @param signInUrl -The sign in URL.\n * @returns The checkout URL.\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 (MsDyn365.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Gets the image settings.\n * @param imageSettings - Image settings.\n * @returns IImageSettings.\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 /**\n * Remove item from cart handler.\n * @param cartlineToRemove - The cart line to remove.\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\n .removeCartLines(input)\n .then(() => {\n this.validateCart().catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n })\n .catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n /**\n * Move to wish list handler.\n * @param result - The wish list action success result.\n * @param cartline - The cart line.\n */\n private readonly moveToWishlistSuccessHandler = (result: IWishlistActionSuccessResult, cartline?: CartLine) => {\n if (result.status === 'ADDED' && cartline) {\n this.removeItemFromCartHandler(cartline);\n }\n };\n\n /**\n * Updates the cart line quantity.\n * @param cartlineToUpdate - The cart line.\n * @param quantity - The quantity.\n * @param lineIndex - The line index.\n * @returns True if the cart line was updated, false otherwise.\n */\n private readonly updateCartlineQuantity = (cartlineToUpdate: CartLine, quantity: number, lineIndex?: number): boolean => {\n cartLineQuantityUpdatedAsync(\n this.isQuantityLimitsFeatureEnabled,\n this.props.data.cart.result,\n this.props.telemetry,\n this.props.data.products.result,\n cartlineToUpdate,\n quantity\n )\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\n if (cartActionResult?.status === 'SUCCESS') {\n this.validateCart().catch(error => {\n this.props.telemetry.warning((error as Error).message);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n this.setState({\n cartlinesErrors: {}\n });\n return true;\n }\n\n if (!ObjectExtensions.isNullOrUndefined(cartActionResult)) {\n // Show update line error message.\n const lineUpdateFailure: LineValidationResult = {\n LineId: ObjectExtensions.isNullOrUndefined(cartlineToUpdate.LineId) ? '0' : cartlineToUpdate.LineId,\n ValidationFailures: [\n {\n ErrorContext: ArrayExtensions.hasElements(cartActionResult.validationResults)\n ? cartActionResult.validationResults[0].ErrorContext\n : '',\n LocalizedMessage: cartActionResult.errorDetails?.LocalizedMessage\n }\n ]\n };\n\n this.setState({\n cartlinesErrors: { ValidationResultsPairs: [lineUpdateFailure] }\n });\n }\n\n return false;\n })\n .catch(() => {\n return false;\n });\n\n return false;\n };\n\n /**\n * Fulfillment store id is updated.\n */\n private readonly fulfillmentStoreIdUpdated = () => {\n if (this.isQuantityLimitsFeatureEnabled) {\n // Refresh products (in props.data) based on latest cart.\n getActiveCartProductsAction(new ActiveCartProductsInput(), this.props.context.actionContext)\n .then(async () => this.validateCart())\n .catch((error: Error) => {\n this.props.telemetry.warning(error.message);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n }\n };\n\n /**\n * Validates cart.\n * @returns Void promise.\n */\n private async validateCart(): Promise {\n if (!this.isQuantityLimitsFeatureEnabled) {\n this.setState({ cartlinesErrors: {}, isCartValid: true });\n return AsyncResult.resolve();\n }\n\n const {\n data: { cart },\n telemetry,\n context\n } = this.props;\n\n const validationResults: CartLineValidationResultsByLineId | undefined = await validateCartAsync(cart, telemetry, context, true);\n\n if (validationResults) {\n const isValid = !ArrayExtensions.hasElements(validationResults.ValidationResultsPairs);\n this.setState({\n cartlinesErrors: validationResults,\n isCartValid: isValid\n });\n } else {\n this.setState({ cartlinesErrors: {}, isCartValid: true });\n }\n\n return AsyncResult.resolve();\n }\n\n /**\n * Get order quantity limit feature flag.\n * @returns True if flag is enabled, false otherwise.\n */\n private async getOrderQuantityLimitsFeatureFlag(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n try {\n const isQuantityLimitsFeatureEnabledInHq =\n featureStatuses.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\n )?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n return false;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n return false;\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 === 'none') {\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n\n try {\n const customerInfo = await this.props.data.customerInformation;\n return (\n !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\n );\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n return false;\n }\n } else {\n const cartConfiguration = await this.props.data.cartConfiguration;\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\n }\n }\n\n private async _isChannelLimitsFeatureEnabled(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\n )?.IsEnabled;\n\n return isChannelLimitsFeatureEnabledInHq ?? false;\n }\n\n /**\n * Gets the cart lines group.\n * @returns ICartlinesViewProps [][].\n */\n private getCartLinesGroup(): ICartlinesViewProps[][] | null {\n const {\n data: {\n cart: { result: cart },\n wishlists: { result: wishlists },\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources,\n modules\n } = this.props;\n\n const imageSettings = this.getImageSettings(config.imageSettings);\n const cartlinesErrors: CartLineValidationResultsByLineId = this.state.cartlinesErrors;\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n const multiplePickUpEnabled = RetailMultiplePickupFeatureState?.IsEnabled;\n const { featureState } = this.props.data;\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const isMultipleCatalogsFeatureEnabled =\n featureState.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n return this.props.data.products &&\n (cart?.hasInvoiceLine || this.props.data.products.result) &&\n cart &&\n cart.cart.CartLines &&\n cart.cart.CartLines.length > 0 &&\n this.props.data.channelDeliveryOptionConfig?.result\n ? CartLineGroupItems({\n cartlines: cart.cart.CartLines,\n storeSelectorModuleId: storeSelectorId,\n cartlinesErrors,\n products: this.props.data.products.result,\n productAvailabilites: this.props.data.productAvailabilites.result,\n productDeliveryOptions: this.props.data.deliveryOptions.result,\n catalogs: this.props.data.catalogs?.result,\n imageSettings,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n hasInvoiceLine: cart?.hasInvoiceLine || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n retailMulitplePickupFeatureState: multiplePickUpEnabled,\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 amountString: resources.productDimensionTypeAmount,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\n discountStringText: resources.discountStringText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n shippingChargesText: resources.shippingCharges,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n priceEditorResources: {\n ...resources\n }\n },\n telemetry,\n addToWishlistButtonText: resources.addToWishlistButtonText,\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\n removeButtonText: resources.removeCartButtonText,\n shipItText: resources.shipInsteadDisplayText,\n pickitUpText: resources.pickItUpDisplayText,\n changeStoreText: resources.changeStoreDisplayText,\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\n outOfStockText: resources.outOfStockErrorMessage,\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\n cartState: this.props.data.cart.result,\n orgUnitLocations: this.props.data.orgUnitLocations.result,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\n wishlists,\n defaultWishlistName: resources.defaultWishlistName,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n includeErrors: config.showOutOfStockErrors,\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\n telemetryContent: this.telemetryContent,\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\n\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources\n ),\n\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\n orderTemplates,\n customerInformation,\n channelDeliveryOptionConfig: this.props.data.channelDeliveryOptionConfig?.result,\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\n productAvailability: this.props.data.productAvailabilites,\n productPickUpOptions: this.state.productPickUpOptions || this.props.data.cartLinesPickUpOptions?.result,\n isMultipleCatalogFeatureEnabledInHq: isMultipleCatalogsFeatureEnabled || false\n })\n : null;\n }\n}\n\nexport default Cart;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface ICartLineItemPromotion {\n id: string;\n showPromotionPopup: boolean;\n promotions: CartPromotionLine[] | undefined;\n resources: ICartLineItemPromotionResourceString;\n onSeeAllClick(event: React.MouseEvent): void;\n onCloseButtonClick(): void;\n}\n\nexport interface ICartLineItemViewProps {\n promotionMessageWrapper: INodeProps;\n promotionMessage: React.ReactNode;\n promotionSeeAllLink: React.ReactElement;\n promotionDialog: React.ReactNode;\n}\n\nexport interface ICartLineItemPromotionResourceString {\n promotionLinkText: string;\n promotionStringHeading: string;\n promotionPopupHeading: string;\n promotionCloseButtonAriaLabel: string;\n}\n\nexport const cartPromotions = (props: ICartLineItemPromotion): ICartLineItemViewProps | undefined => {\n const {\n id,\n showPromotionPopup,\n promotions,\n resources: { promotionLinkText, promotionPopupHeading },\n onCloseButtonClick,\n onSeeAllClick\n } = props;\n\n if (!ArrayExtensions.hasElements(promotions)) {\n return;\n }\n\n const titleId = `${id}_title`;\n const className = 'msc-cart__promotion';\n return {\n promotionMessageWrapper: {\n className: 'msc-cart__promotion'\n },\n promotionMessage: (\n <>\n \n {props.resources.promotionStringHeading}\n \n ),\n promotionSeeAllLink: (\n \n {` `}\n {promotionLinkText} {` `}\n \n ),\n promotionDialog: (\n \n \n
\n {promotionPopupHeading}\n
\n
\n \n
    \n {promotions.map(_promotion => {\n return (\n
  • \n {_promotion.Promotion?.OfferName} {` `}\n
  • \n );\n })}\n
\n
\n \n
\n )\n };\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","import { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ICartMethodChangeProps{\r\n className: string;\r\n HeaderText: string;\r\n BodyText: string;\r\n modalOpen: boolean | undefined;\r\n onClose(): void;\r\n}\r\n\r\nexport const CartMethodChangeDialog = (dialogProps: ICartMethodChangeProps) => {\r\n const {\r\n\r\n className,\r\n BodyText,\r\n HeaderText,\r\n modalOpen\r\n\r\n } = dialogProps;\r\n\r\n const close: () => void = () => {\r\n dialogProps.onClose();\r\n };\r\n\r\n return (\r\n \r\n \r\n {HeaderText}\r\n \r\n \r\n {/*

Your cart contains items with a mix of 'Delivery‘ and 'Store Pick-up‘ delivery options. Please make sure all items are either 'Delivery‘ or 'Store Pick-up‘ before continuing to checkout.

*/}\r\n
\r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n );\r\n};\r\n\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IInvoiceSummaryLines } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport { IOrderSummaryLines } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICartViewProps, IOrderSummaryErrors } from './cart';\nimport { ICartlinesViewProps } from './components/cart-line-items';\nimport { ICartLineItemViewProps } from './components/cart-line-items-promotion';\n\nconst _renderCartlines = (\n cartLines: ICartlinesViewProps[] | undefined,\n cartEmptyText: string,\n CartlinesWrapper: INodeProps,\n storeSelector: React.ReactNode | undefined,\n backToShoppingButton: React.ReactNode,\n waitingComponent: React.ReactNode,\n cartLoadingStatus: string,\n cartDataResult: boolean\n): JSX.Element[] | JSX.Element => {\n if (cartLoadingStatus) {\n return <>{cartLoadingStatus};\n }\n if (cartLines) {\n return cartLines.map(cartLine => {\n return (\n
\n {cartLine.cartline}\n {storeSelector && cartLine.pickUpInStore ? (\n {cartLine.pickUpInStore.defaultComponent}\n ) : null}\n {cartLine.addToOrderTemplate ? (\n \n {cartLine.remove}\n {cartLine.addToWishlist}\n {cartLine.addToOrderTemplate}\n \n ) : (\n <>\n {cartLine.remove}\n {cartLine.addToWishlist}\n \n )}\n
\n );\n });\n }\n return cartDataResult ? (\n
\n

{cartEmptyText}

\n {backToShoppingButton}\n
\n ) : (\n <>{waitingComponent}\n );\n};\n\n/**\n * Method will render error block.\n * @param errorData -The order summary errors interface.\n * @returns Jsx element.\n */\nconst _renderErrorBlock = (errorData: IOrderSummaryErrors | undefined): JSX.Element | null => {\n if (!errorData || !ArrayExtensions.hasElements(errorData.errors)) {\n return null;\n }\n return (\n \n {errorData.header}\n {errorData.errors}\n \n );\n};\n\n/**\n * Method will render invoice summary lines.\n * @param invoiceSummaryLines -The invoicesummary lines interface.\n * @param OrderSummaryItems -The order summary items props.\n * @param props -The cartview props.\n * @returns Jsx element.\n */\nconst _renderInvoiceSummarylines = (\n invoiceSummaryLines: IInvoiceSummaryLines | undefined,\n OrderSummaryItems: INodeProps,\n props: ICartViewProps\n): JSX.Element | null => {\n if (!invoiceSummaryLines) {\n props.context.telemetry.error('InvoiceSummary content is empty, module wont render');\n return null;\n }\n return (\n \n {invoiceSummaryLines.invoices}\n {invoiceSummaryLines.giftCard}\n {invoiceSummaryLines.loyalty}\n {invoiceSummaryLines.orderTotal}\n \n );\n};\n\n/**\n * Method will render order summary lines.\n * @param orderSummaryLines -The ordersummary lines interface.\n * @param OrderSummaryItems -The order summary items props.\n * @param props -The cartview props.\n * @returns Jsx element.\n */\nconst _renderOrderSummarylines = (\n orderSummaryLines: IOrderSummaryLines | undefined,\n OrderSummaryItems: INodeProps,\n props: ICartViewProps\n): JSX.Element | null => {\n if (!orderSummaryLines) {\n props.context.telemetry.error('OrderSummary content is empty, module wont render');\n return null;\n }\n return (\n \n {props.promoCode}\n {orderSummaryLines.subtotal}\n {orderSummaryLines.shipping}\n {orderSummaryLines.otherCharge}\n {orderSummaryLines.tax}\n {orderSummaryLines.totalDiscounts ? orderSummaryLines.totalDiscounts : null}\n {orderSummaryLines.orderTotal}\n \n );\n};\n\n/**\n * Method will render cart promotions.\n * @param promotions -The cartline item view props.\n * @returns Jsx element.\n */\nconst _renderPromotions = (promotions: ICartLineItemViewProps): JSX.Element | undefined => {\n return (\n <>\n \n {promotions.promotionMessage}\n {promotions.promotionSeeAllLink}\n {promotions.promotionDialog}\n \n \n );\n};\n\n/**\n * Method will render cartlines group title.\n * @param cartLine -The cartline view props.\n * @param titleSeparate -The title separate.\n * @returns Jsx element.\n */\nconst renderCartLinesGroupTitle = (cartLine: ICartlinesViewProps, titleSeparate: string) => {\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\n return (\n <>\n \n {isBopisSelected ? (\n

\n {cartLine.pickUpInStore?.deliveryOption}\n {titleSeparate}\n {cartLine.pickUpInStore?.orgUnitName}\n

\n ) : null}\n
\n \n );\n};\n\n/**\n * Method will render cartlines groups header title.\n * @param pickUpText -The pickup text for group.\n * @param shippingText -The shipping text for group.\n * @param emailShippingText -The email shipping text for group.\n * @param titleSeparate -The title separator.\n * @param cartLine -The cartline view props.\n * @param emailDeliveryModeCode -The email delivery code from channel.\n * @returns Jsx element.\n */\nconst renderCartLinesGroupHeader = (\n pickUpText: string,\n shippingText: string,\n emailShippingText: string,\n titleSeparate: string,\n cartLine: ICartlinesViewProps,\n emailDeliveryModeCode?: string\n) => {\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\n let groupTitle: string;\n\n groupTitle = isBopisSelected ? pickUpText : shippingText;\n if (!StringExtensions.isNullOrEmpty(emailDeliveryModeCode)) {\n groupTitle = cartLine.data && cartLine.data.cartline.DeliveryMode === emailDeliveryModeCode ? emailShippingText : groupTitle;\n }\n\n return (\n <>\n
\n

\n

{groupTitle}

\n {renderCartLinesGroupTitle(cartLine, titleSeparate)}\n
\n \n );\n};\n\n/**\n * Method will render cartlines in groups.\n * @param props -The cartline.\n * @returns Jsx element.\n */\nconst renderCartLinesGroup = (props: ICartViewProps): JSX.Element | undefined => {\n if (props.cartLinesGroup && ArrayExtensions.hasElements(props.cartLinesGroup)) {\n return (\n
\n {props.cartLinesGroup.map(cartlines => {\n return (\n
\n {renderCartLinesGroupHeader(\n props.resources.pickUpText,\n props.resources.shippingText,\n props.resources.emailshippingText,\n props.resources.titleSeparate,\n cartlines[0],\n props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode\n )}\n {_renderCartlines(\n cartlines,\n props.resources.emptyCartText,\n props.CartlinesWrapper,\n props.storeSelector,\n props.backToShoppingButton,\n props.waitingComponent,\n props.cartLoadingStatus,\n props.cartDataResult\n )}\n
\n );\n })}\n
\n );\n }\n return props.cartDataResult ? (\n
\n
\n

{props.resources.emptyCartText}

\n {props.backToShoppingButton}\n
\n
\n ) : (\n <>{props.waitingComponent}\n );\n};\n\nconst CartView: React.FC = (props: ICartViewProps) => (\n
\n {props.title}\n {!props.cart?.hasInvoiceLine && props.promotionOptions && _renderPromotions(props.promotionOptions)}\n {props.multiplePickUpEnabled ? (\n renderCartLinesGroup(props)\n ) : (\n \n {_renderCartlines(\n props.cartlines,\n props.resources.emptyCartText,\n props.CartlinesWrapper,\n props.storeSelector,\n props.backToShoppingButton,\n props.waitingComponent,\n props.cartLoadingStatus,\n props.cartDataResult\n )}\n \n )}\n {props.orderSummaryHeading && (\n \n {props.orderSummaryHeading}\n {props.cart?.hasInvoiceLine\n ? _renderInvoiceSummarylines(props.invoiceSummaryLineitems, props.OrderSummaryItems, props)\n : _renderOrderSummarylines(props.orderSummaryLineitems, props.OrderSummaryItems, props)}\n {_renderErrorBlock(props.OrderSummaryErrors)}\n {props.checkoutAsSignInUserButton}\n {props.checkoutAsGuestButton}\n {props.expressCheckoutButton && ArrayExtensions.hasElements(props.expressCheckoutButton) ? (\n {props.expressCheckoutButton}\n ) : null}\n {props.backToShoppingButton}\n {props.createTemplateFromCartButton}\n \n )}\n {props.storeSelector}\n
\n);\n\nexport default CartView;\n"],"names":["SearchOrgUnitLocationsInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","createSearchOrgUnitLocationsInputFunc","inputData","async","getSearchOrgUnitLocationsAction","input","context","searchOrgUnitLocationsAsync","callerContext","retailActionDataAction","createObservableDataAction","id","action","InvoiceSummaryLine","_ref","price","label","typeName","toBeCalculatedText","freeText","cssLabel","React","className","PriceComponent","data","CustomerContextualPrice","freePriceText","_buildPaymentSummarySection","props","telemetry","_computedLoyaltyAmount","checkoutState","loyaltyAmount","InvoiceSummary","TotalAmount","CartLines","cart","invoiceLines","filter","cartLine","IsInvoiceLine","reactNodes","invoices","map","invoiceLine","InvoiceAmount","format","invoiceLabel","InvoiceId","orderTotal","orderTotalLabel","giftCardAmount","_computeGiftCardAmount","giftCardTotalValue","giftCardExtends","reduce","giftCardCounter","count","giftCard","Balance","amount","Math","min","totalAmountAfterGiftCard","loyalty","loyaltyLabel","giftcardLabel","_objectSpread","undefined","validateCartAsync","propsContext","cartResult","cartVersion","shouldRetry","arguments","length","Version","error","warning","debug","AsyncResult","resolve","_validationResult$Val","validationResult","CartsDataActions","actionContext","bypassCache","Id","ValidationResultsByLineId","name","refreshCart","refreshError","validateError","cartLineQuantityUpdatedAsync","isQuantityLimitsFeatureEnabled","products","cartLineToUpdate","quantity","isUsingDefaultOrderSettingsMax","ArrayExtensions","hasElements","_modifiedProduct$Beha2","modifiedProduct","find","product","RecordId","ProductId","Behavior","MaximumQuantity","cartLineId","LineId","toString","newQuantity","additionalProperties","updateLineResult","updateCartLineQuantity","message","OrderSummaryLine","priceCurrency","currencyCode","_buildOrderSummarySection","channelConfiguration","Currency","getDeliveryMode","deliveryMode","_channelDeliveryOptio","featureSate","channelDeliveryOptionConfig","pickupDeliveryMode","PickupDeliveryModeCodes","dM","OrderSummary","SubtotalAmount","SubtotalAmountWithoutTax","TaxAmount","TaxOnNonShippingCharges","DiscountAmount","OtherChargeAmount","canShip","hasDeliveryMethod","hasShippingMethod","freightFee","getDeliveryConfiguration","retailMultiplePickUpOptionEnabled","isTaxIncludedInPrice","isShowTaxBreakup","pickupDeliveryModeCode","PickupDeliveryModeCode","emailDeliveryModeCode","EmailDeliveryModeCode","deliveryModes","DeliveryMode","taxOnShippingCharge","TaxOnShippingCharge","shippingChargeAmount","ShippingChargeAmount","some","subtotal","subTotalLabel","tax","taxLabel","otherCharge","otherChargeLabel","otherChargeAmount","taxOnNonShippingCharges","isTaxGreaterThanZero","otherChargeAmountTotal","subtotalAmountActual","shipping","shippingLabel","customerAccountAmount","customerAccount","customerAccountLabel","totalDiscounts","totalDiscountsLabel","ProductPickUpOptionsForCartLineItems","apiSettings","buildCacheKey","this","getPickUpOptionsForCartLineItems","channelId","Error","getCartState","getActiveCartProductsAction","ActiveCartProductsInput","response","Promise","ProductsDataActions","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","requestContext","getProductByProductId","productId","getProductByProductIdAndWarehouse","warehouseId","cartState","targetWarehouseValue","WarehouseId","_product$Behavior","InventoryLocationId","PickUpInStore","_toggleBOPIS","isBopisSelected","storeSelectorStateManager","cartline","storeSelectorModuleId","openDialog","alreadySelectedLocation","OrgUnitNumber","FulfillmentStoreId","deliveryOptions","onLocationSelected","orgUnitLocation","updateCartLinePickupLocation","location","then","result","status","locationChangedHandler","catch","_onLocationChangedCallback","ShippingAddress","clearCartLinePickupLocation","_getOrgUnitName","fulfillmentStoreId","orgUnitLocations","foundLocation","OrgUnitName","DeliveryOptions","_props$channelDeliver","retailMulitplePickupFeatureState","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","pickup","deliveryCode","Code","push","option","callbacks","toggleBopis","defaultComponent","_renderShippingMethod","shipItText","pickupInStoretext","changeStoreText","orgUnitName","bopisSelected","toggleBOPIS","type","onChange","value","checked","key","onClick","shipitText","pickUpInStoreText","_getDeliveryOption","pickupStore","_deliveryOptions$Deli","Description","ContainerProps","_assembleNode","index","foundProductAvailability","productPickUpOptions","_foundProductAvailabi","_product$Dimensions","_props$cartState","_context$request$chan","imageSettings","gridSettings","resources","removeButtonText","removeItemClickHandler","moveToWishlistSuccessHandler","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","addToWishlistButtonText","removeFromWishlistButtonText","orderTemplates","customerInformation","wishlists","defaultWishlistName","isMultipleCatalogFeatureEnabledInHq","isAuthenticated","request","user","nameOfWishlist","Name","availableQuantityInStock","isStockCheckEnabled","productAvailability","ProductAvailableQuantity","IsProductAvailable","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","_getCartItemMaxQuantity","maxQuantityByConfig","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","maxCartlineQuantity","shouldSkipStockCheck","ItemTypeValue","ReleasedProductType","Service","errorMessage","ObjectExtensions","isNullOrUndefined","_getErrorMessage","currentQuantity","lineId","_props$productAvailab","finalErrorMessages","productAvailabilites","outOfStockText","includeErrors","outOfRangeOneText","outOfRangeFormatText","replace","checkForErrors","cartlinesErrors","ValidationResultsPairs","errorsFoundByLineId","i","ValidationFailures","forEach","validation","ErrorContext","join","Quantity","onRemoveClickHandler","onRemoveClickFunction","payload","getPayloadObject","TelemetryEvent","RemoveFromCart","telemetryContent","attributes","getTelemetryAttributes","inventoryLbl","StockLevelLabel","inventoryCode","StockLevelCode","toLowerCase","isCustomPriceSelected","Dimensions","dimension","DimensionTypeValue","DimensionValue","Value","productUrl","getProductUrlSync","MsDyn365","isBrowser","isChannelTypeB2B","_cartline$CatalogId","fullUrl","URL","window","href","searchParams","set","CatalogId","getInvoiceDetailsPageUrlSync","cartlineId","hasError","StringExtensions","isNullOrEmpty","CartLineItemComponent","catalogs","isOutOfStock","lineIndex","isQuantityEditable","quantityOnChange","updateCartLinesQuantitySuccessHandler","primaryImageUrl","PrimaryImageUrl","inventoryInformationLabel","inventoryLabelClassName","isCartStateReady","showShippingChargesForLineItems","channel","pickUpInStore","pickitUpText","remove","Button","Object","assign","title","addToWishlist","AddToWishlistComponent","showButtonText","showStatusMessage","showRemoveButton","showButtonTooltip","ariaRole","onSuccess","addToOrderTemplate","AddToOrderTemplateComponent","classnames","shouldShowButtonFailedTooltip","disableButton","app","config","disableTooltip","catalogId","assembleCartlines","cartlines","isPickUpItem","isCartLineItemPickUpType","_productAvailability$","_productAvailability$2","_cartline$WarehouseId","shouldIgnoreWarehouse","InventLocationId","toUpperCase","CartLineGroupItems","hasInvoiceLine","_assembleGroupInvoiceCartlines","cartLines","carLineViewProps","_assembleGroupCartlines","getGroupByStorePickup","items","groupBy","item","groupDelivery","cartLinesGroup","entries","deliveryType","groupByDeliveryType","keys","getPromotionData","ctx","promotionData","getPromotionOptionsForCartLineItems","PromotionOptionsForCartLineItems","promotionOptions","exception","Cart","super","_isMounted","promotionPopupId","promotionLinkClick","event","setState","showPromotionDialog","state","promotionCloseButtonclick","_hidePromotionDialog","getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","removeItemFromCartHandler","cartlineToRemove","cartLineIds","removeCartLines","validateCart","updateCartlineQuantity","cartlineToUpdate","cartActionResult","_cartActionResult$err","lineUpdateFailure","validationResults","LocalizedMessage","errorDetails","fulfillmentStoreIdUpdated","getTelemetryObject","telemetryPageName","friendlyName","payLoad","bind","isCartValid","_this$props$data$cart","getOrderQuantityLimitsFeatureFlag","_isChannelLimitsFeatureEnabled","showAvailablePromotions","reaction","_this$props$data$cart2","_this$props$data$cart3","componentWillUnmount","shouldComponentUpdate","nextProps","nextState","render","_this$props$context$r","_cart$cart$CartLines","_this$props$data$prod","_this$props$data$feat","_featureState$result","signInUrl","guestCheckoutUrl","getUrlSync","backToShoppingUrl","checkoutURL","getCheckoutURL","isCartEmpty","_getCartLines","validInventoryAcrossCartLines","validateCartLinesInventory","isValid","RetailMultiplePickupFeatureState","featureState","multiplePickUpEnabled","IsEnabled","isMultipleCatalogsFeatureEnabled","currentCatalogId","getCatalogId","validateCatalogId","getCartLinesGroup","contentAction","etext","TelemetryConstant","Checkout","checkoutBySignInAttributes","GuestCheckout","checkoutByGuestAttributes","BackToShopping","backtoShoppingAttributes","cartLineGroup","_updateCartLineErrorForInvalidInventory","viewProps","cartTitle","CartlinesWrapper","OrderSummaryWrapper","OrderSummaryItems","promoCode","_getPromoCode","_getPromotions","removePromoAriaLabelFormat","orderSummaryHeading","invoiceSummaryTitle","orderSummaryTitle","orderSummaryLineitems","_getOrderSummaryLineItems","invoiceSummaryLineitems","_getInvoiceSummaryLineItems","checkoutAsSignInUserButton","disabled","checkoutButtonTitle","checkoutAsGuestButton","showGuestCheckoutButton","guestCheckoutButtonTitle","expressCheckoutButton","slots","paymentExpress","ExpressCheckoutSectionWrapper","backToShoppingButton","backToShoppingButtonTitle","createTemplateFromCartButton","_displayAddCartToTemplate","SaveCartToOrderTemplateComponent","_generateAddToOrderTemplateDialogResources","_generateOrderTemplateNameDialogResources","linesAddedToOrderTemplateDialogResources","_generateLinesAddedToOrderTemplateDialogResources","_generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","createOrderTemplateFromCartButton","createOrderTemplateFromCartButtonTooltip","checkoutBlockedDueToUnavailableFunds","storeSelector","waitingComponent","Waiting","cartLoadingStatus","cartLoadingErrorMessage","cartDataResult","isEmpty","OrderSummaryErrors","_getOrderSummaryErrors","renderView","_this$props$data$cart4","_cart$cart","showPromotionPopup","promotions","promotionLinkText","promotionPopupHeading","onCloseButtonClick","onSeeAllClick","titleId","promotionMessageWrapper","promotionMessage","promotionStringHeading","promotionSeeAllLink","tabIndex","role","promotionDialog","Modal","isOpen","toggle","ModalHeader","ModalBody","_promotion","_promotion$Promotion","Promotion","OfferName","ModalFooter","cartPromotions","promotionCloseButtonAriaLabel","cartLineInventoryValidationResult","productIdWithErrors","productIdWithError","element","_element$data","outOfStockErrorMessage","allErrors","_cartline$data","_cartline$data$produc","fullError","line","Wrapper","tag","Alert","color","assertive","outOfStockErrorMessageHeader","header","errors","totalAmountLabel","_this$props","_featureState$result2","_this$props$context$r2","isShowOrHideTaxEnabled","isEnableShowOrHideSalesTaxECommerceEnabled","itemsWithCountLabel","estimatedShippingLabel","otherCharges","estimatedTaxLabel","yetToBeCalculatedText","priceFree","IsTaxIncludedInPrice","PromoCodeComponent","promoCodeHeadingText","promoPlaceholderText","promoCodeApplyButtonText","appliedPromoCodeHeadingText","collapseTimeOut","removePromoText","invalidPromoCodeErrorText","failedToAddPromoCodeErrorText","failedToRemovePromoCodeErrorText","duplicatePromoCodeErrorText","duplicatePromotionErrorText","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","_generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","originalPriceText","currentPriceText","linesAddedToOrderTemplateHeaderItemsOneText","linesAddedToOrderTemplateHeaderItemsFormatText","linesAddedToOrderTemplateHeaderLinesOneText","linesAddedToOrderTemplateHeaderLinesFormatText","linesAddedToOrderTemplateHeaderMessageText","linesAddedToOrderTemplateCustomPriceAlertMessageText","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","_this$props$data$feat2","_this$props$data$feat3","_this$props$data$cata","modules","storeSelectorId","CartLineItems","productDeliveryOptions","enableStockCheck","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","warehouseAggregation","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","amountString","productDimensionTypeAmount","quantityDisplayString","quantityDisplayText","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","discountStringText","shippingChargesText","shippingCharges","salesAgreementPricePrompt","priceEditorResources","removeCartButtonText","shipInsteadDisplayText","pickItUpDisplayText","changeStoreDisplayText","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","showOutOfStockErrors","addToOrderTemplateMessage","addItemToOrderTemplateError","isAbsoluteUrl","urlCheck","returnURL","origin","includes","_featureStatuses$find2","featureStatuses","_featureStatuses$find","_cartConfiguration$Ig","cartConfiguration","IgnoreOrderSettings","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","IsB2b","_featureStatuses$find3","isChannelLimitsFeatureEnabledInHq","_this$props$data$feat4","_featureState$result3","_this$props$data$chan","_this$props$data$cata2","_this$props$data$chan2","_this$props$data$cart5","cartLinesPickUpOptions","__decorate","observer","_renderDeliveryLocation","deliverylocation","_foundProductDelivery","foundProductDeliveryOption","shippingText","_renderStoreLocation","_assembleCartlines","foundProductDeliveryOptions","outOfStockThreshold","isServiceItem","RemoveCartItem","removeCartItemAttribute","displayMode","deliveryLocation","storeLocation","getMiniCartData","miniCartData","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","availableQuantity","getDeliveryOptionsForCartLineItems","ProductDeliveryOptionsForCartLineItems","CartIcon","getSortedCartLines","sortOrder","lines","sort","item1","item2","_item2$LineNumber","_item1$LineNumber","LineNumber","_item1$LineNumber2","_item2$LineNumber2","_getImageSettings","_removeItemFromCartHandler","CheckOut","ViewShoppingBag","viewShoppingBagAttributes","_this$props$data$orgU","_setQuantityLimitsFeatureFlag","_validateCart","componentDidUpdate","prevProps","_this$state$miniCartD","_this$state$miniCartD2","enableHoverCart","isAnonymousCheckout","cartUrl","_getCheckoutURL","shouldShowMiniCart","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","showMiniCart","includeFlyout","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","flyoutTitle","flyoutTooltip","UncontrolledTooltip","placement","hideArrow","trigger","target","shouldShowCloseButton","cartPageUrl","hideAriaHidden","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","feature","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","miniCartWrapper","miniCartItemWrapper","goToCartButton","totalPrice","_cart$result$cart$Ver","_cart$result","lastValidatedCartVersion","msdyn365Commerce","FlyoutCartLineItems","cartLinesSortOrder","CartMethodChangeDialog","dialogProps","BodyText","HeaderText","modalOpen","close","onClose","style","whiteSpace","dangerouslySetInnerHTML","__html","_renderCartlines","cartEmptyText","_cartLine$cartlineId","Node","renderCartLinesGroupHeader","pickUpText","emailShippingText","titleSeparate","_cartLine$pickUpInSto4","groupTitle","renderCartLinesGroupTitle","_cartLine$pickUpInSto","_cartLine$pickUpInSto2","_cartLine$pickUpInSto3","_props$cart","_props$cart2","errorData","renderModuleAttributes","_props$context$action","emailshippingText","emptyCartText","renderCartLinesGroup","_renderInvoiceSummarylines","invoiceSummaryLines","_renderOrderSummarylines","orderSummaryLines"],"sourceRoot":""}