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f,GACpF,aAAa6d,EAAAA,YAAYvN,QAAQ4O,GACnC,MAAO3b,GACLG,EAAUka,QAASra,EAAgBE,SACnCC,EAAUE,MAAM,wCAIxB,OAAOia,EAAAA,YAAYvN","sources":["webpack://Dobbies.Commerce/./src/actions/cart-state-share.ts?609c","webpack://Dobbies.Commerce/./src/actions/get-all-store-location-information.ts?4981","webpack://Dobbies.Commerce/./src/themes/dobbies/actions/get-feature-state.override.action.ts?6984","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/quantity/Quantity.tsx?0e68","webpack://Dobbies.Commerce/./src/themes/dobbies/views/components/product.component.tsx?de6d","webpack://Dobbies.Commerce/./src/themes/dobbies/views/custom-components/product-price-component.tsx?086b","webpack://Dobbies.Commerce/./src/validate-cart.ts?cd50"],"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 CartModulesStateShareInput 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 = () => `cartSharedState`;\r\n public getCacheObjectType = () => 'cartSharedState';\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 ICartSharedState {\r\n isCartUpdated?: boolean; // Used to display msg in delivery section\r\n isQuantityUpdated?: 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 CartModulesStateShareInput();\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 updateCartStateAction(input: CartModulesStateShareInput, ctx: IActionContext): Promise {\r\n return {\r\n isCartUpdated: undefined,\r\n isQuantityUpdated: undefined\r\n };\r\n}\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateCartStateAction,\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n ChannelDeliveryOption,\r\n FeatureState,\r\n OrgUnitAvailability,\r\n OrgUnitLocation,\r\n SearchArea,\r\n StoreHours\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getChannelDeliveryOptionsAsync,\r\n getOrgUnitLocationsByAreaAsync,\r\n getStoreHoursAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\nimport getFeatureStateActionDataAction, { FeatureStateInput } from '../themes/dobbies/actions/get-feature-state.override.action';\r\nimport { QueryResultSettingsProxy, IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Get selected variant action input class.\r\n */\r\nexport class GetAllOrgUnitLocationsByAreaInput implements IActionInput {\r\n public Latitude?: number;\r\n\r\n public Longitude?: number;\r\n\r\n public Radius?: number;\r\n\r\n public DistanceUnitValue?: number;\r\n\r\n public IgnoreLocation?: boolean;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number, _DistanceUnitValue?: number, _IgnoreLocation?: boolean) {\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n this.DistanceUnitValue = _DistanceUnitValue;\r\n this.IgnoreLocation = _IgnoreLocation;\r\n }\r\n\r\n public getCacheKey = () => 'GetAllOrgUnitLocationsByAreaInput';\r\n\r\n public getCacheObjectType = () => 'GetAllOrgUnitLocationsByAreaInput';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action.\r\n * @param inputData The input data passed to the createInput method.\r\n */\r\nexport const createGetOrgUnitLocationsByAreaInput = (inputData: ICreateActionContext): GetAllOrgUnitLocationsByAreaInput => {\r\n return new GetAllOrgUnitLocationsByAreaInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail Feature State API and returns a list of feature with isEnabled flag.\r\n * @param context\r\n */\r\nexport async function getFeatureState(context: IActionContext): Promise {\r\n return getFeatureStateActionDataAction(new FeatureStateInput(), context);\r\n}\r\n\r\n/**\r\n * Action method for the getSelectedVariant data action.\r\n * @param input The action input class.\r\n * @param ctx The action context.\r\n */\r\nexport async function getAllOrgUnitLocationsByArea(\r\n input: GetAllOrgUnitLocationsByAreaInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if ((input.Radius === undefined || !input.Latitude || !input.Longitude) && !input.IgnoreLocation) {\r\n // No valid location we want to return empty array so module can show no locations message\r\n return [];\r\n }\r\n\r\n const searchArea: SearchArea = {\r\n Latitude: input.Latitude,\r\n Longitude: input.Longitude,\r\n Radius: input.Radius,\r\n DistanceUnitValue: input.DistanceUnitValue || 0 // 0 is miles\r\n };\r\n\r\n const featureState = await getFeatureState(ctx);\r\n const retailMulitplePickupMFeatureState = featureState?.find(\r\n item => item.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n )?.IsEnabled;\r\n\r\n return getOrgUnitLocationsByAreaAsync(\r\n {\r\n callerContext: ctx,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\r\n },\r\n searchArea\r\n )\r\n .then(async (stores: OrgUnitLocation[]) => {\r\n // console.log(\"🚀 ~ file: get-store-location-information-s.ts:112 ~ .then ~ stores:\", stores)\r\n // return stores\r\n let locationDeliveryOptions: ChannelDeliveryOption[] | undefined = [];\r\n\r\n // If mulitple pickup mode is enable then call getchanneldeliveryoption\r\n if (retailMulitplePickupMFeatureState) {\r\n const orgUnitChannel = stores.map(store => store.ChannelId);\r\n locationDeliveryOptions = await _getLocationPickUpDeliveryModes(orgUnitChannel, ctx);\r\n }\r\n const locationPromiseList = stores.map(store => {\r\n const locationDeliveryOption = locationDeliveryOptions?.find(\r\n _channeldeliveryoption => _channeldeliveryoption.ChannelId === store.ChannelId\r\n );\r\n return _getLocationWithHours(store, locationDeliveryOption, ctx);\r\n });\r\n return Promise.all(locationPromiseList);\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetOrgUnitLocationsByArea] error getting Locations');\r\n ctx.trace(error.message);\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug('[GetOrgUnitLocationsByArea] error getting Locations');\r\n return [];\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information.\r\n * @param orgUnitLocation The org unit location.\r\n * @param storeMap A map that contains store information group by the inventory location id.\r\n * @param channelDeleiveryOptions\r\n * @param ctx The action context.\r\n */\r\nasync function _getLocationWithHours(\r\n orgUnitLocation: OrgUnitLocation,\r\n channelDeleiveryOptions: ChannelDeliveryOption | undefined,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!orgUnitLocation || !orgUnitLocation.OrgUnitNumber) {\r\n return { OrgUnitAvailability: undefined };\r\n }\r\n\r\n return getStoreHoursAsync({ callerContext: ctx }, orgUnitLocation.OrgUnitNumber)\r\n .then((hours: StoreHours) => {\r\n const availability: OrgUnitAvailability = {\r\n OrgUnitLocation: orgUnitLocation\r\n };\r\n\r\n if (hours && !(hours instanceof Error)) {\r\n return { OrgUnitAvailability: availability, StoreHours: hours, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n }\r\n\r\n return { OrgUnitAvailability: availability, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetFullAvailableInventoryNearby] error getting availability with hours');\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('[GetFullAvailableInventoryNearby] error getting availability with hours');\r\n return { OrgUnitAvailability: {} };\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information.\r\n * @param channelCollection The org unit channel Id list.\r\n * @param ctx The action context.\r\n */\r\nasync function _getLocationPickUpDeliveryModes(\r\n channelCollection: (number | undefined)[],\r\n ctx: IActionContext\r\n): Promise {\r\n if (channelCollection?.length === 0 || channelCollection === undefined) {\r\n return undefined;\r\n }\r\n\r\n const channelIdList: number[] = [];\r\n channelCollection?.map(id => {\r\n if (id !== undefined) {\r\n return channelIdList.push(id);\r\n }\r\n return;\r\n });\r\n\r\n // To get all channel pickup delivery mode filterOption should be 4\r\n return getChannelDeliveryOptionsAsync(\r\n {\r\n callerContext: ctx,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\r\n },\r\n channelIdList,\r\n 4\r\n )\r\n .then((channelDeliveryOptions: ChannelDeliveryOption[]) => {\r\n if (channelDeliveryOptions && !(channelDeliveryOptions instanceof Error)) {\r\n return channelDeliveryOptions;\r\n }\r\n\r\n return undefined;\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(\r\n '[GetFullAvailableInventoryNearby][getChannelDeliveryOptionsAsync] error getting availability with channel delivery options'\r\n );\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(\r\n '[GetFullAvailableInventoryNearby] [getChannelDeliveryOptionsAsync] error getting availability with channel delivery options'\r\n );\r\n return [];\r\n });\r\n}\r\n\r\n/**\r\n * The complete getAllOrgUnitLocationsByArea data action.\r\n */\r\nexport const getOrgUnitLocationsByAreaDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-store-location-information',\r\n action: >getAllOrgUnitLocationsByArea,\r\n input: createGetOrgUnitLocationsByAreaInput\r\n});\r\n\r\nexport default getOrgUnitLocationsByAreaDataAction;\r\n","import {\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\nimport { FeatureState } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getFeatureStatesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\n/**\r\n * Input class for the getFeatureState data action\r\n */\r\nexport class FeatureStateInput implements IActionInput {\r\n public readonly featureNames: string[] = [\r\n 'Dynamics.AX.Application.RetailB2BEcommerceFeature',\r\n 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature',\r\n 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature',\r\n 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n ];\r\n\r\n public getCacheKey = () => `FeatureState`;\r\n public getCacheObjectType = () => 'FeatureState';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * createInput method for the getFeatureState method\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nexport const createGetFeatureStateInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new FeatureStateInput();\r\n};\r\n\r\n/**\r\n * The action method for the getFeatureState data action\r\n * @param input The action input\r\n * @param ctx The action context\r\n */\r\nexport async function getFeatureStateAction(input: FeatureStateInput, ctx: IActionContext): Promise {\r\n const featureState = await getFeatureStatesAsync({ callerContext: ctx }, input.featureNames);\r\n return featureState;\r\n}\r\n\r\n/**\r\n * The getFeatureState data action\r\n * Gets the feature state via the read RetailServer API\r\n * Returns address information associated with the retrieved customer\r\n */\r\nexport const getFeatureStateActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-feature-state',\r\n action: >getFeatureStateAction,\r\n input: createGetFeatureStateInput\r\n});\r\nexport default getFeatureStateActionDataAction;\r\n","import debounce from 'lodash/debounce';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IQuantityProps } from './Quantity.props';\r\n\r\ninterface IQuantityState {\r\n currentInput: number;\r\n}\r\n/**\r\n * Quantity Component - This component is used to add or remove quantity\r\n */\r\n@observer\r\nexport default class Quantity extends React.PureComponent {\r\n public static defaultProps: Partial = {\r\n min: 1,\r\n decrementGlyphClass: 'fas fa-minus',\r\n incrementGlyphClass: 'fas fa-plus'\r\n };\r\n\r\n private inputRef: React.RefObject = React.createRef();\r\n\r\n constructor(props: IQuantityProps) {\r\n super(props);\r\n this.state = { currentInput: props.currentCount || 1 };\r\n this._onIncrement = this._onIncrement.bind(this);\r\n this._onDecrement = this._onDecrement.bind(this);\r\n this._handleChange = this._handleChange.bind(this);\r\n }\r\n public componentDidMount(): void {\r\n reaction(\r\n () => this.props.currentCount,\r\n () => {\r\n this.setState({ currentInput: this.props.currentCount || 1 });\r\n }\r\n );\r\n }\r\n public componentDidUpdate(): void {\r\n reaction(\r\n () => this.props.currentCount,\r\n () => {\r\n this.setState({ currentInput: this.props.currentCount || 1 });\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element {\r\n const glyphMinusClassName: string = `${this.props.decrementGlyphClass!} quantity__controls-glyph`;\r\n const glyphPlusClassName: string = `${this.props.incrementGlyphClass!} quantity__controls-glyph`;\r\n const disabled = this.state.currentInput === this.props.min;\r\n const incDisabled = this.state.currentInput === this.props.max;\r\n const currentValue = this.state.currentInput;\r\n let extraClass = '';\r\n if (disabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClass = 'disabled';\r\n } else if (this.props.disabled) {\r\n // this.props.disabled shows if the state is not succeded yet\r\n extraClass = 'transition';\r\n }\r\n let extraClassInc = '';\r\n if (incDisabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClassInc = 'disabled';\r\n } else if (this.props.disabled) {\r\n // this.props.disabled shows if the state is not succeded yet\r\n extraClassInc = 'transition';\r\n }\r\n return (\r\n <>\r\n
\r\n {this.props.hideQuantityControls !== true && (\r\n \r\n \r\n \r\n )}\r\n \r\n {this.props.hideQuantityControls !== true && (\r\n \r\n \r\n \r\n )}\r\n
\r\n \r\n );\r\n }\r\n\r\n private _onIncrement(): void {\r\n let invokeCallback = false;\r\n const currQuantity = this.state.currentInput;\r\n let updatedQuantity: number;\r\n\r\n if (currQuantity < this.props.max) {\r\n invokeCallback = true;\r\n updatedQuantity = currQuantity + 1;\r\n } else {\r\n invokeCallback = false;\r\n updatedQuantity = this.props.max;\r\n }\r\n\r\n invokeCallback && this.props.onChange && this.props.onChange(updatedQuantity);\r\n }\r\n\r\n private _onDecrement(): void {\r\n let invokeCallback = false;\r\n const currQuantity = this.state.currentInput;\r\n let updatedQuantity: number;\r\n\r\n if (currQuantity > 1) {\r\n invokeCallback = true;\r\n updatedQuantity = currQuantity - 1;\r\n } else {\r\n invokeCallback = false;\r\n updatedQuantity = 1;\r\n }\r\n\r\n invokeCallback && this.props.onChange && this.props.onChange(updatedQuantity);\r\n }\r\n\r\n private _handleChange(e: React.ChangeEvent): void {\r\n const currentValue = parseInt(e.target.value, 10);\r\n const minValue = this.props.min === undefined ? 1 : this.props.min;\r\n const inputElement =\r\n this.inputRef && this.inputRef.current && this.inputRef.current instanceof HTMLInputElement && this.inputRef.current;\r\n\r\n if (currentValue > this.props.max) {\r\n this.setState({ currentInput: this.props.max }, () => {\r\n debounce(() => {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n }, 200)();\r\n });\r\n } else {\r\n this.setState({ currentInput: currentValue }, () => {\r\n debounce(() => {\r\n if (!isNaN(this.state.currentInput) && !(this.state.currentInput < minValue)) {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n\r\n if (inputElement) {\r\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\r\n inputElement.setAttribute('value', currentValue.toString());\r\n }\r\n }\r\n }, 200)();\r\n });\r\n }\r\n }\r\n\r\n private _validateMin = (): void => {\r\n const minValue = this.props.min === undefined ? 1 : this.props.min;\r\n if (isNaN(this.state.currentInput) || this.state.currentInput < minValue) {\r\n this.props.onChange && this.props.onChange(minValue);\r\n } else {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n }\r\n };\r\n}\r\n","import { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { RatingComponent, AddToWishlistComponent } from '@msdyn365-commerce/components';\r\nimport { PriceComponent } from '../custom-components/product-price-component';\r\nimport { generateImageUrl, ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Quantity } from '../../utilities/quantity';\r\nimport { IDobbiesAddedProductToBundle } from '../../../../modules/dobbies-product-collection/dobbies-product-collection';\r\nimport { CartModulesStateShareInput } from '../../../../actions/cart-state-share';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getDeliveryOptionsAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { cartLineQuantityUpdatedAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\n\r\nimport { getCartFromCustomer } from '@msdyn365-commerce/global-state';\r\nimport {\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n Image,\r\n msdyn365Commerce,\r\n ICommerceApiSettings\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductPrice, AttributeValue, DiscountLine, Cart, CommerceList, LoyaltyCard, SimpleProduct, DeliveryOption } from '@msdyn365-commerce/retail-proxy';\r\nimport React, { useRef, useState } from 'react';\r\nimport { IProductWithModes } from '../../../../modules/dobbies-search-result-container/components';\r\nimport VsiProductBadges, { badgePageType } from '../../utilities/badges/vsi-product-badges';\r\nimport { getAllOrgUnitLocationsByArea, GetAllOrgUnitLocationsByAreaInput } from '../../../../actions/get-all-store-location-information';\r\nimport { IFullOrgUnitAvailability } from '../../actions/utilities/full-org-unit-availability';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: IProductWithModes; discountLine?: DiscountLine }> {\r\n isNotificationModal?: boolean;\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n discountLine?: DiscountLine[] | undefined;\r\n badgeLink?: string;\r\n showProdPrice?: boolean;\r\n showDeliveryIcons?: boolean;\r\n wishlists?: CommerceList[];\r\n isMobile?: boolean;\r\n showBanner?: (prodId: number) => void;\r\n hideBanner?: (prodId: number) => void;\r\n loyalty?: LoyaltyCard;\r\n nonClubPlusDiscount?: ProductPrice;\r\n isProductAddedToBundles?: boolean;\r\n maxQuantityForBundle?: number;\r\n redirectToCartEnabled?: boolean;\r\n isProductBundles?: boolean,\r\n isQuantityUpdated?: boolean,\r\n isBundlesModal?: boolean,\r\n simpleProduct?: SimpleProduct;\r\n onQuantityChangeListener?(productId: number, newQuantity: number): void;\r\n onBundleProductCheckBoxSelected?(productId: number): void;\r\n}\r\n\r\ninterface ILocalImgData {\r\n primaryUrl: string;\r\n isPrimaryUrl: boolean;\r\n}\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n wishlists,\r\n discountLine,\r\n badgeLink,\r\n showBanner,\r\n hideBanner,\r\n showDeliveryIcons = !data.product?.IsMasterProduct,\r\n isMobile,\r\n loyalty,\r\n nonClubPlusDiscount,\r\n isProductAddedToBundles,\r\n maxQuantityForBundle,\r\n redirectToCartEnabled,\r\n isProductBundles,\r\n isBundlesModal,\r\n isQuantityUpdated,\r\n simpleProduct,\r\n onQuantityChangeListener,\r\n onBundleProductCheckBoxSelected,\r\n isNotificationModal\r\n}) => {\r\n // const [displayClubPlusInfo, setDisplayClubPlusInfo] = React.useState(false);\r\n const [cartData, setCartData] = React.useState(undefined);\r\n const [updatedProductPrice, setUpdatedProductPrice] = React.useState();\r\n const [isHover, setIsHover] = useState(false); // for hover effect\r\n const productImageRef = useRef(null);\r\n const [currBundleQuantity, setCurrBundleQuantity] = React.useState(1);\r\n // const displayClubPlus = () => {\r\n // setDisplayClubPlusInfo(!displayClubPlusInfo);\r\n // }\r\n const product = data.product;\r\n if (!product) {\r\n return null;\r\n }\r\n //VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip\r\n const [images, setImages] = useState({ isPrimaryUrl: false, primaryUrl: '' });\r\n React.useEffect(() => {\r\n if (isQuantityUpdated) {\r\n if (isProductBundles && isBundlesModal) {\r\n getCartState(context.actionContext).then(cartState => {\r\n const cartlines = cartState.cart?.CartLines;\r\n if (cartlines && cartlines.length) {\r\n const cl = cartlines.find(cl => cl.ProductId === product.RecordId);\r\n if (cl && cl.Quantity) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, cl.Quantity);\r\n }\r\n }\r\n }\r\n }).catch(e => { });\r\n context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: false });\r\n return;\r\n }\r\n if (isProductBundles && isNotificationModal) {\r\n getCartState(context.actionContext).then(cartState => {\r\n const cartlines = cartState.cart?.CartLines;\r\n if (cartlines && cartlines.length) {\r\n const cl = cartlines.find(cl => cl.ProductId === product.RecordId);\r\n if (cl && cl.Quantity) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, cl.Quantity);\r\n }\r\n }\r\n }\r\n }).catch(e => { });\r\n context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: false });\r\n return;\r\n }\r\n const cookies = context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection = cookies.get(isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (obj['productId'] === product.RecordId) {\r\n setCurrBundleQuantity(obj['quantity']);\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, obj['quantity']);\r\n }\r\n }\r\n }\r\n }\r\n context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: false });\r\n }\r\n }, [isQuantityUpdated]);\r\n\r\n React.useEffect(() => {\r\n if (isProductAddedToBundles) {\r\n resetQuantity();\r\n }\r\n }, [isProductAddedToBundles]);\r\n\r\n const resetQuantity = async () => {\r\n if (isProductBundles) {\r\n const cartState = await getCartState(context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl && cl.Quantity) {\r\n if (isProductBundles && isBundlesModal) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n }\r\n if (isProductBundles && isNotificationModal) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n }\r\n }\r\n }\r\n };\r\n const resetQuantityOnLoad = async () => {\r\n if (isProductBundles) {\r\n const cartState = await getCartState(context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl && cl.Quantity) {\r\n if (isProductBundles && isBundlesModal) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n } else if (!isBundlesModal) {\r\n setCurrBundleQuantity(1);\r\n }\r\n if (isProductBundles && isNotificationModal) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n } else if (!isBundlesModal) {\r\n setCurrBundleQuantity(1);\r\n }\r\n } else {\r\n setCurrBundleQuantity(1);\r\n }\r\n }\r\n };\r\n\r\n\r\n React.useEffect(() => {\r\n if (product && product.RecordId) {\r\n const baseImgUrl = context.request.apiSettings.baseImageUrl;\r\n const imgName = `Products%2F${product.ItemId}_000_002.png`;\r\n const fullImgUrl = `${baseImgUrl}${imgName}`;\r\n if (!fullImgUrl) {\r\n return;\r\n } else {\r\n setImages({ isPrimaryUrl: false, primaryUrl: '' });\r\n }\r\n validateMediaLocaionAsync(fullImgUrl)\r\n .then(result => {\r\n if (result[1] === true) {\r\n setImages({ isPrimaryUrl: true, primaryUrl: result[0].src! });\r\n } else {\r\n setImages({ isPrimaryUrl: false, primaryUrl: '' });\r\n }\r\n })\r\n .catch(error => {\r\n context.actionContext.telemetry.exception(error);\r\n context.actionContext.telemetry.debug('Unable to validate prodcut images');\r\n });\r\n }\r\n }, [product]);\r\n //VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip\r\n\r\n let productUrl = getProductPageUrlSync(product.Name || '', product.RecordId, context && context.actionContext, undefined);\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context);\r\n }\r\n\r\n const getCartData = async () => {\r\n const cart = await getCartFromCustomer(context.actionContext);\r\n setCartData(cart);\r\n await resetQuantityOnLoad();\r\n };\r\n\r\n const deSelectProduct = async () => {\r\n const cartState = await getCartState(context.actionContext);\r\n const cartlineToRemove = cartState.cart.CartLines?.find(cl => cl.ProductId === product.RecordId);\r\n if (isProductBundles && isBundlesModal) {\r\n if (cartlineToRemove) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n cartState.removeCartLines(input).then(() => {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n })\r\n .catch(error => {\r\n });\r\n }\r\n return;\r\n }\r\n if (isProductBundles && isNotificationModal) {\r\n if (cartlineToRemove) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n cartState.removeCartLines(input).then(() => {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n })\r\n .catch(error => {\r\n });\r\n }\r\n return;\r\n }\r\n const cookies = context.actionContext.requestContext.cookies;\r\n let productsAddedInBundles = cookies.get(isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.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 = isNotificationModal ? 'notification_added_products' : 'added_products_bundles';\r\n cookies.set(cookieName, updatedProductsAddedInBundles);\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n };\r\n\r\n const _getAllStores = async (\r\n latitude?: number,\r\n longitude?: number,\r\n radius?: number,\r\n distanceUnitValue?: number\r\n ): Promise => {\r\n \r\n \r\n const orgUnitLocationsInput = new GetAllOrgUnitLocationsByAreaInput(\r\n latitude,\r\n longitude,\r\n radius,\r\n distanceUnitValue,\r\n false\r\n );\r\n const orgUnitLocations = await getAllOrgUnitLocationsByArea(orgUnitLocationsInput, context.actionContext);\r\n return orgUnitLocations;\r\n };\r\n\r\n const onQuantityChange = async (newValue: number) => {\r\n const cartState = await getCartState(context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (isProductBundles && isBundlesModal) {\r\n if (!cl) {\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n return;\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(\r\n { callerContext: context.actionContext, queryResultSettings: {} },\r\n [product.RecordId]\r\n );\r\n const emailDeliveryModeCode = 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: 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 = 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: 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(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.addProductToCart({ product: simpleProduct, count: diffInQuantity, location: storeLocation.OrgUnitAvailability?.OrgUnitLocation, deliveryMode: cncOption?.Code })\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n }).catch(e => {});\r\n }\r\n } else {\r\n cartState.addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n }).catch(e => {});\r\n }\r\n } else if (diffInQuantity < 0) {\r\n cartLineQuantityUpdatedAsync(\r\n true,\r\n cartState,\r\n context.actionContext.telemetry,\r\n [simpleProduct],\r\n cl,\r\n newValue\r\n )\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n return true;\r\n }\r\n return false;\r\n }).catch(e => { });\r\n }\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n }\r\n return;\r\n }\r\n if (isProductBundles && isNotificationModal) {\r\n if (!cl) {\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n return;\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(\r\n { callerContext: context.actionContext, queryResultSettings: {} },\r\n [product.RecordId]\r\n );\r\n const emailDeliveryModeCode = 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: 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\r\n const cookies = 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: 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(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.addProductToCart({ product: simpleProduct, count: diffInQuantity, location: storeLocation.OrgUnitAvailability?.OrgUnitLocation, deliveryMode: cncOption?.Code })\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n }).catch(e => {});\r\n }\r\n } else {\r\n cartState.addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }).catch(e => { });\r\n }\r\n } else if (diffInQuantity < 0) {\r\n cartLineQuantityUpdatedAsync(\r\n true,\r\n cartState,\r\n context.actionContext.telemetry,\r\n [simpleProduct],\r\n cl,\r\n newValue\r\n )\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n return true;\r\n }\r\n return false;\r\n }).catch(e => { });\r\n }\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n }\r\n return;\r\n }\r\n const cookies = context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection = cookies.get(isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const updatedProducts: IDobbiesAddedProductToBundle[] = [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (obj['productId'] === product.RecordId) {\r\n const valueToBeUpdated = newValue;\r\n if (valueToBeUpdated > 0) {\r\n updatedProducts.push({ productId: obj['productId'], price: obj['price'], quantity: valueToBeUpdated, maxQuantity: maxQuantityForBundle, inventoryLocationId: obj['inventoryLocationId'] });\r\n }\r\n } else {\r\n updatedProducts.push({ productId: obj['productId'], price: obj['price'], quantity: obj['quantity'], maxQuantity: obj['maxQuantity'], inventoryLocationId: obj['inventoryLocationId'] });\r\n }\r\n }\r\n const cookieName = isNotificationModal ? 'notification_added_products' : 'added_products_bundles';\r\n cookies.set(cookieName, updatedProducts);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n };\r\n\r\n const checkboxClicked = () => {\r\n if (isProductAddedToBundles) {\r\n deSelectProduct();\r\n } else if (onBundleProductCheckBoxSelected) {\r\n onBundleProductCheckBoxSelected(product.RecordId);\r\n }\r\n }\r\n\r\n React.useEffect(() => {\r\n getCartData();\r\n setUpdatedProductPrice(product.Price);\r\n\r\n productImageRef.current?.addEventListener('contextmenu', e => {\r\n e.preventDefault();\r\n });\r\n }, []);\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component. */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n //VSI CUSTOMIZATION -START - Check current loyalty tier id.\r\n const getTierId = () => {\r\n if (loyalty!?.LoyaltyGroups!?.length > 0) {\r\n const highestActiveLoyaltyCardTier = loyalty!.LoyaltyGroups![0]?.HighestActiveLoyaltyCardTier;\r\n const loyaltyCardTiers = loyalty!.LoyaltyGroups![0]?.LoyaltyCardTiers;\r\n const loyaltyCardTier = loyaltyCardTiers?.find(tier => tier.RecordId === highestActiveLoyaltyCardTier);\r\n return loyaltyCardTier?.LoyaltyTierRecordId;\r\n }\r\n return undefined;\r\n };\r\n //VSI CUSTOMIZATION -END\r\n const checkClubPlusDiscounts =\r\n discountLine && discountLine.length > 0 && discountLine?.find(x => x.OfferId === context.app.config.discountId);\r\n const checkUserLoyalty = getTierId() === context.app.config.LoyaltyTierId ? true : undefined;\r\n // cartData && cartData.AffiliationLines && cartData.AffiliationLines.find(x => x.LoyaltyTierId === context.app.config.LoyaltyTierId);\r\n // const checkNonClubPlusDiscounts = discountLine && discountLine.find(x => x.OfferId !== context.app.config.discountId);\r\n const membershipDiscount = discountLine && discountLine.find(x => x.OfferId === context.app.config.membershipDiscountId);\r\n //VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip\r\n const outOfSeason =\r\n product.AttributeValues?.find(attr => attr.Name?.toLocaleLowerCase() === 'outofseason')?.TextValue?.toLowerCase() === 'yes';\r\n const getImgContainer = () => {\r\n if (!(typeName === 'dobbies-search-result-container' || images.isPrimaryUrl === false)) {\r\n return (\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context.request.apiSettings\r\n )}\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context.request.apiSettings\r\n )}\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n images.primaryUrl,\r\n product.Name,\r\n context.request.apiSettings\r\n )}\r\n
\r\n );\r\n };\r\n //VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip\r\n return (\r\n product.ItemId ?\r\n
setIsHover(true)} onMouseLeave={() => setIsHover(false)}>\r\n \r\n
\r\n
\r\n {isProductBundles &&\r\n
\r\n { checkboxClicked() }} />\r\n \r\n
\r\n }\r\n \r\n {/* //VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip */}\r\n {getImgContainer()}\r\n {/* //VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip */}\r\n \r\n\r\n \r\n
\r\n\r\n {isHover && quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n\r\n {(isHover || isMobile) && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n\r\n
\r\n \r\n \r\n {/*

{product.Name}

*/}\r\n

{getProductName(product, product.Name!)}

\r\n\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n checkUserLoyalty && membershipDiscount ? product.BasePrice : nonClubPlusDiscount?.AdjustedPrice!,\r\n checkUserLoyalty && membershipDiscount ? product.Price : nonClubPlusDiscount?.CustomerContextualPrice!,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n checkUserLoyalty && membershipDiscount ? discountLine : nonClubPlusDiscount?.DiscountLines,\r\n cartData,\r\n updatedProductPrice,\r\n getTierId,\r\n checkClubPlusDiscounts\r\n )}\r\n {/* {renderDescription(product.Description)} */}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n\r\n {/*do not show delivery and C&C icons on plp*/}\r\n {showDeliveryIcons && (\r\n
\r\n {product!.isHomeDelivery ? (\r\n
\r\n ) : (\r\n
\r\n )}\r\n {(!product!.isHomeDelivery && outOfSeason) ?
: product!.isCnC ?
:
}\r\n
\r\n )}\r\n
\r\n
\r\n {isProductBundles &&\r\n
\r\n \r\n \r\n
\r\n }\r\n
\r\n {checkClubPlusDiscounts && checkUserLoyalty && (\r\n
\r\n

Club Plus Price

\r\n

£{product.Price.toFixed(2)}

\r\n
\r\n )}\r\n {checkClubPlusDiscounts && checkUserLoyalty === undefined && (\r\n
\r\n {product.clubPlusBanner && (\r\n
\r\n
hideBanner && hideBanner(product.RecordId)} className='product-card-club-plus-cross'>
\r\n

\r\n {/* Join Dobbies Club Plus for just £12 a year and enjoy 10% off on plants, bulbs and Seeds.{' '} */}\r\n Join Club Plus and save 10% on plants, bulbs and seeds all year round\r\n \r\n {' '}\r\n Find out more\r\n \r\n

\r\n
\r\n )}\r\n
\r\n

Club Plus Price

\r\n

£{product.Price.toFixed(2)}

\r\n
showBanner && showBanner(product.RecordId)} className='product-card-club-plus-icon'>\r\n

