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ACHnnB,EAAG,YAEHonB,IAAK,GAGLC,GAAI,0CAOAf,EAF4B,4HACXM,EAAQ,KAQzBN,EAF4B,kEACXM,EAAQ,KAQzBN,EAF4B,uEACXM,EAAQ,KAQzBN,EAF4B,iFACXM,EAAQ,MAQzBN,EAF4B,+EACXM,EAAQ,KAQzBN,EAF4B,2BACXM,EAAQ,MAQzBN,EAF4B,uCACXM,EAAQ,MAMjCpW,OAAO8W,aAAe9W,OAAO8W,cAAgB,GAC7C9W,OAAO8W,aAAajG,QAAO/d,EAAAA,EAAA,GACpBkN,OAAO8W,aAAajG,SAAW,IAC/B+E,EAAQ/E,SAGX7Q,OAAO8W,aAAajB,YAAW/iB,EAAAA,EAAA,GAC5BkN,OAAO8W,aAAajB,aAAe,IACnCD,EAAQC,aAEY,MAAMkB,EAAiB,GAC9BA,EAAe,qFAAuF,CAC9G/nB,EAAGA,IAAMonB,EAAQ,MACjBY,GAAI,kDAEpBhX,OAAO8W,aAAe9W,OAAO8W,cAAgB,GAC7C9W,OAAO8W,aAAaC,eAAcjkB,EAAAA,EAAA,GACPkN,OAAO8W,aAAaC,gBAAkB,IACtCA,UC7H3BE,EAAOC,QAAUjtB,cCAjBgtB,EAAOC,QAAUC","sources":["webpack://Dobbies.Commerce/./src/actions/bundle-products-oos-state.ts?fa22","webpack://Dobbies.Commerce/./src/actions/get-plant-pots-product-count.ts?cf83","webpack://Dobbies.Commerce/./src/modules/dobbies-product-collection/dobbies-product-collection.props.autogenerated.ts?d60b","webpack://Dobbies.Commerce/./src/modules/dobbies-product-collection/dobbies-product-collection.tsx?ae9b","webpack://Dobbies.Commerce/./src/modules/dobbies-product-collection/dobbies-product-collection.view.tsx?797c","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/inventory/product-inventory-utils.ts?3772","webpack://Dobbies.Commerce/./lib/dobbies-product-collection/module-registration.js?9ef8","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\n/**\r\n * CheckoutModulesStateShare Input Action\r\n */\r\nexport class BundleProductsStockStateShareInput implements IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `bunldeProductsSharedState`;\r\n public getCacheObjectType = () => 'bunldeProductsSharedState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBundleProductsSharedState {\r\n areAllBundleProductsOOS?: boolean;\r\n}\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BundleProductsStockStateShareInput();\r\n};\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nexport async function updateBundleProductsStockState(\r\n input: BundleProductsStockStateShareInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return {\r\n areAllBundleProductsOOS: undefined\r\n };\r\n}\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateBundleProductsStockState,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * CheckoutModulesStateShare Input Action\r\n */\r\n\r\nexport class GetPlantPotsProductCountInput implements IActionInput {\r\n public getCacheKey = () => `plantPotsProductCount`;\r\n public getCacheObjectType = () => 'plantPotsProductCount';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPlantPotsProductCountState {\r\n potsProductCount?: number; // Share the plantProductsIds accross checkout modules to not check categories again & again\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new GetPlantPotsProductCountInput();\r\n};\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nexport async function sampleStateAction(\r\n input: GetPlantPotsProductCountInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return { potsProductCount: 0 };\r\n}\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >sampleStateAction,\r\n input: createInput\r\n});\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IDobbiesProductCollection containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum layout {\r\n carousel = 'carousel',\r\n grid = 'grid'\r\n}\r\n\r\nexport interface IDobbiesProductCollectionConfig extends Msdyn365.IModuleConfig {\r\n productCollection: Msdyn365.IProductList;\r\n heading?: IHeadingData;\r\n allowedRelationType?: string;\r\n layout?: layout;\r\n allowBackNavigation?: boolean;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n clientRender?: boolean;\r\n enableAffiliationBasedPricing?: boolean;\r\n shouldDisplaySeeAllButton?: boolean;\r\n className?: string;\r\n redirectToCart?: boolean;\r\n isProductBundles?: boolean;\r\n isBundlesModal?: boolean;\r\n isNotificationModal?: boolean;\r\n discountAppliedInCartMessage?: string;\r\n maxQuantityReachedInBundlesmsg?: string;\r\n}\r\n\r\nexport interface IDobbiesProductCollectionResources {\r\n priceFree: string;\r\n priceRangeSeparator: string;\r\n ratingAriaLabel: string;\r\n flipperNext: string;\r\n flipperPrevious: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n ratingCountAriaLabel: string;\r\n ratingCountAriaLabelSingleUser: string;\r\n seeAllButtonText: string;\r\n addToCartButtonText: string;\r\n addedToCartSuccessMessage: string;\r\n addedToCartFailureMessage: string;\r\n maxQuantityLimitText: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IDobbiesProductCollectionProps extends Msdyn365.IModule {\r\n resources: IDobbiesProductCollectionResources;\r\n config: IDobbiesProductCollectionConfig;\r\n slots: {\r\n quickview: React.ReactNode[];\r\n productComparisonButton: React.ReactNode[];\r\n storeSelectors: React.ReactNode[];\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-object-injection */\r\nimport {\r\n ArrayExtensions,\r\n IProductInventoryInformation,\r\n validateCatalogId,\r\n getFallbackImageUrl\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IComponentNodeProps,\r\n IModuleProps,\r\n INodeProps,\r\n ISingleSlideCarouselProps,\r\n ITelemetryContent,\r\n NodeTag,\r\n SingleSlideCarousel\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductComponent } from '../../themes/dobbies/views/components/product.component';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport {\r\n ProductPrice,\r\n ProductSearchResult,\r\n ProjectionDomain,\r\n ProductWarehouseInventoryAvailability\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getActivePricesAsync,\r\n getByIdAsync,\r\n getDeliveryOptionsAsync,\r\n getEstimatedAvailabilityAsync,\r\n searchByCriteriaAsync,\r\n getVariantsByDimensionValuesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n DeliveryOption,\r\n OrgUnitLocation,\r\n ProductSearchCriteria,\r\n ProductWarehouseInventoryInformation,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { GetPlantPotsProductCountInput } from '../../actions/get-plant-pots-product-count';\r\nimport { mapProductInventoryInformation } from '../../themes/dobbies/utilities/inventory/product-inventory-utils';\r\nimport { IDobbiesProductCollectionData } from './dobbies-product-collection.data';\r\nimport { IDobbiesProductCollectionProps, layout } from './dobbies-product-collection.props.autogenerated';\r\nimport { CartModulesStateShareInput } from '../../actions/cart-state-share';\r\nimport { reaction } from 'mobx';\r\nimport { DiscountLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { _getCartItemMaxQuantity } from '../dobbies-cart/components/dobbies-cart-line-items';\r\nimport { getCatalogId } from '@msdyn365-commerce/core';\r\nimport { IActivePointsData } from '../dobbies-active-image';\r\nimport { IDobbiesMiniCartSummaryProduct } from '../../themes/dobbies/views/buybox.view';\r\nimport { BundleProductsStockStateShareInput } from '../../actions/bundle-products-oos-state';\r\n\r\nexport interface IProductCollectionViewProps extends IDobbiesProductCollectionProps<{}> {\r\n heading?: React.ReactNode;\r\n ProductCollectionContainer: IModuleProps;\r\n SingleSlideCarouselComponentProps: INodeProps;\r\n GridComponentProps: INodeProps;\r\n products: IProductComponentViewProps[];\r\n isCarousel: boolean;\r\n productPrices?: ProductPrice[];\r\n shouldShowAddAllProducts?: boolean;\r\n addAllProductsOnClick?: Button;\r\n pdpProduct?: SimpleProduct;\r\n pdpProductComponent?: React.ReactNode;\r\n isBundlesModal?: boolean;\r\n state: IProductComponentState;\r\n notificationModalProducts?: IDobbiesMiniCartSummaryProduct[];\r\n data: IDobbiesProductCollectionData;\r\n storeSelectorDialogParams?: IDobbiesSelectStoresForCnC;\r\n onClickAndCollectSelectedToBeAddedInCookie?: (productId: number, orgUnitLocation: OrgUnitLocation, addedFromModal?: boolean) => void;\r\n onStoreSelectorDialogClose?: () => void;\r\n}\r\n\r\nexport interface IProductBundlesMaxAvailableQuantities {\r\n productId: number;\r\n maxQuantity: number;\r\n}\r\n\r\nexport interface IProductComponentViewProps {\r\n ProductContainer: INodeProps;\r\n productComponent: React.ReactNode;\r\n addToCartButton: React.ReactNode;\r\n}\r\n\r\nexport interface IDobbiesSelectStoresForCnC {\r\n product: SimpleProduct;\r\n quantity: number;\r\n retailMulitplePickupMFeatureState: boolean;\r\n deliveryOption: DeliveryOption;\r\n}\r\nexport interface IProductComponentState {\r\n products: ProductSearchResult[];\r\n /* VSI Customization - START - 13/04/21 */\r\n inventoryInformation: IProductInventoryInformation[];\r\n productCount?: number;\r\n allProducts?: ProductSearchResult[];\r\n listType?: string; // Check if listType is not plants pots, return\r\n isSharedStateSet?: boolean; // Check if shared state is set no need to reset it again and again\r\n /* VSI Customization - END */\r\n addedProductIdsToBundles: number[];\r\n currQuantities: number[][];\r\n pdpProduct?: SimpleProduct;\r\n pdpSearchResultProduct?: ProductSearchResult;\r\n discountLines?: (DiscountLine[] | undefined)[];\r\n nonClubPlusDiscount?: ProductPrice[];\r\n simpleProductObjs?: SimpleProduct[];\r\n storeSelectorDialogParams?: IDobbiesSelectStoresForCnC;\r\n}\r\nexport interface IAddToBagActionMessageState {\r\n productId?: number;\r\n itemKey?: string;\r\n userMessage?: string;\r\n statusCssString?: string;\r\n messageGlyph?: string;\r\n isOpen?: boolean;\r\n}\r\n\r\nexport interface IProductWithModes extends ProductSearchResult {\r\n isCnC: boolean;\r\n isHomeDelivery: boolean;\r\n}\r\nexport interface IDobbiesAddedProductToBundle {\r\n productId?: number;\r\n quantity?: number;\r\n price?: number;\r\n maxQuantity?: number;\r\n inventoryLocationId?: string;\r\n}\r\n/**\r\n * ProductCollection component\r\n */\r\nclass ProductCollection extends React.PureComponent<\r\n IDobbiesProductCollectionProps,\r\n IProductComponentState & IAddToBagActionMessageState\r\n> {\r\n private telemetryContent: ITelemetryContent;\r\n private productPrices: ProductPrice[];\r\n\r\n private cncDeliveryOption: DeliveryOption | undefined;\r\n constructor(\r\n props: IDobbiesProductCollectionProps,\r\n state: IProductComponentState & IAddToBagActionMessageState\r\n ) {\r\n super(props);\r\n const {\r\n config: { productCollection }\r\n } = this.props;\r\n this.productPrices = [];\r\n this.state = {\r\n products: productCollection && productCollection.products,\r\n inventoryInformation: [],\r\n productCount: 0,\r\n listType: productCollection && productCollection.listType,\r\n allProducts: [],\r\n addedProductIdsToBundles: [],\r\n currQuantities: [],\r\n discountLines: [],\r\n nonClubPlusDiscount: []\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n if (this.props.config.isNotificationModal) {\r\n this.getActiveImageproductAction();\r\n }\r\n }\r\n private getActiveImageproductAction = async () => {\r\n const {\r\n context: {\r\n actionContext: {\r\n requestContext: { cookies }\r\n }\r\n }\r\n } = this.props;\r\n const cookienotificationValue = cookies.get('notification_products');\r\n if (cookienotificationValue && Array.isArray(cookienotificationValue.value) && cookienotificationValue.value['length'] > 0) {\r\n const activePoints = cookienotificationValue.value;\r\n const itemIds: number[] = [];\r\n if (activePoints) {\r\n activePoints.map((activePointData: IActivePointsData) => itemIds.push(+activePointData.itemId!));\r\n }\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n const catalogId = getCatalogId(this.props.context.actionContext.requestContext);\r\n validateCatalogId(catalogId);\r\n\r\n searchCriteriaInput.Context = {\r\n ChannelId: this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n };\r\n searchCriteriaInput.IncludeAttributes = true;\r\n searchCriteriaInput.Ids = itemIds;\r\n if (!activePoints || !ArrayExtensions.hasElements(activePoints)) {\r\n throw new Error('Fail to call ActiveImage API no active points configured.');\r\n }\r\n // eslint-disable-next-line no-return-await -- Disable because we want to return the promise.\r\n const products = await searchByCriteriaAsync({ callerContext: this.props.context.actionContext }, searchCriteriaInput);\r\n this.setState({ products: products });\r\n // return products\r\n }\r\n };\r\n\r\n public componentDidMount(): void {\r\n const {\r\n config: { allowedRelationType, productCollection },\r\n context: { actionContext }\r\n } = this.props;\r\n\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n cookies.remove('cnc_products');\r\n\r\n if (!this.props.config.isProductBundles) {\r\n void this.getNonClubPlusDiscountPrices();\r\n }\r\n /* VSI Customization - START - 13/04/21 */\r\n // Check if listType is not plants pots, return\r\n if (!this.state.isSharedStateSet) {\r\n if (this.state.listType?.toLowerCase() === allowedRelationType?.toLowerCase() && productCollection?.products?.length > 0) {\r\n this._getProductAvailability()\r\n .then(res => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const maxQData: IProductBundlesMaxAvailableQuantities[] = [];\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n for (const sp of this.state.products) {\r\n const maxQ = this.getMaxAvailableQuantityForProduct(sp.RecordId);\r\n const maxQObj: IProductBundlesMaxAvailableQuantities = { productId: sp.RecordId, maxQuantity: maxQ };\r\n if (Array.isArray(cncProducts)) {\r\n for (const cncProd of cncProducts) {\r\n if (cncProd === sp.ItemId) {\r\n maxQObj.maxQuantity = this.getMaxQuantityForCNCProduct();\r\n }\r\n }\r\n }\r\n maxQData.push(maxQObj);\r\n }\r\n cookies.set('product_bundles_maximum_available_quantities', maxQData);\r\n })\r\n .catch(error => error);\r\n } else {\r\n actionContext.update(new GetPlantPotsProductCountInput(), { potsProductCount: 0 });\r\n this.setState({ isSharedStateSet: true });\r\n }\r\n }\r\n /* VSI Customization - END */\r\n\r\n this.setState({ addedProductIdsToBundles: [] });\r\n this.updateAddedProductsList();\r\n reaction(\r\n () => this.props.data.cartSharedState.result?.isCartUpdated,\r\n () => {\r\n if (this.props.data.cartSharedState.result?.isCartUpdated) {\r\n this.updateAddedProductsList();\r\n }\r\n }\r\n );\r\n if (this.props.config.isProductBundles && window && !this.props.config.isNotificationModal) {\r\n const splittedUrl = window.location.href.split('/');\r\n const prodIdStr = splittedUrl[splittedUrl.length - 1];\r\n const prodIdStrSplitted = prodIdStr.split('.p');\r\n let prodId = '';\r\n if (prodIdStrSplitted.length > 1) {\r\n prodId = prodIdStrSplitted[0];\r\n }\r\n if (prodId) {\r\n getByIdAsync(\r\n { callerContext: this.props.context.actionContext },\r\n Number(prodId),\r\n this.props.context.request.apiSettings.channelId\r\n )\r\n .then(resp => {\r\n const pdpProd: SimpleProduct = Array.isArray(resp) ? resp[0] : resp;\r\n this.setState({ pdpProduct: pdpProd });\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = {\r\n ChannelId: this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: this.props.context.actionContext.requestContext.apiSettings.catalogId\r\n };\r\n const productId = pdpProd.MasterProductId ? pdpProd.MasterProductId : pdpProd.RecordId;\r\n searchCriteriaInput.Ids = [productId];\r\n searchCriteriaInput.IncludeAttributes = true;\r\n searchByCriteriaAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n searchCriteriaInput\r\n )\r\n .then(searchByCriteriaResp => {\r\n if (searchByCriteriaResp && searchByCriteriaResp.length > 0) {\r\n const searchByCriteriaItem = searchByCriteriaResp[0];\r\n searchByCriteriaItem.RecordId = pdpProd.RecordId;\r\n if (searchByCriteriaItem.IsMasterProduct) {\r\n getVariantsByDimensionValuesAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n searchByCriteriaItem.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n []\r\n ).then(variants => {\r\n if (variants && variants.length) {\r\n const variant = variants[0];\r\n const fallbackImageUrl = getFallbackImageUrl(\r\n variant.ItemId,\r\n this.props.context.actionContext.requestContext.apiSettings\r\n );\r\n if (!variant.PrimaryImageUrl?.includes('http')) {\r\n variant.PrimaryImageUrl = fallbackImageUrl;\r\n }\r\n this.setState({ pdpSearchResultProduct: variant });\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n }\r\n });\r\n } else {\r\n this.setState({ pdpSearchResultProduct: searchByCriteriaItem });\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n }\r\n }\r\n })\r\n .catch(e => {});\r\n })\r\n .catch(ex => {});\r\n }\r\n }\r\n }\r\n public checkDifference = (array1: ProductSearchResult[], array2: ProductSearchResult[]) => {\r\n if (!array1 || !array2) {\r\n return true;\r\n }\r\n if (array1?.length !== array2?.length) {\r\n return true;\r\n }\r\n for (let i = 0; i < array1.length; i++) {\r\n if (array1[i].RecordId !== array2[i].RecordId) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n public componentDidUpdate(\r\n prevProps: Readonly>,\r\n prevState: Readonly,\r\n snapshot?: any\r\n ): void {\r\n if (this.checkDifference(prevState.products, this.state.products)) {\r\n if (this.state.products && this.props.config.isNotificationModal && this.props.config.isProductBundles) {\r\n this._getProductAvailabilityNotification()\r\n .then(res => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const maxQData: IProductBundlesMaxAvailableQuantities[] = [];\r\n for (const sp of this.state.products) {\r\n let maxQ = this.getMaxAvailableQuantityForProduct(sp.RecordId);\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (cncProducts && Array.isArray(cncProducts) && cncProducts.includes(sp.ItemId)) {\r\n maxQ = this.getMaxQuantityForCNCProduct();\r\n }\r\n const maxQObj: IProductBundlesMaxAvailableQuantities = { productId: sp.RecordId, maxQuantity: maxQ };\r\n maxQData.push(maxQObj);\r\n }\r\n cookies.set('product_notification_maximum_available_quantities', maxQData);\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n })\r\n .catch(error => error);\r\n }\r\n }\r\n }\r\n private async getProductsListWithKitProductsHandled(products: ProductSearchResult[]): Promise {\r\n // const kitProductIds = products.map(prod => {\r\n // if (prod.IsMasterProduct) {\r\n // return prod.RecordId;\r\n // }\r\n // return undefined;\r\n // });\r\n const finalProducts: ProductSearchResult[] = [];\r\n if (products && products.length) {\r\n for (const p of products) {\r\n if (p) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n p.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n []\r\n );\r\n if (variants && variants.length === 1) {\r\n // products = products.filter(p => p.RecordId !== p.RecordId);\r\n finalProducts.push(variants[0]);\r\n } else {\r\n finalProducts.push(p);\r\n }\r\n }\r\n }\r\n }\r\n return finalProducts;\r\n }\r\n private async getAllSimpleProducts(): Promise {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n let products = this.props.config.isNotificationModal\r\n ? this.state.products\r\n : this.props.config.productCollection && this.props.config.productCollection.products;\r\n products = await this.getProductsListWithKitProductsHandled(products);\r\n\r\n if (!this.props.config.isNotificationModal) {\r\n const productCollectionProducts = products.map(pros => ({ itemId: pros.RecordId }));\r\n cookies.set('productBundle_products', productCollectionProducts);\r\n }\r\n const productRecIds = ArrayExtensions.hasElements(products) ? products.map(prod => prod.RecordId) : [];\r\n const simpleProds = await getByIdsAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(this.props.context.actionContext)\r\n },\r\n this.props.context.request.apiSettings.channelId,\r\n productRecIds,\r\n null,\r\n this.props.context.request.apiSettings.catalogId ?? 0\r\n );\r\n this.setState({ simpleProductObjs: simpleProds });\r\n }\r\n\r\n private _getNotificationModalProducts(): IDobbiesMiniCartSummaryProduct[] {\r\n const addedToSummaryProducts: IDobbiesMiniCartSummaryProduct[] = [];\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n const product = this.state.simpleProductObjs?.find(prod => prod.RecordId === obj['productId']);\r\n if (product) {\r\n const miniCartProduct: IDobbiesMiniCartSummaryProduct = { ...product };\r\n miniCartProduct.quantity = obj['quantity'];\r\n addedToSummaryProducts.push(miniCartProduct);\r\n }\r\n }\r\n }\r\n return addedToSummaryProducts;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { heading, className } = this.props.config;\r\n const { resources } = this.props;\r\n const { products, inventoryInformation } = this.state;\r\n // Return if there are no products\r\n if (!products || products.length === 0 || inventoryInformation.length === 0) {\r\n return null;\r\n }\r\n const isCarousel = this.props.config.layout === layout.carousel;\r\n const headingComponent = heading && (\r\n \r\n );\r\n\r\n const availableProducts =\r\n products &&\r\n products.length > 0 &&\r\n products\r\n .filter(item => {\r\n if (item.ItemId === this.state.pdpProduct?.ItemId) {\r\n return false;\r\n }\r\n // Check if product doesn't have inventory, dont dislay it\r\n const itemInventorys = inventoryInformation.filter(\r\n inventory => inventory.ProductAvailableQuantity.ProductId === item.RecordId\r\n );\r\n if (itemInventorys && itemInventorys.length) {\r\n for (const iv of itemInventorys) {\r\n if (iv && iv.IsProductAvailable) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (cncProducts && Array.isArray(cncProducts)) {\r\n for (const cncProd of cncProducts) {\r\n if (item.ItemId === cncProd) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n })\r\n .map((item: ProductSearchResult, index: number) => this._getProduct(item, index));\r\n\r\n if (products && products.length && (!availableProducts || !availableProducts.length)) {\r\n this.props.context.actionContext.update(new BundleProductsStockStateShareInput(), { areAllBundleProductsOOS: true });\r\n }\r\n // else if (products && products.length && availableProducts && availableProducts.length) {\r\n // this.props.context.actionContext.update(new BundleProductsStockStateShareInput(), { areAllBundleProductsOOS: false });\r\n // }\r\n\r\n const productCollectionViewProps = {\r\n ...this.props,\r\n state: this.state,\r\n heading: headingComponent,\r\n SingleSlideCarouselComponentProps: {\r\n tag: SingleSlideCarousel,\r\n className: '',\r\n flipperPrevLabel: resources.flipperPrevious,\r\n flipperNextLabel: resources.flipperNext,\r\n parentId: this.props.id,\r\n telemetryContent: this.telemetryContent\r\n } as IComponentNodeProps,\r\n ProductCollectionContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-product-collection product-bundles', className)\r\n },\r\n GridComponentProps: {\r\n tag: 'ul' as NodeTag,\r\n className: 'ms-product-collection__items'\r\n },\r\n isCarousel: isCarousel,\r\n products: availableProducts,\r\n productPrices: this.productPrices,\r\n shouldShowAddAllProducts: this.props.config.isProductBundles,\r\n pdpProduct: this.props.config.isProductBundles && this.state.pdpProduct ? this.state.pdpProduct : undefined,\r\n pdpProductComponent:\r\n this.props.config.isProductBundles &&\r\n this.state.pdpSearchResultProduct &&\r\n this._getPDPProduct(this.state.pdpSearchResultProduct, this.state.pdpSearchResultProduct.RecordId),\r\n isBundlesModal: this.props.config.isBundlesModal,\r\n notificationModalProducts: this._getNotificationModalProducts(),\r\n storeSelectorDialogParams: this.state.storeSelectorDialogParams,\r\n onClickAndCollectSelectedToBeAddedInCookie: this.onClickAndCollectSelectedToBeAddedInCookie,\r\n onStoreSelectorDialogClose: this.onStoreSelectorDialogClose\r\n };\r\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\r\n }\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\r\n\r\n private updateAddedProductsList = () => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const addedProductsIds: number[] = [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n addedProductsIds.push(obj['productId']);\r\n }\r\n this.setState({ addedProductIdsToBundles: addedProductsIds });\r\n }\r\n if (\r\n this.props.config.isNotificationModal &&\r\n this.props.config.isProductBundles &&\r\n this.props.context.request.telemetryPageName !== 'DefaultPdp'\r\n ) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n }\r\n };\r\n private getPDPProductMaxQ = () => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n return cookies.get('pdp_product_quantity_for_bundles').value;\r\n };\r\n\r\n private onStoreSelectorDialogClose = () => {\r\n this.setState({ storeSelectorDialogParams: undefined });\r\n };\r\n\r\n private onClickAndCollectSelectedToBeAddedInCookie = (\r\n productId: number,\r\n orgUnitLocation: OrgUnitLocation,\r\n addedFromModal?: boolean\r\n ) => {\r\n if (!addedFromModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === productId);\r\n const maxPDPQ = this.getPDPProductMaxQ();\r\n const maxPDPQNumber = maxPDPQ ? Number(maxPDPQ) : 0;\r\n if (productId === this.state.pdpSearchResultProduct?.RecordId && !(cl && cl.Quantity && cl.Quantity >= maxPDPQNumber)) {\r\n this._updateCookiesForAddedProducts(this.state.pdpSearchResultProduct, orgUnitLocation);\r\n } else {\r\n const prods = this.state.products;\r\n const prod = prods.find(p => p.RecordId === productId);\r\n if (prod) {\r\n this._updateCookiesForAddedProducts(prod, orgUnitLocation);\r\n }\r\n }\r\n }\r\n this.setState({ storeSelectorDialogParams: undefined });\r\n };\r\n\r\n private onBundleProductCheckBoxSelected = (productId: number) => {\r\n if (this.state.products && this.state.products.length) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n for (const p of this.state.products) {\r\n if (Array.isArray(cncProducts) && p.RecordId === productId) {\r\n for (const c of cncProducts) {\r\n if (c === p.ItemId) {\r\n const sp = this.state.simpleProductObjs?.find(s => s.RecordId === productId);\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === productId);\r\n if (sp && prodQD && prodQD[1] && this.cncDeliveryOption) {\r\n // const findInStore = getFindInStoreForProduct(\r\n // this.props.context,\r\n // this.props.slots.storeSelectors,\r\n // sp,\r\n // p,\r\n // prodQD[1],\r\n // this.cncDeliveryOption\r\n // );\r\n const storeSelectorDialogParams: IDobbiesSelectStoresForCnC = {\r\n product: sp,\r\n quantity: prodQD[1],\r\n retailMulitplePickupMFeatureState: true,\r\n deliveryOption: this.cncDeliveryOption\r\n };\r\n this.setState({ storeSelectorDialogParams: storeSelectorDialogParams });\r\n return;\r\n } else if (sp && this.cncDeliveryOption) {\r\n // const findInStore = getFindInStoreForProduct(\r\n // this.props.context,\r\n // this.props.slots.storeSelectors,\r\n // sp,\r\n // p,\r\n // 1,\r\n // this.cncDeliveryOption\r\n // );\r\n const storeSelectorDialogParams: IDobbiesSelectStoresForCnC = {\r\n product: sp,\r\n quantity: 1,\r\n retailMulitplePickupMFeatureState: true,\r\n deliveryOption: this.cncDeliveryOption\r\n };\r\n this.setState({ storeSelectorDialogParams: storeSelectorDialogParams });\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.state.storeSelectorDialogParams) {\r\n this.setState({ storeSelectorDialogParams: undefined });\r\n }\r\n }\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === productId);\r\n const maxPDPQ = this.getPDPProductMaxQ();\r\n const maxPDPQNumber = maxPDPQ ? Number(maxPDPQ) : 0;\r\n if (productId === this.state.pdpSearchResultProduct?.RecordId && !(cl && cl.Quantity && cl.Quantity >= maxPDPQNumber)) {\r\n this._updateCookiesForAddedProducts(this.state.pdpSearchResultProduct);\r\n } else {\r\n const prods = this.state.products;\r\n const prod = prods.find(p => p.RecordId === productId);\r\n if (prod) {\r\n void this._addItemToCart(prod, prod.RecordId.toString());\r\n }\r\n }\r\n };\r\n private _getPDPProduct = (product: ProductSearchResult, index: number): React.ReactNode => {\r\n if (!product || !product.Name) {\r\n this.props.telemetry.trace('[product-collection] Product or product name is null');\r\n return null;\r\n }\r\n const telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const { imageSettings, allowBackNavigation } = this.props.config;\r\n const { addToCartButtonText } = this.props.resources;\r\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n const resources = this.props.resources;\r\n // 9.33 SDK Update\r\n const quickviewSlot =\r\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\r\n const reviewCount = 1;\r\n const reviewTotalRatings = Number(product.TotalRatings);\r\n const reviewCountAriaLabelValue =\r\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\r\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n console.log(reviewCountAriaLabelValue);\r\n // VSI - CUSTOMIZATION 04/02/2022 - To hide the Mode Of Delivery icons from modal for related products / delivery cart upsells\r\n const productWithModes: IProductWithModes = { ...product, isCnC: false, isHomeDelivery: false };\r\n let shouldNotShowAddToCartButton =\r\n this.props.config.isProductBundles && this.state.addedProductIdsToBundles.includes(product.RecordId);\r\n const maxAvailableQ = this.getPDPProductMaxQ(); //this.getMaxAvailableQuantityForProduct(productWithModes.RecordId);\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n // VSI - CUSTOMIZATION - END\r\n return (\r\n
\r\n 0 ? this.state.discountLines[index] : []}\r\n nonClubPlusDiscount={this.state.nonClubPlusDiscount?.filter(item => item.ProductId === productWithModes.RecordId)[0]}\r\n simpleProduct={this.state.simpleProductObjs?.find(sp => sp.RecordId === productWithModes.RecordId)}\r\n />\r\n {shouldNotShowAddToCartButton ? (\r\n <>\r\n ) : (\r\n \r\n Add\r\n \r\n )}\r\n
\r\n );\r\n };\r\n\r\n private _getProduct = (product: ProductSearchResult, index: number): IProductComponentViewProps | null => {\r\n if (!product || !product.Name) {\r\n this.props.telemetry.trace('[product-collection] Product or product name is null');\r\n return null;\r\n }\r\n const telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const { imageSettings, allowBackNavigation } = this.props.config;\r\n const { addToCartButtonText } = this.props.resources;\r\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\r\n\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n\r\n const resources = this.props.resources;\r\n // 9.33 SDK Update\r\n const quickviewSlot =\r\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\r\n const reviewCount = 1;\r\n const reviewTotalRatings = Number(product.TotalRatings);\r\n const reviewCountAriaLabelValue =\r\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\r\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n\r\n console.log(reviewCountAriaLabelValue);\r\n // VSI - CUSTOMIZATION 04/02/2022 - To hide the Mode Of Delivery icons from modal for related products / delivery cart upsells\r\n const productWithModes: IProductWithModes = { ...product, isCnC: false, isHomeDelivery: false };\r\n let shouldNotShowAddToCartButton =\r\n this.props.config.isProductBundles && this.state.addedProductIdsToBundles.includes(product.RecordId);\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n // VSI - CUSTOMIZATION - END\r\n return {\r\n ProductContainer: {\r\n tag: 'li' as NodeTag,\r\n className: 'ms-product-collection__item',\r\n role: 'listitem',\r\n key: index\r\n },\r\n productComponent: (\r\n 0 ? this.state.discountLines[index] : []}\r\n nonClubPlusDiscount={this.state.nonClubPlusDiscount?.filter(item => item.ProductId === productWithModes.RecordId)[0]}\r\n simpleProduct={this.state.simpleProductObjs?.find(sp => sp.RecordId === productWithModes.RecordId)}\r\n />\r\n ),\r\n addToCartButton: shouldNotShowAddToCartButton ? (\r\n <>\r\n ) : (\r\n \r\n Add\r\n \r\n )\r\n };\r\n };\r\n\r\n private onQuantityChangeListener = (productId: number, newQuantity: number): void => {\r\n const currQuantityData = this.state.currQuantities;\r\n let productFound = false;\r\n for (const qd of currQuantityData) {\r\n if (qd[0] === productId) {\r\n qd[1] = newQuantity;\r\n productFound = true;\r\n }\r\n }\r\n if (!productFound) {\r\n currQuantityData.push([productId, newQuantity]);\r\n }\r\n this.setState({ currQuantities: currQuantityData });\r\n if (this.props.config.isNotificationModal && this.props.config.isProductBundles) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n }\r\n };\r\n\r\n private _getProductAvailabilityNotification = async (): Promise => {\r\n const { products } = this.state;\r\n const {\r\n context: { actionContext }\r\n } = this.props;\r\n\r\n if (!products) {\r\n return;\r\n }\r\n\r\n const validProducts: number[] = [];\r\n\r\n for (const product of products) {\r\n if (product.RecordId) {\r\n validProducts.push(product.RecordId);\r\n }\r\n }\r\n\r\n if (validProducts.length === 0) {\r\n return;\r\n }\r\n\r\n const callerContext = actionContext;\r\n const {\r\n requestContext: {\r\n apiSettings: { channelId, catalogId }\r\n }\r\n } = actionContext;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: channelId, CatalogId: catalogId };\r\n searchCriteriaInput.Ids = validProducts;\r\n searchCriteriaInput.IncludeAttributes = true;\r\n let productData = await searchByCriteriaAsync({ callerContext, queryResultSettings: {} }, searchCriteriaInput);\r\n\r\n productData = await Promise.all(\r\n productData.map(async prod => {\r\n if (prod.IsMasterProduct) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n prod.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n []\r\n );\r\n if (variants && variants.length) {\r\n const variant = variants[0];\r\n prod.RecordId = variant.RecordId;\r\n }\r\n }\r\n return prod;\r\n })\r\n );\r\n\r\n this.setState({\r\n allProducts: productData\r\n });\r\n const attributeName = 'fulfillmenttype';\r\n const attributeTextValue = 'plants';\r\n\r\n const plantProducts: ProductSearchResult[] = [];\r\n const nonPlantProducts: ProductSearchResult[] = [];\r\n\r\n this.state.allProducts &&\r\n this.state.allProducts.map(product => {\r\n const fulfillmentTypeAttribute =\r\n product.AttributeValues &&\r\n product.AttributeValues.find(attribute => {\r\n return attribute?.Name?.toLowerCase() === attributeName;\r\n });\r\n const isPlantFulfillment =\r\n fulfillmentTypeAttribute && fulfillmentTypeAttribute.TextValue?.toLowerCase() === attributeTextValue;\r\n const isPlantCategory = isPlantFulfillment ? true : false;\r\n\r\n if (isPlantCategory) {\r\n plantProducts.push(product);\r\n } else {\r\n nonPlantProducts.push(product);\r\n }\r\n });\r\n\r\n const prodIds = this.state.allProducts && this.state.allProducts.map(prod => prod.RecordId);\r\n if (prodIds && prodIds.length <= 0) {\r\n return;\r\n }\r\n\r\n const plantProductIds = plantProducts.map(pp => pp.RecordId);\r\n const nonPlantProductIds = nonPlantProducts.map(npp => npp.RecordId);\r\n\r\n let productAvailabilitesPlants: ProductWarehouseInventoryInformation | null = null;\r\n\r\n if (plantProductIds && plantProductIds.length) {\r\n productAvailabilitesPlants = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: plantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n prodIds ? prodIds : []\r\n );\r\n const productsWithPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n plantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesPlants && productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities) {\r\n productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities?.map(\r\n (item: ProductWarehouseInventoryAvailability) => {\r\n if (item.InventLocationId === 'P001' || item.InventLocationId === 'S059') {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n } else {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n this.cncDeliveryOption = option;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n if (isCnC && !isHomeDelivery) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (Array.isArray(cncProducts) && !cncProducts.includes(prod.ItemId)) {\r\n cncProducts.push(prod.ItemId);\r\n }\r\n cookies.set('cnc_products', cncProducts);\r\n const maxQuantities = cookies.get('product_bundles_maximum_available_quantities')?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === prod.RecordId) {\r\n maxQ.maxQuantity = this.getMaxQuantityForCNCProduct();\r\n }\r\n }\r\n }\r\n cookies.set('product_bundles_maximum_available_quantities', maxQuantities);\r\n }\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n let productAvailabilitesNonPlantsHD: ProductWarehouseInventoryInformation | null = null;\r\n let productAvailabilitesNonPlantsCNC: ProductWarehouseInventoryInformation | null = null;\r\n // Not Plants API since the warehouse storage is different\r\n if (nonPlantProductIds && nonPlantProductIds.length) {\r\n productAvailabilitesNonPlantsHD = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: true, FilterByChannelFulfillmentGroup: false }\r\n );\r\n productAvailabilitesNonPlantsCNC = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const productsWithNonPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n nonPlantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesNonPlantsHD && productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n });\r\n }\r\n\r\n if (productAvailabilitesNonPlantsCNC && productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n this.cncDeliveryOption = option;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n if (isCnC && !isHomeDelivery) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (Array.isArray(cncProducts)) {\r\n cncProducts.push(prod.ItemId);\r\n }\r\n cookies.set('cnc_products', cncProducts);\r\n const maxQuantities = cookies.get('product_bundles_maximum_available_quantities')?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === prod.RecordId) {\r\n maxQ.maxQuantity = this.getMaxQuantityForCNCProduct();\r\n }\r\n }\r\n }\r\n cookies.set('product_bundles_maximum_available_quantities', maxQuantities);\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n const totalProducts = [...productsWithPlantsDelivery, ...productsWithNonPlantsDelivery];\r\n\r\n const allProducts: any = [];\r\n products.map(prod => {\r\n totalProducts.find(item => {\r\n if (item.RecordId === prod.RecordId) {\r\n allProducts.push(item);\r\n }\r\n });\r\n });\r\n let inventoryInformation: IProductInventoryInformation[] = [];\r\n let productsLength = 0;\r\n if (plantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(actionContext, productAvailabilitesPlants?.ProductWarehouseInventoryAvailabilities ?? [])\r\n );\r\n productsLength += plantProducts.length;\r\n //this.setState({ inventoryInformation: inventoryInformation, productCount: plantProducts.length });\r\n\r\n // Check if product shared state is not set, set it\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: plantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (nonPlantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(\r\n actionContext,\r\n productAvailabilitesNonPlantsHD?.ProductWarehouseInventoryAvailabilities ?? []\r\n )\r\n );\r\n productsLength += nonPlantProducts.length;\r\n // this.setState({\r\n // inventoryInformation: inventoryInformation,\r\n // productCount: nonPlantProducts.length\r\n // });\r\n // Check if product shared state is not set, set it\r\n\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: nonPlantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (inventoryInformation && inventoryInformation.length) {\r\n this.setState({ inventoryInformation: inventoryInformation, productCount: productsLength });\r\n if (!this.state.isSharedStateSet) {\r\n this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n potsProductCount: productsLength\r\n });\r\n this.setState({ isSharedStateSet: true });\r\n }\r\n }\r\n };\r\n\r\n /* VSI Customization - START - 13/04/21 */\r\n private _getProductAvailability = async (): Promise => {\r\n const { products } = this.state;\r\n const {\r\n context: { actionContext }\r\n } = this.props;\r\n\r\n if (!products) {\r\n return;\r\n }\r\n\r\n const validProducts: number[] = [];\r\n\r\n for (const product of products) {\r\n if (product.RecordId) {\r\n validProducts.push(product.RecordId);\r\n }\r\n }\r\n\r\n if (validProducts.length === 0) {\r\n return;\r\n }\r\n\r\n const callerContext = actionContext;\r\n const {\r\n requestContext: {\r\n apiSettings: { channelId, catalogId }\r\n }\r\n } = actionContext;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: channelId, CatalogId: catalogId };\r\n searchCriteriaInput.Ids = validProducts;\r\n searchCriteriaInput.IncludeAttributes = true;\r\n let productData = await searchByCriteriaAsync({ callerContext, queryResultSettings: {} }, searchCriteriaInput);\r\n\r\n productData = await Promise.all(\r\n productData.map(async prod => {\r\n if (prod.IsMasterProduct) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n prod.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n []\r\n );\r\n if (variants && variants.length) {\r\n const variant = variants[0];\r\n prod.RecordId = variant.RecordId;\r\n }\r\n }\r\n return prod;\r\n })\r\n );\r\n\r\n this.setState({\r\n allProducts: productData\r\n });\r\n const attributeName = 'fulfillmenttype';\r\n const attributeTextValue = 'plants';\r\n\r\n const plantProducts: ProductSearchResult[] = [];\r\n const nonPlantProducts: ProductSearchResult[] = [];\r\n\r\n this.state.allProducts &&\r\n this.state.allProducts.map(product => {\r\n const fulfillmentTypeAttribute =\r\n product.AttributeValues &&\r\n product.AttributeValues.find(attribute => {\r\n return attribute?.Name?.toLowerCase() === attributeName;\r\n });\r\n const isPlantFulfillment =\r\n fulfillmentTypeAttribute && fulfillmentTypeAttribute.TextValue?.toLowerCase() === attributeTextValue;\r\n const isPlantCategory = isPlantFulfillment ? true : false;\r\n\r\n if (isPlantCategory) {\r\n plantProducts.push(product);\r\n } else {\r\n nonPlantProducts.push(product);\r\n }\r\n });\r\n\r\n const prodIds = this.state.allProducts && this.state.allProducts.map(prod => prod.RecordId);\r\n if (prodIds && prodIds.length <= 0) {\r\n return;\r\n }\r\n\r\n const plantProductIds = plantProducts.map(pp => pp.RecordId);\r\n const nonPlantProductIds = nonPlantProducts.map(npp => npp.RecordId);\r\n\r\n let productAvailabilitesPlants: ProductWarehouseInventoryInformation | null = null;\r\n if (plantProductIds && plantProductIds.length) {\r\n productAvailabilitesPlants = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: plantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n prodIds ? prodIds : []\r\n );\r\n const productsWithPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n plantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesPlants && productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities) {\r\n productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities?.map(\r\n (item: ProductWarehouseInventoryAvailability) => {\r\n if (item.InventLocationId === 'P001' || item.InventLocationId === 'S059') {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n } else {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n this.cncDeliveryOption = option;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n\r\n if (isCnC && !isHomeDelivery) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (Array.isArray(cncProducts)) {\r\n cncProducts.push(prod.ItemId);\r\n }\r\n cookies.set('cnc_products', cncProducts);\r\n const maxQuantities = cookies.get('product_bundles_maximum_available_quantities')?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === prod.RecordId) {\r\n maxQ.maxQuantity = this.getMaxQuantityForCNCProduct();\r\n }\r\n }\r\n }\r\n cookies.set('product_bundles_maximum_available_quantities', maxQuantities);\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n let productAvailabilitesNonPlantsHD: ProductWarehouseInventoryInformation | null = null;\r\n let productAvailabilitesNonPlantsCNC: ProductWarehouseInventoryInformation | null = null;\r\n // Not Plants API since the warehouse storage is different\r\n if (nonPlantProductIds && nonPlantProductIds.length) {\r\n productAvailabilitesNonPlantsHD = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: true, FilterByChannelFulfillmentGroup: false }\r\n );\r\n productAvailabilitesNonPlantsCNC = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const productsWithNonPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n nonPlantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesNonPlantsHD && productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n });\r\n }\r\n\r\n if (productAvailabilitesNonPlantsCNC && productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n this.cncDeliveryOption = option;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n\r\n if (isCnC && !isHomeDelivery) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (Array.isArray(cncProducts)) {\r\n cncProducts.push(prod.ItemId);\r\n }\r\n cookies.set('cnc_products', cncProducts);\r\n const maxQuantities = cookies.get('product_bundles_maximum_available_quantities')?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === prod.RecordId) {\r\n maxQ.maxQuantity = this.getMaxQuantityForCNCProduct();\r\n }\r\n }\r\n }\r\n cookies.set('product_bundles_maximum_available_quantities', maxQuantities);\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n const totalProducts = [...productsWithPlantsDelivery, ...productsWithNonPlantsDelivery];\r\n\r\n const allProducts: any = [];\r\n products.map(prod => {\r\n totalProducts.find(item => {\r\n if (item.RecordId === prod.RecordId) {\r\n allProducts.push(item);\r\n }\r\n });\r\n });\r\n\r\n let inventoryInformation: IProductInventoryInformation[] = [];\r\n let productsLength = 0;\r\n if (plantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(actionContext, productAvailabilitesPlants?.ProductWarehouseInventoryAvailabilities ?? [])\r\n );\r\n productsLength += plantProducts.length;\r\n // this.setState({ inventoryInformation: inventoryInformation, productCount: plantProducts.length });\r\n\r\n // Check if product shared state is not set, set it\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: plantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (nonPlantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(\r\n actionContext,\r\n productAvailabilitesNonPlantsHD?.ProductWarehouseInventoryAvailabilities ?? []\r\n )\r\n );\r\n productsLength += nonPlantProducts.length;\r\n // this.setState({\r\n // inventoryInformation: inventoryInformation,\r\n // productCount: nonPlantProducts.length\r\n // });\r\n // Check if product shared state is not set, set it\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: nonPlantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (inventoryInformation && inventoryInformation.length) {\r\n this.setState({ inventoryInformation: inventoryInformation, productCount: productsLength });\r\n if (!this.state.isSharedStateSet) {\r\n this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n potsProductCount: productsLength\r\n });\r\n this.setState({ isSharedStateSet: true });\r\n }\r\n }\r\n };\r\n // Following function adds product to cart\r\n private _getAddToCart = (product: ProductSearchResult, itemKey: string) => () => {\r\n if (this.state.products && this.state.products.length) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n for (const p of this.state.products) {\r\n if (Array.isArray(cncProducts) && p.RecordId === product.RecordId) {\r\n for (const c of cncProducts) {\r\n if (c === p.ItemId) {\r\n const sp = this.state.simpleProductObjs?.find(s => s.RecordId === product.RecordId);\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n if (sp && prodQD && prodQD[1] && this.cncDeliveryOption) {\r\n // const findInStore = getFindInStoreForProduct(\r\n // this.props.context,\r\n // this.props.slots.storeSelectors,\r\n // sp,\r\n // p,\r\n // prodQD[1],\r\n // this.cncDeliveryOption\r\n // );\r\n const storeSelectorDialogParams: IDobbiesSelectStoresForCnC = {\r\n product: sp,\r\n quantity: prodQD[1],\r\n retailMulitplePickupMFeatureState: true,\r\n deliveryOption: this.cncDeliveryOption\r\n };\r\n this.setState({ storeSelectorDialogParams: storeSelectorDialogParams });\r\n return;\r\n } else if (sp && this.cncDeliveryOption) {\r\n // const findInStore = getFindInStoreForProduct(\r\n // this.props.context,\r\n // this.props.slots.storeSelectors,\r\n // sp,\r\n // p,\r\n // 1,\r\n // this.cncDeliveryOption\r\n // );\r\n const storeSelectorDialogParams: IDobbiesSelectStoresForCnC = {\r\n product: sp,\r\n quantity: 1,\r\n retailMulitplePickupMFeatureState: true,\r\n deliveryOption: this.cncDeliveryOption\r\n };\r\n this.setState({ storeSelectorDialogParams: storeSelectorDialogParams });\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.state.storeSelectorDialogParams) {\r\n this.setState({ storeSelectorDialogParams: undefined });\r\n }\r\n }\r\n this._addItemToCart(product, itemKey).catch(error => `[addItemToCart] unable to add to cart`);\r\n };\r\n\r\n private getOrderQuantityLimitsFeatureFlag(): boolean {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n try {\r\n const featureStatuses = this.props.data.featureState.result;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n return false;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error as string);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n try {\r\n const customerInfo = this.props.data.customerInformation.result;\r\n return (\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } catch (error) {\r\n this.props.telemetry.warning(error as string);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n return false;\r\n }\r\n }\r\n\r\n private _updateCookiesForAddedProducts = (product: ProductSearchResult, orgLocation?: OrgUnitLocation) => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProducts: IDobbiesAddedProductToBundle[] = [];\r\n const addedProductsToCollection =\r\n cookies.get(this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const maxPDPQuantity = this.getPDPProductMaxQ();\r\n const maxPDPQNumber = maxPDPQuantity ? Number(maxPDPQuantity) : 0;\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n addedProducts.push({\r\n productId: obj['productId'],\r\n quantity: obj['quantity'],\r\n price: obj['price'],\r\n maxQuantity: obj['maxQuantity'],\r\n inventoryLocationId: obj['inventoryLocationId']\r\n });\r\n }\r\n }\r\n let productAddedAlready = false;\r\n for (const ap of addedProducts) {\r\n if (ap.productId === product.RecordId) {\r\n ap.quantity = ap.quantity ? ap.quantity + 1 : 1;\r\n productAddedAlready = true;\r\n }\r\n }\r\n if (!productAddedAlready) {\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n if (prodQD) {\r\n const quantityToBeAdded = prodQD[1];\r\n addedProducts.push({\r\n productId: product.RecordId,\r\n quantity: quantityToBeAdded,\r\n price: product.Price ? product.Price : product.BasePrice,\r\n maxQuantity:\r\n product.RecordId === this.state.pdpSearchResultProduct?.RecordId\r\n ? maxPDPQNumber\r\n : this.getMaxAvailableQuantityForProduct(product.RecordId),\r\n inventoryLocationId: orgLocation?.InventoryLocationId\r\n });\r\n } else {\r\n addedProducts.push({\r\n productId: product.RecordId,\r\n quantity: 1,\r\n price: product.Price ? product.Price : product.BasePrice,\r\n maxQuantity:\r\n product.RecordId === this.state.pdpSearchResultProduct?.RecordId\r\n ? maxPDPQNumber\r\n : this.getMaxAvailableQuantityForProduct(product.RecordId),\r\n inventoryLocationId: orgLocation?.InventoryLocationId\r\n });\r\n }\r\n }\r\n\r\n const cookieName = this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles';\r\n cookies.set(cookieName, addedProducts);\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n if (this.props.config.isNotificationModal) {\r\n this.updateAddedProductsList();\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n }\r\n };\r\n\r\n private getMaxQuantityForCNCProduct = () => {\r\n return this.props.context.app.config.maxQuantityForCartLineItem;\r\n };\r\n\r\n private getMaxAvailableQuantityForProduct = (productId: number): number => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (cncProducts && Array.isArray(cncProducts)) {\r\n for (const cncProd of cncProducts) {\r\n for (const prod of this.state.products) {\r\n if (prod.RecordId === productId && prod.ItemId === cncProd) {\r\n return this.getMaxQuantityForCNCProduct();\r\n }\r\n }\r\n }\r\n }\r\n let quantity = 0;\r\n const inventoryInformation = this.state.inventoryInformation;\r\n const productInvInfo =\r\n inventoryInformation && inventoryInformation.find(inventory => inventory.ProductAvailableQuantity.ProductId === productId);\r\n quantity =\r\n productInvInfo && productInvInfo.ProductAvailableQuantity.AvailableQuantity\r\n ? productInvInfo.ProductAvailableQuantity.AvailableQuantity\r\n : 0;\r\n const product = this.state.simpleProductObjs?.find(prod => prod.RecordId === productId);\r\n quantity = _getCartItemMaxQuantity(\r\n this.props.context.app.config.maxQuantityForCartLineItem,\r\n this.props.context.app.config.enableStockCheck || false,\r\n quantity,\r\n this.getOrderQuantityLimitsFeatureFlag(),\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n return quantity;\r\n };\r\n\r\n private _addItemToCart = async (product: ProductSearchResult, itemKey: string): Promise => {\r\n const { context, data, resources, telemetry } = this.props;\r\n const { cart, featureState } = data;\r\n const { addedToCartSuccessMessage, addedToCartFailureMessage } = resources;\r\n const { inventoryInformation } = this.state;\r\n const productInventoryInformation =\r\n inventoryInformation &&\r\n inventoryInformation.find(inventory => inventory.ProductAvailableQuantity.ProductId === product.RecordId);\r\n const navigationUrl = Msdyn365.getUrlSync('cart', context.actionContext);\r\n if (this.props.config.isProductBundles && !this.props.config.isBundlesModal && !this.props.config.isNotificationModal) {\r\n this._updateCookiesForAddedProducts(product);\r\n return;\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n const productList = new Array();\r\n const p = await this._convertToSimpleProduct(product);\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n let quantityToBeAdded = 1;\r\n if (prodQD) {\r\n quantityToBeAdded = prodQD[1];\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl && cl.Quantity && cl.Quantity < quantityToBeAdded) {\r\n quantityToBeAdded = quantityToBeAdded - cl.Quantity;\r\n }\r\n }\r\n productList.push({\r\n product: p,\r\n count: quantityToBeAdded,\r\n enableStockCheck: this.props.context.app.config.enableStockCheck\r\n });\r\n cart.result\r\n ?.addProductsToCart(productList)\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartSuccessMessage,\r\n statusCssString: 'success',\r\n messageGlyph: 'fas fa-check',\r\n isOpen: true\r\n });\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }\r\n })\r\n .catch(e => {});\r\n return;\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n const productList = new Array();\r\n const p = await this._convertToSimpleProduct(product);\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n let quantityToBeAdded = 1;\r\n if (prodQD) {\r\n quantityToBeAdded = prodQD[1];\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl && cl.Quantity && cl.Quantity < quantityToBeAdded) {\r\n quantityToBeAdded = quantityToBeAdded - cl.Quantity;\r\n }\r\n }\r\n productList.push({\r\n product: p,\r\n count: quantityToBeAdded,\r\n enableStockCheck: this.props.context.app.config.enableStockCheck\r\n });\r\n cart.result\r\n ?.addProductsToCart(productList)\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartSuccessMessage,\r\n statusCssString: 'success',\r\n messageGlyph: 'fas fa-check',\r\n isOpen: true\r\n });\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }\r\n })\r\n .catch(e => {});\r\n return;\r\n }\r\n if (context) {\r\n if (cart.result) {\r\n const isOrderQuantityLimitsFeatureEnabledInHq =\r\n featureState.result?.find(\r\n featuresState => featuresState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform\r\n ?.enableDefaultOrderQuantityLimits;\r\n\r\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings = defaultOrderQuantityLimitsFeatureConfig === 'all';\r\n\r\n const isOrderQuantityLimitsFeatureEnabled =\r\n isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings;\r\n // check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = this.props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n [product.RecordId]\r\n );\r\n\r\n const simpleProduct = await this._convertToSimpleProduct(product);\r\n\r\n const addProductToCartInput = {\r\n product: simpleProduct,\r\n quantity: 1,\r\n enableStockCheck: context.app.config.enableStockCheck,\r\n availableQuantity: productInventoryInformation\r\n ? productInventoryInformation.ProductAvailableQuantity.AvailableQuantity\r\n : 0,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: isOrderQuantityLimitsFeatureEnabled },\r\n isAddEmailDeliveryItemToCart:\r\n ArrayExtensions.hasElements(deliveryOptions) &&\r\n ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) &&\r\n deliveryOptions[0].DeliveryOptions[0].Code === emailDeliveryModeCode\r\n };\r\n cart.result\r\n .addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartSuccessMessage,\r\n statusCssString: 'success',\r\n messageGlyph: 'fas fa-check',\r\n isOpen: true\r\n });\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n !this.props.config.isProductBundles &&\r\n !this.props.config.isBundlesModal &&\r\n navigationUrl &&\r\n window &&\r\n window.location.assign(navigationUrl);\r\n } else if (result.substatus === 'MAXQUANTITY') {\r\n const curQuantity =\r\n (await cart).cart?.CartLines?.find(item => item.ProductId === product.RecordId)?.Quantity || 0;\r\n const maxQtyLimitReachedMessage = this._getInventoryValueMessage(productInventoryInformation, curQuantity);\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: maxQtyLimitReachedMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n } else if (result.substatus === 'QUANTITYLIMITS' && isOrderQuantityLimitsFeatureEnabled) {\r\n const maxQtyLimitReachedMessage = result.errorDetails?.LocalizedMessage;\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: maxQtyLimitReachedMessage || addedToCartFailureMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n } else {\r\n this.props.telemetry.debug('[wishlist-items] Unable to Update Cart Line from Pots Collection');\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartFailureMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n telemetry.warning(error);\r\n telemetry.debug('[wishlist-items] Error trying to Update Cart Line from Pots Collection');\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartFailureMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n });\r\n }\r\n }\r\n };\r\n\r\n private readonly getNonClubPlusDiscountPrices = async (): Promise => {\r\n const products = this.state.products || [];\r\n if (this.props.config.isProductBundles && this.state.pdpSearchResultProduct) {\r\n products.push(this.state.pdpSearchResultProduct);\r\n }\r\n const productsListWithKitScenarioHandled = await this.getProductsListWithKitProductsHandled(\r\n this.state.products ? this.state.products : []\r\n );\r\n const productRecIds = ArrayExtensions.hasElements(productsListWithKitScenarioHandled)\r\n ? productsListWithKitScenarioHandled.map(prod => prod.RecordId)\r\n : [];\r\n const projectDomain: ProjectionDomain = {\r\n ChannelId: this.props.context.request.apiSettings.channelId,\r\n CatalogId: this.props.context.request.apiSettings.catalogId\r\n };\r\n await getActivePricesAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n projectDomain,\r\n productRecIds,\r\n new Date(),\r\n null,\r\n null,\r\n true\r\n )\r\n .then(async (activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n this.setState({\r\n nonClubPlusDiscount: activePricesResponse\r\n });\r\n const updatedProducts = productsListWithKitScenarioHandled.map(prod => {\r\n const activePrice = activePricesResponse.find(price => price.ProductId === prod.RecordId);\r\n if (activePrice) {\r\n prod.Price = activePrice.CustomerContextualPrice ?? prod.Price;\r\n prod.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n }\r\n return prod;\r\n });\r\n const productPricesforcookies = updatedProducts.map(prod => {\r\n return {\r\n recordId: prod.RecordId,\r\n price: prod.Price,\r\n basePrice: prod.BasePrice\r\n };\r\n });\r\n if (updatedProducts) {\r\n const cookieName = this.props.config.isNotificationModal ? 'notification_products_prices' : '';\r\n if (cookieName) {\r\n this.props.context.actionContext.requestContext.cookies.set(cookieName, productPricesforcookies);\r\n }\r\n this.setState({ products: updatedProducts });\r\n }\r\n const activePrice = activePricesResponse.find(price => price.ProductId === this.state.pdpSearchResultProduct?.RecordId);\r\n if (activePrice) {\r\n const pdpProd = this.state.pdpSearchResultProduct;\r\n if (pdpProd) {\r\n pdpProd.Price = activePrice.CustomerContextualPrice ?? pdpProd.Price;\r\n pdpProd.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n this.setState({ pdpSearchResultProduct: pdpProd });\r\n if (this.props.config.isProductBundles && !this.props.config.isBundlesModal) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(\r\n this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles'\r\n )?.value || [];\r\n let pdpProductAlreadyAdded = false;\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (pdpProd.RecordId === obj['productId']) {\r\n pdpProductAlreadyAdded = true;\r\n }\r\n }\r\n }\r\n if (!pdpProductAlreadyAdded) {\r\n if (this.props.config.isProductBundles && !this.props.config.isBundlesModal) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (cncProducts && Array.isArray(cncProducts)) {\r\n for (const cncProd of cncProducts) {\r\n if (pdpProd.ItemId === cncProd) {\r\n return;\r\n }\r\n }\r\n }\r\n this._addItemToCart(pdpProd, pdpProd.RecordId.toString()).catch(\r\n error => `[addItemToCart] unable to add to cart`\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n this.props.context.actionContext.trace(error.message);\r\n this.props.context.actionContext.telemetry.exception(error);\r\n this.props.context.actionContext.telemetry.debug(\r\n '[get Affiliation based price on search result container ]Error executing action'\r\n );\r\n throw new Error('[get Affiliation based price on search result container]Error executing action');\r\n });\r\n };\r\n\r\n // Following function converts ProductSearchResult into SimpleProduct\r\n private async _convertToSimpleProduct(product: ProductSearchResult): Promise {\r\n const {\r\n context: {\r\n actionContext: {\r\n requestContext: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const response = await getByIdAsync({ callerContext: this.props.context.actionContext }, product.RecordId, channelId);\r\n return Array.isArray(response) ? response[0] : response;\r\n }\r\n\r\n // Followig function returns inventory messages\r\n private _getInventoryValueMessage(product: IProductInventoryInformation | undefined, curQuantity: number): string {\r\n const { context, resources } = this.props;\r\n const { maxQuantityLimitText } = resources;\r\n\r\n const maxQuantityForLineItem = context.app.config.maxQuantityForCartLineItem || 10;\r\n\r\n if (!product || !product.ProductAvailableQuantity.AvailableQuantity || !context.app.config.enableStockCheck) {\r\n return maxQuantityLimitText\r\n .replace('{maxQuantity}', maxQuantityForLineItem.toString())\r\n .replace('{curQuantity}', curQuantity.toString());\r\n }\r\n\r\n const minInventory = Math.min(maxQuantityForLineItem, product.ProductAvailableQuantity.AvailableQuantity);\r\n\r\n return maxQuantityLimitText.replace('{maxQuantity}', minInventory.toString()).replace('{curQuantity}', curQuantity.toString());\r\n }\r\n /* VSI Customization - END */\r\n // private _getActivePrice = async (): Promise => {\r\n // let products = this.state.products || [];\r\n // const productRecIds = products && products.length > 0 ? products.map(prod => prod.RecordId) : [];\r\n // const projectDomain: ProjectionDomain = {\r\n // ChannelId: this.props.context.request.apiSettings.channelId,\r\n // CatalogId: this.props.context.request.apiSettings.catalogId\r\n // };\r\n // const affliations: AffiliationLoyaltyTier[] = [];\r\n // const customerInput = new GetCustomerInput(this.props.context.actionContext.requestContext.apiSettings);\r\n // const customer = await getCustomer(customerInput, this.props.context.actionContext);\r\n\r\n // if (customer && customer.CustomerAffiliations) {\r\n // customer.CustomerAffiliations.forEach((affliation: CustomerAffiliation) => {\r\n // const aff: AffiliationLoyaltyTier = { AffiliationId: affliation.RetailAffiliationId, CustomerId: customer.AccountNumber };\r\n // affliations.push(aff);\r\n // });\r\n // }\r\n\r\n // await getActivePricesAsync(\r\n // { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n // projectDomain,\r\n // productRecIds,\r\n // new Date(),\r\n // null,\r\n // affliations,\r\n // true\r\n // )\r\n // .then((activePricesResponse: ProductPrice[]) => {\r\n // this.productPrices = activePricesResponse;\r\n // products = products.map(prod => {\r\n // const activePrice = activePricesResponse.find(price => price.ProductId === prod.RecordId);\r\n // if (activePrice) {\r\n // prod.Price = activePrice.CustomerContextualPrice ?? prod.Price;\r\n // prod.BasePrice = Math.max(\r\n // activePrice.BasePrice || 0,\r\n // activePrice.TradeAgreementPrice || 0,\r\n // activePrice.AdjustedPrice || 0\r\n // );\r\n // }\r\n // return prod;\r\n // });\r\n // this.setState({\r\n // products: products\r\n // });\r\n // })\r\n // .catch((error: Error) => {\r\n // this.props.context.actionContext.trace(error.message);\r\n // this.props.context.actionContext.telemetry.exception(error);\r\n // this.props.context.actionContext.telemetry.debug(\r\n // `[get Affiliation based price on Product Collection]Error executing action`\r\n // );\r\n // throw new Error('[get Affiliation based price on Product Collection]Error executing action');\r\n // });\r\n // };\r\n}\r\n\r\nexport default ProductCollection;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { INodeProps, Module, Node, Button } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IDobbiesAddedProductToBundle, IProductCollectionViewProps, IProductComponentViewProps } from './dobbies-product-collection';\r\nimport { IDobbiesMiniCartSummaryProduct } from '../../themes/dobbies/views/buybox.view';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { ProductPrice, SimpleProduct, ProjectionDomain, DeliveryOption, ProductDeliveryOptions } from '@msdyn365-commerce/retail-proxy';\r\nimport { CartModulesStateShareInput } from '../../actions/cart-state-share';\r\nimport { Quantity } from '../../themes/dobbies/utilities/quantity';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getByIdsAsync,\r\n getDeliveryOptionsAsync,\r\n getActivePricesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ArrayExtensions, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { cartLineQuantityUpdatedAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport PriceComponent from '../../themes/dobbies/views/custom-components/product-price-component';\r\nimport { IFullOrgUnitAvailability } from '../../themes/dobbies/actions/utilities/full-org-unit-availability';\r\nimport { GetAllOrgUnitLocationsByAreaInput, getAllOrgUnitLocationsByArea } from '../../actions/get-all-store-location-information';\r\n\r\nconst ProductCollectionView: React.FC = props => {\r\n const [cartProducts, setCartProducts] = React.useState([]);\r\n const [bundlesSummaryScrollPos, setBundlesSummaryScrollPos] = React.useState(0);\r\n const [bundlesModalSummaryScrollPos, setBundlesModalSummaryScrollPos] = React.useState(0);\r\n\r\n const {\r\n heading,\r\n ProductCollectionContainer,\r\n products,\r\n SingleSlideCarouselComponentProps,\r\n GridComponentProps,\r\n isCarousel,\r\n pdpProduct,\r\n pdpProductComponent\r\n } = props;\r\n\r\n const equalsCheck = (a: number[], b: number[]) => {\r\n return a.length === b.length && a.every((v, i) => v === b[i]);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (props.onStoreSelectorDialogClose && props.data.storeSelectorStateManager.result?.isDialogOpen === false) {\r\n props.onStoreSelectorDialogClose();\r\n }\r\n }, [props.data.storeSelectorStateManager.result?.isDialogOpen]);\r\n\r\n const renderStoreSelector = (\r\n product: SimpleProduct,\r\n quantity: number,\r\n retailMulitplePickupMFeatureState: boolean,\r\n deliveryOption: DeliveryOption,\r\n isFromModal: boolean,\r\n isFromNotification?: boolean\r\n ) => {\r\n //const cartState = await getCartState(props.context.actionContext);\r\n let storeSelectorId = '';\r\n if (\r\n props.modules &&\r\n Object.keys(props.modules).length > 0 &&\r\n props.modules.storeSelectors &&\r\n props.modules.storeSelectors.length > 0\r\n ) {\r\n storeSelectorId = props.modules.storeSelectors[0].id;\r\n }\r\n // storeSelectorId = props.data.storeSelectorStateManager.result?.context?.id || ''; // 'dobbies-buybox-store-selector'\r\n const productDeliveryOptions: ProductDeliveryOptions = { ProductId: product.RecordId, DeliveryOptions: [deliveryOption] };\r\n props.data.storeSelectorStateManager.result\r\n ?.openDialog({\r\n product,\r\n id: storeSelectorId,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? productDeliveryOptions : undefined,\r\n isDialog: true,\r\n onLocationSelected: async (orgUnitLocation, deliveryMode) => {\r\n const cartState = await getCartState(props.context.actionContext);\r\n if (!cartState.cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const {\r\n context: {\r\n app: { config }\r\n }\r\n } = props;\r\n const behavior = config && config.addToCartBehavior;\r\n if (isFromModal) {\r\n return cartState\r\n .addProductToCart({ product: product, count: quantity, location: orgUnitLocation, deliveryMode: deliveryMode })\r\n .then(result => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n console.log('Result failed');\r\n // callbacks.changeModalOpen(false);\r\n // const productAvailability = state.productAvailableQuantity\r\n // ? state.productAvailableQuantity.ProductAvailableQuantity\r\n // : productAvailableQuantity && productAvailableQuantity.length\r\n // ? productAvailableQuantity[0].ProductAvailableQuantity\r\n // : undefined\r\n // const failureResult: IAddToCartFailureResult = {\r\n // failureReason: 'CARTACTIONFAILED',\r\n // cartActionResult: { status: result.status, substatus: result.substatus }\r\n // };\r\n // callbacks.updateErrorState({\r\n // errorHost: 'ADDTOCART',\r\n // configureErrors: {},\r\n // otherError: getGenericError(\r\n // failureResult,\r\n // cart,\r\n // resources,\r\n // context,\r\n // product,\r\n // productAvailability,\r\n // orgUnitLocation\r\n // )\r\n // });\r\n } else {\r\n if (behavior === undefined || behavior === 'goToCart' || behavior === 'nothing') {\r\n if (result.status === 'SUCCESS') {\r\n // SetIsAddedToCart(true);\r\n // if (onAddToCartClicked) {\r\n // onAddToCartClicked();\r\n // }\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n if (props.onClickAndCollectSelectedToBeAddedInCookie) {\r\n props.onClickAndCollectSelectedToBeAddedInCookie(product.RecordId, orgUnitLocation, true);\r\n }\r\n // if (isFromNotification) {\r\n // updateCartProduct();\r\n // }\r\n }\r\n } else if (behavior === 'showModal') {\r\n console.log('Show modal');\r\n // callbacks.updateErrorState({\r\n // configureErrors: {}\r\n // });\r\n // callbacks.changeModalOpen(true);\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n return;\r\n });\r\n } else {\r\n if (props.onClickAndCollectSelectedToBeAddedInCookie) {\r\n props.onClickAndCollectSelectedToBeAddedInCookie(product.RecordId, orgUnitLocation);\r\n }\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n return;\r\n });\r\n };\r\n const updateCartProduct = async () => {\r\n const productIds: number[] = props.data.cart.result?.cart.CartLines\r\n ? props.data.cart.result?.cart.CartLines?.map(cartline => cartline.ProductId || -1)\r\n : [];\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const addedProducts =\r\n cookies.get(props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n if (Array.isArray(addedProducts)) {\r\n for (const ap of addedProducts) {\r\n if (!productIds.includes(ap['productId'])) {\r\n productIds.push(ap['productId']);\r\n }\r\n }\r\n }\r\n const productBundleProducts = cookies.get('notification_products_for_summary');\r\n const updatedProductIds: number[] = [];\r\n if (Array.isArray(productIds)) {\r\n for (const prodId of productIds) {\r\n if (productBundleProducts && Array.isArray(productBundleProducts.value) && productBundleProducts.value['length'] > 0) {\r\n for (const prodBP of productBundleProducts.value) {\r\n if (+prodBP.itemId === prodId || `${+prodBP.itemId}` === `${prodId}`) {\r\n updatedProductIds.push(prodId);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const simpleProductsData = ArrayExtensions.validValues(\r\n await getByIdsAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(props.context.actionContext)\r\n },\r\n props.context.actionContext.requestContext.apiSettings.channelId\r\n ? props.context.actionContext.requestContext.apiSettings.channelId\r\n : -1,\r\n updatedProductIds,\r\n null,\r\n props.context.actionContext.requestContext.apiSettings.catalogId\r\n )\r\n );\r\n\r\n let simpleProductsWithQuantities = simpleProductsData.map(sp => {\r\n const prodWithQuantity: IDobbiesMiniCartSummaryProduct = { ...sp, quantity: 1 };\r\n const cl = props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === prodWithQuantity.RecordId);\r\n if (Array.isArray(addedProducts)) {\r\n for (const ap of addedProducts) {\r\n if (prodWithQuantity.RecordId === ap['productId']) {\r\n prodWithQuantity.quantity = ap['quantity'];\r\n if (cl && prodWithQuantity.quantity && cl.Quantity) {\r\n prodWithQuantity.quantity += cl.Quantity;\r\n }\r\n }\r\n }\r\n }\r\n if (cl && cl.Quantity && prodWithQuantity.quantity && prodWithQuantity.quantity <= cl.Quantity) {\r\n prodWithQuantity.quantity = cl.Quantity;\r\n }\r\n return prodWithQuantity;\r\n });\r\n const simpleProdIds = simpleProductsWithQuantities.map(prod => prod.RecordId);\r\n const cartProductIds = cartProducts.map(cartProd => cartProd.RecordId);\r\n\r\n if (!equalsCheck(simpleProdIds, cartProductIds)) {\r\n const projectDomain: ProjectionDomain = {\r\n ChannelId: props.context.request.apiSettings.channelId,\r\n CatalogId: props.context.request.apiSettings.catalogId\r\n };\r\n const pIds = simpleProductsWithQuantities.map(p => p.RecordId);\r\n await getActivePricesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n projectDomain,\r\n pIds,\r\n new Date(),\r\n null,\r\n null,\r\n true\r\n )\r\n .then((activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n simpleProductsWithQuantities = simpleProductsWithQuantities.map(sp => {\r\n const activePrice = activePricesResponse.find(price => price.ProductId === sp.RecordId);\r\n if (activePrice) {\r\n sp.Price = activePrice.CustomerContextualPrice ?? sp.Price;\r\n sp.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n }\r\n return sp;\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {});\r\n const updatedSimpleProductsWithQuantities = simpleProductsWithQuantities.filter(item => {\r\n // Check if product doesn't have inventory, dont dislay it\r\n const itemInventory = props.state.inventoryInformation.find(\r\n inventory => inventory.ProductAvailableQuantity.ProductId === item.RecordId\r\n );\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (cncProducts && Array.isArray(cncProducts) && cncProducts.includes(item.ItemId)) {\r\n return true;\r\n }\r\n return itemInventory && itemInventory.IsProductAvailable === true;\r\n });\r\n setCartProducts(updatedSimpleProductsWithQuantities);\r\n } else {\r\n if (simpleProductsWithQuantities) {\r\n let needsUpdate = false;\r\n for (const cp of cartProducts) {\r\n const ap = simpleProductsWithQuantities.find(p => p.RecordId === cp.RecordId);\r\n if (ap?.quantity !== cp.quantity) {\r\n needsUpdate = true;\r\n }\r\n }\r\n if (needsUpdate) {\r\n const projectDomain: ProjectionDomain = {\r\n ChannelId: props.context.request.apiSettings.channelId,\r\n CatalogId: props.context.request.apiSettings.catalogId\r\n };\r\n const pIds = simpleProductsWithQuantities.map(p => p.RecordId);\r\n await getActivePricesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n projectDomain,\r\n pIds,\r\n new Date(),\r\n null,\r\n null,\r\n true\r\n )\r\n .then((activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n simpleProductsWithQuantities = simpleProductsWithQuantities.map(sp => {\r\n const activePrice = activePricesResponse.find(price => price.ProductId === sp.RecordId);\r\n if (activePrice) {\r\n sp.Price = activePrice.CustomerContextualPrice ?? sp.Price;\r\n sp.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n }\r\n return sp;\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {});\r\n const updatedSimpleProductsWithQuantities = simpleProductsWithQuantities.filter(item => {\r\n // Check if product doesn't have inventory, dont dislay it\r\n const itemInventory = props.state.inventoryInformation.find(\r\n inventory => inventory.ProductAvailableQuantity.ProductId === item.RecordId\r\n );\r\n\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (cncProducts && Array.isArray(cncProducts) && cncProducts.includes(item.ItemId)) {\r\n return true;\r\n }\r\n return itemInventory && itemInventory.IsProductAvailable === true;\r\n });\r\n setCartProducts(updatedSimpleProductsWithQuantities);\r\n }\r\n }\r\n }\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n };\r\n React.useEffect(() => {\r\n updateCartProduct();\r\n }, [props.data.cart.result?.cart.CartLines]);\r\n React.useEffect(() => {\r\n if (props.data.cartSharedState?.result?.isCartUpdated) {\r\n updateCartProduct();\r\n }\r\n }, [props.data.cartSharedState.result?.isCartUpdated]);\r\n if (products) {\r\n if (props.config.isNotificationModal) {\r\n return (\r\n <>\r\n \r\n {heading}\r\n {isCarousel\r\n ? _renderCarousel(SingleSlideCarouselComponentProps, products)\r\n : _renderGrid(GridComponentProps, products)}\r\n\r\n {props.shouldShowAddAllProducts && props.addAllProductsOnClick}\r\n \r\n
\r\n
\r\n

Your basket

\r\n {_renderCartLines(\r\n props,\r\n cartProducts,\r\n setCartProducts,\r\n bundlesSummaryScrollPos,\r\n setBundlesSummaryScrollPos,\r\n bundlesModalSummaryScrollPos,\r\n setBundlesModalSummaryScrollPos,\r\n true\r\n )}\r\n {\r\n const notifiCheck = props.context.request.user.isAuthenticated ? 'signedin' : 'signedout';\r\n setCookie(props, 'notification_popup', notifiCheck, 1);\r\n MsDyn365.isBrowser && window && window.location.assign('/cart');\r\n }}\r\n >\r\n {!props.data.cart.result?.cart.CartLines?.length ? 'Add an item' : 'View your basket'}\r\n \r\n

