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EnBrS,EAAAA,cAACgH,EAAAA,OAAM7F,OAAA9E,OAAA,CACHgD,UAAW,GAAGA,8BACd9D,QAASggB,EAAU,aACPvY,EAAc0Z,sBACtBf,GAEH3Y,EAAc0Z","sources":["webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/components/add-to-order-template.component.tsx?b91a","webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/components/productnotpurchasable.component.tsx?214e","webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/components/item-added-to-order-template-dialog.component.tsx?65b1","webpack://Msdyn365.Commerce.Online/./src/modules/buybox/components/add-to-cart-confirmation-dialog-component.tsx?04d6","webpack://Msdyn365.Commerce.Online/./src/modules/buybox/components/add-to-cart.component.tsx?7359","webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/components/Popup.tsx?a027"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce, isChannelTypeB2B, IImageSettings } from '@msdyn365-commerce/core';\nimport { AsyncResult, Customer, ProductDimension, ProductList, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n addItemToOrderTemplate,\n AddItemToOrderTemplateInput,\n getPriceForSelectedVariant,\n OrderTemplate,\n PriceForSelectedVariantInput,\n updateOrderTemplateAction,\n UpdateOrderTemplateInput,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as Popper from 'popper.js';\nimport React, { useState } from 'react';\n\nimport {\n AddToOrderTemplateDialog,\n IAddToOrderTemplateDialogData,\n IAddToOrderTemplateDialogResources\n} from '@msdyn365-commerce/components';\nimport {\n DuplicateItemsWhenAddingToOrderTemplateDialog,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources\n} from '@msdyn365-commerce/components';\nimport {\n IItemAddedToOrderTemplateDialogResources,\n ItemAddedToOrderTemplateDialog\n} from '../../views/components/item-added-to-order-template-dialog.component';\nimport { IOrderTemplateNameDialogResources } from '@msdyn365-commerce/components';\n\nexport interface IAddToOrderTemplateComponentProps extends IComponentProps {\n className?: string;\n\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n\n addToOrderTemplateButtonText: string;\n addToOrderTemplateButtonTooltip: string;\n\n addToOrderTemplateMessage?: string;\n addItemToOrderTemplateError?: string;\n\n showButtonText?: boolean;\n showButtonTooltip?: boolean;\n shouldShowButtonFailedTooltip?: boolean;\n disableButton?: boolean;\n tooltipPosition?: Popper.Placement;\n showStatusMessage?: boolean;\n disabled?: boolean;\n canAddMasterProduct?: boolean;\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n isPriceVisible: boolean;\n imageSettings?: IImageSettings;\n\n onSuccess?(): void;\n onError?(result: IOrderTemplateActionErrorResult): void;\n}\n\nexport interface IOrderTemplateActionErrorResult {\n status: 'FAILED' | 'MISSING_DIMENSION';\n\n missingDimensions?: ProductDimension[];\n}\n\ninterface IAddToOrderTemplateStateManager {\n waiting: boolean;\n content: IAddToOrderTemplateContentState;\n\n setWaiting(newWaiting: boolean): void;\n setContent(newContent: IAddToOrderTemplateContentState): void;\n}\n\ninterface IAddToOrderTemplateContentState {\n showAlert?: boolean;\n orderTemplateTextMessage?: string;\n color?: string;\n}\n\ninterface IAddToOrderTemplateData {\n orderTemplates: OrderTemplate[];\n\n product: SimpleProduct;\n quantity: number;\n\n customerInformation?: Customer;\n isChannelTypeB2B?: boolean;\n}\n\nexport interface IAddToOrderTemplateComponent extends IComponent {\n onClick(): (\n event: React.MouseEvent,\n props: IAddToOrderTemplateComponentProps,\n state: IAddToOrderTemplateStateManager\n ) => void;\n}\n\nconst onClick = async (\n _event: React.MouseEvent,\n props: IAddToOrderTemplateComponentProps,\n state: IAddToOrderTemplateStateManager,\n openModal: (opened: boolean) => void\n): Promise => {\n const { user } = props.context.request;\n\n if (state.waiting) {\n return;\n }\n\n if (!user.isAuthenticated && user.signInUrl && window) {\n window.location.assign(user.signInUrl);\n return;\n }\n\n addToOrderTemplate(props, openModal);\n state.setWaiting(false);\n};\n\nconst onDismiss = (state: IAddToOrderTemplateStateManager): void => {\n state.setContent({ color: 'success', showAlert: false });\n};\n\nconst AddToOrderTemplateComponentActions = {\n onClick,\n onDismiss\n};\n\nconst hasProductInOrderTemplates = (productToFind: SimpleProduct) => {\n /*\n TODO: Currently API does not support filtering by products.\n await getProductListLinesAsync(context, '',)\n return orderTemplates.filter(orderTemplate =>\n orderTemplate.orderTemplateLines.filter(\n product => product.productListLine.ProductId === productToFind.RecordId).length !== 0).length !== 0;\n */\n return false;\n};\n\nconst AddToOrderTemplate: React.FC = (props: IAddToOrderTemplateComponentProps) => {\n if (!isChannelTypeB2B(props.context.actionContext.requestContext)) {\n return null;\n }\n\n const [waiting, setWaiting] = useState(false);\n const [content, setContent] = useState({});\n const state: IAddToOrderTemplateStateManager = {\n waiting,\n content,\n\n setWaiting,\n setContent\n };\n\n const [addToOrderTemplateModalOpen, setAddToOrderTemplateModalOpen] = useState(false);\n\n const [chosenOrderTemplateId, setChosenOrderTemplateId] = useState(undefined);\n const [productPrice, setProductPrice] = useState(null);\n const [itemAddedToOrderTemplateDialogOpen, setItemAddedToOrderTemplateDialogOpen] = useState(false);\n const [duplicateItemsWhenAddingToOrderTemplateDialogOpen, setDuplicateItemsWhenAddingToOrderTemplateDialogOpen] = useState(false);\n const catalogId = props.catalogId;\n validateCatalogId(catalogId);\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n const executeAddItemToOrderTemplate = async (orderTemplate: ProductList) => {\n setChosenOrderTemplateId(orderTemplate.Id);\n const input = isMultipleCatalogFeatureEnabledInHq\n ? new AddItemToOrderTemplateInput(\n orderTemplate.Id,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea',\n isMultipleCatalogFeatureEnabledInHq,\n catalogId\n )\n : new AddItemToOrderTemplateInput(\n orderTemplate.Id,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea'\n );\n await addItemToOrderTemplate(input, props.context.actionContext)\n .then(async result => {\n const retrievedProductPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(\n props.data.product.RecordId,\n props.context.actionContext.requestContext.apiSettings.channelId,\n props.data.product\n ),\n props.context.actionContext\n );\n setProductPrice(retrievedProductPrice);\n setAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setItemAddedToOrderTemplateDialogOpen(true);\n }, 500);\n })\n .catch(error => {\n if (error.error?.name !== 'Microsoft_Dynamics_Commerce_Runtime_DuplicateObject') {\n return AsyncResult.reject(error);\n }\n setAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(true);\n }, 500);\n return AsyncResult.resolve();\n });\n };\n\n const onDuplicateDialogCancel = () => {\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(false);\n setTimeout(() => {\n setAddToOrderTemplateModalOpen(true);\n }, 500);\n };\n\n const overrideQuantity = async () => {\n const input = isMultipleCatalogFeatureEnabledInHq\n ? new UpdateOrderTemplateInput(\n chosenOrderTemplateId!,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea',\n isMultipleCatalogFeatureEnabledInHq,\n catalogId\n )\n : new UpdateOrderTemplateInput(\n chosenOrderTemplateId!,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea'\n );\n await updateOrderTemplateAction(input, props.context.actionContext);\n\n const retrievedProductPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(\n props.data.product.RecordId,\n props.context.actionContext.requestContext.apiSettings.channelId,\n props.data.product\n ),\n props.context.actionContext\n );\n setProductPrice(retrievedProductPrice);\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(false);\n setTimeout(() => {\n setItemAddedToOrderTemplateDialogOpen(true);\n }, 500);\n };\n\n const {\n addToOrderTemplateButtonText,\n showStatusMessage,\n showButtonText,\n className,\n disabled,\n showButtonTooltip,\n shouldShowButtonFailedTooltip,\n disableButton,\n tooltipPosition,\n addToOrderTemplateButtonTooltip,\n addToOrderTemplateDialogResources,\n createOrderTemplateDialogResources\n } = props;\n\n const onDismissHandler = () => {\n AddToOrderTemplateComponentActions.onDismiss(state);\n };\n const ariaLabel = addToOrderTemplateButtonText;\n const addToOrderTemplateRef: React.RefObject = React.createRef();\n const showMessage = showStatusMessage !== undefined ? showStatusMessage : true;\n const showTooltip = showButtonTooltip !== undefined ? showButtonTooltip : true;\n const tooltipPos = showButtonTooltip !== undefined ? tooltipPosition : 'top-end';\n\n const dialogData: IAddToOrderTemplateDialogData = {\n orderTemplates: props.data.orderTemplates\n };\n\n const onClickHandler = (event: React.MouseEvent) => {\n return AddToOrderTemplateComponentActions.onClick(event, props, state, setAddToOrderTemplateModalOpen);\n };\n\n return (\n <>\n <>\n \n {showButtonText ? ariaLabel : ''}\n \n {showTooltip && (\n \n {shouldShowButtonFailedTooltip ? addToOrderTemplateButtonTooltip : ariaLabel}\n \n )}\n \n {state.content.showAlert && showMessage ? (\n
\n \n {state.content.orderTemplateTextMessage}\n \n
\n ) : (\n ''\n )}\n \n {chosenOrderTemplateId && productPrice && (\n \n )}\n \n \n );\n};\n\nconst addToOrderTemplate = (props: IAddToOrderTemplateComponentProps, openModal: (opened: boolean) => void): void => {\n const { canAddMasterProduct } = props;\n\n if (props.data.product.Dimensions && !canAddMasterProduct) {\n const missingDimensions = props.data.product.Dimensions.filter(\n dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value)\n );\n\n if (missingDimensions.length > 0) {\n // At least one dimension with no value exists on the product, won't be able to proceed.\n propagateError(props, { status: 'MISSING_DIMENSION', missingDimensions });\n return;\n }\n }\n\n openModal(true);\n};\n\nconst propagateError = (props: IAddToOrderTemplateComponentProps, result: IOrderTemplateActionErrorResult): void => {\n const { onError } = props;\n\n if (onError) {\n onError(result);\n }\n};\n\nexport const AddToOrderTemplateComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IAddToOrderTemplateComponent\n>('AddToOrderTemplate', { component: AddToOrderTemplate, ...AddToOrderTemplateComponentActions });\n","// import msdyn365Commerce, { IComponent, IComponentProps } from \"@msdyn365-commerce/core-internal\";\r\nimport React from \"react\";\r\n\r\nexport interface IProductNotPurchasableProps{\r\n isInActiveProduct?: boolean;\r\n isPriceUnavailable?: boolean;\r\n}\r\n\r\n// export interface IProductNotPurchasable extends IComponent{}\r\n\r\nexport const ProductNotPurchasableComponent = (props: IProductNotPurchasableProps): JSX.Element | null => {\r\n // let isShowMsg: boolean;\r\n // if(props.isInActiveProduct)\r\n // isShowMsg = props.isInActiveProduct;\r\n // if(props.isPriceUnavailable)\r\n // isShowMsg = props.isPriceUnavailable;\r\n if(props && props.isInActiveProduct)\r\n {\r\n return (\r\n Discontinued product\r\n );\r\n }\r\n if(props && props.isPriceUnavailable)\r\n {\r\n return (\r\n \r\n You are not authorized to purchase this product. Please contact the Sales team if you wish to purchase this product.\r\n \r\n );\r\n }\r\nreturn (\r\n \r\n );\r\n};\r\n\r\n\r\n// export const ProductNotPurchasableComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n// 'productNotPurchasable',\r\n// { component: productNotPurchasable }\r\n// );\r\n\r\n// export default ProductNotPurchasableComponent;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IComponentProps, ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { PriceComponent } from '../../views/components/price.components';\n\nexport interface IItemAddedToOrderTemplateDialogResources {\n viewOrderTemplateButtonText: string;\n continueShoppingButtonText: string;\n itemAddedToOrderTemplateHeaderItemOneText: string;\n itemAddedToOrderTemplateHeaderItemFormatText: string;\n itemAddedToOrderTemplateHeaderMessageText: string;\n\n freePriceText: string;\n originalPriceText: string;\n currentPriceText: string;\n}\n\nexport interface IItemAddedToOrderTemplateDialogData {\n product: SimpleProduct;\n productPrice: ProductPrice;\n quantity: number;\n orderTemplateId: string;\n}\n\nexport interface IItemAddedToOrderTemplateDialogProps extends IComponentProps {\n className: string;\n\n dialogStrings: IItemAddedToOrderTemplateDialogResources;\n\n modalOpen: boolean | undefined;\n\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n imageSettings?: IImageSettings;\n}\n\nconst renderOrderTemplateImage = (context: ICoreContext, className: string, product: SimpleProduct, imageSettings?: IImageSettings) => {\n const fallbackImageUrl = getFallbackImageUrl(\n product.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n );\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n lg: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n xl: { q: 'w=140&h=140&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n return (\n \n );\n};\n\nexport const ItemAddedToOrderTemplateDialog = (dialogProps: IItemAddedToOrderTemplateDialogProps) => {\n const {\n dialogStrings,\n className,\n context,\n modalOpen,\n imageSettings,\n data: { orderTemplateId, product, productPrice, quantity }\n } = dialogProps;\n\n const getOrderTemplatePageUrl = (): string => {\n const url = getUrlSync('ordertemplate', context.actionContext) || '';\n const separator = url.includes('?') ? '&' : '?';\n return `${url}${separator}id=${orderTemplateId}`;\n };\n\n const close: () => void = () => {\n window.location.reload(true);\n };\n\n const itemsString =\n quantity === 1\n ? dialogStrings.itemAddedToOrderTemplateHeaderItemOneText\n : dialogStrings.itemAddedToOrderTemplateHeaderItemFormatText.replace('{0}', quantity.toString());\n\n return (\n \n \n {itemsString}\n {dialogStrings.itemAddedToOrderTemplateHeaderMessageText}\n \n \n
\n {renderOrderTemplateImage(context, `${className}__dialog`, product, imageSettings)}\n
\n
{product.Name}
\n
\n {productPrice && (\n \n )}\n
\n {product.Dimensions && (\n
\n {product.Dimensions.map(dimension => dimension.DimensionValue?.Value)\n .filter(value => value)\n .join(', ')}\n
\n )}\n
\n
\n
\n \n \n {dialogStrings.viewOrderTemplateButtonText}\n \n \n {dialogStrings.continueShoppingButtonText}\n \n \n
\n );\n};\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n\r\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface IItemAddedToCartDialogProps {\r\n className: string;\r\n alternateItem: boolean;\r\n isSoftSupresede: boolean;\r\n isBackOrdered: boolean;\r\n modalHeader: string;\r\n modalBodyText: string;\r\n modalOpen: boolean | undefined;\r\n quantity: number;\r\n isLimitedBackOrdered: boolean;\r\n onClose(): void;\r\n onClosePopup(): void;\r\n _addItemToCartCustom(quantity: number): void;\r\n onSoftSupresedeYesClick(quantity: number): void;\r\n onSoftSupresedeNoClick(quantity: number): void;\r\n}\r\n\r\nexport const ConfirmAddedToCartDialog = (dialogProps: IItemAddedToCartDialogProps) => {\r\n const {\r\n\r\n className,\r\n\r\n modalOpen\r\n\r\n } = dialogProps;\r\n\r\n\r\n const close: () => void = () => {\r\n dialogProps.onClose();\r\n };\r\n\r\n const _addItemToCartCustom: () => void = () => {\r\n dialogProps._addItemToCartCustom(dialogProps.quantity);\r\n };\r\n\r\n const closePopup: () => void = () => {\r\n dialogProps.onClosePopup();\r\n };\r\n\r\n const onSoftSupresedeYesClick: () => void = () => {\r\n dialogProps.onSoftSupresedeYesClick(dialogProps.quantity);\r\n };\r\n\r\n const onSoftSupresedeNoClick: () => void = () => {\r\n dialogProps.onSoftSupresedeNoClick(dialogProps.quantity);\r\n };\r\n\r\n return (\r\n \r\n \r\n {dialogProps.modalHeader}\r\n \r\n \r\n
\r\n \r\n \r\n {!dialogProps.alternateItem ? dialogProps.isSoftSupresede ? ((
\r\n {/* \r\n BackOrder\r\n */}\r\n \r\n {'Cancel'}\r\n \r\n
)) : dialogProps.isSoftSupresede ? ((
\r\n Yes\r\n \r\n \r\n {'No'}\r\n \r\n
)) : (
\r\n Yes\r\n \r\n \r\n {'No'}\r\n \r\n
) : (\r\n Close\r\n )}\r\n\r\n \r\n \r\n );\r\n};\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { getCatalogId, IComponent, IComponentProps, IGridSettings, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLineValidationResults, CartsDataActions, CommerceProperty, Customer, format,\n ProductAvailableQuantity, ProductDimension, ProductPrice,\n ProductsDataActions, ProductSearchCriteria, ProductType, SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ErrorNotification, NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\nimport { ArrayExtensions, generateProductImageUrl, ObjectExtensions, IProductInventoryInformation, DeliveryMode } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { Popup, IPopupProps } from '../../../themes/adventureworks/views/components/Popup';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\nimport { IAlternateItems } from './buybox-components';\nimport {//AllowBackorder,\n IAlternateProduct} from '../../../themes/adventureworks/views/common/buyboxInterface';\nimport {\n IItemsAddedToCartResources,\n ItemsAddedToCartDialogComponent,\n ItemSuccessfullyAddedToCartNotification,\n MultiItemsSuccessfullyAddedToCartNotification,\n OrderDetailsProduct\n} from '@msdyn365-commerce/components';\nimport { PriceComponent } from '../../../themes/adventureworks/views/components/price.components';\nimport { ConfirmAddedToCartDialog } from './add-to-cart-confirmation-dialog-component';\n/**\n * Interface for add to cart resources.\n */\nexport interface IAddToCartResources {\n goToCartText: string;\n continueShoppingText: string;\n closeNotificationLabel: string;\n headerItemOneText: string;\n headerItemFormatText: string;\n headerLinesFormatText?: string;\n headerMessageText: string;\n freePriceText: string;\n originalPriceText: string;\n currentPriceText: string;\n addedQuantityText: string;\n buyAgainNotificationTitle?: string;\n buyAgainNotificationCloseAriaLabel?: string;\n validationErrorMessage?: string;\n oneErrorText?: string;\n multiErrorsText?: string;\n}\n\n/**\n * Interface for add to cart components props.\n */\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice } | undefined> {\n className?: string;\n addToCartText: string;\n outOfStockText?: string;\n disabled?: boolean;\n quantity?: number;\n navigationUrl?: string;\n productAvailability?: ProductAvailableQuantity;\n getSelectedProduct?: Promise;\n isNavigationToCartPageDisabled?: boolean;\n shouldSkipSiteSettings?: boolean;\n addToCartArialLabel?: string;\n products?: {\n productId: number;\n quantity: number;\n catalogId?: number;\n }[];\n orderDetailsProducts?: OrderDetailsProduct[];\n hasAvailableProducts?: boolean;\n imageSettings?: IImageSettings;\n gridSettings?: IGridSettings;\n confirmHeaderText?: string;\n confirmBodyText?: string;\n alternateItemHeaderText?: string;\n alternateItemBodyText?: string;\n confirmStateHeaderText?: string;\n confirmStateBodyText?: string;\n isLoading?: boolean;\n isItemSupersed: boolean;\n isItemSoftSupersed: boolean;\n isLimitedBackOrdered: boolean;\n isUpdatingDimension?: boolean;\n isLoadingDeliveryOptions?: boolean;\n isUpdatingDeliveryOptions?: boolean;\n isAddServiceItemToCart?: boolean;\n isAddEmailDeliveryItemToCart?: boolean;\n isPriceKeyedIn?: boolean;\n customPriceAmount?: number;\n isOrderQuantityLimitsFeatureEnabled?: boolean;\n isBackOrdered: boolean;\n dialogStrings?: IAddToCartResources;\n softAlternateItemPopUpHeader?: string;\n softAlternateItemPopUpBody?: string;\n limitedBackorderedHeader?: string;\n limitedBackorderedBody?: string;\n telemetryContent?: ITelemetryContent;\n\n catalogId?: number;\n\n isCustomPriceSelected?: boolean;\n maximumKeyInPrice?: number;\n minimumKeyInPrice?: number;\n defaultMaximumKeyInPrice?: number;\n defaultMinimumKeyInPrice?: number;\n isProductQuantityLoading?: boolean;\n\n isAlternateItemAvailable: boolean;\n\n onAdd?(result: ICartActionResult, allowClose?: boolean): void;\n onQuickViewClosePopup(allowClose?: boolean): void;\n onError?(result: IAddToCartCustomFailureResult): void;\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\n changeConfirmPopupMessage(confirmHeaderText: string, confirmBodyText: string, isItemSupersede: boolean): void;\n updateSoftSupresedeFlag(isItemSoftSupresede: boolean): void;\n updateLimitedBackordered(isLimitedBackordered: boolean): void;\n updateBackOrdered(isBackOrdered: boolean): void;\n alternateItem?: IAlternateItems;\n inventoryLabel?: string;\n alternateProduct?: IAlternateProduct;\n customerInfo?: Customer;\n isOversizedItem?: boolean;\n isAlternateOversized?: boolean;\n cartState:ICartState;\n alternateProductPrice?: ProductPrice[];\n isPriceMinMaxEnabled?: boolean;\n priceRangeSeparator?: string;\n}\n\n/**\n * Cart action Failure reason type.\n */\nexport declare type ICartActionFailureReason = 'EMPTYINPUT' | 'MISSINGDIMENSION' | 'OUTOFSTOCK' | 'CARTACTIONFAILED' | 'INVALIDCUSTOMAMOUNT' | 'INVALIDQUANTITY' |'CUSTOMQUNTITYLIMIT';\n\n/**\n * Interface for add to cart failure result.\n */\nexport interface IAddToCartCustomFailureResult {\n failureReason: ICartActionFailureReason;\n alternateItem?: IAlternateItems;\n alternateProduct?: IAlternateProduct;\n stockLeft?: number;\n cartActionResult?: ICartActionResult;\n missingDimensions?: ProductDimension[];\n}\n\n/**\n * This setting defines the experience when a product is added to cart. Corresponds to the configuration in Fabrikam.\n */\nexport enum AddToCartBehavior {\n\n /**\n * Navigate to cart page.\n */\n goToCart = 'goToCart',\n\n /**\n * Show item added to cart popup.\n */\n showModal = 'showModal',\n\n /**\n * Show mini cart popup.\n */\n showMiniCart = 'showMiniCart',\n\n /**\n * Show item added to cart notification.\n */\n showNotification = 'showNotification',\n\n /**\n * Do nothing and stay on the page.\n */\n nothing = 'nothing'\n}\n\nconst zero = 0;\nconst defaultQuantity = 1;\n\n/**\n * The propagate result.\n * @param props -- The add to cart component props.\n * @param result -- The cart action result.\n */\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult, isClose: boolean): void => {\n if (props.onAdd) {\n props.onAdd(result, isClose);\n }\n};\n\nconst updateConfirmMsg = (props: IAddToCartComponentProps, headerText: string, bdyText: string, isItemSupersede: boolean): void => {\n props.changeConfirmPopupMessage(headerText, bdyText, isItemSupersede);\n};\n\nconst updateSoftSupresedeFlag = (props: IAddToCartComponentProps, isItemSoftSupersede: boolean): void => {\n props.updateSoftSupresedeFlag(isItemSoftSupersede);\n};\n\n// const updateLimitedBackOrder = (props: IAddToCartComponentProps, isLimitedBackordered: boolean): void => {\n// props.updateLimitedBackordered(isLimitedBackordered);\n// };\n\n// const updateBackorderedFlag = (props: IAddToCartComponentProps, isItemSoftSupersedeYes: boolean): void => {\n// props.updateBackOrdered(isItemSoftSupersedeYes);\n// };\n\n/**\n * The propagate error.\n * @param props -- The add to cart component props.\n * @param result -- The add to cart failure result.\n */\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartCustomFailureResult): void => {\n if (props.onError) {\n props.onError(result);\n }\n};\n\n/**\n * Retrieves add to cart input from the component props.\n * @param props - Add to cart component props.\n * @returns Add to cart input.\n */\nconst getAddToCartInputFromProps = async (props: IAddToCartComponentProps) => {\n const products = props.orderDetailsProducts?.filter(product => !ObjectExtensions.isNullOrUndefined(product.simpleProduct));\n const input = products?.map(product => {\n return {\n product: product.simpleProduct!,\n count: ObjectExtensions.isNullOrUndefined(product.salesLine.Quantity) ? defaultQuantity : product.salesLine.Quantity,\n catalogId: product.salesLine.CatalogId\n };\n });\n\n if (ArrayExtensions.hasElements(input)) {\n return input;\n }\n\n if (ArrayExtensions.hasElements(props.products)) {\n const actionContext = props.context.actionContext;\n const apiSettings = actionContext.requestContext.apiSettings;\n\n const searchCriteriaInput: ProductSearchCriteria = {\n Context: {\n ChannelId: apiSettings.channelId,\n CatalogId: props.catalogId ?? getCatalogId(props.context.actionContext.requestContext)\n },\n IncludeAttributes: false,\n Ids: props.products.map(product => product.productId)\n };\n\n const searchResult = await ProductsDataActions.searchByCriteriaAsync(\n { callerContext: actionContext }, searchCriteriaInput);\n const productSearchResultsWithImages = searchResult.map(productSearchResult => {\n const newProductSearchResult = { ...productSearchResult };\n const newImageUrl = generateProductImageUrl(newProductSearchResult, apiSettings);\n\n if (newImageUrl) {\n newProductSearchResult.PrimaryImageUrl = newImageUrl;\n }\n\n return newProductSearchResult;\n });\n\n return props.products.map(item => {\n const productData = productSearchResultsWithImages.find(product => product.RecordId === item.productId);\n let simpleProduct: SimpleProduct;\n if (productData) {\n simpleProduct = {\n ...productData,\n ProductTypeValue: ProductType.Variant,\n AdjustedPrice: productData.Price,\n BasePrice: productData.BasePrice ?? productData.Price\n };\n } else {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Cast to simple product since only record id is available.\n simpleProduct = {\n RecordId: item.productId\n } as SimpleProduct;\n }\n\n return {\n product: simpleProduct,\n count: item.quantity,\n catalogId: item.catalogId\n };\n });\n }\n\n if (props.data?.product) {\n return [\n {\n product: props.data.product,\n count: props.quantity ?? defaultQuantity,\n catalogId: props.catalogId\n }\n ];\n }\n\n return [];\n};\n\n/**\n * Add one item to cart when it is not buy again.\n * @param props -- The props.\n * @param setDisabled -- The set disable call back.\n * @param openModal -- The open modal call back.\n */\nconst addOneItemToCart = async (props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n openModal: (opened: boolean) => void,\n setConfirmAddedToCartDialogOpen: (open: boolean) => void,\n alternateItem: IAlternateItems | undefined, alternateProduct?: IAlternateProduct, isSoftSupresedeNo?: boolean, gcBackOrderAllow?:string): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\n const data = props.data;\n const addToCartInput = await getAddToCartInputFromProps(props);\n let product = addToCartInput[0].product;\n const quantity = addToCartInput[0].count;\n\n const cartState = await getCartState(props.context.actionContext);\n // let existqty = cartState.cart.CartLines?.filter(x => x.ItemId === product.ItemId);\n // let qty = 0;\n // if (existqty) {\n // existqty.forEach(function (item, index) {\n // qty += item.Quantity!;\n // });\n\n // }\n let limitBackorder: boolean = false, backOrder: boolean = false, softSupresed: boolean = false;\n if (alternateItem && alternateProduct && alternateItem.UseAltItemId === 'InventWhen0' && props.inventoryLabel && props.inventoryLabel?.toLowerCase().search('out of stock') > -1 && !isSoftSupresedeNo) {\n softSupresed = true;\n updateSoftSupresedeFlag(props, true);\n }\n // if (props.inventoryLabel && props.inventoryLabel?.toLowerCase().search('out of stock') > -1 && (!alternateItem || !alternateProduct || (alternateItem && alternateItem.UseAltItemId !== 'Always'))) {\n // backOrder = true;\n\n // updateBackorderedFlag(props, true);\n\n // }\n // else if (props.inventoryLabel && props.inventoryLabel?.toLowerCase().search('out of stock') === -1 && (!alternateItem || !alternateProduct || (alternateItem && alternateItem.UseAltItemId !== 'Always')) && ((props.productAvailability && quantity > (props.productAvailability?.AvailableQuantity ?? 0)) || (quantity + qty > props?.productAvailability?.AvailableQuantity! ?? 0 ))) {\n // limitBackorder = true;\n // updateLimitedBackOrder(props, true);\n\n // }\n\n if (softSupresed || backOrder || limitBackorder) {\n let header: string = '', body: string = '';\n // if((backOrder || limitBackorder) && gcBackOrderAllow === AllowBackorder.Yes){\n // _addItemToCartCustom(props, setDisabled, openModal, setConfirmAddedToCartDialogOpen, quantity + qty);\n // return;\n // }\n if(softSupresed)//&& (backOrder || limitBackorder))\n {\n header = 'Confirm Supersede'; //'or Backorder option';\n //body = format(`Part Number {0} has been discontinued and superseded to {1}.
  • Click 'Continue' to add part number {1} to cart.
  • Click 'Backorder' to add part number {0} to cart.
  • Click 'Cancel' to cancel the operation.
`,product.ItemId,alternateProduct?.productDtl?.ItemId);\n body = format(`Part Number {0} has been discontinued and superseded to {1}.
  • Click 'Continue' to add part number {1} to cart.
  • Click 'Cancel' to cancel the operation.
`,product.ItemId,alternateProduct?.productDtl?.ItemId);\n }\n // else if (softSupresed)\n // {\n // header = props.softAlternateItemPopUpHeader??'';\n // body = format(props.softAlternateItemPopUpBody??'',alternateProduct!.productDtl!.ItemId);\n // }\n // else if(backOrder) {\n // if (header && header.length > 0) {\n // header = `${header} and ${props.confirmHeaderText}` ?? '';\n // body = `${body} and ${props.confirmBodyText}` ?? '';\n // }\n // else {\n // header = props.confirmHeaderText ?? '';\n // body = props.confirmBodyText ?? '';\n // }\n // }\n // else if (limitBackorder) {\n // let limitmsg: string = '';// qty = 5, ava = 8\n // if (props.productAvailability?.AvailableQuantity && props.productAvailability.AvailableQuantity < qty) {\n // limitmsg = format(props.limitedBackorderedBody ?? \"\", quantity );\n // }\n // else {\n // limitmsg = format(props.limitedBackorderedBody ?? \"\", (quantity + qty) - (props.productAvailability?.AvailableQuantity ?? 0));\n // }\n\n\n // if (header && header.length > 0) {\n // header = `${header} and ${props.limitedBackorderedHeader}` ?? '';\n // body = `${body} and ${limitmsg}`;\n // }\n // else {\n // header = props.limitedBackorderedHeader ?? '';\n // body = limitmsg;\n // }\n // }\n\n setConfirmAddedToCartDialogOpen(true);\n updateConfirmMsg(props, header, body, false);\n }\n else {\n let productAvailableQuantity = props.productAvailability && props.productAvailability.AvailableQuantity;\n //let isAlternateProduct=false,isAlternateItemOOS=false;\n if (alternateItem && alternateItem.UseAltItemId === 'Always' && alternateProduct) {\n product = alternateProduct.productDtl!;\n productAvailableQuantity = alternateProduct.productAvailibility && alternateProduct.productAvailibility[0] && alternateProduct.productAvailibility[0].ProductAvailableQuantity && alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity ? alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity : undefined;\n // existqty = cartState.cart.CartLines?.filter(x => x.ItemId === product.ItemId);\n // qty = 0;\n // isAlternateProduct = true;\n // isAlternateItemOOS= alternateProduct && alternateProduct.productAvailibility ? _getInventoryLabel(alternateProduct.productAvailibility)!.toLowerCase().search('out of stock') > -1 ? true : false : false;\n // if (existqty) {\n // existqty.forEach(function (item, index) {\n // qty += item.Quantity!;\n // });\n\n // }\n }\n //if(!isAlternateProduct || (isAlternateProduct && (!isAlternateItemOOS || gcBackOrderAllow === AllowBackorder.Yes)))\n // {\n\n const addToCartResult = await cartState.addProductToCart({\n product,\n count: quantity,\n availableQuantity: productAvailableQuantity, //&& (props.productAvailability?.AvailableQuantity === 0 || props.productAvailability?.AvailableQuantity < quantity || props.productAvailability?.AvailableQuantity < quantity + qty) ? quantity + qty : props.productAvailability?.AvailableQuantity,\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n enableStockCheck: props.context.app.config.enableStockCheck,\n isPriceKeyedIn: props.isPriceKeyedIn,\n customPrice: props.customPriceAmount,\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart,\n shouldSkipSiteSettings: props.shouldSkipSiteSettings,\n catalogId: addToCartInput[0].catalogId\n });\n if (addToCartResult.status === 'SUCCESS') {\n let allowClose: boolean = true;\n if ((alternateItem && (alternateItem.UseAltItemId === 'Always' || (alternateItem?.UseAltItemId === 'InventWhen0' && (!props.inventoryLabel || (props.inventoryLabel && props.inventoryLabel?.toLowerCase().search('out of stock') > -1))))) && alternateProduct) {\n setConfirmAddedToCartDialogOpen(true);\n updateConfirmMsg(props, props.alternateItemHeaderText!, format(props.alternateItemBodyText!, alternateProduct.productDtl?.ItemId), true);\n allowClose = false;\n if(props.isAlternateOversized)//(alternateProduct.productAvailibility && _getInventoryLabel(alternateProduct.productAvailibility)?.toLowerCase().search('out of stock') !== -1)\n {\n const cartLines = cartState && cartState.cart && cartState.cart.CartLines ? cartState.cart.CartLines.filter(x => x.ItemId === product.ItemId) : undefined;\n if(cartLines && cartLines.length > 0)\n {\n const extProp: CommerceProperty[] = [];\n const existingExtensionProp = cartState && cartState.cart && cartState.cart.ExtensionProperties;\n cartLines.forEach(cartLine => {\n const existingProp :CommerceProperty | undefined = existingExtensionProp && existingExtensionProp.length > 0 ? existingExtensionProp.find(ext=>ext.Key === cartLine.LineId) : undefined;\n if(existingProp === undefined){\n const updatedExistingProp :CommerceProperty = {Key : cartLine.LineId, Value:{StringValue: 'Oversized Item'}};\n extProp.push(updatedExistingProp);\n }\n });\n await cartState.updateExtensionProperties({newExtensionProperties: extProp});\n }\n }\n }\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\n setDisabled(false);\n openModal(true);\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\n setDisabled(false);\n const notification = new ItemSuccessfullyAddedToCartNotification(\n props.context,\n props.dialogStrings,\n props.imageSettings,\n props.gridSettings,\n product,\n data?.price,\n quantity,\n props.navigationUrl,\n props.telemetryContent!,\n props.id,\n props.typeName\n );\n NotificationsManager.instance().addNotification(notification);\n } else if (MsDyn365.isBrowser && props.navigationUrl && !props.isNavigationToCartPageDisabled &&\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)) {\n window.location.assign(props.navigationUrl);\n } else {\n setDisabled(false);\n }\n\n if(props.isOversizedItem)\n {\n const cartLines = cartState && cartState.cart && cartState.cart.CartLines ? cartState.cart.CartLines.filter(x => x.ItemId === product.ItemId) : undefined;\n if(cartLines && cartLines.length>0)\n {\n const extProp: CommerceProperty[] = [];\n const existingExtensionProp = cartState && cartState.cart && cartState.cart.ExtensionProperties;\n cartLines.forEach(cartLine => {\n const existingProp :CommerceProperty | undefined = existingExtensionProp && existingExtensionProp.length > 0 ? existingExtensionProp.find(ext=>ext.Key === cartLine.LineId) : undefined;\n if(existingProp === undefined){\n const updatedExistingProp :CommerceProperty = {Key : cartLine.LineId, Value:{StringValue: 'Oversized Item'}};\n extProp.push(updatedExistingProp);\n }\n });\n await cartState.updateExtensionProperties({newExtensionProperties: extProp});\n\n }\n }\n propagateResult(props, addToCartResult, allowClose);\n } else {\n NotificationsManager.instance().addNotification(new ErrorNotification(\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\n props.dialogStrings?.closeNotificationLabel ?? ''));\n\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\n setDisabled(false);\n }\n // }\n // else if(isAlternateProduct && isAlternateItemOOS)\n // {\n // updateSoftSupresedeFlag(props, true);\n // setConfirmAddedToCartDialogOpen(true);\n // let etaDateStr:string = '';\n // if(alternateProduct?.etaDetails && alternateProduct?.etaDetails.ETADate && alternateProduct.etaDetails.ResultMessage)\n // {\n // const resultMsg: string = alternateProduct.etaDetails.ResultMessage;\n // if(resultMsg && resultMsg.toLowerCase().search('no eta') === -1)\n // {\n // const etaDate = new Date(alternateProduct?.etaDetails.ETADate??'');\n // etaDateStr = `${etaDate.toLocaleString('default', { month: 'short' }) } ${ etaDate.getDate() }, ${ etaDate.getFullYear()}`; //etaDate.toDateString();\n // }\n\n // }\n // updateConfirmMsg(props, props.alternateItemHeaderText!, format('The current part number has been superseded to {0}, which is not in stock. We expect to have it in stock around {1}. We can fulfill your order when this item becomes available. Do you want us to fulfill your order when stock is available?', alternateProduct?.productDtl?.ItemId,etaDateStr), false);\n // }\n\n }\n // if(isAddtoCart){\n\n // }\n // else{\n // setDisabled(false);\n // }\n};\n\nconst _getInventoryLabel = (productQty : IProductInventoryInformation[]|undefined) => {\n if(productQty)\n {\n const newShippingQuantity = productQty.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\n if(newShippingQuantity)\n {\n return newShippingQuantity.StockLevelLabel;\n }\n }\n return '';\n};\n\nconst _addItemToCartCustom = async (props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n openModal: (opened: boolean) => void,\n setConfirmAddedToCartDialogOpen: (opened: boolean) => void,\n currentQty: number, isItemSoftSupersedeYes?: boolean): Promise => {\n //setConfirmAddedToCartDialogOpen(false);\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\n const data = props.data;\n const addToCartInput = await getAddToCartInputFromProps(props);\n let product = addToCartInput[0].product;\n let availQty = props.productAvailability && props.productAvailability.AvailableQuantity;\n const quantity = addToCartInput[0].count === currentQty ? addToCartInput[0].count : currentQty;\n if (isItemSoftSupersedeYes && props.alternateProduct) {\n product = props.alternateProduct.productDtl!;\n availQty = props.alternateProduct.productAvailibility && props.alternateProduct.productAvailibility[0].ProductAvailableQuantity && props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity ? props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity : 0;\n }\n const cartState = await getCartState(props.context.actionContext);\n // const existqty = cartState.cart.CartLines?.filter(x => x.ItemId === product.ItemId);\n // if (existqty) {\n // existqty.forEach(function (item, index) {\n // qty += item.Quantity!;\n // });\n\n // }\n\n const addToCartResult = await cartState.addProductToCart({\n product,\n count: quantity,\n availableQuantity: availQty,//props.productAvailability !== undefined && props.productAvailability.AvailableQuantity ? props.productAvailability.AvailableQuantity : undefined, //!== undefined && (props.productAvailability?.AvailableQuantity === 0 || props.productAvailability?.AvailableQuantity < quantity || props.productAvailability?.AvailableQuantity < quantity + qty) ? quantity + qty : props.productAvailability?.AvailableQuantity,\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n enableStockCheck: props.context.app.config.enableStockCheck,\n isPriceKeyedIn: props.isPriceKeyedIn,\n customPrice: props.customPriceAmount,\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart,\n shouldSkipSiteSettings: props.shouldSkipSiteSettings,\n catalogId: addToCartInput[0].catalogId\n });\n if (addToCartResult.status === 'SUCCESS') {\n let allowClose: boolean = true;\n if (isItemSoftSupersedeYes) {\n if(props.alternateProduct && props.alternateItem && (props.alternateItem.UseAltItemId.search('Always') === -1 || (props.alternateItem.UseAltItemId.search('Always') > -1 && (!props.alternateProduct.productAvailibility ||(props.alternateProduct.productAvailibility && _getInventoryLabel(props.alternateProduct.productAvailibility)?.toLowerCase().search('out of stock') === -1)))))\n {\n updateConfirmMsg(props, props.alternateItemHeaderText!, format(props.alternateItemBodyText!, props.alternateProduct?.productDtl?.ItemId), true);\n setConfirmAddedToCartDialogOpen(true);\n }\n allowClose = false;\n }\n else{\n setConfirmAddedToCartDialogOpen(false);\n // const cartLines = cartState && cartState.cart && cartState.cart.CartLines ? cartState.cart.CartLines.filter(x => x.ItemId === product.ItemId) : undefined;\n // if(cartLines && cartLines.length>0 && props.inventoryLabel?.toLowerCase().search('out of stock') !== -1)\n // {\n // const extProp: CommerceProperty[] = [];\n // const existingExtensionProp = cartState && cartState.cart && cartState.cart.ExtensionProperties;\n // cartLines.forEach(cartLine => {\n // const existingProp :CommerceProperty | undefined = existingExtensionProp && existingExtensionProp.length > 0 ? existingExtensionProp.find(ext=>ext.Key === cartLine.LineId) : undefined;\n // if(existingProp === undefined){\n // const updatedExistingProp :CommerceProperty = {Key : cartLine.LineId, Value:{StringValue: 'Backorder'}};\n // extProp.push(updatedExistingProp);\n // }\n // });\n // await cartState.updateExtensionProperties({newExtensionProperties: extProp});\n\n // }\n\n }\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\n setDisabled(false);\n openModal(true);\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\n setDisabled(false);\n const notification = new ItemSuccessfullyAddedToCartNotification(\n props.context,\n props.dialogStrings,\n props.imageSettings,\n props.gridSettings,\n product,\n data?.price,\n quantity,\n props.navigationUrl,\n props.telemetryContent!,\n props.id,\n props.typeName\n );\n NotificationsManager.instance().addNotification(notification);\n } else if (MsDyn365.isBrowser && props.navigationUrl && !props.isNavigationToCartPageDisabled &&\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)) {\n window.location.assign(props.navigationUrl);\n } else {\n setDisabled(false);\n }\n if(props.isOversizedItem)\n {\n const cartLines = cartState && cartState.cart && cartState.cart.CartLines ? cartState.cart.CartLines.filter(x => x.ItemId === product.ItemId) : undefined;\n if(cartLines && cartLines.length>0)\n {\n const extProp: CommerceProperty[] = [];\n const existingExtensionProp = cartState && cartState.cart && cartState.cart.ExtensionProperties;\n cartLines.forEach(cartLine => {\n const existingProp :CommerceProperty | undefined = existingExtensionProp && existingExtensionProp.length > 0 ? existingExtensionProp.find(ext=>ext.Key === cartLine.LineId) : undefined;\n if(existingProp === undefined){\n const updatedExistingProp :CommerceProperty = {Key : cartLine.LineId, Value:{StringValue: 'Oversized Item'}};\n extProp.push(updatedExistingProp);\n }\n });\n await cartState.updateExtensionProperties({newExtensionProperties: extProp});\n\n }\n }\n propagateResult(props, addToCartResult, allowClose);\n } else {\n NotificationsManager.instance().addNotification(new ErrorNotification(\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\n props.dialogStrings?.closeNotificationLabel ?? ''));\n\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult,alternateItem: props.alternateItem, alternateProduct: props.alternateProduct });\n setDisabled(false);\n }\n};\n/**\n * Callback to handle success of adding to cart.\n * @param props - Add to cart component props.\n * @param setDisabled - Callback to update disabled state of the component.\n * @param setItemsAddedToCartDialogOpen - Callback to update disabled state of the component.\n * @param setErrorMessage - Callback to update error message state of the component.\n * @param cartState - Current cart state.\n * @param addToCartInput - Input used for adding to cart.\n * @param addToCartResult - Result of adding to cart.\n */\nconst handleAddItemsToCartSuccess = async (props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\n setErrorMessage: (message: string) => void,\n cartState: ICartState,\n addToCartInput: {\n product: SimpleProduct;\n count: number;\n }[],\n addToCartResult: ICartActionResult) => {\n\n // Validate cart for line errors.\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\n { callerContext: props.context.actionContext, bypassCache: 'none' },\n cartState.cart.Id, cartState.cart.Version\n );\n const errorCount = (validationResult.ValidationFailuresByCartLines ?? []).length;\n const singleErrorCount = 1;\n const errorText = errorCount === singleErrorCount ? props.dialogStrings?.oneErrorText : props.dialogStrings?.multiErrorsText;\n const errorMessage = errorCount > zero ? format(props.dialogStrings?.validationErrorMessage ?? '', errorCount.toString(), errorText) : '';\n\n setErrorMessage(errorMessage);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\n\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\n setDisabled(false);\n setItemsAddedToCartDialogOpen(true);\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\n setDisabled(false);\n const itemsAddedResource: IItemsAddedToCartResources = {\n viewCartButtonText: props.dialogStrings.goToCartText,\n closeButtonLabel: props.dialogStrings.closeNotificationLabel,\n itemsAddedToCartHeaderText: props.dialogStrings.headerMessageText,\n itemsAddedToCartFormatText: props.dialogStrings.headerItemFormatText,\n linesAddedToCartFormatText: props.dialogStrings.headerLinesFormatText ?? '{0}',\n itemsAddedValidationErrorMessage: errorMessage\n };\n\n const notification = new MultiItemsSuccessfullyAddedToCartNotification(\n props.context,\n itemsAddedResource,\n props.imageSettings,\n props.gridSettings,\n addToCartInput,\n props.navigationUrl,\n props.telemetryContent!,\n props.id,\n props.typeName);\n NotificationsManager.instance().addNotification(notification);\n } else if (MsDyn365.isBrowser && props.navigationUrl && !props.isNavigationToCartPageDisabled &&\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)) {\n window.location.assign(props.navigationUrl);\n } else {\n setDisabled(false);\n }\n propagateResult(props, addToCartResult, true);\n};\n\n/**\n * Add one or multi item to cart from buy again.\n * @param props -- The props.\n * @param setDisabled -- The set disable call back.\n * @param setItemsAddedToCartDialogOpen -- The open modal call back.\n * @param setErrorMessage -- The set error message call back.\n */\nconst addItemsToCart = async (props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\n setErrorMessage: (message: string) => void): Promise => {\n\n const addToCartInput = await getAddToCartInputFromProps(props);\n\n if (!ArrayExtensions.hasElements(addToCartInput)) {\n return;\n }\n\n const cartState = await getCartState(props.context.actionContext);\n const addToCartResult = await cartState.addProductsToCart(addToCartInput);\n\n if (addToCartResult.status === 'SUCCESS') {\n await handleAddItemsToCartSuccess(\n props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage,\n cartState, addToCartInput, addToCartResult);\n } else {\n if (props.dialogStrings?.buyAgainNotificationTitle) {\n // For buy again show simple error notification.\n NotificationsManager.instance().addNotification(new ErrorNotification(\n props.dialogStrings.buyAgainNotificationTitle,\n props.dialogStrings.buyAgainNotificationCloseAriaLabel ?? ''));\n } else {\n NotificationsManager.instance().addNotification(new ErrorNotification(\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\n props.dialogStrings?.closeNotificationLabel ?? ''));\n }\n\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\n setDisabled(false);\n }\n};\n\n/**\n * Interface for add to cart component.\n */\nexport interface IAddtoCartComponent extends IComponent {\n onClick(): (event: React.MouseEvent, props: IAddToCartComponentProps) => void;\n}\n\n/**\n * On click function.\n * @param _event - The mouse event.\n * @param props - The props.\n * @param setDisabled - Flag to define whether the element is disabled.\n * @param openModal - Flag to specify if it should open in a modal window.\n * @param setItemsAddedToCartDialogOpen - Sets items added to cart while dialog is open.\n * @param setErrorMessage - Error message.\n */\nconst onClick = async (_event: React.MouseEvent,\n props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n openModal: (opened: boolean) => void,\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\n setConfirmAddedToCartDialogOpen: (opened: boolean) => void,\n setErrorMessage: (message: string) => void,\n gcBackOrderAllow?: string): Promise => {\n if (!ArrayExtensions.hasElements(props.products)) {\n props.cartState = await getCartState(props.context.actionContext);\n const cartError = addToCartError(props);\n\n if (cartError) {\n propagateError(props, cartError);\n return;\n }\n\n setDisabled(true);\n }\n\n const hasOrderDetailsProducts = ArrayExtensions.hasElements(props.orderDetailsProducts) && props.orderDetailsProducts.length > defaultQuantity;\n const hasProducts = ArrayExtensions.hasElements(props.products) && props.products.length > defaultQuantity;\n\n const hasMultipleProducts = hasOrderDetailsProducts || hasProducts;\n\n if (props.shouldSkipSiteSettings && hasMultipleProducts) {\n await addItemsToCart(props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage);\n } else {\n await addOneItemToCart(props, setDisabled, openModal, setConfirmAddedToCartDialogOpen, props.alternateItem, props.alternateProduct, undefined ,gcBackOrderAllow);\n }\n};\n\n/**\n * Add to cart component action constant.\n */\nconst AddToCartComponentActions = {\n onClick\n};\n\n/**\n * Add to cart component.\n * @param props - The props.\n * @returns - The add to cart component.\n */\nexport const AddToCartFunctionalComponent: React.FC = (props: IAddToCartComponentProps) => {\n const [disabled, setDisabled] = useState(false);\n const [modalOpen, setModalOpen] = useState(false);\n const [isItemsAddedToCartDialogOpen, setItemsAddedToCartDialogOpen] = useState(false);\n const [isConfirmAddedToCartDialogOpen, setConfirmAddedToCartDialogOpen] = useState(false);\n const [gcBackOrderAllow, setgcBackOrderAllow] = useState('');\n const [errorMessage, setErrorMessage] = useState('');\n const [addToCartInput, setAddToCartInput] = useState<{\n product: SimpleProduct;\n count: number;\n }[]>([]);\n const onClickHandler = async (event: React.MouseEvent) => {\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setItemsAddedToCartDialogOpen, setConfirmAddedToCartDialogOpen, setErrorMessage, gcBackOrderAllow);\n };\n\n /**\n * Close dialog.\n */\n const closeItemsAddedToCartDialog = React.useCallback(() => {\n setItemsAddedToCartDialogOpen(false);\n }, []);\n\n const closeConfirmAddedToCartDialog = React.useCallback(() => {\n setConfirmAddedToCartDialogOpen(false);\n setDisabled(false);\n }, []);\n\n const closeConfirmAddedToCartWithQuickViewDialog = React.useCallback(() => {\n setDisabled(false);\n setConfirmAddedToCartDialogOpen(false);\n props.onQuickViewClosePopup(true);\n // propagateResult(props,null,true);\n }, []);\n\n const cofimationyesEvent = React.useCallback((qty: number) => {\n _addItemToCartCustom(props, setDisabled, setModalOpen, setConfirmAddedToCartDialogOpen, qty);\n }, []);\n\n const onSoftSupresedeyesEvent = React.useCallback((qty: number) => {\n setConfirmAddedToCartDialogOpen(false);\n _addItemToCartCustom(props, setDisabled, setModalOpen, setConfirmAddedToCartDialogOpen, qty, true);\n // props.onQuickViewClosePopup(true);\n }, []);\n\n const onSoftSupresedeNoEvent = React.useCallback((qty: number) => {\n setDisabled(false);\n setConfirmAddedToCartDialogOpen(false);\n updateSoftSupresedeFlag(props, false);\n let isHardSUpersede = false;\n if(props.alternateItem && props.alternateItem.UseAltItemId && props.alternateItem.UseAltItemId.search('Always') > -1)\n {\n isHardSUpersede = true;\n }\n if(!isHardSUpersede)\n {\n _addItemToCartCustom(props, setDisabled, setModalOpen, setConfirmAddedToCartDialogOpen, qty, false);\n }\n }, []);\n\n const popupPrice = props.alternateItem && props.alternateProduct &&(props.alternateItem.UseAltItemId === 'Always' || (props.alternateItem?.UseAltItemId === 'InventWhen0' && props.inventoryLabel && props.inventoryLabel.toLowerCase().search('out of stock') > -1) ) && props.alternateProduct && props.alternateProductPrice && props.alternateProductPrice.length > 0 ? props.alternateProductPrice[0] : props.data?.price;\n const popupProduct = props.alternateItem && props.alternateProduct &&(props.alternateItem.UseAltItemId === 'Always' || (props.alternateItem?.UseAltItemId === 'InventWhen0' && props.inventoryLabel && props.inventoryLabel.toLowerCase().search('out of stock') > -1) ) && props.alternateProduct ? props.alternateProduct.productDtl : props.data?.product;\n const priceComponent = popupPrice ? (\n ) : '';\n\n const popupProps: IPopupProps = {\n context: props.context,\n className: 'gen-add-to-cart-custom msc-add-to-cart',\n id: props.id,\n typeName: props.typeName,\n data: { product: popupProduct, price: popupPrice },\n dialogStrings: props.dialogStrings,\n imageSettings: props.imageSettings,\n gridSettings: props.context.request.gridSettings,\n productQuantity: props.quantity !== undefined ? props.quantity : defaultQuantity,\n priceComponent,\n navigationUrl: props.navigationUrl,\n modalOpen,\n setModalOpen,\n telemetryContent: props.telemetryContent\n };\n\n const itemsAddedResource: IItemsAddedToCartResources = {\n viewCartButtonText: props.dialogStrings?.goToCartText ?? '',\n closeButtonLabel: props.dialogStrings?.closeNotificationLabel ?? 'Close',\n itemsAddedToCartHeaderText: props.dialogStrings?.headerMessageText ?? '',\n itemsAddedToCartFormatText: props.dialogStrings?.headerItemFormatText ?? '',\n linesAddedToCartFormatText: props.dialogStrings?.headerLinesFormatText ?? '{0}',\n itemsAddedValidationErrorMessage: errorMessage\n };\n\n const renderModalPopup = ;\n\n const label = getLinkText(props);\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\n const buttonClassName = props.shouldSkipSiteSettings ? '' : 'msc-add-to-cart ';\n\n React.useEffect(() => {\n /**\n * Retrieves add to cart input and updates the state.\n */\n const gcBackOrdered = props.customerInfo?.ExtensionProperties?.find(f=>f.Key===\"GCALLOWBACKORDERS\")?.Value?.StringValue;\n setgcBackOrderAllow(gcBackOrdered ?? \"-1\");\n const retrieveAddToCartInput = async () => {\n const retrievedInput = await getAddToCartInputFromProps(props);\n setAddToCartInput(retrievedInput);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call async method as per the documentation of react useEffect.\n retrieveAddToCartInput();\n }, [props, setAddToCartInput]);\n return (\n <>\n {renderModalPopup}\n \n {label}\n \n \n \n\n \n );\n};\n\n// Set default props\nAddToCartFunctionalComponent.defaultProps = {\n quantity: defaultQuantity\n};\n\n/**\n * Resolves whether product is in stock.\n * @param props - The add to cart component props.\n * @returns Gets the link text.\n */\nconst getLinkText = (props: IAddToCartComponentProps): string => {\n return shouldShowOutOfStock(props, false) && props.outOfStockText ? props.outOfStockText : props.addToCartText;\n};\n\n/**\n * Resolves whether product is in stock.\n * @param props - The add to cart component props.\n * @returns The add to cart failure result.\n */\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartCustomFailureResult | undefined => {\n const { data, productAvailability, isCustomPriceSelected, customPriceAmount, maximumKeyInPrice, minimumKeyInPrice, defaultMaximumKeyInPrice = 100, defaultMinimumKeyInPrice = 10 } = props;\n const productId = data && data.product.ItemId;\n const cartLines = props.cartState && props.cartState.cart && props.cartState.cart.CartLines ? props.cartState.cart.CartLines.filter(x => x.ItemId === productId) : undefined;\n if (!data || !data.product.RecordId) {\n // No product exists, won't be able to add to cart\n return { failureReason: 'EMPTYINPUT' };\n }\n\n if (data.product.Dimensions) {\n const missingDimensions = data.product.Dimensions.filter(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value));\n\n if (ArrayExtensions.hasElements(missingDimensions)) {\n // At least one dimension with no value exists on the product, won't be able to add to cart\n return { failureReason: 'MISSINGDIMENSION', missingDimensions };\n }\n }\n const isAlternateItemOOS = props.alternateItem && (props.alternateItem.UseAltItemId === 'Always' || (props.alternateItem?.UseAltItemId === 'InventWhen0' && props.inventoryLabel && props.inventoryLabel.toLowerCase().search('out of stock') > -1) ) && props.alternateProduct && props.alternateProduct.productAvailibility ? (_getInventoryLabel(props.alternateProduct.productAvailibility)!.toLowerCase().search('out of stock') > -1)? true : false : false;\n if (shouldShowOutOfStock(props, true) || isAlternateItemOOS) {\n const defaultAvailableQuantity = 0; // Showing as out of stock if no available products found.\n let availableQuantity = props.isAlternateItemAvailable && (props.productAvailability !== undefined && props.productAvailability.AvailableQuantity !== undefined && props.productAvailability.AvailableQuantity === 0) && !isAlternateItemOOS ? props.alternateProduct && props.alternateProduct.productAvailibility && props.alternateProduct.productAvailibility[0] && props.alternateProduct.productAvailibility[0].ProductAvailableQuantity && props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity !== undefined ? props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity : defaultAvailableQuantity : productAvailability?.AvailableQuantity ?? defaultAvailableQuantity;\n if(props.alternateItem && isAlternateItemOOS)\n {\n availableQuantity = 0;\n }\n const stockLeft = Math.max(availableQuantity, defaultAvailableQuantity);\n\n return { failureReason: 'OUTOFSTOCK', stockLeft };\n }\n if(props.quantity && props.quantity > props.context.app.config.cartMaxQuantity){\n return { failureReason: 'INVALIDQUANTITY'};\n }\n\n if(cartLines && cartLines.length>0)\n {\n const lines = cartLines.filter(x => x.ItemId === data.product.ItemId);\n let sum: number = 0;\n if (lines !== null || lines !== undefined)\n {\n lines.forEach(a => sum += a.Quantity && a.Quantity ? a.Quantity : 0);\n }\n const cartLineQty = sum + (props.quantity && props.quantity? props.quantity:0);\n if((cartLineQty && cartLineQty > props.context.app.config.cartMaxQuantity))\n {\n const stockLeft = sum;\n return { failureReason: 'CUSTOMQUNTITYLIMIT',stockLeft};\n }\n }\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\n if (isCustomPriceSelected &&\n (!customPriceAmount || customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))) {\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\n }\n\n // Only allow adding to cart if not showing out of stock\n return undefined;\n};\n\n/**\n * Resolves whether product is in stock.\n * @param props - The add to cart component props.\n * @param includeCurrentQuantity - Flag to specify whether current quantity should be included.\n * @returns The dialog element.\n */\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\n if (props.context.app.config.enableStockCheck === undefined || props.context.app.config.enableStockCheck === false) {\n return false;\n }\n\n // When skip site settings do not need show out of stock on adding to cart\n if (props.shouldSkipSiteSettings) {\n return false;\n }\n\n if (\n props.isLoading ||\n props.isProductQuantityLoading ||\n props.isUpdatingDimension ||\n props.isLoadingDeliveryOptions ||\n props.isUpdatingDeliveryOptions ||\n props.isAddServiceItemToCart\n ) {\n // Out of stock turn off, don't bother showing out of stock\n return false;\n }\n\n if (!props.data || !props.data.product.RecordId) {\n // No product exists, don't bother showing out of stock\n return false;\n }\n\n const hasAvailableProducts = props.hasAvailableProducts ?? true;\n if (!hasAvailableProducts) {\n return true;\n }\n\n if (props.data.product.Dimensions) {\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\n // At least one dimension with no value exists on the product, so also don't show out of stock\n return false;\n }\n }\n\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : defaultQuantity;\n\n if(props.isAlternateItemAvailable)\n {\n if (props.alternateProduct && props.alternateProduct.productAvailibility && props.alternateProduct.productAvailibility[0] && props.alternateProduct.productAvailibility[0].ProductAvailableQuantity !== undefined && props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity !== undefined)\n {\n if(props.alternateItem && props.alternateItem.UseAltItemId && props.alternateItem.UseAltItemId === 'Always')\n {\n if(props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity >= includedQuantityNumber)\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n else if(props.alternateItem && props.alternateItem.UseAltItemId && props.alternateItem.UseAltItemId === 'InventWhen0' && props.inventoryLabel && props.inventoryLabel && props.inventoryLabel.toLowerCase().search('out of stock') > -1)\n {\n if(props.alternateProduct.productAvailibility[0].ProductAvailableQuantity.AvailableQuantity >= includedQuantityNumber)\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n else\n {\n return !(\n props.productAvailability &&\n props.productAvailability.AvailableQuantity !== undefined &&\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\n );\n }\n }\n else\n {\n return !(\n props.productAvailability &&\n props.productAvailability.AvailableQuantity !== undefined &&\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\n );\n }\n }\n\n return !(\n props.productAvailability &&\n props.productAvailability.AvailableQuantity !== undefined &&\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\n );\n};\n\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\n if (props.data?.product.Dimensions) {\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\n // At least one dimension with no value exists on the product, so also not in intermediate state\n return false;\n }\n }\n\n if (!props.isLoading && !props.isUpdatingDimension && !props.isLoadingDeliveryOptions && !props.isUpdatingDeliveryOptions) {\n return false;\n }\n\n return true;\n};\n\n// @ts-expect-error\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'AddToCart',\n { component: AddToCartFunctionalComponent, ...AddToCartComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport * as React from 'react';\n\nimport { Modal, ModalBody, ModalFooter, ModalHeader, Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\n\nexport interface IPopupProps extends IComponentProps<{ product: SimpleProduct | undefined; price: ProductPrice | undefined }> {\n dialogStrings?: {\n goToCartText: string;\n continueShoppingText: string;\n headerItemOneText: string;\n headerItemFormatText: string;\n headerMessageText: string;\n freePriceText: string;\n originalPriceText: string;\n currentPriceText: string;\n };\n\n className: string;\n imageSettings?: IImageSettings;\n gridSettings: IGridSettings | undefined;\n productQuantity: number;\n priceComponent: React.ReactNode;\n navigationUrl?: string;\n modalOpen: boolean | undefined;\n telemetryContent?: ITelemetryContent;\n setModalOpen(newValue: boolean): void;\n}\n\nexport const Popup = (popupProps: IPopupProps) => {\n const {\n dialogStrings,\n className,\n imageSettings,\n gridSettings,\n data: { product, price },\n productQuantity,\n priceComponent,\n navigationUrl,\n modalOpen,\n telemetryContent,\n setModalOpen,\n context\n } = popupProps;\n const closeModal = React.useCallback(() => {\n setModalOpen(false);\n }, [setModalOpen]);\n if (!dialogStrings || !product) {\n return null;\n }\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.ContinueShopping);\n const continueShoppingAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.ViewBagAndCheckout;\n const viewBagAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n const fallbackImageUrl = getFallbackImageUrl(\n product.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n );\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const quantity = productQuantity !== undefined ? productQuantity : 1;\n const itemsString =\n quantity === 1 ? dialogStrings.headerItemOneText : dialogStrings.headerItemFormatText.replace('{0}', quantity.toString());\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n const shouldDisplayUnitOfMeasure =\n context.app.config?.unitOfMeasureDisplayType && context.app.config.unitOfMeasureDisplayType !== 'none';\n\n const reducedDimensions: string = product.Dimensions\n ? product.Dimensions.reduce((str, productDimension) => {\n if (productDimension.DimensionValue && productDimension.DimensionValue.Value) {\n if (str) {\n return `${str}, ${productDimension.DimensionValue.Value}`;\n }\n\n return `${productDimension.DimensionValue.Value}`;\n }\n\n return str;\n }, '')\n : '';\n\n let productShorDescription : string = '';\n\n if(product && product.ExtensionProperties && typeof product.ExtensionProperties !== 'undefined')\n {\n const productDescriptionProp = product.ExtensionProperties.filter(x=> x.Key === 'GCProductDescription');\n if(productDescriptionProp && productDescriptionProp[0] && productDescriptionProp[0].Value !== undefined)\n {\n productShorDescription= productDescriptionProp[0].Value.StringValue !== undefined ? productDescriptionProp[0].Value.StringValue : '';\n }\n }\n\n return (\n \n \n {itemsString}\n {dialogStrings.headerMessageText}\n \n \n \n {product.ItemId + ': ' + product.Name}\n {reducedDimensions !== '' ?
{reducedDimensions}
: ''}\n
{productShorDescription}
\n {price ?
{priceComponent}
: ''}\n {product.DefaultUnitOfMeasure && shouldDisplayUnitOfMeasure ? (\n
\n {product.DefaultUnitOfMeasure}\n
\n ) : (\n ''\n )}\n
\n \n \n {dialogStrings.goToCartText}\n \n \n {dialogStrings.continueShoppingText}\n \n \n
\n );\n};\n\nexport default Popup;\n"],"names":["AddToOrderTemplateComponentActions","onClick","async","_event","props","state","openModal","user","context","request","waiting","isAuthenticated","signInUrl","window","location","assign","addToOrderTemplate","setWaiting","onDismiss","setContent","color","showAlert","canAddMasterProduct","data","product","Dimensions","missingDimensions","filter","dimension","DimensionValue","Value","length","propagateError","status","result","onError","AddToOrderTemplateComponent","msdyn365Commerce","createComponent","_objectSpread","component","isChannelTypeB2B","actionContext","requestContext","useState","content","addToOrderTemplateModalOpen","setAddToOrderTemplateModalOpen","chosenOrderTemplateId","setChosenOrderTemplateId","undefined","productPrice","setProductPrice","itemAddedToOrderTemplateDialogOpen","setItemAddedToOrderTemplateDialogOpen","duplicateItemsWhenAddingToOrderTemplateDialogOpen","setDuplicateItemsWhenAddingToOrderTemplateDialogOpen","catalogId","validateCatalogId","isMultipleCatalogFeatureEnabledInHq","addToOrderTemplateButtonText","showStatusMessage","showButtonText","className","disabled","showButtonTooltip","shouldShowButtonFailedTooltip","disableButton","tooltipPosition","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","ariaLabel","addToOrderTemplateRef","React","showMessage","showTooltip","tooltipPos","dialogData","orderTemplates","classnames","event","ref","UncontrolledTooltip","placement","trigger","target","Alert","isOpen","toggle","onDismissHandler","orderTemplateTextMessage","AddToOrderTemplateDialog","Object","modalOpen","setModalOpen","id","typeName","onOrderTemplateSelected","orderTemplate","Id","input","AddItemToOrderTemplateInput","RecordId","quantity","DefaultUnitOfMeasure","addItemToOrderTemplate","then","retrievedProductPrice","getPriceForSelectedVariant","PriceForSelectedVariantInput","apiSettings","channelId","setTimeout","catch","error","_error$error","name","AsyncResult","reject","resolve","ItemAddedToOrderTemplateDialog","dialogStrings","itemAddedToOrderTemplateDialogResources","imageSettings","orderTemplateId","isPriceVisible","DuplicateItemsWhenAddingToOrderTemplateDialog","duplicateItemsWhenAddingToOrderTemplateDialogResources","executeOverrideQuantity","UpdateOrderTemplateInput","updateOrderTemplateAction","onCancel","onDuplicateDialogCancel","ProductNotPurchasableComponent","isInActiveProduct","style","fontSize","isPriceUnavailable","dialogProps","close","reload","itemsString","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","replace","toString","Modal","ModalHeader","itemAddedToOrderTemplateHeaderMessageText","ModalBody","renderOrderTemplateImage","_context$request$app","fallbackImageUrl","getFallbackImageUrl","ItemId","app","config","OmniChannelMedia","cropFocalRegion","Image","src","PrimaryImageUrl","altText","Name","fallBackSrc","gridSettings","viewports","xs","q","w","h","lg","xl","lazyload","loadFailureBehavior","PriceComponent","price","freePriceText","originalPriceText","currentPriceText","map","_dimension$DimensionV","value","join","ModalFooter","Button","title","viewOrderTemplateButtonText","href","getOrderTemplatePageUrl","url","getUrlSync","separator","includes","continueShoppingButtonText","ConfirmAddedToCartDialog","onClose","closePopup","onClosePopup","onSoftSupresedeYesClick","alternateItem","modalHeader","whiteSpace","dangerouslySetInnerHTML","__html","modalBodyText","isSoftSupresede","onSoftSupresedeNoClick","_addItemToCartCustom","AddToCartBehavior","propagateResult","isClose","onAdd","updateConfirmMsg","headerText","bdyText","isItemSupersede","changeConfirmPopupMessage","updateSoftSupresedeFlag","isItemSoftSupersede","getAddToCartInputFromProps","_props$orderDetailsPr","_props$data","products","orderDetailsProducts","ObjectExtensions","isNullOrUndefined","simpleProduct","count","salesLine","Quantity","CatalogId","ArrayExtensions","hasElements","_props$catalogId","searchCriteriaInput","Context","ChannelId","getCatalogId","IncludeAttributes","Ids","productId","productSearchResultsWithImages","ProductsDataActions","callerContext","productSearchResult","newProductSearchResult","newImageUrl","generateProductImageUrl","item","productData","find","_productData$BasePric","ProductTypeValue","ProductType","Variant","AdjustedPrice","Price","BasePrice","_props$quantity","_getInventoryLabel","productQty","newShippingQuantity","shipping","deliveryType","DeliveryMode","StockLevelLabel","setDisabled","setConfirmAddedToCartDialogOpen","currentQty","isItemSoftSupersedeYes","addToCartBehavior","addToCartInput","availQty","productAvailability","AvailableQuantity","alternateProduct","productDtl","productAvailibility","ProductAvailableQuantity","cartState","getCartState","addToCartResult","addProductToCart","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isOrderQuantityLimitsFeatureEnabled","enableStockCheck","isPriceKeyedIn","customPrice","customPriceAmount","isAddEmailDeliveryItemToCart","shouldSkipSiteSettings","allowClose","_getInventoryLabel2","_props$alternateProdu","UseAltItemId","search","toLowerCase","alternateItemHeaderText","format","alternateItemBodyText","showModal","showNotification","notification","ItemSuccessfullyAddedToCartNotification","navigationUrl","telemetryContent","NotificationsManager","instance","addNotification","MsDyn365","isBrowser","isNavigationToCartPageDisabled","goToCart","isOversizedItem","cartLines","cart","CartLines","x","extProp","existingExtensionProp","ExtensionProperties","forEach","cartLine","ext","Key","LineId","updatedExistingProp","StringValue","push","updateExtensionProperties","newExtensionProperties","_addToCartResult$erro3","_addToCartResult$erro4","_props$dialogStrings$2","_props$dialogStrings2","ErrorNotification","errorDetails","LocalizedMessage","closeNotificationLabel","failureReason","cartActionResult","addItemsToCart","setItemsAddedToCartDialogOpen","setErrorMessage","addProductsToCart","_validationResult$Val","_props$dialogStrings3","_props$dialogStrings4","_props$dialogStrings$3","_props$dialogStrings5","errorCount","CartsDataActions","bypassCache","Version","ValidationFailuresByCartLines","errorText","oneErrorText","multiErrorsText","errorMessage","validationErrorMessage","_props$dialogStrings$4","itemsAddedResource","viewCartButtonText","goToCartText","closeButtonLabel","itemsAddedToCartHeaderText","headerMessageText","itemsAddedToCartFormatText","headerItemFormatText","linesAddedToCartFormatText","headerLinesFormatText","itemsAddedValidationErrorMessage","MultiItemsSuccessfullyAddedToCartNotification","handleAddItemsToCartSuccess","_props$dialogStrings6","_props$dialogStrings$5","_addToCartResult$erro5","_addToCartResult$erro6","_props$dialogStrings$6","_props$dialogStrings7","buyAgainNotificationTitle","buyAgainNotificationCloseAriaLabel","AddToCartComponentActions","gcBackOrderAllow","cartError","addToCartError","hasOrderDetailsProducts","hasProducts","hasMultipleProducts","isSoftSupresedeNo","_props$inventoryLabel","softSupresed","inventoryLabel","header","body","_alternateProduct$pro","productAvailableQuantity","_props$inventoryLabel2","_alternateProduct$pro2","isAlternateOversized","_addToCartResult$erro","_addToCartResult$erro2","_props$dialogStrings$","_props$dialogStrings","addOneItemToCart","AddToCartFunctionalComponent","_props$alternateItem","_props$data2","_props$alternateItem2","_props$data3","_props$dialogStrings8","_props$dialogStrings9","_props$dialogStrings10","_props$dialogStrings$7","_props$dialogStrings11","_props$dialogStrings$8","_props$dialogStrings12","_props$dialogStrings$9","_props$dialogStrings13","_props$dialogStrings$10","_props$dialogStrings14","_props$dialogStrings$11","_props$dialogStrings15","_props$addToCartArial","_props$addToCartArial2","isItemsAddedToCartDialogOpen","isConfirmAddedToCartDialogOpen","setgcBackOrderAllow","setAddToCartInput","closeItemsAddedToCartDialog","closeConfirmAddedToCartDialog","closeConfirmAddedToCartWithQuickViewDialog","onQuickViewClosePopup","cofimationyesEvent","qty","onSoftSupresedeyesEvent","onSoftSupresedeNoEvent","isHardSUpersede","popupPrice","alternateProductPrice","popupProduct","priceComponent","isPriceMinMaxEnabled","priceResources","priceRangeSeparator","popupProps","productQuantity","renderModalPopup","Popup","label","getLinkText","payload","getPayloadObject","TelemetryEvent","AddToCart","attributes","getTelemetryAttributes","buttonClassName","_props$customerInfo","gcBackOrdered","customerInfo","f","retrievedInput","retrieveAddToCartInput","addToCartArialLabel","isIntermediateState","shouldShowOutOfStock","ItemsAddedToCartDialogComponent","isModalOpen","confirmStateHeaderText","confirmStateBodyText","isItemSupersed","isItemSoftSupersed","isBackOrdered","isLimitedBackOrdered","defaultProps","outOfStockText","addToCartText","_props$alternateItem3","isCustomPriceSelected","maximumKeyInPrice","minimumKeyInPrice","defaultMaximumKeyInPrice","defaultMinimumKeyInPrice","isAlternateItemOOS","_productAvailability$","defaultAvailableQuantity","isAlternateItemAvailable","stockLeft","Math","max","cartMaxQuantity","lines","sum","a","cartLineQty","includeCurrentQuantity","_props$hasAvailablePr","isLoading","isProductQuantityLoading","isUpdatingDimension","isLoadingDeliveryOptions","isUpdatingDeliveryOptions","isAddServiceItemToCart","hasAvailableProducts","includedQuantityNumber","_props$data4","AddToCartComponent","_context$app$config","closeModal","payLoad","TelemetryConstant","ContinueShopping","continueShoppingAttribute","contentAction","etext","ViewBagAndCheckout","viewBagAttribute","headerItemOneText","shouldDisplayUnitOfMeasure","unitOfMeasureDisplayType","reducedDimensions","reduce","str","productDimension","productShorDescription","productDescriptionProp","onClosed","continueShoppingText"],"sourceRoot":""}