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4BhL,EAAciL,EAAaC,GAC5E,GAAkB,OAAdF,EACA,OAEJ,MAAMG,EAAyC/E,EAAoBgF,YAAY3C,KAAsBS,IAC1F,CACHmC,oBAAoBC,EAAAA,EAAAA,4CAA2CpC,EAASzC,eACxE8E,eAAgB,CACZxG,SAAU,EACVP,MAAO0E,EAASrC,WAI5B,OAAOjL,IAAAA,aAAmBoP,EAAiC,CAAEQ,kBAAmBxL,EAAMmL,mBAAAA,EAAmBM,QAASR,EAAOS,iBAAkBR,EAAcS,sBAAuBzH,IA+ExJ0H,CAAgB/H,EAAiB5I,EAAQ8J,SAAS9J,EAAQgQ,OAAOhQ,EAAQyQ,kBAC5F5H,GA/UZ,SACGA,EACA7I,EACA4Q,GAEA,OAAOjQ,IAAAA,aAAmBkI,EAA+C,CAAE7I,QAAAA,EAAS4Q,UAAAA,IA0UhDC,CAA8BhI,EAAyB7I,GAAS8Q,EAAAA,EAAAA,IAAarR,EAAQ8F,WA3Q7H,IAAmCuK,GA8HEvC,KA3MP,KAyc9B","sources":["webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/components/price.components.tsx?185a","webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/components/product.component.tsx?4ade"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductType, SalesAgreementPriceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { Button, format, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nconst defaultPrice: number = 0;\nconst freePrice: number = 0;\n\n/**\n * Interface for price component resources.\n * @param {string} priceRangeSeparator - The price range separator.\n */\nexport interface IPriceComponentResources {\n priceRangeSeparator?: string;\n salesAgreementPricePrompt?: string;\n salesAgreementExpirationDatePrompt?: string;\n salesAgreementCommittedQuantityPrompt?: string;\n salesAgreementRemainingQuantityPrompt?: string;\n}\n\n/**\n * Interface for price component props.\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\n * @param {IPriceComponentResources} priceResources - The price range resources.\n */\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\n className?: string;\n product?: SimpleProduct;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n isPriceMinMaxEnabled?: boolean;\n isSalesAgreementPriceFeatureEnabled?: boolean;\n salesAgreementLineId?: number;\n priceResources?: IPriceComponentResources;\n salesAgreementDetailCollapseProps?: ICollapseProps;\n currencyCode?: string;\n salesAgreementDetailOnClick?(event: React.MouseEvent | React.KeyboardEvent): void;\n}\n\n/**\n * The interface of price component.\n */\nexport interface IPriceComponent extends IComponent {}\n\nconst priceComponentActions = {};\n\n/**\n * Get the original price from price component props.\n * @param props - The IPriceComponentProps.\n * @returns The original price.\n */\nconst getOriginalPrice = (props: IPriceComponentProps): number => {\n return props.data.price.AdjustedPrice ?? props.data.price.TradeAgreementPrice ?? props.data.price.BasePrice ?? defaultPrice;\n};\n\nconst getActivePrice = (props: IPriceComponentProps): number => {\n if (showPriceRangeForMasterProduct(props) && props.data.price.MinVariantPrice !== undefined) {\n return props.data.price.MinVariantPrice;\n }\n\n if (props.data.price.CustomerContextualPrice !== undefined) {\n return props.data.price.CustomerContextualPrice;\n }\n\n return getOriginalPrice(props);\n};\n\n/**\n * Get the formatted currency.\n * @param props - The props.\n * @param price - The price.\n * @param shouldUseFreePriceText - The shouldUseFreePriceText.\n * @returns The formatted currency.\n */\nconst formatCurrency = (\n props: IPriceComponentProps,\n price: number | undefined,\n shouldUseFreePriceText: boolean | undefined,\n currencyCode?: string | undefined\n): string => {\n if (price === undefined) {\n return '';\n }\n\n if (shouldUseFreePriceText && price === freePrice && props.freePriceText) {\n return props.freePriceText;\n }\n\n return props.context.cultureFormatter.formatCurrency(price, currencyCode);\n};\n\nconst showPriceRangeForMasterProduct = (props: IPriceComponentProps): boolean => {\n return (\n (props.isPriceMinMaxEnabled ?? false) &&\n (props.product?.ProductTypeValue === ProductType.Master || props.product?.ProductTypeValue === ProductType.KitMaster) &&\n props.data.price.MinVariantPrice !== undefined &&\n props.data.price.MaxVariantPrice !== undefined\n );\n};\n\n/**\n * ShowStrikethroughPricing.\n * @param props - The props.\n * @returns True if showStrikethroughPricing, false otherwise.\n */\nconst showStrikethroughPricing = (props: IPriceComponentProps): boolean => {\n const originalSalesPrice = getOriginalPrice(props);\n const activeSalesPrice = showPriceRangeForMasterProduct(props)\n ? props.data.price.MinVariantPrice\n : props.data.price.CustomerContextualPrice;\n\n if (activeSalesPrice && originalSalesPrice) {\n return activeSalesPrice < originalSalesPrice;\n }\n\n return false;\n};\n\n/**\n * Render current price.\n * @param props - The props.\n * @returns The JSX.Element.\n */\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element => {\n const maxVariantPrice: string = formatCurrency(props, props.data.price.MaxVariantPrice, false, props.currencyCode);\n const minVariantPrice: string = formatCurrency(props, props.data.price.MinVariantPrice, false, props.currencyCode);\n if (\n props.isPriceMinMaxEnabled &&\n props.data.price.MaxVariantPrice &&\n props.data.price.MinVariantPrice &&\n props.data.price.MaxVariantPrice > props.data.price.MinVariantPrice\n ) {\n return (\n \n \n {minVariantPrice}\n \n \n {props.priceResources?.priceRangeSeparator}\n \n \n {maxVariantPrice}\n \n \n );\n }\n\n return (\n \n {formatCurrency(props, getActivePrice(props), true, props.currencyCode)}\n \n );\n};\n\n/**\n * Render active sales price with original sales price.\n * @param props - The props.\n * @returns The JSX.Element.\n */\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element => {\n const initialPrice: string = formatCurrency(props, getOriginalPrice(props), true);\n\n return (\n <>\n \n {` `}\n {props.originalPriceText}\n {` `}\n {initialPrice}\n {` `}\n {props.currentPriceText}\n {` `}\n {renderCurrentPrice(props)}\n \n \n {props.savingsText && {props.savingsText}}\n \n );\n};\n\nconst renderSalesAgreementDetail = (props: IPriceComponentProps): JSX.Element => {\n // In most cases there should be only one sales agreement line.\n // If there are more than one, only the first one will be shown.\n const firstPriceLine: SalesAgreementPriceLine = (props.data.price.AttainablePriceLines ?? [])[0] as SalesAgreementPriceLine;\n return (\n