\r\n {props.config.discountAppliedInCartMessage\r\n ? props.config.discountAppliedInCartMessage\r\n : 'Any offers/discounts will be applied at checkout'}\r\n

\r\n
\r\n
\r\n {props.storeSelectorDialogParams &&\r\n renderStoreSelector(\r\n props.storeSelectorDialogParams.product,\r\n props.storeSelectorDialogParams.quantity,\r\n props.storeSelectorDialogParams.retailMulitplePickupMFeatureState,\r\n props.storeSelectorDialogParams.deliveryOption,\r\n true,\r\n true\r\n )}\r\n {props.storeSelectorDialogParams && props.slots.storeSelectors[0]}\r\n \r\n );\r\n } else if (pdpProduct && pdpProductComponent && !props.isBundlesModal) {\r\n return (\r\n <>\r\n {pdpProductComponent}\r\n
\r\n \r\n {heading}\r\n {isCarousel\r\n ? _renderCarousel(SingleSlideCarouselComponentProps, products)\r\n : _renderGrid(GridComponentProps, products)}\r\n\r\n {props.shouldShowAddAllProducts && props.addAllProductsOnClick}\r\n \r\n {props.storeSelectorDialogParams &&\r\n renderStoreSelector(\r\n props.storeSelectorDialogParams.product,\r\n props.storeSelectorDialogParams.quantity,\r\n props.storeSelectorDialogParams.retailMulitplePickupMFeatureState,\r\n props.storeSelectorDialogParams.deliveryOption,\r\n false\r\n )}\r\n {props.storeSelectorDialogParams && props.slots.storeSelectors[0]}\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {heading}\r\n {isCarousel\r\n ? _renderCarousel(SingleSlideCarouselComponentProps, products)\r\n : _renderGrid(GridComponentProps, products)}\r\n {props.shouldShowAddAllProducts && props.addAllProductsOnClick}\r\n \r\n {props.storeSelectorDialogParams &&\r\n renderStoreSelector(\r\n props.storeSelectorDialogParams.product,\r\n props.storeSelectorDialogParams.quantity,\r\n props.storeSelectorDialogParams.retailMulitplePickupMFeatureState,\r\n props.storeSelectorDialogParams.deliveryOption,\r\n true\r\n )}\r\n {props.storeSelectorDialogParams && props.slots.storeSelectors[0]}\r\n \r\n );\r\n }\r\n }\r\n props.context.telemetry.error('Product collection content is empty, module wont render.');\r\n return null;\r\n};\r\n\r\nconst setCookie = (props: IProductCollectionViewProps, name: string, value: string, deltaDaysFromToday: number) => {\r\n const { cookies } = props.context.request;\r\n const expirationDate = new Date(Date.now());\r\n expirationDate.setTime(expirationDate.getTime() + deltaDaysFromToday * 24 * 60 * 60 * 1000);\r\n\r\n cookies.set(name, value, {\r\n expires: deltaDaysFromToday ? expirationDate : null,\r\n isEssential: true\r\n } as {});\r\n};\r\n\r\nconst _getAllStores = async (\r\n props: IProductCollectionViewProps,\r\n latitude?: number,\r\n longitude?: number,\r\n radius?: number,\r\n distanceUnitValue?: number\r\n): Promise => {\r\n const {\r\n context: { actionContext }\r\n } = props;\r\n\r\n const orgUnitLocationsInput = new GetAllOrgUnitLocationsByAreaInput(latitude, longitude, radius, distanceUnitValue, false);\r\n const orgUnitLocations = await getAllOrgUnitLocationsByArea(orgUnitLocationsInput, actionContext);\r\n return orgUnitLocations;\r\n};\r\n\r\nconst changeQinBundlesModalSummary = async (\r\n props: IProductCollectionViewProps,\r\n productId: number,\r\n newValue: number,\r\n cartProducts: IDobbiesMiniCartSummaryProduct[],\r\n setCartProducts: React.Dispatch>,\r\n isSummaryInModal: boolean,\r\n maxQuantityForBundle: number\r\n) => {\r\n const cartState = await getCartState(props.context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === productId);\r\n const simpleProduct: SimpleProduct | undefined = cartProducts.find(c => c.RecordId === productId);\r\n if (maxQuantityForBundle <= 0) {\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const maxQuantities =\r\n cookies.get(\r\n props.config.isNotificationModal\r\n ? 'product_notification_maximum_available_quantities'\r\n : 'product_bundles_maximum_available_quantities'\r\n )?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === productId) {\r\n maxQuantityForBundle = maxQ.maxQuantity;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (cl && cl.Quantity && maxQuantityForBundle && simpleProduct) {\r\n if (newValue > maxQuantityForBundle) {\r\n return;\r\n }\r\n const diffInQuantity = newValue - cl.Quantity;\r\n const deliveryOptions = await getDeliveryOptionsAsync({ callerContext: props.context.actionContext, queryResultSettings: {} }, [\r\n productId\r\n ]);\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n if (diffInQuantity > 0) {\r\n const addProductToCartInput = {\r\n product: simpleProduct,\r\n quantity: diffInQuantity,\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n availableQuantity: maxQuantityForBundle,\r\n isAddEmailDeliveryItemToCart:\r\n ArrayExtensions.hasElements(deliveryOptions) &&\r\n ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) &&\r\n deliveryOptions[0].DeliveryOptions[0].Code === emailDeliveryModeCode\r\n };\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const cncProducts = cookies.get('cnc_products').value || [];\r\n if (Array.isArray(cncProducts) && cncProducts.includes(simpleProduct.ItemId)) {\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n [simpleProduct.RecordId]\r\n );\r\n let cncOption: DeliveryOption | undefined;\r\n deliveryOptions.map(dopt => {\r\n dopt.DeliveryOptions?.map(delOpt => {\r\n if (delOpt.Code === 'ClickCol') {\r\n cncOption = delOpt;\r\n }\r\n });\r\n });\r\n const sLocations = await _getAllStores(props, 31.5070767, 74.4315609, 0, 0);\r\n const storeLocation = sLocations.find(sl => {\r\n return sl.OrgUnitAvailability?.OrgUnitLocation?.InventoryLocationId === cl.FulfillmentStoreId;\r\n });\r\n if (storeLocation && storeLocation.OrgUnitAvailability?.OrgUnitLocation) {\r\n cartState\r\n .addProductToCart({\r\n product: simpleProduct,\r\n count: diffInQuantity,\r\n location: storeLocation.OrgUnitAvailability?.OrgUnitLocation,\r\n deliveryMode: cncOption?.Code\r\n })\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n })\r\n .catch(e => {});\r\n }\r\n } else {\r\n cartState\r\n .addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n })\r\n .catch(e => {});\r\n }\r\n } else if (diffInQuantity < 0) {\r\n cartLineQuantityUpdatedAsync(true, cartState, props.context.actionContext.telemetry, [simpleProduct], cl, newValue)\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch(e => {});\r\n }\r\n }\r\n};\r\nconst onQuantityChange = async (\r\n props: IProductCollectionViewProps,\r\n productId: number,\r\n newValue: number,\r\n cartProducts: IDobbiesMiniCartSummaryProduct[],\r\n setCartProducts: React.Dispatch>,\r\n isSummaryInModal: boolean,\r\n maxQuantityForBundle: number\r\n) => {\r\n if (isSummaryInModal) {\r\n changeQinBundlesModalSummary(props, productId, newValue, cartProducts, setCartProducts, isSummaryInModal, maxQuantityForBundle);\r\n return;\r\n }\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: false });\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const cartProductsCopy = cartProducts.map(cp => cp);\r\n const updatedProducts: IDobbiesAddedProductToBundle[] = [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (obj['productId'] === productId) {\r\n const valueToBeUpdated = newValue;\r\n if (valueToBeUpdated > 0) {\r\n updatedProducts.push({\r\n productId: obj['productId'],\r\n price: obj['price'],\r\n quantity: valueToBeUpdated,\r\n maxQuantity: obj['maxQuantity']\r\n });\r\n for (const cp of cartProductsCopy) {\r\n if (cp.RecordId === obj['productId']) {\r\n cp.quantity = valueToBeUpdated;\r\n }\r\n }\r\n }\r\n } else {\r\n updatedProducts.push({\r\n productId: obj['productId'],\r\n price: obj['price'],\r\n quantity: obj['quantity'],\r\n maxQuantity: obj['maxQuantity']\r\n });\r\n }\r\n }\r\n const cookieName = props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles';\r\n cookies.set(cookieName, updatedProducts);\r\n setCartProducts(cartProductsCopy);\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n};\r\nconst _renderCartLines = (\r\n props: IProductCollectionViewProps,\r\n cartProducts: IDobbiesMiniCartSummaryProduct[],\r\n setCartProducts: React.Dispatch>,\r\n bundlesSummaryScrollPos: number,\r\n setBundlesSummaryScrollPos: React.Dispatch>,\r\n bundlesModalSummaryScrollPos: number,\r\n setBundlesModalSummaryScrollPos: React.Dispatch>,\r\n isSummaryInModal: boolean\r\n) => {\r\n let totalPrice = 0.0;\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const productsAddedInBundles = cookies.get('notification_added_products')?.value || [];\r\n const elemId = 'notification_product_summary';\r\n const elem = MsDyn365.isBrowser && window && window.document.getElementById(elemId);\r\n const rowHeight = 116;\r\n const minProductsToScroll = isSummaryInModal && MsDyn365.isBrowser && window && window.innerWidth >= 1280 ? 2 : 1;\r\n const upArrowId = isSummaryInModal ? 'up-arrow-btn-modal' : 'up-arrow-btn';\r\n const downArrowId = isSummaryInModal ? 'down-arrow-btn-modal' : 'down-arrow-btn';\r\n let scrollPos = isSummaryInModal ? bundlesModalSummaryScrollPos : bundlesSummaryScrollPos;\r\n const rowHeightForCalc = 90;\r\n const maxQuantityReachedMsg = props.config.maxQuantityReachedInBundlesmsg\r\n ? props.config.maxQuantityReachedInBundlesmsg\r\n : `There is only 1 product left. Please choose quantity within the available range`;\r\n if (isSummaryInModal) {\r\n cartProducts = cartProducts.filter(cp =>\r\n props.data.cart.result?.cart.CartLines?.find(cl => cl.ProductId === cp.RecordId) ? true : false\r\n );\r\n if (cartProducts && props.data.cart.result?.cart.CartLines && props.data.cart.result?.cart.CartLines.length) {\r\n for (const c of props.data.cart.result?.cart.CartLines) {\r\n for (const cp of cartProducts) {\r\n if (c.ProductId === cp.RecordId) {\r\n cp.quantity = c.Quantity;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n cartProducts = cartProducts.filter(\r\n cp => Array.isArray(productsAddedInBundles) && productsAddedInBundles.find(p => p['productId'] === cp.RecordId)\r\n );\r\n }\r\n return (\r\n <>\r\n {cartProducts && cartProducts.length > minProductsToScroll ? (\r\n {\r\n if (elem) {\r\n if (elem.scrollTop - rowHeight > 0) {\r\n elem.scrollTop -= rowHeight;\r\n } else {\r\n elem.scrollTop = 0;\r\n }\r\n if (isSummaryInModal) {\r\n setBundlesModalSummaryScrollPos(elem.scrollTop);\r\n } else {\r\n setBundlesSummaryScrollPos(elem.scrollTop);\r\n }\r\n }\r\n }}\r\n hidden={elem && scrollPos < 50 ? true : false}\r\n >\r\n ) : (\r\n <>\r\n )}\r\n {\r\n if (elem && Math.abs(Math.ceil(elem.scrollTop) - Math.ceil(scrollPos)) > rowHeightForCalc) {\r\n if (!isSummaryInModal) {\r\n if (elem.scrollTop >= (cartProducts.length - (minProductsToScroll + 1)) * rowHeightForCalc) {\r\n setBundlesSummaryScrollPos(elem?.scrollTop);\r\n } else if (elem.scrollTop < 50) {\r\n setBundlesSummaryScrollPos(elem?.scrollTop);\r\n }\r\n } else {\r\n if (elem.scrollTop >= (cartProducts.length - minProductsToScroll + 1) * rowHeightForCalc) {\r\n setBundlesModalSummaryScrollPos(elem?.scrollTop);\r\n } else if (elem.scrollTop < 50) {\r\n setBundlesModalSummaryScrollPos(elem?.scrollTop);\r\n }\r\n const upArrow = MsDyn365.isBrowser && window && window.document.getElementById(upArrowId);\r\n const downArrow = MsDyn365.isBrowser && window && window.document.getElementById(downArrowId);\r\n\r\n if (elem.scrollTop < 50) {\r\n if (upArrow) {\r\n upArrow.hidden = true;\r\n }\r\n } else {\r\n if (upArrow) {\r\n upArrow.hidden = false;\r\n }\r\n }\r\n if (elem.scrollTop > (cartProducts.length - minProductsToScroll) * rowHeightForCalc) {\r\n if (downArrow) {\r\n downArrow.hidden = true;\r\n }\r\n } else {\r\n if (downArrow) {\r\n downArrow.hidden = false;\r\n }\r\n }\r\n }\r\n scrollPos = elem.scrollTop;\r\n }\r\n }}\r\n >\r\n {cartProducts.map((product, index) => {\r\n let prodInBundles;\r\n let cookiePrice;\r\n let maxQuantityForBundle = 0;\r\n let shouldShowQuantityReachedErrorMsg = false;\r\n const cl = props.data.cart?.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (Array.isArray(productsAddedInBundles)) {\r\n prodInBundles = productsAddedInBundles.find(p => p['productId'] === product.RecordId);\r\n if (prodInBundles) {\r\n cookiePrice = prodInBundles['price'];\r\n maxQuantityForBundle = prodInBundles['maxQuantity'];\r\n if (!isSummaryInModal) {\r\n product.quantity = prodInBundles['quantity'];\r\n if (cl && cl.Quantity && product.quantity && maxQuantityForBundle) {\r\n shouldShowQuantityReachedErrorMsg = product.quantity + cl.Quantity > maxQuantityForBundle;\r\n }\r\n }\r\n }\r\n }\r\n if (maxQuantityForBundle <= 0) {\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const maxQuantities =\r\n cookies.get(\r\n props.config.isNotificationModal\r\n ? 'product_notification_maximum_available_quantities'\r\n : 'product_bundles_maximum_available_quantities'\r\n )?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === product.RecordId) {\r\n maxQuantityForBundle = maxQ.maxQuantity;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (product.quantity && product.quantity >= maxQuantityForBundle) {\r\n shouldShowQuantityReachedErrorMsg = true;\r\n }\r\n const priceObj: ProductPrice = {\r\n BasePrice: product.BasePrice,\r\n AdjustedPrice: cookiePrice ? cookiePrice : product.Price,\r\n CustomerContextualPrice: cookiePrice ? cookiePrice : product.Price\r\n };\r\n totalPrice =\r\n totalPrice + (cookiePrice ? Number(cookiePrice) : product.Price) * (product.quantity ? product.quantity : 0);\r\n const imageSettings = {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const baseImageUrl: string = props.context.request.apiSettings.baseImageUrl;\r\n
;\r\n const currQ = product.quantity;\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n

