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C,MAAO,GAAG,CAACF,KAAK,WAAaC,KAAK,kEAAmEC,MAAO,GAAG,CAACF,KAAK,8BAAgCC,KAAK,+FAAgGC,MAAO,GAAG,CAACF,KAAK,mBAAqBC,KAAK,0EAA2EC,MAAO,GAAG,CAACF,KAAK,sBAAwBC,KAAK,kEAAmEC,MAAO,GAAG,CAACF,KAAK,eAAiBC,KAAK,uEAAwEC,MAAO,GAAG,CAACF,KAAK,mBAAqBC,KAAK,+EAAgFC,MAAO,IAEn7BC,KAAK,EACLC,GAAI,YACJC,EAAG,kBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,+BAOAlB,EAF4B,4EACXO,EAAQ,KAQzBP,EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,+FACXO,EAAQ,KAQzBP,EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,0EACXO,EAAQ,KAQzBP,EAF4B,uEACXO,EAAQ,KAQzBP,EAF4B,+EACXO,EAAQ,MAQzBP,EAF4B,mFACXO,EAAQ,MAMjCtW,OAAOkX,aAAelX,OAAOkX,cAAgB,GAC7ClX,OAAOkX,aAAarB,QAAOxJ,EAAAA,EAAA,GACpBrM,OAAOkX,aAAarB,SAAW,IAC/BD,EAAQC,SAGX7V,OAAOkX,aAAapB,YAAWzJ,EAAAA,EAAA,GAC5BrM,OAAOkX,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,+DAAiE,CACxFd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,uCAEpBpX,OAAOkX,aAAelX,OAAOkX,cAAgB,GAC7ClX,OAAOkX,aAAaC,eAAc9K,EAAAA,EAAA,GACPrM,OAAOkX,aAAaC,gBAAkB,IACtCA,0KCpI3BE,EAAOC,QAAU1b,cCAjByb,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/custom-get-simple-products.ts?5fc7","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cart-icon/dlvry-cart-icon.props.autogenerated.ts?9fe0","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cart-icon/components/flyout-cart-line-items.tsx?7742","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cart-icon/utils/get-products-in-active-cart.ts?d03e","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cart-icon/utils/get-products-in-mini-cart.ts?9bb3","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cart-icon/dlvry-cart-icon.tsx?1e5b","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cart-icon/dlvry-cart-icon.view.tsx?e92b","webpack://Msdyn365.Commerce.Online/./src/shared-utils/cart-utils.ts?220b","webpack://Msdyn365.Commerce.Online/./src/themes/dlvry-adventureworks/views/components/carticon.component.tsx?c30e","webpack://Msdyn365.Commerce.Online/./lib/dlvry-cart-icon/module-registration.js?6dc7","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IDictionary,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport {\r\n ArrayExtensions,\r\n generateCacheKey,\r\n QueryResultSettingsProxy,generateProductImageUrl\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Product Input.\r\n */\r\nexport class ProductInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public warehouseId?: string;\r\n\r\n public catalogId?: number;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n public constructor(\r\n productId: number | string,\r\n apiSettings: ICommerceApiSettings,\r\n channelId?: number,\r\n warehouseId?: string,\r\n requestContext?: IRequestContext,\r\n catalogId?: number\r\n ) {\r\n this.apiSettings = apiSettings;\r\n this.productId = +productId;\r\n this.channelId = channelId || apiSettings.channelId;\r\n this.warehouseId = warehouseId;\r\n this.catalogId = catalogId;\r\n\r\n if (requestContext && catalogId === undefined) {\r\n this.catalogId = getCatalogId(requestContext);\r\n }\r\n }\r\n\r\n public getCacheKey = () =>\r\n generateCacheKey(\r\n this.apiSettings,\r\n { key: 'ProductRecordId', value: this.productId },\r\n { key: 'ChannelId', value: this.channelId },\r\n { key: 'WarehouseId', value: this.warehouseId },\r\n { key: 'CatalogId', value: this.catalogId }\r\n );\r\n\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n\r\n public dataCacheType = (): CacheType => 'none'; //'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call.\r\n * @param inputData\r\n */\r\nexport const createSimpleProductsInput = (inputData: ICreateActionContext>): IActionInput[] => {\r\n let productIds = inputData.config && inputData.config.productIds;\r\n if (!productIds) {\r\n return [];\r\n }\r\n\r\n productIds = typeof productIds === 'string' ? productIds.split(',') : productIds;\r\n return !Array.isArray(productIds)\r\n ? []\r\n : productIds.map((productId: string) => {\r\n return new ProductInput(productId, inputData.requestContext.apiSettings, undefined, undefined, inputData.requestContext);\r\n });\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the product based on the passed ProductInput.\r\n * @param inputs\r\n * @param ctx\r\n */\r\nexport async function getSimpleProductsAction(inputs: ProductInput[], ctx: IActionContext): Promise {\r\n if (!ArrayExtensions.hasElements(inputs)) {\r\n ctx.trace('[getSimpleProductsAction] Invalid or empty inputs passed.');\r\n return [];\r\n }\r\n\r\n const productIdMapping: IDictionary = {};\r\n\r\n for (let index = 0; index < inputs.length; ++index) {\r\n productIdMapping[inputs[index].productId] = index;\r\n }\r\n\r\n const queryResultSettings = QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx);\r\n queryResultSettings.Paging!.Top = 1000;\r\n\r\n const getProductPromises: Promise[] = [];\r\n const catalogIds = ArrayExtensions.unique(inputs.map(input => input.catalogId));\r\n for (const catalogId of catalogIds) {\r\n const productInputs = inputs.filter(input => input.catalogId === catalogId);\r\n getProductPromises.push(\r\n getByIdsAsync(\r\n { callerContext: ctx, queryResultSettings },\r\n inputs[0].channelId,\r\n productInputs.map(input => input.productId),\r\n inputs[0].warehouseId ?? null,\r\n catalogId ?? 0\r\n )\r\n .then(response => {\r\n return response;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.debug(`[getSimpleProductsAction] Error in getting response from server. ${error}`);\r\n return {};\r\n })\r\n );\r\n }\r\n\r\n const products = ArrayExtensions.flatten(await Promise.all(getProductPromises));\r\n const mappedProducts = products\r\n .map(product => {\r\n try {\r\n const newImageUrl = generateProductImageUrl(product, ctx.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return product;\r\n } catch {\r\n ctx.trace('[getSimpleProductsAction] Unable to update ImageURL for Product');\r\n return undefined;\r\n }\r\n })\r\n .reduce((memo: SimpleProduct[], product: SimpleProduct | undefined) => {\r\n if (!product) {\r\n return memo;\r\n }\r\n const index = productIdMapping[product.RecordId];\r\n memo[index] = product;\r\n return memo;\r\n }, []);\r\n\r\n // NOTE: This is not an ideal fix, but will resolve all current issues\r\n return inputs.map(input => {\r\n const foundProduct = mappedProducts.find(product => product && product.RecordId === input.productId);\r\n return foundProduct || {};\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-simple-products',\r\n action: >getSimpleProductsAction,\r\n input: createSimpleProductsInput,\r\n isBatched: true\r\n});\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IDlvryCartIcon containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum cartLinesSortOrder {\r\n ascending = 'ascending',\r\n descending = 'descending'\r\n}\r\n\r\nexport interface IDlvryCartIconConfig extends Msdyn365.IModuleConfig {\r\n imageSettings?: Msdyn365.IImageSettings;\r\n enableHoverCart?: boolean;\r\n cartLinesSortOrder?: cartLinesSortOrder;\r\n isAnonymousCheckout?: boolean;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IDlvryCartIconResources {\r\n goToCartButtonTitle: string;\r\n totalPriceFormatString: string;\r\n guestCheckoutButtonTitle: string;\r\n checkoutButtonTitle: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeConfiguration: string;\r\n quantityDisplayText: string;\r\n removeCartButtonText: string;\r\n cartLabel: string;\r\n cartQtyLabel: string;\r\n flyoutTitle: string;\r\n salesAgreementPricePrompt: string;\r\n shippingText: string;\r\n checkoutBlockedDueToUnavailableFundsTitle: string;\r\n checkoutBlockedDueToUnavailableFundsMessage: string;\r\n continueShoppingButtonTitle: string;\r\n subTotalMessage: string;\r\n item: string;\r\n items: string;\r\n emptyPrice: string;\r\n emptyCartButtonText: string;\r\n searchPlaceholderText: string;\r\n emptyCartDescriptionText: string;\r\n emptyCartConfirmButtonText: string;\r\n emptyCartCancelButtonText: string;\r\n}\r\n\r\nexport interface IDlvryCartIconProps extends Msdyn365.IModule {\r\n resources: IDlvryCartIconResources;\r\n config: IDlvryCartIconConfig;\r\n slots: {\r\n emptyCart: React.ReactNode[];\r\n promoContentItem: React.ReactNode[];\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ProductCatalog, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '@msdyn365-commerce-modules/cart';\r\nimport { _mergeDuplicateCartlines } from '../../../shared-utils/cart-utils';\r\n\r\nexport interface IFlyoutCartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: ICartlineResourceString;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n catalogs?: ProductCatalog[];\r\n\r\n /**\r\n * GridSettings for the product image in cartline\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartline\r\n */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n maxCartlineQuantity: number;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n\r\n outOfStockThreshold: number;\r\n isStockCheckEnabled: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\nexport interface IFlyoutCartLineItemViewProps {\r\n cartline: React.ReactNode;\r\n remove: React.ReactNode;\r\n storeLocation: React.ReactNode;\r\n hasError: boolean;\r\n\r\n data: {\r\n product: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\n\r\nconst _getCartItemAvailableQuantity = (\r\n isStockCheckEnabled: boolean,\r\n outOfStockThreshold: number,\r\n productAvailability?: ProductAvailableQuantity\r\n): number => {\r\n if (isStockCheckEnabled) {\r\n if (\r\n !productAvailability ||\r\n !productAvailability.AvailableQuantity ||\r\n productAvailability.AvailableQuantity <= 0 ||\r\n productAvailability.AvailableQuantity <= outOfStockThreshold\r\n ) {\r\n return 0;\r\n }\r\n return productAvailability.AvailableQuantity - outOfStockThreshold;\r\n }\r\n\r\n return 0;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxQuantityByConfig: number,\r\n isStockCheckEnabled: boolean,\r\n availableQuantityInStock: number,\r\n isQuantityLimitsFeatureEnabled: boolean,\r\n maxByQuantityLimitsFeature: number\r\n) => {\r\n if (isQuantityLimitsFeatureEnabled) {\r\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\r\n\r\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\r\n // and consider available qty if stock check enabled and max from config in site settings.\r\n if (!maxByQuantityLimitsFeature) {\r\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\r\n }\r\n\r\n return isStockCheckEnabled\r\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\r\n ? maxByQuantityLimitsFeatureResult\r\n : availableQuantityInStock\r\n : maxByQuantityLimitsFeatureResult;\r\n }\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\r\n }\r\n return maxQuantityByConfig;\r\n};\r\n\r\n/**\r\n * On Remove Click functionality.\r\n * @param removeItemClickHandler -Remove item click function.\r\n * @param cartline -CartLine.\r\n * @returns Remove change value.\r\n */\r\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\r\n removeItemClickHandler(cartline);\r\n};\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct,\r\n props: IFlyoutCartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: ProductAvailableQuantity,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions\r\n): IFlyoutCartLineItemViewProps => {\r\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\r\n\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(\r\n props.isStockCheckEnabled,\r\n props.outOfStockThreshold,\r\n foundProductAvailability\r\n );\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n availableQuantityInStock,\r\n props.isQuantityLimitsFeatureEnabled,\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n\r\n // Check if the product is service or not by product type\r\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\r\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n\r\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\r\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\r\n const fullUrl = new URL(productUrl, window.location.href);\r\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\r\n productUrl = fullUrl.href;\r\n }\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline\r\n },\r\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\r\n cartline: (\r\n \r\n ),\r\n remove: (\r\n \r\n {removeButtonText}\r\n \r\n ),\r\n storeLocation: _renderStoreLocation(cartline, props)\r\n };\r\n};\r\n\r\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\r\n let deliverylocation;\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\r\n });\r\n }\r\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\r\n const location = delivery?.Description;\r\n\r\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\r\n if (location) {\r\n deliverylocation = `${location}, ${orgUnitName}`;\r\n } else {\r\n deliverylocation = `${orgUnitName}`;\r\n }\r\n } else {\r\n deliverylocation = props.resources.shippingText;\r\n }\r\n return deliverylocation;\r\n};\r\n\r\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n if (orgUnitName) {\r\n return (\r\n
\r\n {orgUnitName}\r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n};\r\n\r\nconst _assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: IFlyoutCartLineItemsProps\r\n): IFlyoutCartLineItemViewProps[] | null => {\r\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\r\n\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const mergedCartlines = _mergeDuplicateCartlines(cartlines);\r\n\r\n mergedCartlines.map((cartline, index) => {\r\n let product;\r\n if (props.isQuantityLimitsFeatureEnabled) {\r\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\r\n // to check productId and WarehouseId for identification.\r\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\r\n } else {\r\n product = getProductByProductId(cartline.ProductId, products);\r\n }\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\r\n });\r\n }\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\r\n });\r\n }\r\n if (product) {\r\n reactNodes.push(\r\n _assembleNode(\r\n cartline,\r\n product,\r\n props,\r\n index,\r\n foundProductAvailability?.ProductAvailableQuantity,\r\n foundProductDeliveryOption\r\n )\r\n );\r\n }\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n */\r\n\r\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return _assembleCartlines(cartlines, products, props);\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { FeatureState } from '@msdyn365-commerce/retail-proxy';\r\nimport { Cart, CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport {\r\n ArrayExtensions,\r\n createGetFeatureStateInput,\r\n CartConfigurationInput,\r\n getCartConfiguration,\r\n getCustomer,\r\n GetCustomerInput,\r\n getFeatureState\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport getSimpleProducts, { ProductInput } from '../../../actions/custom-get-simple-products';\r\n\r\n/**\r\n * Input class for activeCartWithProducts data action.\r\n */\r\nexport class ActiveCartProductsInput implements IActionInput {\r\n public getCacheKey = () => 'ActiveCartProducts';\r\n\r\n public getCacheObjectType = () => 'ActiveCartProducts';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext) => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getActiveCartProductsAction(input: ActiveCartProductsInput, ctx: IActionContext): Promise {\r\n // If no cart ID is provided in input, we need to create a cart object\r\n if (!input) {\r\n throw new Error('[getActiveCartWithProducts]No valid Input was provided, failing');\r\n }\r\n\r\n const cartState = await getCartState(ctx);\r\n const cart = cartState.cart;\r\n\r\n const isQuantityLimitsFeatureIsOn: boolean = await isOrderQuantityLimitsFeatureEnabled(ctx);\r\n\r\n if (isQuantityLimitsFeatureIsOn) {\r\n return getActiveCartProductsActionWhenQuantityLimitsFeatureIsOn(cart, ctx);\r\n }\r\n\r\n // If there are cart lines, make call to get products\r\n if (!cartState.hasInvoiceLine && cart && cart.CartLines && cart.CartLines.length > 0) {\r\n ctx.trace('Getting cart product information...');\r\n return getSimpleProducts(\r\n cart.CartLines.map(cartLine => {\r\n if (cartLine.ProductId) {\r\n return new ProductInput(\r\n cartLine.ProductId,\r\n ctx.requestContext.apiSettings,\r\n undefined,\r\n undefined,\r\n ctx.requestContext,\r\n cartLine.CatalogId\r\n );\r\n }\r\n return undefined;\r\n }).filter(Boolean),\r\n ctx\r\n )\r\n .then((products: SimpleProduct[]) => {\r\n if (products) {\r\n return products;\r\n }\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.toString());\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug('[getActiveCartWithProducts]Unable to hydrate cart with product information');\r\n throw new Error('[getActiveCartWithProducts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n ctx.trace('[getActiveCartWithProducts]No Products Found in cart');\r\n return [];\r\n}\r\n\r\nexport const getActiveCartProductsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-products-in-active-cart',\r\n action: >getActiveCartProductsAction,\r\n input: createInput\r\n});\r\nexport default getActiveCartProductsActionDataAction;\r\n\r\nasync function getActiveCartProductsActionWhenQuantityLimitsFeatureIsOn(cart: Cart, ctx: IActionContext): Promise {\r\n const productIdsByWarehouseId: Map = new Map();\r\n let resultProducts: SimpleProduct[] = [];\r\n cart.CartLines?.forEach(cartLine =>\r\n productIdsByWarehouseId.has(cartLine.WarehouseId!)\r\n ? productIdsByWarehouseId.get(cartLine.WarehouseId!)?.push(cartLine)\r\n : productIdsByWarehouseId.set(cartLine.WarehouseId!, [cartLine])\r\n );\r\n return Promise.all(\r\n [...productIdsByWarehouseId].map(([entryWarehouseId, entryProductIds]) => {\r\n return getSimpleProducts(\r\n entryProductIds\r\n .map(cartLine => {\r\n if (cartLine.ProductId) {\r\n return new ProductInput(\r\n cartLine.ProductId,\r\n ctx.requestContext.apiSettings,\r\n undefined,\r\n entryWarehouseId,\r\n ctx.requestContext,\r\n cartLine.CatalogId\r\n );\r\n }\r\n return undefined;\r\n })\r\n .filter(Boolean),\r\n ctx\r\n ).then((products: SimpleProduct[]) => {\r\n if (products) {\r\n resultProducts = products.reduce((accum, product) => {\r\n if (product) {\r\n accum.push(product);\r\n }\r\n return accum;\r\n }, resultProducts);\r\n }\r\n });\r\n })\r\n ).then(() => resultProducts);\r\n}\r\n\r\nasync function isOrderQuantityLimitsFeatureEnabled(ctx: IActionContext): Promise {\r\n const featureStates = await getFeatureState(createGetFeatureStateInput(ctx), ctx);\r\n let isQuantityLimitsFeatureEnabledInHq = false;\r\n if (ArrayExtensions.hasElements(featureStates)) {\r\n isQuantityLimitsFeatureEnabledInHq =\r\n featureStates.find(\r\n (featureState: FeatureState) => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n }\r\n\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n return false;\r\n }\r\n\r\n const useSiteBuilderSettings = featureStates?.find(\r\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = ctx.requestContext.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return Promise.resolve(false);\r\n }\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return Promise.resolve(true);\r\n }\r\n\r\n return getCustomer(new GetCustomerInput(ctx.requestContext.apiSettings), ctx)\r\n .then(customerInfo => {\r\n return (\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n })\r\n .catch((error: Error) => {\r\n ctx.telemetry.warning(error.message);\r\n ctx.telemetry.debug('Unable to get customer info');\r\n return false;\r\n });\r\n } else {\r\n return getCartConfiguration(new CartConfigurationInput(), ctx)\r\n .then(cartConfiguration => {\r\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\r\n })\r\n .catch((error: Error) => {\r\n ctx.telemetry.warning(error.message);\r\n ctx.telemetry.debug('Unable to get cart configuration');\r\n return false;\r\n });\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ActiveCartProductsInput,\r\n // @ts-expect-error\r\n getAvailabilitiesForCartLineItems,\r\n // @ts-expect-error\r\n getDeliveryOptionsForCartLineItems,\r\n IProductInventoryInformation,\r\n // @ts-expect-error\r\n ProductAvailabilitiesForCartLineItems,\r\n // @ts-expect-error\r\n ProductDeliveryOptionsForCartLineItems\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getActiveCartProductsAction } from './get-products-in-active-cart';\r\n\r\n/**\r\n * IMiniCartData entity interface.\r\n */\r\nexport interface IMiniCartData {\r\n products?: SimpleProduct[];\r\n productAvailabilites?: IProductInventoryInformation[];\r\n deliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\nexport const createInput = () => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a mini cart data.\r\n * @param ctx\r\n * @param cartState\r\n */\r\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\r\n const miniCartData: IMiniCartData = {};\r\n\r\n const cart = cartState.cart;\r\n\r\n // If there are cart lines, make call to get products\r\n // If there are invocie linese, then there is no products, so don't make call to get products\r\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\r\n const productsPromise = getActiveCartProductsAction(new ActiveCartProductsInput(), ctx);\r\n const availabilityPromise = Promise.resolve(undefined); // getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx);\r\n const deliveryOptionsPromise = Promise.resolve(undefined); // getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx);\r\n\r\n await Promise.all([productsPromise, availabilityPromise, deliveryOptionsPromise])\r\n .then(([products, availability, deliveryOptions]) => {\r\n if (products) {\r\n miniCartData.products = products;\r\n }\r\n if (availability) {\r\n miniCartData.productAvailabilites = availability;\r\n }\r\n if (deliveryOptions) {\r\n miniCartData.deliveryOptions = deliveryOptions;\r\n }\r\n return miniCartData;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n return miniCartData;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CartLineValidationResultsByLineId,\r\n OrgUnitLocation\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n UncontrolledTooltip,\r\n updateMaxQuantityForCartLineItem,\r\n urlCheck\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport React from 'react';\r\n\r\nimport { IDlvryCartIconData } from './dlvry-cart-icon.data';\r\nimport { cartLinesSortOrder, IDlvryCartIconProps } from './dlvry-cart-icon.props.autogenerated';\r\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\r\n\r\nexport interface IMiniCartState {\r\n miniCartData: IMiniCartData;\r\n orgUnitLocations?: OrgUnitLocation[];\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n isCartValid: boolean;\r\n}\r\n\r\nexport interface ICartIconViewProps extends IDlvryCartIconProps {\r\n className: string;\r\n telemetryContent?: ITelemetryContent;\r\n cartIcon: React.ReactNode;\r\n FlyoutContainer?: INodeProps;\r\n CartlinesWrapper: INodeProps;\r\n miniCartWrapper: INodeProps;\r\n miniCartItemWrapper: INodeProps;\r\n cartlines?: IFlyoutCartLineItemViewProps[];\r\n flyoutTitle: React.ReactNode;\r\n totalPrice: React.ReactNode;\r\n checkoutAsGuestButton?: React.ReactNode;\r\n checkoutAsSignInUserButton?: React.ReactNode;\r\n goToCartButton?: React.ReactNode;\r\n waitingComponent?: React.ReactNode;\r\n isCartLoading: boolean;\r\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\n/**\r\n *\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CartIcon extends React.Component, IMiniCartState> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\r\n\r\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\r\n\r\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\r\n\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n private lastValidatedCartVersion: number | undefined;\r\n\r\n constructor(props: IDlvryCartIconProps) {\r\n super(props);\r\n this.state = {\r\n miniCartData: {},\r\n isCartValid: true,\r\n isQuantityLimitsFeatureEnabled: false\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\r\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\r\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const context = this.props.context.actionContext;\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({\r\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\r\n });\r\n }\r\n );\r\n await this._setQuantityLimitsFeatureFlag();\r\n\r\n this.setState({\r\n orgUnitLocations: this.props.data.orgUnitLocations?.result\r\n });\r\n\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(prevProps: IDlvryCartIconProps): void {\r\n this._validateCart();\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IDlvryCartIconProps, nextState: IMiniCartState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n config: { enableHoverCart, isAnonymousCheckout },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n }\r\n },\r\n context,\r\n resources\r\n } = this.props;\r\n\r\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\r\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n const hasInvoiceLine = cart?.hasInvoiceLine;\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n const cartLines = this._getCartLines();\r\n const validInventoryAcrossCartLines = validateCartLinesInventory(\r\n cart?.cart.CartLines ?? [],\r\n this.state.miniCartData.productAvailabilites ?? [],\r\n this.props.context.actionContext,\r\n this.state.miniCartData.products ?? [],\r\n emailDeliveryModeCode\r\n );\r\n const hasError =\r\n !validInventoryAcrossCartLines?.isValid ||\r\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\r\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\r\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\r\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n const flyoutTitle = resources.flyoutTitle;\r\n const flyoutTooltip = {\r\n tag: UncontrolledTooltip,\r\n shouldShowMiniCart,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__flyout-container',\r\n trigger: 'hover',\r\n displayMode: 'FLYOUT',\r\n target: id,\r\n shouldShowCloseButton: true,\r\n cartPageUrl: cartUrl,\r\n hideAriaHidden: true\r\n };\r\n\r\n // If there are invoice lines, don't update mini cart price\r\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\r\n const priceString = price\r\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\r\n : '';\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\r\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\r\n feature => feature.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n cartIcon: (\r\n \r\n ),\r\n cartlines: cartLines,\r\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\r\n CartlinesWrapper: {\r\n className: 'ms-cart-icon__cart-lines'\r\n },\r\n miniCartWrapper: {\r\n className: classnames('ms-cart-icon'),\r\n id: this.props.id\r\n },\r\n miniCartItemWrapper: {\r\n className: classnames('msc-cart-lines-item')\r\n },\r\n\r\n // If there are invoice lines, don't update mini cart checkout button\r\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\r\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\r\n checkoutAsSignInUserButton:\r\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\r\n \r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\r\n \r\n {resources.guestCheckoutButtonTitle}\r\n \r\n ) : null,\r\n goToCartButton: (\r\n \r\n {goToCartButtonText}\r\n \r\n ),\r\n checkoutBlockedDueToUnavailableFunds: null,\r\n flyoutTitle: {flyoutTitle},\r\n totalPrice:
{priceString}
\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _validateCart(): void {\r\n const {\r\n data: { cart }\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version ?? undefined;\r\n if (this.lastValidatedCartVersion === cartVersion) {\r\n return;\r\n }\r\n\r\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\r\n\r\n if (this.state.isQuantityLimitsFeatureEnabled) {\r\n validateCartAsync(cart, this.props.telemetry, this.props.context)\r\n .then((result: CartLineValidationResultsByLineId | undefined) => {\r\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\r\n })\r\n .catch(() => {\r\n this.setState({ isCartValid: false });\r\n });\r\n } else {\r\n this.setState({ isCartValid: true });\r\n }\r\n }\r\n\r\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\r\n }\r\n\r\n /**\r\n * Sort cartline items.\r\n * @param cartlines - Cartlines to be sorted.\r\n * @param sortOrder - Ascending or descending.\r\n * @returns - Sorted cartlines.\r\n */\r\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\r\n const lines: CartLine[] = [...cartlines];\r\n const zero: number = 0;\r\n\r\n if (sortOrder === cartLinesSortOrder.descending) {\r\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\r\n }\r\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\r\n };\r\n\r\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\r\n const {\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const cart = this.props.data.cart && this.props.data.cart.result;\r\n\r\n // Cart-icon could be placed in each page\r\n // so we check cart content to reduce number of RS calls\r\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\r\n ? FlyoutCartLineItems({\r\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\r\n products: this.state.miniCartData.products,\r\n productAvailabilites: this.state.miniCartData.productAvailabilites,\r\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\r\n imageSettings,\r\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n inputQuantityAriaLabel: '', // Not used\r\n discountStringText: '', // Not used\r\n originalPriceText: '',\r\n currentPriceText: '',\r\n shippingChargesText: '',\r\n shippingText: resources.shippingText\r\n },\r\n telemetry,\r\n removeButtonText: resources.removeCartButtonText,\r\n outOfStockText: '', // Not used\r\n outOfRangeOneText: '', // Not used\r\n outOfRangeFormatText: '', // Not used\r\n cartState: cart,\r\n orgUnitLocations: this.state.orgUnitLocations,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n telemetryContent: this.telemetryContent,\r\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\r\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\r\n catalogs: this.props.data.catalogs?.result\r\n })\r\n : null;\r\n }\r\n\r\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\r\n return (\r\n imageSettings || {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n }\r\n );\r\n };\r\n\r\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\r\n if (this.props.data.cart.result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n this.props.data.cart.result.removeCartLines(input).catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n }\r\n };\r\n\r\n private async _setQuantityLimitsFeatureFlag(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\r\n )?.IsEnabled || false;\r\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n return;\r\n }\r\n\r\n const useSiteBuilderSettings = featureStatuses?.find(\r\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n } else {\r\n this.props.data.customerInformation\r\n .then(customerInfo => {\r\n const result =\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n this.setState({ isQuantityLimitsFeatureEnabled: result });\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n });\r\n }\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n this.setState({ isQuantityLimitsFeatureEnabled: !(cartConfiguration?.IgnoreOrderSettings ?? false) });\r\n return;\r\n }\r\n }\r\n}\r\n\r\nexport default CartIcon;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, Node, KeyCodes, onTelemetryClick, getPayloadObject, INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\nimport { ICartIconViewProps } from './dlvry-cart-icon';\r\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport CartLineItemComponent from '../../themes/dlvry-adventureworks/views/components/cartlineitem.component';\r\nimport CartIconComponent from '../../themes/dlvry-adventureworks/views/components/carticon.component';\r\nimport { _mergeDuplicateCartlines } from '../../shared-utils/cart-utils';\r\n\r\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n\r\n // Component override stopped working in mini-cart after 9.48, force it here\r\n const cartLineProps = (cartLine.cartline as React.ReactElement).props;\r\n const cartLineComp = ;\r\n\r\n return (\r\n \r\n \r\n {cartLineComp}\r\n {/* {cartLine.cartline} */}\r\n \r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\nconst renderTotalPrice = (props: ICartIconViewProps): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n // Calculate total price from cart lines instead of cart object\r\n const sumPrice = props.data.cart.result?.cart.CartLines\r\n ?.map(x => (x.NetAmountWithoutTax || (x.Price! * (x.Quantity || 1))))\r\n .reduce((sum, price) => sum + price, 0);\r\n const sumPriceFormatString = sumPrice\r\n ? props.context.cultureFormatter.formatCurrency(sumPrice)\r\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n\r\n return cart && !cart.hasInvoiceLine ? (\r\n
\r\n \r\n {props.resources.totalPriceFormatString}\r\n {sumPriceFormatString}\r\n \r\n
\r\n ) : (\r\n <>\r\n );\r\n};\r\n\r\nconst getModalContainerProps = (isModalOpen: boolean, closeModal: () => void): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: isModalOpen,\r\n toggle: closeModal\r\n };\r\n};\r\n\r\nconst CartIconView: React.FC = (props: ICartIconViewProps) => {\r\n const cartIconRef = React.useRef(null);\r\n const isAutoDisplayTriggered = React.useRef(false);\r\n const [isModalOpen, setIsModalOpen] = React.useState(false);\r\n const [filter, setFilter] = React.useState('');\r\n const [showEmptyCartConfirmation, setShowEmptyCartConfirmation] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const escHandler = (event: KeyboardEvent) => {\r\n if (event.keyCode === KeyCodes.Escape) {\r\n if (showEmptyCartConfirmation) {\r\n setShowEmptyCartConfirmation(false);\r\n } else if (isModalOpen) {\r\n cartIconRef.current?.focus();\r\n setIsModalOpen(false);\r\n }\r\n }\r\n };\r\n\r\n window.addEventListener('keydown', escHandler, false);\r\n\r\n return () => {\r\n window.removeEventListener('keydown', escHandler, false);\r\n };\r\n }, [isModalOpen, setIsModalOpen, cartIconRef, showEmptyCartConfirmation, setShowEmptyCartConfirmation]);\r\n\r\n const cart = props.data.cart.result ?? undefined;\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n\r\n if (shouldShowMiniCart) {\r\n if (!isAutoDisplayTriggered.current) {\r\n // First time trigger auto mini cart.\r\n setIsModalOpen(true);\r\n isAutoDisplayTriggered.current = true;\r\n } else if (!isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n isAutoDisplayTriggered.current = false;\r\n }\r\n }\r\n\r\n const totalItemsInCart = React.useMemo(() => {\r\n return cart?.cart.CartLines ? _mergeDuplicateCartlines(cart.cart.CartLines).length : 0;\r\n }, [cart?.cart.CartLines]);\r\n const goToCartButtonText = props.resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n\r\n const _openModal = React.useCallback(() => {\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(props.telemetryContent!, payLoad, 'cart-icon');\r\n setIsModalOpen(true);\r\n }, [props.telemetryContent, setIsModalOpen]);\r\n\r\n const _closeModal = React.useCallback(() => {\r\n cartIconRef.current?.focus();\r\n setIsModalOpen(false);\r\n }, [cartIconRef, setIsModalOpen]);\r\n\r\n const doFilter = React.useCallback((cartLine: IFlyoutCartLineItemViewProps) => {\r\n if (!filter) {\r\n return true;\r\n }\r\n\r\n const product = cartLine.data.product;\r\n\r\n return product.Name?.toLocaleLowerCase().includes(filter.toLocaleLowerCase()) ||\r\n product.ItemId?.toLocaleLowerCase().includes(filter.toLocaleLowerCase());\r\n }, [filter]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {props.flyoutTitle}\r\n {totalItemsInCart} {props.resources.items}\r\n \r\n \r\n \r\n )}\r\n \r\n {renderCartlines(props.cartlines?.filter(doFilter), props)}\r\n \r\n \r\n \r\n {props.slots.promoContentItem}\r\n {renderTotalPrice(props)}\r\n

{props.resources.subTotalMessage}

\r\n {/* Removed per Task 4253\r\n {props.checkoutAsSignInUserButton &&\r\n React.cloneElement(props.checkoutAsSignInUserButton as React.ReactElement,{disabled:hasError})} */}\r\n {props.checkoutAsGuestButton}\r\n {props.goToCartButton && React.cloneElement(props.goToCartButton as React.ReactElement, {\r\n 'children': goToCartButtonText\r\n })}\r\n {/* Removed per Task 5216 */}\r\n {/* \r\n {props.data.cart.result?.isEmpty ? (\r\n \r\n {props.resources.continueShoppingButtonTitle}\r\n \r\n ) : null}\r\n */}\r\n
\r\n
\r\n\r\n {showEmptyCartConfirmation && (\r\n setShowEmptyCartConfirmation(!showEmptyCartConfirmation)}\r\n fade={false}\r\n >\r\n \r\n
{props.resources.emptyCartButtonText}
\r\n
\r\n \r\n
{props.resources.emptyCartDescriptionText}
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default CartIconView;\r\n","import { CartLine } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\n/**\r\n * Merge duplicate cartlines for same product. Sums up quantity and prices to its own cartline.\r\n */\r\nexport function _mergeDuplicateCartlines(cartlines: CartLine[]): CartLine[] {\r\n return cartlines;\r\n\r\n // @ts-expect-error\r\n const mergedCartlines: CartLine[] = [];\r\n\r\n cartlines.forEach(cartline => {\r\n const existingCartline = mergedCartlines.find(cl => cl.ProductId === cartline.ProductId);\r\n\r\n if (existingCartline) {\r\n const quantity = (existingCartline.Quantity || 0) + (cartline.Quantity || 0);\r\n const netAmountWithoutTax = cartline.NetAmountWithoutTax\r\n ? (existingCartline.NetAmountWithoutTax || 0) + cartline.NetAmountWithoutTax\r\n : (existingCartline.NetAmountWithoutTax || 0) + (cartline.Price || 0) * (cartline.Quantity || 0);\r\n\r\n mergedCartlines[mergedCartlines.indexOf(existingCartline)] = {\r\n ...existingCartline,\r\n Quantity: quantity,\r\n NetAmountWithoutTax: netAmountWithoutTax\r\n };\r\n } else {\r\n mergedCartlines.push({ ...cartline });\r\n }\r\n });\r\n\r\n return mergedCartlines;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { _mergeDuplicateCartlines } from '../../../../shared-utils/cart-utils';\r\n\r\n/**\r\n * ICartIconData: Interface for Cart Icon Data.\r\n */\r\nexport interface ICartIconData {\r\n cart?: ICartState;\r\n}\r\n\r\n/**\r\n * ICartIconComponentProps: Interface for Cart Icon component props.\r\n */\r\nexport interface ICartIconComponentProps extends IComponentProps {\r\n className?: string;\r\n cartLabel: string;\r\n cartQtyLabel: string;\r\n telemetryContent?: ITelemetryContent;\r\n salesAgreementPricePrompt?: string;\r\n}\r\n\r\n/**\r\n * ICartIconComponent: Interface for Cart Icon component.\r\n */\r\nexport interface ICartIconComponent extends IComponent {}\r\n\r\nconst CartIconComponentActions = {};\r\n\r\n/**\r\n *\r\n * CartIcon component.\r\n * @extends {React.FC}\r\n */\r\nconst CartIcon: React.FC = (props: ICartIconComponentProps) => {\r\n const {\r\n cartLabel,\r\n cartQtyLabel,\r\n data: { cart }\r\n } = props;\r\n\r\n const cartItemsCount = React.useMemo(() => {\r\n return cart?.cart.CartLines ? _mergeDuplicateCartlines(cart.cart.CartLines).length : 0;\r\n }, [cart?.cart.CartLines]);\r\n const qtyLabel = format(cartQtyLabel, cartItemsCount);\r\n const label = format(cartLabel, cartItemsCount);\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const style: React.CSSProperties = {\r\n visibility: cart ? 'visible' : 'hidden'\r\n };\r\n return (\r\n
\r\n
\r\n {qtyLabel}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const CartIconComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n // @ts-expect-error -- Compatible issue with the component override.\r\n ICartIconComponent\r\n>('CartIcon', { component: CartIcon, ...CartIconComponentActions });\r\n\r\nexport default CartIconComponent;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['dlvry-cart-icon'] = {\n c: () => require('partner/modules/dlvry-cart-icon/dlvry-cart-icon.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action', runOn: 1},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerBalances', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'dlvry-cart-icon',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dlvry-cart-icon'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|dlvry-cart-icon|dlvry-cart-icon'] = {\n c: () => require('partner/modules/dlvry-cart-icon/dlvry-cart-icon.view.tsx'),\n cn: '__local__-__local__-dlvry-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["ProductInput","constructor","productId","apiSettings","channelId","warehouseId","requestContext","catalogId","getCacheKey","generateCacheKey","this","key","value","getCacheObjectType","dataCacheType","undefined","getCatalogId","createObservableDataAction","id","action","async","inputs","ctx","ArrayExtensions","hasElements","trace","productIdMapping","index","length","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","Paging","Top","getProductPromises","catalogIds","unique","map","input","_inputs$0$warehouseId","productInputs","filter","push","getByIdsAsync","callerContext","then","response","catch","error","telemetry","debug","mappedProducts","flatten","Promise","all","product","newImageUrl","generateProductImageUrl","PrimaryImageUrl","_unused","reduce","memo","RecordId","find","inputData","productIds","config","split","Array","isArray","isBatched","cartLinesSortOrder","_renderDeliveryLocation","cartLine","props","deliverylocation","FulfillmentStoreId","_foundProductDelivery","orgUnitName","_getOrgUnitName","orgUnitLocations","foundProductDeliveryOption","productDeliveryOptions","deliveryOption","ProductId","delivery","DeliveryOptions","option","Code","DeliveryMode","location","Description","resources","shippingText","_renderStoreLocation","React","className","fulfillmentStoreId","foundLocation","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","cartlines","products","reactNodes","context","_mergeDuplicateCartlines","cartline","foundProductAvailability","_foundProductAvailabi","isQuantityLimitsFeatureEnabled","getProductByProductIdAndWarehouse","WarehouseId","cartState","getProductByProductId","productAvailabilites","productAvailability","_productAvailability$","ProductAvailableQuantity","_assembleNode","foundProductDeliveryOptions","_product$Behavior","imageSettings","gridSettings","typeName","removeButtonText","removeItemClickHandler","availableQuantityInStock","isStockCheckEnabled","outOfStockThreshold","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","_getCartItemMaxQuantity","maxQuantityByConfig","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","maxCartlineQuantity","Behavior","MaximumQuantity","isServiceItem","ItemTypeValue","ReleasedProductType","Service","onRemoveClickHandler","onRemoveClickFunction","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","RemoveCartItem","removeCartItemAttribute","getTelemetryAttributes","productUrl","getProductUrlSync","actionContext","MsDyn365","isBrowser","isChannelTypeB2B","_cartline$CatalogId","fullUrl","URL","window","href","searchParams","set","CatalogId","data","hasError","Quantity","CartLineItemComponent","catalogs","currentQuantity","isOutOfStock","isQuantityEditable","primaryImageUrl","displayMode","channelDeliveryOptionConfig","deliveryLocation","remove","Button","Object","assign","onClick","title","storeLocation","ActiveCartProductsInput","getActiveCartProductsAction","Error","getCartState","cart","_featureStates$find2","featureStates","getFeatureState","createGetFeatureStateInput","isQuantityLimitsFeatureEnabledInHq","_featureStates$find","featureState","Name","IsEnabled","_ctx$requestContext$a","defaultOrderQuantityLimitsFeatureConfig","app","platform","enableDefaultOrderQuantityLimits","resolve","getCustomer","GetCustomerInput","customerInfo","IsB2b","warning","message","getCartConfiguration","CartConfigurationInput","cartConfiguration","_cartConfiguration$Ig","IgnoreOrderSettings","isOrderQuantityLimitsFeatureEnabled","_cart$CartLines","productIdsByWarehouseId","Map","resultProducts","CartLines","forEach","_productIdsByWarehous","has","get","_ref","entryWarehouseId","entryProductIds","getSimpleProducts","Boolean","accum","getActiveCartProductsActionWhenQuantityLimitsFeatureIsOn","hasInvoiceLine","toString","getMiniCartData","miniCartData","productsPromise","availabilityPromise","deliveryOptionsPromise","availability","deliveryOptions","exception","CartIcon","super","retailMultiplePickUpOptionEnabled","getSortedCartLines","sortOrder","lines","descending","sort","item1","item2","_item2$LineNumber","_item1$LineNumber","LineNumber","_item1$LineNumber2","_item2$LineNumber2","_getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","_removeItemFromCartHandler","cartlineToRemove","result","cartLineIds","LineId","removeCartLines","state","isCartValid","getTelemetryObject","request","telemetryPageName","friendlyName","payload","TelemetryEvent","CheckOut","Checkout","checkoutBySignInAttributes","contentAction","etext","GuestCheckout","checkoutByGuestAttributes","ViewShoppingBag","viewShoppingBagAttributes","_this$props$data$orgU","reaction","_this$props$data$cart","setState","_setQuantityLimitsFeatureFlag","_validateCart","componentDidUpdate","prevProps","shouldComponentUpdate","nextProps","nextState","render","_this$props$context$r","_cart$cart$CartLines","_this$state$miniCartD","_this$state$miniCartD2","_this$props$data$chan","_this$props$data$feat","enableHoverCart","isAnonymousCheckout","user","isAuthenticated","signInUrl","guestCheckoutUrl","getUrlSync","cartUrl","checkoutURL","_getCheckoutURL","isCartEmpty","shouldShowMiniCart","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","showMiniCart","emailDeliveryModeCode","channel","EmailDeliveryModeCode","cartLines","_getCartLines","validInventoryAcrossCartLines","validateCartLinesInventory","isValid","some","includeFlyout","status","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","replace","flyoutTitle","flyoutTooltip","tag","UncontrolledTooltip","placement","hideArrow","trigger","target","shouldShowCloseButton","cartPageUrl","hideAriaHidden","price","TotalAmount","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","feature","viewProps","_objectSpread","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","CartlinesWrapper","miniCartWrapper","classnames","miniCartItemWrapper","checkoutAsSignInUserButton","disabled","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","checkoutBlockedDueToUnavailableFunds","totalPrice","renderView","_cart$result$cart$Ver","_cart$result","cartVersion","Version","lastValidatedCartVersion","validateCartAsync","ValidationResultsPairs","isAbsoluteUrl","urlCheck","returnURL","msdyn365Commerce","origin","includes","_this$props$data$cata","PickupDeliveryModeCode","FlyoutCartLineItems","enableStockCheck","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","quantityDisplayString","quantityDisplayText","salesAgreementPricePrompt","inputQuantityAriaLabel","discountStringText","originalPriceText","currentPriceText","shippingChargesText","removeCartButtonText","outOfStockText","outOfRangeOneText","outOfRangeFormatText","pickupDeliveryModeCode","_featureStatuses$find","_featureStatuses$find2","featureStatuses","_this$props$context","_featureStatuses$find3","customerInformation","__decorate","observer","_props$data$cart$resu3","_props$cartlines","cartIconRef","isAutoDisplayTriggered","isModalOpen","setIsModalOpen","setFilter","showEmptyCartConfirmation","setShowEmptyCartConfirmation","escHandler","event","keyCode","KeyCodes","Escape","_cartIconRef$current","current","focus","addEventListener","removeEventListener","_openModal","onTelemetryClick","_closeModal","_cartIconRef$current2","doFilter","_product$Name","_product$ItemId","toLocaleLowerCase","ItemId","Node","renderModuleAttributes","ref","getModalContainerProps","closeModal","Modal","wrapClassName","isOpen","toggle","items","isEmpty","slots","emptyCart","type","placeholder","searchPlaceholderText","onChange","e","style","marginTop","textAlign","emptyCartButtonText","renderCartlines","cartLineIndex","cartLineProps","cartLineComp","promoContentItem","_props$data$cart$resu","_props$data$cart$resu2","sumPrice","x","NetAmountWithoutTax","Price","sum","sumPriceFormatString","emptyPrice","renderTotalPrice","subTotalMessage","modalClassName","backdropClassName","fade","ModalHeader","ModalBody","emptyCartDescriptionText","ModalFooter","emptyCartConfirmButtonText","emptyCartCancelButtonText","createComponentOverride","component","cartItemsCount","qtyLabel","format","label","attributes","visibility","role","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}