\n

\n {/* Available date */}\n {` · ${format(\n props.priceResources?.salesAgreementExpirationDatePrompt ?? '',\n props.context.cultureFormatter.formatDate(firstPriceLine.EffectiveDate as Date),\n props.context.cultureFormatter.formatDate(firstPriceLine.ExpirationDate as Date)\n )}`}\n

\n

\n {/* Quantity commitment */}\n {` · ${format(props.priceResources?.salesAgreementCommittedQuantityPrompt ?? '', firstPriceLine.CommittedQuantity)}`}\n

\n

\n {/* Remaining quantity to qualify */}\n {` · ${format(props.priceResources?.salesAgreementRemainingQuantityPrompt ?? '', firstPriceLine.RemainingQuantity)}`}\n

\n

\n );\n};\n\n/**\n * Price.\n * @param props - The props.\n * @returns The JSX.Element.\n */\nconst Price: React.FC = (props: IPriceComponentProps): JSX.Element | null => {\n // CustomerContextualPrice could be zero\n if (props.data.price.CustomerContextualPrice === undefined) {\n return null;\n }\n\n // Determine if contract price is avaiable/applied by:\n // isFeatureEnabled and SA price != 0, for PDP.\n // SA line id != 0, for cart line.\n if (props.isSalesAgreementPriceFeatureEnabled && props.data.price.SalesAgreementPrice !== 0) {\n const [isExpanded, setIsExpanded] = React.useState(false);\n const toggle = () => {\n setIsExpanded(!isExpanded);\n };\n return (\n \n \n

\n {formatCurrency(props, props.data.price.SalesAgreementPrice ?? props.data.price.CustomerContextualPrice, true)}\n

\n \n {props.priceResources?.salesAgreementPricePrompt}\n \n {isExpanded && renderSalesAgreementDetail(props)}\n
\n
\n );\n }\n\n return (\n \n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\n \n );\n};\n\n/**\n * The PriceComponent.\n */\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponent('Price', {\n component: Price,\n ...priceComponentActions\n});\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport { IPriceComponentResources, ISwatchItem, ProductComponentSwatchComponent, RatingComponent } from '@msdyn365-commerce/components';\r\nimport { PriceComponent } from './price.components';\r\nimport { getCatalogId, IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, convertDimensionTypeToProductDimensionType, Dictionary, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync, IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\nimport { ProductSearchResults } from '../../../../modules/search-result-container/actions/get-full-products-by-collection';\r\nimport { IGCProductTradeAgreementsEntity } from '../../../../actions/AlternateItemsEntity.g';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResults }> {\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 ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n isEnabledProductDescription?: boolean;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n inventoryLabel?: string;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n isPriceVisible?: boolean;\r\n productAgreement?: IGCProductTradeAgreementsEntity;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\n/**\r\n * Renders product comparison button similar to the quick view button.\r\n * @param productComparisonButton - React element of the button.\r\n * @param product - Current product info.\r\n * @param catalogId - Current catalog.\r\n * @returns React element for the specific product.\r\n */\r\n function renderProductComparisonButton(\r\n productComparisonButton: React.ReactNode,\r\n product: ProductSearchResult,\r\n catalogId: number\r\n): JSX.Element | undefined {\r\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\r\n}\r\n\r\n/**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\nfunction getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!colorAttribute) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute.Swatches?.find(item => item.IsDefault === true) ?? colorAttribute.Swatches?.[0];\r\n return defaultSwatch ?? null;\r\n}\r\n\r\n/**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\nfunction getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productData?.PrimaryImageUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n}\r\n\r\n/**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\nfunction updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n}\r\n\r\n/**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\nfunction renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n \r\n {inventoryAvailabilityLabel}\r\n \r\n
\r\n );\r\n}\r\n\r\n/**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\nfunction getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productUrl;\r\n }\r\n\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n}\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 ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n productComparisonButton,\r\n isEnabledProductDescription,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n inventoryLabel,\r\n dimensionAvailabilities,\r\n isPriceVisible,\r\n productAgreement\r\n}) => {\r\n const product = data.product;\r\n const discount = Number(product?.ExtensionProperties?.find(f=>f.Key===\"PRODUCTDISCOUNT\")?.Value?.StringValue);\r\n const ProductDiscPrice =product && product.Price -(discount && discount > 0 ?discount:0);\r\n let productUrl = getProductPageUrlSync(product?.Name ?? '', product?.RecordId ?? Number.MIN_VALUE, context.actionContext, undefined);\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl = productPageUrlFromSwatch, setProductPageUrl] = useState();\r\n const [productImageUrl = productImageUrlFromSwatch, setProductImageUrl] = useState();\r\n const [selectedSwatchItems] = useState(new Dictionary());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = context.app.config.enableStockCheck;\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n selectedSwatchItems.setValue(dimensionType, swatchItem);\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [selectedSwatchItems, context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Checks if rendering the particular dimensions is allowed for product card.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @returns Updates the state with new product page url.\r\n */\r\n function shouldDisplayDimension(dimensionType: string): boolean {\r\n const dimensionsContext = context as ICoreContext;\r\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes);\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @param attributeValues - Attribute value property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\r\n if (!attributeValues) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n {\r\n attributeValues.map((item: AttributeValue) => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n if (!shouldDisplayDimension(dimensionTypeValue)) {\r\n return null;\r\n }\r\n\r\n const siteContext = context as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault,\r\n isDisabled: enableStockCheck && dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? ''))?.isDisabled\r\n };\r\n }) ?? [];\r\n if (dimensionToPreSelectInProductCard !== DimensionTypes.none && ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return (\r\n \r\n );\r\n })\r\n }\r\n
\r\n );\r\n }\r\n\r\n function renderQuickView(quickview: React.ReactNode, item?: number,ETAVal?: any,alternateItem?: any): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map(swatches => {\r\n return {\r\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: swatches.value\r\n }\r\n };\r\n });\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions,ETAData: ETAVal,AlternateItemRep: alternateItem,productTradeAgreement: productAgreement});\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 let isActive = true;\r\n let prodDescription: string = '';\r\n if(typeof product !== 'undefined')\r\n {\r\n if(typeof product.ExtensionProperties !== 'undefined')\r\n {\r\n const isActiveProps = product.ExtensionProperties.filter(x=> x.Key === 'IsActive');\r\n if(isActiveProps && isActiveProps[0] && isActiveProps[0].Value !== undefined)\r\n {\r\n isActive= isActiveProps[0].Value.BooleanValue !== undefined ? isActiveProps[0].Value.BooleanValue : true;\r\n }\r\n\r\n const productDescriptionProp = product.ExtensionProperties.filter(x=> x.Key === 'GCProductDescription');\r\n if(productDescriptionProp && productDescriptionProp[0] && productDescriptionProp[0].Value !== undefined)\r\n {\r\n prodDescription= productDescriptionProp[0].Value.StringValue !== undefined ? productDescriptionProp[0].Value.StringValue : '';\r\n }\r\n }\r\n }\r\n let isPriceAvailable = false;\r\n if(product.Price)\r\n {\r\n if(productAgreement && productAgreement.TradeAgreementPrice !== 0)\r\n {\r\n isPriceAvailable = true;\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n {isEnabledProductDescription ? \r\n
\r\n
\r\n {renderProductPlacementImage(imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context)}\r\n
\r\n
\r\n
\r\n {product.Name}\r\n
\r\n {isActive && isPriceAvailable && renderPrice(context, typeName, id, product.BasePrice, ProductDiscPrice, savingsText, freePriceText, originalPriceText, currentPriceText, isPriceMinMaxEnabled, priceResources,isPriceVisible)}\r\n {renderDescription(prodDescription??product.Description)}\r\n
\r\n
\r\n : \r\n
\r\n {renderProductPlacementImage(imageSettings, context.request.gridSettings, productImageUrl, product.PrimaryImageUrl, product.Name, context)}\r\n
\r\n
\r\n
\r\n {product.ItemId}:  {product.Name}\r\n
\r\n {isActive && isPriceAvailable && renderPrice(context, typeName, id, product.BasePrice, ProductDiscPrice, savingsText, freePriceText, originalPriceText, currentPriceText,undefined,undefined,isPriceVisible)}\r\n {renderDescription(prodDescription??product.Description)}\r\n
\r\n }\r\n {renderProductDimensions(product.AttributeValues)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel, ratingCountAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId,product.ETAVal,product.AlternateItemRep)}\r\n {productComparisonButton && renderProductComparisonButton(productComparisonButton, product, getCatalogId(context.request))}\r\n \r\n );\r\n};\r\n\r\nfunction renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n}\r\n\r\nfunction renderDescription(description?: string): JSX.Element | null {\r\n return (

\r\n {description}\r\n

);\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 getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n}\r\n\r\nfunction renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string, ratingCountAriaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nfunction renderPrice(context: ICoreContext, typeName: string, id: string, basePrice?: number, adjustedPrice?: number, savingsText?: string, freePriceText?: string, originalPriceText?: string, currentPriceText?: string, isPriceMinMaxEnabled?: boolean, priceResources?: IPriceComponentResources, isPriceVisible? : boolean): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n return isPriceVisible? (\r\n \r\n ) : ();\r\n}\r\n\r\nfunction renderProductPlacementImage(imageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string,\r\n context?: ICoreContext): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n\r\nexport default ProductComponent;\r\n"],"names":["getOriginalPrice","props","_ref","_ref2","_props$data$price$Adj","data","price","AdjustedPrice","TradeAgreementPrice","BasePrice","formatCurrency","shouldUseFreePriceText","currencyCode","undefined","freePriceText","context","cultureFormatter","showPriceRangeForMasterProduct","_props$isPriceMinMaxE","_props$product","_props$product2","isPriceMinMaxEnabled","product","ProductTypeValue","ProductType","Master","KitMaster","MinVariantPrice","MaxVariantPrice","renderCurrentPrice","maxVariantPrice","minVariantPrice","_props$priceResources","React","className","itemProp","priceResources","priceRangeSeparator","CustomerContextualPrice","getActivePrice","PriceComponent","msdyn365Commerce","createComponent","_objectSpread","component","isSalesAgreementPriceFeatureEnabled","SalesAgreementPrice","_props$data$price$Sal","_props$priceResources8","_props$priceResources9","isExpanded","setIsExpanded","toggle","classnames","Button","salesAgreementPricePrompt","onClick","tabIndex","_props$data$price$Att","_props$priceResources2","_props$priceResources3","_props$priceResources4","_props$priceResources5","_props$priceResources6","_props$priceResources7","firstPriceLine","AttainablePriceLines","format","salesAgreementExpirationDatePrompt","formatDate","EffectiveDate","ExpirationDate","salesAgreementCommittedQuantityPrompt","CommittedQuantity","salesAgreementRemainingQuantityPrompt","RemainingQuantity","renderSalesAgreementDetail","originalSalesPrice","activeSalesPrice","showStrikethroughPricing","initialPrice","originalPriceText","currentPriceText","savingsText","renderCurrentPriceWithOriginalPrice","getDefaultColorSwatchSelected","productData","_colorAttribute$Swatc","_colorAttribute$Swatc2","_colorAttribute$Swatc3","AttributeValues","colorAttribute","find","attributeValue","_attributeValue$KeyNa","KeyName","toLocaleLowerCase","DimensionTypes","color","defaultSwatch","Swatches","item","IsDefault","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","request","apiSettings","baseUrl","search","href","pathname","renderLabel","name","rating","ratingAriaLabelText","reviewCount","ratingCountAriaLabelText","reviewCountArialableText","getReviewAriaLabel","getRatingAriaLabel","renderDescription","description","ratingAriaLabel","roundedRating","toFixed","renderPrice","typeName","id","basePrice","adjustedPrice","isPriceVisible","renderProductPlacementImage","imageSettings","gridSettings","imageUrl","fallbackImageUrl","altText","img","src","fallBackSrc","imageProps","cropFocalRegion","Image","Object","assign","requestContext","actionContext","loadFailureBehavior","ProductComponent","createComponentOverride","_product$ExtensionPro","_product$Name","_product$RecordId","_getProductImageUrlFr","_getProductPageUrlFro","ratingCountAriaLabel","allowBack","telemetryContent","quickViewButton","productComparisonButton","isEnabledProductDescription","inventoryLabel","dimensionAvailabilities","productAgreement","discount","Number","ExtensionProperties","f","Key","Value","StringValue","ProductDiscPrice","Price","productUrl","getProductPageUrlSync","Name","RecordId","MIN_VALUE","productImageUrlFromSwatch","app","config","dimensionToPreSelectInProductCard","none","PrimaryImageUrl","ArrayExtensions","hasElements","ProductImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","SwatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","useState","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","enableStockCheck","updatePageAndImageUrl","swatchItem","dimensionType","setValue","StringExtensions","isNullOrWhitespace","value","productPageUrlWithSwatch","includes","newUrl","searchParams","delete","toString","swatchProductImageUrl","productImageUrls","newImageUrl","payLoad","getPayloadObject","attribute","getTelemetryAttributes","isActive","prodDescription","isActiveProps","filter","x","BooleanValue","productDescriptionProp","isPriceAvailable","onTelemetryClick","AverageRating","TotalRatings","Description","ItemId","attributeValues","map","_item$KeyName$toLocal","_item$KeyName","_item$Swatches$map","_item$Swatches","dimensionTypeValue","dimensionsToDisplayOnProductCard","dimensionsInProductCard","shouldDisplayDimension","swatches","_item$RecordId","_swatchItem$SwatchVal","_swatchItem$SwatchVal2","_dimensionAvailabilit","itemId","colorHexCode","SwatchColorHexCode","SwatchImageUrl","isDefault","isDisabled","dimensionAvailability","_swatchItem$SwatchVal3","some","swatch","ProductComponentSwatchComponent","onSelectDimension","key","hideRating","moduleTypeName","moduleId","avgRating","totalRatings","ariaLabel","numberRatings","RatingComponent","ratingCount","readOnly","renderRating","inventoryAvailabilityLabel","quickview","ETAVal","alternateItem","selectedDimensions","getValues","DimensionTypeValue","convertDimensionTypeToProductDimensionType","DimensionValue","selectedProductId","ETAData","AlternateItemRep","productTradeAgreement","renderQuickView","catalogId","renderProductComparisonButton","getCatalogId"],"sourceRoot":""}