\r\n {product && product.Name}\r\n

\r\n \r\n {/*

Quantity: {product.quantity}

*/}\r\n

Quantity:

\r\n {\r\n onQuantityChange(\r\n props,\r\n product.RecordId,\r\n newVal,\r\n cartProducts,\r\n setCartProducts,\r\n isSummaryInModal,\r\n maxQuantityForBundle\r\n );\r\n }}\r\n hideQuantityControls={false}\r\n disabledInput={false}\r\n max={maxQuantityForBundle}\r\n min={1}\r\n />\r\n {shouldShowQuantityReachedErrorMsg &&

{maxQuantityReachedMsg}

}\r\n
\r\n
\r\n {\r\n if (!isSummaryInModal) {\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const productsAddedInBundles =\r\n cookies.get(\r\n props.config.isNotificationModal\r\n ? 'notification_added_products'\r\n : 'added_products_bundles'\r\n )?.value || [];\r\n if (Array.isArray(productsAddedInBundles)) {\r\n for (let i = 0; i < productsAddedInBundles.length; i++) {\r\n if (productsAddedInBundles[i]['productId'] === product.RecordId) {\r\n delete productsAddedInBundles[i];\r\n }\r\n }\r\n const updatedProductsAddedInBundles: IDobbiesAddedProductToBundle[] = [];\r\n productsAddedInBundles.map(prod => {\r\n if (prod && prod['productId']) {\r\n const dobbiesProductData: IDobbiesAddedProductToBundle = {};\r\n dobbiesProductData.productId = prod['productId'];\r\n dobbiesProductData.quantity = prod['quantity'];\r\n dobbiesProductData.price = prod['price'];\r\n dobbiesProductData.maxQuantity = prod['maxQuantity'];\r\n updatedProductsAddedInBundles.push(dobbiesProductData);\r\n }\r\n });\r\n const cookieName = props.config.isNotificationModal\r\n ? 'notification_added_products'\r\n : 'added_products_bundles';\r\n cookies.set(cookieName, updatedProductsAddedInBundles);\r\n props.context.actionContext.update(new CartModulesStateShareInput(), {\r\n isCartUpdated: true\r\n });\r\n }\r\n return;\r\n }\r\n const cartlineToRemove = props.data.cart.result?.cart.CartLines?.find(\r\n cl => cl.ProductId === product.RecordId\r\n );\r\n if (cartlineToRemove) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n props.data.cart.result\r\n ?.removeCartLines(input)\r\n .then(() => {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), {\r\n isCartUpdated: true\r\n });\r\n })\r\n .catch(error => {\r\n props.telemetry.warning(error);\r\n props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n } else {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }}\r\n >\r\n
\r\n \r\n );\r\n })}\r\n \r\n\r\n {cartProducts && cartProducts.length > minProductsToScroll ? (\r\n {\r\n if (elem) {\r\n elem.scrollTop += rowHeight;\r\n if (isSummaryInModal) {\r\n setBundlesModalSummaryScrollPos(elem.scrollTop);\r\n } else {\r\n setBundlesSummaryScrollPos(elem.scrollTop);\r\n }\r\n }\r\n }}\r\n hidden={elem && scrollPos > (cartProducts.length - minProductsToScroll) * rowHeightForCalc ? true : false}\r\n >\r\n ) : (\r\n <>\r\n )}\r\n

