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AAA,KAAIrE,OAAAC,OAAA,GAAK1N,GAAsBK,GAC/BkP,IA0CkB8a,CAAkB5D,GAChCzhB,GAhEO4e,EAAC5e,EAA2C6hB,KAChE,MAAM,eAAE9mB,EAAc,oBAAEC,EAAmB,QAAEK,EAAO,MAAEkP,EAAK,OAAEpP,GAAW6E,EAExE,OACIhU,EAAAA,cAAC8gB,EAAAA,KAAIrE,OAAAC,OAAA,GAAK3N,GACN/O,EAAAA,cAAC8gB,EAAAA,KAAIrE,OAAAC,OAAA,GAAK1N,GACLK,EACAF,GAEJoP,EACAsX,IAsDgBjD,CAAgB5e,EAAU6hB,GACtCjB,EACAe,KAWJ2D,EAA+Dn5B,IACxE,MAAM,UAAEqzB,EAAS,gBAAEC,EAAe,YAAE3K,EAAW,eAAEzlB,GAAmBlD,EACpE,OACIH,EAAAA,cAACg5B,EAAAA,OAAMvc,OAAAC,OAAA,GAAK8W,IACNnwB,GAAkBowB,EACnB3K,GAAeiQ,EAAsB54B,KAKlD","sources":["webpack://bestseller.commerce.online/./src/modules/buybox/buybox.tsx?e22d","webpack://bestseller.commerce.online/./src/modules/bulk-purchase/bulk-purchase.tsx?9fd5","webpack://bestseller.commerce.online/./src/common/buyboxInterface.ts?9d60","webpack://bestseller.commerce.online/./src/common/utilities/error-utilities.ts?bb69","webpack://bestseller.commerce.online/./src/common/buybox-product-configure.tsx?139c","webpack://bestseller.commerce.online/./src/common/dropdown/dropdown.props.ts?7676","webpack://bestseller.commerce.online/./src/common/buybox-components.tsx?42b4","webpack://bestseller.commerce.online/./src/modules/recently-viewed/base/recently-viewed-product-item.ts?4982","webpack://bestseller.commerce.online/./src/modules/recently-viewed/base/recently-viewed-item.ts?54c9","webpack://bestseller.commerce.online/./src/modules/recently-viewed/recently-viewed-state.ts?c73b","webpack://bestseller.commerce.online/./src/modules/recently-viewed/recently-viewed-manager.ts?a2a8","webpack://bestseller.commerce.online/./src/common/dropdown/dropdown.tsx?f1d3","webpack://bestseller.commerce.online/./src/modules/quickview/utilities/helper.ts?f31d","webpack://bestseller.commerce.online/./src/modules/quickview/utilities/get-valid-product-images.ts?78b7","webpack://bestseller.commerce.online/./src/modules/quickview/quickview.tsx?4080","webpack://bestseller.commerce.online/./src/modules/quickview/utilities/get-product-details.ts?5cc2","webpack://bestseller.commerce.online/./src/modules/quickview/quickview.view.tsx?ee5b"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport {\n CommerceProperty,\n ProductCatalog,\n ProductDeliveryOptions,\n ProductDimensionValue,\n ProductDimensionValueInventoryAvailability,\n ProductPrice,\n ReleasedProductType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\nimport {\n ArrayExtensions,\n DeliveryMode,\n FinitePromiseQueue,\n FinitePromiseQueueError,\n getDeliveryOptionsForSelectedVariant,\n GetDeliveryOptionsForSelectedVariantInput,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getDimensionValuesFromQuery,\n getInventoryLevelCodeFromDimensionValue,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getSelectedVariant,\n IDimensionsApp,\n IDimensionValueForSelectedVariant,\n InventoryLevelValues,\n IProductInventoryInformation,\n IPromiseQueue,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput,\n setDimensionValuesToQuery,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getTelemetryObject,\n IModuleProps,\n INodeProps,\n ITelemetryContent,\n updateMaxQuantityForCartLineItem\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport {\n getBuyboxAddToCart,\n getBuyBoxInventoryLabel,\n getBuyboxKeyInPrice,\n getBuyboxProductAddToOrderTemplate,\n getBuyboxProductAddToWishlist,\n getBuyboxProductComparisonButton,\n getBuyboxProductDescription,\n getBuyboxProductPrice,\n getBuyboxProductQuantity,\n getBuyboxProductRating,\n getBuyboxProductTitle,\n getBuyboxProductUnitOfMeasure,\n getBuyboxShopSimilarButton,\n getQuantityLimitsMessages,\n RetailDefaultOrderQuantityLimitsFeatureName,\n EcommerceQuantityLimitConfigurationsFeatureName,\n RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\n} from '../../common/buybox-components';\nimport { getBuyboxProductConfigure } from '../../common/buybox-product-configure';\nimport {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxCallbacks,\n IBuyboxCommonData,\n IBuyboxExtentedProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxShopSimilarLookViewProps,\n IBuyboxState,\n IErrorState,\n ShopSimiliarButtonType\n} from '../../common/buyboxInterface';\nimport { IBuyboxData } from './buybox.data';\nimport { IBuyboxProps, IBuyboxResources } from './buybox.props.autogenerated';\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/buybox-find-in-store';\nimport { RecentlyViewedState } from '../recently-viewed';\n\nexport interface IBuyboxViewProps extends IBuyboxProps {\n state: IBuyboxState;\n ModuleProps: IModuleProps;\n ProductInfoContainerProps: INodeProps;\n MediaGalleryContainerProps: INodeProps;\n callbacks: IBuyboxCallbacks;\n mediaGallery?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n rating?: React.ReactNode;\n price?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n bulkPurchaseLink?: React.ReactNode;\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\n addToWishlist?: IBuyboxAddToWishlistViewProps;\n min?: number | undefined;\n max: number | undefined;\n addToCart: IBuyboxAddToCartViewProps;\n findInStore?: IBuyboxFindInStoreViewProps;\n quantity?: IBuyboxProductQuantityViewProps;\n configure?: IBuyboxProductConfigureViewProps;\n inventoryLabel?: React.ReactNode;\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\n quantityLimitsMessages: React.ReactNode;\n telemetryContent?: ITelemetryContent;\n keyInPrice?: IBuyboxKeyInPriceViewProps;\n unitOfMeasure?: React.ReactNode;\n catalogs?: ProductCatalog[] | undefined;\n isChannelMultipleCatalogsFeatureEnabled?: boolean;\n currentCatalogId?: number;\n applyDefaultOrderSettings?: boolean;\n}\n\n/**\n * Buybox Module.\n */\nclass Buybox extends React.PureComponent, IBuyboxState> {\n /**\n * A queue of tasks of processing the changes in the dimensions.\n * Limit to two processes:\n * 1 - for the current process, which is under execution at the moment.\n * 2 - next process, which will process the latest version of data.\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\n */\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\n\n private dimensions: { [id: number]: string } = {};\n private initializedDimensions: Set = new Set();\n\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\n updateQuantity: (newQuantity: number): boolean => {\n const errorState = { ...this.state.errorState };\n errorState.quantityError = undefined;\n errorState.otherError = undefined;\n\n this.setState({ quantity: newQuantity, errorState });\n return true;\n },\n updateErrorState: (newErrorState: IErrorState): void => {\n this.setState({ errorState: newErrorState });\n },\n updateSelectedProduct: (\n newSelectedProduct: Promise,\n newInventory: IProductInventoryInformation | undefined,\n newPrice: ProductPrice | undefined,\n newDeliveryOptions: ProductDeliveryOptions | undefined\n ): void => {\n this.setState({\n selectedProduct: newSelectedProduct,\n productAvailableQuantity: newInventory,\n productDeliveryOptions: newDeliveryOptions\n });\n this._updatePrice(newPrice);\n },\n initializeDimension: (initializedDimension: string): void => {\n if (initializedDimension) {\n this.initializedDimensions.add(initializedDimension);\n }\n },\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\n // Only trigger _updateDimensions when all dimensions are initialized\n if (this.initializedDimensions.size === (this.props.data.product.result?.Dimensions?.length || 0)) {\n return this.dimensionUpdateQueue\n .enqueue(async () => {\n return this._updateDimensions();\n })\n .catch((error: unknown) => {\n // Ignore discarded processes.\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\n throw error;\n }\n });\n }\n },\n getDropdownName: (dimensionType: number, resources: IBuyboxResources): string => {\n return this._getDropdownName(dimensionType, resources);\n },\n changeModalOpen: (isModalOpen: boolean): void => {\n this.setState({ modalOpen: isModalOpen });\n },\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\n this.setState({ isUpdatingDimension });\n },\n\n /**\n * Update isUpdatingDeliveryOptions state.\n *\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\n */\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\n this.setState({ isUpdatingDeliveryOptions });\n },\n\n updateKeyInPrice: (customPrice: number): void => {\n // Remove custom amount error when updating the custom price\n const errorState = { ...this.state.errorState };\n errorState.customAmountError = undefined;\n\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\n this._updatePrice(this.state.productPrice, customPrice);\n }\n };\n\n private readonly telemetryContent: ITelemetryContent;\n\n public constructor(props: IBuyboxProps, state: IBuyboxState) {\n super(props);\n this.state = {\n errorState: {\n configureErrors: {}\n },\n quantity: 1,\n min: undefined,\n max: undefined,\n selectedProduct: undefined,\n productPrice: undefined,\n productDeliveryOptions: undefined,\n\n modalOpen: false,\n isUpdatingDimension: false,\n isUpdatingDeliveryOptions: false,\n isPriceApiCalled: false\n };\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\n }\n\n public async componentDidMount(): Promise {\n const {\n data: {\n product: { result: product },\n productPrice\n },\n context\n } = this.props;\n\n // There are multiple sources triggering the callback function dimensionSelectedAsync calling the GetActivePrice api before componentDidMount and after componentDidMount.\n // Set isPriceApiCalled to false here to prevent redundant API call after componentDidMount:\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\n\n const matchedDimensions = getDimensionValuesFromQuery(this.props.context.request.url.requestUrl);\n\n // Set isPriceApiCalled to false only when variant is there\n if (matchedDimensions.length > 0) {\n this.setState({ isPriceApiCalled: false });\n } else {\n this.setState({ isPriceApiCalled: true });\n }\n\n productPrice.then(async result => {\n this._updatePrice(result);\n });\n\n if (product) {\n // Check if the product is service or not by product type\n if (product.ItemTypeValue === ReleasedProductType.Service) {\n this.setState({ isServiceItem: true });\n }\n await this._updateQuantitiesInState(product);\n }\n\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\n }\n }\n\n public render(): JSX.Element | null {\n const {\n slots: { mediaGallery, productComparisonButton },\n data: {\n product: { result: product }\n },\n config: { className = '' }\n } = this.props;\n\n const { min, max } = this.state;\n\n if (!product) {\n this.props.context.telemetry.error('Product content is empty, module wont render');\n return null;\n }\n\n const props = this.props as IBuyboxExtentedProps;\n const defaultMinimumKeyInPrice = 10;\n const defaultMaximumKeyInPrice = 100;\n\n const context = this.props.context as ICoreContext;\n const inventoryLevel = context.app.config.inventoryLevel;\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\n );\n const applyDefaultOrderSettings =\n (this.props.data.featureState?.result?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\n ?.IsEnabled ??\n false) &&\n (this.props.data.cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false);\n const hasAvailableProducts =\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\n dimensionValuesWithInventory.some((value: unknown) => {\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\n value as ProductDimensionValueInventoryAvailability,\n inventoryLevel\n );\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\n });\n const catalogId = getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n\n const viewProps: IBuyboxViewProps = {\n ...(this.props as IBuyboxProps),\n state: this.state,\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\n ModuleProps: {\n moduleProps: this.props,\n className: classnames('ms-buybox', className)\n },\n ProductInfoContainerProps: {\n className: 'ms-buybox__content'\n },\n MediaGalleryContainerProps: {\n className: 'ms-buybox__media-gallery'\n },\n telemetryContent: this.telemetryContent,\n callbacks: this.buyboxCallbacks,\n title: getBuyboxProductTitle(props),\n description: getBuyboxProductDescription(props),\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\n price: getBuyboxProductPrice(props, this.state),\n addToCart: getBuyboxAddToCart(\n props,\n this.state,\n this.buyboxCallbacks,\n defaultMinimumKeyInPrice,\n defaultMaximumKeyInPrice,\n undefined,\n hasAvailableProducts\n ),\n productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\n ? getBuyboxProductComparisonButton(\n productComparisonButton[0],\n product,\n getCatalogId(this.props.context.request),\n this.state\n )\n : undefined,\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(\n props,\n this.state,\n this.buyboxCallbacks,\n this._isChannelMultipleCatalogsFeatureEnabled(),\n catalogId\n ),\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\n inventoryLabel: getBuyBoxInventoryLabel(props),\n shopSimilarLook:\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\n : undefined,\n shopSimilarDescription:\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\n : undefined,\n keyInPrice:\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\n : undefined,\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\n min: applyDefaultOrderSettings ? min : 1,\n max,\n applyDefaultOrderSettings: applyDefaultOrderSettings,\n isChannelMultipleCatalogsFeatureEnabled: this._isChannelMultipleCatalogsFeatureEnabled(),\n currentCatalogId: catalogId,\n catalogs: this._validateCatalogDetails(catalogId)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handles anchor click event and scrolls to the given bulk purchase module.\n * @param bulkPurchaseModule - Bulk purchase module.\n * @returns Handler.\n */\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\n const scrollX = boundingRect.left + window.pageXOffset;\n const scrollY = boundingRect.top + window.pageYOffset;\n\n window.scrollTo(scrollX, scrollY);\n };\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\n let isMultipleCatalogFeatureEnabledInHq = false;\n if (this.props.data.featureState) {\n isMultipleCatalogFeatureEnabledInHq =\n this.props.data.featureState.result?.find(\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\n )?.IsEnabled || false;\n }\n return isMultipleCatalogFeatureEnabledInHq;\n };\n\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\n return null;\n }\n\n if (!msdyn365Commerce.isBrowser) {\n return null;\n }\n\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\n\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\n return null;\n }\n\n return (\n \n {this.props.resources.bulkPurchaseLinkText}\n \n );\n }\n\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\n if (this.state.isCustomPriceSelected && newPrice) {\n newPrice.CustomerContextualPrice = customPrice;\n }\n this.setState({ productPrice: newPrice });\n }\n\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\n const {\n data: {\n product: { result: product }\n },\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n\n const productDimensions = this.props.data.productDimensions.result!;\n\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\n // over the information in data\n const mappedDimensions = productDimensions\n .map(dimension => {\n const dimensions = (dimension.dimensionValuesWithInventory ??\n dimension.DimensionValues ??\n []) as IDimensionValueForSelectedVariant[];\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue:\n dimensions.find(\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\n )?.DimensionValue ?? dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n })\n .filter(dimension => dimension.DimensionValue);\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\n\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\n // so that places like add to cart can await it\n const selectedProductPromise = getSelectedVariant(\n new SelectedVariantInput(\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\n channelId,\n undefined,\n undefined,\n this.props.context.request\n ),\n actionContext\n );\n this.setState({ selectedProduct: selectedProductPromise });\n\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\n }\n\n private readonly _updateDimensions = async (): Promise => {\n const product = this.props.data.product.result;\n\n const productDimensions = this.props.data.productDimensions.result;\n\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\n\n if (!product || !hasProductDimensions) {\n return;\n }\n\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\n\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\n\n // Step 1: Clear error state to display relevant errors\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\n const clearErrorState = { ...this.state.errorState };\n clearErrorState.otherError = undefined;\n if (this.state.errorState.errorHost === 'ADDTOCART') {\n clearErrorState.quantityError = undefined;\n clearErrorState.errorHost = undefined;\n }\n this.setState({ errorState: clearErrorState });\n }\n\n // Step 2: Clear any errors indicating the dimension wasn't selected\n for (const key of Object.keys(dimensionsToUpdate)) {\n if (this.state.errorState.configureErrors[key]) {\n this.setState(previousState => {\n const errorState = previousState.errorState;\n errorState.configureErrors[key] = undefined;\n return { errorState };\n });\n }\n }\n\n const data = this._getProductVariant(dimensionsToUpdate);\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\n\n if (!productVariant) {\n return;\n }\n\n const promises: Promise[] = [\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\n this._hydrateInventoryInfo(productVariant),\n this._hydratePrice(productVariant),\n this._hydrateDeliveryOptions(productVariant),\n this._updateQuantitiesInState(productVariant)\n ];\n\n await Promise.all(promises);\n };\n\n private async _getDimensionsForSelectedVariant(\n productVariant: SimpleProduct,\n mappedDimensions: {\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\n DimensionTypeValue: number;\n DimensionValue: ProductDimensionValue | undefined;\n ExtensionProperties: CommerceProperty[] | undefined;\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\n }[]\n ): Promise {\n await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\n this.props.context.request.apiSettings.channelId,\n mappedDimensions,\n this.props.context.request\n ),\n this.props.context.actionContext\n );\n }\n\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\n // so that places like add to cart can await it\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\n new ProductAvailabilitiesForSelectedVariantInput(\n productVariant.RecordId,\n this.props.context.request.apiSettings.channelId,\n productVariant\n ),\n this.props.context.actionContext\n );\n\n const newShippingQuantity = newAvailableQuantity?.find(\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\n );\n const isCustomPriceSelected = productVariant.Dimensions?.find(\n dimension =>\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\n );\n if (isCustomPriceSelected) {\n this.setState({ isCustomPriceSelected: true });\n } else {\n this.setState(previousState => {\n const errorState = previousState.errorState;\n errorState.customAmountError = undefined;\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\n });\n }\n\n if (newShippingQuantity) {\n this.setState({ productAvailableQuantity: newShippingQuantity });\n } else {\n this.setState({ productAvailableQuantity: undefined });\n }\n }\n\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\n // This function is invoked when dimensionSelectedAsync get called.\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\n if (!this.state.isPriceApiCalled) {\n this.setState({ isPriceApiCalled: true });\n return;\n }\n\n // Step 6. Use these dimensions hydrate the product price.\n const newPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId, productVariant),\n this.props.context.actionContext\n );\n\n if (newPrice) {\n this._updatePrice(newPrice);\n }\n }\n\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n\n // Step 7. Use these dimensions hydrate the product delivery options.\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\n new GetDeliveryOptionsForSelectedVariantInput(\n productVariant.RecordId,\n this.props.context.request.apiSettings.channelId,\n productVariant,\n undefined,\n retailMultiplePickupFeatureState?.IsEnabled\n ),\n this.props.context.actionContext\n );\n\n if (newDeliveryOptions) {\n this.setState({ productDeliveryOptions: newDeliveryOptions });\n }\n }\n\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\n const isChannelLimitsFeatureEnabled = await this._isChannelLimitsFeatureEnabled();\n\n const min: number = this._getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled, product);\n const max: number = this._getMaxQuantityForCartLineItem(\n isChannelLimitsFeatureEnabled || isOrderQuantityLimitsFeatureEnabled,\n product\n );\n let quantity: number = this._getQuantity(product, isOrderQuantityLimitsFeatureEnabled);\n quantity = Math.max(quantity, min);\n\n this.setState({\n min,\n max,\n quantity\n });\n }\n\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\n if (\n isOrderQuantityLimitsFeatureEnabled &&\n this._getIgnoreOrderSettings() &&\n product?.Behavior?.MinimumQuantity &&\n product.Behavior.MinimumQuantity > 0\n ) {\n return product.Behavior.MinimumQuantity;\n }\n\n return 1;\n }\n\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\n if (\n isQuantityLimitsFeatureEnabled &&\n this._getIgnoreOrderSettings() &&\n product?.Behavior?.MaximumQuantity &&\n product.Behavior.MaximumQuantity > 0\n ) {\n return product.Behavior.MaximumQuantity;\n }\n\n return updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem);\n }\n\n /**\n * Retrieves the value of the IgnoreOrderSettings property from the cart configuration.\n * If the property is not present, it defaults to false.\n * @returns {boolean} The value of the IgnoreOrderSettings property.\n */\n private _getIgnoreOrderSettings(): boolean {\n const cartConfiguration = this.props.data.cartConfiguration;\n return !(cartConfiguration?.result?.IgnoreOrderSettings ?? false);\n }\n\n private _getQuantity(product: SimpleProduct, isOrderQuantityLimitsFeatureEnabled: boolean): number {\n const { quantity } = this.state;\n let defaultQuantity = 1;\n\n if (quantity !== defaultQuantity || !isOrderQuantityLimitsFeatureEnabled) {\n return quantity;\n }\n\n const cartConfiguration = this.props.data.cartConfiguration;\n const applyDefaultOrderSettingsForCartLine = cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false;\n if (!applyDefaultOrderSettingsForCartLine) {\n return quantity;\n }\n\n if (product?.Behavior?.DefaultQuantity && product.Behavior.DefaultQuantity > 0) {\n defaultQuantity = product.Behavior.DefaultQuantity;\n }\n\n return defaultQuantity;\n }\n\n private readonly _getDropdownName = (dimensionType: number, resources: IBuyboxResources): string => {\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\n\n switch (dimensionType) {\n case 1: // ProductDimensionType.Color\n return resources.productDimensionTypeColor;\n case 2: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // ProductDimensionType.Size\n return resources.productDimensionTypeSize;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isFeatureEnabledInHq = featureStatuses?.find(\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\n )?.IsEnabled;\n if (!isFeatureEnabledInHq) {\n return false;\n }\n const useSiteBuilderSettings = featureStatuses?.find(\n featureState => featureState.Name === RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\n )?.IsEnabled;\n\n if (useSiteBuilderSettings) {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n let customerInfo;\n try {\n customerInfo = await this.props.data.customerInformation;\n } catch (error) {\n this.props.telemetry.information(error);\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\n return false;\n }\n\n return (\n customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\n );\n } else {\n const cartConfiguration = await this.props.data.cartConfiguration;\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\n }\n }\n\n private _validateCatalogDetails(catalogId: number): ProductCatalog[] | undefined {\n const catalogs = this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId);\n if (ArrayExtensions.hasElements(catalogs) && catalogs[0].RecordId === 0) {\n return;\n }\n\n return catalogs;\n }\n\n private async _isChannelLimitsFeatureEnabled(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\n featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName\n )?.IsEnabled;\n\n return isChannelLimitsFeatureEnabledInHq ?? false;\n }\n}\n\nexport default Buybox;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\nimport { ProductDimensionsMatrix } from '@msdyn365-commerce/components';\nimport { RichTextComponent } from '@msdyn365-commerce/core';\nimport { ICoreContext, getCatalogId } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions, IDimensionsApp, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, Collapse, IModuleProps, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { FeatureState } from '@msdyn365-commerce/retail-proxy';\nimport { IBulkPurchaseData } from './bulk-purchase.data';\nimport { IBulkPurchaseProps } from './bulk-purchase.props.autogenerated';\n\n/**\n * Additional optional props for the bulk purchase.\n */\nexport interface IBulkPurchaseExtendedProps extends IBulkPurchaseProps {\n productDimensions?: IProductDimensionsWithAvailabilitiesFull[];\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseViewProps extends IBulkPurchaseProps {\n container: IModuleProps;\n content: React.ReactElement;\n}\n\n/**\n * BulkPurchase state message Interface.\n */\nexport interface IBulkPurchaseStateMessage {\n isOpen: boolean;\n messageGlyph: string;\n messageText: string;\n statusCssString: string;\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseState {\n isExpanded: boolean;\n stateMessage?: IBulkPurchaseStateMessage;\n}\n\n/**\n * Bulk-purchase module.\n */\nexport class BulkPurchase extends React.PureComponent {\n public static readonly className = 'ms-bulk-purchase';\n private readonly _errorCssClass: string = 'danger';\n private readonly _errorCssGlyphClass: string = 'fas fa-exclamation-triangle';\n private readonly collapseRef: React.RefObject = React.createRef();\n\n public constructor(props: IBulkPurchaseExtendedProps) {\n super(props);\n\n this.state = {\n isExpanded: false\n };\n }\n\n public render(): React.ReactElement | null {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n const hasDimensionsInData = ArrayExtensions.hasElements(this.props.data.productDimensions?.result);\n if (!hasDimensionsInProps && !hasDimensionsInData) {\n return null;\n }\n\n const viewProps: IBulkPurchaseViewProps = {\n ...this.props,\n container: {\n moduleProps: this.props,\n className: classnames(BulkPurchase.className, this.props.config.className)\n },\n content: this._renderCollapseContent(`${BulkPurchase.className}__content`)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _renderCollapseContent(className: string): React.ReactElement {\n return (\n
\n {this._renderCollapseButton(`${className}__collapse-button`)}\n {this._renderCollapse(`${className}__collapse`)}\n
\n );\n }\n\n private _renderCollapseButton(className: string): React.ReactElement {\n return (\n \n {this.props.resources.bulkPurchaseHeaderTitle}\n \n );\n }\n\n /**\n *This function is being used to handel variant change dropdown.\n */\n private _dimensionDropDownChange = () => {\n this.collapseRef.current?.reEvaluateHeight();\n };\n\n private _renderCollapse(className: string): React.ReactElement {\n return (\n \n {this._renderMainContent(`${className}__main-content`)}\n \n );\n }\n\n private _renderMainContent(className: string): React.ReactElement {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n const userMessageNode = this.state.stateMessage ? (\n \n \n {this.state.stateMessage.messageText}\n \n ) : (\n undefined\n );\n\n return (\n
\n {!isMobileDevice && (\n
\n \n
\n )}\n {userMessageNode}\n {this._renderMatrix(`${className}__matrix-container`)}\n
\n );\n }\n\n private _renderMatrix(className: string): React.ReactElement {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const { featureState } = this.props.data;\n const isMultipleCatalogsFeatureEnabled =\n featureState?.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n const catalogId = getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n return (\n }\n data={{\n dimensions: hasDimensionsInProps ? this.props.productDimensions! : this.props.data.productDimensions!.result!,\n orderTemplates: this.props.data.orderTemplates?.result,\n customerInformation: this.props.data.customerInformation?.result\n }}\n resources={this.props.resources}\n dimensionOnChange={this._dimensionDropDownChange}\n onErrorMessage={this._onErrorMessage}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogsFeatureEnabled}\n catalogId={catalogId}\n />\n );\n }\n\n private _onErrorMessage = (errorMessage: string) => {\n this.setState({\n stateMessage: {\n messageText: errorMessage,\n statusCssString: this._errorCssClass,\n messageGlyph: this._errorCssGlyphClass,\n isOpen: true\n }\n });\n };\n\n /**\n * Callback which toggles collapse mode.\n */\n private readonly _toggleCollapse = () => {\n this.setState(state => ({\n isExpanded: !state.isExpanded\n }));\n };\n}\n\nexport default BulkPurchase;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProductDimensionFull, RatingsSummary } from '@msdyn365-commerce/commerce-entities';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CommerceList,\n Customer,\n FeatureState,\n ProductDeliveryOptions,\n ProductPrice,\n SimpleProduct,\n CartConfiguration\n} from '@msdyn365-commerce/retail-proxy';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport {\n IDimensionForSelectedVariant,\n IProductInventoryInformation,\n ISelectedProduct,\n OrderTemplate\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\n\nexport interface IBuyboxState {\n quantity: number;\n min: number | undefined;\n max: number | undefined;\n errorState: IErrorState;\n selectedProduct?: Promise;\n productAvailableQuantity?: IProductInventoryInformation;\n productPrice?: ProductPrice;\n productDeliveryOptions?: ProductDeliveryOptions;\n modalOpen?: boolean;\n isUpdatingDimension?: boolean;\n isUpdatingDeliveryOptions?: boolean;\n isServiceItem?: boolean;\n isPriceKeyedIn?: boolean;\n keyInPriceAmount?: number;\n isCustomPriceSelected?: boolean;\n activeIndex?: number;\n animating?: boolean;\n lastUpdate?: number;\n mediaGalleryItems?: Msdyn365.IImageData[] | undefined;\n isPriceApiCalled?: boolean;\n}\n\nexport interface IBuyboxCommonData {\n deliveryOptions: AsyncResult | undefined;\n product: AsyncResult;\n productDimensions: AsyncResult;\n productPrice: AsyncResult;\n ratingsSummary: AsyncResult;\n storeSelectorStateManager: AsyncResult;\n wishlists: AsyncResult;\n orderTemplates: AsyncResult;\n cart: AsyncResult;\n productAvailableQuantity: AsyncResult;\n customerInformation: AsyncResult;\n featureState: AsyncResult;\n cartConfiguration?: AsyncResult;\n}\nexport declare type IBuyboxErrorHost = 'ADDTOCART' | 'FINDINSTORE' | 'WISHLIST' | 'SHOPSIMILARITEM' | 'ORDER_TEMPLATE';\n\nexport interface IErrorState {\n errorHost?: IBuyboxErrorHost;\n configureErrors: { [configureId: string]: string | undefined };\n quantityError?: string;\n customAmountError?: string;\n otherError?: string;\n}\n\nexport interface IBuyboxAddToCartViewProps {\n ContainerProps: INodeProps;\n errorBlock?: React.ReactNode;\n button?: React.ReactNode;\n}\n\nexport interface IBuyboxAddToOrderTemplateViewProps {\n ContainerProps: INodeProps;\n errorBlock?: React.ReactNode;\n button?: React.ReactNode;\n}\n\nexport interface IBuyboxProductQuantityViewProps {\n ContainerProps: INodeProps;\n LabelContainerProps: INodeProps;\n\n heading: React.ReactNode;\n errors?: React.ReactNode;\n\n input: React.ReactNode;\n}\n\nexport interface IBuyboxAddToWishlistViewProps {\n ContainerProps: INodeProps;\n errorBlock?: React.ReactNode;\n button?: React.ReactNode;\n}\n\nexport interface IBuyboxShopSimilarLookViewProps {\n ContainerProps: INodeProps;\n errors?: React.ReactNode;\n input: React.ReactNode;\n}\n\nexport enum ShopSimiliarButtonType {\n Looks = 'looks',\n Description = 'descriptions'\n}\n\nexport interface IBuyboxKeyInPriceViewProps {\n ContainerProps: INodeProps;\n LabelContainerProps: INodeProps;\n heading: React.ReactNode;\n input: React.ReactNode;\n}\n\nexport interface IBuyboxErrorBlockProps {\n configureErrors: { [configureId: string]: string | undefined };\n quantityError?: string;\n customAmountError?: string;\n otherError?: string;\n resources: IBuyboxCommonResources;\n showError: boolean;\n enableHidePdpRepeatingErrors?: boolean;\n}\n\nexport interface IBuyboxProductConfigureProps {\n product: SimpleProduct;\n productDimensions: ProductDimensionFull[];\n resources: IBuyboxCommonResources;\n channelId: number;\n actionContext: Msdyn365.IActionContext;\n errors: { [configureId: string]: string | undefined };\n\n dimensionChanged?(newValue: number): void;\n}\n\nexport interface IBuyboxProductConfigureDropdownViewProps {\n ContainerProps: INodeProps;\n LabelContainerProps: INodeProps;\n\n heading: React.ReactNode;\n errors?: React.ReactNode;\n\n select: React.ReactNode;\n}\n\nexport interface IBuyboxProductConfigureViewProps {\n ContainerProps: INodeProps;\n\n dropdowns: IBuyboxProductConfigureDropdownViewProps[];\n}\n\nexport interface IBuyboxCallbacks {\n updateQuantity(newQuantity: number): boolean;\n updateKeyInPrice(keyInPrice: number): void;\n updateErrorState(newErrorState: IErrorState): void;\n updateSelectedProduct(\n selectedProduct: Promise,\n newInventory: IProductInventoryInformation | undefined,\n newPrice: ProductPrice | undefined,\n newDeliveryOptions: ProductDeliveryOptions | undefined\n ): void;\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\n dimensionSelectedAsync(selectedDimensionId: number, selectedDimensionValueId: string): Promise;\n changeModalOpen(isModalOpen: boolean): void;\n changeUpdatingDimension(isUpdatingDimension: boolean): void;\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\n\n initializeDimension?(initializedDimension: string | undefined): void;\n}\n\nexport interface IBuyboxExtentedProps extends Msdyn365.IModule {\n resources: IBuyboxCommonResources;\n config: IBuyboxCommonConfig;\n slots: {};\n}\n\nexport interface IBuyboxCommonConfig {\n titleHeadingTag?: titleHeadingTag;\n className?: string;\n enableShopSimilarLooks?: boolean;\n enableShopSimilarDescription?: boolean;\n enableKeyInPrice?: boolean;\n minimumKeyInPrice?: number;\n maximumKeyInPrice?: number;\n}\n\nexport interface IProductDetails {\n product?: ISelectedProduct | null;\n productPrice?: ProductPrice | null;\n ratingsSummary?: RatingsSummary;\n productAvailableQuantity?: IProductInventoryInformation[];\n cart?: ICartState | undefined;\n productDimensions?: IDimensionForSelectedVariant[] | null;\n}\n\nexport enum titleHeadingTag {\n h1 = 'h1',\n h2 = 'h2',\n h3 = 'h3',\n h4 = 'h4',\n h5 = 'h5',\n h6 = 'h6'\n}\n\nexport interface IBuyboxCommonResources {\n priceFree: string;\n invalidSmallCustomAmountText: string;\n invalidLargeCustomAmountText: string;\n buyBoxGoToCartText: string;\n buyBoxContinueShoppingText: string;\n closeNotificationLabel: string;\n buyBoxSingleItemText: string;\n buyBoxMultiLineItemFormatText: string;\n buyBoxHeaderMessageText: string;\n originalPriceText: string;\n currentPriceText: string;\n addedQuantityText: string;\n addToCartText: string;\n outOfStockText: string;\n averageRatingAriaLabel: string;\n addToOrderTemplateHeader: string;\n noOrderTemplatesMessage: string;\n noOrderTemplatesDescription: string;\n createAnOrderTemplateButtonText: string;\n createNewOrderTemplateButtonText: string;\n cancelOrderTemplateCreationButtonText: string;\n selectTemplatesText: string;\n addToTemplateButtonText: string;\n lineItemsText: string;\n createOrderTemplateHeader: string;\n orderTemplateTitle: string;\n orderTemplateNameAriaLabel: string;\n createOrderTemplateDescription: string;\n defaultOrderTemplateName: string;\n createOrderTemplateButtonText: string;\n cancelNewOrderTemplateCreationButtonText: string;\n viewOrderTemplateButtonText: string;\n continueShoppingButtonText: string;\n itemAddedToOrderTemplateHeaderItemOneText: string;\n itemAddedToOrderTemplateHeaderItemFormatText: string;\n itemAddedToOrderTemplateHeaderMessageText: string;\n duplicatedProductsHeader: string;\n duplicatedProductsDescription: string;\n updateQuantityButtonText: string;\n cancelDuplicateItemsButtonText: string;\n addToWishlistButtonText: string;\n removeFromWishlistButtonText: string;\n addToWishlistMessage: string;\n removedFromWishlistMessage: string;\n addItemToWishlistError: string;\n removeItemFromWishlistError: string;\n nameOfWishlist: string;\n productQuantityHeading: string;\n inputQuantityAriaLabel: string;\n buyboxKeyInPriceLabelHeading: string;\n buyboxErrorMessageHeader: string;\n maxQuantityText: string;\n minQuantityText: string;\n selectDimensionFormatString: string;\n errorMessageOutOfStock: string;\n errorMessageOutOfRangeOneLeft: string;\n errorMessageOutOfRangeFormat: string;\n addToOrderTemplateButtonText: string;\n addedToCartFailureMessage: string;\n maxQuantityLimitText: string;\n productDimensionTypeColorErrorMessage: string;\n productDimensionTypeConfigurationErrorMessage: string;\n productDimensionTypeSizeErrorMessage: string;\n productDimensionTypeAmountErrorMessage: string;\n productDimensionTypeStyleErrorMessage: string;\n shopSimilarLooksText?: string;\n shopSimilarDescriptionText?: string;\n addToOrderTemplateButtonTooltip: string;\n loadingText?: string;\n informationIconText?: string;\n priceRangeSeparator?: string;\n swatchItemAriaLabel?: string;\n salesAgreementPricePrompt?: string;\n salesAgreementExpirationDatePrompt?: string;\n salesAgreementCommittedQuantityPrompt?: string;\n salesAgreementRemainingQuantityPrompt?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAddToCartFailureResult } from '@msdyn365-commerce/components';\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { OrgUnitLocation, ProductAvailableQuantity, ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IBuyboxCommonResources } from '../buyboxInterface';\n\n/**\n * Get the quantity limit.\n * @param context - The context.\n * @param productAvailability - The product availability.\n * @returns The quantity limit.\n */\nexport function getQuantityLimit(context: ICoreContext>, productAvailability: ProductAvailableQuantity | undefined): number {\n // Get the quantity limit for the product\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- need read from config.\n const maxQuantityForCartLineItem: number | undefined = context.app.config.maxQuantityForCartLineItem;\n const availableQty = productAvailability?.AvailableQuantity;\n const defaultQuantityLimit = 10;\n\n let quantityLimit: number;\n\n if (maxQuantityForCartLineItem === undefined && availableQty === undefined) {\n quantityLimit = defaultQuantityLimit;\n } else if (availableQty === undefined) {\n quantityLimit = maxQuantityForCartLineItem ?? defaultQuantityLimit;\n } else if (maxQuantityForCartLineItem === undefined) {\n quantityLimit = availableQty;\n } else {\n quantityLimit = Math.min(maxQuantityForCartLineItem, availableQty);\n }\n\n return quantityLimit;\n}\n\n/**\n * Get the element index.\n * @param cart - The cart.\n * @param product - The product.\n * @param location - The location.\n * @returns The index of the element.\n */\nexport function getElementIndex(\n cart: ICartState | undefined,\n product: SimpleProduct | undefined,\n location: OrgUnitLocation | undefined\n): number {\n // Get the quantity of the product in cart\n let elementFoundAt: number = -1;\n\n const productIdToFind = product?.RecordId;\n\n for (let index = 0; index < cart!.cart.CartLines!.length; index++) {\n if (\n cart!.cart.CartLines![index].ProductId === productIdToFind &&\n (cart!.cart.CartLines![index].FulfillmentStoreId || '') === (location?.OrgUnitNumber || '')\n ) {\n elementFoundAt = index;\n\n break;\n }\n }\n\n return elementFoundAt;\n}\n\nexport function getQuantityError(stockLeft: number | undefined, resources: IBuyboxCommonResources): string | undefined {\n if (!stockLeft || stockLeft <= 0) {\n return resources.errorMessageOutOfStock;\n } else if (stockLeft === 1) {\n return resources.errorMessageOutOfRangeOneLeft;\n }\n return resources.errorMessageOutOfRangeFormat.replace('{numLeft}', stockLeft.toString());\n}\n\nexport function getGenericError(\n result: IAddToCartFailureResult,\n cart: ICartState | undefined,\n resources: IBuyboxCommonResources,\n context: ICoreContext>,\n product: SimpleProduct | undefined,\n productAvailability: ProductAvailableQuantity | undefined,\n location: OrgUnitLocation | undefined\n): string | undefined {\n if (result.failureReason === 'EMPTYINPUT') {\n return resources.addedToCartFailureMessage;\n } else if (result.failureReason === 'CARTACTIONFAILED') {\n if (result.cartActionResult && result.cartActionResult.substatus === 'MAXQUANTITY') {\n // Get the quantity of the product in cart\n const elementFoundAt: number = getElementIndex(cart, product, location);\n\n let currentQuantity: number = 0;\n if (elementFoundAt !== -1) {\n const cartLineToUpdate = { ...cart!.cart.CartLines![elementFoundAt] };\n currentQuantity = cartLineToUpdate.Quantity ?? 0;\n }\n\n // Get the quantity limit for the product\n const quantityLimit = getQuantityLimit(context, productAvailability);\n return resources.maxQuantityLimitText\n .replace('{curQuantity}', currentQuantity.toString())\n .replace('{maxQuantity}', quantityLimit.toString());\n } else if (\n result.cartActionResult &&\n (result.cartActionResult.substatus === 'QUANTITYLIMITS' || result.cartActionResult.substatus === 'INVOICEINCART')\n ) {\n return result.cartActionResult.errorDetails?.LocalizedMessage;\n }\n\n if (result.cartActionResult?.validationResults && ArrayExtensions.hasElements(result.cartActionResult.validationResults)) {\n return result.cartActionResult.validationResults\n .map(item => {\n return StringExtensions.isNullOrEmpty(item.LocalizedMessage)\n ? item.ErrorContext ?? item.ErrorResourceId\n : item.LocalizedMessage;\n })\n .toString();\n }\n\n return resources.addedToCartFailureMessage;\n }\n\n return undefined;\n}\n\nexport function getConfigureErrors(\n result: ProductDimension[] | undefined,\n resources: IBuyboxCommonResources,\n isGiftCard?: boolean\n): { [configureId: string]: string | undefined } {\n if (!result) {\n return {};\n }\n\n const dimensions: { [configureId: string]: string | undefined } = {};\n\n for (const dimension of result) {\n dimensions[dimension.DimensionTypeValue] = getDimensionErrorString(dimension.DimensionTypeValue, resources, isGiftCard);\n }\n\n return dimensions;\n}\n\nexport function getDimensionErrorString(dimensionTypeValue: number, resources: IBuyboxCommonResources, isGiftCard?: boolean): string {\n switch (dimensionTypeValue) {\n case 1: // ProductDimensionType.Color\n return resources.productDimensionTypeColorErrorMessage;\n case 2: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfigurationErrorMessage;\n case 3: // ProductDimensionType.Size\n return resources.productDimensionTypeSizeErrorMessage;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmountErrorMessage : resources.productDimensionTypeStyleErrorMessage;\n default:\n return '';\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\nimport { ProductDimension, ProductDimensionType } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n convertProductDimensionTypeToDimensionTypes,\n DimensionTypes,\n getDimensionValuesFromQuery,\n getInventoryLevelCodeFromDimensionValue,\n IDimensionForSelectedVariant,\n IDimensionsApp,\n IDimensionValueForSelectedVariant,\n InventoryLevelValues,\n ObjectExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { format, getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n IBuyboxCallbacks,\n IBuyboxCommonData,\n IBuyboxCommonResources,\n IBuyboxExtentedProps,\n IBuyboxProductConfigureDropdownViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxState,\n IProductDetails\n} from './buyboxInterface';\nimport {\n Dropdown,\n IDropdownItemProps,\n IDropdownOnInitializeNotification,\n IDropdownOnSelectionChangeNotification,\n SelectionType\n} from './dropdown';\n\nlet telemetryContent: ITelemetryContent;\n\n/**\n * Dimension pre-processing info.\n */\ninterface IProductDimensionInfo {\n dropdownName: string;\n dropdownId: string;\n dropdownList: IDropdownItemProps[];\n}\n\n/**\n * Props for rendering a dropdown.\n */\ninterface IProductDimensionDropdownProps extends IProductDimensionInfo {\n resources: IBuyboxCommonResources;\n className: string;\n context: ICoreContext;\n\n configureErrors: { [configureId: string]: string | undefined };\n\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\n dropdownCallback(notification: IDropdownOnSelectionChangeNotification): Promise;\n initializeCallback(notification: IDropdownOnInitializeNotification): void;\n}\n\nconst mapProductDimensionFullToDropdownViewProps = (props: IProductDimensionDropdownProps): IBuyboxProductConfigureDropdownViewProps => {\n const dimensionId = Number.parseInt(props.dropdownId, 10) as ProductDimensionType;\n const dropdownToggleName = format(props.resources.selectDimensionFormatString, props.dropdownName);\n\n const errorMessage = props.configureErrors[props.dropdownId];\n\n let dimensionSelectionType = SelectionType.dropdown;\n\n const dimensionType = convertProductDimensionTypeToDimensionTypes(dimensionId);\n\n const dimensionsAsSwatchConfiguration = props.context.app.config.dimensionsAsSwatchType;\n if (\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\n !dimensionsAsSwatchConfiguration.includes(DimensionTypes.none) &&\n dimensionsAsSwatchConfiguration.includes(dimensionType)\n ) {\n dimensionSelectionType = SelectionType.swatch;\n }\n\n return {\n ContainerProps: {\n className: `${props.className}__dropdown`\n },\n LabelContainerProps: {\n tag: 'label',\n className: `${props.className}__dropdown-quantity-label`,\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\n },\n errors: errorMessage && (\n \n \n ),\n heading:
{props.dropdownName}
,\n select: (\n \n )\n };\n};\n\nexport function getBuyboxProductConfigure(\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks,\n productDetails?: IProductDetails,\n selectedDimensions?: ProductDimension[]\n): IBuyboxProductConfigureViewProps | undefined {\n const { resources, typeName } = props;\n\n const {\n errorState: { configureErrors }\n } = state;\n\n const { getDropdownName } = callbacks;\n\n const context = props.context as ICoreContext;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const productDimensionsData = props.data.productDimensions?.result ?? productDetails?.productDimensions;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\n const enableStockCheck = props.context.app.config.enableStockCheck;\n\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensionsData);\n\n if (!product || !hasProductDimensions) {\n return undefined;\n }\n\n const className = _getClassNamePrefix(typeName);\n\n const onChanged = async (notification: IDropdownOnSelectionChangeNotification) =>\n _onChanged(notification, callbacks.dimensionSelectedAsync);\n\n const onInitializedDimension = async (notification: IDropdownOnInitializeNotification) =>\n _onInitializedDimension(notification, callbacks.initializeDimension);\n\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, props.typeName, props.telemetry);\n\n const inventoryLevel = context.app.config.inventoryLevel;\n\n let dimensionsInfo: IProductDimensionInfo[] = [];\n\n const productDimensions = productDimensionsData as IDimensionForSelectedVariant[];\n\n dimensionsInfo = productDimensions.map(productDimensionFull => {\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\n\n const dimensions = (productDimensionFull.dimensionValuesWithInventory ??\n productDimensionFull.DimensionValues ??\n []) as IDimensionValueForSelectedVariant[];\n const validProductDimensionsFull = dimensions.filter(\n value => !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId)\n );\n\n const dropdownList: IDropdownItemProps[] = validProductDimensionsFull.map(dimensionValuesWithInventory => {\n const dimensionValue = dimensionValuesWithInventory.DimensionValue ?? dimensionValuesWithInventory;\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventory, inventoryLevel);\n return {\n value: dimensionValue.Value ?? '',\n id: dimensionValue.RecordId.toString(),\n colorHexCode: dimensionValue.ColorHexCode,\n imageUrl: dimensionValue.ImageUrl,\n isDisabled: enableStockCheck && inventoryLevelCode === InventoryLevelValues.outOfStock,\n swatchItemAriaLabel: resources.swatchItemAriaLabel ? resources.swatchItemAriaLabel : ''\n };\n });\n return {\n dropdownName,\n dropdownId,\n dropdownList\n };\n });\n\n const matchedDimensions = selectedDimensions ?? getDimensionValuesFromQuery(context.request.url.requestUrl);\n for (const dimensionInfo of dimensionsInfo) {\n const currentDimensionsFromQuery = matchedDimensions.filter(\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dimensionInfo.dropdownId\n );\n if (!ArrayExtensions.hasElements(currentDimensionsFromQuery)) {\n continue;\n }\n const currentDimensionFromQuery = currentDimensionsFromQuery[0];\n const selectedDimensionItem = dimensionInfo.dropdownList.filter(\n dimensionItem =>\n dimensionItem.value.toLocaleLowerCase() === currentDimensionFromQuery.DimensionValue?.Value?.toLocaleLowerCase()\n );\n if (!ArrayExtensions.hasElements(selectedDimensionItem)) {\n continue;\n }\n selectedDimensionItem[0].isDefault = true;\n }\n\n const dropdowns: IBuyboxProductConfigureDropdownViewProps[] = dimensionsInfo.map(dimensionInfo => {\n return mapProductDimensionFullToDropdownViewProps({\n ...dimensionInfo,\n resources,\n configureErrors,\n getDropdownName,\n dropdownCallback: onChanged,\n initializeCallback: onInitializedDimension,\n className,\n context\n });\n });\n\n return {\n ContainerProps: {\n className: `${className}__configure`\n },\n dropdowns\n };\n}\n\nconst _onChanged = async (\n notification: IDropdownOnSelectionChangeNotification,\n dimensionChanged: (newValue: number, selectedDimensionValue: string, initializedDimension?: string) => Promise\n): Promise => {\n await dimensionChanged(+notification.dropdownId, notification.selectId);\n};\n\nconst _onInitializedDimension = (\n notification: IDropdownOnInitializeNotification,\n initializeDimension?: (initializedDimension: string | undefined) => void\n): void => {\n if (initializeDimension) {\n initializeDimension(notification.initializedDimension);\n }\n};\n\nconst _getClassNamePrefix = (typeName: string): string => {\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\n\n/**\n * Specifies the type of selection.\n */\nexport enum SelectionType {\n dropdown = 0,\n swatch = 1\n}\n\n/**\n * Copyright (c) 2018 Microsoft Corporation.\n */\nexport interface IDropdownProps {\n /**\n * Specifies the type of selection. Dropdown by default.\n */\n selectionType?: SelectionType;\n\n /**\n * @friendlyName dropdownId\n * @description Id for dropdown component.\n */\n dropdownId: string;\n\n /**\n * @friendlyName dropdownName\n * @description Name of the dropdown component.\n */\n dropdownName: string;\n\n /**\n * @friendlyName dropdownList\n * @description List of items in dropdown.\n */\n dropdownList: IDropdownItemProps[];\n\n /**\n * @friendlyName dropdownToggleName\n * @description Name to use for the toggle when nothing is selected.\n */\n dropdownToggleName: string;\n\n /**\n * @telemetryContent telemetryContent\n * @description Telemetry content.\n */\n telemetryContent?: ITelemetryContent;\n\n apiSettings?: ICommerceApiSettings;\n\n /**\n * @friendlyName onChange\n * @description Callback that gets fired when when a selected dimension changes.\n */\n onChange?(notification: IDropdownOnSelectionChangeNotification): Promise;\n\n /**\n * @friendlyName onInitialize\n * @description Callback that gets fired when dimension is initialized.\n */\n onInitialize?(notification: IDropdownOnInitializeNotification): void;\n}\n\nexport interface IDropdownItemProps {\n value: string;\n id: string;\n colorHexCode?: string;\n imageUrl?: string;\n isDisabled?: boolean;\n isDefault?: boolean;\n}\n\nexport interface IDropdownOnSelectionChangeNotification {\n dropdownId: string;\n selectId: string;\n selectedValue: string;\n}\n\nexport interface IDropdownOnInitializeNotification {\n initializedDimension: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n AddToCartComponent,\n AddToOrderTemplateComponent,\n AddToWishlistComponent,\n IAddToCartFailureResult,\n IAddToCartResources,\n IAddToOrderTemplateDialogResources,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources,\n IOrderTemplateActionErrorResult,\n IOrderTemplateNameDialogResources,\n IWishlistActionErrorResult,\n PriceComponent,\n RatingComponent\n} from '@msdyn365-commerce/components';\nimport { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductAvailableQuantity, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, DeliveryMode, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Alert,\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n Heading,\n ITelemetryContent,\n Node,\n Quantity,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxCallbacks,\n IBuyboxCommonData,\n IBuyboxCommonResources,\n IBuyboxErrorBlockProps,\n IBuyboxExtentedProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxShopSimilarLookViewProps,\n IBuyboxState,\n IProductDetails,\n ShopSimiliarButtonType\n} from './buyboxInterface';\nimport { getConfigureErrors, getGenericError, getQuantityError } from './utilities/error-utilities';\n\nconst _getClassNamePrefix = (typeName: string): string => {\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\n};\n\nexport function getBuyBoxInventoryLabel(\n props: IBuyboxExtentedProps,\n productDetails?: IProductDetails\n): React.ReactElement | undefined {\n const { typeName } = props;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ?? productDetails?.productAvailableQuantity;\n\n const className = _getClassNamePrefix(typeName);\n if (!productAvailableQuantity || !ArrayExtensions.hasElements(productAvailableQuantity)) {\n return undefined;\n }\n const shippingInventory = productAvailableQuantity.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\n\n if (shippingInventory) {\n let inventoryClassName: string;\n if (shippingInventory.StockLevelCode) {\n inventoryClassName = `${className}__inventory-label ${className}__inventory-code-${shippingInventory.StockLevelCode.toLowerCase()}`;\n } else {\n inventoryClassName = `${className}__inventory-label`;\n }\n return (\n
\n {shippingInventory.StockLevelLabel}\n
\n );\n }\n\n return undefined;\n}\n\nexport function getBuyboxProductTitle(\n props: IBuyboxExtentedProps,\n productDetails?: IProductDetails\n): React.ReactElement | undefined {\n const {\n config: { titleHeadingTag = 'h1' },\n typeName\n } = props;\n const className = _getClassNamePrefix(typeName);\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const product = props.data.product?.result ?? productDetails?.product ?? undefined;\n\n return product && ;\n}\n\nexport function getBuyboxProductDescription(\n props: IBuyboxExtentedProps,\n productDetails?: IProductDetails\n): React.ReactElement | undefined {\n const { typeName } = props;\n const className = _getClassNamePrefix(typeName);\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const product = props.data.product?.result ?? productDetails?.product ?? undefined;\n\n return product &&

{product.Description}

;\n}\n\n/**\n * Gets the react node for product unit of measure display.\n * @param {IBuyboxExtentedProps} props The buybox module props.\n * @param {IProductDetails} productDetails The product details to be displyed in buybox.\n * @returns {React.ReactElement} The node representing markup for unit of measure component.\n */\nexport function getBuyboxProductUnitOfMeasure(\n props: IBuyboxExtentedProps,\n productDetails?: IProductDetails\n): React.ReactElement | undefined {\n const { typeName } = props;\n const className = _getClassNamePrefix(typeName);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (\n props.context.app.config &&\n (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none')\n ) {\n return undefined;\n }\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const product = props.data.product?.result ?? productDetails?.product;\n if (!product || !product.DefaultUnitOfMeasure) {\n props.telemetry.warning('Missing defult unit of measureor theproduct');\n return undefined;\n }\n\n return (\n
\n {product.DefaultUnitOfMeasure}\n
\n );\n}\n\nlet telemetryContent: ITelemetryContent;\n\n/**\n * On add to cart failed function.\n * @param props -The buybox module props.\n * @param state -The buybox module state.\n * @param callbacks -The buybox module callbacks.\n * @param defaultMinimumKeyInPrice -The default minimum key in price.\n * @param defaultMaximumKeyInPrice -The default maximum key in price.\n * @param cart -The cart state.\n * @param product -The simple product.\n * @param productAvailability -The product available quantity.\n * @returns Update error state.\n */\nconst onAddToCartFailed = (\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks,\n defaultMinimumKeyInPrice: number,\n defaultMaximumKeyInPrice: number,\n cart: ICartState,\n product: SimpleProduct,\n productAvailability: ProductAvailableQuantity | undefined\n) => (result: IAddToCartFailureResult) => {\n let quantityErrorForState: string | undefined;\n let customAmountErrorForState: string | undefined;\n let otherErrorForState: string | undefined = getGenericError(\n result,\n cart,\n props.resources,\n props.context,\n product,\n productAvailability,\n undefined\n );\n\n if (result.failureReason === 'OUTOFSTOCK') {\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, props.resources) : undefined;\n } else if (\n result.failureReason === 'CARTACTIONFAILED' &&\n result.cartActionResult &&\n (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult.substatus === 'QUANTITYLIMITS')\n ) {\n quantityErrorForState = getGenericError(result, cart, props.resources, props.context, product, productAvailability, undefined);\n otherErrorForState = undefined; // Prevent error duplication in otherError and quantityError\n }\n\n if (result.failureReason === 'INVALIDCUSTOMAMOUNT') {\n if (state.keyInPriceAmount === undefined || state.keyInPriceAmount < (props.config.minimumKeyInPrice || defaultMinimumKeyInPrice)) {\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(\n props.config.minimumKeyInPrice || defaultMinimumKeyInPrice\n );\n customAmountErrorForState = props.resources.invalidSmallCustomAmountText.replace('{minAmount}', formatedAmountLimit);\n } else if (state.keyInPriceAmount > (props.config.maximumKeyInPrice || defaultMaximumKeyInPrice)) {\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(\n props.config.maximumKeyInPrice || defaultMaximumKeyInPrice\n );\n customAmountErrorForState = props.resources.invalidLargeCustomAmountText.replace('{maxAmount}', formatedAmountLimit);\n }\n }\n\n callbacks.updateErrorState({\n errorHost: 'ADDTOCART',\n quantityError: quantityErrorForState,\n configureErrors:\n result.failureReason === 'MISSINGDIMENSION'\n ? getConfigureErrors(result.missingDimensions, props.resources, product?.IsGiftCard)\n : {},\n customAmountError: customAmountErrorForState,\n otherError: otherErrorForState\n });\n};\n\n/**\n * On Item Add To Cart function.\n * @param typeName -Type name.\n * @param callbacks -Buybox Callbacks.\n * @returns Change modal open.\n */\nconst onItemAddedToCart = (typeName: string, callbacks: IBuyboxCallbacks) => (result: ICartActionResult) => {\n if (typeName === 'quickview') {\n callbacks.changeModalOpen(false);\n }\n};\n\nexport function getBuyboxAddToCart(\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks,\n defaultMinimumKeyInPrice: number,\n defaultMaximumKeyInPrice: number,\n productDetails?: IProductDetails,\n hasAvailableProducts?: boolean\n): IBuyboxAddToCartViewProps {\n const { id, typeName, context, resources } = props;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const product = props.data.product?.result ?? productDetails?.product;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const cart = props.data.cart?.result ?? productDetails?.cart;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ?? productDetails?.productAvailableQuantity;\n\n const {\n quantity,\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\n selectedProduct,\n isUpdatingDimension,\n isUpdatingDeliveryOptions,\n isServiceItem\n } = state;\n\n const productAvailability = state.productAvailableQuantity\n ? state.productAvailableQuantity.ProductAvailableQuantity\n : productAvailableQuantity && productAvailableQuantity.length > 0\n ? productAvailableQuantity[0].ProductAvailableQuantity\n : undefined;\n\n const dialogStrings: IAddToCartResources = {\n goToCartText: resources.buyBoxGoToCartText,\n continueShoppingText: resources.buyBoxContinueShoppingText,\n closeNotificationLabel: resources.closeNotificationLabel,\n headerItemOneText: resources.buyBoxSingleItemText,\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\n headerMessageText: resources.buyBoxHeaderMessageText,\n freePriceText: resources.priceFree,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n addedQuantityText: resources.addedQuantityText\n };\n\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n const isProductQuantityLoading = typeName !== 'quickview' && props.data.productAvailableQuantity.status === 'LOADING';\n if (isProductQuantityLoading) {\n callbacks.changeUpdatingDimension(false);\n }\n\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\n if (isLoadingDeliveryOptions && callbacks.changeUpdatingDeliveryOptions) {\n callbacks.changeUpdatingDeliveryOptions(false);\n }\n\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.typeName, props.telemetry);\n\n // Check if the product delivery mode is electronic\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n // from quickview we are not getting deliveryoptions in props.data hence getting it from quickview state\n const deliveryOptions = typeName === 'quickview' ? state.productDeliveryOptions : props.data.deliveryOptions?.result;\n const isEmailDelivery =\n ArrayExtensions.hasElements(deliveryOptions?.DeliveryOptions) && deliveryOptions!.DeliveryOptions[0].Code === emailDeliveryModeCode;\n const className = _getClassNamePrefix(typeName);\n const isDisabled = isUpdatingDimension && typeName === 'quickview';\n const { enableHidePdpRepeatingErrors } = props.context.request.features;\n return {\n ContainerProps: {\n className: `${className}__add-to-cart-container`\n },\n button: product && (\n \n ),\n errorBlock: (\n \n )\n };\n}\n\n/**\n * Get the React.ReactElement contains price.\n * @param props - The IBuyboxExtentedProps.\n * @param state - The buybox state.\n * @returns The React.ReactElement.\n */\nexport function getBuyboxProductPrice(props: IBuyboxExtentedProps, state: IBuyboxState): React.ReactElement | undefined {\n const { id, typeName, context, resources } = props;\n\n return (\n state.productPrice && (\n featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\n )?.IsEnabled\n }\n isSalesAgreementPriceFeatureEnabled={\n props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSalesAgreementPriceSupportFeature'\n )?.IsEnabled\n }\n priceResources={{\n priceRangeSeparator: resources.priceRangeSeparator,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n salesAgreementExpirationDatePrompt: resources.salesAgreementExpirationDatePrompt,\n salesAgreementCommittedQuantityPrompt: resources.salesAgreementCommittedQuantityPrompt,\n salesAgreementRemainingQuantityPrompt: resources.salesAgreementRemainingQuantityPrompt\n }}\n freePriceText={resources.priceFree}\n originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n />\n )\n );\n}\n\nexport function getBuyboxProductRating(\n props: IBuyboxExtentedProps,\n productDetails?: IProductDetails\n): React.ReactElement | undefined {\n const { id, typeName, context, resources } = props;\n\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const ratingsSummary = props.data.ratingsSummary?.result ?? productDetails?.ratingsSummary;\n if (!ratingsSummary || !ratingsSummary.averageRating) {\n return
;\n }\n const ratingComponent = (\n \n );\n\n return ratingComponent;\n}\n\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\n return {\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\n\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\n\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\n\n selectTemplatesText: resources.selectTemplatesText,\n addToTemplateButtonText: resources.addToTemplateButtonText,\n lineItemsText: resources.lineItemsText\n };\n}\n\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\n orderTemplateDescription: resources.createOrderTemplateDescription,\n\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\n };\n}\n\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\n freePriceText: resources.priceFree,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText\n };\n}\n\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources: IBuyboxCommonResources\n): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\n return {\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\n updateQuantityButtonText: resources.updateQuantityButtonText,\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\n };\n}\n\n/**\n * Add to order template failed function.\n * @param callbacks -Buybox callbacks.\n * @param resources -Buybox common resources.\n * @param product -Simple product.\n * @returns Update error state.\n */\nconst onAddToOrderTemplateFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\n result: IOrderTemplateActionErrorResult\n) => {\n callbacks.updateErrorState({\n errorHost: 'ORDER_TEMPLATE',\n configureErrors:\n result.status === 'MISSING_DIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\n });\n};\n\nexport function getBuyboxProductAddToOrderTemplate(\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks,\n isMultipleCatalogsFeatureEnabled?: boolean,\n catalogId?: number\n): IBuyboxAddToOrderTemplateViewProps | undefined {\n const {\n id,\n typeName,\n context,\n data: {\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n resources\n } = props;\n\n const product = props.data.product?.result;\n\n const {\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\n quantity\n } = state;\n\n // If custom amount is selected, add-to-orderTemplate is disabled\n if (state.isCustomPriceSelected) {\n return undefined;\n }\n const className = _getClassNamePrefix(typeName);\n const { enableHidePdpRepeatingErrors } = props.context.request.features;\n\n return {\n ContainerProps: {\n className: `${className}__add-to-order-template-container`\n },\n button: product && orderTemplates && (\n \n ),\n errorBlock: (\n \n )\n };\n}\n\n/**\n * Renders add to comparison button for the given product.\n * @param productComparisonButton - React element of the button.\n * @param product - Product information.\n * @param catalogId - Current catalog.\n * @param state - Buybox state.\n * @returns React element of the button.\n */\nexport function getBuyboxProductComparisonButton(\n productComparisonButton: React.ReactNode,\n product: SimpleProduct,\n catalogId: number,\n state: IBuyboxState\n): JSX.Element | undefined {\n if (state.isCustomPriceSelected) {\n return undefined;\n }\n\n validateCatalogId(catalogId);\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\n}\n\n/**\n * Add to wishlist failed function.\n * @param callbacks -Buybox callbacks.\n * @param resources -Buybox resources.\n * @param product -Simple product.\n * @returns Update error state.\n */\nconst onAddToWishlistFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\n result: IWishlistActionErrorResult\n) => {\n callbacks.updateErrorState({\n errorHost: 'WISHLIST',\n configureErrors:\n result.status === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\n });\n};\n\nexport function getBuyboxProductAddToWishlist(\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks,\n productDetails?: IProductDetails\n): IBuyboxAddToWishlistViewProps | undefined {\n const {\n id,\n typeName,\n context,\n data: {\n wishlists: { result: wishlists }\n },\n resources\n } = props;\n\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\n\n const {\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\n selectedProduct\n } = state;\n\n // If custom amount is selected, add-to-wishlist is disabled\n if (state.isCustomPriceSelected) {\n return undefined;\n }\n\n const className = _getClassNamePrefix(typeName);\n const { enableHidePdpRepeatingErrors } = props.context.request.features;\n return {\n ContainerProps: {\n className: `${className}__add-to-wishlist-container`\n },\n button: product && (\n \n ),\n errorBlock: (\n \n )\n };\n}\n\n/**\n * On quantity change function.\n * @param callbacks -Buybox callbacks.\n * @returns Update quantity.\n */\nconst onQuantityChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number) => {\n if (callbacks.updateQuantity) {\n callbacks.updateQuantity(newValue);\n }\n};\n\nexport function getBuyboxProductQuantity(\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks\n): IBuyboxProductQuantityViewProps {\n const { resources, typeName } = props;\n\n const {\n quantity,\n min,\n max,\n errorState: { quantityError }\n } = state;\n\n const className = _getClassNamePrefix(typeName);\n\n return {\n ContainerProps: {\n className: `${className}__quantity`\n },\n LabelContainerProps: {\n tag: 'label',\n className: `${className}__product-quantity-label`,\n htmlFor: `${className}__product-quantity-input`\n },\n heading:
{resources.productQuantityHeading}
,\n errors: quantityError && (\n \n \n ),\n input: (\n \n )\n };\n}\n\nexport function getBuyboxShopSimilarButton(\n props: IBuyboxExtentedProps,\n buttonType: ShopSimiliarButtonType\n): IBuyboxShopSimilarLookViewProps {\n const { resources, context, typeName } = props;\n const product = props.data.product?.result;\n\n const className = _getClassNamePrefix(typeName);\n const navigationUrl = (shopSimiliarButtonType: ShopSimiliarButtonType) => () => {\n const searchURL = getUrlSync('search', context && context.actionContext);\n const separator = searchURL!.includes('?') ? '&' : '?';\n document.location.href = `${searchURL}${separator}productId=${product &&\n product.RecordId}&recommendation=${shopSimiliarButtonType}`;\n };\n const telemetryText =\n buttonType === ShopSimiliarButtonType.Looks ? TelemetryConstant.ShopSimliarLooks : TelemetryConstant.ShopSimliarDescription;\n const payLoad = getPayloadObject('click', telemetryContent, telemetryText);\n const attribute = getTelemetryAttributes(telemetryContent, payLoad);\n const text = buttonType === ShopSimiliarButtonType.Looks ? resources.shopSimilarLooksText : resources.shopSimilarDescriptionText;\n\n return {\n ContainerProps: {\n className: `${className}__shopsimilar${buttonType}`\n },\n input: (\n \n {text}\n \n )\n };\n}\n\n/**\n * On price change function.\n * @param callbacks -Buybox callbacks.\n * @returns Update key in price.\n */\nconst onPriceChangeHandler = (callbacks: IBuyboxCallbacks) => (event: React.ChangeEvent) => {\n const value = event.currentTarget.value;\n callbacks.updateKeyInPrice(value.length > 0 ? Number(value) : Number.parseFloat(value));\n};\n\nexport function getBuyboxKeyInPrice(\n props: IBuyboxExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks\n): IBuyboxKeyInPriceViewProps {\n const { config, resources } = props;\n\n const {\n errorState: {}\n } = state;\n\n const className = _getClassNamePrefix(props.typeName);\n\n return {\n ContainerProps: {\n className: `${className}__key_in_price`\n },\n LabelContainerProps: {\n tag: 'label',\n className: `${className}__key_in_price-label`,\n htmlFor: `${className}__key_in_price`\n },\n heading:
{resources.buyboxKeyInPriceLabelHeading}
,\n input: (\n \n )\n };\n}\n\nexport const BuyboxErrorBlock: React.FC = ({\n showError,\n configureErrors,\n quantityError,\n customAmountError,\n otherError,\n resources,\n enableHidePdpRepeatingErrors\n}) => {\n let errorMessages: (string | undefined)[] = [];\n\n // skip configuration repeating errors when flight is enabled\n if (!enableHidePdpRepeatingErrors) {\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\n }\n\n // skip quantity repeating errors when flight is enabled\n if (quantityError && !enableHidePdpRepeatingErrors) {\n errorMessages.push(quantityError);\n }\n\n if (customAmountError) {\n errorMessages.push(customAmountError);\n }\n\n if (otherError) {\n errorMessages.push(otherError);\n }\n\n return (\n 0} color='danger' assertive aria-label={resources.buyboxErrorMessageHeader}>\n \n {errorMessages.map((message, index) => {\n return (\n
\n {message}\n
\n );\n })}\n
\n );\n};\n\nexport function getQuantityLimitsMessages(\n props: IBuyboxExtentedProps,\n state: IBuyboxState\n): React.ReactElement | undefined {\n const { resources } = props;\n\n const { min, max } = state;\n\n if (!_isOrderQuantityLimitsFeatureEnabled(props) && !_isChannelLimitsFeatureEnabled(props)) {\n return undefined;\n }\n\n return (\n \n {_renderMaxLabel(props, max, resources.maxQuantityText)}\n {_renderMinLabel(props, min, resources.minQuantityText)}\n \n );\n}\n\nexport const RetailDefaultOrderQuantityLimitsFeatureName: string = 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature';\nexport const EcommerceQuantityLimitConfigurationsFeatureName: string =\n 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature';\nexport const RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName: string = 'RevertToSiteBuilderOrderQuantityLimitsSettings';\n\nconst _renderMaxLabel = (\n props: IBuyboxExtentedProps,\n max: number | undefined,\n maxQuantityText: string\n): React.ReactElement | undefined => {\n const { resources, typeName } = props;\n const className = _getClassNamePrefix(typeName);\n if (max && max !== 0 && max !== Number.MAX_VALUE) {\n return (\n

\n {resources.informationIconText}\n