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CACjCQ,EAAG,IAAMC,EAAQ,MACjBC,MAAO,kBACPC,GAAI,CAAC,CAAC7D,KAAK,OAAS8D,KAAK,mFAAoFC,MAAO,GAAG,CAAC/D,KAAK,8BAAgC8D,KAAK,+FAAgGC,MAAO,GAAG,CAAC/D,KAAK,sBAAwB8D,KAAK,kEAAmEC,MAAO,IAEzXC,KAAK,EACLC,GAAI,YACJC,EAAG,iBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,8BAOAjB,EAF4B,+FACXO,EAAQ,KAQzBP,EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,mFACXO,EAAQ,MAMjClD,OAAO6D,aAAe7D,OAAO6D,cAAgB,GAC7C7D,OAAO6D,aAAapB,QAApB,OACOzC,OAAO6D,aAAapB,SAAW,IAC/BD,EAAQC,SAGXzC,OAAO6D,aAAanB,YAApB,OACG1C,OAAO6D,aAAanB,aAAe,IACnCF,EAAQE,aAEY,MAAMoB,EAAiB,GAC9BA,EAAe,6DAA+D,CACtFb,EAAG,IAAMC,EAAQ,KACjBa,GAAI,sCAEpB/D,OAAO6D,aAAe7D,OAAO6D,cAAgB,GAC7C7D,OAAO6D,aAAaC,eAApB,OAC2B9D,OAAO6D,aAAaC,gBAAkB,IACtCA,I,MCjG3BE,EAAOC,QAAUlS,O,OCAjBiS,EAAOC,QAAUC,W","sources":["webpack://mattressfirm/./src/modules/mfrm-cart-icon/components/flyout-cart-line-items.tsx?07bd","webpack://mattressfirm/./src/modules/mfrm-cart-icon/utils/get-products-in-mini-cart.ts?cd4c","webpack://mattressfirm/./src/modules/mfrm-cart-icon/mfrm-cart-icon.tsx?d3a4","webpack://mattressfirm/./src/modules/mfrm-cart-icon/mfrm-cart-icon.view.tsx?f4de","webpack://mattressfirm/./lib/mfrm-cart-icon/module-registration.js?0be2","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\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 { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\r\nimport { ICoreContext, IGridSettings, IImageSettings, ITelemetry } 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 { ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport * as React from 'react';\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 /** GridSettings for the product image in cartline */\r\n gridSettings: IGridSettings;\r\n /** ImageSettings for the product image in cartline */\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 _getProduct = (productId: number | undefined, products: SimpleProduct[]): SimpleProduct | undefined => {\r\n if (productId !== undefined && products) {\r\n return products.find(product => {\r\n return productId === product.RecordId;\r\n });\r\n }\r\n return undefined;\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 } else {\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\r\n } else {\r\n return maxQuantityByConfig;\r\n }\r\n }\r\n};\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 PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n const isServiceItem = product.ItemTypeValue === PRODUCTASSERVICE;\r\n\r\n const onRemoveClickHandler = (event: React.MouseEvent) => {\r\n removeItemClickHandler(cartline);\r\n };\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\r\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n\r\n return {\r\n data: {\r\n product: product,\r\n cartline: 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 _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 } else {\r\n return fulfillmentStoreId;\r\n }\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 cartlines.map((cartline, index) => {\r\n const product = _getProduct(cartline.ProductId, products);\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","/* eslint-disable no-duplicate-imports */\r\nimport { ActiveCartProductsInput, getActiveCartProductsAction, getAvailabilitiesForCartLineItems, getDeliveryOptionsForCartLineItems, IProductInventoryInformation, ProductAvailabilitiesForCartLineItems, ProductDeliveryOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\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\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 */\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 && !cartState.hasInvoiceLine) {\r\n await getActiveCartProductsAction(\r\n new ActiveCartProductsInput(),\r\n ctx\r\n )\r\n .then(products => {\r\n if (products) {\r\n miniCartData.products = products;\r\n }\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 await getAvailabilitiesForCartLineItems(\r\n new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings),\r\n ctx\r\n )\r\n .then(availableQuantity => {\r\n if (availableQuantity) {\r\n miniCartData.productAvailabilites = availableQuantity;\r\n }\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 await getDeliveryOptionsForCartLineItems(\r\n new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings),\r\n ctx\r\n )\r\n .then(deliveryOptions => {\r\n if (deliveryOptions) {\r\n miniCartData.deliveryOptions = deliveryOptions;\r\n }\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 * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\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} from '@msdyn365-commerce-modules/utilities';\r\nimport { CartIconComponent } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport { CartLine, ChannelDeliveryOptionConfiguration, OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\r\nimport { validateForCheckoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport React from 'react';\r\nimport { _getDeliveryService } from '../../Utilities/getDeliveryService';\r\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport { IMfrmCartIconData } from './mfrm-cart-icon.data';\r\nimport { IMfrmCartIconProps } from './mfrm-cart-icon.props.autogenerated';\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 IMfrmCartIconProps {\r\n className: string;\r\n cartIcon: React.ReactNode;\r\n\r\n FlyoutContainer?: INodeProps;\r\n\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\r\n checkoutAsGuestButton?: React.ReactNode;\r\n checkoutAsSignInUserButton?: React.ReactNode;\r\n goToCartButton?: React.ReactNode;\r\n waitingComponent?: React.ReactNode;\r\n\r\n isCartLoading: boolean;\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 telemetryContent: ITelemetryContent;\r\n private checkoutBySignInAttributes: IDictionary | undefined;\r\n private checkoutByGuestAttributes: IDictionary | undefined;\r\n private viewShoppingBagAttributes: IDictionary | undefined;\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n private lastValidatedCartVersion: number | undefined;\r\n\r\n constructor(props: IMfrmCartIconProps) {\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 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 // 27871 - To be used later on\r\n // this.setState({\r\n // orgUnitLocations: this.props.data.orgUnitLocations.result\r\n // });\r\n await this._setOrderQuantityLimitsFeatureFlag();\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(prevProps: IMfrmCartIconProps): void {\r\n this._validateCart();\r\n }\r\n\r\n // tslint:disable-next-line:cyclomatic-complexity\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n config: { enableHoverCart },\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 const hasInvoiceLine = cart && cart.hasInvoiceLine;\r\n const cartLines = this._getCartLines();\r\n const hasErrors = !this.state.isCartValid || (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 && cart.totalItemsInCart ? (cart.hasInvoiceLine ? 0 : cart.totalItemsInCart) : 0;\r\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n const flyoutTitle = resources.flyoutTitle;\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 // VSI Customization START\r\n // Need to comment this code because we removed featureState data-action\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?.\r\n // find(feature => feature.Name === multiplePickupStoreSwitchName)?.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\r\n ? {\r\n tag: UncontrolledTooltip,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__flyout-container',\r\n trigger: 'hover focus',\r\n displayMode: 'FLYOUT',\r\n target: id\r\n }\r\n : 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 // If there are invoice lines, don't update mini cart checkout button\r\n checkoutAsSignInUserButton:\r\n !isCartEmpty && !hasInvoiceLine ? (\r\n \r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n !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 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(retry: boolean = true): void {\r\n if (!this.state.isQuantityLimitsFeatureEnabled) {\r\n return;\r\n }\r\n\r\n const {\r\n data: { cart: cart }\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version;\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 if (cartVersion && cart.result?.cart.CartLines && cart.result?.cart.CartLines.length > 0) {\r\n validateForCheckoutAsync(\r\n { callerContext: this.props.context.actionContext, bypassCache: 'none' },\r\n cart.result?.cart?.Id || '',\r\n cartVersion\r\n )\r\n .then(result => {\r\n let isCartValid = true;\r\n if (result.ValidationFailuresByCartLines && result.ValidationFailuresByCartLines.length > 0) {\r\n isCartValid = !result.ValidationFailuresByCartLines?.some(\r\n lineDataValidationFailure => !!lineDataValidationFailure.DataValidationFailure?.ErrorContext\r\n );\r\n }\r\n this.setState({ isCartValid });\r\n })\r\n .catch(error => {\r\n this.setState({ isCartValid: false });\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n if (retry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\r\n const cartState = cart.result;\r\n cartState\r\n ?.refreshCart({})\r\n .then(() => this._validateCart(false))\r\n .catch((refreshError: Error) => {\r\n this.props.telemetry.warning(refreshError.message);\r\n this.props.telemetry.debug('Unable to refresh Cart');\r\n });\r\n }\r\n });\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 absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\r\n const isAbsoluteUrl = absoluteUrlRegExp.test(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.indexOf('?') === -1 ? '?' : '&'}ru=${returnURL}`;\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: 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: cart.cart.CartLines,\r\n products: this.state.miniCartData.products,\r\n productAvailabilites: this.state.miniCartData.productAvailabilites,\r\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\r\n imageSettings: imageSettings,\r\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: 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 inputQuantityAriaLabel: '', // not used\r\n discountStringText: '', // not used\r\n originalPriceText: '',\r\n currentPriceText: '',\r\n shippingChargesText: ''\r\n },\r\n telemetry: 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 })\r\n : null;\r\n }\r\n\r\n private _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 _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 _setOrderQuantityLimitsFeatureFlag(): Promise {\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 try {\r\n // const featureStatuses = await this.props.data.featureState;\r\n // const isQuantityLimitsFeatureEnabledInHq = featureStatuses\r\n // .find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.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 }\r\n}\r\n\r\nexport default CartIcon;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport { ICartIconViewProps } from './mfrm-cart-icon';\r\n\r\nconst _renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n return cartLines.map((cartLine, index) => {\r\n return (\r\n \r\n {cartLine.cartline}\r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\nconst CartIconView: React.FC = (props: ICartIconViewProps) => (\r\n \r\n {props.cartIcon}\r\n {props.FlyoutContainer ? (\r\n \r\n {props.flyoutTitle}\r\n {_renderCartlines(props.cartlines, props)}\r\n {props.totalPrice}\r\n {props.checkoutAsSignInUserButton}\r\n {props.goToCartButton}\r\n \r\n ) : (\r\n false\r\n )}\r\n \r\n);\r\n\r\nexport default CartIconView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-cart-icon'] = {\n c: () => require('partner/modules/mfrm-cart-icon/mfrm-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:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-cart-icon',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-cart-icon'\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/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|mfrm-cart-icon|mfrm-cart-icon'] = {\n c: () => require('partner/modules/mfrm-cart-icon/mfrm-cart-icon.view.tsx'),\n cn: '__local__-__local__-mfrm-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["_renderStoreLocation","cartLine","props","FulfillmentStoreId","orgUnitName","_getOrgUnitName","orgUnitLocations","React","className","fulfillmentStoreId","length","foundLocation","find","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","cartlines","products","reactNodes","map","cartline","index","product","productId","undefined","RecordId","_getProduct","ProductId","foundProductAvailability","foundProductDeliveryOption","productAvailabilites","productAvailability","ProductAvailableQuantity","productDeliveryOptions","deliveryOption","push","foundProductDeliveryOptions","imageSettings","gridSettings","id","typeName","context","resources","removeButtonText","removeItemClickHandler","availableQuantityInStock","isStockCheckEnabled","outOfStockThreshold","AvailableQuantity","maxQuantity","maxQuantityByConfig","isQuantityLimitsFeatureEnabled","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","_getCartItemMaxQuantity","maxCartlineQuantity","Behavior","MaximumQuantity","isServiceItem","ItemTypeValue","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","removeCartItemAttribute","getTelemetryAttributes","data","hasError","Quantity","CartLineItemComponent","currentQuantity","isOutOfStock","productUrl","getProductUrlSync","actionContext","key","isQuantityEditable","primaryImageUrl","PrimaryImageUrl","displayMode","channelDeliveryOptionConfig","remove","Button","Object","onClick","event","title","storeLocation","_assembleNode","telemetry","error","async","getMiniCartData","ctx","cartState","miniCartData","cart","CartLines","hasInvoiceLine","getActiveCartProductsAction","ActiveCartProductsInput","then","catch","exception","Error","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","requestContext","apiSettings","availableQuantity","getDeliveryOptionsForCartLineItems","ProductDeliveryOptionsForCartLineItems","deliveryOptions","CartIcon","constructor","super","retailMultiplePickUpOptionEnabled","_getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","_removeItemFromCartHandler","cartlineToRemove","this","result","input","cartLineIds","LineId","toString","removeCartLines","warning","debug","state","isCartValid","getTelemetryObject","request","telemetryPageName","friendlyName","payload","TelemetryEvent","checkoutBySignInAttributes","contentAction","etext","checkoutByGuestAttributes","viewShoppingBagAttributes","reaction","setState","_setOrderQuantityLimitsFeatureFlag","_validateCart","componentDidUpdate","prevProps","render","config","enableHoverCart","user","isAuthenticated","signInUrl","guestCheckoutUrl","getUrlSync","cartUrl","checkoutURL","_getCheckoutURL","isCartEmpty","cartLines","_getCartLines","hasErrors","some","includeFlyout","status","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","replace","flyoutTitle","price","TotalAmount","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","viewProps","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","tag","UncontrolledTooltip","placement","hideArrow","trigger","target","CartlinesWrapper","miniCartWrapper","classnames","miniCartItemWrapper","checkoutAsSignInUserButton","disabled","href","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","totalPrice","renderView","retry","cartVersion","Version","lastValidatedCartVersion","validateForCheckoutAsync","callerContext","bypassCache","Id","ValidationFailuresByCartLines","lineDataValidationFailure","DataValidationFailure","ErrorContext","name","refreshCart","refreshError","message","isAbsoluteUrl","RegExp","test","returnURL","msdyn365Commerce","window","location","origin","indexOf","channel","PickupDeliveryModeCode","FlyoutCartLineItems","app","enableStockCheck","maxQuantityForCartLineItem","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","quantityDisplayString","quantityDisplayText","inputQuantityAriaLabel","discountStringText","originalPriceText","currentPriceText","shippingChargesText","removeCartButtonText","outOfStockText","outOfRangeOneText","outOfRangeFormatText","pickupDeliveryModeCode","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInformation","customerInfo","IsB2b","observer","Node","renderModuleAttributes","_renderCartlines","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}