\r\n {'Total price:'}\r\n \r\n {' '}\r\n {new Intl.NumberFormat('en-US', {\r\n style: 'currency',\r\n currencyDisplay: 'symbol',\r\n currency: 'GBP',\r\n minimumFractionDigits: 2\r\n }).format(totalPrice)}\r\n \r\n

\r\n \r\n );\r\n};\r\nconst _renderCarousel = (carouselContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\r\n return {items && items.map(_renderProduct)};\r\n};\r\n\r\nconst _renderGrid = (gridContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\r\n return {items && items.map(_renderProduct)};\r\n};\r\n\r\nconst _renderProduct = (product: IProductComponentViewProps): JSX.Element => {\r\n const { ProductContainer, productComponent, addToCartButton } = product;\r\n\r\n return (\r\n \r\n {productComponent}\r\n {addToCartButton}\r\n \r\n );\r\n};\r\n\r\nexport default ProductCollectionView;\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ProductAvailableQuantity, ProductSearchResult, ProductWarehouseInventoryAvailability } from '@msdyn365-commerce/retail-proxy';\r\n/**\r\n * Product inventory information class\r\n */\r\nexport interface IProductInventoryInformation {\r\n ProductAvailableQuantity: ProductAvailableQuantity;\r\n StockLevelCode?: string;\r\n StockLevelLabel?: string;\r\n IsProductAvailable: boolean;\r\n InventLocationId?: string;\r\n}\r\n/**\r\n * The function that maps a ProductWareHouse object into a ProductAvailabilityQuantity\r\n */\r\nexport const mapProductInventoryInformation = (\r\n ctx: IActionContext,\r\n productsWarehouseInventory: ProductWarehouseInventoryAvailability[],\r\n isPreSale?: string,\r\n dobbiesProductsData?: ProductSearchResult[]\r\n): IProductInventoryInformation[] => {\r\n const {\r\n requestContext: {\r\n app: {\r\n config: { enableStockCheck, inventoryLevel }\r\n }\r\n }\r\n } = ctx;\r\n\r\n const productInventoryInformation: IProductInventoryInformation[] = [];\r\n\r\n if (enableStockCheck === undefined || enableStockCheck === false) {\r\n return productInventoryInformation;\r\n }\r\n\r\n if (productsWarehouseInventory && productsWarehouseInventory.length > 0) {\r\n for (const product of productsWarehouseInventory) {\r\n const filteredProduct = dobbiesProductsData?.find(prod => prod.RecordId === product.ProductId);\r\n const presell = filteredProduct?.AttributeValues?.find(proAttr => proAttr.Name === \"PreSale\" && proAttr.TextValue === \"Yes\")\r\n const IsVendershipProduct = filteredProduct?.AttributeValues?.find(proAttr => proAttr.Name === \"IsVendershipProduct\" && proAttr.TextValue === \"No\")\r\n const FulfillmentType = filteredProduct?.AttributeValues?.find(proAttr => proAttr.Name === \"FulfillmentType\" && proAttr.TextValue !== \"Plants\")\r\n switch (isPreSale ? \"totalAvailable\" : (presell && IsVendershipProduct && FulfillmentType) ? \"totalAvailable\" : inventoryLevel) {\r\n case 'physicalAvailable':\r\n // Inventory level is enabled with Physical inventory\r\n const physicalProductMap = mapInventoryWithPhysicalBufferEnabled(ctx, product);\r\n if (physicalProductMap) {\r\n productInventoryInformation.push(physicalProductMap);\r\n }\r\n break;\r\n case 'totalAvailable':\r\n // Inventory level is enabled with Total available inventory\r\n const totalAvailableProductMap = mapInventoryWithTotalAvailableBufferEnabled(ctx, product);\r\n if (totalAvailableProductMap) {\r\n productInventoryInformation.push(totalAvailableProductMap);\r\n }\r\n break;\r\n default:\r\n // when inventory level is inventoryThreshold or not defined\r\n const productMap = mapInventoryWithThresholdEnabled(ctx, product);\r\n if (productMap) {\r\n productInventoryInformation.push(productMap);\r\n }\r\n }\r\n }\r\n }\r\n return productInventoryInformation;\r\n};\r\n\r\nexport const mapInventoryWithThresholdEnabled = (\r\n ctx: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n) => {\r\n if (\r\n productWarehouseInventoryAvailability &&\r\n productWarehouseInventoryAvailability.ProductId &&\r\n productWarehouseInventoryAvailability.TotalAvailable !== undefined\r\n ) {\r\n const productQty = productWarehouseInventoryAvailability.TotalAvailable - ctx.requestContext.app.config.outOfStockThreshold;\r\n const productAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQty > 0 ? productQty : 0\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity && productAvailableQuantity.AvailableQuantity > 0 ? true : false,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n return null;\r\n};\r\n\r\nexport const mapInventoryWithPhysicalBufferEnabled = (\r\n ctx: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n) => {\r\n const shouldRenderLabel = displayLabelEnabled(ctx, productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode);\r\n if (\r\n productWarehouseInventoryAvailability &&\r\n productWarehouseInventoryAvailability.ProductId &&\r\n productWarehouseInventoryAvailability.TotalAvailable !== undefined\r\n ) {\r\n // As per the new buffer logic from RS,\r\n // if code is out of stock then we set the available quantity to 0 regardless of the actual value from API\r\n const productQuantity =\r\n productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode === 'OOS'\r\n ? 0\r\n : productWarehouseInventoryAvailability.PhysicalAvailable;\r\n const productAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQuantity\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n StockLevelCode: shouldRenderLabel ? productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode : undefined,\r\n StockLevelLabel: shouldRenderLabel ? productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelLabel : undefined,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity !== undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n return null;\r\n};\r\n\r\nexport const mapInventoryWithTotalAvailableBufferEnabled = (\r\n ctx: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n) => {\r\n const shouldRenderLabel = displayLabelEnabled(ctx, productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode);\r\n if (\r\n productWarehouseInventoryAvailability &&\r\n productWarehouseInventoryAvailability.ProductId &&\r\n productWarehouseInventoryAvailability.TotalAvailable !== undefined\r\n ) {\r\n // As per the new buffer logic from RS,\r\n // if code is out of stock then we set the available quantity to 0 regardless of the actual value from API\r\n const productQuantity =\r\n productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode === 'OOS'\r\n ? 0\r\n : productWarehouseInventoryAvailability.TotalAvailable;\r\n const productAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQuantity\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n StockLevelCode: shouldRenderLabel ? productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode : undefined,\r\n StockLevelLabel: shouldRenderLabel ? productWarehouseInventoryAvailability.TotalAvailableInventoryLevelLabel : undefined,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity !== undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n return null;\r\n};\r\n\r\nexport const displayLabelEnabled = (ctx: IActionContext, inventoryCode: string | undefined) => {\r\n if (!inventoryCode) {\r\n return false;\r\n }\r\n switch (ctx.requestContext.app.config.inventoryRanges) {\r\n case 'lowAndOutofStock':\r\n if (inventoryCode !== 'AVAIL') {\r\n return true;\r\n }\r\n break;\r\n case 'outOfStock':\r\n if (inventoryCode === 'OOS') {\r\n return true;\r\n }\r\n break;\r\n case 'all':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n return false;\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['dobbies-product-collection'] = {\n c: () => require('partner/modules/dobbies-product-collection/dobbies-product-collection.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'cartSharedState', path:'actions/cart-state-share', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'plantPotsProductCountState', path:'actions/get-plant-pots-product-count', runOn: 0},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'dobbies-product-collection',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dobbies-product-collection'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/cart-state-share';\n let dataAction = require('partner/actions/cart-state-share');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-plant-pots-product-count';\n let dataAction = require('partner/actions/get-plant-pots-product-count');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|dobbies-product-collection|dobbies-product-collection'] = {\n c: () => require('partner/modules/dobbies-product-collection/dobbies-product-collection.view.tsx'),\n cn: '__local__-__local__-dobbies-product-collection'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["BundleProductsStockStateShareInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","async","updateBundleProductsStockState","input","ctx","areAllBundleProductsOOS","undefined","createObservableDataAction","action","inputData","GetPlantPotsProductCountInput","sampleStateAction","potsProductCount","layout","HeadingTag","ProductCollection","React","props","state","super","getActiveImageproductAction","context","actionContext","requestContext","cookies","this","cookienotificationValue","get","Array","isArray","value","activePoints","itemIds","map","activePointData","push","itemId","searchCriteriaInput","catalogId","getCatalogId","validateCatalogId","Context","ChannelId","apiSettings","channelId","CatalogId","IncludeAttributes","Ids","ArrayExtensions","hasElements","Error","products","searchByCriteriaAsync","callerContext","setState","checkDifference","array1","array2","length","i","RecordId","handleHeadingChange","event","config","heading","text","target","updateAddedProductsList","_cookies$get","addedProductsToCollection","isNotificationModal","addedProductsIds","obj","addedProductIdsToBundles","isProductBundles","request","telemetryPageName","update","CartModulesStateShareInput","isCartUpdated","getPDPProductMaxQ","onStoreSelectorDialogClose","storeSelectorDialogParams","onClickAndCollectSelectedToBeAddedInCookie","productId","orgUnitLocation","addedFromModal","_this$props$data$cart","_this$state$pdpSearch","cl","data","cart","result","CartLines","find","c","ProductId","maxPDPQ","maxPDPQNumber","Number","pdpSearchResultProduct","Quantity","prod","p","_updateCookiesForAddedProducts","onBundleProductCheckBoxSelected","_this$props$data$cart2","_this$state$pdpSearch2","cncProducts","ItemId","_this$state$simplePro","sp","simpleProductObjs","s","prodQD","currQuantities","qd","cncDeliveryOption","product","quantity","retailMulitplePickupMFeatureState","deliveryOption","_addItemToCart","toString","_getPDPProduct","index","_this$props$data$feat","_this$props$data$wish","_this$props$data$cart5","_this$state$nonClubPl","_this$state$simplePro2","Name","telemetry","trace","telemetryContent","getTelemetryObject","friendlyName","imageSettings","allowBackNavigation","addToCartButtonText","resources","breaCrumbType","app","breadcrumbType","allowBack","quickviewSlot","slots","quickview","reviewCountAriaLabelValue","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","featureState","console","log","productWithModes","_objectSpread","isCnC","isHomeDelivery","shouldNotShowAddToCartButton","includes","maxAvailableQ","isBundlesModal","_this$props$data$cart3","_this$props$data$cart4","className","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","id","typeName","quickViewButton","IsEnabled","showDeliveryIcons","wishlists","isProductAddedToBundles","maxQuantityForBundle","redirectToCartEnabled","redirectToCart","onQuantityChangeListener","isQuantityUpdated","cartSharedState","discountLine","discountLines","nonClubPlusDiscount","filter","item","simpleProduct","Button","title","onClick","_getAddToCart","_getProduct","_this$props$data$feat2","_this$props$data$wish2","_this$props$data$cart8","_this$state$nonClubPl2","_this$state$simplePro3","_this$props$data$cart6","_this$props$data$cart7","ProductContainer","tag","role","key","productComponent","getMaxAvailableQuantityForProduct","addToCartButton","newQuantity","currQuantityData","productFound","_getProductAvailabilityNotification","validProducts","productData","queryResultSettings","Promise","all","IsMasterProduct","variants","getVariantsByDimensionValuesAsync","variant","allProducts","plantProducts","nonPlantProducts","_fulfillmentTypeAttri","fulfillmentTypeAttribute","AttributeValues","attribute","_attribute$Name","toLowerCase","TextValue","prodIds","plantProductIds","pp","nonPlantProductIds","npp","productAvailabilitesPlants","getEstimatedAvailabilityAsync","ProductIds","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","deliveryOptions","getDeliveryOptionsAsync","productsWithPlantsDelivery","idx","_prod$AttributeValues","_productAvailabilites","ProductWarehouseInventoryAvailabilities","_deliveryOptions$idx$","InventLocationId","PhysicalAvailableInventoryLevelCode","DeliveryOptions","option","Code","isVendorShipAttribute","trim","_cookies$get2","set","maxQuantities","maxQ","maxQuantity","getMaxQuantityForCNCProduct","productAvailabilitesNonPlantsHD","productAvailabilitesNonPlantsCNC","totalProducts","_prod$AttributeValues2","AggregatedProductInventoryAvailabilities","stores","_deliveryOptions$idx$2","_cookies$get3","inventoryInformation","productsLength","_productAvailabilites2","_productAvailabilites3","_productAvailabilites4","_productAvailabilites5","concat","mapProductInventoryInformation","productCount","isSharedStateSet","_getProductAvailability","_fulfillmentTypeAttri2","_attribute$Name2","_prod$AttributeValues3","_productAvailabilites6","_deliveryOptions$idx$3","_cookies$get4","_prod$AttributeValues4","_deliveryOptions$idx$4","_cookies$get5","_productAvailabilites7","_productAvailabilites8","_productAvailabilites9","_productAvailabilites10","itemKey","_this$state$simplePro4","catch","error","orgLocation","_cookies$get6","addedProducts","maxPDPQuantity","price","inventoryLocationId","productAddedAlready","ap","_this$state$pdpSearch3","quantityToBeAdded","Price","BasePrice","InventoryLocationId","_this$state$pdpSearch4","cookieName","maxQuantityForCartLineItem","_this$state$simplePro5","_product$Behavior","cncProd","productInvInfo","inventory","ProductAvailableQuantity","AvailableQuantity","_getCartItemMaxQuantity","enableStockCheck","getOrderQuantityLimitsFeatureFlag","Behavior","MaximumQuantity","addedToCartSuccessMessage","addedToCartFailureMessage","productInventoryInformation","navigationUrl","Msdyn365","_cart$result","productList","_convertToSimpleProduct","_this$props$data$cart9","count","addProductsToCart","then","status","userMessage","statusCssString","messageGlyph","isOpen","e","_cart$result2","_this$props$data$cart10","_featureState$result","_this$props$context","_this$props$context$a","isOrderQuantityLimitsFeatureEnabledInHq","featuresState","isOrderQuantityLimitsFeatureEnabledInSiteSettings","platform","enableDefaultOrderQuantityLimits","isOrderQuantityLimitsFeatureEnabled","emailDeliveryModeCode","channel","EmailDeliveryModeCode","addProductToCartInput","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isAddEmailDeliveryItemToCart","addProductToCart","window","location","assign","substatus","_await$cart$cart","curQuantity","maxQtyLimitReachedMessage","_getInventoryValueMessage","_result$errorDetails","errorDetails","LocalizedMessage","debug","warning","getNonClubPlusDiscountPrices","productsListWithKitScenarioHandled","getProductsListWithKitProductsHandled","productRecIds","projectDomain","getActivePricesAsync","Date","activePricesResponse","updatedProducts","activePrice","_activePrice$Customer","CustomerContextualPrice","Math","max","TradeAgreementPrice","AdjustedPrice","productPricesforcookies","recordId","basePrice","_this$state$pdpSearch5","pdpProd","_activePrice$Customer2","_cookies$get7","pdpProductAlreadyAdded","message","exception","productCollection","productPrices","listType","componentDidMount","allowedRelationType","_this$state$listType","_productCollection$pr","remove","res","maxQData","maxQObj","reaction","_this$props$data$cart11","_this$props$data$cart12","splittedUrl","href","split","prodIdStrSplitted","prodId","getByIdAsync","resp","pdpProduct","MasterProductId","searchByCriteriaResp","searchByCriteriaItem","_variant$PrimaryImage","fallbackImageUrl","getFallbackImageUrl","PrimaryImageUrl","getAllSimpleProducts","ex","componentDidUpdate","prevProps","prevState","snapshot","finalProducts","_this$props$context$r","productCollectionProducts","pros","simpleProds","getByIdsAsync","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","_getNotificationModalProducts","_cookies$get8","addedToSummaryProducts","_this$state$simplePro6","miniCartProduct","render","isCarousel","carousel","headingComponent","editProps","onEdit","availableProducts","_this$state$pdpProduc","itemInventorys","iv","IsProductAvailable","productCollectionViewProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","shouldShowAddAllProducts","pdpProductComponent","notificationModalProducts","renderView","_this$props$context2","defaultOrderQuantityLimitsFeatureConfig","_featureStatuses$find","featureStatuses","customerInfo","customerInformation","IsB2b","response","maxQuantityLimitText","maxQuantityForLineItem","replace","minInventory","min","setCookie","name","deltaDaysFromToday","expirationDate","now","setTime","getTime","expires","isEssential","changeQinBundlesModalSummary","newValue","cartProducts","setCartProducts","isSummaryInModal","_cartState$cart$CartL","cartState","getCartState","_props$context$action","diffInQuantity","_storeLocation$OrgUni","cncOption","dopt","_dopt$DeliveryOptions","delOpt","storeLocation","latitude","longitude","radius","distanceUnitValue","orgUnitLocationsInput","GetAllOrgUnitLocationsByAreaInput","getAllOrgUnitLocationsByArea","_getAllStores","sl","_sl$OrgUnitAvailabili","OrgUnitAvailability","OrgUnitLocation","FulfillmentStoreId","_storeLocation$OrgUni2","_cncOption","deliveryMode","cartLineQuantityUpdatedAsync","cartActionResult","_renderCartLines","bundlesSummaryScrollPos","setBundlesSummaryScrollPos","bundlesModalSummaryScrollPos","setBundlesModalSummaryScrollPos","totalPrice","productsAddedInBundles","elemId","elem","MsDyn365","isBrowser","document","getElementById","minProductsToScroll","innerWidth","upArrowId","downArrowId","scrollPos","maxQuantityReachedMsg","maxQuantityReachedInBundlesmsg","_props$data$cart$resu9","_props$data$cart$resu10","cp","_props$data$cart$resu8","_props$data$cart$resu11","scrollTop","hidden","onScroll","abs","ceil","upArrow","downArrow","_props$data$cart","prodInBundles","cookiePrice","shouldShowQuantityReachedErrorMsg","priceObj","baseImageUrl","currQ","src","fallBackSrc","altText","gridSettings","viewports","xs","q","w","h","sm","lg","lazyload","loadFailureBehavior","PriceComponent","savingsText","updatedPrice","getTierId","clubPlusDiscountsOfferId","currentCount","onChange","newVal","cartProductsCopy","valueToBeUpdated","onQuantityChange","hideQuantityControls","disabledInput","_props$data$cart$resu12","updatedProductsAddedInBundles","dobbiesProductData","cartlineToRemove","_props$data$cart$resu13","cartLineIds","LineId","removeCartLines","Intl","NumberFormat","style","currencyDisplay","currency","minimumFractionDigits","format","_renderCarousel","carouselContainer","items","Node","Object","_renderProduct","_renderGrid","gridContainer","_props$data$storeSele2","_props$data$cart$resu4","_props$data$cartShare2","_props$data$storeSele","storeSelectorStateManager","isDialogOpen","renderStoreSelector","isFromModal","isFromNotification","_props$data$storeSele3","storeSelectorId","modules","keys","storeSelectors","productDeliveryOptions","openDialog","isDialog","onLocationSelected","resolve","behavior","addToCartBehavior","updateCartProduct","_props$data$cart$resu","_props$data$cart$resu2","productIds","cartline","productBundleProducts","updatedProductIds","prodBP","simpleProductsWithQuantities","validValues","_props$data$cart$resu3","prodWithQuantity","simpleProdIds","cartProductIds","cartProd","b","a","every","v","needsUpdate","pIds","updatedSimpleProductsWithQuantities","itemInventory","equalsCheck","_props$data$cart$resu5","_props$data$cart$resu6","_props$data$cart$resu7","_props$data$cartShare","Module","addAllProductsOnClick","disabled","notifiCheck","user","isAuthenticated","discountAppliedInCartMessage","productsWarehouseInventory","isPreSale","dobbiesProductsData","inventoryLevel","_filteredProduct$Attr","_filteredProduct$Attr2","_filteredProduct$Attr3","filteredProduct","presell","proAttr","IsVendershipProduct","FulfillmentType","physicalProductMap","mapInventoryWithPhysicalBufferEnabled","totalAvailableProductMap","mapInventoryWithTotalAvailableBufferEnabled","productMap","mapInventoryWithThresholdEnabled","productWarehouseInventoryAvailability","TotalAvailable","productQty","outOfStockThreshold","productAvailableQuantity","shouldRenderLabel","displayLabelEnabled","productQuantity","PhysicalAvailable","StockLevelCode","StockLevelLabel","PhysicalAvailableInventoryLevelLabel","TotalAvailableInventoryLevelCode","TotalAvailableInventoryLevelLabel","inventoryCode","inventoryRanges","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","require","$type","da","path","runOn","iNM","ns","n","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}