?

\r\n
\r\n
\r\n
\r\n )}\r\n
\r\n
: <>\r\n );\r\n};\r\n\r\nfunction getProductName(product: IProductWithModes | undefined, productName: string): string | undefined {\r\n let prodName = '';\r\n //debugger;\r\n if ((product && product.AttributeValues === undefined) || (product && product.AttributeValues?.length == 0)) {\r\n prodName = productName;\r\n } else {\r\n if (product && product.AttributeValues) {\r\n product.AttributeValues?.map((val: AttributeValue) => {\r\n if (val.Name === 'EComName' && val.TextValue !== '') {\r\n prodName = val.TextValue!;\r\n } else {\r\n prodName = productName;\r\n }\r\n });\r\n } \r\n }\r\n return prodName;\r\n}\r\n\r\nfunction renderLabel(name?: string, price?: string, rating?: number, ratingAriaLabel?: string): string {\r\n name = name || '';\r\n price = price || '';\r\n return `${name} ${price} ${getRatingAriaLabel(rating, ratingAriaLabel)}`;\r\n}\r\n\r\n// function renderDescription(description?: string): JSX.Element | null {\r\n// return

{description}

;\r\n// }\r\n\r\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\r\n if (rating && ratingAriaLabel) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabel || '', roundedRating, '5');\r\n }\r\n return '';\r\n}\r\n\r\nfunction updateProductUrl(productUrl: string, context: ICoreContext): string {\r\n const srcUrl = new URL(productUrl, context.request.apiSettings.baseUrl);\r\n const queryString = `back=true`;\r\n if (srcUrl.search) {\r\n srcUrl.search += `&${queryString}`;\r\n } else {\r\n srcUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(srcUrl.href);\r\n return updatedUrl.pathname + srcUrl.search;\r\n}\r\n\r\nfunction renderRating(\r\n context: ICoreContext<{\r\n [x: string]: any;\r\n }>,\r\n typeName: string,\r\n id: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string\r\n): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n // display empty box to match the design of when rating isnt there on product component\r\n }\r\n\r\n const minNumOfStars = context.app.config.numberOfStarReviewsToShow;\r\n if (minNumOfStars && avgRating && avgRating < minNumOfStars) {\r\n return <>;\r\n }\r\n\r\n const numRatings = (totalRatings && totalRatings.toString()) || undefined;\r\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n basePrice?: number,\r\n adjustedPrice?: number,\r\n savingsText?: string,\r\n freePriceText?: string,\r\n originalPriceText?: string,\r\n currentPriceText?: string,\r\n discountLine?: DiscountLine[] | undefined,\r\n cartData?: Cart | undefined,\r\n updatedPrice?: number,\r\n getTierId?: () => number | undefined,\r\n clubPlusDiscountsOfferId?: DiscountLine | undefined | false\r\n): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n//VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip\r\nasync function validateMediaLocaionAsync(uri: string): Promise<[IImageData, boolean]> {\r\n const imageData = {\r\n src: uri || '',\r\n altText: ''\r\n };\r\n if (imageData.src === '') {\r\n return [imageData, false];\r\n }\r\n return new Promise<[IImageData, boolean]>(resolve => {\r\n try {\r\n const http = new XMLHttpRequest();\r\n http.open('HEAD', imageData.src, true);\r\n http.addEventListener('load', () => {\r\n resolve([imageData, http.status === 200 || http.status === 201]);\r\n });\r\n http.addEventListener('error', () => {\r\n resolve([imageData, false]);\r\n });\r\n http.send();\r\n } catch {\r\n resolve([imageData, false]);\r\n }\r\n });\r\n}\r\n//VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string,\r\n apiSettings?: ICommerceApiSettings\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings || !apiSettings) {\r\n return null;\r\n }\r\n\r\n const newImageUrl = generateImageUrl(imageUrl, apiSettings);\r\n\r\n const img: IImageData = {\r\n src: newImageUrl ? newImageUrl : '',\r\n altText: altText ? altText : ''\r\n };\r\n const imageProps = {\r\n gridSettings: gridSettings,\r\n imageSettings: imageSettings\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n\r\n // debugger;\r\n return ;\r\n}\r\n\r\n// @ts-ignore\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;\r\n","import classnames from 'classnames';\r\nimport * as React from 'react';\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\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, DiscountLine, Cart } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n discountLine?: DiscountLine[] | undefined;\r\n cartData?: Cart;\r\n updatedPrice?: number;\r\n currencyCode?: string;\r\n getTierId?: () => number | undefined;\r\n clubPlusDiscountsOfferId?: DiscountLine | undefined | false;\r\n}\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst Price: React.FC = (props: IPriceComponentProps) => {\r\n // CustomerContextualPrice could be 0\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n\r\n //loyalty &&\r\n\r\n return (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n \r\n );\r\n};\r\n\r\nconst showStrikethroughPricing = (props: IPriceComponentProps) => {\r\n const originalPrice = getOriginalPrice(props);\r\n\r\n if (originalPrice && props.data.price.CustomerContextualPrice) {\r\n return originalPrice > props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst getOriginalPrice = (props: IPriceComponentProps) => {\r\n return Math.max(props.data.price.BasePrice || 0, props.data.price.TradeAgreementPrice || 0, props.data.price.AdjustedPrice || 0);\r\n};\r\n\r\nconst renderCurrentPrice = (props: IPriceComponentProps, clubPlusDiscountsOfferId?: DiscountLine, checkUserLoyalty?: boolean): JSX.Element | undefined => {\r\n const initialPrice = formatCurrency(props, props.data.price.CustomerContextualPrice);\r\n return (\r\n \r\n {initialPrice}\r\n \r\n );\r\n};\r\n\r\nconst formatCurrency = (props: IPriceComponentProps, price: number | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price, props.currencyCode);\r\n};\r\n\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element | null => {\r\n const originalPrice = getOriginalPrice(props);\r\n const initialPrice = formatCurrency(props, originalPrice);\r\n\r\n const checkClubPlusDiscounts = props.discountLine && props.discountLine.find(x => x.OfferId === props.context.app.config.discountId);\r\n const checkUserLoyalty = props.getTierId && props.getTierId() === props.context.app.config.LoyaltyTierId ? true : undefined;\r\n // props.cartData &&\r\n // props.cartData.AffiliationLines &&\r\n // props.cartData.AffiliationLines.find(x => x.LoyaltyTierId === props.context.app.config.LoyaltyTierId);\r\n const checkNonClubPlusDiscounts = props.discountLine && props.discountLine.find(x => x.OfferId !== props.context.app.config.discountId);\r\n\r\n const clubPlusFormatCurrency = (\r\n props: IPriceComponentProps,\r\n price: number | undefined,\r\n nonClubPlusPrice: number | undefined\r\n ): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n if (price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n if (nonClubPlusPrice === undefined) {\r\n return undefined;\r\n }\r\n if (nonClubPlusPrice === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(nonClubPlusPrice, props.context.request.channel?.Currency);\r\n };\r\n\r\n const renderClubPlusCurrentPrice = (props: IPriceComponentProps): JSX.Element | undefined => {\r\n const initialPrice = clubPlusFormatCurrency(props, props.data.price.CustomerContextualPrice, props.updatedPrice);\r\n return (\r\n \r\n {initialPrice}\r\n \r\n );\r\n };\r\n\r\n return (\r\n <>\r\n {checkClubPlusDiscounts && checkUserLoyalty ? (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n\r\n \r\n \r\n ) : checkClubPlusDiscounts && checkNonClubPlusDiscounts && checkUserLoyalty === undefined ? (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n \r\n \r\n {/* VSI - Customization - End */}\r\n {props.savingsText && {props.savingsText}}\r\n \r\n ) : checkClubPlusDiscounts && checkUserLoyalty === undefined ? (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n\r\n \r\n \r\n ) : (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n \r\n {props.clubPlusDiscountsOfferId && checkUserLoyalty ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {/* VSI - Customization - End */}\r\n {props.savingsText && {props.savingsText}}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\n// @ts-ignore\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Price',\r\n { component: Price, ...PriceComponentActions }\r\n);\r\n\r\nexport default PriceComponent;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CartLine,\n CartLineValidationResults,\n CartLineValidationResultsByLineId,\n CartsDataActions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\n\nimport { ITelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Validate the cart.\n * @param isQuantityLimitsFeatureEnabled -- Is the quantity limits feature enabled.\n * @param cart -- The cart state to validate.\n * @param telemetry -- The telemetry.\n * @param propsContext -- The props context.\n * @param shouldRetry -- Should retry.\n * @returns A list of line data validation failures.\n */\nexport async function validateCartAsync(\n cart: AsyncResult,\n telemetry: ITelemetry,\n propsContext: ICoreContext,\n shouldRetry: boolean = true\n): Promise {\n let cartResult: ICartState;\n let cartVersion: number | undefined;\n try {\n cartResult = await cart;\n cartVersion = cartResult.cart.Version;\n } catch (error) {\n telemetry.warning(error);\n telemetry.debug('Unable to get cart or cart version.');\n return AsyncResult.resolve();\n }\n\n if (cartVersion) {\n try {\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\n { callerContext: propsContext.actionContext, bypassCache: 'none' },\n cartResult.cart.Id,\n cartVersion\n );\n\n return await AsyncResult.resolve(validationResult.ValidationResultsByLineId ?? undefined);\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- error type is not defined.\n if (shouldRetry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n try {\n await cartResult.refreshCart({});\n } catch (refreshError) {\n telemetry.warning(refreshError);\n telemetry.debug('Unable to refresh Cart');\n return AsyncResult.resolve();\n }\n try {\n await validateCartAsync(cart, telemetry, propsContext, false);\n return AsyncResult.resolve();\n } catch (validateError) {\n telemetry.warning(validateError);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n }\n\n telemetry.warning(error);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n } else {\n telemetry.warning('Cart version not found for Cart validation request.');\n return AsyncResult.resolve();\n }\n}\n\n/**\n * Check if cart line quantity update is success.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function isCartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number\n): Promise {\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find(\n (product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId\n );\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult.status === 'SUCCESS');\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve(false);\n}\n\n/**\n * Update cart line with cart action result.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function cartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number\n): Promise {\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find(\n (product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId\n );\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult);\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve();\n}\n"],"names":["CartModulesStateShareInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","async","updateCartStateAction","input","ctx","isCartUpdated","undefined","isQuantityUpdated","createObservableDataAction","action","inputData","GetAllOrgUnitLocationsByAreaInput","_Latitude","_Longitude","_Radius","_DistanceUnitValue","_IgnoreLocation","this","Latitude","Longitude","Radius","DistanceUnitValue","IgnoreLocation","createGetOrgUnitLocationsByAreaInput","getFeatureState","context","getFeatureStateActionDataAction","FeatureStateInput","getAllOrgUnitLocationsByArea","_featureState$find","searchArea","featureState","retailMulitplePickupMFeatureState","find","item","Name","IsEnabled","getOrgUnitLocationsByAreaAsync","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","then","locationDeliveryOptions","orgUnitChannel","stores","map","store","ChannelId","channelCollection","length","channelIdList","id","push","getChannelDeliveryOptionsAsync","channelDeliveryOptions","Error","catch","error","trace","message","telemetry","exception","debug","_getLocationPickUpDeliveryModes","locationPromiseList","_locationDeliveryOpti","locationDeliveryOption","_channeldeliveryoption","orgUnitLocation","channelDeleiveryOptions","OrgUnitNumber","OrgUnitAvailability","getStoreHoursAsync","hours","availability","OrgUnitLocation","OrgUnitPickUpDeliveryModes","StoreHours","_getLocationWithHours","Promise","all","getOrgUnitLocationsByAreaDataAction","featureNames","createGetFeatureStateInput","getFeatureStateAction","getFeatureStatesAsync","Quantity","React","props","super","inputRef","_validateMin","minValue","min","isNaN","state","currentInput","onChange","currentCount","_onIncrement","bind","_onDecrement","_handleChange","componentDidMount","reaction","setState","componentDidUpdate","render","glyphMinusClassName","decrementGlyphClass","glyphPlusClassName","incrementGlyphClass","disabled","incDisabled","max","currentValue","extraClass","extraClassInc","className","hideQuantityControls","title","decrementButtonAriaLabel","onClick","tabIndex","color","type","pattern","value","onBlur","inputQuantityAriaLabel","role","ref","disabledInput","incrementButtonAriaLabel","invokeCallback","currQuantity","updatedQuantity","e","parseInt","target","inputElement","current","HTMLInputElement","debounce","setAttribute","toString","defaultProps","__decorate","observer","getProductName","product","productName","_product$AttributeVal2","prodName","_product$AttributeVal3","AttributeValues","val","TextValue","renderLabel","name","price","rating","ratingAriaLabel","getRatingAriaLabel","roundedRating","toFixed","format","renderProductPlacementImage","imageSettings","gridSettings","imageUrl","altText","apiSettings","newImageUrl","generateImageUrl","img","src","imageProps","cropFocalRegion","Image","Object","assign","loadFailureBehavior","ProductComponent","msdyn365Commerce","createComponentOverride","_objectSpread","component","_ref","_data$product","_product$AttributeVal","_context$request$chan","data","savingsText","freePriceText","originalPriceText","currentPriceText","allowBack","typeName","telemetryContent","quickViewButton","wishlists","discountLine","badgeLink","showBanner","hideBanner","showDeliveryIcons","IsMasterProduct","isMobile","loyalty","nonClubPlusDiscount","isProductAddedToBundles","maxQuantityForBundle","redirectToCartEnabled","isProductBundles","isBundlesModal","simpleProduct","onQuantityChangeListener","onBundleProductCheckBoxSelected","isNotificationModal","cartData","setCartData","updatedProductPrice","setUpdatedProductPrice","isHover","setIsHover","useState","productImageRef","useRef","currBundleQuantity","setCurrBundleQuantity","images","setImages","isPrimaryUrl","primaryUrl","_cookies$get","getCartState","actionContext","cartState","_cartState$cart","cartlines","cart","CartLines","cl","ProductId","RecordId","update","_cartState$cart2","addedProductsToCollection","requestContext","cookies","get","Array","isArray","obj","resetQuantity","_cartState$cart$CartL","c","fullImgUrl","request","baseImageUrl","ItemId","uri","imageData","resolve","http","XMLHttpRequest","open","addEventListener","status","send","_unused","validateMediaLocaionAsync","result","productUrl","getProductPageUrlSync","srcUrl","URL","baseUrl","queryString","search","href","pathname","updateProductUrl","getCartData","getCartFromCustomer","_cartState$cart$CartL2","resetQuantityOnLoad","_getAllStores","latitude","longitude","radius","distanceUnitValue","orgUnitLocationsInput","checkboxClicked","_cartState$cart$CartL3","_cookies$get2","cartlineToRemove","cartLineIds","LineId","removeCartLines","productsAddedInBundles","i","updatedProductsAddedInBundles","prod","dobbiesProductData","productId","quantity","maxQuantity","cookieName","set","deSelectProduct","_productImageRef$curr","Price","preventDefault","payLoad","getPayloadObject","attribute","getTelemetryAttributes","getTierId","_loyalty$LoyaltyGroup","LoyaltyGroups","_loyalty$LoyaltyGroup2","_loyalty$LoyaltyGroup3","highestActiveLoyaltyCardTier","HighestActiveLoyaltyCardTier","loyaltyCardTiers","LoyaltyCardTiers","loyaltyCardTier","tier","LoyaltyTierRecordId","checkClubPlusDiscounts","x","OfferId","app","config","discountId","checkUserLoyalty","LoyaltyTierId","membershipDiscount","membershipDiscountId","outOfSeason","attr","_attr$Name","toLocaleLowerCase","toLowerCase","onMouseOver","onMouseLeave","onTelemetryClick","cultureFormatter","formatCurrency","channel","Currency","AverageRating","style","position","checked","xmlns","width","height","viewBox","d","stroke","fill","display","outline","PrimaryImageUrl","VsiProductBadges","productComponentProduct","moduleType","badgePageType","plp","quickview","selectedProductId","renderQuickView","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","basePrice","adjustedPrice","updatedPrice","clubPlusDiscountsOfferId","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","renderPrice","DiscountLines","hideRating","avgRating","totalRatings","ariaLabel","minNumOfStars","numberOfStarReviewsToShow","numRatings","RatingComponent","ratingCount","readOnly","renderRating","TotalRatings","isHomeDelivery","isCnC","_cartState$cart$CartL4","_cookies$get3","newValue","_context$actionContex","diffInQuantity","deliveryOptions","getDeliveryOptionsAsync","emailDeliveryModeCode","EmailDeliveryModeCode","addProductToCartInput","enableStockCheck","availableQuantity","isAddEmailDeliveryItemToCart","ArrayExtensions","hasElements","DeliveryOptions","Code","cncProducts","includes","_storeLocation$OrgUni","cncOption","dopt","_dopt$DeliveryOptions","delOpt","storeLocation","sl","_sl$OrgUnitAvailabili","InventoryLocationId","FulfillmentStoreId","_storeLocation$OrgUni2","_cncOption","addProductToCart","count","location","deliveryMode","cartLineQuantityUpdatedAsync","cartActionResult","_context$actionContex2","_storeLocation$OrgUni3","_dopt$DeliveryOptions2","_sl$OrgUnitAvailabili2","_storeLocation$OrgUni4","_cncOption2","updatedProducts","valueToBeUpdated","inventoryLocationId","clubPlusBanner","showStrikethroughPricing","originalPrice","getOriginalPrice","Math","TradeAgreementPrice","renderCurrentPrice","initialPrice","itemProp","currencyCode","renderCurrentPriceWithOriginalPrice","checkNonClubPlusDiscounts","clubPlusFormatCurrency","nonClubPlusPrice","_props$context$reques","renderClubPlusCurrentPrice","classnames","validateCartAsync","propsContext","cartResult","cartVersion","shouldRetry","arguments","Version","warning","AsyncResult","_validationResult$Val","validationResult","CartsDataActions","bypassCache","Id","ValidationResultsByLineId","refreshCart","refreshError","validateError","isQuantityLimitsFeatureEnabled","products","cartLineToUpdate","isUsingDefaultOrderSettingsMax","_modifiedProduct$Beha2","modifiedProduct","Behavior","MaximumQuantity","cartLineId","newQuantity","additionalProperties","updateLineResult","updateCartLineQuantity"],"sourceRoot":""}